/*! For license information please see application-d5ae6c20bbc5014f8e25.digested.js.LICENSE.txt */
(()=>{var __webpack_modules__={26748:e=>{function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=26748,e.exports=t},86900:(e,t,r)=>{var n={"./AnalyticsTrigger":79958,"./AnalyticsTrigger.jsx":79958,"./App":45117,"./App.jsx":45117,"./AuthenticatedModal":31090,"./AuthenticatedModal.jsx":31090,"./ConfirmActionButton":2386,"./ConfirmActionButton.jsx":2386,"./CrossSectionPropertyView":35983,"./CrossSectionPropertyView.jsx":35983,"./DocksZoomControl":76282,"./DocksZoomControl.jsx":76282,"./DownloadsButton":38719,"./DownloadsButton.jsx":38719,"./EstimatedPrice":17551,"./EstimatedPrice.jsx":17551,"./ExternalProjectSaveButton":65223,"./ExternalProjectSaveButton.jsx":65223,"./FormFromServer":98313,"./FormFromServer.jsx":98313,"./GuestEditorSaveForm":52546,"./GuestEditorSaveForm.jsx":52546,"./HelpView":6204,"./HelpView.jsx":6204,"./IntroVideoModal":35354,"./IntroVideoModal.jsx":35354,"./JumpToZoomControls":52394,"./JumpToZoomControls.jsx":52394,"./KeyboardShortcutsModalView":95130,"./KeyboardShortcutsModalView.jsx":95130,"./LightningBoltView":85760,"./LightningBoltView.jsx":85760,"./MaterialListFormBody":13891,"./MaterialListFormBody.jsx":13891,"./PartsBreakdown":18709,"./PartsBreakdown.jsx":18709,"./PriceListFormBody":66493,"./PriceListFormBody.jsx":66493,"./ProgressModal":9296,"./ProgressModal.jsx":9296,"./ProjectQuoteForm":8325,"./ProjectQuoteForm.jsx":8325,"./ProjectTemplateView":10354,"./ProjectTemplateView.jsx":10354,"./PropertyPanelStyleGuide":49858,"./PropertyPanelStyleGuide.jsx":49858,"./SignInForm":33818,"./SignInForm.jsx":33818,"./SignUpForm":13740,"./SignUpForm.jsx":13740,"./ThunderCloudDotMenu":16527,"./ThunderCloudDotMenu.jsx":16527,"./ThunderCloudDrawingEditorActionBar":27521,"./ThunderCloudDrawingEditorActionBar.jsx":27521,"./ThunderCloudIconFactory":44308,"./ThunderCloudIconFactory.jsx":44308,"./ToolsPanel":78363,"./ToolsPanel.jsx":78363,"./UnsupportedScreenSizeWarning":53696,"./UnsupportedScreenSizeWarning.jsx":53696,"./VideoModalView":2065,"./VideoModalView.jsx":2065,"./VideoPageView":49683,"./VideoPageView.jsx":49683,"./XROverlay":51753,"./XROverlay.jsx":51753,"./XRPreviewButton":75662,"./XRPreviewButton.jsx":75662,"./editor-strategies/ExternalProjectsModeStrategy":79645,"./editor-strategies/ExternalProjectsModeStrategy.jsx":79645,"./editor-strategies/GuestModeStrategy":36280,"./editor-strategies/GuestModeStrategy.jsx":36280,"./editor-strategies/ModeStrategy":63526,"./editor-strategies/ModeStrategy.jsx":63526,"./editor-strategies/PreviewModeStrategy":19395,"./editor-strategies/PreviewModeStrategy.jsx":19395,"./editor-strategies/ProjectModeStrategy":379,"./editor-strategies/ProjectModeStrategy.jsx":379,"./editor-strategies/PublicModeStrategy":73593,"./editor-strategies/PublicModeStrategy.jsx":73593,"./editor-strategies/QuoteModeStrategy":32912,"./editor-strategies/QuoteModeStrategy.jsx":32912,"./editor-strategies/TemplateModeStrategy":21860,"./editor-strategies/TemplateModeStrategy.jsx":21860,"./property-panels/ActionPropertyView":21716,"./property-panels/ActionPropertyView.jsx":21716,"./property-panels/DividerPropertyView":19907,"./property-panels/DividerPropertyView.jsx":19907,"./property-panels/EdgeBooleanMapPropertyView":68739,"./property-panels/EdgeBooleanMapPropertyView.jsx":68739,"./property-panels/EdgeMultiStateMapPropertyView":40661,"./property-panels/EdgeMultiStateMapPropertyView.jsx":40661,"./property-panels/FilePropertyView":56792,"./property-panels/FilePropertyView.jsx":56792,"./property-panels/LocatorBooleanMapPropertyView":64460,"./property-panels/LocatorBooleanMapPropertyView.jsx":64460,"./property-panels/NoticePropertyView":53498,"./property-panels/NoticePropertyView.jsx":53498,"./property-panels/ScalePropertyView":11698,"./property-panels/ScalePropertyView.jsx":11698,"./property-panels/SegmentPropertyView":53779,"./property-panels/SegmentPropertyView.jsx":53779,"./tool-panels":63622,"./tool-panels/":63622,"./tool-panels/RailingCollectionToolPanel":61951,"./tool-panels/RailingCollectionToolPanel.jsx":61951,"./tool-panels/ToolContextMessagePanel":10793,"./tool-panels/ToolContextMessagePanel.jsx":10793,"./tool-panels/ToolPropertyPanel":25418,"./tool-panels/ToolPropertyPanel.jsx":25418,"./tool-panels/index":63622,"./tool-panels/index.js":63622};function i(e){var t=s(e);return r(t)}function s(e){if(!r.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}i.keys=function(){return Object.keys(n)},i.resolve=s,e.exports=i,i.id=86900},21710:(e,t,r)=>{var n={"./ApiClient":31700,"./ApiClient.js":31700,"./RailingComponent":29916,"./RailingComponent.js":29916,"./i18n":57699,"./i18n.js":57699,"./migrations":44158,"./migrations.js":44158,"./sharedThreeMaterials":61280,"./sharedThreeMaterials.js":61280,"./smartJSON":82372,"./smartJSON.js":82372,"./units":7732,"./units.js":7732};function i(e){var t=s(e);return r(t)}function s(e){if(!r.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}i.keys=function(){return Object.keys(n)},i.resolve=s,e.exports=i,i.id=21710},60661:(e,t,r)=>{var n={"./dashboard/index_controller.js":26830,"./date_range_controller.js":10875,"./folder_controller.js":74469,"./index_controller.js":30135,"./menu_controller.js":35196,"./nested_form_controller.js":55165,"./password_complexity_controller.js":65777,"./project/index_controller.js":98209,"./project_folders_controller.js":28002,"./toggle_controller.mjs":17944,"./tom_select_controller.js":60778,"./user/index_controller.js":53973};function i(e){var t=s(e);return r(t)}function s(e){if(!r.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}i.keys=function(){return Object.keys(n)},i.resolve=s,e.exports=i,i.id=60661},86190:(e,t,r)=>{var n={"./american-muscle-docks-logo--info.jpg":23182,"./american-muscle-docks-logo.png":40724,"./american-muscle-docks-watermark.png":58467,"./bear-ridge-claw.png":45343,"./bear-ridge-logo.png":77179,"./city-post-logo.png":86335,"./coastal-pier-and-dock-logo.png":31617,"./customIcons":85758,"./customIcons.js":85758,"./dock-designer-app-logo-white.png":99310,"./dock-designer-app-logo.png":43930,"./dock-designer-app-watermark.png":97857,"./dock-designer-logo.png":37156,"./docklife-logo.png":37538,"./environment.hdr":51947,"./ez-dock-logo.png":15110,"./falcon-railings-logo.png":7526,"./hollaender-quik-connect-logo-watermark.png":61686,"./hollaender-quik-connect-logo.png":12560,"./icons/2-inch-rectangle-rail-shape.svg":16499,"./icons/3-inch-rectangle-rail-shape.svg":39714,"./icons/3d-off.svg":99035,"./icons/3d-on.svg":51938,"./icons/ada-rail.svg":16024,"./icons/anchor-platform.svg":45254,"./icons/base-shoe-glass-rail.svg":68742,"./icons/bench.svg":88061,"./icons/bikeway-rail.svg":13688,"./icons/boat-lift-sling.svg":67551,"./icons/boat-slip.svg":49190,"./icons/cable-rail-stair.svg":99545,"./icons/cable-rail.svg":54109,"./icons/circle-rail-shape.svg":75430,"./icons/cleat.svg":2013,"./icons/coastal-boathouse.svg":47147,"./icons/colosseum-rail.svg":81806,"./icons/cursor-level-glass-rail.svg":81562,"./icons/cursor-stair-glass-rail.svg":57769,"./icons/curved-rail-shape.svg":24203,"./icons/custom-icon.svg":78362,"./icons/default-dock.svg":58756,"./icons/default-opening.svg":93731,"./icons/dock-triangle.svg":30365,"./icons/edit-curve.svg":34843,"./icons/folder-open.svg":21634,"./icons/folder.svg":17853,"./icons/framed-glass.svg":76323,"./icons/gangway.svg":20633,"./icons/generic-rail-stair.svg":581,"./icons/generic-rail.svg":61385,"./icons/glass-rail-infinity.svg":35785,"./icons/glass-rail-post-to-top.svg":88941,"./icons/glass-rail-stair.svg":90688,"./icons/glass-rail.svg":85540,"./icons/guardrail-rail.svg":61437,"./icons/hand-grab-flat-rail.svg":19548,"./icons/hand-grab-rail.svg":23574,"./icons/kalani.svg":55151,"./icons/l-shape.svg":61287,"./icons/ladder.svg":36417,"./icons/lasso.svg":16925,"./icons/mahina.svg":42033,"./icons/mid-rail.svg":34046,"./icons/move_selection_right.svg":92602,"./icons/ohana.svg":28746,"./icons/organization.svg":53292,"./icons/oval-rail-shape.svg":11350,"./icons/picket-rail.svg":64526,"./icons/pile-guide.svg":44174,"./icons/pipe-hold.svg":51789,"./icons/platform.svg":40788,"./icons/post-override.svg":73075,"./icons/project.svg":45112,"./icons/rectangle.svg":27520,"./icons/roof.svg":57047,"./icons/rope-rail.svg":16970,"./icons/select.svg":93513,"./icons/stairs.svg":40995,"./icons/standard-dock.svg":8118,"./icons/standoff-glass-rail.svg":35890,"./icons/stick-dock.svg":69477,"./icons/stick-pier.svg":22560,"./icons/success.svg":36466,"./icons/system_pricing.svg":58569,"./icons/t-shape.svg":40079,"./icons/three-rail.svg":30908,"./icons/top-rail-only.svg":98570,"./icons/triton-rail.svg":12068,"./icons/u-shape.svg":76050,"./icons/user_pricing.svg":80151,"./icons/zone.svg":38299,"./innovative-aluminum-logo.png":15299,"./k-and-s-logo.png":78126,"./k-and-s-watermark.png":3501,"./kwikclamp-logo-icon.png":87254,"./kwikclamp-logo.png":87842,"./kwikclamp-watermark.png":84905,"./lightningcad-logo.png":41629,"./oasis-boat-docks-logo.png":27812,"./oasis-boat-docks-watermark.png":38707,"./omega-is-gradient-logo.png":71766,"./omega-is-watermark.png":61968,"./railing-designer-logo.png":26557,"./rogue-fabricators-logo.png":4574,"./water-normals.png":18377,"./waterside-logo-icon.png":84873,"./waterside-logo.png":36123};function i(e){var t=s(e);return r(t)}function s(e){if(!r.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}i.keys=function(){return Object.keys(n)},i.resolve=s,e.exports=i,i.id=86190},14678:(e,t,r)=>{var n={"./adjustable-corner-sleeve-placeholder.glb":63787,"./aluminum-post-cap.glb":13471,"./am-docks-12-floats.glb":34356,"./am-docks-16-floats.glb":95680,"./am-docks-c10-cleat-stf.glb":36399,"./am-docks-c10-cleat.glb":7077,"./am-docks-c12-cleat-stf.glb":73193,"./am-docks-c12-cleat.glb":33615,"./am-docks-framing-brackets.glb":62135,"./am-docks-gangway-hinge-3ft.glb":88869,"./am-docks-gangway-hinge-4ft.glb":73050,"./am-docks-gangway-short-rail.glb":2635,"./am-docks-gangway-tall-rail.glb":94160,"./am-docks-gangway-transitional-plate.glb":81041,"./am-docks-ph-c.glb":31743,"./am-docks-ph-h10.glb":77183,"./am-docks-ph-h10r.glb":89317,"./am-docks-ph-h10rp.glb":38649,"./am-docks-ph-h12.glb":92381,"./am-docks-ph-h12r.glb":13859,"./am-docks-ph-h12rp.glb":64867,"./am-docks-ph-h14.glb":31776,"./am-docks-ph-h14r.glb":92753,"./am-docks-ph-h14rp.glb":31005,"./am-docks-ph-h16.glb":22513,"./am-docks-ph-h16r.glb":87487,"./am-docks-ph-h16rp.glb":15175,"./am-docks-ph-h18.glb":247,"./am-docks-ph-h18r.glb":84749,"./am-docks-ph-h18rp.glb":86961,"./am-docks-ph-hsr14.glb":32312,"./am-docks-ph-hsr16.glb":94754,"./am-docks-ph-hsrp14.glb":97832,"./am-docks-ph-hsrp16.glb":71506,"./am-docks-ph-l10.glb":25235,"./am-docks-ph-l12.glb":38353,"./am-docks-ph-l14.glb":63295,"./am-docks-ph-l16.glb":65693,"./am-docks-ph-l18.glb":83467,"./am-docks-ph-l6.glb":4544,"./am-docks-ph-l8.glb":70150,"./am-docks-pipe-holders-steel-channel.glb":24461,"./am-docks-pipe-holders.glb":57237,"./am-docks-roller-deck-plate.glb":13406,"./am-docks-rub-rail-corner.glb":1053,"./am-docks-steel-channel-frames.glb":92713,"./am-docks-steel-hardware.glb":69189,"./am-docks-steel-truss-frames.glb":18969,"./am-docks-steel-truss-tapered-frames.glb":48387,"./am-docks-transition-plate.glb":34373,"./baseplate-placeholder.glb":84724,"./citypost-cable-crimp.glb":84926,"./citypost-cable-nuts.glb":72082,"./citypost-corner-sleeves.glb":49962,"./citypost-post-36-fascia.glb":13411,"./citypost-post-36.glb":76313,"./citypost-post-42-fascia.glb":56632,"./citypost-post-42.glb":64412,"./citypost-single-corner-post-36.glb":26072,"./citypost-single-corner-post-42.glb":65061,"./citypost-slope-transition-sleeves.glb":39522,"./citypost-stair-post-36-fascia.glb":92831,"./citypost-stair-post-36.glb":5069,"./citypost-stair-post-42-fascia.glb":79764,"./citypost-stair-post-42.glb":37520,"./citypost-straight-sleeves.glb":53871,"./corner-90-sleeve-placeholder.glb":62381,"./debug-axis.glb":70148,"./ez-boat-port-side-extension.glb":99745,"./ez-boat-port.glb":84469,"./ez-dock-100in.glb":25057,"./ez-dock-40in.glb":25464,"./ez-dock-60in.glb":72122,"./ez-dock-80in-low-profile.glb":33149,"./ez-dock-80in.glb":13628,"./ez-dock-air-assist.glb":47809,"./ez-dock-baby-dock.glb":41917,"./ez-dock-bench-with-arm-rests.glb":9597,"./ez-dock-bench.glb":68471,"./ez-dock-dog-bone-coupler-low-profile.glb":960,"./ez-dock-dog-bone-coupler.glb":34801,"./ez-dock-float-tank.glb":850,"./ez-dock-gangway-grating-3x10.glb":98393,"./ez-dock-gangway-grating-3x15.glb":30024,"./ez-dock-gangway-grating-3x20.glb":98768,"./ez-dock-gangway-grating-3x25.glb":19009,"./ez-dock-gangway-grating-3x30.glb":95455,"./ez-dock-gangway-grating-4x10.glb":45060,"./ez-dock-gangway-grating-4x15.glb":87837,"./ez-dock-gangway-grating-4x20.glb":30285,"./ez-dock-gangway-grating-4x25.glb":88244,"./ez-dock-gangway-grating-4x30.glb":13334,"./ez-dock-gangway-solid-3x10.glb":33782,"./ez-dock-gangway-solid-3x15.glb":77255,"./ez-dock-gangway-solid-3x20.glb":89539,"./ez-dock-gangway-solid-3x25.glb":72730,"./ez-dock-gangway-solid-3x30.glb":65508,"./ez-dock-gangway-solid-4x10.glb":56975,"./ez-dock-gangway-solid-4x15.glb":56510,"./ez-dock-gangway-solid-4x20.glb":80882,"./ez-dock-gangway-solid-4x25.glb":75867,"./ez-dock-gangway-solid-4x30.glb":20297,"./ez-dock-half-hex.glb":6686,"./ez-dock-kayak-launch.glb":92874,"./ez-dock-ladder.glb":84553,"./ez-dock-long-bunk.glb":55996,"./ez-dock-pocket-filler.glb":82096,"./ez-dock-tri.glb":23162,"./ez-port-260.glb":14385,"./ez-port-280.glb":78827,"./ez-port-2i-bow-stop.glb":95604,"./ez-port-2i.glb":37894,"./ez-port-full-deck-bow.glb":58153,"./ez-port-max-easy-lift-entry.glb":56684,"./ez-port-max-entry.glb":55552,"./ez-port-max-extension.glb":639,"./ez-port-small-bow.glb":60739,"./ez-port-vxp.glb":83751,"./falcon-glass-gate-hinge.glb":60159,"./falcon-picket-rail-corner-sleeve.glb":76963,"./falcon-picket-rail-downward-slope-sleeve.glb":87534,"./falcon-picket-rail-upward-slope-sleeve.glb":51099,"./generic-2-in-pipe-sleeve-lower-corner-90.glb":36970,"./generic-2-in-pipe-sleeve-lower-corner-adjustable.glb":7615,"./generic-2-in-pipe-sleeve-lower-line.glb":9670,"./generic-2-in-pipe-sleeve-lower-slope-line.glb":31132,"./generic-2-in-pipe-sleeve-lower-slope-terminal.glb":1362,"./generic-2-in-pipe-sleeve-lower-slope-transition.glb":41703,"./generic-2-in-pipe-sleeve-lower-terminal.glb":75008,"./generic-2-in-pipe-sleeve-upper-corner-90.glb":94190,"./generic-2-in-pipe-sleeve-upper-corner-adjustable.glb":99420,"./generic-2-in-pipe-sleeve-upper-line.glb":14603,"./generic-2-in-pipe-sleeve-upper-slope-line.glb":18469,"./generic-2-in-pipe-sleeve-upper-slope-terminal.glb":54411,"./generic-2-in-pipe-sleeve-upper-slope-transition.glb":95886,"./generic-2-in-pipe-sleeve-upper-terminal.glb":80125,"./generic-cleat.glb":62312,"./generic-dock-ladder.glb":9919,"./generic-sling-boat-lift.glb":59453,"./hollaender-connector-11E-8.glb":64486,"./hollaender-connector-3-8.glb":91370,"./hollaender-connector-30C-8-half.glb":81015,"./hollaender-connector-5-8.glb":85304,"./hollaender-connector-5E-8.glb":2949,"./hollaender-connector-7E-8.glb":58303,"./hollaender-connector-9-8.glb":36404,"./hollaender-connector-cap-60-8.glb":78740,"./hollaender-panel-13.glb":74957,"./hollaender-panel-20.glb":64087,"./hollaender-panel-27.glb":82172,"./hollaender-panel-34.glb":34284,"./hollaender-panel-41.glb":11376,"./hollaender-post-baseplate.glb":48178,"./kee-klamp-single-socket-tee.glb":6814,"./kona-cube.glb":38552,"./kona-pin.glb":3138,"./kona-spacer.glb":91303,"./kwikclamp-101_d48.glb":51724,"./kwikclamp-104-ETD.glb":85466,"./kwikclamp-104-ETJ.glb":71500,"./kwikclamp-104_d48.glb":20869,"./kwikclamp-116_d48.glb":13648,"./kwikclamp-119_d48.glb":78239,"./kwikclamp-124_d48.glb":34835,"./kwikclamp-125_d48.glb":40126,"./kwikclamp-127_d48.glb":9704,"./kwikclamp-128_d48.glb":8135,"./kwikclamp-129_d48.glb":46274,"./kwikclamp-130_d48.glb":95888,"./kwikclamp-139_d48.glb":43613,"./kwikclamp-146_d48.glb":83183,"./kwikclamp-148_d48-with-cap.glb":15,"./kwikclamp-148_d48.glb":42885,"./kwikclamp-152_d48.glb":17880,"./kwikclamp-153_d48.glb":91741,"./kwikclamp-155-ETJ.glb":63646,"./kwikclamp-155_d48.glb":4927,"./kwikclamp-156_d48.glb":2724,"./kwikclamp-180-ETJ.glb":6512,"./kwikclamp-180_d48.glb":30953,"./kwikclamp-181-ETJ.glb":1761,"./kwikclamp-181_d48.glb":73764,"./kwikclamp-182_d48.glb":69471,"./kwikclamp-183_d48.glb":16218,"./kwikclamp-184_d48.glb":26237,"./kwikclamp-185_d48.glb":35e3,"./kwikclamp-186_d48.glb":29603,"./kwikclamp-187_d48.glb":17006,"./kwikclamp-189_d48.glb":22684,"./kwikclamp-198_d48.glb":47074,"./kwikclamp-199_d48.glb":76647,"./kwikclamp-232_d48.glb":88401,"./kwikclamp-233_d48.glb":45356,"./kwikclamp-242_d48.glb":89520,"./kwikclamp-252_d48.glb":5931,"./kwikclamp-253_d48.glb":14102,"./kwikclamp-255_d48.glb":26348,"./kwikclamp-256-ETD.glb":77472,"./kwikclamp-256_d48.glb":1767,"./kwikclamp-725_d48.glb":65844,"./kwikclamp-746_d48.glb":73357,"./kwikclamp-751_d48.glb":21237,"./kwikclamp-752_d48.glb":95142,"./kwikclamp-755_d48.glb":26241,"./kwikclamp-756_d48.glb":75026,"./kwikclamp-757_d48.glb":82903,"./kwikclamp-758_d48.glb":52888,"./kwikclamp-764_d48.glb":11301,"./kwikclamp-ASSY_753M_173F_3D.glb":32452,"./kwikclamp-ASSY_754D48_173F_3D.glb":33844,"./kwikclamp-ETD.glb":57760,"./kwikclamp-ETJ.glb":67462,"./kwikclamp-mezzanine-gate.glb":18628,"./kwikclamp-temp-fitting.glb":65413,"./oasis-lift-motor.glb":23538,"./oasis-shaft-bracket.glb":96098,"./omega-angle-bracket-30.glb":25701,"./omega-angle-bracket-45.glb":62225,"./omega-angle-bracket-60.glb":37330,"./omega-corner-cap.glb":97575,"./omega-double-inline-bracket-flipped.glb":99520,"./omega-double-inline-bracket.glb":25851,"./omega-inline-bracket-flipped.glb":7384,"./omega-inline-bracket.glb":54595,"./omega-inside-corner-bracket.glb":25922,"./omega-lift-out-double-rail-assembly-flipped.glb":83168,"./omega-lift-out-double-rail-assembly.glb":86651,"./omega-lift-out-rail-assembly-flipped.glb":86570,"./omega-lift-out-rail-assembly.glb":93081,"./omega-post-18.glb":16347,"./omega-post-44.glb":39468,"./omega-removable-double-rail-hinge.glb":45769,"./omega-removable-rail-hinge.glb":67585,"./omega-self-closing-gate-end.glb":40519,"./omega-self-closing-gate-mount.glb":32467,"./omega-swing-gate-36.glb":49743,"./omega-swing-gate-48.glb":73388,"./omega-swing-gate-60.glb":64038,"./omega-wrap-around-flare-flipped.glb":9185,"./omega-wrap-around-flare.glb":60306,"./rogue-fabricators-hand-grab-stem.glb":70257,"./safesmart-platform-rail-end.glb":9590,"./safesmart-platform-rail-middle.glb":64646,"./safesmart-platform-rail-start.glb":85961,"./safesmart-stair-rail-2-step.glb":7592,"./safesmart-stair-rail-bottom.glb":52644,"./safesmart-stair-rail-middle.glb":28154,"./safesmart-stair-rail-top.glb":23576};function i(e){var t=s(e);return r(t)}function s(e){if(!r.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}i.keys=function(){return Object.keys(n)},i.resolve=s,e.exports=i,i.id=14678},75247:(e,t,r)=>{var n={"./aluminum-walkway-mesh-textures/color.jpg":61120,"./aluminum-walkway-mesh-textures/normal.jpg":4836,"./aluminum-walkway-mesh-textures/opacity.jpg":94665,"./aluminum-walkway-mesh-textures/roughness.jpg":20123,"./composite-decking-textures/color.jpg":22642,"./composite-decking-textures/normal.jpg":90822,"./composite-decking-textures/roughness.jpg":93765,"./concrete-textures/ambient_occlusion.jpg":61449,"./concrete-textures/color.jpg":89134,"./concrete-textures/normal.jpg":63730,"./concrete-textures/roughness.jpg":54209,"./falcon-textures/normal.jpg":80192,"./grass-textures/color.jpg":6161,"./grass-textures/normal.jpg":27699,"./grass-textures/roughness.jpg":90430,"./ground-textures/color.jpg":10298,"./ground-textures/normal.jpg":78574,"./ground-textures/roughness.jpg":65645,"./ipe-textures/color.jpg":41719,"./ipe-textures/normal.jpg":12961,"./ipe-textures/roughness.jpg":83796,"./lumber-rock-textures/normal.jpg":79820,"./metal-roof-textures/color.jpg":86149,"./metal-roof-textures/metalness.jpg":6264,"./metal-roof-textures/normal.jpg":69527,"./metal-roof-textures/roughness.jpg":74482,"./pressure-treated-textures/color.jpg":47398,"./pressure-treated-textures/normal.jpg":55786,"./pressure-treated-textures/roughness.jpg":83385,"./rope-textures/ambient_occlusion.jpg":46774,"./rope-textures/color.jpg":75917,"./rope-textures/normal.jpg":7071,"./rope-textures/roughness.jpg":76762,"./shingle-textures/color.jpg":53573,"./shingle-textures/displacement.jpg":33083,"./shingle-textures/normal.jpg":96695,"./shingle-textures/roughness.jpg":21490,"./weardeck-textures/color.jpg":63639,"./weardeck-textures/normal.jpg":68449,"./weardeck-textures/roughness.jpg":11476};function i(e){var t=s(e);return r(t)}function s(e){if(!r.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}i.keys=function(){return Object.keys(n)},i.resolve=s,e.exports=i,i.id=75247},2766:(e,t,r)=>{var n={"./concrete":13584,"./concrete.js":13584,"./debug-colors":63017,"./debug-colors.js":63017,"./decking/composite-decking":41046,"./decking/composite-decking.js":41046,"./decking/fiberon":25632,"./decking/fiberon.js":25632,"./decking/ipe":45915,"./decking/ipe.js":45915,"./decking/lumber-rock":14668,"./decking/lumber-rock.js":14668,"./decking/pressure-treated":58432,"./decking/pressure-treated.js":58432,"./decking/weardeck":68057,"./decking/weardeck.js":68057,"./fixed-dock":49653,"./fixed-dock.js":49653,"./glass":707,"./glass.js":707,"./metal/aluminum":65601,"./metal/aluminum.js":65601,"./metal/mesh/aluminum-walkway-mesh":15122,"./metal/mesh/aluminum-walkway-mesh.js":15122,"./metal/mesh/metallic-mesh-low-gloss":5916,"./metal/mesh/metallic-mesh-low-gloss.js":5916,"./metal/metallic-low-gloss":97926,"./metal/metallic-low-gloss.js":97926,"./metal/safety-red":91139,"./metal/safety-red.js":91139,"./metal/steel":97360,"./metal/steel.js":97360,"./outdoors/grass":57475,"./outdoors/grass.js":57475,"./outdoors/ground":98994,"./outdoors/ground.js":98994,"./outdoors/underground":19512,"./outdoors/underground.js":19512,"./plastic/legacy-plastic":73932,"./plastic/legacy-plastic.js":73932,"./plastic/plastic-matte":58152,"./plastic/plastic-matte.js":58152,"./registerMaterialHelpers":2454,"./registerMaterialHelpers.js":2454,"./roofing/metal-roof":89580,"./roofing/metal-roof.js":89580,"./roofing/shingle":52556,"./roofing/shingle.js":52556,"./rope":24107,"./rope.js":24107,"./strategy-specific-colors/falcon-colors":86379,"./strategy-specific-colors/falcon-colors.js":86379,"./strategy-specific-colors/hollaender-colors":4954,"./strategy-specific-colors/hollaender-colors.js":4954,"./strategy-specific-colors/omega-colors":7589,"./strategy-specific-colors/omega-colors.js":7589,"./textureTypes":94111,"./textureTypes.js":94111,"./textures/aluminum-walkway-mesh-textures/color.jpg":61120,"./textures/aluminum-walkway-mesh-textures/normal.jpg":4836,"./textures/aluminum-walkway-mesh-textures/opacity.jpg":94665,"./textures/aluminum-walkway-mesh-textures/roughness.jpg":20123,"./textures/composite-decking-textures/color.jpg":22642,"./textures/composite-decking-textures/normal.jpg":90822,"./textures/composite-decking-textures/roughness.jpg":93765,"./textures/concrete-textures/ambient_occlusion.jpg":61449,"./textures/concrete-textures/color.jpg":89134,"./textures/concrete-textures/normal.jpg":63730,"./textures/concrete-textures/roughness.jpg":54209,"./textures/falcon-textures/normal.jpg":80192,"./textures/grass-textures/color.jpg":6161,"./textures/grass-textures/normal.jpg":27699,"./textures/grass-textures/roughness.jpg":90430,"./textures/ground-textures/color.jpg":10298,"./textures/ground-textures/normal.jpg":78574,"./textures/ground-textures/roughness.jpg":65645,"./textures/ipe-textures/color.jpg":41719,"./textures/ipe-textures/normal.jpg":12961,"./textures/ipe-textures/roughness.jpg":83796,"./textures/lumber-rock-textures/normal.jpg":79820,"./textures/metal-roof-textures/color.jpg":86149,"./textures/metal-roof-textures/metalness.jpg":6264,"./textures/metal-roof-textures/normal.jpg":69527,"./textures/metal-roof-textures/roughness.jpg":74482,"./textures/pressure-treated-textures/color.jpg":47398,"./textures/pressure-treated-textures/normal.jpg":55786,"./textures/pressure-treated-textures/roughness.jpg":83385,"./textures/rope-textures/ambient_occlusion.jpg":46774,"./textures/rope-textures/color.jpg":75917,"./textures/rope-textures/normal.jpg":7071,"./textures/rope-textures/roughness.jpg":76762,"./textures/shingle-textures/color.jpg":53573,"./textures/shingle-textures/displacement.jpg":33083,"./textures/shingle-textures/normal.jpg":96695,"./textures/shingle-textures/roughness.jpg":21490,"./textures/weardeck-textures/color.jpg":63639,"./textures/weardeck-textures/normal.jpg":68449,"./textures/weardeck-textures/roughness.jpg":11476};function i(e){var t=s(e);return r(t)}function s(e){if(!r.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}i.keys=function(){return Object.keys(n)},i.resolve=s,e.exports=i,i.id=2766},16948:(e,t,r)=>{var n={"./american-muscle/domain-models/AMCleat.js":68500,"./american-muscle/domain-models/AMDock.js":18112,"./american-muscle/domain-models/AMDockAccessory.js":74352,"./american-muscle/domain-models/AMDockAngleBracket.js":58101,"./american-muscle/domain-models/AMDockBracket.js":28174,"./american-muscle/domain-models/AMDockCornerBracket.js":88933,"./american-muscle/domain-models/AMDockFramingDescriptor.js":92853,"./american-muscle/domain-models/AMDockInnerCornerBracket.js":49283,"./american-muscle/domain-models/AMDockSection.js":5345,"./american-muscle/domain-models/AMDockSectionSpecification.js":3260,"./american-muscle/domain-models/AMDocksLumberProcessor.js":97946,"./american-muscle/domain-models/AMDocksProject.js":87046,"./american-muscle/domain-models/AMDocksSteelFrameBracket.js":56199,"./american-muscle/domain-models/AMFloat.js":60657,"./american-muscle/domain-models/AMFrameConnection.js":38014,"./american-muscle/domain-models/AMGangway.js":79009,"./american-muscle/domain-models/AMGangwayHingeBracket.js":92916,"./american-muscle/domain-models/AMPileGuide.js":68475,"./american-muscle/domain-models/AMPipeHold.js":55038,"./american-muscle/domain-models/AMSteelChannelDock.js":98609,"./american-muscle/domain-models/AMSteelChannelDockSection.js":17779,"./american-muscle/domain-models/AMSteelTrussDock.js":46618,"./american-muscle/domain-models/AMSteelTrussDockSection.js":33735,"./american-muscle/domain-models/AMSteelTrussLumberProcessor.js":73282,"./american-muscle/domain-models/AMSteelTrussTaperedDock.js":85309,"./american-muscle/domain-models/AMSteelTrussTaperedDockSection.js":16270,"./american-muscle/domain-models/AMWoodDock.js":9649,"./american-muscle/domain-models/AMWoodDockFramer.js":65940,"./american-muscle/domain-models/AMWoodDockSection.js":13002,"./american-muscle/domain-models/ArticulatingSteelFrameConnectionType.js":74698,"./american-muscle/domain-models/ArticulatingWoodFrameConnectionType.js":72654,"./american-muscle/domain-models/BoltedSteelFrameConnectionType.js":63431,"./american-muscle/domain-models/Gangway3DModelFrameSection.js":90559,"./american-muscle/domain-models/MirroredGangway3DModelFrameSection.js":34909,"./american-muscle/domain-models/NonArticulatingSteelFrameConnectionType.js":56493,"./american-muscle/domain-models/NonArticulatingWoodFrameConnectionType.js":98099,"./american-muscle/domain-models/RubRail.js":80716,"./american-muscle/domain-models/RubRailCorner.js":24409,"./american-muscle/domain-models/SteelChannelFrame.js":44518,"./american-muscle/domain-models/SteelFrameConnection.js":69009,"./american-muscle/domain-models/SteelFrameConnectionType.js":59585,"./american-muscle/domain-models/SteelTrussFrame.js":25706,"./american-muscle/domain-models/WoodFrameConnection.js":74231,"./american-muscle/domain-models/WoodFrameConnectionType.js":39359,"./american-muscle/domain-models/dockTypes.js":32877,"./american-muscle/domain-models/floatPlacementHelpers.js":13463,"./american-muscle/domain-models/getFloatInfoForSize.js":42433,"./american-muscle/domain-models/materials.js":47347,"./bear-ridge/domain-models/BearRidgeFramedGlassRailingStyle.js":57026,"./bear-ridge/domain-models/BearRidgeGateTypes.js":72562,"./bear-ridge/domain-models/BearRidgeGlassPanel.js":75462,"./bear-ridge/domain-models/BearRidgeGlassRailingStyle.js":76247,"./bear-ridge/domain-models/BearRidgeInfinityRailingStyle.js":79858,"./bear-ridge/domain-models/BearRidgePicketRailingStyle.js":19185,"./bear-ridge/domain-models/BearRidgeProject.js":63283,"./bear-ridge/domain-models/BearRidgeRailingCollection.js":87166,"./bear-ridge/domain-models/BearRidgeRailingOpening.js":92856,"./bear-ridge/domain-models/BearRidgeRailingRun.js":4065,"./bear-ridge/domain-models/CapRail.js":22685,"./bear-ridge/domain-models/gates/BearRidgeFramedGlassGate.js":99290,"./bear-ridge/domain-models/gates/BearRidgeFramedGlassGate30Inch.js":18610,"./bear-ridge/domain-models/gates/BearRidgeGlassGate.js":64108,"./bear-ridge/domain-models/gates/BearRidgeGlassGate30Inch.js":10079,"./bear-ridge/domain-models/gates/BearRidgePicketGate.js":87648,"./bear-ridge/domain-models/gates/BearRidgePicketGate30Inch.js":79083,"./bear-ridge/domain-models/gates/doorLatches.js":18192,"./bear-ridge/domain-models/materials.js":15327,"./bear-ridge/domain-models/posts/BearRidgeRailingCornerPost.js":79429,"./bear-ridge/domain-models/posts/BearRidgeRailingPicketStairsPost.js":36198,"./bear-ridge/domain-models/posts/BearRidgeRailingPost.js":54836,"./bear-ridge/domain-models/posts/BearRidgeRailingStairTransitionCornerPost.js":83253,"./bear-ridge/domain-models/posts/BearRidgeRailingStairTransitionPost.js":88100,"./bear-ridge/domain-models/posts/BearRidgeRailingTerminalPost.js":90464,"./bear-ridge/domain-models/railingStyles.js":20807,"./bear-ridge/domain-models/sections/BearRidgeFramedGlassRailingSection.js":86109,"./bear-ridge/domain-models/sections/BearRidgeGlassRailingSection.js":1308,"./bear-ridge/domain-models/sections/BearRidgePicketRailingSection.js":72512,"./coastal-pier/domain-models/CoastalBoathouseDeckingSupport.js":12178,"./coastal-pier/domain-models/CoastalBoathouseDock.js":66451,"./coastal-pier/domain-models/CoastalBoathouseDockFramer.js":55426,"./coastal-pier/domain-models/CoastalBoathouseDockFramingDescriptor.js":82660,"./coastal-pier/domain-models/CoastalDock.js":13191,"./coastal-pier/domain-models/CoastalDockDeckingSurface.js":85157,"./coastal-pier/domain-models/CoastalDockFramer.js":5726,"./coastal-pier/domain-models/CoastalFramingDescriptor.js":47553,"./coastal-pier/domain-models/CoastalPierAndDockProject.js":16831,"./coastal-pier/domain-models/CoastalPierBoathouse.js":19820,"./coastal-pier/domain-models/CoastalPierFramingDescriptor.js":76677,"./coastal-pier/domain-models/CoastalPierGableEndFraming.js":30046,"./coastal-pier/domain-models/CoastalPierGableRoof.js":3117,"./coastal-pier/domain-models/CoastalPierGableRoofFraming.js":41963,"./coastal-pier/domain-models/CoastalPierHipRoof.js":91801,"./coastal-pier/domain-models/CoastalPierHipRoofFraming.js":60495,"./coastal-pier/domain-models/CoastalPierPricingStrategy.js":84517,"./coastal-pier/domain-models/CoastalPierRoofFraming.js":7157,"./coastal-pier/domain-models/DockDeckingStrategy.js":16400,"./coastal-pier/domain-models/Pier.js":89088,"./coastal-pier/domain-models/PierDeckingStrategy.js":90753,"./coastal-pier/domain-models/PierFramer.js":42626,"./coastal-pier/domain-models/RoofMaterial.js":28564,"./coastal-pier/domain-models/mixins/CoastalSharedDockBehavior.js":701,"./dock-designer-app/domain-models/DockDesignerAppGangway.js":11393,"./dock-designer-app/domain-models/DockDesignerAppProject.js":34330,"./dock-designer-app/domain-models/accessories/DockDesignerAppAccessory.js":42318,"./dock-designer-app/domain-models/accessories/DockDesignerAppBoatLift.js":46317,"./dock-designer-app/domain-models/accessories/DockDesignerAppCleat.js":87675,"./dock-designer-app/domain-models/accessories/DockDesignerAppLadder.js":24625,"./dock-designer-app/domain-models/decking-surfaces/DockDesignerAppDeckingSurfaceClasses.js":44872,"./dock-designer-app/domain-models/decking-surfaces/DockDesignerAppGrateDeckingSurface.js":39759,"./dock-designer-app/domain-models/docks/DockDesignerAppFloatingDock.js":32097,"./dock-designer-app/domain-models/docks/DockDesignerAppFramingDescriptor.js":83565,"./dock-designer-app/domain-models/docks/DockDesignerAppTimberDock.js":4748,"./dock-designer-app/domain-models/docks/DockDesignerAppTriangularDock.js":98870,"./dock-designer-app/domain-models/docks/DockPostType.js":88880,"./dock-designer-app/domain-models/docks/postPositions.js":39927,"./dock-designer-app/domain-models/docks/postVerticalPositions.js":26861,"./dock-designer-app/domain-models/generic-objects/CircularObjectStrategy.js":10594,"./dock-designer-app/domain-models/generic-objects/GenericObject.js":4103,"./dock-designer-app/domain-models/generic-objects/GenericObjectStrategy.js":92910,"./dock-designer-app/domain-models/generic-objects/RectangularObjectStrategy.js":80299,"./dock-designer-app/domain-models/generic-objects/TriangularObjectStrategy.js":15162,"./dock-designer-app/domain-models/materials.js":1120,"./dock-designer-app/domain-models/mixins/DockDesignerAppDockMixin.js":25642,"./dock-designer-app/domain-models/railings/DockDesignerAppCircleExtrusionMaterial.js":5229,"./dock-designer-app/domain-models/railings/DockDesignerAppRailingCollection.js":67251,"./dock-designer-app/domain-models/railings/DockDesignerAppRailingRun.js":99126,"./dock-designer-app/domain-models/railings/DockDesignerAppRailingSection.js":70164,"./dock-designer-app/domain-models/railings/blocks/DockDesignerAppGangwayRailingBlock.js":48809,"./dock-designer-app/domain-models/railings/helpers/DockDesignerAppGangwayPostLayoutEdgeInsetHelper.js":62277,"./dock-designer-app/domain-models/railings/posts/DockDesignerAppGangwayRailingPost.js":10287,"./dock-designer-app/domain-models/railings/railing-styles/DockDesignerAppGangwayRailingStyle.js":29264,"./dock-designer-app/domain-models/railings/railing-styles/DockDesignerAppRailingStyle.js":8514,"./dock-designer-app/domain-models/railings/rails/DockDesignerAppGangwayRail.js":80447,"./dock-designer-app/domain-models/roofs/DockDesignerAppFlatRoof.js":76018,"./dock-designer-app/domain-models/roofs/DockDesignerAppFreeStandingRoof.js":90227,"./dock-designer-app/domain-models/roofs/DockDesignerAppGableRoof.js":40292,"./dock-designer-app/domain-models/roofs/DockDesignerAppRoofMixin.js":13332,"./docks-preview/domain-models/DocksPreviewProject.js":15963,"./docks/domain-models/AbstractGangway.js":79851,"./docks/domain-models/AluminumGangway.js":61820,"./docks/domain-models/AluminumSurface.js":14098,"./docks/domain-models/AnchorPlatform.js":81625,"./docks/domain-models/BoardColorSource.js":88677,"./docks/domain-models/CollarTie.js":87558,"./docks/domain-models/CompositeDock.js":91211,"./docks/domain-models/CutoutDock.js":94848,"./docks/domain-models/DeckingOption.js":21373,"./docks/domain-models/DeckingOptionProvider.js":68772,"./docks/domain-models/DeckingSurface.js":96797,"./docks/domain-models/DeckingSurfaceWithCutout.js":10493,"./docks/domain-models/DefaultDockFramer.js":37528,"./docks/domain-models/Dock.js":26716,"./docks/domain-models/DockAccessory.js":63348,"./docks/domain-models/DockBank.js":19702,"./docks/domain-models/DockBankControlPoint.js":22431,"./docks/domain-models/DockConnection.js":57100,"./docks/domain-models/DockDesignerProject.js":7524,"./docks/domain-models/DockEdgeRailingMultiState.js":70291,"./docks/domain-models/DockFramingDescriptor.js":95369,"./docks/domain-models/DockRoof.js":65773,"./docks/domain-models/DockRoofCoveringMaterial.js":31038,"./docks/domain-models/DockRoofFramer.js":69639,"./docks/domain-models/DockRoofFramingDescriptor.js":48151,"./docks/domain-models/DockRoofingLevel.js":88548,"./docks/domain-models/DredgeZone.js":42482,"./docks/domain-models/ExistingDock.js":55421,"./docks/domain-models/FloatingDockFramer.js":6559,"./docks/domain-models/FloatingDockFramingDescriptor.js":83007,"./docks/domain-models/FramingLevel.js":32387,"./docks/domain-models/FramingLevelSubstructure.js":83924,"./docks/domain-models/GangwayRailingPost.js":24659,"./docks/domain-models/GangwayRailingSection.js":18974,"./docks/domain-models/Hinge.js":41756,"./docks/domain-models/LegacyGangway.js":6916,"./docks/domain-models/MetalFrameSection.js":26852,"./docks/domain-models/Pile.js":34143,"./docks/domain-models/Post.js":10765,"./docks/domain-models/PostGridAnnotationComponent.js":56825,"./docks/domain-models/ProjectPostGridAnnotationComponent.js":41274,"./docks/domain-models/Rafter.js":73835,"./docks/domain-models/RectangularFloat.js":25737,"./docks/domain-models/SeaWall.js":11307,"./docks/domain-models/SkirtBoard.js":8994,"./docks/domain-models/SteelPile.js":30580,"./docks/domain-models/TimberDock.js":5163,"./docks/domain-models/WalkwayMesh.js":19382,"./docks/domain-models/WaterDepthService.js":68768,"./docks/domain-models/WaterGradient.js":16576,"./docks/domain-models/WaterGradientBreakline.js":90019,"./docks/domain-models/WoodFramedFloatingDock.js":91296,"./docks/domain-models/WoodenRamp.js":33225,"./docks/domain-models/diy/DIYCompositeDock.js":76954,"./docks/domain-models/diy/LShapedDock.js":7734,"./docks/domain-models/diy/TShapedDock.js":54558,"./docks/domain-models/diy/UShapedDock.js":49053,"./docks/domain-models/dockLayers.js":10066,"./docks/domain-models/framers/HipRoofWoodenFramer.js":36882,"./docks/domain-models/generic/BetterDock.js":95039,"./docks/domain-models/kona-docks/KalaniDock.js":8389,"./docks/domain-models/kona-docks/KonaCompositeDock.js":22619,"./docks/domain-models/kona-docks/KonaCube.js":94230,"./docks/domain-models/kona-docks/KonaDock.js":31756,"./docks/domain-models/kona-docks/KonaDocksDimensionAnnotation.js":86230,"./docks/domain-models/kona-docks/KonaPin.js":79116,"./docks/domain-models/kona-docks/MahinaDock.js":71283,"./docks/domain-models/kona-docks/OhanaDock.js":43530,"./docks/domain-models/mixins/ConnectionMixin.js":43775,"./docks/domain-models/mixins/DockProjectWithRailingsMixin.js":25830,"./docks/domain-models/mixins/DockProjectWithRoofsMixin.js":60998,"./docks/domain-models/mixins/DockWithAccessoriesMixin.js":6364,"./docks/domain-models/mixins/DockWithGroupingMixin.js":18313,"./docks/domain-models/mixins/DockWithRailingsMixin.js":16461,"./docks/domain-models/mixins/FramedComponentMixin.js":36887,"./docks/domain-models/mixins/GangwayAttachableDockMixin.js":61061,"./docks/domain-models/mixins/JoistGeneratorMixin.js":6437,"./docks/domain-models/mixins/PitchedRoofMixin.js":18934,"./docks/domain-models/mixins/ProjectWaterDepthMixin.js":10962,"./docks/domain-models/mixins/ProjectWithDockGroupsMixin.js":32723,"./docks/domain-models/mixins/SelfOrientingRoofMixin.js":76360,"./docks/domain-models/mixins/StructuralFoundationWithFramingLevelMixin.js":57129,"./docks/domain-models/mixins/TrussGeneratorMixin.js":42903,"./docks/domain-models/mixins/WoodFrameHipRoofMixin.js":31908,"./docks/domain-models/railings/DockRailingCollection.js":86580,"./docks/domain-models/railings/DockRailingRun.js":59503,"./docks/domain-models/railings/DockRailingSection.js":23525,"./docks/domain-models/railings/DockRailingStyle.js":64463,"./domain-models/AdditionalLineItemComponent.js":63019,"./domain-models/Alignment.js":77869,"./domain-models/ArbitraryDimensionAnnotation.js":20149,"./domain-models/BreakdownElement.js":67287,"./domain-models/BreakdownLineItem.js":17130,"./domain-models/BreakdownLineItemCollection.js":44622,"./domain-models/BreakdownPricingStrategy.js":95348,"./domain-models/BulkMaterial.js":98683,"./domain-models/CategoryHeaderLineItem.js":34794,"./domain-models/CircularRail.js":69435,"./domain-models/ComponentColor.js":43320,"./domain-models/CompositePropertiesCollection.js":84514,"./domain-models/ConnectableFrame.js":37937,"./domain-models/Connector.js":68243,"./domain-models/CoveringMaterial.js":75086,"./domain-models/CreasedCornerCurve.js":74225,"./domain-models/CubicBezierExtrusionMaterial.js":48511,"./domain-models/CutLengthMaterialLineItem.js":7568,"./domain-models/Cylinder.js":41776,"./domain-models/DeleteableBreakdownLineItem.js":8275,"./domain-models/DividerProperty.js":9500,"./domain-models/EditableBreakdownElement.js":36539,"./domain-models/EditableMarginPercentageLineItem.js":81813,"./domain-models/EditableMultiplierLineItem.js":21856,"./domain-models/EditablePricingLineItem.js":94263,"./domain-models/EditableQuantityMultiplierLineItem.js":5393,"./domain-models/EditableQuantityPricingLineItem.js":68720,"./domain-models/EditableUnitPricePricingLineItem.js":92096,"./domain-models/ExtrusionMaterial.js":30202,"./domain-models/ExtrusionRail.js":74215,"./domain-models/Framer.js":73399,"./domain-models/FramingDescriptor.js":61447,"./domain-models/FreestandingRoof.js":80866,"./domain-models/GlassPanel.js":81996,"./domain-models/GradientAnnotation.js":72539,"./domain-models/LumberMaterial.js":96100,"./domain-models/MaterialAggregator.js":77030,"./domain-models/MaterialListProperty.js":15838,"./domain-models/MaterialPricingLineItem.js":6556,"./domain-models/MaterialPricingStrategy.js":54400,"./domain-models/MetalStairTread.js":35032,"./domain-models/MetalStairway.js":82188,"./domain-models/MiterCurve.js":390,"./domain-models/MiterLineCurve.js":39064,"./domain-models/MultiStateToggle.js":2932,"./domain-models/NormalPostGeometryStrategy.js":36310,"./domain-models/ObjectKeyMap.js":5090,"./domain-models/OverlappingPropertiesCollection.js":25630,"./domain-models/Platform.js":8297,"./domain-models/PricingSource.js":60115,"./domain-models/ProjectedLocator.js":35668,"./domain-models/PropertiesCollection.js":67603,"./domain-models/Rail.js":2198,"./domain-models/RectangularGeometryOffsetHelper.js":87763,"./domain-models/ReferenceMaterialSpecifier.js":57418,"./domain-models/RepeatingEditableProperty.js":14244,"./domain-models/RepeatingEditablePropertyWrapper.js":41409,"./domain-models/SelectPropertySupport.js":38536,"./domain-models/SteelChannel.js":11464,"./domain-models/SteelExtrusion.js":72596,"./domain-models/SteppedStructureConnector.js":28823,"./domain-models/Stringer.js":76816,"./domain-models/StructuralFoundation.js":55848,"./domain-models/SubtotalLineItem.js":69979,"./domain-models/Surface.js":16727,"./domain-models/ThunderCloud3DModel.js":57473,"./domain-models/ThunderCloudAngleAnnotation.js":39463,"./domain-models/ThunderCloudBadgeTextAnnotation.js":34732,"./domain-models/ThunderCloudBoard.js":83465,"./domain-models/ThunderCloudComponent.js":83102,"./domain-models/ThunderCloudComponentFrom3DModel.js":41908,"./domain-models/ThunderCloudDimensionAnnotation.js":44476,"./domain-models/ThunderCloudEdgeAnnotation.js":98305,"./domain-models/ThunderCloudExternalObjectCache.js":84255,"./domain-models/ThunderCloudExtrudedPolygon.js":12002,"./domain-models/ThunderCloudLocatorAnnotation.js":16994,"./domain-models/ThunderCloudLocatorCircleAnnotation.js":38374,"./domain-models/ThunderCloudLocatorRectangleAnnotation.js":33603,"./domain-models/ThunderCloudMaterialList.js":23696,"./domain-models/ThunderCloudMeasurementAnnotation.js":56768,"./domain-models/ThunderCloudModel3DRepository.js":18719,"./domain-models/ThunderCloudOffsetTextDimensionAnnotation.js":52832,"./domain-models/ThunderCloudProject.js":73164,"./domain-models/ThunderCloudRotatable3DModelComponent.js":66886,"./domain-models/ThunderCloudStairHeightAnnotation.js":63106,"./domain-models/ThunderCloudTextAnnotation.js":9343,"./domain-models/TopLevelComponent.js":54798,"./domain-models/UnitProvider.js":24421,"./domain-models/UnknownMaterialSpecifier.js":46103,"./domain-models/VerticalPostGeometryStrategy.js":29531,"./domain-models/VerticalPostRailingPost.js":94046,"./domain-models/VerticalPostRailingSection.js":99105,"./domain-models/VerticalPostRailingSectionDefaults.js":99831,"./domain-models/VerticalPostRailingSectionDelegate.js":89682,"./domain-models/Zone.js":47256,"./domain-models/config/thundercloudConfigValues.js":81428,"./domain-models/config/thundercloudProjectBaseConfig.js":56124,"./domain-models/config/thundercloudProjectConfig.js":22809,"./domain-models/config/utils/areConfigsEqual.js":75450,"./domain-models/config/utils/buildPostMountStyleConfig.js":38611,"./domain-models/config/utils/buildProjectConfig.js":38282,"./domain-models/config/utils/buildRailingStyleConfig.js":90462,"./domain-models/config/utils/shouldShowProperty.js":51486,"./domain-models/cross-section/ArcPathSegment.js":76385,"./domain-models/cross-section/CirclePathSegment.js":20901,"./domain-models/cross-section/CrossSection.js":88646,"./domain-models/cross-section/CubicBezierPathSegment.js":23202,"./domain-models/cross-section/LinePathSegment.js":1487,"./domain-models/cross-section/PolygonPathSegment.js":86755,"./domain-models/cross-section/RectanglePathSegment.js":56214,"./domain-models/geometry/ThunderCloudRectangle.js":45641,"./domain-models/helpers/SurfaceCoveringMaterialCalculator.js":36189,"./domain-models/material-processors/CategorizedMaterialProcessor.js":29906,"./domain-models/material-processors/ConsolidationProcessor.js":87960,"./domain-models/material-processors/ManufacturedLengthLinearMaterialProcessor.js":8519,"./domain-models/material-processors/MaterialProcessor.js":42525,"./domain-models/material-processors/RemoveZeroQuantityProcessor.js":18371,"./domain-models/material-processors/RoundUpProcessor.js":69515,"./domain-models/material-processors/UnitRoundUpProcessor.js":55093,"./domain-models/mixins/CompositionMixin.js":20632,"./domain-models/mixins/ContainEndEdgesOnSideEdgesSnappingMixin.js":87991,"./domain-models/mixins/EqualSpacedDistanceMixin.js":80365,"./domain-models/mixins/ExtrusionMixin.js":28219,"./domain-models/mixins/MaterialLineItemMixin.js":42638,"./domain-models/mixins/PropertiesCollectionMixin.js":3569,"./domain-models/mixins/SmartJSONClone.js":17043,"./domain-models/mixins/StrategyProjectConfigRadiatorMixin.js":24360,"./domain-models/mixins/SystemStrategyRadiatorMixin.js":87032,"./domain-models/mixins/ThunderCloudComponentMixin.js":19744,"./domain-models/mixins/TopLevelComponentMixin.js":95052,"./domain-models/plan-background/PDFImageGenerator.js":73157,"./domain-models/plan-background/PlanBackground.js":27154,"./domain-models/plan-background/PlanImageGenerator.js":78920,"./domain-models/plan-background/PlanScale.js":4558,"./domain-models/plan-background/PlanScaleMeasurement.js":22184,"./domain-models/roles.js":80317,"./domain-models/roof-framing/FlatRoofFraming.js":21125,"./domain-models/roof-framing/GableRoofEndFraming.js":18126,"./domain-models/roof-framing/GableRoofFraming.js":50549,"./domain-models/roof-framing/RoofFraming.js":9664,"./domain-models/roofs/FlatRoof.js":17087,"./domain-models/roofs/GableRoof.js":48119,"./domain-models/roofs/Roof.js":34076,"./ezdock/domain-models/EZDock.js":37793,"./ezdock/domain-models/EZDock3DComponent.js":67275,"./ezdock/domain-models/EZDockCommonUnits.js":82253,"./ezdock/domain-models/EZDockConnection.js":24749,"./ezdock/domain-models/EZDockGangway.js":61483,"./ezdock/domain-models/EZDockGangwayDeckingOptions.js":41588,"./ezdock/domain-models/EZDockGangwayDeckingType.js":93768,"./ezdock/domain-models/EZDockPolygonDock.js":35156,"./ezdock/domain-models/EZDockProject.js":84308,"./ezdock/domain-models/accessories/EZDockAccessory.js":41742,"./ezdock/domain-models/accessories/EZDockBench.js":48302,"./ezdock/domain-models/accessories/EZDockLadder.js":97342,"./ezdock/domain-models/boat-ports/AirAssist.js":31150,"./ezdock/domain-models/boat-ports/EZBoatPort.js":83087,"./ezdock/domain-models/boat-ports/EZBoatPortSectionConfigurations.js":29355,"./ezdock/domain-models/boat-ports/EZBoatPortSectionProvider.js":37177,"./ezdock/domain-models/boat-ports/FloatTank.js":55819,"./ezdock/domain-models/boat-ports/LongBunk.js":189,"./ezdock/domain-models/colors/EZDockColor.js":53777,"./ezdock/domain-models/colors/EZDockColors.js":49380,"./ezdock/domain-models/colors/EZDockGangwayColors.js":35716,"./ezdock/domain-models/couplers/EZDockCoupler.js":5403,"./ezdock/domain-models/couplers/EZDockCouplerLowProfile.js":77848,"./ezdock/domain-models/couplers/EZDockPocketFiller.js":16797,"./ezdock/domain-models/geometry-strategies/EZPortGeometryStrategy.js":59139,"./ezdock/domain-models/materials.js":72655,"./ezdock/domain-models/ports-and-launches/EZDockLaunch.js":28887,"./ezdock/domain-models/ports-and-launches/EZDockLaunchSection.js":8004,"./ezdock/domain-models/ports-and-launches/EZDockLaunchSectionType.js":40156,"./ezdock/domain-models/ports-and-launches/EZPort.js":37648,"./ezdock/domain-models/ports-and-launches/EZPort2iBowStop.js":24253,"./ezdock/domain-models/ports-and-launches/EZPort2iSectionType.js":24402,"./ezdock/domain-models/ports-and-launches/EZPortFullDeckBow.js":24742,"./ezdock/domain-models/ports-and-launches/EZPortMaxEntrySectionType.js":87851,"./ezdock/domain-models/ports-and-launches/EZPortMaxSectionType.js":64313,"./ezdock/domain-models/ports-and-launches/EZPortSection.js":38801,"./ezdock/domain-models/ports-and-launches/EZPortSectionType.js":57665,"./ezdock/domain-models/ports-and-launches/EZPortSectionTypes.js":41684,"./ezdock/domain-models/ports-and-launches/EZPortSmallBow.js":59465,"./ezdock/domain-models/sections/EZDockPolygonSection.js":53797,"./ezdock/domain-models/sections/EZDockPolygonSectionType.js":23301,"./ezdock/domain-models/sections/EZDockSection.js":55125,"./ezdock/domain-models/sections/EZDockSectionType.js":49237,"./ezdock/domain-models/sections/EZDockSectionTypes.js":82144,"./falcon-railings/domain-models/FalconADAHandrailExtensionTypes.js":56858,"./falcon-railings/domain-models/FalconGlassHole.js":65979,"./falcon-railings/domain-models/FalconMaterialPricingLineItem.js":5205,"./falcon-railings/domain-models/FalconRailingCollection.js":60261,"./falcon-railings/domain-models/FalconRailingOpening.js":13353,"./falcon-railings/domain-models/FalconRailingRun.js":28184,"./falcon-railings/domain-models/FalconRailingsPricingStrategy.js":73645,"./falcon-railings/domain-models/FalconRailingsProject.js":88367,"./falcon-railings/domain-models/FalconStairHeightAnnotation.js":57854,"./falcon-railings/domain-models/FalconStandoffButton.js":54648,"./falcon-railings/domain-models/blocks/FalconBaseShoeGlassBlock.js":94931,"./falcon-railings/domain-models/blocks/FalconFramedGlassRailBlock.js":14294,"./falcon-railings/domain-models/blocks/FalconNoPostGlassBlock.js":1828,"./falcon-railings/domain-models/blocks/FalconPicketRailBlock.js":53947,"./falcon-railings/domain-models/blocks/FalconRailingBlock.js":53185,"./falcon-railings/domain-models/blocks/FalconStandoffGlassBlock.js":3668,"./falcon-railings/domain-models/falconColorChoices.js":29892,"./falcon-railings/domain-models/gates/FalconGateTypes.js":67042,"./falcon-railings/domain-models/gates/FalconGlassGate.js":4125,"./falcon-railings/domain-models/gates/FalconGlassGateHinge.js":98190,"./falcon-railings/domain-models/gates/FalconPicketGate.js":16819,"./falcon-railings/domain-models/gates/FalconSingleGate.js":5063,"./falcon-railings/domain-models/infill/FalconGlassPanel.js":68773,"./falcon-railings/domain-models/infill/FalconPicket.js":60044,"./falcon-railings/domain-models/infill/FalconStandoffGlassPanel.js":94699,"./falcon-railings/domain-models/materials.js":95580,"./falcon-railings/domain-models/mount-styles/FalconFasciaMountStyle.js":46651,"./falcon-railings/domain-models/mount-styles/FalconPostMountStyle.js":9760,"./falcon-railings/domain-models/mount-styles/FalconStandardMountStyle.js":303,"./falcon-railings/domain-models/mount-styles/FalconStandoffFasciaMountStyle.js":75706,"./falcon-railings/domain-models/posts/FalconPicketRailingPost.js":18479,"./falcon-railings/domain-models/posts/FalconPicketRailingTerminalPost.js":7127,"./falcon-railings/domain-models/posts/FalconRailingCornerPost.js":88394,"./falcon-railings/domain-models/posts/FalconRailingPost.js":72175,"./falcon-railings/domain-models/posts/FalconRailingStairTransitionCornerPost.js":91784,"./falcon-railings/domain-models/posts/FalconRailingStairTransitionPost.js":4697,"./falcon-railings/domain-models/posts/FalconRailingStringerPost.js":39353,"./falcon-railings/domain-models/posts/FalconRailingTerminalPost.js":22295,"./falcon-railings/domain-models/railing-styles/FalconBaseShoeGlassRailingStyle.js":98666,"./falcon-railings/domain-models/railing-styles/FalconFramedGlassRailingStyle.js":36941,"./falcon-railings/domain-models/railing-styles/FalconGlassRailingStyle.js":78924,"./falcon-railings/domain-models/railing-styles/FalconPicketRailingStyle.js":89600,"./falcon-railings/domain-models/railing-styles/FalconRailingStyle.js":27424,"./falcon-railings/domain-models/railing-styles/FalconStandoffGlassRailingStyle.js":44775,"./falcon-railings/domain-models/railing-styles/InfinityRailingStyle.js":9297,"./falcon-railings/domain-models/railing-styles/railingStyles.js":17092,"./falcon-railings/domain-models/rails/FalconBaseShoeBottomRail.js":92058,"./falcon-railings/domain-models/rails/FalconHandrailExtension.js":66798,"./falcon-railings/domain-models/rails/FalconPicketBottomRail.js":61940,"./falcon-railings/domain-models/rails/FalconPicketRail.js":85491,"./falcon-railings/domain-models/rails/FalconPicketTopRail.js":54732,"./falcon-railings/domain-models/rails/FalconRailingsRail.js":72226,"./falcon-railings/domain-models/rails/Handrail.js":32347,"./falcon-railings/domain-models/rails/HandrailStyle.js":91186,"./falcon-railings/domain-models/rails/SecondGuard.js":30357,"./falcon-railings/domain-models/rails/TopGuard.js":98750,"./falcon-railings/domain-models/rails/handrailMountPositions.js":19716,"./falcon-railings/domain-models/rails/handrailStyles.js":68401,"./falcon-railings/domain-models/sections/FalconBaseShoeGlassRailingSection.js":25365,"./falcon-railings/domain-models/sections/FalconBlockSection.js":64226,"./falcon-railings/domain-models/sections/FalconFramedGlassRailingSection.js":86794,"./falcon-railings/domain-models/sections/FalconGlassRailingSection.js":97807,"./falcon-railings/domain-models/sections/FalconInfinityGlassRailingSection.js":40603,"./falcon-railings/domain-models/sections/FalconPicketRailingSection.js":61453,"./falcon-railings/domain-models/sections/FalconRailingSection.js":43449,"./falcon-railings/domain-models/sections/FalconStandoffGlassRailingSection.js":37220,"./falcon-railings/domain-models/stair-mount-surfaces/FalconRailingsStringerStairMountSurface.js":43412,"./falcon-railings/domain-models/stair-mount-surfaces/FalconRailingsTreadStairMountSurface.js":41349,"./geometry-strategies/CircularGeometryStrategy.js":76983,"./geometry-strategies/GeometryStrategy.js":38222,"./geometry-strategies/PolygonGeometryStrategy.js":11216,"./geometry-strategies/RectangularCutoutGeometryStrategy.js":25574,"./geometry-strategies/RectangularGeometryStrategy.js":16810,"./geometry/shapes/MutableCircle.js":3336,"./innovative-aluminum/domain-models/InnovativeAluminumProject.js":26885,"./innovative-aluminum/domain-models/layers/iaSystemsAlwaysVisibleLayers.js":21643,"./innovative-aluminum/domain-models/layers/iaSystemsAnnotationLayers.js":55201,"./innovative-aluminum/domain-models/layers/iaSystemsComponentLayers.js":97529,"./k-and-s-railings/domain-models/KAndSAntiRailBreakZone.js":79574,"./k-and-s-railings/domain-models/KAndSBlock.js":77026,"./k-and-s-railings/domain-models/KAndSBottomRail.js":99784,"./k-and-s-railings/domain-models/KAndSCutAngleAnnotation.js":27661,"./k-and-s-railings/domain-models/KAndSFramedGlassBlock.js":15489,"./k-and-s-railings/domain-models/KAndSFramedGlassSection.js":53359,"./k-and-s-railings/domain-models/KAndSFramelessGlassBlock.js":47126,"./k-and-s-railings/domain-models/KAndSFramelessGlassPanel.js":95589,"./k-and-s-railings/domain-models/KAndSFramelessGlassSection.js":27776,"./k-and-s-railings/domain-models/KAndSGlassBlock.js":41478,"./k-and-s-railings/domain-models/KAndSGlassPanel.js":99317,"./k-and-s-railings/domain-models/KAndSMaterialPricingLineItem.js":55747,"./k-and-s-railings/domain-models/KAndSOpening.js":33839,"./k-and-s-railings/domain-models/KAndSPDFGlassPanel.js":22999,"./k-and-s-railings/domain-models/KAndSPicket.js":19007,"./k-and-s-railings/domain-models/KAndSPicketBlock.js":27890,"./k-and-s-railings/domain-models/KAndSPicketSection.js":21388,"./k-and-s-railings/domain-models/KAndSPostSpacingHelper.js":80104,"./k-and-s-railings/domain-models/KAndSProject.js":98198,"./k-and-s-railings/domain-models/KAndSRail.js":47999,"./k-and-s-railings/domain-models/KAndSRailLengthHelper.js":63595,"./k-and-s-railings/domain-models/KAndSRailSleeve.js":8567,"./k-and-s-railings/domain-models/KAndSRailingCollection.js":91659,"./k-and-s-railings/domain-models/KAndSRailingPlacementStrategy.js":58773,"./k-and-s-railings/domain-models/KAndSRailingRun.js":72718,"./k-and-s-railings/domain-models/KAndSRailingSection.js":13356,"./k-and-s-railings/domain-models/KAndSSurfaceStairPostSpacingHelper.js":48280,"./k-and-s-railings/domain-models/KAndSTopRail.js":6256,"./k-and-s-railings/domain-models/annotations/KAndSAngleAnnotation.js":94966,"./k-and-s-railings/domain-models/annotations/KAndSDimensionAnnotation.js":92493,"./k-and-s-railings/domain-models/annotations/KAndSImaginaryEdgeAnnotation.js":68033,"./k-and-s-railings/domain-models/annotations/KAndSTextAnnotation.js":37700,"./k-and-s-railings/domain-models/gates/KAndSBlockGate.js":27460,"./k-and-s-railings/domain-models/gates/KAndSBlockGate180Degree.js":76581,"./k-and-s-railings/domain-models/gates/KAndSRailStyleGateType.js":57895,"./k-and-s-railings/domain-models/gates/KandSGateTypes.js":53362,"./k-and-s-railings/domain-models/helpers/KAndSFramelessGlassPostLayoutEdgeInsetHelper.js":72287,"./k-and-s-railings/domain-models/helpers/KAndSPostLayoutEdgeInsetHelper.js":55559,"./k-and-s-railings/domain-models/kandsColors.js":57963,"./k-and-s-railings/domain-models/kandsLayers.js":15189,"./k-and-s-railings/domain-models/materials.js":93050,"./k-and-s-railings/domain-models/platform-types/KAndSConcretePlatformType.js":89081,"./k-and-s-railings/domain-models/platform-types/KAndSWoodPlatformType.js":40019,"./k-and-s-railings/domain-models/post-mount-styles/KAndSPostFasciaMountStyle.js":67022,"./k-and-s-railings/domain-models/post-mount-styles/KAndSPostMountStyle.js":73739,"./k-and-s-railings/domain-models/post-mount-styles/KAndSPostSurfaceMountStyle.js":28608,"./k-and-s-railings/domain-models/posts/KAndSCornerPost.js":34808,"./k-and-s-railings/domain-models/posts/KAndSFramelessGlassPost.js":46122,"./k-and-s-railings/domain-models/posts/KAndSGateFramePost.js":52189,"./k-and-s-railings/domain-models/posts/KAndSPost.js":80265,"./k-and-s-railings/domain-models/posts/KAndSRailIntersectionLinePost.js":46742,"./k-and-s-railings/domain-models/posts/KAndSStairTransitionPost.js":66955,"./k-and-s-railings/domain-models/posts/KAndSTerminalPost.js":19201,"./k-and-s-railings/domain-models/rail-shapes/KAndSCircleRailShapeExtrusion.js":62901,"./k-and-s-railings/domain-models/rail-shapes/KAndSCurvedRailShapeExtrusion.js":18724,"./k-and-s-railings/domain-models/rail-shapes/KAndSOvalRailShapeExtrusion.js":80377,"./k-and-s-railings/domain-models/rail-shapes/KAndSRailShape.js":35940,"./k-and-s-railings/domain-models/rail-shapes/KAndSRailShapeExtrusion.js":81389,"./k-and-s-railings/domain-models/rail-shapes/kandsRailShapes.js":7531,"./k-and-s-railings/domain-models/railing-styles/KAndSFramedGlassRailingStyle.js":92339,"./k-and-s-railings/domain-models/railing-styles/KAndSFramelessGlassRailingStyle.js":96706,"./k-and-s-railings/domain-models/railing-styles/KAndSPicketRailingStyle.js":44614,"./k-and-s-railings/domain-models/railing-styles/KAndSRailingStyle.js":57590,"./k-and-s-railings/domain-models/railing-styles/kandsRailingStyles.js":68989,"./kwikclamp/domain-models/KwikclampCollection.js":62423,"./kwikclamp/domain-models/KwikclampEndWallConnection.js":9526,"./kwikclamp/domain-models/KwikclampKickplate.js":32805,"./kwikclamp/domain-models/KwikclampOpening.js":90675,"./kwikclamp/domain-models/KwikclampPlacementStrategy.js":82417,"./kwikclamp/domain-models/KwikclampPricingStrategy.js":52320,"./kwikclamp/domain-models/KwikclampProject.js":54474,"./kwikclamp/domain-models/KwikclampRailingSection.js":216,"./kwikclamp/domain-models/KwikclampRun.js":63562,"./kwikclamp/domain-models/blocks/KwikclampBarrierBlock.js":85976,"./kwikclamp/domain-models/blocks/KwikclampBikewayBlock.js":64489,"./kwikclamp/domain-models/blocks/KwikclampCornerBlock.js":20120,"./kwikclamp/domain-models/blocks/KwikclampStandardBlock.js":81304,"./kwikclamp/domain-models/gates/KwikclampGateTypes.js":18026,"./kwikclamp/domain-models/gates/KwikclampMezzanineGate.js":85004,"./kwikclamp/domain-models/gates/KwikclampSlidingGate.js":56059,"./kwikclamp/domain-models/gates/KwikclampSlidingGateBlock.js":10774,"./kwikclamp/domain-models/gates/KwikclampSlidingGateKickplate.js":7213,"./kwikclamp/domain-models/gates/KwikclampSlidingGatePost.js":92665,"./kwikclamp/domain-models/gates/KwikclampSlidingGateRail.js":47299,"./kwikclamp/domain-models/gates/KwikclampSlidingGateSection.js":48960,"./kwikclamp/domain-models/kwikclampLayers.js":36761,"./kwikclamp/domain-models/layout-helpers/KwikclampPostLayoutInsetHelper.js":56711,"./kwikclamp/domain-models/layout-helpers/KwikclampWallMountPostLayoutInsetHelper.js":24846,"./kwikclamp/domain-models/materials.js":64840,"./kwikclamp/domain-models/mount-styles/KwikClampPostMountStyle.js":35504,"./kwikclamp/domain-models/mount-styles/KwikclampPostFasciaMountStyle.js":93961,"./kwikclamp/domain-models/mount-styles/KwikclampPostInGroundMountStyle.js":7940,"./kwikclamp/domain-models/mount-styles/KwikclampPostSurfaceMountStyle.js":9217,"./kwikclamp/domain-models/posts/KwikclampBarrierEndPost.js":7237,"./kwikclamp/domain-models/posts/KwikclampBikewayEndPost.js":77360,"./kwikclamp/domain-models/posts/KwikclampBikewayPost.js":24697,"./kwikclamp/domain-models/posts/KwikclampDdaPost.js":15166,"./kwikclamp/domain-models/posts/KwikclampEndPost.js":88412,"./kwikclamp/domain-models/posts/KwikclampPost.js":82437,"./kwikclamp/domain-models/posts/KwikclampStandardEndPost.js":71867,"./kwikclamp/domain-models/posts/KwikclampWallMountPost.js":78648,"./kwikclamp/domain-models/railing-styles/KwikclampBarrierRailingStyle.js":89105,"./kwikclamp/domain-models/railing-styles/KwikclampBasicRailingStyle.js":81056,"./kwikclamp/domain-models/railing-styles/KwikclampBikewayRailingStyle.js":77642,"./kwikclamp/domain-models/railing-styles/KwikclampStandardRailingStyle.js":79191,"./kwikclamp/domain-models/railing-styles/KwikclampThreeRailRailingStyle.js":17326,"./kwikclamp/domain-models/railing-styles/KwikclampWallMountRailingStyle.js":39971,"./kwikclamp/domain-models/rails/KwikclampCustomRail.js":95766,"./kwikclamp/domain-models/rails/KwikclampCutRail.js":81785,"./kwikclamp/domain-models/rails/KwikclampDdaRail.js":34142,"./kwikclamp/domain-models/rails/KwikclampRail.js":78913,"./kwikclamp/domain-models/sleeveDescriptorDefinitions.js":64815,"./oasis-docks/domain-models/OasisBoatDocksProject.js":38313,"./oasis-docks/domain-models/OasisBoatLift.js":48089,"./oasis-docks/domain-models/OasisBoatLiftFramer.js":94828,"./oasis-docks/domain-models/OasisBoatLiftMotor.js":74916,"./oasis-docks/domain-models/OasisBoxCradleLift.js":32847,"./oasis-docks/domain-models/OasisBunk.js":75672,"./oasis-docks/domain-models/OasisCradleFramingDescriptor.js":82526,"./oasis-docks/domain-models/OasisCradleLiftFramer.js":70801,"./oasis-docks/domain-models/OasisDeckingSurface.js":79752,"./oasis-docks/domain-models/OasisDock.js":53405,"./oasis-docks/domain-models/OasisDockConnection.js":46801,"./oasis-docks/domain-models/OasisDockFasciaBoard.js":75518,"./oasis-docks/domain-models/OasisDockFramer.js":65115,"./oasis-docks/domain-models/OasisDockSlip.js":12379,"./oasis-docks/domain-models/OasisFlashing.js":45492,"./oasis-docks/domain-models/OasisFlatRoof.js":67751,"./oasis-docks/domain-models/OasisFramingDescriptor.js":74411,"./oasis-docks/domain-models/OasisGableRoof.js":27247,"./oasis-docks/domain-models/OasisHipRoof.js":6107,"./oasis-docks/domain-models/OasisHipRoofWoodenFramingDescriptor.js":24394,"./oasis-docks/domain-models/OasisLadderAccessory.js":42894,"./oasis-docks/domain-models/OasisLift.js":18427,"./oasis-docks/domain-models/OasisNullLift.js":46834,"./oasis-docks/domain-models/OasisPWCLift.js":52791,"./oasis-docks/domain-models/OasisPile.js":13614,"./oasis-docks/domain-models/OasisPitchedRoof.js":46873,"./oasis-docks/domain-models/OasisPontoonBoatLift.js":85230,"./oasis-docks/domain-models/OasisPontoonBoatLiftFramer.js":86099,"./oasis-docks/domain-models/OasisPontoonBoatLiftFramingDescriptor.js":90643,"./oasis-docks/domain-models/OasisPostLayoutHelper.js":2734,"./oasis-docks/domain-models/OasisPostRow.js":66462,"./oasis-docks/domain-models/OasisRoof.js":12852,"./oasis-docks/domain-models/OasisRoofFramingDescriptor.js":6529,"./oasis-docks/domain-models/OasisRoofingLevel.js":50698,"./oasis-docks/domain-models/OasisSimpleLift.js":81925,"./oasis-docks/domain-models/OasisSimpleLiftFramer.js":20160,"./oasis-docks/domain-models/OasisSimpleLiftFramingDescriptor.js":13998,"./oasis-docks/domain-models/OasisSling.js":72241,"./oasis-docks/domain-models/OasisSlingLift.js":10460,"./oasis-docks/domain-models/OasisSplitRoof.js":49030,"./oasis-docks/domain-models/OasisSplitRoofFramingDescriptor.js":7787,"./oasis-docks/domain-models/OasisStorageUnit.js":74783,"./oasis-docks/domain-models/OasisWoodenFrameHipRoof.js":66608,"./oasis-docks/domain-models/framers/OasisFlatRoofFramer.js":3751,"./oasis-docks/domain-models/framers/OasisGableRoofFramer.js":5389,"./oasis-docks/domain-models/framers/OasisHipRoofFramer.js":55521,"./oasis-docks/domain-models/framers/OasisPitchedRoofFramer.js":89927,"./oasis-docks/domain-models/framers/OasisRoofFramer.js":61836,"./oasis-docks/domain-models/framers/OasisSplitRoofFramer.js":77588,"./oasis-docks/domain-models/geometryStrategies/OasisDockSlipGeometryStrategy.js":1776,"./oasis-docks/domain-models/helpers/OasisChannelPlateHelper.js":23981,"./oasis-docks/domain-models/materials.js":83265,"./oasis-docks/domain-models/oasisLayers.js":83724,"./oasis-docks/domain-models/railings/OasisPostMountStyle.js":71968,"./oasis-docks/domain-models/railings/OasisRailingBlock.js":28729,"./oasis-docks/domain-models/railings/OasisRailingCollection.js":26686,"./oasis-docks/domain-models/railings/OasisRailingPost.js":27688,"./oasis-docks/domain-models/railings/OasisRailingRun.js":83073,"./oasis-docks/domain-models/railings/OasisRailingSection.js":24148,"./oasis-docks/domain-models/railings/OasisRailingStyle.js":56677,"./platforms/domain-models/AccessPlatform.js":12154,"./platforms/domain-models/AccessPlatformRailingCollection.js":15336,"./platforms/domain-models/AccessPlatformRailingRun.js":72339,"./platforms/domain-models/AccessPlatformStrategy.js":33775,"./platforms/domain-models/DefaultAccessPlatformStrategy.js":67162,"./platforms/domain-models/PlatformSupport.js":37697,"./platforms/domain-models/PlatformSupportCollection.js":32273,"./platforms/domain-models/safesmart/AdaptaStepAdjustableFoot.js":46458,"./platforms/domain-models/safesmart/AdaptaStepPlatformRailingSection.js":74541,"./platforms/domain-models/safesmart/AdaptaStepPlatformStrategy.js":86427,"./platforms/domain-models/safesmart/AdaptaStepPlatformSupport.js":67847,"./platforms/domain-models/safesmart/AdaptaStepPlatformSupportCollection.js":16403,"./platforms/domain-models/safesmart/AdaptaStepWeldedSupportLeg.js":79485,"./railing-depot/domain-models/RailingDepotCollection.js":52364,"./railing-depot/domain-models/RailingDepotComponentColors.js":72285,"./railing-depot/domain-models/RailingDepotGlassPanel.js":25278,"./railing-depot/domain-models/RailingDepotPicket.js":35680,"./railing-depot/domain-models/RailingDepotProject.js":93003,"./railing-depot/domain-models/RailingDepotRailingSection.js":78175,"./railing-depot/domain-models/RailingDepotRun.js":98503,"./railing-depot/domain-models/blocks/RailingDepotCableBlock.js":24587,"./railing-depot/domain-models/blocks/RailingDepotGlassBlock.js":73012,"./railing-depot/domain-models/blocks/RailingDepotPicketBlock.js":66144,"./railing-depot/domain-models/blocks/RailingDepotPipeBlock.js":83220,"./railing-depot/domain-models/helpers/RailingDepotGuardrailPostLayoutInsetHelper.js":65619,"./railing-depot/domain-models/helpers/RailingDepotPostLayoutInsetHelper.js":61681,"./railing-depot/domain-models/helpers/RailingDepotRailLayoutInsetHelper.js":39379,"./railing-depot/domain-models/materials.js":20834,"./railing-depot/domain-models/mount-styles/RailingDepotPostFasciaMountStyle.js":28396,"./railing-depot/domain-models/mount-styles/RailingDepotPostMountStyle.js":2933,"./railing-depot/domain-models/mount-styles/RailingDepotPostSurfaceMountStyle.js":83822,"./railing-depot/domain-models/posts/RailingDepotPipePost.js":42298,"./railing-depot/domain-models/posts/RailingDepotPost.js":20702,"./railing-depot/domain-models/posts/RailingDepotSquarePost.js":54649,"./railing-depot/domain-models/posts/RailingDepotSquarePostWithSleeves.js":66864,"./railing-depot/domain-models/railing-styles/RailingDepotCableRailingStyle.js":6314,"./railing-depot/domain-models/railing-styles/RailingDepotGlassRailingStyle.js":27295,"./railing-depot/domain-models/railing-styles/RailingDepotGuardrailRailingStyle.js":90202,"./railing-depot/domain-models/railing-styles/RailingDepotPicketRailingStyle.js":95737,"./railing-depot/domain-models/railing-styles/RailingDepotPipeRailingStyle.js":92257,"./railing-depot/domain-models/railing-styles/RailingDepotRailingStyle.js":98061,"./railing-depot/domain-models/rails/RailingDepotBottomRail.js":50449,"./railing-depot/domain-models/rails/RailingDepotCable.js":97169,"./railing-depot/domain-models/rails/RailingDepotGuardrail.js":36461,"./railing-depot/domain-models/rails/RailingDepotPipeRail.js":46494,"./railing-depot/domain-models/rails/RailingDepotRail.js":16610,"./railing-depot/domain-models/rails/RailingDepotTopRail.js":3179,"./railings-preview/domain-models/RailingsPreviewProject.js":99813,"./railings/domain-models/GeneratedPlatform.js":93250,"./railings/domain-models/GeneratedPlatformWithDripEdge.js":53416,"./railings/domain-models/GeneratedStairs.js":7491,"./railings/domain-models/LegacyEdgeIntersectionHelper.js":35337,"./railings/domain-models/LevelSurfaceRailingPlacementStrategy.js":68689,"./railings/domain-models/PostContext.js":68289,"./railings/domain-models/PostDescriptor.js":76281,"./railings/domain-models/RailingDesignerProject.js":43812,"./railings/domain-models/RailingMountStringer.js":66509,"./railings/domain-models/ResizableGate.js":59214,"./railings/domain-models/SingleGate.js":35961,"./railings/domain-models/StairSurfaceRailingPlacementStrategy.js":45708,"./railings/domain-models/ThunderCloudGate.js":84374,"./railings/domain-models/ThunderCloudHybridSurfaceRailingPlacementStrategy.js":52494,"./railings/domain-models/ThunderCloudMultiPartRailingPost.js":22391,"./railings/domain-models/ThunderCloudNullPost.js":74134,"./railings/domain-models/ThunderCloudRailingCollection.js":97477,"./railings/domain-models/ThunderCloudRailingOpening.js":14025,"./railings/domain-models/ThunderCloudRailingPlacementStrategy.js":70971,"./railings/domain-models/ThunderCloudRailingPost.js":80371,"./railings/domain-models/ThunderCloudRailingRun.js":33496,"./railings/domain-models/ThunderCloudRailingSection.js":10590,"./railings/domain-models/ThunderCloudRailingStyle.js":58684,"./railings/domain-models/ThunderCloudRailingTerminationMode.js":84692,"./railings/domain-models/city-post/CityPostBlock.js":63105,"./railings/domain-models/city-post/CityPostCable.js":28077,"./railings/domain-models/city-post/CityPostCableRailingStyle.js":43988,"./railings/domain-models/city-post/CityPostCableWrapBlock.js":88e3,"./railings/domain-models/city-post/CityPostCollection.js":27878,"./railings/domain-models/city-post/CityPostComponentColors.js":19535,"./railings/domain-models/city-post/CityPostMaterialPricingLineItem.js":16180,"./railings/domain-models/city-post/CityPostProject.js":11685,"./railings/domain-models/city-post/CityPostRail.js":96846,"./railings/domain-models/city-post/CityPostRailingRun.js":99307,"./railings/domain-models/city-post/CityPostSection.js":60943,"./railings/domain-models/city-post/Posts/CityPostPost.js":17588,"./railings/domain-models/city-post/Posts/CityPostPostContext.js":87177,"./railings/domain-models/city-post/Posts/CityPostSingleCornerPost.js":84585,"./railings/domain-models/city-post/Posts/CityPostSingleLevelToStairTerminalCornerPost.js":20485,"./railings/domain-models/city-post/Posts/CityPostSingleTerminalCornerPost.js":80725,"./railings/domain-models/city-post/Posts/CityPostStairPost.js":26039,"./railings/domain-models/city-post/Posts/CityPostStairTerminalPost.js":60255,"./railings/domain-models/city-post/Posts/CityPostTerminalPost.js":28288,"./railings/domain-models/city-post/cityPostLayers.js":31224,"./railings/domain-models/city-post/materials.js":14545,"./railings/domain-models/city-post/post-mount-styles/CityPostPostFasciaMountStyle.js":85727,"./railings/domain-models/city-post/post-mount-styles/CityPostPostSurfaceMountStyle.js":74079,"./railings/domain-models/defaultRailingLayers.js":5895,"./railings/domain-models/generic/ExtrusionPost.js":18475,"./railings/domain-models/generic/InfillHelper.js":28622,"./railings/domain-models/generic/blocks/HorizontalBarBlock.js":3679,"./railings/domain-models/generic/blocks/PicketBlock.js":73964,"./railings/domain-models/generic/blocks/RailingBlockRailFactory.js":42632,"./railings/domain-models/generic/blocks/ThunderCloudExtrusionPanelBlock.js":68384,"./railings/domain-models/generic/blocks/ThunderCloudPanelBlock.js":43481,"./railings/domain-models/generic/blocks/ThunderCloudRailingBlock.js":84155,"./railings/domain-models/generic/mixins/RailingBlockBottomRailMixin.js":22766,"./railings/domain-models/generic/mixins/RailingBlockTopRailMixin.js":29876,"./railings/domain-models/helpers/AngleAnnotationHelper.js":35080,"./railings/domain-models/helpers/AnnotationsFactory.js":36363,"./railings/domain-models/helpers/LinearDimensionAnnotationHelper.js":90348,"./railings/domain-models/helpers/RailingPostOrientationHelper.js":21416,"./railings/domain-models/helpers/ThunderCloudAnnotationHelper.js":37458,"./railings/domain-models/helpers/ThunderCloudPostLayoutEdgeInsetHelper.js":43357,"./railings/domain-models/helpers/WarningAnnotationHelper.js":17171,"./railings/domain-models/hollaender/HollaenderPanel.js":83383,"./railings/domain-models/hollaender/HollaenderProject.js":41456,"./railings/domain-models/hollaender/HollaenderRail.js":90161,"./railings/domain-models/hollaender/hollaenderLayers.js":93491,"./railings/domain-models/hollaender/hollaenderProjectConfig.js":38578,"./railings/domain-models/hollaender/posts/HollaenderAdjustableCornerPost.js":27877,"./railings/domain-models/hollaender/posts/HollaenderEndPost.js":13254,"./railings/domain-models/hollaender/posts/HollaenderLinePost.js":4777,"./railings/domain-models/hollaender/posts/HollaenderPost.js":80791,"./railings/domain-models/hollaender/posts/HollaenderRightCornerPost.js":60392,"./railings/domain-models/mixins/DataDrivenRailingsProjectMixin.js":33046,"./railings/domain-models/mixins/Model3DRightCornerSleeveMixin.js":93969,"./railings/domain-models/mixins/Model3DSleeveMixin.js":1412,"./railings/domain-models/mixins/RailingPostWith3DModelBaseplateMixin.js":18729,"./railings/domain-models/mixins/RailingPostWith3DModelSleeveMixin.js":10712,"./railings/domain-models/mixins/RailingPostWithExtrusionSleeveMixin.js":30301,"./railings/domain-models/mixins/ThunderCloudRailingPlacementStrategyMixin.js":88317,"./railings/domain-models/mixins/block/ExtrusionPanelBlockMixin.js":59556,"./railings/domain-models/mixins/block/HorizontalBarBlockMixin.js":92214,"./railings/domain-models/mixins/block/PicketBlockMixin.js":99343,"./railings/domain-models/mixins/legacy/LegacyPostMountStyleMixin.js":53627,"./railings/domain-models/mixins/legacy/LegacyProjectMixin.js":6706,"./railings/domain-models/mixins/legacy/LegacyRailingCollectionMixin.js":97209,"./railings/domain-models/mixins/legacy/LegacyRailingRunMixin.js":71096,"./railings/domain-models/mixins/legacy/LegacyRailingSectionMixin.js":26566,"./railings/domain-models/omega/OmegaAngleBracket.js":98430,"./railings/domain-models/omega/OmegaCombinedPricingNote.js":37264,"./railings/domain-models/omega/OmegaCornerCap.js":88024,"./railings/domain-models/omega/OmegaDoubleInlineBracket.js":24335,"./railings/domain-models/omega/OmegaGuardrailSection.js":32487,"./railings/domain-models/omega/OmegaInlineBracket.js":97368,"./railings/domain-models/omega/OmegaInsideCornerBracket.js":28772,"./railings/domain-models/omega/OmegaLiftOutDoubleRailAssembly.js":46233,"./railings/domain-models/omega/OmegaLiftOutRailAssembly.js":63816,"./railings/domain-models/omega/OmegaProject.js":44246,"./railings/domain-models/omega/OmegaRail.js":28831,"./railings/domain-models/omega/OmegaRailBaseMountStrategy.js":28096,"./railings/domain-models/omega/OmegaRailComponent.js":62623,"./railings/domain-models/omega/OmegaRailInlineMountStrategy.js":25072,"./railings/domain-models/omega/OmegaRailLengthHelper.js":56267,"./railings/domain-models/omega/OmegaRailLiftOutMountStrategy.js":54758,"./railings/domain-models/omega/OmegaRailPanel.js":281,"./railings/domain-models/omega/OmegaRailSurfaceMountStrategy.js":85298,"./railings/domain-models/omega/OmegaRailingCollection.js":17163,"./railings/domain-models/omega/OmegaRailingOpening.js":46975,"./railings/domain-models/omega/OmegaRailingRun.js":79374,"./railings/domain-models/omega/OmegaRemovableDoubleRailHinge.js":55564,"./railings/domain-models/omega/OmegaRemovableRailHinge.js":32471,"./railings/domain-models/omega/OmegaWrapAroundFlare.js":97108,"./railings/domain-models/omega/drawings2D/handles/OmegaSectionHandle.js":17222,"./railings/domain-models/omega/gates/Omega3DRailComponent.js":82388,"./railings/domain-models/omega/gates/OmegaDoubleSelfClosingGate.js":36843,"./railings/domain-models/omega/gates/OmegaDoubleSwingGate.js":28368,"./railings/domain-models/omega/gates/OmegaGate.js":1519,"./railings/domain-models/omega/gates/OmegaGateTypes.js":81362,"./railings/domain-models/omega/gates/OmegaLiftOutGate.js":64034,"./railings/domain-models/omega/gates/OmegaRailGate.js":89007,"./railings/domain-models/omega/gates/OmegaRemovableRailGate.js":72840,"./railings/domain-models/omega/gates/OmegaSelfClosingGate.js":24740,"./railings/domain-models/omega/gates/OmegaSwingGate.js":66135,"./railings/domain-models/omega/gates/OmegaSwingGateAssembly.js":2123,"./railings/domain-models/omega/gates/OmegaVariableWidthGate.js":29141,"./railings/domain-models/omega/gates/omegaSwingGateArmWidths.js":62844,"./railings/domain-models/omega/materials.js":74666,"./railings/domain-models/omega/omegaComponentColors.js":56780,"./railings/domain-models/omega/omegaLayers.js":28021,"./railings/domain-models/omega/posts/OmegaGuardrailPost.js":48028,"./railings/domain-models/post-mount-styles/ThunderCloudNoPlatformPostMountStyle.js":1617,"./railings/domain-models/post-mount-styles/ThunderCloudPostMountStyle.js":83741,"./railings/domain-models/sleeves/AdjustableCorner3DModelSleeve.js":24212,"./railings/domain-models/sleeves/AdjustableSlope3DModelSleeve.js":29854,"./railings/domain-models/sleeves/CornerExtrusionSleeve.js":2650,"./railings/domain-models/sleeves/CornerSleeve.js":56593,"./railings/domain-models/sleeves/Model3DRightCornerSleeve.js":79041,"./railings/domain-models/sleeves/Model3DSleeve.js":66016,"./railings/domain-models/sleeves/Sleeve.js":94060,"./railings/domain-models/sleeves/SleeveCategories.js":31651,"./railings/domain-models/sleeves/sleeve-descriptor-definitions/defaultSleeveDescriptorDefinitions.js":71300,"./railings/domain-models/sleeves/sleeve-descriptor-definitions/generic2inPipeSleeveDescriptorDefinitions.js":26511,"./railings/domain-models/stair-mount-surfaces/StairMountSurface.js":11496,"./railings/domain-models/stair-mount-surfaces/ThunderCloudStairMountTreadFixedDistanceSurface.js":3262,"./railings/domain-models/stair-mount-surfaces/ThundercloudStairMountTreadSurface.js":76427,"./rogue-fabricators/domain-models/Infill/RogueFabricatorsPicket.js":61345,"./rogue-fabricators/domain-models/RogueFabricatorsComponentColors.js":77281,"./rogue-fabricators/domain-models/RogueFabricatorsExtrusionHole.js":28731,"./rogue-fabricators/domain-models/RogueFabricatorsExtrusionMaterial.js":45208,"./rogue-fabricators/domain-models/RogueFabricatorsExtrusionWithHoles.js":97010,"./rogue-fabricators/domain-models/RogueFabricatorsGeminiTerminalRailLoop.js":11381,"./rogue-fabricators/domain-models/RogueFabricatorsHorizontalBar.js":55507,"./rogue-fabricators/domain-models/RogueFabricatorsPonyWall.js":89064,"./rogue-fabricators/domain-models/RogueFabricatorsPricingStrategy.js":14661,"./rogue-fabricators/domain-models/RogueFabricatorsProject.js":61159,"./rogue-fabricators/domain-models/RogueFabricatorsRailingCollection.js":57674,"./rogue-fabricators/domain-models/RogueFabricatorsRailingPlacementStrategy.js":2902,"./rogue-fabricators/domain-models/RogueFabricatorsRailingRun.js":17229,"./rogue-fabricators/domain-models/RogueFabricatorsStairPostSpacingHelper.js":79256,"./rogue-fabricators/domain-models/annotationProperties.js":15096,"./rogue-fabricators/domain-models/annotations/RogueFabricatorsDimensionAnnotation.js":34290,"./rogue-fabricators/domain-models/blocks/RogueFabricatorsGeminiBlock.js":44041,"./rogue-fabricators/domain-models/blocks/RogueFabricatorsHorizontalBarBlock.js":96823,"./rogue-fabricators/domain-models/blocks/RogueFabricatorsPicketRailingBlock.js":38252,"./rogue-fabricators/domain-models/blocks/RogueFabricatorsRailingBlock.js":42492,"./rogue-fabricators/domain-models/helpers/RogueFabricatorsColosseumPostLayoutEdgeInsetHelper.js":35730,"./rogue-fabricators/domain-models/helpers/RogueFabricatorsComponentLayoutEdgeInsetHelper.js":41455,"./rogue-fabricators/domain-models/helpers/RogueFabricatorsConnectedExtrusionsMiterHelper.js":34662,"./rogue-fabricators/domain-models/helpers/RogueFabricatorsCoreMountPostLayoutEdgeInsetHelper.js":36964,"./rogue-fabricators/domain-models/helpers/RogueFabricatorsHandGrabPostLayoutEdgeInsetHelper.js":97691,"./rogue-fabricators/domain-models/helpers/RogueFabricatorsJavelinComponentLayoutEdgeInsetHelper.js":43506,"./rogue-fabricators/domain-models/helpers/RogueFabricatorsPostLayoutEdgeInsetHelper.js":84726,"./rogue-fabricators/domain-models/helpers/columns.js":93387,"./rogue-fabricators/domain-models/helpers/formatterOptions.js":86446,"./rogue-fabricators/domain-models/materials.js":32972,"./rogue-fabricators/domain-models/post-mount-styles/RogueFabricatorsCoreMountStyle.js":72821,"./rogue-fabricators/domain-models/post-mount-styles/RogueFabricatorsFasciaMountStyle.js":34571,"./rogue-fabricators/domain-models/post-mount-styles/RogueFabricatorsPostMountStyle.js":10736,"./rogue-fabricators/domain-models/post-mount-styles/RogueFabricatorsSurfaceMountStyle.js":63139,"./rogue-fabricators/domain-models/post-mount-styles/RogueFabricatorsWallMountStyle.js":76234,"./rogue-fabricators/domain-models/posts/RogueFabricatorsCoreMountPipePost.js":66780,"./rogue-fabricators/domain-models/posts/RogueFabricatorsDoubleBarPost.js":33806,"./rogue-fabricators/domain-models/posts/RogueFabricatorsHandGrabPost.js":95537,"./rogue-fabricators/domain-models/posts/RogueFabricatorsHandGrabPostLeg.js":44421,"./rogue-fabricators/domain-models/posts/RogueFabricatorsPerpendicularSlopeTopDoubleBarPost.js":2662,"./rogue-fabricators/domain-models/posts/RogueFabricatorsRailingPost.js":61872,"./rogue-fabricators/domain-models/posts/RogueFabricatorsStringerMountDoubleBarPost.js":79445,"./rogue-fabricators/domain-models/posts/RogueFabricatorsTaperedLeg.js":35621,"./rogue-fabricators/domain-models/posts/RogueFabricatorsTreadMountDoubleBarPost.js":27585,"./rogue-fabricators/domain-models/posts/RogueFabricatorsTreadMountRailingPost.js":42039,"./rogue-fabricators/domain-models/posts/RogueFabricatorsTreadMountTopDoubleBarPost.js":47648,"./rogue-fabricators/domain-models/railing-styles/RogueFabricatorsAchillesRailingStyle.js":72834,"./rogue-fabricators/domain-models/railing-styles/RogueFabricatorsColosseumRailingStyle.js":46353,"./rogue-fabricators/domain-models/railing-styles/RogueFabricatorsEvaRailingStyle.js":64817,"./rogue-fabricators/domain-models/railing-styles/RogueFabricatorsGeminiRailingStyle.js":19502,"./rogue-fabricators/domain-models/railing-styles/RogueFabricatorsHandGrabRailingStyle.js":45618,"./rogue-fabricators/domain-models/railing-styles/RogueFabricatorsHorizontalBarRailingStyle.js":66262,"./rogue-fabricators/domain-models/railing-styles/RogueFabricatorsJavelinRailingStyle.js":19456,"./rogue-fabricators/domain-models/railing-styles/RogueFabricatorsLineRailingStyle.js":82631,"./rogue-fabricators/domain-models/railing-styles/RogueFabricatorsOrionRailingStyle.js":83550,"./rogue-fabricators/domain-models/railing-styles/RogueFabricatorsPantheonRailingStyle.js":94814,"./rogue-fabricators/domain-models/railing-styles/RogueFabricatorsRailingStyle.js":26917,"./rogue-fabricators/domain-models/railing-styles/RogueFabricatorsStandardRailingStyle.js":16864,"./rogue-fabricators/domain-models/railing-styles/RogueFabricatorsTritonRailingStyle.js":27927,"./rogue-fabricators/domain-models/railing-styles/RogueFabricatorsVikingRailingStyle.js":34419,"./rogue-fabricators/domain-models/railing-styles/rogueFabricatorsRailingStyles.js":39632,"./rogue-fabricators/domain-models/rails/RogueFabricatorsCircleRail.js":57174,"./rogue-fabricators/domain-models/rails/RogueFabricatorsRail.js":6338,"./rogue-fabricators/domain-models/rails/RogueFabricatorsRectangleRail.js":18037,"./rogue-fabricators/domain-models/rogueFabricatorsLayers.js":37766,"./rogue-fabricators/domain-models/sections/RogueFabricatorsRailingSection.js":72768,"./rogue-fabricators/domain-models/stair-mount-surfaces/RogueFabricatorsCoreTreadStairMountSurface.js":78321,"./rogue-fabricators/domain-models/stair-mount-surfaces/RogueFabricatorsStringerStairMountSurface.js":93512,"./rogue-fabricators/domain-models/stair-mount-surfaces/RogueFabricatorsTreadStairMountSurface.js":80006,"./waterside/domain-models/WatersideBaseDockStrategy.js":32216,"./waterside/domain-models/WatersideBerthDock.js":12781,"./waterside/domain-models/WatersideBerthFixedDockStrategy.js":61476,"./waterside/domain-models/WatersideBerthFloatingDockStrategy.js":26554,"./waterside/domain-models/WatersideDefaultFixedDockStrategy.js":45100,"./waterside/domain-models/WatersideDock.js":44548,"./waterside/domain-models/WatersideDockConnection.js":16436,"./waterside/domain-models/WatersideDockGroup.js":37129,"./waterside/domain-models/WatersideDocksPricingStrategy.js":74168,"./waterside/domain-models/WatersideDocksProject.js":59170,"./waterside/domain-models/WatersideExistingPile.js":30326,"./waterside/domain-models/WatersideFixedBerthDock.js":30915,"./waterside/domain-models/WatersideFixedDockToRoofSubstructure.js":61782,"./waterside/domain-models/WatersideFloat.js":1997,"./waterside/domain-models/WatersideFloatToRoofSubstructure.js":58405,"./waterside/domain-models/WatersideFloatingBerthDock.js":90639,"./waterside/domain-models/WatersideFloatingDock.js":29642,"./waterside/domain-models/WatersideFloatingDockStrategy.js":7423,"./waterside/domain-models/WatersideGangway.js":2029,"./waterside/domain-models/WatersideGangwaySurface.js":21890,"./waterside/domain-models/WatersideHipRoof.js":10104,"./waterside/domain-models/WatersidePier.js":61847,"./waterside/domain-models/WatersidePile.js":62887,"./waterside/domain-models/WatersideRoofingLevel.js":69399,"./waterside/domain-models/WatersideSharedPile.js":86606,"./waterside/domain-models/builders/WatersideBerthDockBuilder.js":98045,"./waterside/domain-models/framing/WatersideDockFramer.js":12992,"./waterside/domain-models/framing/WatersideDockFramingDescriptor.js":92526,"./waterside/domain-models/framing/WatersideFixedDockToRoofSubstructureDescriptor.js":81664,"./waterside/domain-models/framing/WatersideFloatToRoofSubstructureDescriptor.js":33855,"./waterside/domain-models/framing/WatersideFloatToRoofSubstructureFramer.js":84475,"./waterside/domain-models/framing/WatersideFloatingDockFramer.js":39690,"./waterside/domain-models/framing/WatersideFloatingDockFramingDescriptor.js":80892,"./waterside/domain-models/framing/WatersideGangwayFramer.js":84559,"./waterside/domain-models/framing/WatersideGangwayFramingDescriptor.js":18044,"./waterside/domain-models/framing/WatersideHipRoofFramingDescriptor.js":50948,"./waterside/domain-models/framing/WatersideHipRoofWoodenFramer.js":62311,"./waterside/domain-models/framing/WatersidePostLayoutHelper.js":82422,"./waterside/domain-models/framing/WatersideSpanHelper.js":24242,"./waterside/domain-models/helpers/WatersideDeckingCalculator.js":88846,"./waterside/domain-models/materials.js":22373,"./waterside/domain-models/railings/WatersideCable.js":90556,"./waterside/domain-models/railings/WatersideCollection.js":58757,"./waterside/domain-models/railings/WatersideEdgeRailingMultiState.js":87548,"./waterside/domain-models/railings/WatersideNotchedPostMountRailingPost.js":6885,"./waterside/domain-models/railings/WatersideNotchedPostMountStyle.js":18670,"./waterside/domain-models/railings/WatersidePicketRail.js":32897,"./waterside/domain-models/railings/WatersidePileMountRailingPost.js":72476,"./waterside/domain-models/railings/WatersidePileMountStyle.js":56099,"./waterside/domain-models/railings/WatersidePostMountStyle.js":75501,"./waterside/domain-models/railings/WatersideRail.js":91953,"./waterside/domain-models/railings/WatersideRailingPost.js":43275,"./waterside/domain-models/railings/WatersideRailingSection.js":31206,"./waterside/domain-models/railings/WatersideRopeExtrusion.js":92554,"./waterside/domain-models/railings/WatersideRopeRail.js":22933,"./waterside/domain-models/railings/WatersideRun.js":16856,"./waterside/domain-models/railings/blocks/WatersideCableBlock.js":23650,"./waterside/domain-models/railings/blocks/WatersideNullRailingBlock.js":68200,"./waterside/domain-models/railings/blocks/WatersidePicketBlock.js":45519,"./waterside/domain-models/railings/blocks/WatersidePipeBlock.js":78159,"./waterside/domain-models/railings/blocks/WatersideRailingBlock.js":30093,"./waterside/domain-models/railings/blocks/WatersideRopeBlock.js":91763,"./waterside/domain-models/railings/styles/WatersideCableRailingStyle.js":73030,"./waterside/domain-models/railings/styles/WatersideHorizontalRailRailingStyle.js":74665,"./waterside/domain-models/railings/styles/WatersideNullRailingStyle.js":41912,"./waterside/domain-models/railings/styles/WatersidePicketRailingStyle.js":27805,"./waterside/domain-models/railings/styles/WatersidePipeRailingStyle.js":86205,"./waterside/domain-models/railings/styles/WatersideRailingStyle.js":77521,"./waterside/domain-models/railings/styles/WatersideRopeRailingStyle.js":30601,"./waterside/domain-models/watersideLayers.js":8125};function i(e){var t=s(e);return r(t)}function s(e){if(!r.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}i.keys=function(){return Object.keys(n)},i.resolve=s,e.exports=i,i.id=16948},41178:(e,t,r)=>{var n={"./migrations/20240105140659UpdateWatersideRunPlacementStrategy.js":10232,"./migrations/20240301152723ConvertFalconADACompliantHandrailToADAHandrailType.js":76044,"./migrations/20240321132120UpdateDockDesignerAppProjectDeckingOption.js":84700,"./migrations/20240712135519ConvertHollaenderProjectColorToDataDriven.js":37846,"./migrations/legacy/00000000000001RailingCollectionLegacyMigration.js":95752,"./migrations/legacy/00000000000002AMPipeHoldLegacyMigration.js":19890,"./migrations/legacy/00000000000003AMSteelTrussDockLegacyMigration.js":56431,"./migrations/legacy/00000000000004AMSteelTrussDockSectionLegacyMigration.js":56545,"./migrations/legacy/00000000000005AMWoodDockLegacyMigration.js":21680,"./migrations/legacy/00000000000006CoastalPierBoathouseLegacyMigration.js":86370,"./migrations/legacy/00000000000007RoofMaterialLegacyMigration.js":9131,"./migrations/legacy/00000000000008AbstractGangwayLegacyMigration.js":98595,"./migrations/legacy/00000000000009DeckingOptionLegacyMigration.js":37426,"./migrations/legacy/00000000000010DefaultDockFramerLegacyMigration.js":743,"./migrations/legacy/00000000000011DockDesignerProjectLegacyMigration.js":15048,"./migrations/legacy/00000000000012ThunderCloudComponentLegacyMigration.js":92098,"./migrations/legacy/00000000000013ThunderCloudProjectLegacyMigration.js":76747,"./migrations/legacy/00000000000014FalconFramedGlassRailingStyleLegacyMigration.js":27455,"./migrations/legacy/00000000000015FalconGlassRailingSectionLegacyMigration.js":92341,"./migrations/legacy/00000000000016FalconGlassRailingStyleLegacyMigration.js":13018,"./migrations/legacy/00000000000017FalconRailingCollectionLegacyMigration.js":44670,"./migrations/legacy/00000000000018FalconRailingRunLegacyMigration.js":25794,"./migrations/legacy/00000000000019FalconRailingSectionLegacyMigration.js":49677,"./migrations/legacy/00000000000020FalconRailingsProjectLegacyMigration.js":22150,"./migrations/legacy/00000000000021FalconRailingStyleLegacyMigration.js":75970,"./migrations/legacy/00000000000022KandSRailingPlacementStrategyLegacyMigration.js":59560,"./migrations/legacy/00000000000023OasisBoatDocksProjectLegacyMigration.js":71598,"./migrations/legacy/00000000000024OasisDockSlipLegacyMigration.js":67709,"./migrations/legacy/00000000000025StairSurfaceRailingPlacementStrategyLegacyMigration.js":4880,"./migrations/legacy/00000000000026CityPostCollectionLegacyMigration.js":84402,"./migrations/legacy/00000000000027OmegaGuardrailSectionLegacyMigration.js":67637,"./migrations/legacy/00000000000028OmegaProjectLegacyMigration.js":79423,"./migrations/legacy/00000000000029OmegaRailingCollectionLegacyMigration.js":75786,"./migrations/legacy/00000000000030RogueFabricatorsRailingCollectionLegacyMigration.js":27356,"./migrations/legacy/00000000000031RogueFabricatorsColosseumRailingStyleLegacyMigration.js":67474,"./migrations/legacy/00000000000032RogueFabricatorsOrionRailingStyleLegacyMigration.js":44606,"./migrations/legacy/00000000000033RogueFabricatorsRailingSectionLegacyMigration.js":19150,"./waterside/migrations/20230919154107SplitWatersideBerthDockFingerDocksMigration.js":22164,"./waterside/migrations/20230922170653ResetFixedDockHeightForLoweredWaterLevelMigration.js":24168};function i(e){var t=s(e);return r(t)}function s(e){if(!r.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}i.keys=function(){return Object.keys(n)},i.resolve=s,e.exports=i,i.id=41178},21269:(e,t,r)=>{var n={"./analytics/strategies/AnalyticsStrategy.js":37662,"./analytics/strategies/GA4AnalyticsStrategy.js":27678,"./ezdock/domain-models/geometry-strategies/EZPortGeometryStrategy.js":59139,"./geometry-strategies/CircularGeometryStrategy.js":76983,"./geometry-strategies/GeometryStrategy.js":38222,"./geometry-strategies/PolygonGeometryStrategy.js":11216,"./geometry-strategies/RectangularCutoutGeometryStrategy.js":25574,"./geometry-strategies/RectangularGeometryStrategy.js":16810,"./strategies/AccessPlatformSystemStrategy.js":59865,"./strategies/AmericanMuscleDocksStrategy.js":16971,"./strategies/BaseDockStrategy.js":32083,"./strategies/BaseRailingStrategy.js":86176,"./strategies/BearRidgeStrategy.js":72126,"./strategies/CityPostStrategy.js":44400,"./strategies/CoastalPierAndDockStrategy.js":98006,"./strategies/DIYDockStrategy.js":37154,"./strategies/DemoStrategy.js":23154,"./strategies/DockDesignerAppStrategy.js":33430,"./strategies/DocksPreviewStrategy.js":5633,"./strategies/EZDockStrategy.js":89489,"./strategies/FalconRailingsStrategy.js":10809,"./strategies/HollaenderStrategy.js":50400,"./strategies/InnovativeAluminumStrategy.js":8792,"./strategies/KAndSStrategy.js":9536,"./strategies/KonaDocksStrategy.js":70726,"./strategies/KwikclampStrategy.js":95422,"./strategies/LegacyBaseDockStrategy.js":32019,"./strategies/OasisBoatDocksStrategy.js":60332,"./strategies/OmegaRailingStrategy.js":91164,"./strategies/RailingDepotStrategy.js":4167,"./strategies/RailingsPreviewStrategy.js":51752,"./strategies/RogueFabricatorsStrategy.js":45089,"./strategies/SafesmartAccessStrategy.js":44275,"./strategies/SystemStrategy.js":50636,"./strategies/UltraloxStrategy.js":37076,"./strategies/WatersideDocksStrategy.js":61193,"./strategies/mixins/StrategyWithConfigurableRailingsMixin.js":10607};function i(e){var t=s(e);return r(t)}function s(e){if(!r.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}i.keys=function(){return Object.keys(n)},i.resolve=s,e.exports=i,i.id=21269},29665:(e,t,r)=>{var n={"./bundles/dda_basic.en.yml":9460,"./bundles/dda_pro.en.yml":39281,"./bundles/dda_standard.en.yml":77401,"./bundles/default.en.yml":20991,"./devise.en.yml":68872,"./devise.security_extension.en.yml":75312,"./devise_invitable.en.yml":99377,"./en.yml":75274,"./simple_form.en.yml":41145,"./strategies/access_platform.en.yml":33548,"./strategies/american_muscle_docks.en.yml":71635,"./strategies/bear_ridge.en.yml":57092,"./strategies/city_post.en.yml":55234,"./strategies/coastal_pier_and_dock.en.yml":91596,"./strategies/demo.en.yml":5073,"./strategies/diy.en.yml":6222,"./strategies/dock_designer_app.en.yml":24369,"./strategies/docks_preview.en.yml":30383,"./strategies/ezdock.en.yml":35978,"./strategies/falcon_railings.en.yml":99827,"./strategies/hollaender.en.yml":73719,"./strategies/innovative_aluminum.en.yml":70570,"./strategies/k_and_s.en.yml":39901,"./strategies/kona.en.yml":40817,"./strategies/kwikclamp.en.yml":89837,"./strategies/oasis_boat_docks.en.yml":57765,"./strategies/omega.en.yml":3135,"./strategies/railing_depot.en.yml":99965,"./strategies/railings_preview.en.yml":22208,"./strategies/rogue_fabricators.en.yml":971,"./strategies/safesmart_access.en.yml":26299,"./strategies/ultralox.en.yml":44035,"./strategies/waterside_docks.en.yml":54271,"./strategy.en.yml":39200};function i(e){var t=s(e);return r(t)}function s(e){if(!r.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}i.keys=function(){return Object.keys(n)},i.resolve=s,e.exports=i,i.id=29665},80046:(e,t,r)=>{var n={"./3DView.svg":16101,"./BottomView.svg":47130,"./DotMenu.svg":2225,"./FrontView.svg":57135,"./KeyboardArrowDown.svg":63803,"./KeyboardArrowLeft.svg":83676,"./KeyboardArrowRight.svg":14403,"./KeyboardArrowUp.svg":59412,"./LeftView.svg":65375,"./QuestionMark.svg":52012,"./RearView.svg":8254,"./RightView.svg":86836,"./TopView.svg":11595,"./ZoomDropdown.svg":90725};function i(e){var t=s(e);return r(t)}function s(e){if(!r.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}i.keys=function(){return Object.keys(n)},i.resolve=s,e.exports=i,i.id=80046},79958:(e,t,r)=>{const n=r(23770),i=r(69722),s=r(11511);class AnalyticsTrigger extends n.Component{static propTypes={eventKey:i.string.isRequired,strategyIdentifier:i.string.isRequired};constructor(e){super(e),s.setStrategyIdentifier(e.strategyIdentifier)}componentDidMount(){this.systemStrategy().postAnalyticsEvent(this.props.eventKey)}systemStrategy(){return s.strategy()}render(){return n.createElement("div",{id:"analytics-trigger","data-event-key":this.props.eventKey})}}e.exports=AnalyticsTrigger},45117:(e,t,r)=>{const n=r(23770),{createBrowserHistory:i}=r(68587),s=r(69722),{MultiPerspectiveProjectEditorView:o,IconFactoryContext:a,PropertyPanel:l,Icon:c}=r(47794),{Router:u}=r(44886),d=r(10643),{MigrationRegistry:h}=r(57075),{ApiClient:p}=r(7340),m=r(84188),f=r(27521),g=r(34323),y=r(78363),b=r(44308),v=r(379),_=r(36280),x=r(32912),w=r(73593),R=r(21860),k=r(86293),j=r(53696),z=r(11511),q=r(10354),$=r(21716),Z=r(52394),X=r(56792),Y=r(11698),ee=r(53779),te=r(76623),re=r(68739),ne=r(40661),ie=r(64460),se=r(53498),oe=r(79645),ae=r(35354),le=r(82938),ce=r(19395),ue=r(51753),de=r(72349),he=[$,X,Y,ee,re,ne,ie,se,r(19907)],pe={project:v,guest:_,quote:x,public:w,template:R,external:oe,preview:ce};class App extends n.Component{static propTypes={basePath:s.string,backLinkText:s.string,backPath:s.string,signedIn:s.bool,isAdmin:s.bool,projectId:s.oneOfType([s.number,s.string]),baseProjectId:s.oneOfType([s.number,s.string]),mode:s.oneOf(["project","quote","guest","public","template","external","preview"]),publicLink:s.string,logo:s.string,url:s.string,guestEditorPath:s.string,strategyIdentifier:s.string,bundleIdentifier:s.string,stagingEnvironment:s.bool,introVideoId:s.string,configuration:s.object};static defaultProps={basePath:"/",backPath:"/",signedIn:!0,isAdmin:!1,stagingEnvironment:!1};constructor(e){super(e),this._modalRoot=document.getElementById("modal_root")||document.createElement("div"),this.props.signedIn||(window.onbeforeunload=()=>this.editorModeStrategy().alertForUnsavedChanges()),z.setStrategyIdentifier(e.strategyIdentifier),z.setBundleIdentifier(e.bundleIdentifier),z.setIsAdmin(e.isAdmin),z.setEditorMode(e.mode),z.setConfiguration(e.configuration),this.state={loaded:!1,selectingTemplate:!1,signedIn:this.props.signedIn,showIntroVideo:Boolean(this.props.introVideoId),projectMessage:{message:""},xrSessionActive:!1},this._storeQueryParameters()}componentWillUnmount(){window.onbeforeunload=()=>{}}apiClient(){return this._apiClient??=new p}_storeQueryParameters(){this._queryParameters=new URLSearchParams(window.location.search)}queryParameters(){return this._queryParameters}queryParameter(e){return this.queryParameters().get(e)}onSignIn(){this.setState({signedIn:!0})}modalRoot(){return this._modalRoot}componentDidMount(){this._loadProject()}async _loadProject(){await this.editorModeStrategy().loadProject(),this._configureDrawingEditors();const e=this.project();e.isInitialized()||(await this._loadTemplates(),this._templates.length>0?this.setState({selectingTemplate:!0}):e.setIsInitialized(!0)),this.setState({loaded:!0}),this._startObservingProject(),this._versionedProject().addCurrentVersionReplacedObserver(this,this._currentProjectVersionReplaced)}_startObservingProject(){this._stopObservingProject(),this._observedProject=this.project(),this._observedProject.addStateRecoveredObserver(this,this._recordProjectChanged),this._observedProject.addUserMessageBroadcastObserver(this,this.setProjectMessage)}_stopObservingProject(){this._observedProject&&(this._observedProject.removeStateRecoveredObserver(this,this._recordProjectChanged),this._observedProject.removeUserMessageBroadcastObserver(this,this.setProjectMessage),this._observedProject=void 0)}setProjectMessage(e,t){this.setState({projectMessage:{message:e,level:t}})}_recordProjectChanged(){this._propertyEventRecorder().recordChange()}_currentProjectVersionReplaced(){this._startObservingProject()}_versionedProject(){return this.projectRepository().project()}async _loadTemplates(){this._templates=await this.apiClient().get("/templates",{headers:{...this.apiClient().defaultHeaders(),"X-CSRF-Token":m.csrfToken()}})}async onTemplateSelected(e){if(e){const t=(await this.apiClient().get(`/templates/${e}`,{headers:{...this.apiClient().defaultHeaders(),"X-CSRF-Token":m.csrfToken()}})).project.design,r=await this.projectRepository().buildObjectFromJSON(t);r.afterBuildFromTemplate();const n=this._versionedProject();n.setCurrent(r),n.notifyCurrentVersionReplacedObservers(),await n.createSnapshot(),n.clearSnapshots();this.drawingEditors().top.drawingController().setTranslation(void 0,void 0)}this.setState({selectingTemplate:!1}),this.project().setIsInitialized(!0),await this.editorModeStrategy().updateOnServer()}editorModeStrategy(){return this._editorModeStrategy??=this._defaultEditorModeStrategy()}_defaultEditorModeStrategy(){return new(0,pe[this.props.mode])(this)}drawingEditors(){return this._drawingEditors}project(){return this.projectRepository().project()}baseProjectId(){return this.props.baseProjectId}projectRepository(){return this._projectRepository??=this._defaultProjectRepository()}_defaultProjectRepository(){const e=new g;return e.setProjectPath(this.editorModeStrategy().projectPath()),e.setBaseProjectId(this.baseProjectId()),e}iconFactory(){return this._iconFactory??=new b}_drawingLayers(){return this.editorModeStrategy().drawingLayers()}_configureDrawingEditors(){const e=new k(this.project(),this.editorModeStrategy().isViewOnly());e.zoomPalette().setDefaultZoomLevel("2x"),e.zoomPalette().setActiveZoomLevel("2x"),e.toolPalette();const t=e.drawingController().layerManager();t.setLayers(this._drawingLayers());const r=z.strategy().drawing3DControllerClass(),n=new le(this.project(),r);n.toolPalette().addTool(new de(n.drawingController())),n.drawingController().setLayerManager(t),n.drawingController().addXrSessionStartedObserver(this,this.xrSessionStarted),n.drawingController().addXrSessionEndedObserver(this,this.xrSessionEnded),this._drawingEditors={top:e,"3d":n},this._setupForTests(e,n)}_setupForTests(e,t){}history(){return this._history??=i({basename:this.props.basePath})}async saveBeforeNavigate(e){const t=e.currentTarget.href;e.preventDefault(),await this.projectRepository().updateOnServer(),window.location=t}_renderSidebarLogo(){if(this.props.logo)return n.createElement("div",{className:"side-panel-logo"},n.createElement("img",{src:r(86190)(`./${this.props.logo}`)}))}_wrapLogo(e){return this.props.url?n.createElement("a",{href:this.props.url},e):e}_renderFloatingLogo(){if(!this.props.logo)return;const e=n.createElement("img",{src:r(86190)(`./${this.props.logo}`)});return n.createElement("div",{className:"floating-logo"},this._wrapLogo(e))}_renderTemplateSelectionModal(){if(this.state.selectingTemplate)return n.createElement(q,{templates:this._templates,onTemplateSelected:e=>this.onTemplateSelected(e)})}_renderJumpToLocationControls(e){if(z.strategy().shouldRenderJumpToLocationControls())return n.createElement(Z,{drawingController:e.drawingController(),zoomPalette:e.zoomPalette()})}_propertyEventRecorder(e){return this.__propertyEventRecorder??=this._defaultPropertyEventRecorder(e)}_defaultPropertyEventRecorder(e){if(e)return new te(e)}renderStagingBanner(){if(this.props.stagingEnvironment)return n.createElement("div",{className:"staging-banner"},n.createElement("p",{className:"margin-none font-weight-500"},"Staging Environment"))}renderUserMessageBanner(){if(!this.state.projectMessage.message)return;const e=this.state.projectMessage.level?.toLowerCase(),t=`user-message-banner__${["info","warn","error"].includes(e)?e:"info"}`;return n.createElement("div",{className:t},n.createElement("div",null,this.state.projectMessage.message),n.createElement("button",{onClick:()=>this.setState({projectMessage:{message:""}})},n.createElement(c,{name:"close"})))}async updateUserIntroVideoStatus(){await this.apiClient().put("/user_watched_intro_video",{headers:{...this.apiClient().defaultHeaders(),"X-CSRF-Token":m.csrfToken()}})}shouldShowIntroVideo(){return this.state.showIntroVideo}async closeIntroVideo(){await this.updateUserIntroVideoStatus(),this.setState({showIntroVideo:!1})}renderIntroVideo(){if(this.shouldShowIntroVideo())return n.createElement(ae,{videoId:this.props.introVideoId,closeModal:this.closeIntroVideo.bind(this)})}xrSessionStarted(){this.setState({xrSessionActive:!0})}xrSessionEnded(){this.setState({xrSessionActive:!1})}renderXROverlay(){if(!this.state.xrSessionActive)return;const e=this.drawingEditors()["3d"];return n.createElement(ue,{drawingEditor:e})}render(){if(!this.state.loaded)return n.createElement("div",null,"Loading...");const e={actionBarOptions:{includePerspectiveIcons:!1,renderBackLink:this.editorModeStrategy().showBackLink()?()=>this.editorModeStrategy().renderBackLink():void 0,renderSaveButton:e=>this.editorModeStrategy().renderSaveButton(e),includeUndoRedo:this.editorModeStrategy().showUndoRedoControls(),renderMenuItems:this.editorModeStrategy().showMenuItems()?e=>this.editorModeStrategy().renderMenuItems(e,this.projectRepository()):void 0},renderActionBar:e=>n.createElement(f,{editorModeStrategy:this.editorModeStrategy(),signedIn:this.props.signedIn,...e})};this.editorModeStrategy().showToolPanel()||(e.actionBarOptions.renderExtraElements=this._renderFloatingLogo.bind(this));const t={...e,actionBarOptions:{...e.actionBarOptions,renderExtraElements:this._renderFloatingLogo.bind(this)}},r={renderAccessoryElement:e=>this.editorModeStrategy().accessoryEditorElement(e)};return n.createElement(d.Provider,{value:this.modalRoot()},n.createElement("div",{id:"dom_overlay_root"},this.renderXROverlay()),n.createElement(u,{history:this.history()},n.createElement(a.Provider,{value:this.iconFactory()},this.renderStagingBanner(),this.renderIntroVideo(),n.createElement(j,null),this.renderUserMessageBanner(),this._renderTemplateSelectionModal(),n.createElement(o,{drawingEditors:this.drawingEditors(),versionedProject:this.project(),projectRepository:this.projectRepository(),defaultPerspective:this.editorModeStrategy().defaultPerspective(),perspectiveOptions:{top:{...r,rightSidePanel:this.editorModeStrategy().showPropertyPanel(),leftSidePanel:this.editorModeStrategy().showToolPanel(),renderLeftSidePanel:e=>n.createElement("div",{className:"side-panel-scroll flex flex-col justify-between"},n.createElement(y,{toolPalette:e.toolPalette(),drawingController:e.drawingController()}),this._renderSidebarLogo()),renderRightSidePanel:e=>n.createElement(n.Fragment,null,this._renderJumpToLocationControls(e),n.createElement("div",{className:"side-panel__container"},n.createElement(l,{drawingController:e.drawingController(),propertyViews:he,propertyEventRecorder:this._propertyEventRecorder(e)}))),...e},"3d":{...r,...t}}}))))}}e.exports=App},31090:(e,t,r)=>{const n=r(23770),i=r(69722),{Modal:s,Icon:o}=r(47794),{Route:a,Switch:l,withRouter:c,Redirect:u}=r(44886),d=r(33818),h=r(13740),p=r(78035);class AuthenticatedModal extends n.Component{static propTypes={signedIn:i.bool.isRequired,renderChildren:i.func.isRequired,buttonText:i.string.isRequired,systemStrategy:i.object.isRequired,buttonClassName:i.string,modalClassName:i.string,modalTitle:i.string,onSignIn:i.func,match:i.object};static defaultProps={buttonClassName:"btn-primary",onSignIn:()=>{}};constructor(e){super(e),this.state={visible:!1,signedIn:this.props.signedIn}}_modalTitle(){return this.props.modalTitle||this.props.buttonText}_openModal(e){this.setState({visible:!0})}_closeModal(e){!this.state.formResponseUrl||this.state.formResponseUrl&&window.location.href.includes(this.state.formResponseUrl)?this.setState({visible:!1}):window.location=this.state.formResponseUrl}_onSuccessfulCreation(e){this.setState({formResponseUrl:e})}_routeUrl(e,t=this.props.match.url){return t.endsWith("/")?`${t}${e}`:`${t}/${e}`}_renderChildren(){return this.props.signedIn?this.props.renderChildren(this._closeModal.bind(this),this._onSuccessfulCreation.bind(this)):n.createElement(u,{to:this._routeUrl("signup")})}_renderLoginForm(){return this.props.signedIn?n.createElement(u,{to:this._routeUrl("")}):n.createElement(d,{onSignIn:this.props.onSignIn,signUpUrl:this._routeUrl("signup"),isInModal:!0})}_renderSignUpForm(){return this.props.signedIn?n.createElement(u,{to:this._routeUrl("")}):n.createElement(h,{onSignIn:this.props.onSignIn,signInUrl:this._routeUrl("login"),note:this.props.systemStrategy.t("guest_sign_up.note"),isInModal:!0})}_renderModalHeader(e){return n.createElement("div",{className:"modal__header"},n.createElement("span",null),n.createElement("h2",null,this._modalTitle()),n.createElement("button",{className:"modal__close",onClick:e},n.createElement("span",{title:"close",className:"material-icons"},"close")))}_renderModalContents(){const{path:e}=this.props.match;return n.createElement(l,null,n.createElement(a,{exact:!0,path:this._routeUrl("",e),render:this._renderChildren.bind(this)}),n.createElement(a,{path:this._routeUrl("login",e),render:this._renderLoginForm.bind(this)}),n.createElement(a,{path:this._routeUrl("signup",e),render:this._renderSignUpForm.bind(this)}))}render(){const e=this._closeModal.bind(this),t=p("btn",this.props.buttonClassName),r=p("authenticated-modal",this.props.modalClassName);return n.createElement(n.Fragment,null,n.createElement("button",{type:"button",className:t,onClick:this._openModal.bind(this)},this.props.buttonText),n.createElement(s,{visible:this.state.visible,className:r,onClickOutsideModal:e,onEscapeKey:e},this._renderModalHeader(e),this._renderModalContents()))}}e.exports=c(AuthenticatedModal)},2386:(e,t,r)=>{const n=r(23770),i=r(69722),{Modal:s}=r(47794);class ConfirmActionButton extends n.Component{static propTypes={buttonClasses:i.string,label:i.string.isRequired,prompt:i.string.isRequired,action:i.func.isRequired,modalTitle:i.string};constructor(e){super(e),this.state={modalVisible:!1}}_modalTitle(){return this.props.modalTitle||"Confirm Action"}_hideModal(){this.setState({modalVisible:!1})}_showModal(){this.setState({modalVisible:!0})}_execute(){this._hideModal(),this.props.action()}render(){const e=()=>this._hideModal();return n.createElement(n.Fragment,null,n.createElement("button",{onClick:()=>this._showModal(),className:this.props.buttonClasses},this.props.label),n.createElement(s,{className:"confirm-action-modal",visible:this.state.modalVisible,onEscapeKey:e,onClickOutsideModal:e},n.createElement("div",{className:"modal__header"},n.createElement("h3",null,this._modalTitle())),n.createElement("div",{className:"modal__body"},n.createElement("p",null,this.props.prompt)),n.createElement("div",{className:"modal__footer"},n.createElement("button",{className:"btn",onClick:e},"Cancel"),n.createElement("button",{className:this.props.buttonClasses,onClick:()=>this._execute()},this.props.label))))}}e.exports=ConfirmActionButton},35983:(e,t,r)=>{const{DrawingEditor:n}=r(7340),{DrawingCanvas:i}=r(47794),s=r(69722),o=r(23770),a=r(10880),l=r(68041);class CrossSectionPropertyView extends o.Component{static propTypes={property:s.object.isRequired};static forType="cross-section";constructor(e){super(e),this._drawingEditor=new n(void 0,a),this._crossSectionTool=new l(this._drawingEditor.drawingController(),this._drawingEditor.zoomPalette(),this.props.property.get()),this._drawingEditor.toolPalette().addTool(this._crossSectionTool),this._drawingEditor.toolPalette().setActiveTool(this._crossSectionTool)}componentWillUnmount(){this._crossSectionTool.deactivate()}drawingEditor(){return this._drawingEditor}crossSectionTool(){return this._crossSectionTool}crossSection(){return this.crossSectionTool().crossSection()}render(){return o.createElement("div",{className:"display-property display-property--editable"},o.createElement("label",{className:"display-property__label"},this.props.property.label(),":"),o.createElement("div",{className:"container--xs cross-section-drawing-area padding-none"},o.createElement(i,{drawingEditor:this.drawingEditor()}),o.createElement("div",{className:"cross-section__buttons"},o.createElement("button",{className:"btn btn--primary margin-right-sm",onClick:()=>this.crossSectionTool().toggleMode()},"Toggle mode"),o.createElement("button",{className:"btn btn--primary margin-right-sm",onClick:()=>this.crossSectionTool().resetTool()},"Reset"),o.createElement("button",{className:"btn btn--primary",onClick:()=>this.crossSectionTool().finishedPlacing()},"Finished"))))}}e.exports=CrossSectionPropertyView},76282:(e,t,r)=>{const n=r(23770),i=r(69722),{Icon:s}=r(47794),{zoomToBounds:o}=r(27892);class DocksZoomControl extends n.Component{static propTypes={zoomPalette:i.object.isRequired,drawingController:i.object.isRequired,showLabels:i.bool};_project(){return this.props.drawingController.project()}_strategy(){return this._project().systemStrategy()}_drawingController(){const{drawingController:e}=this.props;return e}componentDidMount(){this._project().addRegionOfInterestChangedObserver(this,this._viewRegionOfInterest)}componentWillUnmount(){this._project().removeRegionOfInterestChangedObserver(this,this._viewRegionOfInterest)}_zoomFactor(){return 1.5}_zoomIn(){const{zoomPalette:e}=this.props;e.zoomCanvasCenterBy(this._zoomFactor())}_zoomOut(){const{zoomPalette:e}=this.props;e.zoomCanvasCenterBy(1/this._zoomFactor())}_viewRegionOfInterest(){const e=this._project().regionOfInterest();o(this._drawingController(),e)}_centerView(){const{zoomPalette:e}=this.props;if(e.centerView)e.centerView();else{const e=this._drawingController().drawing().boundingBox();o(this._drawingController(),e)}}_renderButtonLabel(e,t){if(this.props.showLabels)return n.createElement("div",{className:"action-bar-label","data-testid":`${t}-button-label`},e)}render(){return n.createElement(n.Fragment,null,n.createElement("button",{type:"button",className:"editor-control-button",title:"Zoom out",onClick:this._zoomOut.bind(this)},this._renderButtonLabel("Zoom Out","zoom-out"),n.createElement(s,{name:"zoom_out"})),n.createElement("button",{type:"button",className:"editor-control-button margin-x-sm",title:"Center view",onClick:this._centerView.bind(this)},this._renderButtonLabel("Center","center"),n.createElement(s,{name:"zoom_out_map"})),n.createElement("button",{type:"button",className:"editor-control-button",title:"Zoom in",onClick:this._zoomIn.bind(this)},this._renderButtonLabel("Zoom In","zoom-in"),n.createElement(s,{name:"zoom_in"})))}}e.exports=DocksZoomControl},38719:(e,t,r)=>{const n=r(23770),i=r(69722),{SmartJsonBuilder:s}=r(57075),o=r(72922),a=r(78035),l=r(31888),c=r(9296);class DownloadsButton extends n.Component{static propTypes={drawingEditor:i.object.isRequired,projectRepository:i.object.isRequired,buttonText:i.string,inMenu:i.bool};static defaultProps={inMenu:!0};constructor(e){super(e),this.state={downloadInProgress:!1,progressMessage:""}}drawingEditor(){return this.props.drawingEditor}projectRepository(){return this.props.projectRepository}_externalId(){return this.drawingEditor().project().externalId()}projectsPath(){return this.projectRepository().projectsPath()}actionURL(){return`${this.projectsPath()}/${this._externalId()}/documents`}completionURL(e){const t=e.documentRequest.id;return`${this.actionURL()}/${t}`}isComplete(e){return e.documentRequest.url}async requestBody(){const e=this.drawingEditor().project().current(),t=await e.projectForPDF(),{json:r}=await(new s).stringify(t);return{design:r}}headers(){return{Accept:"application/json, application/pdf, image/vnd.dwg","Content-Type":"application/json"}}async _generateDocument(){try{const e=new l(this),t=await e.execute();this._safeWindowLocationUpdate(t)}catch(e){return console.log(e),this.setProgressMessage("PDF generation failed"),!1}return this.setProgressMessage("Finished"),!0}progressMessage(){return this.state.progressMessage}setProgressMessage(e){this.setState({progressMessage:e})}initiateDownload(){this.setState({downloadInProgress:!0,progressMessage:"Generating PDF…"})}dismissModal(){this.setState({downloadInProgress:!1})}_safeWindowLocationUpdate(e){if(!e)return;const t=e.documentRequest.url,r=window.onbeforeunload;window.onbeforeunload=void 0,window.location.replace(t),window.onbeforeunload=r}_renderProgressModal(){if(this.state.downloadInProgress)return n.createElement(c,{task:()=>this._generateDocument(),title:"Download PDF",statusText:this.state.progressMessage,supplementalText:"This may take several minutes",onDismiss:this.dismissModal.bind(this)})}render(){const e=a({"action-bar-dropdown-menu__item":this.props.inMenu,btn:!this.props.inMenu,"btn-primary":!this.props.inMenu});return n.createElement(n.Fragment,null,this._renderProgressModal(),n.createElement("button",{type:"button",className:e,onClick:()=>this.initiateDownload()},n.createElement(o,{name:"file_download"}),"Download"))}}e.exports=DownloadsButton},17551:(e,t,r)=>{const n=r(23770),i=r(69722),{ApiClient:s}=r(7340),o=r(9498),a=r(76286),l=r(18709),c=r(27586);class EstimatedPrice extends n.Component{static propTypes={projectRepository:i.object.isRequired,hideBreakdown:i.bool,onlyShowDisclaimer:i.bool,hidePricing:i.bool};constructor(e){super(e),this.state={priceListLoaded:!1,price:void 0,showDetails:!1}}componentDidMount(){this._loadSupportingData(),this.project().addCurrentVersionChangedObserver(this,this.updateQuote),this.eventRecorder().addIntermediateChangeObserver(this,this.updateQuote)}apiClient(){return this._apiClient||(this._apiClient=new s),this._apiClient}projectRepository(){return this.props.projectRepository}project(){return this.projectRepository().project()}priceList(){return this._priceList}materialDefinitions(){return this._materialDefinitions}async _loadSupportingData(){this._priceList=await this.projectRepository().loadPriceList(),this._materialDefinitions=await this.projectRepository().loadMaterialDefinitions(),this._startQuoteUpdates()}_startQuoteUpdates(){this.unmounted()||(this.setState({priceListLoaded:!0}),this.updateQuote())}unmounted(){return this._unmounted}componentWillUnmount(){this._unmounted=!0,this.project().removeCurrentVersionChangedObserver(this,this.updateQuote),this.eventRecorder().removeIntermediateChangeObserver(this,this.updateQuote)}systemStrategy(){return this.project().systemStrategy()}eventRecorder(){return this._eventRecorder||(this._eventRecorder=new a(this.project())),this._eventRecorder}updateQuote(){this.state.priceListLoaded&&this.setState({price:this.project().totalPrice(this.priceList())})}showDetails(){this.setState({showDetails:!0})}hideDetails(){this.setState({showDetails:!1})}renderCloseButton(){return n.createElement("button",{className:"modal__close",onClick:this.hideDetails.bind(this)},n.createElement("span",{title:"close",className:"material-icons"},"close"))}renderModalHeader(){return n.createElement("div",{className:"modal__header"},n.createElement("span",null),n.createElement("h2",null,this.systemStrategy().t("parts_breakdown.title")),this.renderCloseButton())}renderBreakdownModal(){if(!this.state.showDetails)return;const e=()=>this.hideDetails();return n.createElement(o,{visible:this.state.showDetails,onEscapeKey:e,onClickOutsideModal:e,className:"parts-breakdown__modal"},this.renderModalHeader(),n.createElement(l,{project:this.project(),priceList:this.priceList(),materialDefinitions:this.materialDefinitions(),eventRecorder:this.eventRecorder(),onlyShowDisclaimer:this.props.onlyShowDisclaimer,hidePricing:this.props.hidePricing}))}renderBreakdownButton(){return n.createElement(n.Fragment,null,n.createElement("button",{onClick:()=>this.showDetails(),className:"btn btn--outline"},this.systemStrategy().t("parts_breakdown.title")),this.renderBreakdownModal())}renderEstimatedPrice(){return this.props.hidePricing?this.renderBreakdownButton():n.createElement(n.Fragment,null,n.createElement("div",{className:"estimated-price-header"},this.systemStrategy().t("estimated_price")),n.createElement("div",{className:"estimated-price"},n.createElement("span",null,c(this.state.price)),this.renderBreakdown()))}renderBreakdown(){if(!(!this.state.priceListLoaded||this.props.hideBreakdown)||this.props.onlyShowDisclaimer)return n.createElement(n.Fragment,null,n.createElement("button",{onClick:()=>this.showDetails()},n.createElement("span",{title:"details",className:"material-icons"},"info_outline")),this.renderBreakdownModal())}render(){return n.createElement("div",{className:"estimated-price-wrapper"},this.renderEstimatedPrice())}}e.exports=EstimatedPrice},65223:(e,t,r)=>{const n=r(23770),i=r(69722),s=r(9296),o=r(11511);class ExternalProjectSaveButton extends n.Component{static propTypes={projectRepository:i.object.isRequired,onCompletion:i.func.isRequired,progressMessage:i.string};static defaultProps={progressMessage:"Working..."};constructor(e){super(e),this.state={saveInProgress:!1,progressMessage:e.progressMessage}}progressMessage(){return this.state.progressMessage}setProgressMessage(e){this.setState({progressMessage:e})}saveInProgress(){return this.state.saveInProgress}setSaveInProgress(e){this.setState({saveInProgress:e})}projectRepository(){return this.props.projectRepository}initiateSave(){this.setState({saveInProgress:!0,progressMessage:this.props.progressMessage})}setResultFromUpdate(e){this._resultFromUpdate=e}resultFromUpdate(){return this._resultFromUpdate}dismissModal(){this.setState({saveInProgress:!1}),this.props.onCompletion(this.resultFromUpdate())}async _updateOnServer(){let e=!1;try{await this.projectRepository().updateOnServer(),e=!0,this.setProgressMessage("Saved project details")}catch{this.setProgressMessage("Failed to save project details")}return e}async _pushExternal(){const e=await this.projectRepository().pushExternal();if(e.success)this.setProgressMessage("Submission complete");else{const t=e.message||"Failed to complete submission";this.setProgressMessage(t)}return e}async saveProject(){const e=await this._updateOnServer();let t={success:e};return e&&(t=await this._pushExternal()),this.setResultFromUpdate(t),t.success}_renderProgressModal(){if(this.saveInProgress())return n.createElement(s,{task:()=>this.saveProject(),title:"Submission Progress",statusText:this.progressMessage(),onDismiss:this.dismissModal.bind(this)})}render(){const e=o.strategy();return n.createElement(n.Fragment,null,this._renderProgressModal(),n.createElement("button",{type:"button",title:e.t("external_project.submit_button"),className:"btn btn--primary",onClick:()=>this.initiateSave()},e.t("external_project.submit_button")))}}e.exports=ExternalProjectSaveButton},98313:(e,t,r)=>{const n=r(69722),i=r(23770);class FormFromServer extends i.Component{static propTypes={onSuccess:n.func.isRequired,url:n.string.isRequired,renderExtraElements:n.func,onLoadFromServer:n.func,renderFlash:n.func,onFailure:n.func,pageTitle:n.string,pageClassName:n.string,extraElementsClassName:n.string};static defaultProps={renderExtraElements:()=>{},onLoadFromServer:()=>{},renderFlash:()=>{},onFailure:()=>{}};constructor(e){super(e),this.formRef=i.createRef()}componentDidMount(){this.getFormHtml()}async getFormHtml(){const e=await fetch(this.props.url,{method:"GET",credentials:"same-origin"});await this.parseForm(e)}async parseHtml(e){const t=await e.text();return(new DOMParser).parseFromString(t,"text/html")}async parseForm(e){const t=(await this.parseHtml(e)).querySelector("form");if(t.addEventListener("submit",this.onSubmit.bind(this)),await this.props.onLoadFromServer(t),this.formRef.current)return this.formRef.current.firstChild&&this.formRef.current.removeChild(this.formRef.current.firstChild),this.formRef.current.appendChild(t),t}async onSubmit(e){e.preventDefault();const t=new FormData(e.target),r=await fetch(e.target.action,{method:"POST",credentials:"same-origin",body:t});if(r.redirected){const e=await this.parseHtml(r);this.props.onSuccess(e,r)}else{const e=await this.parseForm(r);this.props.onFailure(e)}}renderPage(){const e=i.createElement("div",{ref:this.formRef});return this.props.pageClassName||this.props.pageTitle?i.createElement("div",{className:this.props.pageClassName},this.props.pageTitle?i.createElement("h2",null,this.props.pageTitle):void 0,e):e}renderExtraElements(){const e=this.props.renderExtraElements();return e&&this.props.extraElementsClassName?i.createElement("div",{className:this.props.extraElementsClassName},e):e}render(){return i.createElement(i.Fragment,null,this.props.renderFlash(),this.renderPage(),this.renderExtraElements())}}e.exports=FormFromServer},52546:(e,t,r)=>{const n=r(69722),i=r(23770),s=r(98313);class GuestEditorSaveForm extends i.Component{static propTypes={projectRepository:n.object.isRequired,onProjectSaved:n.func,isInModal:n.bool};static defaultProps={onProjectSaved:()=>{}};async onLoadFromServer(e){const t=e.querySelector('input[name="project[design]"]'),{json:r}=await this.props.projectRepository.generateProjectJSON();t.value=r}onSuccessfulSave(e,t){this.props.onProjectSaved(),window.location=t.url}render(){return i.createElement(s,{onSuccess:this.onSuccessfulSave.bind(this),url:"/projects/new",onLoadFromServer:this.onLoadFromServer.bind(this),pageClassName:this.props.isInModal?"modal__body":void 0})}}e.exports=GuestEditorSaveForm},6204:(e,t,r)=>{const n=r(23770),i=r(69722),s=r(37462),{Icon:o,IconFactoryContext:a,Modal:l,ModalRootContext:c}=r(47794),{ApiClient:u}=r(7340),d=r(44308),h=r(2065),p=r(11511),m=r(95130),f={dock:"1PMl7u6riY85YCjOBP88XK1tvyMKmA6F1y3ZsDI4pfRM",railing:"1ZmdoNdU-tOVK449PeP3Qy_mWlNuqM-fTpnj6JVW2hQg"};class HelpView extends n.Component{static propTypes={strategyIdentifier:i.string,drawingEditor:i.object,browser:i.object,showKeyboardShortcuts:i.bool,signedIn:i.bool.isRequired};constructor(e){super(e),this._modalRoot=document.getElementById("modal_root")||document.createElement("div"),e.strategyIdentifier&&p.setStrategyIdentifier(e.strategyIdentifier),this.state={menuOpen:!1,videoModalOpen:!1,loaded:!1},this._browser=e.browser}browser(){return void 0===this._browser&&(this._browser=s.getParser(window.navigator.userAgent).parsedResult),this._browser}componentDidUpdate(){const e=document.querySelector("#help-menu__contents"),t=document.querySelector("#header");if(e){const r=6,n=(t.clientHeight-e.parentNode.clientHeight)/2;e.style.top=`${e.parentNode.clientHeight+n+r}px`}}async componentDidMount(){const e=await this.apiClient().get("/videos");this._videos=e,this.unmounted()||this.setState({loaded:!0})}componentWillUnmount(){this._unmounted=!0}unmounted(){return this._unmounted}apiClient(){return this._apiClient||=new u,this._apiClient}get videos(){return this._videos}get faqDocumentId(){return f[this.systemStrategy.projectType()]}get faqUrl(){return`https://docs.google.com/document/d/${this.faqDocumentId}`}get systemStrategy(){return this._systemStrategy||=p.strategy()}modalRoot(){return this._modalRoot}iconFactory(){return this._iconFactory||(this._iconFactory=new d),this._iconFactory}toggleMenu(){this.setState((e=>({menuOpen:!e.menuOpen})))}_inEditor(){return void 0!==this.props.drawingEditor}_isDesktop(){return"desktop"===this.browser().platform.type}_shouldShowShortcuts(){return this.props.showKeyboardShortcuts&&this._inEditor()&&this._isDesktop()}_os(){return this.browser().os.name}_openVideoModal(){this.setState({menuOpen:!1,videoModalOpen:!0})}_closeVideoModal(){this.setState({videoModalOpen:!1})}_openShortcutsModal(){this.setState({menuOpen:!1,shortcutsModalOpen:!0})}_closeShortcutsModal(){this.setState({shortcutsModalOpen:!1})}renderMenuButton(){const e=this.state.menuOpen?"help":"help_outline";return n.createElement("button",{type:"button",className:"editor-control-button",title:"Help",onClick:()=>this.toggleMenu()},n.createElement(o,{name:e}))}renderMenu(){return n.createElement("div",{className:"help-menu"},this.renderMenuButton(),this.renderMenuContents())}renderVideoButtonLoadingState(){return n.createElement("span",{className:"menu__item--disabled"},n.createElement(o,{name:"smart_display",className:"margin-right-md"}),"Loading Videos...")}_renderMenuButton(e,t,r){return n.createElement("button",{type:"button",onClick:()=>r(),className:"menu__item"},n.createElement(o,{name:t,className:"margin-right-md"}),e)}renderVideoButton(){return this.state.loaded?0!==this.videos.length?this._renderMenuButton("Videos","smart_display",this._openVideoModal.bind(this)):void 0:this.renderVideoButtonLoadingState()}renderShortcutsButton(){if(this._shouldShowShortcuts())return this._renderMenuButton("Keyboard Shortcuts","keyboard",this._openShortcutsModal.bind(this))}renderReleasesButton(){if(this.props.signedIn)return n.createElement("a",{href:"/deploys",className:"menu__item"},n.createElement(o,{name:"new_releases",className:"margin-right-md"}),"Releases")}renderFAQButton(){return n.createElement("a",{href:this.faqUrl,target:"_blank",rel:"noreferrer",className:"menu__item"},n.createElement(o,{name:"quiz",className:"margin-right-md"}),"FAQ")}renderMenuContents(){if(this.state.menuOpen)return n.createElement("div",{className:"menu",id:"help-menu__contents"},n.createElement("h4",{className:"menu__header"},"Help"),n.createElement("div",{className:"menu__items"},this.renderVideoButton(),this.renderShortcutsButton(),this.renderFAQButton(),this.renderReleasesButton()))}renderVideoModal(){if(this.state.loaded)return n.createElement(l,{visible:this.state.videoModalOpen,onEscapeKey:this._closeVideoModal.bind(this),className:"help-modal help-modal--full video-tutorials"},n.createElement(h,{closeModal:this._closeVideoModal.bind(this),videos:this.videos}))}renderShortcutsModal(){if(this._shouldShowShortcuts())return n.createElement(l,{visible:this.state.shortcutsModalOpen,onClickOutsideModal:this._closeShortcutsModal.bind(this),onEscapeKey:this._closeShortcutsModal.bind(this),className:"help-modal help-modal--partial"},n.createElement(m,{closeModal:this._closeShortcutsModal.bind(this),os:this._os(),drawingEditor:this.props.drawingEditor}))}render(){return n.createElement(c.Provider,{value:this.modalRoot()},n.createElement(a.Provider,{value:this.iconFactory()},this.renderMenu(),this.renderVideoModal(),this.renderShortcutsModal()))}}e.exports=HelpView},35354:(e,t,r)=>{const n=r(23770),{Icon:i}=r(47794),s=r(69722),{Modal:o}=r(47794);class IntroVideoModal extends n.Component{static propTypes={videoId:s.string.isRequired,closeModal:s.func.isRequired};render(){const e=`https://www.youtube.com/embed/${this.props.videoId}`;return n.createElement(o,{visible:!0,onClickOutsideModal:this.props.closeModal,onEscapeKey:this.props.closeModal,className:"modal__content modal__content--video"},n.createElement("div",{className:"modal__header"},n.createElement("button",{onClick:this.props.closeModal,className:"btn btn--pill btn--icon btn--small"},n.createElement(i,{name:"close"}))),n.createElement("iframe",{src:e,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}))}}e.exports=IntroVideoModal},52394:(e,t,r)=>{const n=r(69722),i=r(23770),{zoomToBounds:s}=r(27892);class JumpToZoomControls extends i.Component{static propTypes={drawingController:n.object.isRequired,zoomPalette:n.object};componentDidMount(){this.props.drawingController.addCanvasChangedObserver(this,this.forceUpdate)}componentWillUnmount(){this.props.drawingController.removeCanvasChangedObserver(this,this.forceUpdate)}_focusAreaHeight(e){const{drawingController:t}=this.props,r=t.canvas();return r&&0!==r.width&&0!==r.height?e/r.width*r.height:e}topBounds(){const{drawingController:e}=this.props,t=e.drawing().boundingBox(),r=t.topLeft().toCorner(t.topRight().add(0,300)),n=e.drawing().boundingBoxInBounds(r),i=this._focusAreaHeight(n.width());return n.topLeft().toCorner(n.topRight().add(0,i))}bottomBounds(){const{drawingController:e}=this.props,t=e.drawing().boundingBox(),r=t.bottomLeft().add(0,-300).toCorner(t.bottomRight()),n=e.drawing().boundingBoxInBounds(r),i=this._focusAreaHeight(n.width());return n.bottomLeft().add(0,-i).toCorner(n.bottomRight())}imageForBounds(e){const{drawingController:t}=this.props,r=e.width()/8,n=83*Math.SQRT1_2-41.5,s=this.squareBounds(e).insettedBy(-(n+r)),o=t.imageOfBounds(s,83);return i.createElement("img",{src:o.source,width:o.width,height:o.height})}squareBounds(e){const t=Math.max(e.width(),e.height());return e.center().expandedBy(t/2)}renderJumpToButtons(){const{drawingController:e}=this.props;return[{title:"Zoom to Dock",bounds:this.topBounds(),dimension:"width"},{title:"Zoom to Bank",bounds:this.bottomBounds(),dimension:"width"}].map((({title:t,bounds:r,dimension:n})=>i.createElement("button",{key:t,type:"button",className:"jump-control__button margin-bottom-sm",title:t,onClick:()=>s(e,r,n)},i.createElement("div",null,this.imageForBounds(r)))))}render(){return this.props.drawingController.canvas()?i.createElement("div",{className:"jump-controls"},this.renderJumpToButtons()):null}}e.exports=JumpToZoomControls},95130:(e,t,r)=>{const{Icon:n}=r(47794),i=r(23770),s=r(69722),o=r(19075),a=r(11511);class KeyboardShortcutsModalView extends i.Component{static propTypes={closeModal:s.func.isRequired,os:s.string.isRequired,drawingEditor:s.object.isRequired};constructor(e){super(e),this._keyboard=new o(e.os)}keyboard(){return this._keyboard}_keyString(e){return this.keyboard().keyString(e)}renderHeader(){return i.createElement("div",{className:"modal__header"},i.createElement("span",null),i.createElement("h3",null,"Keyboard Shortcuts"),i.createElement("button",{type:"button",className:"modal__close",onClick:()=>this.props.closeModal()},i.createElement(n,{name:"close"})))}_render(e){if(0!==e.length)return i.createElement("span",{className:"key-separator"},e)}_renderKey(e,t){return i.createElement("span",{key:t,className:"keyboard-key"},this._keyString(e))}_renderChord(e){const t=[...e.modifiers,e.key],r=t.length;return t.map(((e,t)=>{const n=t<r-1?"+":"";return i.createElement(i.Fragment,{key:t},this._renderKey(e,t),this._render(n))}))}_shortcutMatchesPlatform(e){if(void 0===e.os)return!0;return(Array.isArray(e.os)?e.os:[e.os]).includes(this.props.os.toLowerCase())}_renderShortcut(e,t){if(this._shortcutMatchesPlatform(e))return i.createElement(i.Fragment,{key:t},i.createElement("dt",{className:"shortcut--title"},e.title),i.createElement("dd",{className:"shortcut--command"},this._renderChord(e)))}_renderSection(e,t,r){if(0!==t.length)return i.createElement(i.Fragment,{key:r},i.createElement("div",null,i.createElement("h4",{className:"section-heading"},e),i.createElement("dl",{className:"shortcut--glossary"},t.map(((e,t)=>this._renderShortcut(e,t))))))}renderContent(e){return i.createElement(i.Fragment,null,e.map(((e,t)=>this._renderSection(e.title,e.shortcuts,t))))}render(){const e=a.strategy();return i.createElement(i.Fragment,null,this.renderHeader(),i.createElement("div",{className:"shortcut-menu-group"},this.renderContent(e.keyboardShortcutsDescriptor(this.props.drawingEditor))))}}e.exports=KeyboardShortcutsModalView},85760:(e,t,r)=>{const{DisplayPropertiesView:n}=r(47794),i=r(23770),s=r(60195),o=r(32829),a=r(45117),l=r(35983),c=r(21716),u=r(68739),d=r(56792),h=r(64460),p=[c,d,r(11698),r(53779),u,h,l];class LightningBoltView extends i.Component{constructor(e){super(e),this.state={previewMode:!1}}lightningBolt(){return this._lightningBolt||(this._lightningBolt=new s),this._lightningBolt}eventRecorder(){return this._eventRecorder||(this._eventRecorder=new o),this._eventRecorder}exportJSON(){const e=JSON.stringify(this.lightningBolt().designerSettings()),t=new Blob([e],{type:"application/json"}),r=URL.createObjectURL(t),n=document.createElement("a");n.href=r,n.download="DesignerJSON.json",n.click(),URL.revokeObjectURL(r)}previewDesign(){this.setState({previewMode:!0})}returnToOptions(){this.setState({previewMode:!1})}_renderDesignerForm(){return i.createElement("div",{className:"container--xs card margin-y-lg"},i.createElement(n,{components:[this.lightningBolt()],propertyEventRecorder:this.eventRecorder(),propertyViews:p}),i.createElement("div",{className:"flex justify-end"},i.createElement("button",{className:"btn btn--outline margin-right-md",onClick:()=>this.previewDesign()},"Preview"),i.createElement("button",{className:"btn btn-primary",onClick:()=>this.exportJSON()},"Export")))}_renderPreview(){return i.createElement("div",{className:"editor-wrapper"},i.createElement(a,{basePath:"/lightning_bolt",mode:"preview",logo:"lightningcad-logo.png",strategyIdentifier:`${this.lightningBolt().designerTypeIdentifier()}Preview`,configuration:this.lightningBolt().designerSettings(),returnToOptions:this.returnToOptions.bind(this)}))}render(){return this.state.previewMode?this._renderPreview():this._renderDesignerForm()}}e.exports=LightningBoltView},13891:(e,t,r)=>{const n=r(23770),i=r(69722),s=r(11511);class MaterialListFormBody extends n.Component{static propTypes={materialList:i.string,strategyIdentifier:i.string};constructor(e){super(e),s.setStrategyIdentifier(e.strategyIdentifier)}_systemStrategy(){return s.strategy()}materialList(){return this._materialList||(this._materialList=JSON.parse(this.props.materialList??"{}")),this._materialList}materialItems(){return this._systemStrategy().defaultMaterialDefinitions().map((e=>({...e,values:this.materialList()[e.identifier]??{}})))}_renderProperty(e,t,r,i){const s=this._valueFor(e.name(),r,i);return e.editable()?n.createElement("input",{name:`material_list[content][${t}][${e.name()}]`,defaultValue:s,className:"form__input",type:"string"}):n.createElement(n.Fragment,null,s)}_renderItem({identifier:e,displayValue:t,values:r,...i}){return n.createElement("tr",{key:e},n.createElement("td",{className:"padding-sm"},t),this._systemStrategy().materialListProperties().map(((t,s)=>n.createElement("td",{className:"padding-sm",key:`${e}-property-${s}`},this._renderProperty(t,e,r,i)))))}_valueFor(e,t,r){return t[e]||r[e]||""}render(){return n.createElement("div",{className:"margin-lg"},n.createElement("table",{className:"table border-none"},n.createElement("thead",null,n.createElement("tr",null,n.createElement("th",{className:"text-left"},"Identifier"),this._systemStrategy().materialListPropertyNames().map(((e,t)=>n.createElement("th",{key:`th-${t}`},e))))),n.createElement("tbody",null,this.materialItems().map((e=>this._renderItem(e))))))}}e.exports=MaterialListFormBody},18709:(e,t,r)=>{const n=r(23770),i=r(69722),{Icon:s,PropertyView:o}=r(47794),a=r(77532),l=r(77869),c=r(76286),u=r(27586);class PartsBreakdown extends n.Component{static propTypes={project:i.object.isRequired,priceList:i.object,materialDefinitions:i.object,eventRecorder:i.object.isRequired,onlyShowDisclaimer:i.bool,hidePricing:i.bool};constructor(e){super(e),this._CSVRef=this._createCSVRef(),this.state={loaded:!1}}CSVRef(){return this._CSVRef}project(){return this.props.project}priceList(){return this.props.priceList}materialDefinitions(){return this.props.materialDefinitions}projectName(){return this.project().name()}breakdownLineItems(){return this.project().breakdownLineItems({priceList:this.priceList(),materialDefinitions:this.materialDefinitions()})||[]}totalPrice(){return this.project().totalPrice(this.priceList())}priceDisclaimer(){return this.systemStrategy().t("parts_breakdown.disclaimer")}updatePricesDisclaimer(){return this.systemStrategy().t("parts_breakdown.update_cached_prices_disclaimer")}showPriceBreakdownDownloadButton(){return this.systemStrategy().showsPriceBreakdownDownloadButton()&&this.CSVRef()}_addAdditionalLineItem(){this.project().addAdditionalLineItem(),this.project().createSnapshot()}_deleteLineItem(e){e.delete(),this.project().createSnapshot()}systemStrategy(){return this.project().systemStrategy()}componentDidMount(){this.systemStrategy().showsPriceBreakdownDownloadButton()&&this.props.eventRecorder.addIntermediateChangeObserver(this,this.updateCSVRef)}componentWillUnmount(){this.systemStrategy().showsPriceBreakdownDownloadButton()&&(window.URL.revokeObjectURL(this.CSVRef()),this.props.eventRecorder.removeIntermediateChangeObserver(this,this.updateCSVRef))}updateCSVRef(){window.URL.revokeObjectURL(this.CSVRef()),this._CSVRef=this._createCSVRef()}_alignmentClassName(e,t){if(!e.alignmentHint())return 0===t?"text-left":"text-right";switch(e.alignmentHint()){case l.LEFT:return"text-left";case l.RIGHT:return"text-right";default:return"text-center"}}_renderLabelForElement(e,t){const r=this._alignmentClassName(e,t),i=e.label();return n.createElement("th",{className:r,key:i},i)}_renderElement(e,t,r){const i=`${r}-${t}`,s=e.formattedValue(),a=this._alignmentClassName(e,t),l=new c(this.project()),u=e.label().replaceAll(" ","-").toLowerCase();return e.property?n.createElement("td",{className:`${a} column-${u}`,key:i},n.createElement(o,{property:e.property(),eventRecorder:l})):n.createElement("td",{className:a,key:i},s)}_renderLineItem(e,t,r){const i=`${t+1}-of-${r}`,s=`parts-breakdown-table__row ${e.classes().join(" ")}`;return n.createElement("tr",{className:s,key:i},this.renderInfoIconCell(e),e.elements().map(((e,t)=>this._renderElement(e,t,i))),this.renderDeleteCell(e))}renderInfoIconCell(e){const t=e?.infoIcon();return n.createElement("td",{className:"parts-breakdown-table__cell--info"},t?n.createElement(s,{name:t}):void 0)}renderDeleteCell(e){return n.createElement("td",{className:"parts-breakdown-table__cell--delete"},e?.isDeletable()?n.createElement("button",{type:"button",title:"Delete",className:"btn btn--destructive btn--icon btn--no-border",onClick:()=>this._deleteLineItem(e)},n.createElement(s,{name:"delete"})):void 0)}renderUpdatePricesButton(){if(!this.systemStrategy().shouldCacheProjectPricing())return;const e=this.project().priceListTimestamp(),t=new Date(e).toLocaleDateString();return n.createElement("div",{className:"parts-breakdown-pricing-management__update-prices"},n.createElement("div",{className:"parts-breakdown-pricing-management__unit-price-info"},n.createElement("span",{className:"margin-right-md"},"Unit prices retrieved on ",t),n.createElement("button",{type:"button",className:"btn btn-primary",onClick:()=>this._updatePrices()},"Update Prices")),this.renderUpdatePricesDisclaimer())}_updatePrices(){this.project().resetPriceList(),this.project().createSnapshot()}renderUpdatePricesDisclaimer(){const e=this.updatePricesDisclaimer();if(e)return n.createElement("div",null,n.createElement("p",{className:"text-center"},e))}renderDisclaimer(){const e=this.priceDisclaimer();if(!e)return;const t=e.split("\n");return n.createElement("div",{className:"parts-breakdown-pricing-management__disclaimers"},t.map(((e,t)=>n.createElement("p",{key:`disclaimer-paragraph-${t}`},e))))}renderPricingNotes(){const e=this.project().pricingNoteLabel(),t=this.project().pricingNoteStrings();if(0!==t.length)return n.createElement("div",{className:"parts-breakdown-pricing-management__pricing-notes"},n.createElement("span",{className:"parts-breakdown-pricing-note__label"},e,":"),n.createElement("ul",{className:"parts-breakdown-pricing-note__list"},t.map(((e,t)=>n.createElement("li",{key:`pricing-note-${t}`},e)))))}_CSVBlob(){const e=this.breakdownLineItems();if(0===e.length)return;const t=e.columnLabels(),r=e.cellValues();return new a(t,r).toBlob()}_createCSVRef(){if(!this.systemStrategy().showsPriceBreakdownDownloadButton())return;const e=this._CSVBlob();return e?window.URL.createObjectURL(e):void 0}renderDownloadButton(){if(!this.showPriceBreakdownDownloadButton())return n.createElement("span",{className:"placeholder"});const e=`${this.projectName()}-materials.csv`;return n.createElement("a",{className:"btn btn-primary",download:e,href:this.CSVRef()},"Download")}renderBreakdownBody(){if(this.props.onlyShowDisclaimer)return;const e=this.breakdownLineItems();if(0===e.length)return n.createElement("div",{className:"parts-breakdown-table__container"},n.createElement("p",null,"This project does not yet contain any parts."));const t=e.first().elements();return n.createElement("div",{className:"parts-breakdown-table__container"},n.createElement("table",{className:"parts-breakdown-table table"},n.createElement("thead",{className:"parts-breakdown-table__header"},n.createElement("tr",null,this.renderInfoIconCell(),t.map(((e,t)=>this._renderLabelForElement(e,t))),this.renderDeleteCell())),n.createElement("tbody",null,e.map(((t,r)=>this._renderLineItem(t,r,e.length))))),this.renderAddButton())}renderAddButton(){if(this.systemStrategy().allowAddingAdditionalLineItems())return n.createElement("button",{type:"button",title:"Add",className:"btn btn-primary btn--small btn--icon btn--pill btn--add-item",onClick:()=>this._addAdditionalLineItem()},n.createElement(s,{name:"add"}))}_breakdownShouldHaveFooter(){return!this.props.onlyShowDisclaimer&&(!this.props.hidePricing||this.showPriceBreakdownDownloadButton())}renderBreakdownFooter(){return this._breakdownShouldHaveFooter()?n.createElement("div",{className:"modal__footer"},this.renderDownloadButton(),this.renderTotalPrice()):n.createElement("div",{className:"margin-bottom-lg"})}renderTotalPrice(){if(!this.props.hidePricing)return n.createElement("div",null,n.createElement("span",{className:"parts-breakdown-total-price__label"},this.systemStrategy().t("parts_breakdown.total_price"),":"),n.createElement("span",{className:"parts-breakdown-total-price__value"},u(this.totalPrice())))}render(){return n.createElement("div",{className:"parts-breakdown__modal-content"},n.createElement("div",{className:"modal__body"},n.createElement("div",{className:"parts-breakdown-pricing-management"},this.renderUpdatePricesButton(),this.renderDisclaimer(),this.renderPricingNotes()),this.renderBreakdownBody()),this.renderBreakdownFooter())}}e.exports=PartsBreakdown},66493:(e,t,r)=>{const n=r(23770),i=r(69722),s=r(11511),o=r(27586),a=r(78035),l=r(39662);class PriceListFormBody extends n.Component{static TYPES=["retail","industry"];static propTypes={priceList:i.string.isRequired,materialList:i.string,fallbackPriceList:i.string,strategyIdentifier:i.string,allowCustomIndustryPricing:i.bool};constructor(e){super(e),s.setStrategyIdentifier(e.strategyIdentifier)}_systemStrategy(){return s.strategy()}_priceList(){return this.__pricingList||(this.__pricingList=JSON.parse(this.props.priceList)),this.__pricingList}_materialDefinitions(){return this.__materialDefinitions||(this.__materialDefinitions=JSON.parse(this.props.materialList??"{}")),this.__materialDefinitions}_fallbackPriceList(){return this.__fallbackPriceList||(this.__fallbackPriceList=this._defaultFallbackPriceList()),this.__fallbackPriceList}_defaultFallbackPriceList(){return this.props.fallbackPriceList?JSON.parse(this.props.fallbackPriceList):{retail:{},industry:{}}}_defaultRetailPricing(){return this._systemStrategy().retailPricing(this._fallbackPriceList())}_defaultIndustryPricing(){return this._systemStrategy().industryPricing(this._fallbackPriceList())}pricingItems(){const e=this._defaultRetailPricing(),t=this._defaultIndustryPricing(),r=this._priceList();return Object.keys(e).map((n=>{const i=e[n].perUnit?`(per ${e[n].perUnit})`:"";return{key:n,defaultPricing:{retail:e[n].price,industry:t[n]?.price},customPricing:{retail:r.retail[n],industry:r.industry[n]},perUnit:i}}))}_inputName(e,t){return`price_list[${t}_content][${e}]`}_itemName(e){return this._systemStrategy().materialName(e.key,this._materialDefinitions())??e.key}toggleTab(e){const t=this.constructor.TYPES.filter((t=>e!==t));document.getElementById(`${e}-tab`).classList.toggle("tab--active",!0),document.getElementById(`${e}-content`).classList.toggle("hidden",!1),t.forEach((e=>{document.getElementById(`${e}-tab`).classList.toggle("tab--active",!1),document.getElementById(`${e}-content`).classList.toggle("hidden",!0)}))}renderTabGroup(){return this.props.allowCustomIndustryPricing?n.createElement("div",{className:"card__sticky-top"},n.createElement("div",{className:"tab-group tab-group--blue flex"},this.constructor.TYPES.map((e=>this._renderTab(e))))):n.createElement("div",{className:"margin-top-lg"})}_renderTab(e){const t=`${e}-tab`,r=a("tab",{"tab--active":e===this.constructor.TYPES.first()});return n.createElement("div",{className:r,id:t,key:t},n.createElement("button",{type:"button",onClick:()=>this.toggleTab(e)},l.capitalized(e)))}renderPricingTable(e){const t=`${e}-content`,r=a("table","border-none","margin-x-lg",{hidden:e!==this.constructor.TYPES.first()});return n.createElement("table",{className:r,id:t,key:t},n.createElement("thead",null,n.createElement("tr",null,n.createElement("th",{className:"text-left"},"Item"),n.createElement("th",{className:"text-center"},"Default Price"),n.createElement("th",{className:"text-center"},"Custom Price"))),n.createElement("tbody",null,this.pricingItems().map((t=>this._renderItem(t,e)))))}_renderItem(e,t){const r=`${t}-${e.key}`;return n.createElement("tr",{key:e.key},n.createElement("td",{className:"padding-sm"},n.createElement("label",{htmlFor:r},this._itemName(e)," ",e.perUnit)),n.createElement("td",{className:"padding-sm text-right"},o(e.defaultPricing[t])),n.createElement("td",{className:"padding-sm"},n.createElement("input",{name:this._inputName(e.key,t),id:r,defaultValue:e.customPricing[t],className:"form__input",type:"number"})))}render(){return n.createElement(n.Fragment,null,this.renderTabGroup(),n.createElement("div",{className:"flex"},this.constructor.TYPES.map((e=>this.renderPricingTable(e)))))}}e.exports=PriceListFormBody},9296:(e,t,r)=>{const n=r(23770),i=r(69722),s=r(9498),{Icon:o}=r(47794);class ProgressModal extends n.Component{static propTypes={task:i.func.isRequired,title:i.string.isRequired,statusText:i.string,supplementalText:i.string,buttonText:i.string,onDismiss:i.func};static defaultProps={statusText:"Loading",buttonText:"Dismiss"};constructor(e){super(e),this.state={visible:!0,isFinished:!1}}task(){return this.props.task}title(){return this.props.title}statusText(){return this.props.statusText}supplementalText(){return this.props.supplementalText}buttonText(){return this.props.buttonText}isVisible(){return this.state.visible}onDismiss(){return this.props.onDismiss}isFinished(){return this.state.isFinished}finish(e){this.setState({isFinished:!0,succeeded:e})}taskSucceeded(){return this.state.succeeded}async runTask(){const e=this.task(),t=await e();this.finish(t)}dismissModal(){this.onDismiss()(),this.hide()}hide(){this.setState({visible:!1})}renderDismissButton(){return n.createElement("button",{className:"btn btn-primary",onClick:()=>this.dismissModal(),disabled:!this.isFinished()},this.buttonText())}renderSpinner(){return n.createElement("span",{className:"spinner spinner--small indicator"})}renderSuccess(){return n.createElement(o,{name:"check_circle_outline",className:"indicator indicator-icon indicator--success"})}renderFailure(){return n.createElement(o,{name:"error_outline",className:"indicator indicator-icon indicator--error"})}renderIndicator(){return this.isFinished()?this.taskSucceeded()?this.renderSuccess():this.renderFailure():this.renderSpinner()}renderSupplementalText(){if(this.supplementalText())return n.createElement("p",{className:"supplemental-text"},this.supplementalText())}componentDidMount(){this.runTask()}render(){return n.createElement(s,{className:"progress-modal",visible:this.isVisible()},n.createElement("div",{className:"modal__header"},n.createElement("h2",null,this.title())),n.createElement("div",{className:"modal__body"},n.createElement("p",null,this.renderIndicator(),n.createElement("span",{className:"progress-text"},this.statusText())),this.renderSupplementalText()),n.createElement("div",{className:"modal__footer"},this.renderDismissButton()))}}e.exports=ProgressModal},8325:(e,t,r)=>{const n=r(23770),i=r(69722),{Icon:s}=r(47794),o=r(98313),a=r(11511),l=r(16961);class ProjectQuoteForm extends n.Component{static propTypes={projectRepository:i.object.isRequired,closeModal:i.func.isRequired,onSuccessfulCreation:i.func.isRequired,disclaimer:i.string};constructor(e){super(e),this.state={successfulCreation:!1}}async onLoadFromServer(e){const t=e.querySelector('input[name="project_quote[project][design]"]'),{json:r}=await this.props.projectRepository.generateProjectJSON();t.value=r;e.querySelector('input[name="project_quote[amount]"]').value=this.props.projectRepository.project().totalPrice()}onSuccessfulCreation(e,t){this.setState({successfulCreation:!0}),this._postQuoteSubmittedEvent(),this.props.onSuccessfulCreation(t.url)}_systemStrategy(){return a.strategy()}_postQuoteSubmittedEvent(){this._systemStrategy().postAnalyticsEvent(l.quoteSubmitted)}_renderSuccessMessage(){const e=this._systemStrategy();return n.createElement("div",{className:"project-quote-request--success"},n.createElement("div",{className:"modal__body"},n.createElement("h2",null,"Success!"),n.createElement(s,{name:"success",className:"success-message__icon"}),n.createElement("p",null,e.t("quote.success"))),n.createElement("div",{className:"modal__footer"},n.createElement("button",{className:"btn",onClick:()=>this.props.closeModal()},"Continue designing"),n.createElement("a",{href:"/projects",className:"btn-primary"},"Return to projects")))}renderDisclaimer(){if(this.props.disclaimer)return n.createElement("p",{className:"project-quote-request--disclaimer"},this.props.disclaimer)}render(){if(this.state.successfulCreation)return this._renderSuccessMessage();const e=`/quotes/new${this.props.projectRepository.projectId()?`?project_id=${this.props.projectRepository.projectId()}`:""}`;return n.createElement(o,{onSuccess:this.onSuccessfulCreation.bind(this),onLoadFromServer:this.onLoadFromServer.bind(this),url:e,renderExtraElements:this.renderDisclaimer.bind(this),pageClassName:"modal__body",extraElementsClassName:"modal__footer"})}}e.exports=ProjectQuoteForm},10354:(e,t,r)=>{const n=r(23770),i=r(69722),s=r(9498);class ProjectTemplateView extends n.Component{static propTypes={templates:i.array.isRequired,onTemplateSelected:i.func.isRequired};render(){return n.createElement(s,{visible:!0,className:"project-templates-modal scroll-y"},n.createElement("div",{className:"flex items-center justify-between card__sticky-top margin-bottom-none"},n.createElement("h3",{className:"margin-none margin-right-lg"},"Choose a template"),n.createElement("button",{onClick:()=>this.props.onTemplateSelected(),type:"button",className:"btn btn--outline"},"Start from blank")),n.createElement("div",{className:"template-library"},this.renderTemplates()))}renderTemplates(){return this.props.templates.map((e=>n.createElement("button",{type:"button",key:e.id,className:"btn btn--outline flex flex-col template--button",onClick:()=>this.props.onTemplateSelected(e.id)},n.createElement("img",{src:e.thumbnail_url,width:"100%"}),n.createElement("span",{className:"margin-top-sm"},e.name))))}}e.exports=ProjectTemplateView},49858:(e,t,r)=>{const{extend:n}=r(50988),i=r(23770),s=r(63768),{IconFactoryContext:o,PropertyPanel:a}=r(47794),{EditableProperty:l,ReadableProperty:c,DisplayProperties:u}=r(7340),d=r(44308),h=r(83102),p=r(98272),m=[r(21716),r(56792),r(11698),r(53779)];class TestComponent extends h{defaultDisplayProperties(){return[new l(this,"Unit",{type:"unit",get:()=>s.unit(30,"kg"),defaultUnit:"kg",set:()=>{}}),new l(this,"Text",{type:"text",get:()=>"Default Text",set:()=>{}}),new l(this,"Number",{type:"number",get:()=>4,set:()=>{}}),new l(this,"Select",{type:"select",get:()=>3,choices:[{label:"One",value:1},{label:"Two",value:2},{label:"Three",value:3}],set:()=>{}}),new l(this,"Boolean",{type:"boolean",get:()=>!0,toggle:()=>{}}),new l(this,"Color",{type:"color",get:()=>"#ff0000",set:()=>{}}),new l(this,"Radio",{label:"Label",type:"radio",get:()=>"Option 1",choices:[{label:"Option 1",value:"Option 1"},{label:"Option 2",value:"Option 2"},{label:"Option 3",value:"Option 3"},{label:"Option 4",value:"Option 4"}],set:()=>{}}),new l(this,"Boolean Map",{type:"booleanmap",get:()=>({top:!0,bottom:!1,left:!1,right:!0,in:!0,out:!1}),set:()=>{}}),new l(this,"Radio Select",{type:"radioselect",get:()=>"Option 2",choices:[{label:"Option 1",value:"Option 1"},{label:"Option 2",value:"Option 2"},{label:"Option 3",value:"Option 3"},{label:"Option 4",value:"Option 4"}],set:()=>{}}),new l(this,"Tray Select",{type:"trayselect",get:()=>"Option 1",choices:[{icon:"text_rotate_vertical",label:"Option 1",value:"Option 1"},{icon:"text_rotate_up",label:"Option 2",value:"Option 2"},{icon:"text_rotation_angledown",label:"Option 3",value:"Option 3"},{icon:"text_rotation_angleup",label:"Option 4",value:"Option 4"},{icon:"text_rotation_down",label:"Option 5",value:"Option 5"},{icon:"text_rotation_none",label:"Option 6",value:"Option 6"}],set:()=>{}}),new l(this,"Action",{type:"action",perform:()=>{}}),new l(this,"Segment",{type:"segment",get:()=>"1",set:()=>{},choices:[{icon:"14mp",label:"14 MP",value:"1"},{icon:"15mp",label:"15 MP",value:"2"},{icon:"16mp",label:"16 MP",value:"3"}]}),new c(this,"Read Only Unit",{type:"unit",get:()=>s.unit(30,"kg")}),new c(this,"Read Only Text",{type:"text",get:()=>"default text"}),new c(this,"Read Only Number",{type:"number",get:()=>4}),new c(this,"Read Only Select",{type:"select",get:()=>3,choices:[{label:"One",value:1},{label:"Two",value:2},{label:"Three",value:3}]}),new c(this,"Read Only Boolean",{type:"boolean",get:()=>!0})]}}n(TestComponent,u);class PropertyPanelStyleGuide extends i.Component{model(){if(!this._model){const e={};this._model=new TestComponent,this._model.setComponentOf(e)}return this._model}drawingController(){return this._drawingController||(this._drawingController=new p,this._drawingController.deleteSelection=()=>{},this._drawingController.snapshotProject=()=>{},this._drawingController.select(this.model())),this._drawingController}iconFactory(){return this._iconFactory||(this._iconFactory=new d),this._iconFactory}render(){return i.createElement("div",{className:"editor-wrapper"},i.createElement(o.Provider,{value:this.iconFactory()},i.createElement("header",{className:"action-bar"}),i.createElement("div",{className:"drawing-editor"},i.createElement("div",{className:"side-panel side-panel--right"},i.createElement("div",{className:"side-panel__container"},i.createElement(a,{drawingController:this.drawingController(),propertyViews:m}))),i.createElement("div",{className:"canvas-area"}))))}}e.exports=PropertyPanelStyleGuide},33818:(e,t,r)=>{const n=r(23770),i=r(69722),{Link:s}=r(44886),o=r(98313),a=r(11511),l=r(16961);class SignInForm extends n.Component{static propTypes={onSignIn:i.func.isRequired,signUpUrl:i.string,isInModal:i.bool};constructor(e){super(e),this.state={error:void 0}}onSuccessfulSignIn(e){const t=e.querySelector('meta[name="csrf-token"]').content;document.querySelector('meta[name="csrf-token"]').content=t,this._postLoginEvent(),this.props.onSignIn()}onFailureToSignIn(){this.setState({error:"Invalid Email or password."})}_systemStrategy(){return a.strategy()}_postLoginEvent(){this._systemStrategy().postAnalyticsEvent(l.login)}renderErrorMessages(){if(this.state.error)return n.createElement("div",{className:"container"},n.createElement("p",{className:"flash flash--alert"},this.state.error))}renderSignUpLink(){return n.createElement("div",{className:"margin-top-md margin-left-sm"},n.createElement(s,{to:this.props.signUpUrl},"Sign up"))}render(){return n.createElement(o,{onSuccess:this.onSuccessfulSignIn.bind(this),onFailure:this.onFailureToSignIn.bind(this),url:"/users/sign_in",renderExtraElements:this.renderSignUpLink.bind(this),renderFlash:this.renderErrorMessages.bind(this),pageTitle:"Log in",pageClassName:this.props.isInModal?"modal__body":void 0,extraElementsClassName:this.props.isInModal?"modal__footer":void 0})}}e.exports=SignInForm},13740:(e,t,r)=>{const n=r(69722),i=r(23770),{Link:s}=r(44886),o=r(98313),a=r(11511),l=r(16961);class SignUpForm extends i.Component{static propTypes={onSignIn:n.func.isRequired,note:n.string,signInUrl:n.string,isInModal:n.bool};onSuccessfulSignUp(e){const t=e.querySelector('meta[name="csrf-token"]').content;document.querySelector('meta[name="csrf-token"]').content=t,this._postSignUpEvent(),this.props.onSignIn()}_systemStrategy(){return a.strategy()}_postSignUpEvent(){this._systemStrategy().postAnalyticsEvent(l.signUp)}renderSignInLink(){return i.createElement("div",{className:"margin-top-md margin-left-sm"},i.createElement(s,{to:this.props.signInUrl},"Log in"))}renderNote(){if(this.props.note)return i.createElement(i.Fragment,null,i.createElement("hr",{className:"margin-top-md"}),i.createElement("p",{className:"text-center"},this.props.note))}renderExtraElements(){return i.createElement(i.Fragment,null,this.renderSignInLink(),this.renderNote())}render(){return i.createElement(o,{onSuccess:this.onSuccessfulSignUp.bind(this),url:"/users/sign_up",renderExtraElements:this.renderExtraElements.bind(this),pageTitle:"Sign Up",pageClassName:this.props.isInModal?"modal__body":void 0,extraElementsClassName:this.props.isInModal?"modal__footer":void 0})}}e.exports=SignUpForm},16527:(e,t,r)=>{const n=r(23770),i=r(69722),{DotMenu:s}=r(47794),o=r(72922),a=r(78035);class ThunderCloudDotMenu extends s{static propTypes={children:i.node.isRequired};componentDidUpdate(){document.querySelector("#dot-menu__list"),document.querySelector("#dot-menu__container")}_renderMenuItems(){const e=a("dot-menu__menu-list",{hidden:!this.state.isOpen});return n.createElement("div",{className:e,id:"dot-menu__list"},this.props.children)}render(){return n.createElement("div",{className:"dot-menu",onClick:this._toggle.bind(this),id:"dot-menu__container"},n.createElement("button",{className:"action-bar__toggle-button",title:"Menu",onClick:this._toggle.bind(this)},n.createElement(o,{name:"DotMenu",className:"action-bar__item-icon"})),this._renderMenuItems())}}e.exports=ThunderCloudDotMenu},27521:(e,t,r)=>{const n=r(23770),i=r(69722),{UndoControl:s,RedoControl:o,pointerCapture:a,DrawingEditorActionBar:{DrawingEditorActionBar:l},Icon:c,LayersControl:u}=r(47794),{withRouter:d,NavLink:h}=r(44886),p=r(76282),m=r(16527),f=r(6204),g=r(75662);class ThunderCloudDrawingEditorActionBar extends l{static propTypes={editorModeStrategy:i.object.isRequired,drawingEditor:i.object.isRequired,projectRepository:i.object.isRequired,basePath:i.string.isRequired,perspectives:i.arrayOf(i.string).isRequired,signedIn:i.bool.isRequired,includePerspectiveIcons:i.bool,includeUndoRedo:i.bool,renderBackLink:i.func,renderMenuItems:i.func,renderExtraElements:i.func,renderSaveButton:i.func,match:i.object};_showButtonLabels(){const e=this.props.drawingEditor.project().systemStrategy();return e.showsActionBarIconLabels?.()}_renderBackLink(){const e=this.props.renderBackLink(this.props.drawingEditor);if(e)return n.createElement("div",{className:"action-bar-section action-bar-section--start"},e)}_renderActionBarItems(e){if(e)return n.createElement("div",{className:"action-bar-section action-bar-section--start"},e)}_renderGuestEditorButton(){const e=this.props.editorModeStrategy.renderGuestEditorButton();return this._renderActionBarItems(e)}_renderUndoRedoControls(){if(this.props.includeUndoRedo){const e="editor-control-button btn--no-border";return n.createElement("div",{className:"action-bar-section action-bar-section--start"},n.createElement(s,{versionedProject:this.props.drawingEditor.project(),useIcon:!0,showIconLabel:this._showButtonLabels(),className:`undo-control ${e}`}),n.createElement(o,{versionedProject:this.props.drawingEditor.project(),useIcon:!0,showIconLabel:this._showButtonLabels(),className:`redo-control ${e}`}))}}_renderLeftActionBarItems(){const e=this.props.editorModeStrategy.renderLeftActionBarItems();return this._renderActionBarItems(e)}_renderButtonLabel(e){if(this._showButtonLabels())return n.createElement("div",{className:"action-bar-label","data-testid":`${e.toLowerCase()}-view-button-label`},e)}_renderViewLinks(){return"top"===this.props.match.params.perspective?n.createElement(h,{to:`${this.props.basePath}/3d`,className:"action-bar__view-link text-center text-decoration-none",activeClassName:"action-bar__view-link--active",title:"3D view"},n.createElement("div",{className:"editor-control-button"},this._renderButtonLabel("3D"),n.createElement(c,{name:"3d-on"}))):n.createElement(n.Fragment,null,this._renderXRButton(),n.createElement(h,{to:`${this.props.basePath}/top`,className:"action-bar__view-link text-center text-decoration-none",activeClassName:"action-bar__view-link--active",title:"Top view"},n.createElement("div",{className:"editor-control-button"},this._renderButtonLabel("2D"),n.createElement(c,{name:"3d-off"}))))}_renderXRButton(){const e=this.props.drawingEditor.project().systemStrategy();let t;if(e.allowAR()&&(t="ar"),!t&&e.allowVR()&&(t="vr"),!t)return;const{drawingEditor:r}=this.props;return n.createElement(g,{drawingEditor:r,showLabels:this._showButtonLabels(),xrMode:t})}_renderZoomControl(){const{drawingEditor:e}=this.props,t=e.zoomPalette();if(t)return n.createElement("div",{className:"action-bar-section action-bar-section--end"},n.createElement(p,{zoomPalette:t,drawingController:e.drawingController(),showLabels:this._showButtonLabels()}))}_renderEstimatedPrice(){const e=this.props.editorModeStrategy.renderEstimatedPrice();if(e)return n.createElement("div",{className:"action-bar-section action-bar-section--end"},e)}_renderActionButtons(){const e=this.props.renderSaveButton(this.props.projectRepository),t=this.props.editorModeStrategy.renderSubmitQuoteModal(),r=this.props.editorModeStrategy.renderCustomLinkButton(),i=this.props.editorModeStrategy.renderShareLink(),s=this.props.editorModeStrategy.renderActionButtons(this.props.drawingEditor);if(e||t||r||i||s)return n.createElement("div",{className:"action-bar-section action-bar-section--end action-bar-section--action-buttons"},e,t,r,i,s)}_renderDotMenu(){if(this.props.renderMenuItems)return n.createElement(m,null,this.props.renderMenuItems(this.props.drawingEditor))}_renderLayerToggle(){if(this.props.editorModeStrategy.showLayerToggle())return n.createElement("div",{className:"action-bar-section action-bar-section--end"},n.createElement(u,{drawingController:this.props.drawingEditor.drawingController(),showLabel:this._showButtonLabels(),className:"layers-control",buttonClassName:"btn--no-border"}))}_renderHelp(){return n.createElement(f,{drawingEditor:this.props.drawingEditor,showKeyboardShortcuts:this.props.editorModeStrategy.showKeyboardShortcuts(),signedIn:this.props.signedIn})}render(){return n.createElement("header",{className:"action-bar",id:"header",...this.props.pointerCaptureProps},n.createElement("div",{className:"flex"},this._renderGuestEditorButton(),this._renderBackLink(),this._renderUndoRedoControls(),this._renderLeftActionBarItems()),n.createElement("div",{className:"flex"},this.props.renderExtraElements(this.props.drawingEditor),this._renderLayerToggle(),this._renderZoomControl(),n.createElement("div",{className:"action-bar-section action-bar-section--end"},this._renderViewLinks()),this._renderEstimatedPrice(),this._renderActionButtons(),this._renderDotMenu(),this._renderHelp()))}}e.exports=d(a(ThunderCloudDrawingEditorActionBar))},44308:(e,t,r)=>{const n=r(23770),{IconFactory:i}=r(47794),s=r(78035),o=r(85758);e.exports=class ThunderCloudIconFactory extends i{constructor(e){super(e),this._coreToMaterialIcons={ComponentSelectionTool:"select",DotMenu:"more_vert",FreeFormSelectionTool:"lasso",KeyboardArrowLeft:"keyboard_arrow_left",KeyboardArrowRight:"keyboard_arrow_right",KeyboardArrowDown:"keyboard_arrow_down",square:"check_box_outline_blank",circle:"radio_button_unchecked"}}makeIcon(e,t){const r=this._coreToMaterialIcons[e]||e,n={className:s("material-icons",t.className),title:t.hoverText||t.name,...t.color?{style:{color:`var(--color-${t.color})`}}:{}};return this._customIcon(r,n)||this._materialIcon(r,n)}_customIcon(e,t){if(`${e}`in o)return t.className=t.className.replace("material-icons","custom-icons"),n.createElement("span",{...t,dangerouslySetInnerHTML:{__html:o[e]}})}_materialIcon(e,t){return n.createElement("span",{...t},e)}}},78363:(e,t,r)=>{const n=r(23770),i=r(69722),s=r(78035),o=r(72922),a=r(59602),l=r(63622);class ToolsPanel extends n.Component{static propTypes={drawingController:i.object.isRequired,toolPalette:i.object.isRequired};componentDidMount(){this._startObserving()}componentWillUnmount(){this._stopObserving()}_startObserving(){this.props.drawingController.toolHolder().addValueChangedObserver(this,this.forceUpdate),this.forceUpdate()}_stopObserving(e=this.props.drawingController){e.toolHolder().removeValueChangedObserver(this,this.forceUpdate)}_toolPalette(){return this.props.toolPalette}_availableToolCategories(){return this._toolPalette().tools().reduce(((e,t)=>(e[this._categoryFor(t)]=e[this._categoryFor(t)]??[],e[this._categoryFor(t)].push(t),e)),{})}_categoryFor(e){return e.category?.()??a.default}_activateTool(e){this._toolPalette().setActiveTool(e)}_renderTools(e){const t=this._toolPalette().activeTool();return e.map((e=>{if(e.excludeFromToolPanel?.())return;const r=t===e,i=s("tool-container",{active:r}),a=e.iconName?.()??e.constructor.name;return n.createElement("div",{className:i,key:e.displayName()},n.createElement("button",{onClick:()=>this._activateTool(e),className:"btn tool-button btn--no-border",type:"button"},n.createElement(o,{name:a}),e.displayName()),this._renderToolPanel(e,r))}))}_renderToolPanel(e,t){const r=e.constructor.toolPanelClassName?.(),i=l.findByName(r);if(!i||!t)return;const s=n.createElement(i,{tool:e});return e.hideToolPanelDivider?.()?s:n.createElement("div",{className:"tool-panel-container"},n.createElement("div",{className:"active-tool-divider"}),s)}_renderToolCategory(e,t){return n.createElement("div",{key:e,className:"tool-category"},this._renderTools(t))}render(){const e=this._availableToolCategories();return n.createElement("div",{className:"tool-panel__section"},Object.keys(e).map((t=>this._renderToolCategory(t,e[t]))))}}e.exports=ToolsPanel},53696:(e,t,r)=>{const n=r(72922),i=r(23770);class UnsupportedScreenSizeWarning extends i.Component{constructor(e){super(e),this.state={isVisible:!0}}_closeWarning(){this.setState({isVisible:!1})}render(){return this.state.isVisible?i.createElement("div",{className:"flex screen-size-warning__container"},i.createElement("div",null,"Warning: This application is not optimized for this screen size. We recommend using a larger tablet or desktop."),i.createElement("button",{className:"self-start",onClick:this._closeWarning.bind(this)},i.createElement(n,{name:"close"}))):null}}e.exports=UnsupportedScreenSizeWarning},2065:(e,t,r)=>{const{Icon:n}=r(47794),i=r(69722),s=r(23770),o=r(49683);class VideoModalView extends s.Component{static propTypes={closeModal:i.func.isRequired,videos:i.array.isRequired};constructor(e){super(e),this.state={selectedVideo:void 0}}videos(){return this.props.videos}libraryVideos(){return this.videos().filter((e=>e!==this.featuredVideo()))}featuredVideo(){const e=window.location.pathname;let t=t=>""!==t&&e.endsWith(t.trim().toLowerCase());return"/"===e&&(t=t=>e===t.trim()),this.videos().find((e=>e.featured_paths?.split(",").some(t)))??this.videos().find((e=>"default"===e.featured_paths))??this.videos().first()}navigateToVideoLibrary(){this.setState({selectedVideo:void 0})}navigateToVideo(e){this.setState({selectedVideo:e})}renderHeader(){return s.createElement("div",{className:"modal__header"},s.createElement("span",null),s.createElement("h2",{className:"margin-none"},"Video Tutorials"),s.createElement("button",{type:"button",className:"modal__close",onClick:()=>this.props.closeModal()},s.createElement(n,{name:"close"})))}renderFeaturedVideo(){const e=this.featuredVideo();if(e)return s.createElement("div",{className:"video-modal__video-library--featured-video"},s.createElement("button",{type:"button",className:"video-button",onClick:()=>this.navigateToVideo(e)},s.createElement("img",{src:`https://img.youtube.com/vi/${e.youtube_id}/mqdefault.jpg`}),s.createElement("div",{className:"hover-overlay"},s.createElement(n,{name:"play_arrow"}))),s.createElement("div",{className:"video-modal__video-description"},s.createElement("div",{className:"tag-group"},s.createElement("div",{className:"tag tag--primary"},"Featured")),s.createElement("h3",{className:"section-heading"},e.title),e.description.split("\n").map(((e,t)=>s.createElement("p",{key:`paragraph-${t}`},e)))))}renderCatalogVideo(e,t){return s.createElement("div",{className:"video-modal__video-library--catalog-item"},s.createElement("button",{key:t,type:"button",className:"video-button",onClick:()=>this.navigateToVideo(e)},s.createElement("img",{src:`https://img.youtube.com/vi/${e.youtube_id}/mqdefault.jpg`}),s.createElement("div",{className:"hover-overlay"},s.createElement(n,{name:"play_arrow"}))),s.createElement("div",{className:"video-modal__video-description"},s.createElement("h4",{className:"section-heading"},e.title),s.createElement("p",null,e.description)))}renderLibraryContent(){return s.createElement("div",{className:"video-modal__video-library--catalog-list"},this.libraryVideos().map(((e,t)=>this.renderCatalogVideo(e,t))))}renderVideoPage(){return s.createElement("div",{className:"video-modal__video-library--player"},s.createElement(o,{video:this.state.selectedVideo,goBack:()=>this.navigateToVideoLibrary()}))}renderVideoLibrary(){return 0===this.videos().length?s.createElement(s.Fragment,null):s.createElement("div",{className:"video-modal__video-library--container"},this.renderFeaturedVideo(),this.renderLibraryContent())}renderContent(){return s.createElement("div",{className:"modal__body"},this.state.selectedVideo?this.renderVideoPage():this.renderVideoLibrary())}render(){return s.createElement(s.Fragment,null,this.renderHeader(),this.renderContent())}}e.exports=VideoModalView},49683:(e,t,r)=>{const{Icon:n}=r(47794),i=r(69722),s=r(23770);class VideoPageView extends s.Component{static propTypes={video:i.object.isRequired,goBack:i.func.isRequired};renderBackLink(){return s.createElement("button",{type:"button",onClick:()=>this.props.goBack(),className:"btn btn--navigate"},s.createElement(n,{name:"arrow_back"}),"All Videos")}renderVideo(){return s.createElement("div",{className:"modal__content--video"},s.createElement("iframe",{allowFullScreen:!0,src:`https://youtube.com/embed/${this.props.video.youtube_id}`}))}renderVideoText(){return s.createElement("div",{className:"modal__content--video-description"},s.createElement("h3",{className:"section-heading"},this.props.video.title),this.props.video.description.split("\n").map(((e,t)=>s.createElement("p",{key:`paragraph-${t}`},e))))}render(){return s.createElement(s.Fragment,null,this.renderBackLink(),this.renderVideo(),this.renderVideoText())}}e.exports=VideoPageView},51753:(e,t,r)=>{const n=r(23770),i=r(69722);class XROverlay extends n.Component{static propTypes={drawingEditor:i.object.isRequired};constructor(e){super(e),this.overlayWrapperRef=n.createRef()}componentDidMount(){this.overlayWrapperRef.current.addEventListener("beforexrselect",this._catchEvent)}componentWillUnmount(){this.overlayWrapperRef.current.removeEventListener("beforexrselect",this._catchEvent)}async exitXR(){await this.props.drawingEditor.drawingController().exitXR()}resetAlignment(){const e=this.props.drawingEditor.toolPalette().tool("Set Alignment");this.props.drawingEditor.toolPalette().setActiveTool(e)}_catchEvent(e){"BUTTON"===e.target.tagName&&e.preventDefault()}_renderExitButton(){return n.createElement("button",{className:"btn btn--outline",type:"button",onClick:()=>this.exitXR()},"Exit AR")}_renderResetButton(){return n.createElement("button",{className:"btn btn--outline",type:"button",onClick:()=>this.resetAlignment()},"Set Alignment")}render(){return n.createElement("div",{className:"ar-overlay",ref:this.overlayWrapperRef},this._renderExitButton(),this._renderResetButton())}}e.exports=XROverlay},75662:(e,t,r)=>{const n=r(23770),i=r(69722),s=r(72922);class XRPreviewButton extends n.Component{static propTypes={drawingEditor:i.object.isRequired,xrMode:i.string.isRequired,showLabels:i.bool};constructor(e){super(e),this.state={supportedModes:[]}}async componentDidMount(){await this.loadSupportedModes()}async loadSupportedModes(){if(!window.navigator.xr)return[];const e=[await window.navigator.xr.isSessionSupported("immersive-ar")&&"ar",await window.navigator.xr.isSessionSupported("immersive-vr")&&"vr"].filter(Boolean);this.setState({supportedModes:e})}async enterXR(){const e=this.props.xrMode;if(await this.props.drawingEditor.drawingController().enterXR(e),"ar"===e){const e=this.props.drawingEditor.toolPalette().tool("Set Alignment");this.props.drawingEditor.toolPalette().setActiveTool(e)}}xrSupported(){const e=this.props.xrMode;return this.state.supportedModes.includes(e)}_renderButtonLabel(){if(!this.props.showLabels||!this.xrSupported())return;const e="ar"===this.props.xrMode?"AR Preview":"VR Preview";return n.createElement("div",{className:"action-bar-label","data-testid":"xr-preview-button-label"},e)}render(){return this.xrSupported()?n.createElement("button",{type:"button",className:"editor-control-button",onClick:()=>this.enterXR()},this._renderButtonLabel(),n.createElement(s,{name:"view_in_ar",color:"primary"})):null}}e.exports=XRPreviewButton},79645:(e,t,r)=>{const n=r(23770),i=r(65223),s=r(63526);e.exports=class ExternalProjectsModeStrategy extends s{renderSaveButton(e){return n.createElement(i,{projectRepository:e,onCompletion:this.onCompletion.bind(this)})}onCompletion(e){e.success&&this.redirect(e)}redirect(e){this.disableUnsavedAlert(),window.location.assign(this.redirectDestination(e))}projectPath(){return"/external_projects"}projectDidLoad(){this.setupAutosave()}renderEstimatedPrice(){if(this.systemStrategy().showsExternalEditorPrice())return super.renderEstimatedPrice()}redirectDestination(e){const t=this.app().props.projectId;return this.systemStrategy().externalEditorRedirectDefault(t,e)}showMenuItems(){const e=this.systemStrategy();return e.customMenuItemPaths().length>0&&e.allowsExternalEditorDownloads()}disableUnsavedAlert(){window.onbeforeunload=()=>{}}alertForUnsavedChanges(){return!0}}},36280:(e,t,r)=>{const n=r(31090),i=r(2386),s=r(52546),o=r(8325),{VersionedProject:a}=r(7340),l=r(23770),c=r(11511),u=r(63526);e.exports=class GuestModeStrategy extends u{systemStrategy(){return c.strategy()}showLayerToggle(){return this.systemStrategy().showsGuestLayerToggle()}renderLeftActionBarItems(){const e=this.systemStrategy().startOverButtonText();return l.createElement(i,{buttonClasses:"btn btn-warning",label:e,prompt:"This will completely erase the contents of your design.",action:()=>this._reloadPage()})}_guestEditorPath(){return this.app().props.basePath}_reloadPage(){this.disableUnsavedAlert(),location.replace(this._guestEditorPath())}renderSaveButton(e){if(this.systemStrategy().showsGuestSaveButton())return l.createElement(n,{signedIn:this.app().state.signedIn,onSignIn:()=>this.app().onSignIn(),renderChildren:()=>l.createElement(s,{projectRepository:e,onProjectSaved:()=>this.disableUnsavedAlert(),isInModal:!0}),buttonText:"Save",modalTitle:"Save Project",buttonClassName:"btn--pill",systemStrategy:this.systemStrategy()})}renderSubmitQuoteModal(){const e=this.systemStrategy();if(e.showsGuestRequestQuoteButton())return l.createElement(n,{signedIn:this.app().state.signedIn,onSignIn:()=>this._signedIn(),renderChildren:(t,r)=>l.createElement(o,{projectRepository:this.app().projectRepository(),disclaimer:e.t("quote.disclaimer"),closeModal:t,onSuccessfulCreation:r}),buttonText:"Request Quote",buttonClassName:"btn-primary",systemStrategy:e})}accessoryEditorElement(e){const t=this.systemStrategy().guestWatermarkClassNames();if(t)return l.createElement("div",{className:t})}showCustomLinkButton(){return this.systemStrategy().showGuestCustomLinkButton()}loadProject(){const e=this.systemStrategy().projectClass(),t=new a(new e);return t.setIsInitialized(!1),this.app().projectRepository().setProject(t),t}async updateOnServer(){}_signedIn(){this.app().onSignIn(),this.disableUnsavedAlert()}disableUnsavedAlert(){window.onbeforeunload=()=>{}}alertForUnsavedChanges(){return!0}}},63526:(e,t,r)=>{const n=r(23770),{Icon:i}=r(47794),s=r(17551),o=r(11511);e.exports=class ModeStrategy{constructor(e){this._app=e}app(){return this._app}renderSaveButton(){}renderSubmitQuoteModal(){}projectPath(){}alertForUnsavedChanges(){}renderGuestEditorButton(){}renderLeftActionBarItems(){}defaultPerspective(){return"top"}systemStrategy(){return o.strategy()}async loadProject(){const e=this.app().props.projectId;this.projectWillLoad(),await this.app().projectRepository().loadFromServer(e),this.projectDidLoad()}projectWillLoad(){}projectDidLoad(){}setupAutosave(){this.app().projectRepository().setupAutosave()}async updateOnServer(){this.app().projectRepository().updateOnServer()}publicLink(){return this.app().props.publicLink}renderShareLink(){if(this.publicLink()&&!this.showMenuItems())return n.createElement("div",{className:"margin-left-md"},this._shareLink("action-bar-link"))}_shareLink(e,t){if(this.publicLink())return n.createElement("a",{href:this.publicLink(),title:"View only link",className:e,target:"_blank",rel:"noreferrer"},t,"Share Link")}renderBackLink(){return n.createElement("a",{href:this.app().props.backPath,title:"Back",className:"action-bar-link",onClick:e=>this.app().saveBeforeNavigate(e)},n.createElement(i,{name:"arrow_back"}),this.app().props.backLinkText)}renderEstimatedPrice(){return n.createElement(s,{projectRepository:this.app().projectRepository(),onlyShowDisclaimer:this.systemStrategy().onlyShowPriceDisclaimer(),hidePricing:this.systemStrategy().hidePricing()})}customMenuItems(e,t){return this.systemStrategy().customMenuItemPaths().map((i=>{const s=r(86900)(`./${i}`);return n.createElement(s,{key:i,drawingEditor:e,projectRepository:t})}))}renderMenuItems(e,t){return n.createElement(n.Fragment,null,this._shareLink("action-bar-dropdown-menu__item",n.createElement(i,{name:"link"})),this.customMenuItems(e,t))}renderActionButtons(e){}renderCustomLinkButton(){if(!this.showCustomLinkButton())return;const e=this.systemStrategy();return n.createElement("a",{href:e.t("custom_link_button.link"),className:"btn btn-primary",target:"_blank",rel:"noreferrer"},e.t("custom_link_button.label"))}showBackLink(){return!1}showMenuItems(){return!1}showUndoRedoControls(){return!0}showPropertyPanel(){return!0}showToolPanel(){return!0}showCustomLinkButton(){return!1}isViewOnly(){return!1}showLayerToggle(){return!0}drawingLayers(){return this.systemStrategy().drawingLayers()}showKeyboardShortcuts(){return!0}accessoryEditorElement(e){}}},19395:(e,t,r)=>{const{VersionedProject:n}=r(7340),i=r(11511),s=r(63526),o=r(23770);e.exports=class PreviewModeStrategy extends s{systemStrategy(){return i.strategy()}loadProject(){const e=this.systemStrategy().projectClass(),t=new n(new e);return t.setIsInitialized(!0),this.app().projectRepository().setProject(t),t}async updateOnServer(){}onProjectSaved(){window.onbeforeunload=()=>{}}alertForUnsavedChanges(){return!0}showBackLink(){return!0}renderBackLink(){return o.createElement("button",{type:"button",onClick:()=>this.app().props.returnToOptions?.(),className:"btn btn-primary"},"Back to options")}}},379:(e,t,r)=>{const n=r(23770),i=r(63526),s=r(31090),o=r(8325);e.exports=class ProjectModeStrategy extends i{showBackLink(){return!0}renderSubmitQuoteModal(){const e=this.app().project().systemStrategy();if(e.showsRequestQuoteButton())return n.createElement(s,{signedIn:this.app().state.signedIn,onSignIn:this.app().onSignIn.bind(this.app()),buttonText:"Request Quote",buttonClassName:"action-bar--call-to-action",systemStrategy:e,renderChildren:(t,r)=>n.createElement(o,{projectRepository:this.app().projectRepository(),disclaimer:e.t("quote.disclaimer"),closeModal:t,onSuccessfulCreation:r})})}projectDidLoad(){this.setupAutosave()}showMenuItems(){return this.systemStrategy().customMenuItemPaths().length>0}}},73593:(e,t,r)=>{const n=r(23770),i=r(63526),s=r(17551),o=r(38719),a=r(16961);e.exports=class PublicModeStrategy extends i{projectPath(){return this.app().props.projectPath}projectWillLoad(){this._postShareLinkVisitedEvent()}_postShareLinkVisitedEvent(){this.systemStrategy().postAnalyticsEvent(a.shareLinkVisited)}showUndoRedoControls(){return!1}defaultPerspective(){return"3d"}renderEstimatedPrice(){if(this.systemStrategy().showsPublicPrice())return n.createElement(s,{projectRepository:this.app().projectRepository(),hideBreakdown:!0,onlyShowDisclaimer:this.systemStrategy().showPublicPricingDisclaimer(),hidePricing:this.systemStrategy().hidePricing()})}renderGuestEditorButton(){const e=this.systemStrategy().showsPublicDesignYourOwnButton(),t=this.app().props.guestEditorPath;if(t&&e)return n.createElement("a",{className:"btn btn-primary",href:t},"Design your own")}showLayerToggle(){return this.systemStrategy().showsPublicLayerToggle()}showPropertyPanel(){return!1}showToolPanel(){return!1}isViewOnly(){return!0}drawingLayers(){return this.systemStrategy().publicDrawingLayers()}showKeyboardShortcuts(){return!1}accessoryEditorElement(e){const t=this.systemStrategy().watermarkClassNames();if(t)return n.createElement("div",{className:t})}renderActionButtons(e){if(this.systemStrategy().allowsPublicDownloads())return n.createElement(o,{inMenu:!1,projectRepository:this.app().projectRepository(),drawingEditor:e})}}},32912:(e,t,r)=>{const n=r(63526);e.exports=class QuoteModeStrategy extends n{projectPath(){return"/admin/quotes"}async loadProject(){await super.loadProject(),this.app().projectRepository().setupAutosave()}showBackLink(){return!0}showMenuItems(){return this.systemStrategy().customMenuItemPaths().length>0}}},21860:(e,t,r)=>{const n=r(63526);e.exports=class TemplateModeStrategy extends n{projectPath(){return"/templates"}showBackLink(){return!0}async loadProject(){await super.loadProject(),this.app().projectRepository().setupAutosave()}}},21716:(e,t,r)=>{const n=r(23770),i=r(69722);class ActionPropertyView extends n.Component{static propTypes={property:i.object.isRequired,eventRecorder:i.object.isRequired};static forType="action";_performAction(){this.props.property.editableProperties?this.props.property.editableProperties().map((e=>{this._perform(e)})):this._perform(this.props.property),this.props.eventRecorder.recordChange()}_perform(e){e.options().perform()}render(){const e=this.props.property;return n.createElement("button",{type:"button",className:"btn btn--outline full-width margin-top-md",disabled:e.disabled?.(),onClick:this._performAction.bind(this)},e.label())}}e.exports=ActionPropertyView},19907:(e,t,r)=>{const n=r(23770),i=r(69722);class DividerPropertyView extends n.Component{static propTypes={property:i.object.isRequired};static forType="divider";property(){return this.props.property}label(){return this.property().label()}imageURL(){return this.property().imageURL()}_renderLabel(){if(this.label())return n.createElement("p",{className:"label"},this.label())}_renderImage(){if(this.imageURL())return n.createElement("img",{src:this.imageURL()})}render(){return n.createElement("div",{className:"property-divider"},this._renderLabel(),this._renderImage())}}e.exports=DividerPropertyView},68739:(e,t,r)=>{const n=r(23770),i=r(69722),{Polygon:s,$P:o}=r(62048),a=r(21260),l=r(74320);class EdgeBooleanMapPropertyView extends n.Component{static propTypes={property:i.object.isRequired,eventRecorder:i.object.isRequired};static forType="edge-boolean-map";constructor(e){super(e),this.state={map:e.property.get()}}keys(){return this.state.map.keys()}items(){return this._shape().edges()}_toggleValue(e){this.props.property.set(e,!this.state.map.get(e)),this.props.eventRecorder.recordChange(),this.setState({values:this.props.property.get()})}_axisDerivedShape(){const e=this.props.property.component().mainAxis().multipliedBy(40),t=this.props.property.component().crossAxis().multipliedBy(20),r=o(0,0);return new s([r.subtract(e).subtract(t),r.add(e).subtract(t),r.add(e).add(t),r.subtract(e).add(t)])}_shape(){const e=this.props.property.options().geometry;return e||this._axisDerivedShape()}_imageGenerator(){return this.__imageGenerator??=new l(this._shape())}_generateImageFor(e,t){const r=this._drawingStylesFor(this._stateNameFor(t));return this._imageGenerator().generateImage({highlightedElement:e,drawingStyles:r})}_stateNameFor(e){return this.state.map.get(e)?"on":"off"}_drawingStylesFor(e){return this._drawingStylesMap()[e]}_drawingStylesMap(){return this.__drawingStylesMap??=this._defaultDrawingStylesMap()}_defaultDrawingStylesMap(){return{off:new a("#EBEBEB","#1A202C"),on:new a("#B8DAFF","#5485d2")}}_renderableItemForKey(e){return this.props.property.options().renderableItemForKey?.(e)}_renderKey(e,t){const r=this._renderableItemForKey(e)||this.items()[t];return n.createElement("button",{className:"display-properties__edge-map--button",key:`option-${t}`,onClick:()=>this._toggleValue(e),title:`Option ${t+1}`},n.createElement("img",{width:"100%",src:this._generateImageFor(r,e)}))}renderOptions(){return this.keys().map(((e,t)=>this._renderKey(e,t)))}_renderOptionsLegendItem(e){const t=this._drawingStylesFor(e),r={backgroundColor:t.backgroundColor,border:`1px ${t.lineDash?.length>0?"dashed":"solid"} ${t.strokeColor}`};return n.createElement("div",{key:e,className:"edge-map__legend--state display-property--readonly"},n.createElement("span",{className:"box",style:r})," ",n.createElement("span",{className:"form-label name"},e))}_showOptionsLegend(){return!1}renderOptionsLegend(){if(this._showOptionsLegend())return n.createElement("div",{className:"edge-map__legend"},Object.keys(this._drawingStylesMap()).map(this._renderOptionsLegendItem.bind(this)))}render(){return void 0===this.props.property.component?null:n.createElement("fieldset",{className:"radio-select"},n.createElement("legend",{className:"form-label"},this.props.property.label()),n.createElement("div",{className:"radio-select__options edge-map__options"},this.renderOptions(),this.renderOptionsLegend()))}}e.exports=EdgeBooleanMapPropertyView},40661:(e,t,r)=>{const n=r(68739);e.exports=class EdgeMultiStateMapPropertyView extends n{static forType="edge-multi-state-map";_defaultDrawingStylesMap(){const e=this.state.map.values().first().constructor.defaultToggleStateDrawingStyles(),t={};return Object.entries(e).forEach((([e,r])=>t[e]=r)),t}_toggleValue(e){const t=this.state.map.get(e);t.toggle(),this.props.property.set(e,t),this.props.eventRecorder.recordChange(),this.setState({values:this.props.property.get()})}_stateNameFor(e){return this.state.map.get(e).current().name}_showOptionsLegend(){return!0}}},56792:(e,t,r)=>{const n=r(23770),i=r(69722);class FilePropertyView extends n.Component{static propTypes={property:i.object.isRequired,eventRecorder:i.object.isRequired};static forType="file";_updateFile(e){const t=e.target.files[0];t&&this._setFile(t)}_removeFile(e){this._setFile(void 0)}_setFile(e){this.props.property.set(e),this.props.eventRecorder.recordChange(),this.forceUpdate()}_labelPrependText(){return this.props.property.get()?this.props.property.options().withValueLabel??"Replace":this.props.property.options().noValueLabel??"Add"}_renderRemoveButton(){if(!this.props.property.get())return;const{property:e}=this.props;return n.createElement("button",{className:"btn btn--danger full-width",onClick:this._removeFile.bind(this)},"Remove ",e.label())}render(){const{property:e}=this.props;return n.createElement(n.Fragment,null,n.createElement("label",{className:"btn btn--outline full-width"},this._labelPrependText()," ",e.label(),n.createElement("input",{className:"hidden",type:"file",accept:e.options().accept,onChange:this._updateFile.bind(this)})),this._renderRemoveButton())}}e.exports=FilePropertyView},64460:(e,t,r)=>{const n=r(68739);e.exports=class LocatorBooleanMapPropertyView extends n{static forType="locator-boolean-map";items(){return this._shape().vertices()}}},53498:(e,t,r)=>{const n=r(23770),i=r(69722);class NoticePropertyView extends n.Component{static propTypes={property:i.object.isRequired,eventRecorder:i.object.isRequired};static forType="notice";_keyFor(e){return`notice-${e.split(" ").join("-").toString()}`}_renderPropertyValue(e){const t=e.get();return n.createElement(n.Fragment,null,n.createElement("span",{className:"display-property__label"},e.label(),":"),n.createElement("ul",null,t.map((e=>n.createElement("li",{key:this._keyFor(e),className:"display-property__read-only-value"},e)))))}render(){const e=this.props.property;return this._renderPropertyValue(e)}}e.exports=NoticePropertyView},11698:(e,t,r)=>{const n=r(23770),i=r(69722),{UnitField:s}=r(47794),o=r(78035);class ScalePropertyView extends n.Component{static propTypes={property:i.object.isRequired,eventRecorder:i.object.isRequired};static forType="scale";constructor(e){super(e),this.state={pageDistance:e.property.component().pageDistance(),worldDistance:e.property.component().worldDistance(),fieldKey:0,pageDistanceFieldKey:0,measuringScale:!1,distanceMeasured:!1}}scale(){return this.props.property.component()}measureTool(){return this.props.eventRecorder.measureTool()}pageDistance(){return this.state.measuringScale?this.measureTool().pageDistance():this.state.pageDistance}worldDistance(){return this.state.worldDistance}componentDidMount(){this.props.eventRecorder.startObserverToolHolder(this,this.updateMeasuringValue)}componentWillUnmount(){this.props.eventRecorder.stopObserverToolHolder(this,this.updateMeasuringValue),this.stopMeasuringScale()}stopMeasuringScale(){if(this.state.measuringScale){const e=this.measureTool().measurement();e.removeLengthChangedObserver(this,this._measurementLengthChanged),e.removeMeasuredObserver(this,this._measurementLengthMeasured),this.props.eventRecorder.deactivateMeasureTool()}}startMeasuringScale(){this.props.eventRecorder.activateMeasureTool();const e=this.measureTool().measurement();e.addLengthChangedObserver(this,this._measurementLengthChanged),e.addMeasuredObserver(this,this._measurementLengthMeasured)}updateMeasuringValue(){this.setState((e=>({measuringScale:this.props.eventRecorder.measureToolActive(),pageDistanceFieldKey:e.pageDistanceFieldKey+1})))}_toggleMeasureTool(){this.state.measuringScale?(this.stopMeasuringScale(),this._updateValues()):(this.startMeasuringScale(),this.updateMeasuringValue())}_actionsDisabled(){return this.pageDistance()?.equals(this.scale().pageDistance())&&this.worldDistance().equals(this.scale().worldDistance())}_cancelDisabled(){return!this.state.measuringScale&&this._actionsDisabled()}_saveDisabled(){return this._actionsDisabled()||this.state.measuringScale&&!this.state.distanceMeasured}_onCancel(){this.state.measuringScale?this._toggleMeasureTool():this._updateValues()}_updateValues(){this.setState((e=>({pageDistance:this.scale().pageDistance(),worldDistance:this.scale().worldDistance(),fieldKey:e.fieldKey+1,distanceMeasured:!1,measuringScale:!1})))}_onSave(){this.scale().set(this.pageDistance(),this.worldDistance()),this.stopMeasuringScale(),this._updateValues(),this.props.eventRecorder.recordChange()}_updatePageDistance(e){this.setState({pageDistance:e})}_savePageDistance(e){this._updatePageDistance(e)}_updateWorldDistance(e){this.setState({worldDistance:e})}_saveWorldDistance(e){this._updateWorldDistance(e)}_measurementLengthChanged(){this.setState((e=>({pageDistanceFieldKey:e.pageDistanceFieldKey+1})))}_measurementLengthMeasured(){this.setState({distanceMeasured:!0})}_label(){return this.props.property.label()}_promptLabel(){return this._label().replace(" Scale","")}_renderLabel(){return n.createElement("div",{className:"text-center"},this._label())}formatter(){return this.scale().lengthFormatter()}_renderInputs(){const e=this.scale(),t=e.isSet()?e.pageDistance():void 0,r=this.measureTool().pageDistance(),i=this.state.measuringScale?r:t,o=e.isSet()?this.formatter().format(e.worldDistance()):"",a=i?this.formatter().format(i):"",l=this.formatter().baseUnit();return n.createElement("div",{className:"flex items-center margin-top-sm"},n.createElement(s,{key:`page-distance-${this.state.fieldKey}-${this.state.pageDistanceFieldKey}`,name:"Page Distance",defaultUnit:l,label:"Page Distance",value:a,onSave:e=>this._savePageDistance(e),onUpdate:e=>this._updatePageDistance(e),disabled:this.state.measuringScale,labelClassName:"hidden",wrapperClassName:"enter-scale__input-wrapper",inputClassName:"display-property__input",errorClassName:"hidden"}),n.createElement("span",{className:"margin-x-sm"},"="),n.createElement(s,{key:`world-distance-${this.state.fieldKey}`,name:"World Distance",defaultUnit:l,label:"World Distance",value:o,onSave:e=>this._saveWorldDistance(e),onUpdate:e=>this._updateWorldDistance(e),labelClassName:"hidden",wrapperClassName:"enter-scale__input-wrapper",inputClassName:"display-property__input",errorClassName:"hidden"}))}_renderActions(){return n.createElement("div",{className:"flex items-center margin-top-sm"},n.createElement("button",{type:"button",disabled:this._cancelDisabled(),className:"btn btn--outline full-width margin-right-sm",onClick:()=>this._onCancel()},"Cancel"),n.createElement("button",{type:"button",disabled:this._saveDisabled(),className:"btn btn--primary full-width",onClick:()=>this._onSave()},"Save"))}_renderMeasureScale(){const e=o("btn btn--outline btn--small full-width",{"measure-tool-on":this.state.measuringScale});return n.createElement("div",{className:"measure-scale__wrapper"},n.createElement("span",{className:"measure-scale__label"},this._promptLabel()," missing a scale?"),n.createElement("button",{type:"button",className:e,onClick:()=>this._toggleMeasureTool()},"Measure a dimension"))}render(){return n.createElement(n.Fragment,null,n.createElement("div",{className:"enter-scale__wrapper"},this._renderLabel(),this._renderInputs(),this._renderActions()),this._renderMeasureScale())}}e.exports=ScalePropertyView},53779:(e,t,r)=>{const n=r(23770),i=r(69722),{Icon:s}=r(47794);class SegmentPropertyView extends n.Component{static propTypes={property:i.object.isRequired,eventRecorder:i.object.isRequired};static forType="segment";constructor(e){super(e),this.state={property:e.property,selectedValue:e.property.get()}}isSelected(e){const t=this.state.selectedValue;return""!==t&&(e.value===t||e.value?.equals?.(t))}_updateProperty(e){const t=this.state.property;t.set(e),this.props.eventRecorder.recordChange(),this.setState({selectedValue:t.get()})}_renderLabel(){const e=this.props.property.label();return e?n.createElement("legend",{className:"form-label"},e,":"):""}_renderOption(e){const t=this.isSelected(e);return n.createElement("label",{key:e.label,className:t?"selected":"",title:e.label},n.createElement("input",{type:"radio",value:e.label,className:"hidden",selected:t,onClick:()=>this._updateProperty(e.value),disabled:e.disabled}),n.createElement(s,{name:e.icon}))}_renderSelectedValue(){const{property:e}=this.state,t=e.options().choices.find((e=>this.isSelected(e))),r=t?.label??"Multiple";return n.createElement("span",{className:"display-property__selected-value"},r)}render(){const{property:e}=this.state,t=e.options().choices;return n.createElement(n.Fragment,null,this._renderLabel(),n.createElement("div",{className:"segment-control__wrapper"},t.map((e=>this._renderOption(e)))),this._renderSelectedValue())}}e.exports=SegmentPropertyView},61951:(e,t,r)=>{const n=r(23770),i=r(69722),{DisplayPropertiesView:s}=r(47794),o=r(48578),a=r(11511),l=r(10793);class RailingCollectionToolPanel extends n.Component{static propTypes={tool:i.object.isRequired};constructor(e){super(e),this.state={angleSnappingOn:e.tool.angleSnapping()}}componentDidMount(){this.props.tool.addAngleSnapToggledObserver(this,this._angleSnapToggled)}componentWillUnmount(){this.props.tool.removeAngleSnapToggledObserver(this,this._angleSnapToggled)}tool(){return this.props.tool}place(){this.tool().terminate()}cancel(){this.tool().cancelAction()}eventRecorder(){return this._eventRecorder||(this._eventRecorder=new o),this._eventRecorder}_angleSnapToggled(){this.setState({angleSnappingOn:this.tool().angleSnapping()})}_toggleSnapping(){this.tool().toggleAngleSnapping()}_renderStrategyProperties(){return n.createElement(s,{components:[this.tool().defaultPlacementStrategy()],propertyEventRecorder:this.eventRecorder()})}_renderToolProperties(){return n.createElement(s,{components:[this.tool()],propertyEventRecorder:this.eventRecorder()})}_renderAngleSnappingToggle(){if(!a.strategy().allowAngleSnapToggle())return;const e=`${this.tool().iconName()}--angle-snapping`;return n.createElement("div",{className:"display-property display-property--editable display-property--boolean"},n.createElement("input",{className:"form__checkbox",onChange:this._toggleSnapping.bind(this),checked:this.state.angleSnappingOn,type:"checkbox",id:e,name:e}),n.createElement("label",{className:"form-label",htmlFor:e},"Angle Snapping"))}_renderActionButtons(){return n.createElement("div",{className:"action-buttons"},n.createElement("button",{className:"btn",onClick:this.cancel.bind(this),type:"reset"},"Cancel"),n.createElement("button",{className:"btn btn-primary",onClick:this.place.bind(this),type:"submit"},"Place"))}render(){return n.createElement(n.Fragment,null,n.createElement(l,{tool:this.tool()}),this._renderToolProperties(),this._renderStrategyProperties(),this._renderAngleSnappingToggle(),this._renderActionButtons())}}e.exports=RailingCollectionToolPanel},10793:(e,t,r)=>{const n=r(69722),i=r(23770);class ToolContextMessagePanel extends i.Component{static propTypes={tool:n.object.isRequired};constructor(e){super(e),this.state={message:e.tool.contextMessage()}}componentDidMount(){this.props.tool.addToolContextMessageChangedObserver(this,this.updateMessage.bind(this))}componentWillUnmount(){this.props.tool.removeToolContextMessageChangedObserver(this,this.updateMessage.bind(this))}updateMessage(){this.setState({message:this.props.tool.contextMessage()})}render(){const e=this.state.message;return e?i.createElement("div",{className:"tool-context-message__container"},e):null}}e.exports=ToolContextMessagePanel},25418:(e,t,r)=>{const n=r(23770),i=r(69722),{DisplayPropertiesView:s}=r(47794),o=r(48578),a=r(10793),l=r(21716);class ToolPropertyPanel extends n.Component{static propTypes={tool:i.object.isRequired};tool(){return this.props.tool}eventRecorder(){return this._eventRecorder||(this._eventRecorder=new o),this._eventRecorder}render(){return n.createElement(n.Fragment,null,n.createElement(a,{tool:this.tool()}),n.createElement(s,{propertyViews:[l],components:[this.tool()],propertyEventRecorder:this.eventRecorder()}))}}e.exports=ToolPropertyPanel},77673:(e,t,r)=>{"use strict";function n(e){return e.keys().map((t=>function(e,t){const r=function(e){const t=(e.match(/^(?:\.\/)?(.+)(?:[_-]controller\..+?)$/)||[])[1];if(t)return t.replace(/_/g,"-").replace(/\//g,"--")}(t);if(r)return function(e,t){const r=e.default;if("function"==typeof r)return{identifier:t,controllerConstructor:r}}(e(t),r)}(e,t))).filter((e=>e))}r.d(t,{Ux:()=>n})},37849:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Application:()=>Application,AttributeObserver:()=>AttributeObserver,Context:()=>Context,Controller:()=>Controller,ElementObserver:()=>ElementObserver,IndexedMultimap:()=>IndexedMultimap,Multimap:()=>Multimap,SelectorObserver:()=>SelectorObserver,StringMapObserver:()=>StringMapObserver,TokenListObserver:()=>TokenListObserver,ValueListObserver:()=>ValueListObserver,add:()=>g,defaultSchema:()=>q,del:()=>y,fetch:()=>b,prune:()=>v});class EventListener{constructor(e,t,r){this.eventTarget=e,this.eventName=t,this.eventOptions=r,this.unorderedBindings=new Set}connect(){this.eventTarget.addEventListener(this.eventName,this,this.eventOptions)}disconnect(){this.eventTarget.removeEventListener(this.eventName,this,this.eventOptions)}bindingConnected(e){this.unorderedBindings.add(e)}bindingDisconnected(e){this.unorderedBindings.delete(e)}handleEvent(e){const t=function(e){if("immediatePropagationStopped"in e)return e;{const{stopImmediatePropagation:t}=e;return Object.assign(e,{immediatePropagationStopped:!1,stopImmediatePropagation(){this.immediatePropagationStopped=!0,t.call(this)}})}}(e);for(const e of this.bindings){if(t.immediatePropagationStopped)break;e.handleEvent(t)}}hasBindings(){return this.unorderedBindings.size>0}get bindings(){return Array.from(this.unorderedBindings).sort(((e,t)=>{const r=e.index,n=t.index;return r<n?-1:r>n?1:0}))}}class Dispatcher{constructor(e){this.application=e,this.eventListenerMaps=new Map,this.started=!1}start(){this.started||(this.started=!0,this.eventListeners.forEach((e=>e.connect())))}stop(){this.started&&(this.started=!1,this.eventListeners.forEach((e=>e.disconnect())))}get eventListeners(){return Array.from(this.eventListenerMaps.values()).reduce(((e,t)=>e.concat(Array.from(t.values()))),[])}bindingConnected(e){this.fetchEventListenerForBinding(e).bindingConnected(e)}bindingDisconnected(e,t=!1){this.fetchEventListenerForBinding(e).bindingDisconnected(e),t&&this.clearEventListenersForBinding(e)}handleError(e,t,r={}){this.application.handleError(e,`Error ${t}`,r)}clearEventListenersForBinding(e){const t=this.fetchEventListenerForBinding(e);t.hasBindings()||(t.disconnect(),this.removeMappedEventListenerFor(e))}removeMappedEventListenerFor(e){const{eventTarget:t,eventName:r,eventOptions:n}=e,i=this.fetchEventListenerMapForEventTarget(t),s=this.cacheKey(r,n);i.delete(s),0==i.size&&this.eventListenerMaps.delete(t)}fetchEventListenerForBinding(e){const{eventTarget:t,eventName:r,eventOptions:n}=e;return this.fetchEventListener(t,r,n)}fetchEventListener(e,t,r){const n=this.fetchEventListenerMapForEventTarget(e),i=this.cacheKey(t,r);let s=n.get(i);return s||(s=this.createEventListener(e,t,r),n.set(i,s)),s}createEventListener(e,t,r){const n=new EventListener(e,t,r);return this.started&&n.connect(),n}fetchEventListenerMapForEventTarget(e){let t=this.eventListenerMaps.get(e);return t||(t=new Map,this.eventListenerMaps.set(e,t)),t}cacheKey(e,t){const r=[e];return Object.keys(t).sort().forEach((e=>{r.push(`${t[e]?"":"!"}${e}`)})),r.join(":")}}const n={stop:({event:e,value:t})=>(t&&e.stopPropagation(),!0),prevent:({event:e,value:t})=>(t&&e.preventDefault(),!0),self:({event:e,value:t,element:r})=>!t||r===e.target},i=/^(?:(?:([^.]+?)\+)?(.+?)(?:\.(.+?))?(?:@(window|document))?->)?(.+?)(?:#([^:]+?))(?::(.+))?$/;function s(e){return"window"==e?window:"document"==e?document:void 0}function o(e){return e.replace(/(?:[_-])([a-z0-9])/g,((e,t)=>t.toUpperCase()))}function a(e){return o(e.replace(/--/g,"-").replace(/__/g,"_"))}function l(e){return e.charAt(0).toUpperCase()+e.slice(1)}function c(e){return e.replace(/([A-Z])/g,((e,t)=>`-${t.toLowerCase()}`))}function u(e){return null!=e}function d(e,t){return Object.prototype.hasOwnProperty.call(e,t)}const h=["meta","ctrl","alt","shift"];class Action{constructor(e,t,r,n){this.element=e,this.index=t,this.eventTarget=r.eventTarget||e,this.eventName=r.eventName||function(e){const t=e.tagName.toLowerCase();if(t in p)return p[t](e)}(e)||m("missing event name"),this.eventOptions=r.eventOptions||{},this.identifier=r.identifier||m("missing identifier"),this.methodName=r.methodName||m("missing method name"),this.keyFilter=r.keyFilter||"",this.schema=n}static forToken(e,t){return new this(e.element,e.index,function(e){const t=e.trim().match(i)||[];let r=t[2],n=t[3];return n&&!["keydown","keyup","keypress"].includes(r)&&(r+=`.${n}`,n=""),{eventTarget:s(t[4]),eventName:r,eventOptions:t[7]?(o=t[7],o.split(":").reduce(((e,t)=>Object.assign(e,{[t.replace(/^!/,"")]:!/^!/.test(t)})),{})):{},identifier:t[5],methodName:t[6],keyFilter:t[1]||n};var o}(e.content),t)}toString(){const e=this.keyFilter?`.${this.keyFilter}`:"",t=this.eventTargetName?`@${this.eventTargetName}`:"";return`${this.eventName}${e}${t}->${this.identifier}#${this.methodName}`}shouldIgnoreKeyboardEvent(e){if(!this.keyFilter)return!1;const t=this.keyFilter.split("+");if(this.keyFilterDissatisfied(e,t))return!0;const r=t.filter((e=>!h.includes(e)))[0];return!!r&&(d(this.keyMappings,r)||m(`contains unknown key filter: ${this.keyFilter}`),this.keyMappings[r].toLowerCase()!==e.key.toLowerCase())}shouldIgnoreMouseEvent(e){if(!this.keyFilter)return!1;const t=[this.keyFilter];return!!this.keyFilterDissatisfied(e,t)}get params(){const e={},t=new RegExp(`^data-${this.identifier}-(.+)-param$`,"i");for(const{name:r,value:n}of Array.from(this.element.attributes)){const i=r.match(t),s=i&&i[1];s&&(e[o(s)]=f(n))}return e}get eventTargetName(){return(e=this.eventTarget)==window?"window":e==document?"document":void 0;var e}get keyMappings(){return this.schema.keyMappings}keyFilterDissatisfied(e,t){const[r,n,i,s]=h.map((e=>t.includes(e)));return e.metaKey!==r||e.ctrlKey!==n||e.altKey!==i||e.shiftKey!==s}}const p={a:()=>"click",button:()=>"click",form:()=>"submit",details:()=>"toggle",input:e=>"submit"==e.getAttribute("type")?"click":"input",select:()=>"change",textarea:()=>"input"};function m(e){throw new Error(e)}function f(e){try{return JSON.parse(e)}catch(t){return e}}class Binding{constructor(e,t){this.context=e,this.action=t}get index(){return this.action.index}get eventTarget(){return this.action.eventTarget}get eventOptions(){return this.action.eventOptions}get identifier(){return this.context.identifier}handleEvent(e){const t=this.prepareActionEvent(e);this.willBeInvokedByEvent(e)&&this.applyEventModifiers(t)&&this.invokeWithEvent(t)}get eventName(){return this.action.eventName}get method(){const e=this.controller[this.methodName];if("function"==typeof e)return e;throw new Error(`Action "${this.action}" references undefined method "${this.methodName}"`)}applyEventModifiers(e){const{element:t}=this.action,{actionDescriptorFilters:r}=this.context.application,{controller:n}=this.context;let i=!0;for(const[s,o]of Object.entries(this.eventOptions))if(s in r){const a=r[s];i=i&&a({name:s,value:o,event:e,element:t,controller:n})}return i}prepareActionEvent(e){return Object.assign(e,{params:this.action.params})}invokeWithEvent(e){const{target:t,currentTarget:r}=e;try{this.method.call(this.controller,e),this.context.logDebugActivity(this.methodName,{event:e,target:t,currentTarget:r,action:this.methodName})}catch(t){const{identifier:r,controller:n,element:i,index:s}=this,o={identifier:r,controller:n,element:i,index:s,event:e};this.context.handleError(t,`invoking action "${this.action}"`,o)}}willBeInvokedByEvent(e){const t=e.target;return!(e instanceof KeyboardEvent&&this.action.shouldIgnoreKeyboardEvent(e))&&(!(e instanceof MouseEvent&&this.action.shouldIgnoreMouseEvent(e))&&(this.element===t||(t instanceof Element&&this.element.contains(t)?this.scope.containsElement(t):this.scope.containsElement(this.action.element))))}get controller(){return this.context.controller}get methodName(){return this.action.methodName}get element(){return this.scope.element}get scope(){return this.context.scope}}class ElementObserver{constructor(e,t){this.mutationObserverInit={attributes:!0,childList:!0,subtree:!0},this.element=e,this.started=!1,this.delegate=t,this.elements=new Set,this.mutationObserver=new MutationObserver((e=>this.processMutations(e)))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,this.mutationObserverInit),this.refresh())}pause(e){this.started&&(this.mutationObserver.disconnect(),this.started=!1),e(),this.started||(this.mutationObserver.observe(this.element,this.mutationObserverInit),this.started=!0)}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started){const e=new Set(this.matchElementsInTree());for(const t of Array.from(this.elements))e.has(t)||this.removeElement(t);for(const t of Array.from(e))this.addElement(t)}}processMutations(e){if(this.started)for(const t of e)this.processMutation(t)}processMutation(e){"attributes"==e.type?this.processAttributeChange(e.target,e.attributeName):"childList"==e.type&&(this.processRemovedNodes(e.removedNodes),this.processAddedNodes(e.addedNodes))}processAttributeChange(e,t){this.elements.has(e)?this.delegate.elementAttributeChanged&&this.matchElement(e)?this.delegate.elementAttributeChanged(e,t):this.removeElement(e):this.matchElement(e)&&this.addElement(e)}processRemovedNodes(e){for(const t of Array.from(e)){const e=this.elementFromNode(t);e&&this.processTree(e,this.removeElement)}}processAddedNodes(e){for(const t of Array.from(e)){const e=this.elementFromNode(t);e&&this.elementIsActive(e)&&this.processTree(e,this.addElement)}}matchElement(e){return this.delegate.matchElement(e)}matchElementsInTree(e=this.element){return this.delegate.matchElementsInTree(e)}processTree(e,t){for(const r of this.matchElementsInTree(e))t.call(this,r)}elementFromNode(e){if(e.nodeType==Node.ELEMENT_NODE)return e}elementIsActive(e){return e.isConnected==this.element.isConnected&&this.element.contains(e)}addElement(e){this.elements.has(e)||this.elementIsActive(e)&&(this.elements.add(e),this.delegate.elementMatched&&this.delegate.elementMatched(e))}removeElement(e){this.elements.has(e)&&(this.elements.delete(e),this.delegate.elementUnmatched&&this.delegate.elementUnmatched(e))}}class AttributeObserver{constructor(e,t,r){this.attributeName=t,this.delegate=r,this.elementObserver=new ElementObserver(e,this)}get element(){return this.elementObserver.element}get selector(){return`[${this.attributeName}]`}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get started(){return this.elementObserver.started}matchElement(e){return e.hasAttribute(this.attributeName)}matchElementsInTree(e){const t=this.matchElement(e)?[e]:[],r=Array.from(e.querySelectorAll(this.selector));return t.concat(r)}elementMatched(e){this.delegate.elementMatchedAttribute&&this.delegate.elementMatchedAttribute(e,this.attributeName)}elementUnmatched(e){this.delegate.elementUnmatchedAttribute&&this.delegate.elementUnmatchedAttribute(e,this.attributeName)}elementAttributeChanged(e,t){this.delegate.elementAttributeValueChanged&&this.attributeName==t&&this.delegate.elementAttributeValueChanged(e,t)}}function g(e,t,r){b(e,t).add(r)}function y(e,t,r){b(e,t).delete(r),v(e,t)}function b(e,t){let r=e.get(t);return r||(r=new Set,e.set(t,r)),r}function v(e,t){const r=e.get(t);null!=r&&0==r.size&&e.delete(t)}class Multimap{constructor(){this.valuesByKey=new Map}get keys(){return Array.from(this.valuesByKey.keys())}get values(){return Array.from(this.valuesByKey.values()).reduce(((e,t)=>e.concat(Array.from(t))),[])}get size(){return Array.from(this.valuesByKey.values()).reduce(((e,t)=>e+t.size),0)}add(e,t){g(this.valuesByKey,e,t)}delete(e,t){y(this.valuesByKey,e,t)}has(e,t){const r=this.valuesByKey.get(e);return null!=r&&r.has(t)}hasKey(e){return this.valuesByKey.has(e)}hasValue(e){return Array.from(this.valuesByKey.values()).some((t=>t.has(e)))}getValuesForKey(e){const t=this.valuesByKey.get(e);return t?Array.from(t):[]}getKeysForValue(e){return Array.from(this.valuesByKey).filter((([t,r])=>r.has(e))).map((([e,t])=>e))}}class IndexedMultimap extends Multimap{constructor(){super(),this.keysByValue=new Map}get values(){return Array.from(this.keysByValue.keys())}add(e,t){super.add(e,t),g(this.keysByValue,t,e)}delete(e,t){super.delete(e,t),y(this.keysByValue,t,e)}hasValue(e){return this.keysByValue.has(e)}getKeysForValue(e){const t=this.keysByValue.get(e);return t?Array.from(t):[]}}class SelectorObserver{constructor(e,t,r,n){this._selector=t,this.details=n,this.elementObserver=new ElementObserver(e,this),this.delegate=r,this.matchesByElement=new Multimap}get started(){return this.elementObserver.started}get selector(){return this._selector}set selector(e){this._selector=e,this.refresh()}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get element(){return this.elementObserver.element}matchElement(e){const{selector:t}=this;if(t){const r=e.matches(t);return this.delegate.selectorMatchElement?r&&this.delegate.selectorMatchElement(e,this.details):r}return!1}matchElementsInTree(e){const{selector:t}=this;if(t){const r=this.matchElement(e)?[e]:[],n=Array.from(e.querySelectorAll(t)).filter((e=>this.matchElement(e)));return r.concat(n)}return[]}elementMatched(e){const{selector:t}=this;t&&this.selectorMatched(e,t)}elementUnmatched(e){const t=this.matchesByElement.getKeysForValue(e);for(const r of t)this.selectorUnmatched(e,r)}elementAttributeChanged(e,t){const{selector:r}=this;if(r){const t=this.matchElement(e),n=this.matchesByElement.has(r,e);t&&!n?this.selectorMatched(e,r):!t&&n&&this.selectorUnmatched(e,r)}}selectorMatched(e,t){this.delegate.selectorMatched(e,t,this.details),this.matchesByElement.add(t,e)}selectorUnmatched(e,t){this.delegate.selectorUnmatched(e,t,this.details),this.matchesByElement.delete(t,e)}}class StringMapObserver{constructor(e,t){this.element=e,this.delegate=t,this.started=!1,this.stringMap=new Map,this.mutationObserver=new MutationObserver((e=>this.processMutations(e)))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,{attributes:!0,attributeOldValue:!0}),this.refresh())}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started)for(const e of this.knownAttributeNames)this.refreshAttribute(e,null)}processMutations(e){if(this.started)for(const t of e)this.processMutation(t)}processMutation(e){const t=e.attributeName;t&&this.refreshAttribute(t,e.oldValue)}refreshAttribute(e,t){const r=this.delegate.getStringMapKeyForAttribute(e);if(null!=r){this.stringMap.has(e)||this.stringMapKeyAdded(r,e);const n=this.element.getAttribute(e);if(this.stringMap.get(e)!=n&&this.stringMapValueChanged(n,r,t),null==n){const t=this.stringMap.get(e);this.stringMap.delete(e),t&&this.stringMapKeyRemoved(r,e,t)}else this.stringMap.set(e,n)}}stringMapKeyAdded(e,t){this.delegate.stringMapKeyAdded&&this.delegate.stringMapKeyAdded(e,t)}stringMapValueChanged(e,t,r){this.delegate.stringMapValueChanged&&this.delegate.stringMapValueChanged(e,t,r)}stringMapKeyRemoved(e,t,r){this.delegate.stringMapKeyRemoved&&this.delegate.stringMapKeyRemoved(e,t,r)}get knownAttributeNames(){return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)))}get currentAttributeNames(){return Array.from(this.element.attributes).map((e=>e.name))}get recordedAttributeNames(){return Array.from(this.stringMap.keys())}}class TokenListObserver{constructor(e,t,r){this.attributeObserver=new AttributeObserver(e,t,this),this.delegate=r,this.tokensByElement=new Multimap}get started(){return this.attributeObserver.started}start(){this.attributeObserver.start()}pause(e){this.attributeObserver.pause(e)}stop(){this.attributeObserver.stop()}refresh(){this.attributeObserver.refresh()}get element(){return this.attributeObserver.element}get attributeName(){return this.attributeObserver.attributeName}elementMatchedAttribute(e){this.tokensMatched(this.readTokensForElement(e))}elementAttributeValueChanged(e){const[t,r]=this.refreshTokensForElement(e);this.tokensUnmatched(t),this.tokensMatched(r)}elementUnmatchedAttribute(e){this.tokensUnmatched(this.tokensByElement.getValuesForKey(e))}tokensMatched(e){e.forEach((e=>this.tokenMatched(e)))}tokensUnmatched(e){e.forEach((e=>this.tokenUnmatched(e)))}tokenMatched(e){this.delegate.tokenMatched(e),this.tokensByElement.add(e.element,e)}tokenUnmatched(e){this.delegate.tokenUnmatched(e),this.tokensByElement.delete(e.element,e)}refreshTokensForElement(e){const t=this.tokensByElement.getValuesForKey(e),r=this.readTokensForElement(e),n=function(e,t){const r=Math.max(e.length,t.length);return Array.from({length:r},((r,n)=>[e[n],t[n]]))}(t,r).findIndex((([e,t])=>{return n=t,!((r=e)&&n&&r.index==n.index&&r.content==n.content);var r,n}));return-1==n?[[],[]]:[t.slice(n),r.slice(n)]}readTokensForElement(e){const t=this.attributeName;return function(e,t,r){return e.trim().split(/\s+/).filter((e=>e.length)).map(((e,n)=>({element:t,attributeName:r,content:e,index:n})))}(e.getAttribute(t)||"",e,t)}}class ValueListObserver{constructor(e,t,r){this.tokenListObserver=new TokenListObserver(e,t,this),this.delegate=r,this.parseResultsByToken=new WeakMap,this.valuesByTokenByElement=new WeakMap}get started(){return this.tokenListObserver.started}start(){this.tokenListObserver.start()}stop(){this.tokenListObserver.stop()}refresh(){this.tokenListObserver.refresh()}get element(){return this.tokenListObserver.element}get attributeName(){return this.tokenListObserver.attributeName}tokenMatched(e){const{element:t}=e,{value:r}=this.fetchParseResultForToken(e);r&&(this.fetchValuesByTokenForElement(t).set(e,r),this.delegate.elementMatchedValue(t,r))}tokenUnmatched(e){const{element:t}=e,{value:r}=this.fetchParseResultForToken(e);r&&(this.fetchValuesByTokenForElement(t).delete(e),this.delegate.elementUnmatchedValue(t,r))}fetchParseResultForToken(e){let t=this.parseResultsByToken.get(e);return t||(t=this.parseToken(e),this.parseResultsByToken.set(e,t)),t}fetchValuesByTokenForElement(e){let t=this.valuesByTokenByElement.get(e);return t||(t=new Map,this.valuesByTokenByElement.set(e,t)),t}parseToken(e){try{return{value:this.delegate.parseValueForToken(e)}}catch(e){return{error:e}}}}class BindingObserver{constructor(e,t){this.context=e,this.delegate=t,this.bindingsByAction=new Map}start(){this.valueListObserver||(this.valueListObserver=new ValueListObserver(this.element,this.actionAttribute,this),this.valueListObserver.start())}stop(){this.valueListObserver&&(this.valueListObserver.stop(),delete this.valueListObserver,this.disconnectAllActions())}get element(){return this.context.element}get identifier(){return this.context.identifier}get actionAttribute(){return this.schema.actionAttribute}get schema(){return this.context.schema}get bindings(){return Array.from(this.bindingsByAction.values())}connectAction(e){const t=new Binding(this.context,e);this.bindingsByAction.set(e,t),this.delegate.bindingConnected(t)}disconnectAction(e){const t=this.bindingsByAction.get(e);t&&(this.bindingsByAction.delete(e),this.delegate.bindingDisconnected(t))}disconnectAllActions(){this.bindings.forEach((e=>this.delegate.bindingDisconnected(e,!0))),this.bindingsByAction.clear()}parseValueForToken(e){const t=Action.forToken(e,this.schema);if(t.identifier==this.identifier)return t}elementMatchedValue(e,t){this.connectAction(t)}elementUnmatchedValue(e,t){this.disconnectAction(t)}}class ValueObserver{constructor(e,t){this.context=e,this.receiver=t,this.stringMapObserver=new StringMapObserver(this.element,this),this.valueDescriptorMap=this.controller.valueDescriptorMap}start(){this.stringMapObserver.start(),this.invokeChangedCallbacksForDefaultValues()}stop(){this.stringMapObserver.stop()}get element(){return this.context.element}get controller(){return this.context.controller}getStringMapKeyForAttribute(e){if(e in this.valueDescriptorMap)return this.valueDescriptorMap[e].name}stringMapKeyAdded(e,t){const r=this.valueDescriptorMap[t];this.hasValue(e)||this.invokeChangedCallback(e,r.writer(this.receiver[e]),r.writer(r.defaultValue))}stringMapValueChanged(e,t,r){const n=this.valueDescriptorNameMap[t];null!==e&&(null===r&&(r=n.writer(n.defaultValue)),this.invokeChangedCallback(t,e,r))}stringMapKeyRemoved(e,t,r){const n=this.valueDescriptorNameMap[e];this.hasValue(e)?this.invokeChangedCallback(e,n.writer(this.receiver[e]),r):this.invokeChangedCallback(e,n.writer(n.defaultValue),r)}invokeChangedCallbacksForDefaultValues(){for(const{key:e,name:t,defaultValue:r,writer:n}of this.valueDescriptors)null==r||this.controller.data.has(e)||this.invokeChangedCallback(t,n(r),void 0)}invokeChangedCallback(e,t,r){const n=`${e}Changed`,i=this.receiver[n];if("function"==typeof i){const n=this.valueDescriptorNameMap[e];try{const e=n.reader(t);let s=r;r&&(s=n.reader(r)),i.call(this.receiver,e,s)}catch(e){throw e instanceof TypeError&&(e.message=`Stimulus Value "${this.context.identifier}.${n.name}" - ${e.message}`),e}}}get valueDescriptors(){const{valueDescriptorMap:e}=this;return Object.keys(e).map((t=>e[t]))}get valueDescriptorNameMap(){const e={};return Object.keys(this.valueDescriptorMap).forEach((t=>{const r=this.valueDescriptorMap[t];e[r.name]=r})),e}hasValue(e){const t=`has${l(this.valueDescriptorNameMap[e].name)}`;return this.receiver[t]}}class TargetObserver{constructor(e,t){this.context=e,this.delegate=t,this.targetsByName=new Multimap}start(){this.tokenListObserver||(this.tokenListObserver=new TokenListObserver(this.element,this.attributeName,this),this.tokenListObserver.start())}stop(){this.tokenListObserver&&(this.disconnectAllTargets(),this.tokenListObserver.stop(),delete this.tokenListObserver)}tokenMatched({element:e,content:t}){this.scope.containsElement(e)&&this.connectTarget(e,t)}tokenUnmatched({element:e,content:t}){this.disconnectTarget(e,t)}connectTarget(e,t){var r;this.targetsByName.has(t,e)||(this.targetsByName.add(t,e),null===(r=this.tokenListObserver)||void 0===r||r.pause((()=>this.delegate.targetConnected(e,t))))}disconnectTarget(e,t){var r;this.targetsByName.has(t,e)&&(this.targetsByName.delete(t,e),null===(r=this.tokenListObserver)||void 0===r||r.pause((()=>this.delegate.targetDisconnected(e,t))))}disconnectAllTargets(){for(const e of this.targetsByName.keys)for(const t of this.targetsByName.getValuesForKey(e))this.disconnectTarget(t,e)}get attributeName(){return`data-${this.context.identifier}-target`}get element(){return this.context.element}get scope(){return this.context.scope}}function _(e,t){const r=w(e);return Array.from(r.reduce(((e,r)=>(function(e,t){const r=e[t];return Array.isArray(r)?r:[]}(r,t).forEach((t=>e.add(t))),e)),new Set))}function x(e,t){return w(e).reduce(((e,r)=>(e.push(...function(e,t){const r=e[t];return r?Object.keys(r).map((e=>[e,r[e]])):[]}(r,t)),e)),[])}function w(e){const t=[];for(;e;)t.push(e),e=Object.getPrototypeOf(e);return t.reverse()}class OutletObserver{constructor(e,t){this.started=!1,this.context=e,this.delegate=t,this.outletsByName=new Multimap,this.outletElementsByName=new Multimap,this.selectorObserverMap=new Map,this.attributeObserverMap=new Map}start(){this.started||(this.outletDefinitions.forEach((e=>{this.setupSelectorObserverForOutlet(e),this.setupAttributeObserverForOutlet(e)})),this.started=!0,this.dependentContexts.forEach((e=>e.refresh())))}refresh(){this.selectorObserverMap.forEach((e=>e.refresh())),this.attributeObserverMap.forEach((e=>e.refresh()))}stop(){this.started&&(this.started=!1,this.disconnectAllOutlets(),this.stopSelectorObservers(),this.stopAttributeObservers())}stopSelectorObservers(){this.selectorObserverMap.size>0&&(this.selectorObserverMap.forEach((e=>e.stop())),this.selectorObserverMap.clear())}stopAttributeObservers(){this.attributeObserverMap.size>0&&(this.attributeObserverMap.forEach((e=>e.stop())),this.attributeObserverMap.clear())}selectorMatched(e,t,{outletName:r}){const n=this.getOutlet(e,r);n&&this.connectOutlet(n,e,r)}selectorUnmatched(e,t,{outletName:r}){const n=this.getOutletFromMap(e,r);n&&this.disconnectOutlet(n,e,r)}selectorMatchElement(e,{outletName:t}){const r=this.selector(t),n=this.hasOutlet(e,t),i=e.matches(`[${this.schema.controllerAttribute}~=${t}]`);return!!r&&(n&&i&&e.matches(r))}elementMatchedAttribute(e,t){const r=this.getOutletNameFromOutletAttributeName(t);r&&this.updateSelectorObserverForOutlet(r)}elementAttributeValueChanged(e,t){const r=this.getOutletNameFromOutletAttributeName(t);r&&this.updateSelectorObserverForOutlet(r)}elementUnmatchedAttribute(e,t){const r=this.getOutletNameFromOutletAttributeName(t);r&&this.updateSelectorObserverForOutlet(r)}connectOutlet(e,t,r){var n;this.outletElementsByName.has(r,t)||(this.outletsByName.add(r,e),this.outletElementsByName.add(r,t),null===(n=this.selectorObserverMap.get(r))||void 0===n||n.pause((()=>this.delegate.outletConnected(e,t,r))))}disconnectOutlet(e,t,r){var n;this.outletElementsByName.has(r,t)&&(this.outletsByName.delete(r,e),this.outletElementsByName.delete(r,t),null===(n=this.selectorObserverMap.get(r))||void 0===n||n.pause((()=>this.delegate.outletDisconnected(e,t,r))))}disconnectAllOutlets(){for(const e of this.outletElementsByName.keys)for(const t of this.outletElementsByName.getValuesForKey(e))for(const r of this.outletsByName.getValuesForKey(e))this.disconnectOutlet(r,t,e)}updateSelectorObserverForOutlet(e){const t=this.selectorObserverMap.get(e);t&&(t.selector=this.selector(e))}setupSelectorObserverForOutlet(e){const t=this.selector(e),r=new SelectorObserver(document.body,t,this,{outletName:e});this.selectorObserverMap.set(e,r),r.start()}setupAttributeObserverForOutlet(e){const t=this.attributeNameForOutletName(e),r=new AttributeObserver(this.scope.element,t,this);this.attributeObserverMap.set(e,r),r.start()}selector(e){return this.scope.outlets.getSelectorForOutletName(e)}attributeNameForOutletName(e){return this.scope.schema.outletAttributeForScope(this.identifier,e)}getOutletNameFromOutletAttributeName(e){return this.outletDefinitions.find((t=>this.attributeNameForOutletName(t)===e))}get outletDependencies(){const e=new Multimap;return this.router.modules.forEach((t=>{_(t.definition.controllerConstructor,"outlets").forEach((r=>e.add(r,t.identifier)))})),e}get outletDefinitions(){return this.outletDependencies.getKeysForValue(this.identifier)}get dependentControllerIdentifiers(){return this.outletDependencies.getValuesForKey(this.identifier)}get dependentContexts(){const e=this.dependentControllerIdentifiers;return this.router.contexts.filter((t=>e.includes(t.identifier)))}hasOutlet(e,t){return!!this.getOutlet(e,t)||!!this.getOutletFromMap(e,t)}getOutlet(e,t){return this.application.getControllerForElementAndIdentifier(e,t)}getOutletFromMap(e,t){return this.outletsByName.getValuesForKey(t).find((t=>t.element===e))}get scope(){return this.context.scope}get schema(){return this.context.schema}get identifier(){return this.context.identifier}get application(){return this.context.application}get router(){return this.application.router}}class Context{constructor(e,t){this.logDebugActivity=(e,t={})=>{const{identifier:r,controller:n,element:i}=this;t=Object.assign({identifier:r,controller:n,element:i},t),this.application.logDebugActivity(this.identifier,e,t)},this.module=e,this.scope=t,this.controller=new e.controllerConstructor(this),this.bindingObserver=new BindingObserver(this,this.dispatcher),this.valueObserver=new ValueObserver(this,this.controller),this.targetObserver=new TargetObserver(this,this),this.outletObserver=new OutletObserver(this,this);try{this.controller.initialize(),this.logDebugActivity("initialize")}catch(e){this.handleError(e,"initializing controller")}}connect(){this.bindingObserver.start(),this.valueObserver.start(),this.targetObserver.start(),this.outletObserver.start();try{this.controller.connect(),this.logDebugActivity("connect")}catch(e){this.handleError(e,"connecting controller")}}refresh(){this.outletObserver.refresh()}disconnect(){try{this.controller.disconnect(),this.logDebugActivity("disconnect")}catch(e){this.handleError(e,"disconnecting controller")}this.outletObserver.stop(),this.targetObserver.stop(),this.valueObserver.stop(),this.bindingObserver.stop()}get application(){return this.module.application}get identifier(){return this.module.identifier}get schema(){return this.application.schema}get dispatcher(){return this.application.dispatcher}get element(){return this.scope.element}get parentElement(){return this.element.parentElement}handleError(e,t,r={}){const{identifier:n,controller:i,element:s}=this;r=Object.assign({identifier:n,controller:i,element:s},r),this.application.handleError(e,`Error ${t}`,r)}targetConnected(e,t){this.invokeControllerMethod(`${t}TargetConnected`,e)}targetDisconnected(e,t){this.invokeControllerMethod(`${t}TargetDisconnected`,e)}outletConnected(e,t,r){this.invokeControllerMethod(`${a(r)}OutletConnected`,e,t)}outletDisconnected(e,t,r){this.invokeControllerMethod(`${a(r)}OutletDisconnected`,e,t)}invokeControllerMethod(e,...t){const r=this.controller;"function"==typeof r[e]&&r[e](...t)}}function R(e){return function(e,t){const r=j(e),n=function(e,t){return k(t).reduce(((r,n)=>{const i=function(e,t,r){const n=Object.getOwnPropertyDescriptor(e,r);if(!n||!("value"in n)){const e=Object.getOwnPropertyDescriptor(t,r).value;return n&&(e.get=n.get||e.get,e.set=n.set||e.set),e}}(e,t,n);return i&&Object.assign(r,{[n]:i}),r}),{})}(e.prototype,t);return Object.defineProperties(r.prototype,n),r}(e,function(e){const t=_(e,"blessings");return t.reduce(((t,r)=>{const n=r(e);for(const e in n){const r=t[e]||{};t[e]=Object.assign(r,n[e])}return t}),{})}(e))}const k="function"==typeof Object.getOwnPropertySymbols?e=>[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)]:Object.getOwnPropertyNames,j=(()=>{function e(e){function t(){return Reflect.construct(e,arguments,new.target)}return t.prototype=Object.create(e.prototype,{constructor:{value:t}}),Reflect.setPrototypeOf(t,e),t}try{return function(){const t=e((function(){this.a.call(this)}));t.prototype.a=function(){},new t}(),e}catch(e){return e=>class extended extends e{}}})();class Module{constructor(e,t){this.application=e,this.definition=function(e){return{identifier:e.identifier,controllerConstructor:R(e.controllerConstructor)}}(t),this.contextsByScope=new WeakMap,this.connectedContexts=new Set}get identifier(){return this.definition.identifier}get controllerConstructor(){return this.definition.controllerConstructor}get contexts(){return Array.from(this.connectedContexts)}connectContextForScope(e){const t=this.fetchContextForScope(e);this.connectedContexts.add(t),t.connect()}disconnectContextForScope(e){const t=this.contextsByScope.get(e);t&&(this.connectedContexts.delete(t),t.disconnect())}fetchContextForScope(e){let t=this.contextsByScope.get(e);return t||(t=new Context(this,e),this.contextsByScope.set(e,t)),t}}class ClassMap{constructor(e){this.scope=e}has(e){return this.data.has(this.getDataKey(e))}get(e){return this.getAll(e)[0]}getAll(e){const t=this.data.get(this.getDataKey(e))||"";return t.match(/[^\s]+/g)||[]}getAttributeName(e){return this.data.getAttributeNameForKey(this.getDataKey(e))}getDataKey(e){return`${e}-class`}get data(){return this.scope.data}}class DataMap{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get(e){const t=this.getAttributeNameForKey(e);return this.element.getAttribute(t)}set(e,t){const r=this.getAttributeNameForKey(e);return this.element.setAttribute(r,t),this.get(e)}has(e){const t=this.getAttributeNameForKey(e);return this.element.hasAttribute(t)}delete(e){if(this.has(e)){const t=this.getAttributeNameForKey(e);return this.element.removeAttribute(t),!0}return!1}getAttributeNameForKey(e){return`data-${this.identifier}-${c(e)}`}}class Guide{constructor(e){this.warnedKeysByObject=new WeakMap,this.logger=e}warn(e,t,r){let n=this.warnedKeysByObject.get(e);n||(n=new Set,this.warnedKeysByObject.set(e,n)),n.has(t)||(n.add(t),this.logger.warn(r,e))}}function z(e,t){return`[${e}~="${t}"]`}class TargetSet{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(e){return null!=this.find(e)}find(...e){return e.reduce(((e,t)=>e||this.findTarget(t)||this.findLegacyTarget(t)),void 0)}findAll(...e){return e.reduce(((e,t)=>[...e,...this.findAllTargets(t),...this.findAllLegacyTargets(t)]),[])}findTarget(e){const t=this.getSelectorForTargetName(e);return this.scope.findElement(t)}findAllTargets(e){const t=this.getSelectorForTargetName(e);return this.scope.findAllElements(t)}getSelectorForTargetName(e){return z(this.schema.targetAttributeForScope(this.identifier),e)}findLegacyTarget(e){const t=this.getLegacySelectorForTargetName(e);return this.deprecate(this.scope.findElement(t),e)}findAllLegacyTargets(e){const t=this.getLegacySelectorForTargetName(e);return this.scope.findAllElements(t).map((t=>this.deprecate(t,e)))}getLegacySelectorForTargetName(e){const t=`${this.identifier}.${e}`;return z(this.schema.targetAttribute,t)}deprecate(e,t){if(e){const{identifier:r}=this,n=this.schema.targetAttribute,i=this.schema.targetAttributeForScope(r);this.guide.warn(e,`target:${t}`,`Please replace ${n}="${r}.${t}" with ${i}="${t}". The ${n} attribute is deprecated and will be removed in a future version of Stimulus.`)}return e}get guide(){return this.scope.guide}}class OutletSet{constructor(e,t){this.scope=e,this.controllerElement=t}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(e){return null!=this.find(e)}find(...e){return e.reduce(((e,t)=>e||this.findOutlet(t)),void 0)}findAll(...e){return e.reduce(((e,t)=>[...e,...this.findAllOutlets(t)]),[])}getSelectorForOutletName(e){const t=this.schema.outletAttributeForScope(this.identifier,e);return this.controllerElement.getAttribute(t)}findOutlet(e){const t=this.getSelectorForOutletName(e);if(t)return this.findElement(t,e)}findAllOutlets(e){const t=this.getSelectorForOutletName(e);return t?this.findAllElements(t,e):[]}findElement(e,t){return this.scope.queryElements(e).filter((r=>this.matchesElement(r,e,t)))[0]}findAllElements(e,t){return this.scope.queryElements(e).filter((r=>this.matchesElement(r,e,t)))}matchesElement(e,t,r){const n=e.getAttribute(this.scope.schema.controllerAttribute)||"";return e.matches(t)&&n.split(" ").includes(r)}}class Scope{constructor(e,t,r,n){this.targets=new TargetSet(this),this.classes=new ClassMap(this),this.data=new DataMap(this),this.containsElement=e=>e.closest(this.controllerSelector)===this.element,this.schema=e,this.element=t,this.identifier=r,this.guide=new Guide(n),this.outlets=new OutletSet(this.documentScope,t)}findElement(e){return this.element.matches(e)?this.element:this.queryElements(e).find(this.containsElement)}findAllElements(e){return[...this.element.matches(e)?[this.element]:[],...this.queryElements(e).filter(this.containsElement)]}queryElements(e){return Array.from(this.element.querySelectorAll(e))}get controllerSelector(){return z(this.schema.controllerAttribute,this.identifier)}get isDocumentScope(){return this.element===document.documentElement}get documentScope(){return this.isDocumentScope?this:new Scope(this.schema,document.documentElement,this.identifier,this.guide.logger)}}class ScopeObserver{constructor(e,t,r){this.element=e,this.schema=t,this.delegate=r,this.valueListObserver=new ValueListObserver(this.element,this.controllerAttribute,this),this.scopesByIdentifierByElement=new WeakMap,this.scopeReferenceCounts=new WeakMap}start(){this.valueListObserver.start()}stop(){this.valueListObserver.stop()}get controllerAttribute(){return this.schema.controllerAttribute}parseValueForToken(e){const{element:t,content:r}=e;return this.parseValueForElementAndIdentifier(t,r)}parseValueForElementAndIdentifier(e,t){const r=this.fetchScopesByIdentifierForElement(e);let n=r.get(t);return n||(n=this.delegate.createScopeForElementAndIdentifier(e,t),r.set(t,n)),n}elementMatchedValue(e,t){const r=(this.scopeReferenceCounts.get(t)||0)+1;this.scopeReferenceCounts.set(t,r),1==r&&this.delegate.scopeConnected(t)}elementUnmatchedValue(e,t){const r=this.scopeReferenceCounts.get(t);r&&(this.scopeReferenceCounts.set(t,r-1),1==r&&this.delegate.scopeDisconnected(t))}fetchScopesByIdentifierForElement(e){let t=this.scopesByIdentifierByElement.get(e);return t||(t=new Map,this.scopesByIdentifierByElement.set(e,t)),t}}class Router{constructor(e){this.application=e,this.scopeObserver=new ScopeObserver(this.element,this.schema,this),this.scopesByIdentifier=new Multimap,this.modulesByIdentifier=new Map}get element(){return this.application.element}get schema(){return this.application.schema}get logger(){return this.application.logger}get controllerAttribute(){return this.schema.controllerAttribute}get modules(){return Array.from(this.modulesByIdentifier.values())}get contexts(){return this.modules.reduce(((e,t)=>e.concat(t.contexts)),[])}start(){this.scopeObserver.start()}stop(){this.scopeObserver.stop()}loadDefinition(e){this.unloadIdentifier(e.identifier);const t=new Module(this.application,e);this.connectModule(t);const r=e.controllerConstructor.afterLoad;r&&r.call(e.controllerConstructor,e.identifier,this.application)}unloadIdentifier(e){const t=this.modulesByIdentifier.get(e);t&&this.disconnectModule(t)}getContextForElementAndIdentifier(e,t){const r=this.modulesByIdentifier.get(t);if(r)return r.contexts.find((t=>t.element==e))}proposeToConnectScopeForElementAndIdentifier(e,t){const r=this.scopeObserver.parseValueForElementAndIdentifier(e,t);r?this.scopeObserver.elementMatchedValue(r.element,r):console.error(`Couldn't find or create scope for identifier: "${t}" and element:`,e)}handleError(e,t,r){this.application.handleError(e,t,r)}createScopeForElementAndIdentifier(e,t){return new Scope(this.schema,e,t,this.logger)}scopeConnected(e){this.scopesByIdentifier.add(e.identifier,e);const t=this.modulesByIdentifier.get(e.identifier);t&&t.connectContextForScope(e)}scopeDisconnected(e){this.scopesByIdentifier.delete(e.identifier,e);const t=this.modulesByIdentifier.get(e.identifier);t&&t.disconnectContextForScope(e)}connectModule(e){this.modulesByIdentifier.set(e.identifier,e);this.scopesByIdentifier.getValuesForKey(e.identifier).forEach((t=>e.connectContextForScope(t)))}disconnectModule(e){this.modulesByIdentifier.delete(e.identifier);this.scopesByIdentifier.getValuesForKey(e.identifier).forEach((t=>e.disconnectContextForScope(t)))}}const q={controllerAttribute:"data-controller",actionAttribute:"data-action",targetAttribute:"data-target",targetAttributeForScope:e=>`data-${e}-target`,outletAttributeForScope:(e,t)=>`data-${e}-${t}-outlet`,keyMappings:Object.assign(Object.assign({enter:"Enter",tab:"Tab",esc:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",page_up:"PageUp",page_down:"PageDown"},$("abcdefghijklmnopqrstuvwxyz".split("").map((e=>[e,e])))),$("0123456789".split("").map((e=>[e,e]))))};function $(e){return e.reduce(((e,[t,r])=>Object.assign(Object.assign({},e),{[t]:r})),{})}class Application{constructor(e=document.documentElement,t=q){this.logger=console,this.debug=!1,this.logDebugActivity=(e,t,r={})=>{this.debug&&this.logFormattedMessage(e,t,r)},this.element=e,this.schema=t,this.dispatcher=new Dispatcher(this),this.router=new Router(this),this.actionDescriptorFilters=Object.assign({},n)}static start(e,t){const r=new this(e,t);return r.start(),r}async start(){await new Promise((e=>{"loading"==document.readyState?document.addEventListener("DOMContentLoaded",(()=>e())):e()})),this.logDebugActivity("application","starting"),this.dispatcher.start(),this.router.start(),this.logDebugActivity("application","start")}stop(){this.logDebugActivity("application","stopping"),this.dispatcher.stop(),this.router.stop(),this.logDebugActivity("application","stop")}register(e,t){this.load({identifier:e,controllerConstructor:t})}registerActionOption(e,t){this.actionDescriptorFilters[e]=t}load(e,...t){(Array.isArray(e)?e:[e,...t]).forEach((e=>{e.controllerConstructor.shouldLoad&&this.router.loadDefinition(e)}))}unload(e,...t){(Array.isArray(e)?e:[e,...t]).forEach((e=>this.router.unloadIdentifier(e)))}get controllers(){return this.router.contexts.map((e=>e.controller))}getControllerForElementAndIdentifier(e,t){const r=this.router.getContextForElementAndIdentifier(e,t);return r?r.controller:null}handleError(e,t,r){var n;this.logger.error("%s\n\n%o\n\n%o",t,e,r),null===(n=window.onerror)||void 0===n||n.call(window,t,"",0,0,e)}logFormattedMessage(e,t,r={}){r=Object.assign({application:this},r),this.logger.groupCollapsed(`${e} #${t}`),this.logger.log("details:",Object.assign({},r)),this.logger.groupEnd()}}function Z(e,t,r){return e.application.getControllerForElementAndIdentifier(t,r)}function X(e,t,r){let n=Z(e,t,r);return n||(e.application.router.proposeToConnectScopeForElementAndIdentifier(t,r),n=Z(e,t,r),n||void 0)}function Y([e,t],r){return function(e){const{token:t,typeDefinition:r}=e,n=`${c(t)}-value`,i=function(e){const{controller:t,token:r,typeDefinition:n}=e,i={controller:t,token:r,typeObject:n},s=function(e){const{controller:t,token:r,typeObject:n}=e,i=u(n.type),s=u(n.default),o=i&&s,a=i&&!s,l=!i&&s,c=ee(n.type),d=te(e.typeObject.default);if(a)return c;if(l)return d;if(c!==d){throw new Error(`The specified default value for the Stimulus Value "${t?`${t}.${r}`:r}" must match the defined type "${c}". The provided default value of "${n.default}" is of type "${d}".`)}if(o)return c}(i),o=te(n),a=ee(n),l=s||o||a;if(l)return l;const c=t?`${t}.${n}`:r;throw new Error(`Unknown value type "${c}" for "${r}" value`)}(e);return{type:i,key:n,name:o(n),get defaultValue(){return function(e){const t=ee(e);if(t)return re[t];const r=d(e,"default"),n=d(e,"type"),i=e;if(r)return i.default;if(n){const{type:e}=i,t=ee(e);if(t)return re[t]}return e}(r)},get hasCustomDefaultValue(){return void 0!==te(r)},reader:ne[i],writer:ie[i]||ie.default}}({controller:r,token:e,typeDefinition:t})}function ee(e){switch(e){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function te(e){switch(typeof e){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}return Array.isArray(e)?"array":"[object Object]"===Object.prototype.toString.call(e)?"object":void 0}const re={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},ne={array(e){const t=JSON.parse(e);if(!Array.isArray(t))throw new TypeError(`expected value of type "array" but instead got value "${e}" of type "${te(t)}"`);return t},boolean:e=>!("0"==e||"false"==String(e).toLowerCase()),number:e=>Number(e.replace(/_/g,"")),object(e){const t=JSON.parse(e);if(null===t||"object"!=typeof t||Array.isArray(t))throw new TypeError(`expected value of type "object" but instead got value "${e}" of type "${te(t)}"`);return t},string:e=>e},ie={default:function(e){return`${e}`},array:se,object:se};function se(e){return JSON.stringify(e)}class Controller{constructor(e){this.context=e}static get shouldLoad(){return!0}static afterLoad(e,t){}get application(){return this.context.application}get scope(){return this.context.scope}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get targets(){return this.scope.targets}get outlets(){return this.scope.outlets}get classes(){return this.scope.classes}get data(){return this.scope.data}initialize(){}connect(){}disconnect(){}dispatch(e,{target:t=this.element,detail:r={},prefix:n=this.identifier,bubbles:i=!0,cancelable:s=!0}={}){const o=new CustomEvent(n?`${n}:${e}`:e,{detail:r,bubbles:i,cancelable:s});return t.dispatchEvent(o),o}}Controller.blessings=[function(e){return _(e,"classes").reduce(((e,t)=>{return Object.assign(e,{[`${r=t}Class`]:{get(){const{classes:e}=this;if(e.has(r))return e.get(r);{const t=e.getAttributeName(r);throw new Error(`Missing attribute "${t}"`)}}},[`${r}Classes`]:{get(){return this.classes.getAll(r)}},[`has${l(r)}Class`]:{get(){return this.classes.has(r)}}});var r}),{})},function(e){return _(e,"targets").reduce(((e,t)=>{return Object.assign(e,{[`${r=t}Target`]:{get(){const e=this.targets.find(r);if(e)return e;throw new Error(`Missing target element "${r}" for "${this.identifier}" controller`)}},[`${r}Targets`]:{get(){return this.targets.findAll(r)}},[`has${l(r)}Target`]:{get(){return this.targets.has(r)}}});var r}),{})},function(e){const t=x(e,"values"),r={valueDescriptorMap:{get(){return t.reduce(((e,t)=>{const r=Y(t,this.identifier),n=this.data.getAttributeNameForKey(r.key);return Object.assign(e,{[n]:r})}),{})}}};return t.reduce(((e,t)=>Object.assign(e,function(e,t){const r=Y(e,t),{key:n,name:i,reader:s,writer:o}=r;return{[i]:{get(){const e=this.data.get(n);return null!==e?s(e):r.defaultValue},set(e){void 0===e?this.data.delete(n):this.data.set(n,o(e))}},[`has${l(i)}`]:{get(){return this.data.has(n)||r.hasCustomDefaultValue}}}}(t))),r)},function(e){return _(e,"outlets").reduce(((e,t)=>Object.assign(e,function(e){const t=a(e);return{[`${t}Outlet`]:{get(){const t=this.outlets.find(e),r=this.outlets.getSelectorForOutletName(e);if(t){const r=X(this,t,e);if(r)return r;throw new Error(`The provided outlet element is missing an outlet controller "${e}" instance for host controller "${this.identifier}"`)}throw new Error(`Missing outlet element "${e}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${r}".`)}},[`${t}Outlets`]:{get(){const t=this.outlets.findAll(e);return t.length>0?t.map((t=>{const r=X(this,t,e);if(r)return r;console.warn(`The provided outlet element is missing an outlet controller "${e}" instance for host controller "${this.identifier}"`,t)})).filter((e=>e)):[]}},[`${t}OutletElement`]:{get(){const t=this.outlets.find(e),r=this.outlets.getSelectorForOutletName(e);if(t)return t;throw new Error(`Missing outlet element "${e}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${r}".`)}},[`${t}OutletElements`]:{get(){return this.outlets.findAll(e)}},[`has${l(t)}Outlet`]:{get(){return this.outlets.has(e)}}}}(t))),{})}],Controller.targets=[],Controller.outlets=[],Controller.values={}},49565:(e,t,r)=>{"use strict";!function(){if(void 0===window.Reflect||void 0===window.customElements||window.customElements.polyfillWrapFlushCallback)return;const e=HTMLElement,t=function(){return Reflect.construct(e,[],this.constructor)};window.HTMLElement=t,HTMLElement.prototype=e.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,e)}(),function(e){function t(e,t,r){throw new e("Failed to execute 'requestSubmit' on 'HTMLFormElement': "+t+".",r)}"function"!=typeof e.requestSubmit&&(e.requestSubmit=function(e){e?(!function(e,r){e instanceof HTMLElement||t(TypeError,"parameter 1 is not of type 'HTMLElement'"),"submit"==e.type||t(TypeError,"The specified element is not a submit button"),e.form==r||t(DOMException,"The specified element is not owned by this form element","NotFoundError")}(e,this),e.click()):((e=document.createElement("input")).type="submit",e.hidden=!0,this.appendChild(e),e.click(),this.removeChild(e))})}(HTMLFormElement.prototype);const n=new WeakMap;function i(e){const t=function(e){const t=e instanceof Element?e:e instanceof Node?e.parentElement:null,r=t?t.closest("input, button"):null;return"submit"==(null==r?void 0:r.type)?r:null}(e.target);t&&t.form&&n.set(t.form,t)}var s,o,a,l,c,u,d,h,p,m,f,g;!function(){if("submitter"in Event.prototype)return;let e=window.Event.prototype;if("SubmitEvent"in window&&/Apple Computer/.test(navigator.vendor))e=window.SubmitEvent.prototype;else if("SubmitEvent"in window)return;addEventListener("click",i,!0),Object.defineProperty(e,"submitter",{get(){if("submit"==this.type&&this.target instanceof HTMLFormElement)return n.get(this.target)}})}(),(o=s||(s={})).eager="eager",o.lazy="lazy";class FrameElement extends HTMLElement{static get observedAttributes(){return["disabled","complete","loading","src"]}constructor(){super(),this.loaded=Promise.resolve(),this.delegate=new FrameElement.delegateConstructor(this)}connectedCallback(){this.delegate.connect()}disconnectedCallback(){this.delegate.disconnect()}reload(){return this.delegate.sourceURLReloaded()}attributeChangedCallback(e){"loading"==e?this.delegate.loadingStyleChanged():"complete"==e?this.delegate.completeChanged():"src"==e?this.delegate.sourceURLChanged():this.delegate.disabledChanged()}get src(){return this.getAttribute("src")}set src(e){e?this.setAttribute("src",e):this.removeAttribute("src")}get loading(){return function(e){if("lazy"===e.toLowerCase())return s.lazy;return s.eager}(this.getAttribute("loading")||"")}set loading(e){e?this.setAttribute("loading",e):this.removeAttribute("loading")}get disabled(){return this.hasAttribute("disabled")}set disabled(e){e?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get autoscroll(){return this.hasAttribute("autoscroll")}set autoscroll(e){e?this.setAttribute("autoscroll",""):this.removeAttribute("autoscroll")}get complete(){return!this.delegate.isLoading}get isActive(){return this.ownerDocument===document&&!this.isPreview}get isPreview(){var e,t;return null===(t=null===(e=this.ownerDocument)||void 0===e?void 0:e.documentElement)||void 0===t?void 0:t.hasAttribute("data-turbo-preview")}}function y(e){return new URL(e.toString(),document.baseURI)}function b(e){let t;return e.hash?e.hash.slice(1):(t=e.href.match(/#(.*)$/))?t[1]:void 0}function v(e,t){return y((null==t?void 0:t.getAttribute("formaction"))||e.getAttribute("action")||e.action)}function _(e){return(function(e){return function(e){return e.pathname.split("/").slice(1)}(e).slice(-1)[0]}(e).match(/\.[^.]*$/)||[])[0]||""}function x(e,t){const r=function(e){return t=e.origin+e.pathname,t.endsWith("/")?t:t+"/";var t}(t);return e.href===y(r).href||e.href.startsWith(r)}function w(e,t){return x(e,t)&&!!_(e).match(/^(?:|\.(?:htm|html|xhtml|php))$/)}function R(e){const t=b(e);return null!=t?e.href.slice(0,-(t.length+1)):e.href}function k(e){return R(e)}class FetchResponse{constructor(e){this.response=e}get succeeded(){return this.response.ok}get failed(){return!this.succeeded}get clientError(){return this.statusCode>=400&&this.statusCode<=499}get serverError(){return this.statusCode>=500&&this.statusCode<=599}get redirected(){return this.response.redirected}get location(){return y(this.response.url)}get isHTML(){return this.contentType&&this.contentType.match(/^(?:text\/([^\s;,]+\b)?html|application\/xhtml\+xml)\b/)}get statusCode(){return this.response.status}get contentType(){return this.header("Content-Type")}get responseText(){return this.response.clone().text()}get responseHTML(){return this.isHTML?this.response.clone().text():Promise.resolve(void 0)}header(e){return this.response.headers.get(e)}}function j(e){if("false"==e.getAttribute("data-turbo-eval"))return e;{const t=document.createElement("script"),r=oe("csp-nonce");return r&&(t.nonce=r),t.textContent=e.textContent,t.async=!1,function(e,t){for(const{name:r,value:n}of t.attributes)e.setAttribute(r,n)}(t,e),t}}function z(e,{target:t,cancelable:r,detail:n}={}){const i=new CustomEvent(e,{cancelable:r,bubbles:!0,composed:!0,detail:n});return t&&t.isConnected?t.dispatchEvent(i):document.documentElement.dispatchEvent(i),i}function q(){return new Promise((e=>requestAnimationFrame((()=>e()))))}function $(e=""){return(new DOMParser).parseFromString(e,"text/html")}function Z(e,...t){const r=function(e,t){return e.reduce(((e,r,n)=>e+r+(null==t[n]?"":t[n])),"")}(e,t).replace(/^\n/,"").split("\n"),n=r[0].match(/^\s+/),i=n?n[0].length:0;return r.map((e=>e.slice(i))).join("\n")}function X(){return Array.from({length:36}).map(((e,t)=>8==t||13==t||18==t||23==t?"-":14==t?"4":19==t?(Math.floor(4*Math.random())+8).toString(16):Math.floor(15*Math.random()).toString(16))).join("")}function Y(e,...t){for(const r of t.map((t=>null==t?void 0:t.getAttribute(e))))if("string"==typeof r)return r;return null}function ee(...e){for(const t of e)"turbo-frame"==t.localName&&t.setAttribute("busy",""),t.setAttribute("aria-busy","true")}function te(...e){for(const t of e)"turbo-frame"==t.localName&&t.removeAttribute("busy"),t.removeAttribute("aria-busy")}function re(e,t=2e3){return new Promise((r=>{const n=()=>{e.removeEventListener("error",n),e.removeEventListener("load",n),r()};e.addEventListener("load",n,{once:!0}),e.addEventListener("error",n,{once:!0}),setTimeout(r,t)}))}function ne(e){switch(e){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}function ie(...e){const t=Y("data-turbo-action",...e);return function(e){return"advance"==e||"replace"==e||"restore"==e}(t)?t:null}function se(e){return document.querySelector(`meta[name="${e}"]`)}function oe(e){const t=se(e);return t&&t.content}function ae(e,t){var r;if(e instanceof Element)return e.closest(t)||ae(e.assignedSlot||(null===(r=e.getRootNode())||void 0===r?void 0:r.host),t)}(l=a||(a={}))[l.get=0]="get",l[l.post=1]="post",l[l.put=2]="put",l[l.patch=3]="patch",l[l.delete=4]="delete";class FetchRequest{constructor(e,t,r,n=new URLSearchParams,i=null){this.abortController=new AbortController,this.resolveRequestPromise=e=>{},this.delegate=e,this.method=t,this.headers=this.defaultHeaders,this.body=n,this.url=r,this.target=i}get location(){return this.url}get params(){return this.url.searchParams}get entries(){return this.body?Array.from(this.body.entries()):[]}cancel(){this.abortController.abort()}async perform(){const{fetchOptions:e}=this;this.delegate.prepareRequest(this),await this.allowRequestToBeIntercepted(e);try{this.delegate.requestStarted(this);const t=await fetch(this.url.href,e);return await this.receive(t)}catch(e){if("AbortError"!==e.name)throw this.willDelegateErrorHandling(e)&&this.delegate.requestErrored(this,e),e}finally{this.delegate.requestFinished(this)}}async receive(e){const t=new FetchResponse(e);return z("turbo:before-fetch-response",{cancelable:!0,detail:{fetchResponse:t},target:this.target}).defaultPrevented?this.delegate.requestPreventedHandlingResponse(this,t):t.succeeded?this.delegate.requestSucceededWithResponse(this,t):this.delegate.requestFailedWithResponse(this,t),t}get fetchOptions(){var e;return{method:a[this.method].toUpperCase(),credentials:"same-origin",headers:this.headers,redirect:"follow",body:this.isSafe?null:this.body,signal:this.abortSignal,referrer:null===(e=this.delegate.referrer)||void 0===e?void 0:e.href}}get defaultHeaders(){return{Accept:"text/html, application/xhtml+xml"}}get isSafe(){return this.method===a.get}get abortSignal(){return this.abortController.signal}acceptResponseType(e){this.headers.Accept=[e,this.headers.Accept].join(", ")}async allowRequestToBeIntercepted(e){const t=new Promise((e=>this.resolveRequestPromise=e));z("turbo:before-fetch-request",{cancelable:!0,detail:{fetchOptions:e,url:this.url,resume:this.resolveRequestPromise},target:this.target}).defaultPrevented&&await t}willDelegateErrorHandling(e){return!z("turbo:fetch-request-error",{target:this.target,cancelable:!0,detail:{request:this,error:e}}).defaultPrevented}}class AppearanceObserver{constructor(e,t){this.started=!1,this.intersect=e=>{const t=e.slice(-1)[0];(null==t?void 0:t.isIntersecting)&&this.delegate.elementAppearedInViewport(this.element)},this.delegate=e,this.element=t,this.intersectionObserver=new IntersectionObserver(this.intersect)}start(){this.started||(this.started=!0,this.intersectionObserver.observe(this.element))}stop(){this.started&&(this.started=!1,this.intersectionObserver.unobserve(this.element))}}class StreamMessage{static wrap(e){return"string"==typeof e?new this(function(e){const t=document.createElement("template");return t.innerHTML=e,t.content}(e)):e}constructor(e){this.fragment=function(e){for(const t of e.querySelectorAll("turbo-stream")){const e=document.importNode(t,!0);for(const t of e.templateElement.content.querySelectorAll("script"))t.replaceWith(j(t));t.replaceWith(e)}return e}(e)}}StreamMessage.contentType="text/vnd.turbo-stream.html",(u=c||(c={}))[u.initialized=0]="initialized",u[u.requesting=1]="requesting",u[u.waiting=2]="waiting",u[u.receiving=3]="receiving",u[u.stopping=4]="stopping",u[u.stopped=5]="stopped",(h=d||(d={})).urlEncoded="application/x-www-form-urlencoded",h.multipart="multipart/form-data",h.plain="text/plain";class FormSubmission{static confirmMethod(e,t,r){return Promise.resolve(confirm(e))}constructor(e,t,r,n=!1){this.state=c.initialized,this.delegate=e,this.formElement=t,this.submitter=r,this.formData=function(e,t){const r=new FormData(e),n=null==t?void 0:t.getAttribute("name"),i=null==t?void 0:t.getAttribute("value");n&&r.append(n,i||"");return r}(t,r),this.location=y(this.action),this.method==a.get&&function(e,t){const r=new URLSearchParams;for(const[e,n]of t)n instanceof File||r.append(e,n);e.search=r.toString()}(this.location,[...this.body.entries()]),this.fetchRequest=new FetchRequest(this,this.method,this.location,this.body,this.formElement),this.mustRedirect=n}get method(){var e;return function(e){switch(e.toLowerCase()){case"get":return a.get;case"post":return a.post;case"put":return a.put;case"patch":return a.patch;case"delete":return a.delete}}(((null===(e=this.submitter)||void 0===e?void 0:e.getAttribute("formmethod"))||this.formElement.getAttribute("method")||"").toLowerCase())||a.get}get action(){var e;const t="string"==typeof this.formElement.action?this.formElement.action:null;return(null===(e=this.submitter)||void 0===e?void 0:e.hasAttribute("formaction"))?this.submitter.getAttribute("formaction")||"":this.formElement.getAttribute("action")||t||""}get body(){return this.enctype==d.urlEncoded||this.method==a.get?new URLSearchParams(this.stringFormData):this.formData}get enctype(){var e;return function(e){switch(e.toLowerCase()){case d.multipart:return d.multipart;case d.plain:return d.plain;default:return d.urlEncoded}}((null===(e=this.submitter)||void 0===e?void 0:e.getAttribute("formenctype"))||this.formElement.enctype)}get isSafe(){return this.fetchRequest.isSafe}get stringFormData(){return[...this.formData].reduce(((e,[t,r])=>e.concat("string"==typeof r?[[t,r]]:[])),[])}async start(){const{initialized:e,requesting:t}=c,r=Y("data-turbo-confirm",this.submitter,this.formElement);if("string"==typeof r){if(!await FormSubmission.confirmMethod(r,this.formElement,this.submitter))return}if(this.state==e)return this.state=t,this.fetchRequest.perform()}stop(){const{stopping:e,stopped:t}=c;if(this.state!=e&&this.state!=t)return this.state=e,this.fetchRequest.cancel(),!0}prepareRequest(e){if(!e.isSafe){const t=function(e){if(null!=e){const t=(document.cookie?document.cookie.split("; "):[]).find((t=>t.startsWith(e)));if(t){const e=t.split("=").slice(1).join("=");return e?decodeURIComponent(e):void 0}}}(oe("csrf-param"))||oe("csrf-token");t&&(e.headers["X-CSRF-Token"]=t)}this.requestAcceptsTurboStreamResponse(e)&&e.acceptResponseType(StreamMessage.contentType)}requestStarted(e){var t;this.state=c.waiting,null===(t=this.submitter)||void 0===t||t.setAttribute("disabled",""),this.setSubmitsWith(),z("turbo:submit-start",{target:this.formElement,detail:{formSubmission:this}}),this.delegate.formSubmissionStarted(this)}requestPreventedHandlingResponse(e,t){this.result={success:t.succeeded,fetchResponse:t}}requestSucceededWithResponse(e,t){if(t.clientError||t.serverError)this.delegate.formSubmissionFailedWithResponse(this,t);else if(this.requestMustRedirect(e)&&function(e){return 200==e.statusCode&&!e.redirected}(t)){const e=new Error("Form responses must redirect to another location");this.delegate.formSubmissionErrored(this,e)}else this.state=c.receiving,this.result={success:!0,fetchResponse:t},this.delegate.formSubmissionSucceededWithResponse(this,t)}requestFailedWithResponse(e,t){this.result={success:!1,fetchResponse:t},this.delegate.formSubmissionFailedWithResponse(this,t)}requestErrored(e,t){this.result={success:!1,error:t},this.delegate.formSubmissionErrored(this,t)}requestFinished(e){var t;this.state=c.stopped,null===(t=this.submitter)||void 0===t||t.removeAttribute("disabled"),this.resetSubmitterText(),z("turbo:submit-end",{target:this.formElement,detail:Object.assign({formSubmission:this},this.result)}),this.delegate.formSubmissionFinished(this)}setSubmitsWith(){if(this.submitter&&this.submitsWith)if(this.submitter.matches("button"))this.originalSubmitText=this.submitter.innerHTML,this.submitter.innerHTML=this.submitsWith;else if(this.submitter.matches("input")){const e=this.submitter;this.originalSubmitText=e.value,e.value=this.submitsWith}}resetSubmitterText(){if(this.submitter&&this.originalSubmitText)if(this.submitter.matches("button"))this.submitter.innerHTML=this.originalSubmitText;else if(this.submitter.matches("input")){this.submitter.value=this.originalSubmitText}}requestMustRedirect(e){return!e.isSafe&&this.mustRedirect}requestAcceptsTurboStreamResponse(e){return!e.isSafe||function(e,...t){return t.some((t=>t&&t.hasAttribute(e)))}("data-turbo-stream",this.submitter,this.formElement)}get submitsWith(){var e;return null===(e=this.submitter)||void 0===e?void 0:e.getAttribute("data-turbo-submits-with")}}class Snapshot{constructor(e){this.element=e}get activeElement(){return this.element.ownerDocument.activeElement}get children(){return[...this.element.children]}hasAnchor(e){return null!=this.getElementForAnchor(e)}getElementForAnchor(e){return e?this.element.querySelector(`[id='${e}'], a[name='${e}']`):null}get isConnected(){return this.element.isConnected}get firstAutofocusableElement(){for(const e of this.element.querySelectorAll("[autofocus]"))if(null==e.closest("[inert], :disabled, [hidden], details:not([open]), dialog:not([open])"))return e;return null}get permanentElements(){return ce(this.element)}getPermanentElementById(e){return le(this.element,e)}getPermanentElementMapForSnapshot(e){const t={};for(const r of this.permanentElements){const{id:n}=r,i=e.getPermanentElementById(n);i&&(t[n]=[r,i])}return t}}function le(e,t){return e.querySelector(`#${t}[data-turbo-permanent]`)}function ce(e){return e.querySelectorAll("[id][data-turbo-permanent]")}class FormSubmitObserver{constructor(e,t){this.started=!1,this.submitCaptured=()=>{this.eventTarget.removeEventListener("submit",this.submitBubbled,!1),this.eventTarget.addEventListener("submit",this.submitBubbled,!1)},this.submitBubbled=e=>{if(!e.defaultPrevented){const t=e.target instanceof HTMLFormElement?e.target:void 0,r=e.submitter||void 0;t&&function(e,t){const r=(null==t?void 0:t.getAttribute("formmethod"))||e.getAttribute("method");return"dialog"!=r}(t,r)&&function(e,t){if((null==t?void 0:t.hasAttribute("formtarget"))||e.hasAttribute("target")){const r=(null==t?void 0:t.getAttribute("formtarget"))||e.target;for(const e of document.getElementsByName(r))if(e instanceof HTMLIFrameElement)return!1;return!0}return!0}(t,r)&&this.delegate.willSubmitForm(t,r)&&(e.preventDefault(),e.stopImmediatePropagation(),this.delegate.formSubmitted(t,r))}},this.delegate=e,this.eventTarget=t}start(){this.started||(this.eventTarget.addEventListener("submit",this.submitCaptured,!0),this.started=!0)}stop(){this.started&&(this.eventTarget.removeEventListener("submit",this.submitCaptured,!0),this.started=!1)}}class View{constructor(e,t){this.resolveRenderPromise=e=>{},this.resolveInterceptionPromise=e=>{},this.delegate=e,this.element=t}scrollToAnchor(e){const t=this.snapshot.getElementForAnchor(e);t?(this.scrollToElement(t),this.focusElement(t)):this.scrollToPosition({x:0,y:0})}scrollToAnchorFromLocation(e){this.scrollToAnchor(b(e))}scrollToElement(e){e.scrollIntoView()}focusElement(e){e instanceof HTMLElement&&(e.hasAttribute("tabindex")?e.focus():(e.setAttribute("tabindex","-1"),e.focus(),e.removeAttribute("tabindex")))}scrollToPosition({x:e,y:t}){this.scrollRoot.scrollTo(e,t)}scrollToTop(){this.scrollToPosition({x:0,y:0})}get scrollRoot(){return window}async render(e){const{isPreview:t,shouldRender:r,newSnapshot:n}=e;if(r)try{this.renderPromise=new Promise((e=>this.resolveRenderPromise=e)),this.renderer=e,await this.prepareToRenderSnapshot(e);const r=new Promise((e=>this.resolveInterceptionPromise=e)),i={resume:this.resolveInterceptionPromise,render:this.renderer.renderElement};this.delegate.allowsImmediateRender(n,i)||await r,await this.renderSnapshot(e),this.delegate.viewRenderedSnapshot(n,t),this.delegate.preloadOnLoadLinksForView(this.element),this.finishRenderingSnapshot(e)}finally{delete this.renderer,this.resolveRenderPromise(void 0),delete this.renderPromise}else this.invalidate(e.reloadReason)}invalidate(e){this.delegate.viewInvalidated(e)}async prepareToRenderSnapshot(e){this.markAsPreview(e.isPreview),await e.prepareToRender()}markAsPreview(e){e?this.element.setAttribute("data-turbo-preview",""):this.element.removeAttribute("data-turbo-preview")}async renderSnapshot(e){await e.render()}finishRenderingSnapshot(e){e.finishRendering()}}class FrameView extends View{missing(){this.element.innerHTML='<strong class="turbo-frame-error">Content missing</strong>'}get snapshot(){return new Snapshot(this.element)}}class LinkInterceptor{constructor(e,t){this.clickBubbled=e=>{this.respondsToEventTarget(e.target)?this.clickEvent=e:delete this.clickEvent},this.linkClicked=e=>{this.clickEvent&&this.respondsToEventTarget(e.target)&&e.target instanceof Element&&this.delegate.shouldInterceptLinkClick(e.target,e.detail.url,e.detail.originalEvent)&&(this.clickEvent.preventDefault(),e.preventDefault(),this.delegate.linkClickIntercepted(e.target,e.detail.url,e.detail.originalEvent)),delete this.clickEvent},this.willVisit=e=>{delete this.clickEvent},this.delegate=e,this.element=t}start(){this.element.addEventListener("click",this.clickBubbled),document.addEventListener("turbo:click",this.linkClicked),document.addEventListener("turbo:before-visit",this.willVisit)}stop(){this.element.removeEventListener("click",this.clickBubbled),document.removeEventListener("turbo:click",this.linkClicked),document.removeEventListener("turbo:before-visit",this.willVisit)}respondsToEventTarget(e){const t=e instanceof Element?e:e instanceof Node?e.parentElement:null;return t&&t.closest("turbo-frame, html")==this.element}}class LinkClickObserver{constructor(e,t){this.started=!1,this.clickCaptured=()=>{this.eventTarget.removeEventListener("click",this.clickBubbled,!1),this.eventTarget.addEventListener("click",this.clickBubbled,!1)},this.clickBubbled=e=>{if(e instanceof MouseEvent&&this.clickEventIsSignificant(e)){const t=e.composedPath&&e.composedPath()[0]||e.target,r=this.findLinkFromClickTarget(t);if(r&&function(e){if(e.hasAttribute("target")){for(const t of document.getElementsByName(e.target))if(t instanceof HTMLIFrameElement)return!1;return!0}return!0}(r)){const t=this.getLocationForLink(r);this.delegate.willFollowLinkToLocation(r,t,e)&&(e.preventDefault(),this.delegate.followedLinkToLocation(r,t))}}},this.delegate=e,this.eventTarget=t}start(){this.started||(this.eventTarget.addEventListener("click",this.clickCaptured,!0),this.started=!0)}stop(){this.started&&(this.eventTarget.removeEventListener("click",this.clickCaptured,!0),this.started=!1)}clickEventIsSignificant(e){return!(e.target&&e.target.isContentEditable||e.defaultPrevented||e.which>1||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)}findLinkFromClickTarget(e){return ae(e,"a[href]:not([target^=_]):not([download])")}getLocationForLink(e){return y(e.getAttribute("href")||"")}}class FormLinkClickObserver{constructor(e,t){this.delegate=e,this.linkInterceptor=new LinkClickObserver(this,t)}start(){this.linkInterceptor.start()}stop(){this.linkInterceptor.stop()}willFollowLinkToLocation(e,t,r){return this.delegate.willSubmitFormLinkToLocation(e,t,r)&&e.hasAttribute("data-turbo-method")}followedLinkToLocation(e,t){const r=document.createElement("form");for(const[e,n]of t.searchParams)r.append(Object.assign(document.createElement("input"),{type:"hidden",name:e,value:n}));const n=Object.assign(t,{search:""});r.setAttribute("data-turbo","true"),r.setAttribute("action",n.href),r.setAttribute("hidden","");const i=e.getAttribute("data-turbo-method");i&&r.setAttribute("method",i);const s=e.getAttribute("data-turbo-frame");s&&r.setAttribute("data-turbo-frame",s);const o=ie(e);o&&r.setAttribute("data-turbo-action",o);const a=e.getAttribute("data-turbo-confirm");a&&r.setAttribute("data-turbo-confirm",a);e.hasAttribute("data-turbo-stream")&&r.setAttribute("data-turbo-stream",""),this.delegate.submittedFormLinkToLocation(e,t,r),document.body.appendChild(r),r.addEventListener("turbo:submit-end",(()=>r.remove()),{once:!0}),requestAnimationFrame((()=>r.requestSubmit()))}}class Bardo{static async preservingPermanentElements(e,t,r){const n=new this(e,t);n.enter(),await r(),n.leave()}constructor(e,t){this.delegate=e,this.permanentElementMap=t}enter(){for(const e in this.permanentElementMap){const[t,r]=this.permanentElementMap[e];this.delegate.enteringBardo(t,r),this.replaceNewPermanentElementWithPlaceholder(r)}}leave(){for(const e in this.permanentElementMap){const[t]=this.permanentElementMap[e];this.replaceCurrentPermanentElementWithClone(t),this.replacePlaceholderWithPermanentElement(t),this.delegate.leavingBardo(t)}}replaceNewPermanentElementWithPlaceholder(e){const t=function(e){const t=document.createElement("meta");return t.setAttribute("name","turbo-permanent-placeholder"),t.setAttribute("content",e.id),t}(e);e.replaceWith(t)}replaceCurrentPermanentElementWithClone(e){const t=e.cloneNode(!0);e.replaceWith(t)}replacePlaceholderWithPermanentElement(e){const t=this.getPlaceholderById(e.id);null==t||t.replaceWith(e)}getPlaceholderById(e){return this.placeholders.find((t=>t.content==e))}get placeholders(){return[...document.querySelectorAll("meta[name=turbo-permanent-placeholder][content]")]}}class Renderer{constructor(e,t,r,n,i=!0){this.activeElement=null,this.currentSnapshot=e,this.newSnapshot=t,this.isPreview=n,this.willRender=i,this.renderElement=r,this.promise=new Promise(((e,t)=>this.resolvingFunctions={resolve:e,reject:t}))}get shouldRender(){return!0}get reloadReason(){}prepareToRender(){}finishRendering(){this.resolvingFunctions&&(this.resolvingFunctions.resolve(),delete this.resolvingFunctions)}async preservingPermanentElements(e){await Bardo.preservingPermanentElements(this,this.permanentElementMap,e)}focusFirstAutofocusableElement(){const e=this.connectedSnapshot.firstAutofocusableElement;(function(e){return e&&"function"==typeof e.focus})(e)&&e.focus()}enteringBardo(e){this.activeElement||e.contains(this.currentSnapshot.activeElement)&&(this.activeElement=this.currentSnapshot.activeElement)}leavingBardo(e){e.contains(this.activeElement)&&this.activeElement instanceof HTMLElement&&(this.activeElement.focus(),this.activeElement=null)}get connectedSnapshot(){return this.newSnapshot.isConnected?this.newSnapshot:this.currentSnapshot}get currentElement(){return this.currentSnapshot.element}get newElement(){return this.newSnapshot.element}get permanentElementMap(){return this.currentSnapshot.getPermanentElementMapForSnapshot(this.newSnapshot)}}class FrameRenderer extends Renderer{static renderElement(e,t){var r;const n=document.createRange();n.selectNodeContents(e),n.deleteContents();const i=t,s=null===(r=i.ownerDocument)||void 0===r?void 0:r.createRange();s&&(s.selectNodeContents(i),e.appendChild(s.extractContents()))}constructor(e,t,r,n,i,s=!0){super(t,r,n,i,s),this.delegate=e}get shouldRender(){return!0}async render(){await q(),this.preservingPermanentElements((()=>{this.loadFrameElement()})),this.scrollFrameIntoView(),await q(),this.focusFirstAutofocusableElement(),await q(),this.activateScriptElements()}loadFrameElement(){this.delegate.willRenderFrame(this.currentElement,this.newElement),this.renderElement(this.currentElement,this.newElement)}scrollFrameIntoView(){if(this.currentElement.autoscroll||this.newElement.autoscroll){const r=this.currentElement.firstElementChild,n=(e=this.currentElement.getAttribute("data-autoscroll-block"),t="end","end"==e||"start"==e||"center"==e||"nearest"==e?e:t),i=function(e,t){return"auto"==e||"smooth"==e?e:t}(this.currentElement.getAttribute("data-autoscroll-behavior"),"auto");if(r)return r.scrollIntoView({block:n,behavior:i}),!0}var e,t;return!1}activateScriptElements(){for(const e of this.newScriptElements){const t=j(e);e.replaceWith(t)}}get newScriptElements(){return this.currentElement.querySelectorAll("script")}}class ProgressBar{static get defaultCSS(){return Z`
      .turbo-progress-bar {
        position: fixed;
        display: block;
        top: 0;
        left: 0;
        height: 3px;
        background: #0076ff;
        z-index: 2147483647;
        transition:
          width ${ProgressBar.animationDuration}ms ease-out,
          opacity ${ProgressBar.animationDuration/2}ms ${ProgressBar.animationDuration/2}ms ease-in;
        transform: translate3d(0, 0, 0);
      }
    `}constructor(){this.hiding=!1,this.value=0,this.visible=!1,this.trickle=()=>{this.setValue(this.value+Math.random()/100)},this.stylesheetElement=this.createStylesheetElement(),this.progressElement=this.createProgressElement(),this.installStylesheetElement(),this.setValue(0)}show(){this.visible||(this.visible=!0,this.installProgressElement(),this.startTrickling())}hide(){this.visible&&!this.hiding&&(this.hiding=!0,this.fadeProgressElement((()=>{this.uninstallProgressElement(),this.stopTrickling(),this.visible=!1,this.hiding=!1})))}setValue(e){this.value=e,this.refresh()}installStylesheetElement(){document.head.insertBefore(this.stylesheetElement,document.head.firstChild)}installProgressElement(){this.progressElement.style.width="0",this.progressElement.style.opacity="1",document.documentElement.insertBefore(this.progressElement,document.body),this.refresh()}fadeProgressElement(e){this.progressElement.style.opacity="0",setTimeout(e,1.5*ProgressBar.animationDuration)}uninstallProgressElement(){this.progressElement.parentNode&&document.documentElement.removeChild(this.progressElement)}startTrickling(){this.trickleInterval||(this.trickleInterval=window.setInterval(this.trickle,ProgressBar.animationDuration))}stopTrickling(){window.clearInterval(this.trickleInterval),delete this.trickleInterval}refresh(){requestAnimationFrame((()=>{this.progressElement.style.width=10+90*this.value+"%"}))}createStylesheetElement(){const e=document.createElement("style");return e.type="text/css",e.textContent=ProgressBar.defaultCSS,this.cspNonce&&(e.nonce=this.cspNonce),e}createProgressElement(){const e=document.createElement("div");return e.className="turbo-progress-bar",e}get cspNonce(){return oe("csp-nonce")}}ProgressBar.animationDuration=300;class HeadSnapshot extends Snapshot{constructor(){super(...arguments),this.detailsByOuterHTML=this.children.filter((e=>!function(e){const t=e.localName;return"noscript"==t}(e))).map((e=>function(e){e.hasAttribute("nonce")&&e.setAttribute("nonce","");return e}(e))).reduce(((e,t)=>{const{outerHTML:r}=t,n=r in e?e[r]:{type:ue(t),tracked:de(t),elements:[]};return Object.assign(Object.assign({},e),{[r]:Object.assign(Object.assign({},n),{elements:[...n.elements,t]})})}),{})}get trackedElementSignature(){return Object.keys(this.detailsByOuterHTML).filter((e=>this.detailsByOuterHTML[e].tracked)).join("")}getScriptElementsNotInSnapshot(e){return this.getElementsMatchingTypeNotInSnapshot("script",e)}getStylesheetElementsNotInSnapshot(e){return this.getElementsMatchingTypeNotInSnapshot("stylesheet",e)}getElementsMatchingTypeNotInSnapshot(e,t){return Object.keys(this.detailsByOuterHTML).filter((e=>!(e in t.detailsByOuterHTML))).map((e=>this.detailsByOuterHTML[e])).filter((({type:t})=>t==e)).map((({elements:[e]})=>e))}get provisionalElements(){return Object.keys(this.detailsByOuterHTML).reduce(((e,t)=>{const{type:r,tracked:n,elements:i}=this.detailsByOuterHTML[t];return null!=r||n?i.length>1?[...e,...i.slice(1)]:e:[...e,...i]}),[])}getMetaValue(e){const t=this.findMetaElementByName(e);return t?t.getAttribute("content"):null}findMetaElementByName(e){return Object.keys(this.detailsByOuterHTML).reduce(((t,r)=>{const{elements:[n]}=this.detailsByOuterHTML[r];return function(e,t){const r=e.localName;return"meta"==r&&e.getAttribute("name")==t}(n,e)?n:t}),void 0)}}function ue(e){return function(e){const t=e.localName;return"script"==t}(e)?"script":function(e){const t=e.localName;return"style"==t||"link"==t&&"stylesheet"==e.getAttribute("rel")}(e)?"stylesheet":void 0}function de(e){return"reload"==e.getAttribute("data-turbo-track")}class PageSnapshot extends Snapshot{static fromHTMLString(e=""){return this.fromDocument($(e))}static fromElement(e){return this.fromDocument(e.ownerDocument)}static fromDocument({head:e,body:t}){return new this(t,new HeadSnapshot(e))}constructor(e,t){super(e),this.headSnapshot=t}clone(){const e=this.element.cloneNode(!0),t=this.element.querySelectorAll("select"),r=e.querySelectorAll("select");for(const[e,n]of t.entries()){const t=r[e];for(const e of t.selectedOptions)e.selected=!1;for(const e of n.selectedOptions)t.options[e.index].selected=!0}for(const t of e.querySelectorAll('input[type="password"]'))t.value="";return new PageSnapshot(e,this.headSnapshot)}get headElement(){return this.headSnapshot.element}get rootLocation(){var e;return y(null!==(e=this.getSetting("root"))&&void 0!==e?e:"/")}get cacheControlValue(){return this.getSetting("cache-control")}get isPreviewable(){return"no-preview"!=this.cacheControlValue}get isCacheable(){return"no-cache"!=this.cacheControlValue}get isVisitable(){return"reload"!=this.getSetting("visit-control")}getSetting(e){return this.headSnapshot.getMetaValue(`turbo-${e}`)}}(m=p||(p={})).visitStart="visitStart",m.requestStart="requestStart",m.requestEnd="requestEnd",m.visitEnd="visitEnd",(g=f||(f={})).initialized="initialized",g.started="started",g.canceled="canceled",g.failed="failed",g.completed="completed";const he={action:"advance",historyChanged:!1,visitCachedSnapshot:()=>{},willRender:!0,updateHistory:!0,shouldCacheSnapshot:!0,acceptsStreamResponse:!1};var pe,me,fe,ge;(me=pe||(pe={}))[me.networkFailure=0]="networkFailure",me[me.timeoutFailure=-1]="timeoutFailure",me[me.contentTypeMismatch=-2]="contentTypeMismatch";class Visit{constructor(e,t,r,n={}){this.identifier=X(),this.timingMetrics={},this.followedRedirect=!1,this.historyChanged=!1,this.scrolled=!1,this.shouldCacheSnapshot=!0,this.acceptsStreamResponse=!1,this.snapshotCached=!1,this.state=f.initialized,this.delegate=e,this.location=t,this.restorationIdentifier=r||X();const{action:i,historyChanged:s,referrer:o,snapshot:a,snapshotHTML:l,response:c,visitCachedSnapshot:u,willRender:d,updateHistory:h,shouldCacheSnapshot:p,acceptsStreamResponse:m}=Object.assign(Object.assign({},he),n);this.action=i,this.historyChanged=s,this.referrer=o,this.snapshot=a,this.snapshotHTML=l,this.response=c,this.isSamePage=this.delegate.locationWithActionIsSamePage(this.location,this.action),this.visitCachedSnapshot=u,this.willRender=d,this.updateHistory=h,this.scrolled=!d,this.shouldCacheSnapshot=p,this.acceptsStreamResponse=m}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get history(){return this.delegate.history}get restorationData(){return this.history.getRestorationDataForIdentifier(this.restorationIdentifier)}get silent(){return this.isSamePage}start(){this.state==f.initialized&&(this.recordTimingMetric(p.visitStart),this.state=f.started,this.adapter.visitStarted(this),this.delegate.visitStarted(this))}cancel(){this.state==f.started&&(this.request&&this.request.cancel(),this.cancelRender(),this.state=f.canceled)}complete(){this.state==f.started&&(this.recordTimingMetric(p.visitEnd),this.state=f.completed,this.followRedirect(),this.followedRedirect||(this.adapter.visitCompleted(this),this.delegate.visitCompleted(this)))}fail(){this.state==f.started&&(this.state=f.failed,this.adapter.visitFailed(this))}changeHistory(){var e;if(!this.historyChanged&&this.updateHistory){const t=ne(this.location.href===(null===(e=this.referrer)||void 0===e?void 0:e.href)?"replace":this.action);this.history.update(t,this.location,this.restorationIdentifier),this.historyChanged=!0}}issueRequest(){this.hasPreloadedResponse()?this.simulateRequest():this.shouldIssueRequest()&&!this.request&&(this.request=new FetchRequest(this,a.get,this.location),this.request.perform())}simulateRequest(){this.response&&(this.startRequest(),this.recordResponse(),this.finishRequest())}startRequest(){this.recordTimingMetric(p.requestStart),this.adapter.visitRequestStarted(this)}recordResponse(e=this.response){if(this.response=e,e){const{statusCode:t}=e;ye(t)?this.adapter.visitRequestCompleted(this):this.adapter.visitRequestFailedWithStatusCode(this,t)}}finishRequest(){this.recordTimingMetric(p.requestEnd),this.adapter.visitRequestFinished(this)}loadResponse(){if(this.response){const{statusCode:e,responseHTML:t}=this.response;this.render((async()=>{this.shouldCacheSnapshot&&this.cacheSnapshot(),this.view.renderPromise&&await this.view.renderPromise,ye(e)&&null!=t?(await this.view.renderPage(PageSnapshot.fromHTMLString(t),!1,this.willRender,this),this.performScroll(),this.adapter.visitRendered(this),this.complete()):(await this.view.renderError(PageSnapshot.fromHTMLString(t),this),this.adapter.visitRendered(this),this.fail())}))}}getCachedSnapshot(){const e=this.view.getCachedSnapshotForLocation(this.location)||this.getPreloadedSnapshot();if(e&&(!b(this.location)||e.hasAnchor(b(this.location)))&&("restore"==this.action||e.isPreviewable))return e}getPreloadedSnapshot(){if(this.snapshotHTML)return PageSnapshot.fromHTMLString(this.snapshotHTML)}hasCachedSnapshot(){return null!=this.getCachedSnapshot()}loadCachedSnapshot(){const e=this.getCachedSnapshot();if(e){const t=this.shouldIssueRequest();this.render((async()=>{this.cacheSnapshot(),this.isSamePage?this.adapter.visitRendered(this):(this.view.renderPromise&&await this.view.renderPromise,await this.view.renderPage(e,t,this.willRender,this),this.performScroll(),this.adapter.visitRendered(this),t||this.complete())}))}}followRedirect(){var e;this.redirectedToLocation&&!this.followedRedirect&&(null===(e=this.response)||void 0===e?void 0:e.redirected)&&(this.adapter.visitProposedToLocation(this.redirectedToLocation,{action:"replace",response:this.response,shouldCacheSnapshot:!1,willRender:!1}),this.followedRedirect=!0)}goToSamePageAnchor(){this.isSamePage&&this.render((async()=>{this.cacheSnapshot(),this.performScroll(),this.changeHistory(),this.adapter.visitRendered(this)}))}prepareRequest(e){this.acceptsStreamResponse&&e.acceptResponseType(StreamMessage.contentType)}requestStarted(){this.startRequest()}requestPreventedHandlingResponse(e,t){}async requestSucceededWithResponse(e,t){const r=await t.responseHTML,{redirected:n,statusCode:i}=t;null==r?this.recordResponse({statusCode:pe.contentTypeMismatch,redirected:n}):(this.redirectedToLocation=t.redirected?t.location:void 0,this.recordResponse({statusCode:i,responseHTML:r,redirected:n}))}async requestFailedWithResponse(e,t){const r=await t.responseHTML,{redirected:n,statusCode:i}=t;null==r?this.recordResponse({statusCode:pe.contentTypeMismatch,redirected:n}):this.recordResponse({statusCode:i,responseHTML:r,redirected:n})}requestErrored(e,t){this.recordResponse({statusCode:pe.networkFailure,redirected:!1})}requestFinished(){this.finishRequest()}performScroll(){this.scrolled||this.view.forceReloaded||("restore"==this.action?this.scrollToRestoredPosition()||this.scrollToAnchor()||this.view.scrollToTop():this.scrollToAnchor()||this.view.scrollToTop(),this.isSamePage&&this.delegate.visitScrolledToSamePageLocation(this.view.lastRenderedLocation,this.location),this.scrolled=!0)}scrollToRestoredPosition(){const{scrollPosition:e}=this.restorationData;if(e)return this.view.scrollToPosition(e),!0}scrollToAnchor(){const e=b(this.location);if(null!=e)return this.view.scrollToAnchor(e),!0}recordTimingMetric(e){this.timingMetrics[e]=(new Date).getTime()}getTimingMetrics(){return Object.assign({},this.timingMetrics)}getHistoryMethodForAction(e){switch(e){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}hasPreloadedResponse(){return"object"==typeof this.response}shouldIssueRequest(){return!this.isSamePage&&("restore"==this.action?!this.hasCachedSnapshot():this.willRender)}cacheSnapshot(){this.snapshotCached||(this.view.cacheSnapshot(this.snapshot).then((e=>e&&this.visitCachedSnapshot(e))),this.snapshotCached=!0)}async render(e){this.cancelRender(),await new Promise((e=>{this.frame=requestAnimationFrame((()=>e()))})),await e(),delete this.frame}cancelRender(){this.frame&&(cancelAnimationFrame(this.frame),delete this.frame)}}function ye(e){return e>=200&&e<300}class BrowserAdapter{constructor(e){this.progressBar=new ProgressBar,this.showProgressBar=()=>{this.progressBar.show()},this.session=e}visitProposedToLocation(e,t){this.navigator.startVisit(e,(null==t?void 0:t.restorationIdentifier)||X(),t)}visitStarted(e){this.location=e.location,e.loadCachedSnapshot(),e.issueRequest(),e.goToSamePageAnchor()}visitRequestStarted(e){this.progressBar.setValue(0),e.hasCachedSnapshot()||"restore"!=e.action?this.showVisitProgressBarAfterDelay():this.showProgressBar()}visitRequestCompleted(e){e.loadResponse()}visitRequestFailedWithStatusCode(e,t){switch(t){case pe.networkFailure:case pe.timeoutFailure:case pe.contentTypeMismatch:return this.reload({reason:"request_failed",context:{statusCode:t}});default:return e.loadResponse()}}visitRequestFinished(e){this.progressBar.setValue(1),this.hideVisitProgressBar()}visitCompleted(e){}pageInvalidated(e){this.reload(e)}visitFailed(e){}visitRendered(e){}formSubmissionStarted(e){this.progressBar.setValue(0),this.showFormProgressBarAfterDelay()}formSubmissionFinished(e){this.progressBar.setValue(1),this.hideFormProgressBar()}showVisitProgressBarAfterDelay(){this.visitProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay)}hideVisitProgressBar(){this.progressBar.hide(),null!=this.visitProgressBarTimeout&&(window.clearTimeout(this.visitProgressBarTimeout),delete this.visitProgressBarTimeout)}showFormProgressBarAfterDelay(){null==this.formProgressBarTimeout&&(this.formProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay))}hideFormProgressBar(){this.progressBar.hide(),null!=this.formProgressBarTimeout&&(window.clearTimeout(this.formProgressBarTimeout),delete this.formProgressBarTimeout)}reload(e){var t;z("turbo:reload",{detail:e}),window.location.href=(null===(t=this.location)||void 0===t?void 0:t.toString())||window.location.href}get navigator(){return this.session.navigator}}class CacheObserver{constructor(){this.selector="[data-turbo-temporary]",this.deprecatedSelector="[data-turbo-cache=false]",this.started=!1,this.removeTemporaryElements=e=>{for(const e of this.temporaryElements)e.remove()}}start(){this.started||(this.started=!0,addEventListener("turbo:before-cache",this.removeTemporaryElements,!1))}stop(){this.started&&(this.started=!1,removeEventListener("turbo:before-cache",this.removeTemporaryElements,!1))}get temporaryElements(){return[...document.querySelectorAll(this.selector),...this.temporaryElementsWithDeprecation]}get temporaryElementsWithDeprecation(){const e=document.querySelectorAll(this.deprecatedSelector);return e.length&&console.warn(`The ${this.deprecatedSelector} selector is deprecated and will be removed in a future version. Use ${this.selector} instead.`),[...e]}}class FrameRedirector{constructor(e,t){this.session=e,this.element=t,this.linkInterceptor=new LinkInterceptor(this,t),this.formSubmitObserver=new FormSubmitObserver(this,t)}start(){this.linkInterceptor.start(),this.formSubmitObserver.start()}stop(){this.linkInterceptor.stop(),this.formSubmitObserver.stop()}shouldInterceptLinkClick(e,t,r){return this.shouldRedirect(e)}linkClickIntercepted(e,t,r){const n=this.findFrameElement(e);n&&n.delegate.linkClickIntercepted(e,t,r)}willSubmitForm(e,t){return null==e.closest("turbo-frame")&&this.shouldSubmit(e,t)&&this.shouldRedirect(e,t)}formSubmitted(e,t){const r=this.findFrameElement(e,t);r&&r.delegate.formSubmitted(e,t)}shouldSubmit(e,t){var r;const n=v(e,t),i=this.element.ownerDocument.querySelector('meta[name="turbo-root"]'),s=y(null!==(r=null==i?void 0:i.content)&&void 0!==r?r:"/");return this.shouldRedirect(e,t)&&w(n,s)}shouldRedirect(e,t){if(e instanceof HTMLFormElement?this.session.submissionIsNavigatable(e,t):this.session.elementIsNavigatable(e)){const r=this.findFrameElement(e,t);return!!r&&r!=e.closest("turbo-frame")}return!1}findFrameElement(e,t){const r=(null==t?void 0:t.getAttribute("data-turbo-frame"))||e.getAttribute("data-turbo-frame");if(r&&"_top"!=r){const e=this.element.querySelector(`#${r}:not([disabled])`);if(e instanceof FrameElement)return e}}}class History{constructor(e){this.restorationIdentifier=X(),this.restorationData={},this.started=!1,this.pageLoaded=!1,this.onPopState=e=>{if(this.shouldHandlePopState()){const{turbo:t}=e.state||{};if(t){this.location=new URL(window.location.href);const{restorationIdentifier:e}=t;this.restorationIdentifier=e,this.delegate.historyPoppedToLocationWithRestorationIdentifier(this.location,e)}}},this.onPageLoad=async e=>{await Promise.resolve(),this.pageLoaded=!0},this.delegate=e}start(){this.started||(addEventListener("popstate",this.onPopState,!1),addEventListener("load",this.onPageLoad,!1),this.started=!0,this.replace(new URL(window.location.href)))}stop(){this.started&&(removeEventListener("popstate",this.onPopState,!1),removeEventListener("load",this.onPageLoad,!1),this.started=!1)}push(e,t){this.update(history.pushState,e,t)}replace(e,t){this.update(history.replaceState,e,t)}update(e,t,r=X()){const n={turbo:{restorationIdentifier:r}};e.call(history,n,"",t.href),this.location=t,this.restorationIdentifier=r}getRestorationDataForIdentifier(e){return this.restorationData[e]||{}}updateRestorationData(e){const{restorationIdentifier:t}=this,r=this.restorationData[t];this.restorationData[t]=Object.assign(Object.assign({},r),e)}assumeControlOfScrollRestoration(){var e;this.previousScrollRestoration||(this.previousScrollRestoration=null!==(e=history.scrollRestoration)&&void 0!==e?e:"auto",history.scrollRestoration="manual")}relinquishControlOfScrollRestoration(){this.previousScrollRestoration&&(history.scrollRestoration=this.previousScrollRestoration,delete this.previousScrollRestoration)}shouldHandlePopState(){return this.pageIsLoaded()}pageIsLoaded(){return this.pageLoaded||"complete"==document.readyState}}class Navigator{constructor(e){this.delegate=e}proposeVisit(e,t={}){this.delegate.allowsVisitingLocationWithAction(e,t.action)&&(w(e,this.view.snapshot.rootLocation)?this.delegate.visitProposedToLocation(e,t):window.location.href=e.toString())}startVisit(e,t,r={}){this.stop(),this.currentVisit=new Visit(this,y(e),t,Object.assign({referrer:this.location},r)),this.currentVisit.start()}submitForm(e,t){this.stop(),this.formSubmission=new FormSubmission(this,e,t,!0),this.formSubmission.start()}stop(){this.formSubmission&&(this.formSubmission.stop(),delete this.formSubmission),this.currentVisit&&(this.currentVisit.cancel(),delete this.currentVisit)}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get history(){return this.delegate.history}formSubmissionStarted(e){"function"==typeof this.adapter.formSubmissionStarted&&this.adapter.formSubmissionStarted(e)}async formSubmissionSucceededWithResponse(e,t){if(e==this.formSubmission){const r=await t.responseHTML;if(r){const n=e.isSafe;n||this.view.clearSnapshotCache();const{statusCode:i,redirected:s}=t,o={action:this.getActionForFormSubmission(e),shouldCacheSnapshot:n,response:{statusCode:i,responseHTML:r,redirected:s}};this.proposeVisit(t.location,o)}}}async formSubmissionFailedWithResponse(e,t){const r=await t.responseHTML;if(r){const e=PageSnapshot.fromHTMLString(r);t.serverError?await this.view.renderError(e,this.currentVisit):await this.view.renderPage(e,!1,!0,this.currentVisit),this.view.scrollToTop(),this.view.clearSnapshotCache()}}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished(e){"function"==typeof this.adapter.formSubmissionFinished&&this.adapter.formSubmissionFinished(e)}visitStarted(e){this.delegate.visitStarted(e)}visitCompleted(e){this.delegate.visitCompleted(e)}locationWithActionIsSamePage(e,t){const r=b(e),n=b(this.view.lastRenderedLocation),i="restore"===t&&void 0===r;return"replace"!==t&&R(e)===R(this.view.lastRenderedLocation)&&(i||null!=r&&r!==n)}visitScrolledToSamePageLocation(e,t){this.delegate.visitScrolledToSamePageLocation(e,t)}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}getActionForFormSubmission({submitter:e,formElement:t}){return ie(e,t)||"advance"}}(ge=fe||(fe={}))[ge.initial=0]="initial",ge[ge.loading=1]="loading",ge[ge.interactive=2]="interactive",ge[ge.complete=3]="complete";class PageObserver{constructor(e){this.stage=fe.initial,this.started=!1,this.interpretReadyState=()=>{const{readyState:e}=this;"interactive"==e?this.pageIsInteractive():"complete"==e&&this.pageIsComplete()},this.pageWillUnload=()=>{this.delegate.pageWillUnload()},this.delegate=e}start(){this.started||(this.stage==fe.initial&&(this.stage=fe.loading),document.addEventListener("readystatechange",this.interpretReadyState,!1),addEventListener("pagehide",this.pageWillUnload,!1),this.started=!0)}stop(){this.started&&(document.removeEventListener("readystatechange",this.interpretReadyState,!1),removeEventListener("pagehide",this.pageWillUnload,!1),this.started=!1)}pageIsInteractive(){this.stage==fe.loading&&(this.stage=fe.interactive,this.delegate.pageBecameInteractive())}pageIsComplete(){this.pageIsInteractive(),this.stage==fe.interactive&&(this.stage=fe.complete,this.delegate.pageLoaded())}get readyState(){return document.readyState}}class ScrollObserver{constructor(e){this.started=!1,this.onScroll=()=>{this.updatePosition({x:window.pageXOffset,y:window.pageYOffset})},this.delegate=e}start(){this.started||(addEventListener("scroll",this.onScroll,!1),this.onScroll(),this.started=!0)}stop(){this.started&&(removeEventListener("scroll",this.onScroll,!1),this.started=!1)}updatePosition(e){this.delegate.scrollPositionChanged(e)}}class StreamMessageRenderer{render({fragment:e}){Bardo.preservingPermanentElements(this,function(e){const t=ce(document.documentElement),r={};for(const n of t){const{id:t}=n;for(const i of e.querySelectorAll("turbo-stream")){const e=le(i.templateElement.content,t);e&&(r[t]=[n,e])}}return r}(e),(()=>document.documentElement.appendChild(e)))}enteringBardo(e,t){t.replaceWith(e.cloneNode(!0))}leavingBardo(){}}class StreamObserver{constructor(e){this.sources=new Set,this.started=!1,this.inspectFetchResponse=e=>{const t=function(e){var t;const r=null===(t=e.detail)||void 0===t?void 0:t.fetchResponse;if(r instanceof FetchResponse)return r}(e);t&&function(e){var t;const r=null!==(t=e.contentType)&&void 0!==t?t:"";return r.startsWith(StreamMessage.contentType)}(t)&&(e.preventDefault(),this.receiveMessageResponse(t))},this.receiveMessageEvent=e=>{this.started&&"string"==typeof e.data&&this.receiveMessageHTML(e.data)},this.delegate=e}start(){this.started||(this.started=!0,addEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}stop(){this.started&&(this.started=!1,removeEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}connectStreamSource(e){this.streamSourceIsConnected(e)||(this.sources.add(e),e.addEventListener("message",this.receiveMessageEvent,!1))}disconnectStreamSource(e){this.streamSourceIsConnected(e)&&(this.sources.delete(e),e.removeEventListener("message",this.receiveMessageEvent,!1))}streamSourceIsConnected(e){return this.sources.has(e)}async receiveMessageResponse(e){const t=await e.responseHTML;t&&this.receiveMessageHTML(t)}receiveMessageHTML(e){this.delegate.receivedMessageFromStream(StreamMessage.wrap(e))}}class ErrorRenderer extends Renderer{static renderElement(e,t){const{documentElement:r,body:n}=document;r.replaceChild(t,n)}async render(){this.replaceHeadAndBody(),this.activateScriptElements()}replaceHeadAndBody(){const{documentElement:e,head:t}=document;e.replaceChild(this.newHead,t),this.renderElement(this.currentElement,this.newElement)}activateScriptElements(){for(const e of this.scriptElements){const t=e.parentNode;if(t){const r=j(e);t.replaceChild(r,e)}}}get newHead(){return this.newSnapshot.headSnapshot.element}get scriptElements(){return document.documentElement.querySelectorAll("script")}}class PageRenderer extends Renderer{static renderElement(e,t){document.body&&t instanceof HTMLBodyElement?document.body.replaceWith(t):document.documentElement.appendChild(t)}get shouldRender(){return this.newSnapshot.isVisitable&&this.trackedElementsAreIdentical}get reloadReason(){return this.newSnapshot.isVisitable?this.trackedElementsAreIdentical?void 0:{reason:"tracked_element_mismatch"}:{reason:"turbo_visit_control_is_reload"}}async prepareToRender(){await this.mergeHead()}async render(){this.willRender&&await this.replaceBody()}finishRendering(){super.finishRendering(),this.isPreview||this.focusFirstAutofocusableElement()}get currentHeadSnapshot(){return this.currentSnapshot.headSnapshot}get newHeadSnapshot(){return this.newSnapshot.headSnapshot}get newElement(){return this.newSnapshot.element}async mergeHead(){const e=this.mergeProvisionalElements(),t=this.copyNewHeadStylesheetElements();this.copyNewHeadScriptElements(),await e,await t}async replaceBody(){await this.preservingPermanentElements((async()=>{this.activateNewBody(),await this.assignNewBody()}))}get trackedElementsAreIdentical(){return this.currentHeadSnapshot.trackedElementSignature==this.newHeadSnapshot.trackedElementSignature}async copyNewHeadStylesheetElements(){const e=[];for(const t of this.newHeadStylesheetElements)e.push(re(t)),document.head.appendChild(t);await Promise.all(e)}copyNewHeadScriptElements(){for(const e of this.newHeadScriptElements)document.head.appendChild(j(e))}async mergeProvisionalElements(){const e=[...this.newHeadProvisionalElements];for(const t of this.currentHeadProvisionalElements)this.isCurrentElementInElementList(t,e)||document.head.removeChild(t);for(const t of e)document.head.appendChild(t)}isCurrentElementInElementList(e,t){for(const[r,n]of t.entries()){if("TITLE"==e.tagName){if("TITLE"!=n.tagName)continue;if(e.innerHTML==n.innerHTML)return t.splice(r,1),!0}if(n.isEqualNode(e))return t.splice(r,1),!0}return!1}removeCurrentHeadProvisionalElements(){for(const e of this.currentHeadProvisionalElements)document.head.removeChild(e)}copyNewHeadProvisionalElements(){for(const e of this.newHeadProvisionalElements)document.head.appendChild(e)}activateNewBody(){document.adoptNode(this.newElement),this.activateNewBodyScriptElements()}activateNewBodyScriptElements(){for(const e of this.newBodyScriptElements){const t=j(e);e.replaceWith(t)}}async assignNewBody(){await this.renderElement(this.currentElement,this.newElement)}get newHeadStylesheetElements(){return this.newHeadSnapshot.getStylesheetElementsNotInSnapshot(this.currentHeadSnapshot)}get newHeadScriptElements(){return this.newHeadSnapshot.getScriptElementsNotInSnapshot(this.currentHeadSnapshot)}get currentHeadProvisionalElements(){return this.currentHeadSnapshot.provisionalElements}get newHeadProvisionalElements(){return this.newHeadSnapshot.provisionalElements}get newBodyScriptElements(){return this.newElement.querySelectorAll("script")}}class SnapshotCache{constructor(e){this.keys=[],this.snapshots={},this.size=e}has(e){return k(e)in this.snapshots}get(e){if(this.has(e)){const t=this.read(e);return this.touch(e),t}}put(e,t){return this.write(e,t),this.touch(e),t}clear(){this.snapshots={}}read(e){return this.snapshots[k(e)]}write(e,t){this.snapshots[k(e)]=t}touch(e){const t=k(e),r=this.keys.indexOf(t);r>-1&&this.keys.splice(r,1),this.keys.unshift(t),this.trim()}trim(){for(const e of this.keys.splice(this.size))delete this.snapshots[e]}}class PageView extends View{constructor(){super(...arguments),this.snapshotCache=new SnapshotCache(10),this.lastRenderedLocation=new URL(location.href),this.forceReloaded=!1}renderPage(e,t=!1,r=!0,n){const i=new PageRenderer(this.snapshot,e,PageRenderer.renderElement,t,r);return i.shouldRender?null==n||n.changeHistory():this.forceReloaded=!0,this.render(i)}renderError(e,t){null==t||t.changeHistory();const r=new ErrorRenderer(this.snapshot,e,ErrorRenderer.renderElement,!1);return this.render(r)}clearSnapshotCache(){this.snapshotCache.clear()}async cacheSnapshot(e=this.snapshot){if(e.isCacheable){this.delegate.viewWillCacheSnapshot();const{lastRenderedLocation:t}=this;await new Promise((e=>setTimeout((()=>e()),0)));const r=e.clone();return this.snapshotCache.put(t,r),r}}getCachedSnapshotForLocation(e){return this.snapshotCache.get(e)}get snapshot(){return PageSnapshot.fromElement(this.element)}}class Preloader{constructor(e){this.selector="a[data-turbo-preload]",this.delegate=e}get snapshotCache(){return this.delegate.navigator.view.snapshotCache}start(){if("loading"===document.readyState)return document.addEventListener("DOMContentLoaded",(()=>{this.preloadOnLoadLinksForView(document.body)}));this.preloadOnLoadLinksForView(document.body)}preloadOnLoadLinksForView(e){for(const t of e.querySelectorAll(this.selector))this.preloadURL(t)}async preloadURL(e){const t=new URL(e.href);if(!this.snapshotCache.has(t))try{const e=await fetch(t.toString(),{headers:{"VND.PREFETCH":"true",Accept:"text/html"}}),r=await e.text(),n=PageSnapshot.fromHTMLString(r);this.snapshotCache.put(t,n)}catch(e){}}}function be(e){Object.defineProperties(e,ve)}const ve={absoluteURL:{get(){return this.toString()}}};const _e={after(){this.targetElements.forEach((e=>{var t;return null===(t=e.parentElement)||void 0===t?void 0:t.insertBefore(this.templateContent,e.nextSibling)}))},append(){this.removeDuplicateTargetChildren(),this.targetElements.forEach((e=>e.append(this.templateContent)))},before(){this.targetElements.forEach((e=>{var t;return null===(t=e.parentElement)||void 0===t?void 0:t.insertBefore(this.templateContent,e)}))},prepend(){this.removeDuplicateTargetChildren(),this.targetElements.forEach((e=>e.prepend(this.templateContent)))},remove(){this.targetElements.forEach((e=>e.remove()))},replace(){this.targetElements.forEach((e=>e.replaceWith(this.templateContent)))},update(){this.targetElements.forEach((e=>{e.innerHTML="",e.append(this.templateContent)}))}},xe=new class Session{constructor(){this.navigator=new Navigator(this),this.history=new History(this),this.preloader=new Preloader(this),this.view=new PageView(this,document.documentElement),this.adapter=new BrowserAdapter(this),this.pageObserver=new PageObserver(this),this.cacheObserver=new CacheObserver,this.linkClickObserver=new LinkClickObserver(this,window),this.formSubmitObserver=new FormSubmitObserver(this,document),this.scrollObserver=new ScrollObserver(this),this.streamObserver=new StreamObserver(this),this.formLinkClickObserver=new FormLinkClickObserver(this,document.documentElement),this.frameRedirector=new FrameRedirector(this,document.documentElement),this.streamMessageRenderer=new StreamMessageRenderer,this.drive=!0,this.enabled=!0,this.progressBarDelay=500,this.started=!1,this.formMode="on"}start(){this.started||(this.pageObserver.start(),this.cacheObserver.start(),this.formLinkClickObserver.start(),this.linkClickObserver.start(),this.formSubmitObserver.start(),this.scrollObserver.start(),this.streamObserver.start(),this.frameRedirector.start(),this.history.start(),this.preloader.start(),this.started=!0,this.enabled=!0)}disable(){this.enabled=!1}stop(){this.started&&(this.pageObserver.stop(),this.cacheObserver.stop(),this.formLinkClickObserver.stop(),this.linkClickObserver.stop(),this.formSubmitObserver.stop(),this.scrollObserver.stop(),this.streamObserver.stop(),this.frameRedirector.stop(),this.history.stop(),this.started=!1)}registerAdapter(e){this.adapter=e}visit(e,t={}){const r=t.frame?document.getElementById(t.frame):null;r instanceof FrameElement?(r.src=e.toString(),r.loaded):this.navigator.proposeVisit(y(e),t)}connectStreamSource(e){this.streamObserver.connectStreamSource(e)}disconnectStreamSource(e){this.streamObserver.disconnectStreamSource(e)}renderStreamMessage(e){this.streamMessageRenderer.render(StreamMessage.wrap(e))}clearCache(){this.view.clearSnapshotCache()}setProgressBarDelay(e){this.progressBarDelay=e}setFormMode(e){this.formMode=e}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}historyPoppedToLocationWithRestorationIdentifier(e,t){this.enabled?this.navigator.startVisit(e,t,{action:"restore",historyChanged:!0}):this.adapter.pageInvalidated({reason:"turbo_disabled"})}scrollPositionChanged(e){this.history.updateRestorationData({scrollPosition:e})}willSubmitFormLinkToLocation(e,t){return this.elementIsNavigatable(e)&&w(t,this.snapshot.rootLocation)}submittedFormLinkToLocation(){}willFollowLinkToLocation(e,t,r){return this.elementIsNavigatable(e)&&w(t,this.snapshot.rootLocation)&&this.applicationAllowsFollowingLinkToLocation(e,t,r)}followedLinkToLocation(e,t){const r=this.getActionForLink(e),n=e.hasAttribute("data-turbo-stream");this.visit(t.href,{action:r,acceptsStreamResponse:n})}allowsVisitingLocationWithAction(e,t){return this.locationWithActionIsSamePage(e,t)||this.applicationAllowsVisitingLocation(e)}visitProposedToLocation(e,t){be(e),this.adapter.visitProposedToLocation(e,t)}visitStarted(e){e.acceptsStreamResponse||ee(document.documentElement),be(e.location),e.silent||this.notifyApplicationAfterVisitingLocation(e.location,e.action)}visitCompleted(e){te(document.documentElement),this.notifyApplicationAfterPageLoad(e.getTimingMetrics())}locationWithActionIsSamePage(e,t){return this.navigator.locationWithActionIsSamePage(e,t)}visitScrolledToSamePageLocation(e,t){this.notifyApplicationAfterVisitingSamePageLocation(e,t)}willSubmitForm(e,t){const r=v(e,t);return this.submissionIsNavigatable(e,t)&&w(y(r),this.snapshot.rootLocation)}formSubmitted(e,t){this.navigator.submitForm(e,t)}pageBecameInteractive(){this.view.lastRenderedLocation=this.location,this.notifyApplicationAfterPageLoad()}pageLoaded(){this.history.assumeControlOfScrollRestoration()}pageWillUnload(){this.history.relinquishControlOfScrollRestoration()}receivedMessageFromStream(e){this.renderStreamMessage(e)}viewWillCacheSnapshot(){var e;(null===(e=this.navigator.currentVisit)||void 0===e?void 0:e.silent)||this.notifyApplicationBeforeCachingSnapshot()}allowsImmediateRender({element:e},t){const r=this.notifyApplicationBeforeRender(e,t),{defaultPrevented:n,detail:{render:i}}=r;return this.view.renderer&&i&&(this.view.renderer.renderElement=i),!n}viewRenderedSnapshot(e,t){this.view.lastRenderedLocation=this.history.location,this.notifyApplicationAfterRender()}preloadOnLoadLinksForView(e){this.preloader.preloadOnLoadLinksForView(e)}viewInvalidated(e){this.adapter.pageInvalidated(e)}frameLoaded(e){this.notifyApplicationAfterFrameLoad(e)}frameRendered(e,t){this.notifyApplicationAfterFrameRender(e,t)}applicationAllowsFollowingLinkToLocation(e,t,r){return!this.notifyApplicationAfterClickingLinkToLocation(e,t,r).defaultPrevented}applicationAllowsVisitingLocation(e){return!this.notifyApplicationBeforeVisitingLocation(e).defaultPrevented}notifyApplicationAfterClickingLinkToLocation(e,t,r){return z("turbo:click",{target:e,detail:{url:t.href,originalEvent:r},cancelable:!0})}notifyApplicationBeforeVisitingLocation(e){return z("turbo:before-visit",{detail:{url:e.href},cancelable:!0})}notifyApplicationAfterVisitingLocation(e,t){return z("turbo:visit",{detail:{url:e.href,action:t}})}notifyApplicationBeforeCachingSnapshot(){return z("turbo:before-cache")}notifyApplicationBeforeRender(e,t){return z("turbo:before-render",{detail:Object.assign({newBody:e},t),cancelable:!0})}notifyApplicationAfterRender(){return z("turbo:render")}notifyApplicationAfterPageLoad(e={}){return z("turbo:load",{detail:{url:this.location.href,timing:e}})}notifyApplicationAfterVisitingSamePageLocation(e,t){dispatchEvent(new HashChangeEvent("hashchange",{oldURL:e.toString(),newURL:t.toString()}))}notifyApplicationAfterFrameLoad(e){return z("turbo:frame-load",{target:e})}notifyApplicationAfterFrameRender(e,t){return z("turbo:frame-render",{detail:{fetchResponse:e},target:t,cancelable:!0})}submissionIsNavigatable(e,t){if("off"==this.formMode)return!1;{const r=!t||this.elementIsNavigatable(t);return"optin"==this.formMode?r&&null!=e.closest('[data-turbo="true"]'):r&&this.elementIsNavigatable(e)}}elementIsNavigatable(e){const t=ae(e,"[data-turbo]"),r=ae(e,"turbo-frame");return this.drive||r?!t||"false"!=t.getAttribute("data-turbo"):!!t&&"true"==t.getAttribute("data-turbo")}getActionForLink(e){return ie(e)||"advance"}get snapshot(){return this.view.snapshot}},we=new class Cache{constructor(e){this.session=e}clear(){this.session.clearCache()}resetCacheControl(){this.setCacheControl("")}exemptPageFromCache(){this.setCacheControl("no-cache")}exemptPageFromPreview(){this.setCacheControl("no-preview")}setCacheControl(e){!function(e,t){let r=se(e);r||(r=document.createElement("meta"),r.setAttribute("name",e),document.head.appendChild(r)),r.setAttribute("content",t)}("turbo-cache-control",e)}}(xe),{navigator:Se}=xe;function Pe(){xe.start()}function Te(e){xe.connectStreamSource(e)}function Re(e){xe.disconnectStreamSource(e)}var ke=Object.freeze({__proto__:null,navigator:Se,session:xe,cache:we,PageRenderer,PageSnapshot,FrameRenderer,start:Pe,registerAdapter:function(e){xe.registerAdapter(e)},visit:function(e,t){xe.visit(e,t)},connectStreamSource:Te,disconnectStreamSource:Re,renderStreamMessage:function(e){xe.renderStreamMessage(e)},clearCache:function(){console.warn("Please replace `Turbo.clearCache()` with `Turbo.cache.clear()`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),xe.clearCache()},setProgressBarDelay:function(e){xe.setProgressBarDelay(e)},setConfirmMethod:function(e){FormSubmission.confirmMethod=e},setFormMode:function(e){xe.setFormMode(e)},StreamActions:_e});class TurboFrameMissingError extends Error{}function Ie(e){if(null!=e){const t=document.getElementById(e);if(t instanceof FrameElement)return t}}function je(e,t){if(e){const n=e.getAttribute("src");if(null!=n&&null!=t&&(r=t,y(n).href==y(r).href))throw new Error(`Matching <turbo-frame id="${e.id}"> element has a source URL which references itself`);if(e.ownerDocument!==document&&(e=document.importNode(e,!0)),e instanceof FrameElement)return e.connectedCallback(),e.disconnectedCallback(),e}var r}class StreamElement extends HTMLElement{static async renderElement(e){await e.performAction()}async connectedCallback(){try{await this.render()}catch(e){console.error(e)}finally{this.disconnect()}}async render(){var e;return null!==(e=this.renderPromise)&&void 0!==e?e:this.renderPromise=(async()=>{const e=this.beforeRenderEvent;this.dispatchEvent(e)&&(await q(),await e.detail.render(this))})()}disconnect(){try{this.remove()}catch(e){}}removeDuplicateTargetChildren(){this.duplicateChildren.forEach((e=>e.remove()))}get duplicateChildren(){var e;const t=this.targetElements.flatMap((e=>[...e.children])).filter((e=>!!e.id)),r=[...(null===(e=this.templateContent)||void 0===e?void 0:e.children)||[]].filter((e=>!!e.id)).map((e=>e.id));return t.filter((e=>r.includes(e.id)))}get performAction(){if(this.action){const e=_e[this.action];if(e)return e;this.raise("unknown action")}this.raise("action attribute is missing")}get targetElements(){return this.target?this.targetElementsById:this.targets?this.targetElementsByQuery:void this.raise("target or targets attribute is missing")}get templateContent(){return this.templateElement.content.cloneNode(!0)}get templateElement(){if(null===this.firstElementChild){const e=this.ownerDocument.createElement("template");return this.appendChild(e),e}if(this.firstElementChild instanceof HTMLTemplateElement)return this.firstElementChild;this.raise("first child element must be a <template> element")}get action(){return this.getAttribute("action")}get target(){return this.getAttribute("target")}get targets(){return this.getAttribute("targets")}raise(e){throw new Error(`${this.description}: ${e}`)}get description(){var e,t;return null!==(t=(null!==(e=this.outerHTML.match(/<[^>]+>/))&&void 0!==e?e:[])[0])&&void 0!==t?t:"<turbo-stream>"}get beforeRenderEvent(){return new CustomEvent("turbo:before-stream-render",{bubbles:!0,cancelable:!0,detail:{newStream:this,render:StreamElement.renderElement}})}get targetElementsById(){var e;const t=null===(e=this.ownerDocument)||void 0===e?void 0:e.getElementById(this.target);return null!==t?[t]:[]}get targetElementsByQuery(){var e;const t=null===(e=this.ownerDocument)||void 0===e?void 0:e.querySelectorAll(this.targets);return 0!==t.length?Array.prototype.slice.call(t):[]}}class StreamSourceElement extends HTMLElement{constructor(){super(...arguments),this.streamSource=null}connectedCallback(){this.streamSource=this.src.match(/^ws{1,2}:/)?new WebSocket(this.src):new EventSource(this.src),Te(this.streamSource)}disconnectedCallback(){this.streamSource&&Re(this.streamSource)}get src(){return this.getAttribute("src")||""}}let He;async function ze(){return He||Ge(async function(){const{createConsumer:e}=await Promise.resolve().then(r.bind(r,35061));return e()}().then(Ge))}function Ge(e){return He=e}function We(e){return e&&"object"==typeof e?e instanceof Date||e instanceof RegExp?e:Array.isArray(e)?e.map(We):Object.keys(e).reduce((function(t,r){return t[r[0].toLowerCase()+r.slice(1).replace(/([A-Z]+)/g,(function(e,t){return"_"+t.toLowerCase()}))]=We(e[r]),t}),{}):e}FrameElement.delegateConstructor=class FrameController{constructor(e){this.fetchResponseLoaded=e=>{},this.currentFetchRequest=null,this.resolveVisitPromise=()=>{},this.connected=!1,this.hasBeenLoaded=!1,this.ignoredAttributes=new Set,this.action=null,this.visitCachedSnapshot=({element:e})=>{const t=e.querySelector("#"+this.element.id);t&&this.previousFrameElement&&t.replaceChildren(...this.previousFrameElement.children),delete this.previousFrameElement},this.element=e,this.view=new FrameView(this,this.element),this.appearanceObserver=new AppearanceObserver(this,this.element),this.formLinkClickObserver=new FormLinkClickObserver(this,this.element),this.linkInterceptor=new LinkInterceptor(this,this.element),this.restorationIdentifier=X(),this.formSubmitObserver=new FormSubmitObserver(this,this.element)}connect(){this.connected||(this.connected=!0,this.loadingStyle==s.lazy?this.appearanceObserver.start():this.loadSourceURL(),this.formLinkClickObserver.start(),this.linkInterceptor.start(),this.formSubmitObserver.start())}disconnect(){this.connected&&(this.connected=!1,this.appearanceObserver.stop(),this.formLinkClickObserver.stop(),this.linkInterceptor.stop(),this.formSubmitObserver.stop())}disabledChanged(){this.loadingStyle==s.eager&&this.loadSourceURL()}sourceURLChanged(){this.isIgnoringChangesTo("src")||(this.element.isConnected&&(this.complete=!1),(this.loadingStyle==s.eager||this.hasBeenLoaded)&&this.loadSourceURL())}sourceURLReloaded(){const{src:e}=this.element;return this.ignoringChangesToAttribute("complete",(()=>{this.element.removeAttribute("complete")})),this.element.src=null,this.element.src=e,this.element.loaded}completeChanged(){this.isIgnoringChangesTo("complete")||this.loadSourceURL()}loadingStyleChanged(){this.loadingStyle==s.lazy?this.appearanceObserver.start():(this.appearanceObserver.stop(),this.loadSourceURL())}async loadSourceURL(){this.enabled&&this.isActive&&!this.complete&&this.sourceURL&&(this.element.loaded=this.visit(y(this.sourceURL)),this.appearanceObserver.stop(),await this.element.loaded,this.hasBeenLoaded=!0)}async loadResponse(e){(e.redirected||e.succeeded&&e.isHTML)&&(this.sourceURL=e.response.url);try{const t=await e.responseHTML;if(t){const r=$(t);PageSnapshot.fromDocument(r).isVisitable?await this.loadFrameResponse(e,r):await this.handleUnvisitableFrameResponse(e)}}finally{this.fetchResponseLoaded=()=>{}}}elementAppearedInViewport(e){this.proposeVisitIfNavigatedWithAction(e,e),this.loadSourceURL()}willSubmitFormLinkToLocation(e){return this.shouldInterceptNavigation(e)}submittedFormLinkToLocation(e,t,r){const n=this.findFrameElement(e);n&&r.setAttribute("data-turbo-frame",n.id)}shouldInterceptLinkClick(e,t,r){return this.shouldInterceptNavigation(e)}linkClickIntercepted(e,t){this.navigateFrame(e,t)}willSubmitForm(e,t){return e.closest("turbo-frame")==this.element&&this.shouldInterceptNavigation(e,t)}formSubmitted(e,t){this.formSubmission&&this.formSubmission.stop(),this.formSubmission=new FormSubmission(this,e,t);const{fetchRequest:r}=this.formSubmission;this.prepareRequest(r),this.formSubmission.start()}prepareRequest(e){var t;e.headers["Turbo-Frame"]=this.id,(null===(t=this.currentNavigationElement)||void 0===t?void 0:t.hasAttribute("data-turbo-stream"))&&e.acceptResponseType(StreamMessage.contentType)}requestStarted(e){ee(this.element)}requestPreventedHandlingResponse(e,t){this.resolveVisitPromise()}async requestSucceededWithResponse(e,t){await this.loadResponse(t),this.resolveVisitPromise()}async requestFailedWithResponse(e,t){await this.loadResponse(t),this.resolveVisitPromise()}requestErrored(e,t){console.error(t),this.resolveVisitPromise()}requestFinished(e){te(this.element)}formSubmissionStarted({formElement:e}){ee(e,this.findFrameElement(e))}formSubmissionSucceededWithResponse(e,t){const r=this.findFrameElement(e.formElement,e.submitter);r.delegate.proposeVisitIfNavigatedWithAction(r,e.formElement,e.submitter),r.delegate.loadResponse(t),e.isSafe||xe.clearCache()}formSubmissionFailedWithResponse(e,t){this.element.delegate.loadResponse(t),xe.clearCache()}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished({formElement:e}){te(e,this.findFrameElement(e))}allowsImmediateRender({element:e},t){const r=z("turbo:before-frame-render",{target:this.element,detail:Object.assign({newFrame:e},t),cancelable:!0}),{defaultPrevented:n,detail:{render:i}}=r;return this.view.renderer&&i&&(this.view.renderer.renderElement=i),!n}viewRenderedSnapshot(e,t){}preloadOnLoadLinksForView(e){xe.preloadOnLoadLinksForView(e)}viewInvalidated(){}willRenderFrame(e,t){this.previousFrameElement=e.cloneNode(!0)}async loadFrameResponse(e,t){const r=await this.extractForeignFrameElement(t.body);if(r){const t=new Snapshot(r),n=new FrameRenderer(this,this.view.snapshot,t,FrameRenderer.renderElement,!1,!1);this.view.renderPromise&&await this.view.renderPromise,this.changeHistory(),await this.view.render(n),this.complete=!0,xe.frameRendered(e,this.element),xe.frameLoaded(this.element),this.fetchResponseLoaded(e)}else this.willHandleFrameMissingFromResponse(e)&&this.handleFrameMissingFromResponse(e)}async visit(e){var t;const r=new FetchRequest(this,a.get,e,new URLSearchParams,this.element);return null===(t=this.currentFetchRequest)||void 0===t||t.cancel(),this.currentFetchRequest=r,new Promise((e=>{this.resolveVisitPromise=()=>{this.resolveVisitPromise=()=>{},this.currentFetchRequest=null,e()},r.perform()}))}navigateFrame(e,t,r){const n=this.findFrameElement(e,r);n.delegate.proposeVisitIfNavigatedWithAction(n,e,r),this.withCurrentNavigationElement(e,(()=>{n.src=t}))}proposeVisitIfNavigatedWithAction(e,t,r){if(this.action=ie(r,t,e),this.action){const t=PageSnapshot.fromElement(e).clone(),{visitCachedSnapshot:r}=e.delegate;e.delegate.fetchResponseLoaded=n=>{if(e.src){const{statusCode:i,redirected:s}=n,o={response:{statusCode:i,redirected:s,responseHTML:e.ownerDocument.documentElement.outerHTML},visitCachedSnapshot:r,willRender:!1,updateHistory:!1,restorationIdentifier:this.restorationIdentifier,snapshot:t};this.action&&(o.action=this.action),xe.visit(e.src,o)}}}}changeHistory(){if(this.action){const e=ne(this.action);xe.history.update(e,y(this.element.src||""),this.restorationIdentifier)}}async handleUnvisitableFrameResponse(e){console.warn(`The response (${e.statusCode}) from <turbo-frame id="${this.element.id}"> is performing a full page visit due to turbo-visit-control.`),await this.visitResponse(e.response)}willHandleFrameMissingFromResponse(e){this.element.setAttribute("complete","");const t=e.response;return!z("turbo:frame-missing",{target:this.element,detail:{response:t,visit:async(e,t={})=>{e instanceof Response?this.visitResponse(e):xe.visit(e,t)}},cancelable:!0}).defaultPrevented}handleFrameMissingFromResponse(e){this.view.missing(),this.throwFrameMissingError(e)}throwFrameMissingError(e){const t=`The response (${e.statusCode}) did not contain the expected <turbo-frame id="${this.element.id}"> and will be ignored. To perform a full page visit instead, set turbo-visit-control to reload.`;throw new TurboFrameMissingError(t)}async visitResponse(e){const t=new FetchResponse(e),r=await t.responseHTML,{location:n,redirected:i,statusCode:s}=t;return xe.visit(n,{response:{redirected:i,statusCode:s,responseHTML:r}})}findFrameElement(e,t){var r;return null!==(r=Ie(Y("data-turbo-frame",t,e)||this.element.getAttribute("target")))&&void 0!==r?r:this.element}async extractForeignFrameElement(e){let t;const r=CSS.escape(this.id);try{if(t=je(e.querySelector(`turbo-frame#${r}`),this.sourceURL),t)return t;if(t=je(e.querySelector(`turbo-frame[src][recurse~=${r}]`),this.sourceURL),t)return await t.loaded,await this.extractForeignFrameElement(t)}catch(e){return console.error(e),new FrameElement}return null}formActionIsVisitable(e,t){return w(y(v(e,t)),this.rootLocation)}shouldInterceptNavigation(e,t){const r=Y("data-turbo-frame",t,e)||this.element.getAttribute("target");if(e instanceof HTMLFormElement&&!this.formActionIsVisitable(e,t))return!1;if(!this.enabled||"_top"==r)return!1;if(r){const e=Ie(r);if(e)return!e.disabled}return!!xe.elementIsNavigatable(e)&&!(t&&!xe.elementIsNavigatable(t))}get id(){return this.element.id}get enabled(){return!this.element.disabled}get sourceURL(){if(this.element.src)return this.element.src}set sourceURL(e){this.ignoringChangesToAttribute("src",(()=>{this.element.src=null!=e?e:null}))}get loadingStyle(){return this.element.loading}get isLoading(){return void 0!==this.formSubmission||void 0!==this.resolveVisitPromise()}get complete(){return this.element.hasAttribute("complete")}set complete(e){this.ignoringChangesToAttribute("complete",(()=>{e?this.element.setAttribute("complete",""):this.element.removeAttribute("complete")}))}get isActive(){return this.element.isActive&&this.connected}get rootLocation(){var e;const t=this.element.ownerDocument.querySelector('meta[name="turbo-root"]');return y(null!==(e=null==t?void 0:t.content)&&void 0!==e?e:"/")}isIgnoringChangesTo(e){return this.ignoredAttributes.has(e)}ignoringChangesToAttribute(e,t){this.ignoredAttributes.add(e),t(),this.ignoredAttributes.delete(e)}withCurrentNavigationElement(e,t){this.currentNavigationElement=e,t(),delete this.currentNavigationElement}},void 0===customElements.get("turbo-frame")&&customElements.define("turbo-frame",FrameElement),void 0===customElements.get("turbo-stream")&&customElements.define("turbo-stream",StreamElement),void 0===customElements.get("turbo-stream-source")&&customElements.define("turbo-stream-source",StreamSourceElement),(()=>{let e=document.currentScript;if(e&&!e.hasAttribute("data-turbo-suppress-warning"))for(e=e.parentElement;e;){if(e==document.body)return console.warn(Z`
        You are loading Turbo from a <script> element inside the <body> element. This is probably not what you meant to do!

        Load your application’s JavaScript bundle inside the <head> element instead. <script> elements in <body> are evaluated with each page change.

        For more information, see: https://turbo.hotwired.dev/handbook/building#working-with-script-elements

        ——
        Suppress this warning by adding a "data-turbo-suppress-warning" attribute to: %s
      `,e.outerHTML);e=e.parentElement}})(),window.Turbo=ke,Pe();class TurboCableStreamSourceElement extends HTMLElement{async connectedCallback(){Te(this),this.subscription=await async function(e,t){const{subscriptions:r}=await ze();return r.create(e,t)}(this.channel,{received:this.dispatchMessageEvent.bind(this),connected:this.subscriptionConnected.bind(this),disconnected:this.subscriptionDisconnected.bind(this)})}disconnectedCallback(){Re(this),this.subscription&&this.subscription.unsubscribe()}dispatchMessageEvent(e){const t=new MessageEvent("message",{data:e});return this.dispatchEvent(t)}subscriptionConnected(){this.setAttribute("connected","")}subscriptionDisconnected(){this.removeAttribute("connected")}get channel(){return{channel:this.getAttribute("channel"),signed_stream_name:this.getAttribute("signed-stream-name"),...We({...this.dataset})}}}void 0===customElements.get("turbo-cable-stream-source")&&customElements.define("turbo-cable-stream-source",TurboCableStreamSourceElement),addEventListener("turbo:before-fetch-request",(function(e){if(e.target instanceof HTMLFormElement){const{target:t,detail:{fetchOptions:r}}=e;t.addEventListener("turbo:submit-start",(({detail:{formSubmission:{submitter:e}}})=>{const n=function(e){return e instanceof FormData||e instanceof URLSearchParams}(r.body)?r.body:new URLSearchParams,i=function(e,t,r){const n=function(e){return(e instanceof HTMLButtonElement||e instanceof HTMLInputElement)&&e.hasAttribute("formmethod")?e.formMethod:null}(e),i=t.get("_method"),s=r.getAttribute("method")||"get";return"string"==typeof n?n:"string"==typeof i?i:s}(e,n,t);/get/i.test(i)||(/post/i.test(i)?n.delete("_method"):n.set("_method",i),r.method="post")}),{once:!0})}}))},35061:(e,t,r)=>{"use strict";r.d(t,{createConsumer:()=>f});const n={logger:self.console,WebSocket:self.WebSocket},i={log(...e){this.enabled&&(e.push(Date.now()),n.logger.log("[ActionCable]",...e))}},s=()=>(new Date).getTime(),o=e=>(s()-e)/1e3;class ConnectionMonitor{constructor(e){this.visibilityDidChange=this.visibilityDidChange.bind(this),this.connection=e,this.reconnectAttempts=0}start(){this.isRunning()||(this.startedAt=s(),delete this.stoppedAt,this.startPolling(),addEventListener("visibilitychange",this.visibilityDidChange),i.log(`ConnectionMonitor started. stale threshold = ${this.constructor.staleThreshold} s`))}stop(){this.isRunning()&&(this.stoppedAt=s(),this.stopPolling(),removeEventListener("visibilitychange",this.visibilityDidChange),i.log("ConnectionMonitor stopped"))}isRunning(){return this.startedAt&&!this.stoppedAt}recordPing(){this.pingedAt=s()}recordConnect(){this.reconnectAttempts=0,this.recordPing(),delete this.disconnectedAt,i.log("ConnectionMonitor recorded connect")}recordDisconnect(){this.disconnectedAt=s(),i.log("ConnectionMonitor recorded disconnect")}startPolling(){this.stopPolling(),this.poll()}stopPolling(){clearTimeout(this.pollTimeout)}poll(){this.pollTimeout=setTimeout((()=>{this.reconnectIfStale(),this.poll()}),this.getPollInterval())}getPollInterval(){const{staleThreshold:e,reconnectionBackoffRate:t}=this.constructor;return 1e3*e*Math.pow(1+t,Math.min(this.reconnectAttempts,10))*(1+(0===this.reconnectAttempts?1:t)*Math.random())}reconnectIfStale(){this.connectionIsStale()&&(i.log(`ConnectionMonitor detected stale connection. reconnectAttempts = ${this.reconnectAttempts}, time stale = ${o(this.refreshedAt)} s, stale threshold = ${this.constructor.staleThreshold} s`),this.reconnectAttempts++,this.disconnectedRecently()?i.log(`ConnectionMonitor skipping reopening recent disconnect. time disconnected = ${o(this.disconnectedAt)} s`):(i.log("ConnectionMonitor reopening"),this.connection.reopen()))}get refreshedAt(){return this.pingedAt?this.pingedAt:this.startedAt}connectionIsStale(){return o(this.refreshedAt)>this.constructor.staleThreshold}disconnectedRecently(){return this.disconnectedAt&&o(this.disconnectedAt)<this.constructor.staleThreshold}visibilityDidChange(){"visible"===document.visibilityState&&setTimeout((()=>{!this.connectionIsStale()&&this.connection.isOpen()||(i.log(`ConnectionMonitor reopening stale connection on visibilitychange. visibilityState = ${document.visibilityState}`),this.connection.reopen())}),200)}}ConnectionMonitor.staleThreshold=6,ConnectionMonitor.reconnectionBackoffRate=.15;const a=ConnectionMonitor,l={message_types:{welcome:"welcome",disconnect:"disconnect",ping:"ping",confirmation:"confirm_subscription",rejection:"reject_subscription"},disconnect_reasons:{unauthorized:"unauthorized",invalid_request:"invalid_request",server_restart:"server_restart"},default_mount_path:"/cable",protocols:["actioncable-v1-json","actioncable-unsupported"]},{message_types:c,protocols:u}=l,d=u.slice(0,u.length-1),h=[].indexOf;class Connection{constructor(e){this.open=this.open.bind(this),this.consumer=e,this.subscriptions=this.consumer.subscriptions,this.monitor=new a(this),this.disconnected=!0}send(e){return!!this.isOpen()&&(this.webSocket.send(JSON.stringify(e)),!0)}open(){return this.isActive()?(i.log(`Attempted to open WebSocket, but existing socket is ${this.getState()}`),!1):(i.log(`Opening WebSocket, current state is ${this.getState()}, subprotocols: ${u}`),this.webSocket&&this.uninstallEventHandlers(),this.webSocket=new n.WebSocket(this.consumer.url,u),this.installEventHandlers(),this.monitor.start(),!0)}close({allowReconnect:e}={allowReconnect:!0}){if(e||this.monitor.stop(),this.isOpen())return this.webSocket.close()}reopen(){if(i.log(`Reopening WebSocket, current state is ${this.getState()}`),!this.isActive())return this.open();try{return this.close()}catch(e){i.log("Failed to reopen WebSocket",e)}finally{i.log(`Reopening WebSocket in ${this.constructor.reopenDelay}ms`),setTimeout(this.open,this.constructor.reopenDelay)}}getProtocol(){if(this.webSocket)return this.webSocket.protocol}isOpen(){return this.isState("open")}isActive(){return this.isState("open","connecting")}isProtocolSupported(){return h.call(d,this.getProtocol())>=0}isState(...e){return h.call(e,this.getState())>=0}getState(){if(this.webSocket)for(let e in n.WebSocket)if(n.WebSocket[e]===this.webSocket.readyState)return e.toLowerCase();return null}installEventHandlers(){for(let e in this.events){const t=this.events[e].bind(this);this.webSocket[`on${e}`]=t}}uninstallEventHandlers(){for(let e in this.events)this.webSocket[`on${e}`]=function(){}}}Connection.reopenDelay=500,Connection.prototype.events={message(e){if(!this.isProtocolSupported())return;const{identifier:t,message:r,reason:n,reconnect:s,type:o}=JSON.parse(e.data);switch(o){case c.welcome:return this.monitor.recordConnect(),this.subscriptions.reload();case c.disconnect:return i.log(`Disconnecting. Reason: ${n}`),this.close({allowReconnect:s});case c.ping:return this.monitor.recordPing();case c.confirmation:return this.subscriptions.confirmSubscription(t),this.subscriptions.notify(t,"connected");case c.rejection:return this.subscriptions.reject(t);default:return this.subscriptions.notify(t,"received",r)}},open(){if(i.log(`WebSocket onopen event, using '${this.getProtocol()}' subprotocol`),this.disconnected=!1,!this.isProtocolSupported())return i.log("Protocol is unsupported. Stopping monitor and disconnecting."),this.close({allowReconnect:!1})},close(e){if(i.log("WebSocket onclose event"),!this.disconnected)return this.disconnected=!0,this.monitor.recordDisconnect(),this.subscriptions.notifyAll("disconnected",{willAttemptReconnect:this.monitor.isRunning()})},error(){i.log("WebSocket onerror event")}};const p=Connection;class Subscription{constructor(e,t={},r){this.consumer=e,this.identifier=JSON.stringify(t),function(e,t){if(null!=t)for(let r in t){const n=t[r];e[r]=n}}(this,r)}perform(e,t={}){return t.action=e,this.send(t)}send(e){return this.consumer.send({command:"message",identifier:this.identifier,data:JSON.stringify(e)})}unsubscribe(){return this.consumer.subscriptions.remove(this)}}const m=class SubscriptionGuarantor{constructor(e){this.subscriptions=e,this.pendingSubscriptions=[]}guarantee(e){-1==this.pendingSubscriptions.indexOf(e)?(i.log(`SubscriptionGuarantor guaranteeing ${e.identifier}`),this.pendingSubscriptions.push(e)):i.log(`SubscriptionGuarantor already guaranteeing ${e.identifier}`),this.startGuaranteeing()}forget(e){i.log(`SubscriptionGuarantor forgetting ${e.identifier}`),this.pendingSubscriptions=this.pendingSubscriptions.filter((t=>t!==e))}startGuaranteeing(){this.stopGuaranteeing(),this.retrySubscribing()}stopGuaranteeing(){clearTimeout(this.retryTimeout)}retrySubscribing(){this.retryTimeout=setTimeout((()=>{this.subscriptions&&"function"==typeof this.subscriptions.subscribe&&this.pendingSubscriptions.map((e=>{i.log(`SubscriptionGuarantor resubscribing ${e.identifier}`),this.subscriptions.subscribe(e)}))}),500)}};class Subscriptions{constructor(e){this.consumer=e,this.guarantor=new m(this),this.subscriptions=[]}create(e,t){const r="object"==typeof e?e:{channel:e},n=new Subscription(this.consumer,r,t);return this.add(n)}add(e){return this.subscriptions.push(e),this.consumer.ensureActiveConnection(),this.notify(e,"initialized"),this.subscribe(e),e}remove(e){return this.forget(e),this.findAll(e.identifier).length||this.sendCommand(e,"unsubscribe"),e}reject(e){return this.findAll(e).map((e=>(this.forget(e),this.notify(e,"rejected"),e)))}forget(e){return this.guarantor.forget(e),this.subscriptions=this.subscriptions.filter((t=>t!==e)),e}findAll(e){return this.subscriptions.filter((t=>t.identifier===e))}reload(){return this.subscriptions.map((e=>this.subscribe(e)))}notifyAll(e,...t){return this.subscriptions.map((r=>this.notify(r,e,...t)))}notify(e,t,...r){let n;return n="string"==typeof e?this.findAll(e):[e],n.map((e=>"function"==typeof e[t]?e[t](...r):void 0))}subscribe(e){this.sendCommand(e,"subscribe")&&this.guarantor.guarantee(e)}confirmSubscription(e){i.log(`Subscription confirmed ${e}`),this.findAll(e).map((e=>this.guarantor.forget(e)))}sendCommand(e,t){const{identifier:r}=e;return this.consumer.send({command:t,identifier:r})}}class Consumer{constructor(e){this._url=e,this.subscriptions=new Subscriptions(this),this.connection=new p(this)}get url(){return function(e){"function"==typeof e&&(e=e());if(e&&!/^wss?:/i.test(e)){const t=document.createElement("a");return t.href=e,t.href=t.href,t.protocol=t.protocol.replace("http","ws"),t.href}return e}(this._url)}send(e){return this.connection.send(e)}connect(){return this.connection.open()}disconnect(){return this.connection.close({allowReconnect:!1})}ensureActiveConnection(){if(!this.connection.isActive())return this.connection.open()}}function f(e=function(e){const t=document.head.querySelector(`meta[name='action-cable-${e}']`);if(t)return t.getAttribute("content")}("url")||l.default_mount_path){return new Consumer(e)}},74147:(e,t,r)=>{"use strict";r.r(t),r.d(t,{DirectUpload:()=>DirectUpload,DirectUploadController:()=>DirectUploadController,DirectUploadsController:()=>DirectUploadsController,start:()=>m});var n={exports:{}};n.exports=function(e){var t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function r(e,t){var r=e[0],n=e[1],i=e[2],s=e[3];n=((n+=((i=((i+=((s=((s+=((r=((r+=(n&i|~n&s)+t[0]-680876936|0)<<7|r>>>25)+n|0)&n|~r&i)+t[1]-389564586|0)<<12|s>>>20)+r|0)&r|~s&n)+t[2]+606105819|0)<<17|i>>>15)+s|0)&s|~i&r)+t[3]-1044525330|0)<<22|n>>>10)+i|0,n=((n+=((i=((i+=((s=((s+=((r=((r+=(n&i|~n&s)+t[4]-176418897|0)<<7|r>>>25)+n|0)&n|~r&i)+t[5]+1200080426|0)<<12|s>>>20)+r|0)&r|~s&n)+t[6]-1473231341|0)<<17|i>>>15)+s|0)&s|~i&r)+t[7]-45705983|0)<<22|n>>>10)+i|0,n=((n+=((i=((i+=((s=((s+=((r=((r+=(n&i|~n&s)+t[8]+1770035416|0)<<7|r>>>25)+n|0)&n|~r&i)+t[9]-1958414417|0)<<12|s>>>20)+r|0)&r|~s&n)+t[10]-42063|0)<<17|i>>>15)+s|0)&s|~i&r)+t[11]-1990404162|0)<<22|n>>>10)+i|0,n=((n+=((i=((i+=((s=((s+=((r=((r+=(n&i|~n&s)+t[12]+1804603682|0)<<7|r>>>25)+n|0)&n|~r&i)+t[13]-40341101|0)<<12|s>>>20)+r|0)&r|~s&n)+t[14]-1502002290|0)<<17|i>>>15)+s|0)&s|~i&r)+t[15]+1236535329|0)<<22|n>>>10)+i|0,n=((n+=((i=((i+=((s=((s+=((r=((r+=(n&s|i&~s)+t[1]-165796510|0)<<5|r>>>27)+n|0)&i|n&~i)+t[6]-1069501632|0)<<9|s>>>23)+r|0)&n|r&~n)+t[11]+643717713|0)<<14|i>>>18)+s|0)&r|s&~r)+t[0]-373897302|0)<<20|n>>>12)+i|0,n=((n+=((i=((i+=((s=((s+=((r=((r+=(n&s|i&~s)+t[5]-701558691|0)<<5|r>>>27)+n|0)&i|n&~i)+t[10]+38016083|0)<<9|s>>>23)+r|0)&n|r&~n)+t[15]-660478335|0)<<14|i>>>18)+s|0)&r|s&~r)+t[4]-405537848|0)<<20|n>>>12)+i|0,n=((n+=((i=((i+=((s=((s+=((r=((r+=(n&s|i&~s)+t[9]+568446438|0)<<5|r>>>27)+n|0)&i|n&~i)+t[14]-1019803690|0)<<9|s>>>23)+r|0)&n|r&~n)+t[3]-187363961|0)<<14|i>>>18)+s|0)&r|s&~r)+t[8]+1163531501|0)<<20|n>>>12)+i|0,n=((n+=((i=((i+=((s=((s+=((r=((r+=(n&s|i&~s)+t[13]-1444681467|0)<<5|r>>>27)+n|0)&i|n&~i)+t[2]-51403784|0)<<9|s>>>23)+r|0)&n|r&~n)+t[7]+1735328473|0)<<14|i>>>18)+s|0)&r|s&~r)+t[12]-1926607734|0)<<20|n>>>12)+i|0,n=((n+=((i=((i+=((s=((s+=((r=((r+=(n^i^s)+t[5]-378558|0)<<4|r>>>28)+n|0)^n^i)+t[8]-2022574463|0)<<11|s>>>21)+r|0)^r^n)+t[11]+1839030562|0)<<16|i>>>16)+s|0)^s^r)+t[14]-35309556|0)<<23|n>>>9)+i|0,n=((n+=((i=((i+=((s=((s+=((r=((r+=(n^i^s)+t[1]-1530992060|0)<<4|r>>>28)+n|0)^n^i)+t[4]+1272893353|0)<<11|s>>>21)+r|0)^r^n)+t[7]-155497632|0)<<16|i>>>16)+s|0)^s^r)+t[10]-1094730640|0)<<23|n>>>9)+i|0,n=((n+=((i=((i+=((s=((s+=((r=((r+=(n^i^s)+t[13]+681279174|0)<<4|r>>>28)+n|0)^n^i)+t[0]-358537222|0)<<11|s>>>21)+r|0)^r^n)+t[3]-722521979|0)<<16|i>>>16)+s|0)^s^r)+t[6]+76029189|0)<<23|n>>>9)+i|0,n=((n+=((i=((i+=((s=((s+=((r=((r+=(n^i^s)+t[9]-640364487|0)<<4|r>>>28)+n|0)^n^i)+t[12]-421815835|0)<<11|s>>>21)+r|0)^r^n)+t[15]+530742520|0)<<16|i>>>16)+s|0)^s^r)+t[2]-995338651|0)<<23|n>>>9)+i|0,n=((n+=((s=((s+=(n^((r=((r+=(i^(n|~s))+t[0]-198630844|0)<<6|r>>>26)+n|0)|~i))+t[7]+1126891415|0)<<10|s>>>22)+r|0)^((i=((i+=(r^(s|~n))+t[14]-1416354905|0)<<15|i>>>17)+s|0)|~r))+t[5]-57434055|0)<<21|n>>>11)+i|0,n=((n+=((s=((s+=(n^((r=((r+=(i^(n|~s))+t[12]+1700485571|0)<<6|r>>>26)+n|0)|~i))+t[3]-1894986606|0)<<10|s>>>22)+r|0)^((i=((i+=(r^(s|~n))+t[10]-1051523|0)<<15|i>>>17)+s|0)|~r))+t[1]-2054922799|0)<<21|n>>>11)+i|0,n=((n+=((s=((s+=(n^((r=((r+=(i^(n|~s))+t[8]+1873313359|0)<<6|r>>>26)+n|0)|~i))+t[15]-30611744|0)<<10|s>>>22)+r|0)^((i=((i+=(r^(s|~n))+t[6]-1560198380|0)<<15|i>>>17)+s|0)|~r))+t[13]+1309151649|0)<<21|n>>>11)+i|0,n=((n+=((s=((s+=(n^((r=((r+=(i^(n|~s))+t[4]-145523070|0)<<6|r>>>26)+n|0)|~i))+t[11]-1120210379|0)<<10|s>>>22)+r|0)^((i=((i+=(r^(s|~n))+t[2]+718787259|0)<<15|i>>>17)+s|0)|~r))+t[9]-343485551|0)<<21|n>>>11)+i|0,e[0]=r+e[0]|0,e[1]=n+e[1]|0,e[2]=i+e[2]|0,e[3]=s+e[3]|0}function n(e){var t,r=[];for(t=0;t<64;t+=4)r[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return r}function i(e){var t,r=[];for(t=0;t<64;t+=4)r[t>>2]=e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24);return r}function s(e){var t,i,s,o,a,l,c=e.length,u=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=c;t+=64)r(u,n(e.substring(t-64,t)));for(i=(e=e.substring(t-64)).length,s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;t<i;t+=1)s[t>>2]|=e.charCodeAt(t)<<(t%4<<3);if(s[t>>2]|=128<<(t%4<<3),t>55)for(r(u,s),t=0;t<16;t+=1)s[t]=0;return o=(o=8*c).toString(16).match(/(.*?)(.{0,8})$/),a=parseInt(o[2],16),l=parseInt(o[1],16)||0,s[14]=a,s[15]=l,r(u,s),u}function o(e){var t,n,s,o,a,l,c=e.length,u=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=c;t+=64)r(u,i(e.subarray(t-64,t)));for(n=(e=t-64<c?e.subarray(t-64):new Uint8Array(0)).length,s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;t<n;t+=1)s[t>>2]|=e[t]<<(t%4<<3);if(s[t>>2]|=128<<(t%4<<3),t>55)for(r(u,s),t=0;t<16;t+=1)s[t]=0;return o=(o=8*c).toString(16).match(/(.*?)(.{0,8})$/),a=parseInt(o[2],16),l=parseInt(o[1],16)||0,s[14]=a,s[15]=l,r(u,s),u}function a(e){var r,n="";for(r=0;r<4;r+=1)n+=t[e>>8*r+4&15]+t[e>>8*r&15];return n}function l(e){var t;for(t=0;t<e.length;t+=1)e[t]=a(e[t]);return e.join("")}function c(e){return/[\u0080-\uFFFF]/.test(e)&&(e=unescape(encodeURIComponent(e))),e}function u(e,t){var r,n=e.length,i=new ArrayBuffer(n),s=new Uint8Array(i);for(r=0;r<n;r+=1)s[r]=e.charCodeAt(r);return t?s:i}function d(e){return String.fromCharCode.apply(null,new Uint8Array(e))}function h(e,t,r){var n=new Uint8Array(e.byteLength+t.byteLength);return n.set(new Uint8Array(e)),n.set(new Uint8Array(t),e.byteLength),r?n:n.buffer}function p(e){var t,r=[],n=e.length;for(t=0;t<n-1;t+=2)r.push(parseInt(e.substr(t,2),16));return String.fromCharCode.apply(String,r)}function SparkMD52(){this.reset()}return l(s("hello")),"undefined"==typeof ArrayBuffer||ArrayBuffer.prototype.slice||function(){function t(e,t){return(e=0|e||0)<0?Math.max(e+t,0):Math.min(e,t)}ArrayBuffer.prototype.slice=function(r,n){var i,s,o,a,l=this.byteLength,c=t(r,l),u=l;return n!==e&&(u=t(n,l)),c>u?new ArrayBuffer(0):(i=u-c,s=new ArrayBuffer(i),o=new Uint8Array(s),a=new Uint8Array(this,c,i),o.set(a),s)}}(),SparkMD52.prototype.append=function(e){return this.appendBinary(c(e)),this},SparkMD52.prototype.appendBinary=function(e){this._buff+=e,this._length+=e.length;var t,i=this._buff.length;for(t=64;t<=i;t+=64)r(this._hash,n(this._buff.substring(t-64,t)));return this._buff=this._buff.substring(t-64),this},SparkMD52.prototype.end=function(e){var t,r,n=this._buff,i=n.length,s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<i;t+=1)s[t>>2]|=n.charCodeAt(t)<<(t%4<<3);return this._finish(s,i),r=l(this._hash),e&&(r=p(r)),this.reset(),r},SparkMD52.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},SparkMD52.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},SparkMD52.prototype.setState=function(e){return this._buff=e.buff,this._length=e.length,this._hash=e.hash,this},SparkMD52.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},SparkMD52.prototype._finish=function(e,t){var n,i,s,o=t;if(e[o>>2]|=128<<(o%4<<3),o>55)for(r(this._hash,e),o=0;o<16;o+=1)e[o]=0;n=(n=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),i=parseInt(n[2],16),s=parseInt(n[1],16)||0,e[14]=i,e[15]=s,r(this._hash,e)},SparkMD52.hash=function(e,t){return SparkMD52.hashBinary(c(e),t)},SparkMD52.hashBinary=function(e,t){var r=l(s(e));return t?p(r):r},SparkMD52.ArrayBuffer=function(){this.reset()},SparkMD52.ArrayBuffer.prototype.append=function(e){var t,n=h(this._buff.buffer,e,!0),s=n.length;for(this._length+=e.byteLength,t=64;t<=s;t+=64)r(this._hash,i(n.subarray(t-64,t)));return this._buff=t-64<s?new Uint8Array(n.buffer.slice(t-64)):new Uint8Array(0),this},SparkMD52.ArrayBuffer.prototype.end=function(e){var t,r,n=this._buff,i=n.length,s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<i;t+=1)s[t>>2]|=n[t]<<(t%4<<3);return this._finish(s,i),r=l(this._hash),e&&(r=p(r)),this.reset(),r},SparkMD52.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},SparkMD52.ArrayBuffer.prototype.getState=function(){var e=SparkMD52.prototype.getState.call(this);return e.buff=d(e.buff),e},SparkMD52.ArrayBuffer.prototype.setState=function(e){return e.buff=u(e.buff,!0),SparkMD52.prototype.setState.call(this,e)},SparkMD52.ArrayBuffer.prototype.destroy=SparkMD52.prototype.destroy,SparkMD52.ArrayBuffer.prototype._finish=SparkMD52.prototype._finish,SparkMD52.ArrayBuffer.hash=function(e,t){var r=l(o(new Uint8Array(e)));return t?p(r):r},SparkMD52}();var i=n.exports;const s=File.prototype.slice||File.prototype.mozSlice||File.prototype.webkitSlice;class FileChecksum{static create(e,t){new FileChecksum(e).create(t)}constructor(e){this.file=e,this.chunkSize=2097152,this.chunkCount=Math.ceil(this.file.size/this.chunkSize),this.chunkIndex=0}create(e){this.callback=e,this.md5Buffer=new i.ArrayBuffer,this.fileReader=new FileReader,this.fileReader.addEventListener("load",(e=>this.fileReaderDidLoad(e))),this.fileReader.addEventListener("error",(e=>this.fileReaderDidError(e))),this.readNextChunk()}fileReaderDidLoad(e){if(this.md5Buffer.append(e.target.result),!this.readNextChunk()){const e=this.md5Buffer.end(!0),t=btoa(e);this.callback(null,t)}}fileReaderDidError(e){this.callback(`Error reading ${this.file.name}`)}readNextChunk(){if(this.chunkIndex<this.chunkCount||0==this.chunkIndex&&0==this.chunkCount){const e=this.chunkIndex*this.chunkSize,t=Math.min(e+this.chunkSize,this.file.size),r=s.call(this.file,e,t);return this.fileReader.readAsArrayBuffer(r),this.chunkIndex++,!0}return!1}}function o(e,t){return"string"==typeof e&&(t=e,e=document),e.querySelector(t)}function a(e,t,r={}){const{disabled:n}=e,{bubbles:i,cancelable:s,detail:o}=r,a=document.createEvent("Event");a.initEvent(t,i||!0,s||!0),a.detail=o||{};try{e.disabled=!1,e.dispatchEvent(a)}finally{e.disabled=n}return a}function l(e){return Array.isArray(e)?e:Array.from?Array.from(e):[].slice.call(e)}class BlobRecord{constructor(e,t,r,n={}){this.file=e,this.attributes={filename:e.name,content_type:e.type||"application/octet-stream",byte_size:e.size,checksum:t},this.xhr=new XMLHttpRequest,this.xhr.open("POST",r,!0),this.xhr.responseType="json",this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.setRequestHeader("Accept","application/json"),this.xhr.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(n).forEach((e=>{this.xhr.setRequestHeader(e,n[e])}));const i=function(e){const t=o(document.head,`meta[name="${e}"]`);if(t)return t.getAttribute("content")}("csrf-token");null!=i&&this.xhr.setRequestHeader("X-CSRF-Token",i),this.xhr.addEventListener("load",(e=>this.requestDidLoad(e))),this.xhr.addEventListener("error",(e=>this.requestDidError(e)))}get status(){return this.xhr.status}get response(){const{responseType:e,response:t}=this.xhr;return"json"==e?t:JSON.parse(t)}create(e){this.callback=e,this.xhr.send(JSON.stringify({blob:this.attributes}))}requestDidLoad(e){if(this.status>=200&&this.status<300){const{response:e}=this,{direct_upload:t}=e;delete e.direct_upload,this.attributes=e,this.directUploadData=t,this.callback(null,this.toJSON())}else this.requestDidError(e)}requestDidError(e){this.callback(`Error creating Blob for "${this.file.name}". Status: ${this.status}`)}toJSON(){const e={};for(const t in this.attributes)e[t]=this.attributes[t];return e}}class BlobUpload{constructor(e){this.blob=e,this.file=e.file;const{url:t,headers:r}=e.directUploadData;this.xhr=new XMLHttpRequest,this.xhr.open("PUT",t,!0),this.xhr.responseType="text";for(const e in r)this.xhr.setRequestHeader(e,r[e]);this.xhr.addEventListener("load",(e=>this.requestDidLoad(e))),this.xhr.addEventListener("error",(e=>this.requestDidError(e)))}create(e){this.callback=e,this.xhr.send(this.file.slice())}requestDidLoad(e){const{status:t,response:r}=this.xhr;t>=200&&t<300?this.callback(null,r):this.requestDidError(e)}requestDidError(e){this.callback(`Error storing "${this.file.name}". Status: ${this.xhr.status}`)}}let c=0;class DirectUpload{constructor(e,t,r,n={}){this.id=++c,this.file=e,this.url=t,this.delegate=r,this.customHeaders=n}create(e){FileChecksum.create(this.file,((t,r)=>{if(t)return void e(t);const n=new BlobRecord(this.file,r,this.url,this.customHeaders);u(this.delegate,"directUploadWillCreateBlobWithXHR",n.xhr),n.create((t=>{if(t)e(t);else{const t=new BlobUpload(n);u(this.delegate,"directUploadWillStoreFileWithXHR",t.xhr),t.create((t=>{t?e(t):e(null,n.toJSON())}))}}))}))}}function u(e,t,...r){if(e&&"function"==typeof e[t])return e[t](...r)}class DirectUploadController{constructor(e,t){this.input=e,this.file=t,this.directUpload=new DirectUpload(this.file,this.url,this),this.dispatch("initialize")}start(e){const t=document.createElement("input");t.type="hidden",t.name=this.input.name,this.input.insertAdjacentElement("beforebegin",t),this.dispatch("start"),this.directUpload.create(((r,n)=>{r?(t.parentNode.removeChild(t),this.dispatchError(r)):t.value=n.signed_id,this.dispatch("end"),e(r)}))}uploadRequestDidProgress(e){const t=e.loaded/e.total*100;t&&this.dispatch("progress",{progress:t})}get url(){return this.input.getAttribute("data-direct-upload-url")}dispatch(e,t={}){return t.file=this.file,t.id=this.directUpload.id,a(this.input,`direct-upload:${e}`,{detail:t})}dispatchError(e){this.dispatch("error",{error:e}).defaultPrevented||alert(e)}directUploadWillCreateBlobWithXHR(e){this.dispatch("before-blob-request",{xhr:e})}directUploadWillStoreFileWithXHR(e){this.dispatch("before-storage-request",{xhr:e}),e.upload.addEventListener("progress",(e=>this.uploadRequestDidProgress(e)))}}class DirectUploadsController{constructor(e){var t,r;this.form=e,this.inputs=(t=e,r="input[type=file][data-direct-upload-url]:not([disabled])","string"==typeof t&&(r=t,t=document),l(t.querySelectorAll(r))).filter((e=>e.files.length))}start(e){const t=this.createDirectUploadControllers(),r=()=>{const n=t.shift();n?n.start((t=>{t?(e(t),this.dispatch("end")):r()})):(e(),this.dispatch("end"))};this.dispatch("start"),r()}createDirectUploadControllers(){const e=[];return this.inputs.forEach((t=>{l(t.files).forEach((r=>{const n=new DirectUploadController(t,r);e.push(n)}))})),e}dispatch(e,t={}){return a(this.form,`direct-uploads:${e}`,{detail:t})}}const d="data-direct-uploads-processing",h=new WeakMap;let p=!1;function m(){p||(p=!0,document.addEventListener("click",f,!0),document.addEventListener("submit",g,!0),document.addEventListener("ajax:before",y))}function f(e){const t=e.target.closest("button, input");t&&"submit"===t.type&&t.form&&h.set(t.form,t)}function g(e){b(e)}function y(e){"FORM"==e.target.tagName&&b(e)}function b(e){const t=e.target;if(t.hasAttribute(d))return void e.preventDefault();const r=new DirectUploadsController(t),{inputs:n}=r;n.length&&(e.preventDefault(),t.setAttribute(d,""),n.forEach(v),r.start((e=>{t.removeAttribute(d),e?n.forEach(_):function(e){let t=h.get(e)||o(e,"input[type=submit], button[type=submit]");if(t){const{disabled:e}=t;t.disabled=!1,t.focus(),t.click(),t.disabled=e}else t=document.createElement("input"),t.type="submit",t.style.display="none",e.appendChild(t),t.click(),e.removeChild(t);h.delete(e)}(t)})))}function v(e){e.disabled=!0}function _(e){e.disabled=!1}setTimeout((function(){window.ActiveStorage&&m()}),1)},54843:e=>{"use strict";e.exports=function(e){var t,r,n,i=e.length,s=0;for(t=0;t<i;++t)s+=e[t].length;var o=new Array(s),a=0;for(t=0;t<i;++t){var l=e[t],c=l.length;for(r=0;r<c;++r){var u=o[a++]=new Array(c-1),d=0;for(n=0;n<c;++n)n!==r&&(u[d++]=l[n]);if(1&r){var h=u[1];u[1]=u[0],u[0]=h}}}return o}},37462:function(e){e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=90)}({17:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n=r(18),i=function(){function e(){}return e.getFirstMatch=function(e,t){var r=t.match(e);return r&&r.length>0&&r[1]||""},e.getSecondMatch=function(e,t){var r=t.match(e);return r&&r.length>1&&r[2]||""},e.matchAndReturnConst=function(e,t,r){if(e.test(t))return r},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,r,n){void 0===n&&(n=!1);var i=e.getVersionPrecision(t),s=e.getVersionPrecision(r),o=Math.max(i,s),a=0,l=e.map([t,r],(function(t){var r=o-e.getVersionPrecision(t),n=t+new Array(r+1).join(".0");return e.map(n.split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));for(n&&(a=o-Math.min(i,s)),o-=1;o>=a;){if(l[0][o]>l[1][o])return 1;if(l[0][o]===l[1][o]){if(o===a)return 0;o-=1}else if(l[0][o]<l[1][o])return-1}},e.map=function(e,t){var r,n=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(r=0;r<e.length;r+=1)n.push(t(e[r]));return n},e.find=function(e,t){var r,n;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(r=0,n=e.length;r<n;r+=1){var i=e[r];if(t(i,r))return i}},e.assign=function(e){for(var t,r,n=e,i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];if(Object.assign)return Object.assign.apply(Object,[e].concat(s));var a=function(){var e=s[t];"object"==typeof e&&null!==e&&Object.keys(e).forEach((function(t){n[t]=e[t]}))};for(t=0,r=s.length;t<r;t+=1)a();return e},e.getBrowserAlias=function(e){return n.BROWSER_ALIASES_MAP[e]},e.getBrowserTypeByAlias=function(e){return n.BROWSER_MAP[e]||""},e}();t.default=i,e.exports=t.default},18:function(e,t,r){"use strict";t.__esModule=!0,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0,t.BROWSER_ALIASES_MAP={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},t.BROWSER_MAP={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},t.PLATFORMS_MAP={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},t.OS_MAP={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},t.ENGINE_MAP={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"}},90:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(91))&&n.__esModule?n:{default:n},s=r(18);function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var a=function(){function e(){}var t,r,n;return e.getParser=function(e,t){if(void 0===t&&(t=!1),"string"!=typeof e)throw new Error("UserAgent should be a string");return new i.default(e,t)},e.parse=function(e){return new i.default(e).getResult()},t=e,n=[{key:"BROWSER_MAP",get:function(){return s.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return s.ENGINE_MAP}},{key:"OS_MAP",get:function(){return s.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return s.PLATFORMS_MAP}}],(r=null)&&o(t.prototype,r),n&&o(t,n),e}();t.default=a,e.exports=t.default},91:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n=l(r(92)),i=l(r(93)),s=l(r(94)),o=l(r(95)),a=l(r(17));function l(e){return e&&e.__esModule?e:{default:e}}var c=function(){function e(e,t){if(void 0===t&&(t=!1),null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}var t=e.prototype;return t.getUA=function(){return this._ua},t.test=function(e){return e.test(this._ua)},t.parseBrowser=function(){var e=this;this.parsedResult.browser={};var t=a.default.find(n.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser},t.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},t.getBrowserName=function(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},t.getBrowserVersion=function(){return this.getBrowser().version},t.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},t.parseOS=function(){var e=this;this.parsedResult.os={};var t=a.default.find(i.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os},t.getOSName=function(e){var t=this.getOS().name;return e?String(t).toLowerCase()||"":t||""},t.getOSVersion=function(){return this.getOS().version},t.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},t.getPlatformType=function(e){void 0===e&&(e=!1);var t=this.getPlatform().type;return e?String(t).toLowerCase()||"":t||""},t.parsePlatform=function(){var e=this;this.parsedResult.platform={};var t=a.default.find(s.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform},t.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},t.getEngineName=function(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},t.parseEngine=function(){var e=this;this.parsedResult.engine={};var t=a.default.find(o.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine},t.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},t.getResult=function(){return a.default.assign({},this.parsedResult)},t.satisfies=function(e){var t=this,r={},n=0,i={},s=0;if(Object.keys(e).forEach((function(t){var o=e[t];"string"==typeof o?(i[t]=o,s+=1):"object"==typeof o&&(r[t]=o,n+=1)})),n>0){var o=Object.keys(r),l=a.default.find(o,(function(e){return t.isOS(e)}));if(l){var c=this.satisfies(r[l]);if(void 0!==c)return c}var u=a.default.find(o,(function(e){return t.isPlatform(e)}));if(u){var d=this.satisfies(r[u]);if(void 0!==d)return d}}if(s>0){var h=Object.keys(i),p=a.default.find(h,(function(e){return t.isBrowser(e,!0)}));if(void 0!==p)return this.compareVersion(i[p])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var r=this.getBrowserName().toLowerCase(),n=e.toLowerCase(),i=a.default.getBrowserTypeByAlias(n);return t&&i&&(n=i.toLowerCase()),n===r},t.compareVersion=function(e){var t=[0],r=e,n=!1,i=this.getBrowserVersion();if("string"==typeof i)return">"===e[0]||"<"===e[0]?(r=e.substr(1),"="===e[1]?(n=!0,r=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?r=e.substr(1):"~"===e[0]&&(n=!0,r=e.substr(1)),t.indexOf(a.default.compareVersions(i,r,n))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e}();t.default=c,e.exports=t.default},92:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},s=/version\/(\d+(\.?_?\d+)+)/i,o=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},r=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},r=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},r=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},r=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},r=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},r=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},r=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},r=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},r=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},r=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},r=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},r=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},r=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},r=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},r=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return r&&(t.version=r),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},r=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},r=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},r=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},r=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},r=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},r=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},r=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},r=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},r=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},r=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},r=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},r=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){var t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe:function(e){var t={name:"Android Browser"},r=i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},r=i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},r=i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:i.default.getFirstMatch(t,e),version:i.default.getSecondMatch(t,e)}}}];t.default=o,e.exports=t.default},93:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},s=r(18),o=[{test:[/Roku\/DVP/],describe:function(e){var t=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:s.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:s.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),r=i.default.getWindowsVersionName(t);return{name:s.OS_MAP.Windows,version:t,versionName:r}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:s.OS_MAP.iOS},r=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return r&&(t.version=r),t}},{test:[/macintosh/i],describe:function(e){var t=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),r=i.default.getMacOSVersionName(t),n={name:s.OS_MAP.MacOS,version:t};return r&&(n.versionName=r),n}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:s.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe:function(e){var t=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),r=i.default.getAndroidVersionName(t),n={name:s.OS_MAP.Android,version:t};return r&&(n.versionName=r),n}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),r={name:s.OS_MAP.WebOS};return t&&t.length&&(r.version=t),r}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||i.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:s.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:s.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:s.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:s.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:s.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:s.OS_MAP.PlayStation4,version:t}}}];t.default=o,e.exports=t.default},94:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},s=r(18),o=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=i.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",r={type:s.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(r.model=t),r}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),r=e.test(/like (ipod|iphone)/i);return t&&!r},describe:function(e){var t=i.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:s.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:s.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.tv}}}];t.default=o,e.exports=t.default},95:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},s=r(18),o=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:s.ENGINE_MAP.Blink};var t=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:s.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:s.ENGINE_MAP.Trident},r=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:s.ENGINE_MAP.Presto},r=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){var t=e.test(/gecko/i),r=e.test(/like gecko/i);return t&&!r},describe:function(e){var t={name:s.ENGINE_MAP.Gecko},r=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:s.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:s.ENGINE_MAP.WebKit},r=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}}];t.default=o,e.exports=t.default}})},51281:(e,t,r)=>{"use strict";var n=r(77664),i=r(84481),s=i(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&s(e,".prototype.")>-1?i(r):r}},84481:(e,t,r)=>{"use strict";var n=r(5905),i=r(77664),s=r(39271),o=r(58921),a=i("%Function.prototype.apply%"),l=i("%Function.prototype.call%"),c=i("%Reflect.apply%",!0)||n.call(l,a),u=r(7905),d=i("%Math.max%");e.exports=function(e){if("function"!=typeof e)throw new o("a function is required");var t=c(n,l,arguments);return s(t,1+d(0,e.length-(arguments.length-1)),!0)};var h=function(){return c(n,a,arguments)};u?u(e.exports,"apply",{value:h}):e.exports.apply=h},52695:(e,t,r)=>{const n=r(15556);t.parseFont=n,t.createCanvas=function(e,t){return Object.assign(document.createElement("canvas"),{width:e,height:t})},t.createImageData=function(e,t,r){switch(arguments.length){case 0:return new ImageData;case 1:return new ImageData(e);case 2:return new ImageData(e,t);default:return new ImageData(e,t,r)}},t.loadImage=function(e,t){return new Promise((function(r,n){const i=Object.assign(document.createElement("img"),t);function s(){i.onload=null,i.onerror=null}i.onload=function(){s(),r(i)},i.onerror=function(){s(),n(new Error('Failed to load the image "'+e+'"'))},i.src=e}))}},15556:e=>{"use strict";const t="'([^']+)'|\"([^\"]+)\"|[\\w\\s-]+",r=new RegExp("(bold|bolder|lighter|[1-9]00) +","i"),n=new RegExp("(italic|oblique) +","i"),i=new RegExp("(small-caps) +","i"),s=new RegExp("(ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded) +","i"),o=new RegExp(`([\\d\\.]+)(px|pt|pc|in|cm|mm|%|em|ex|ch|rem|q) *((?:${t})( *, *(?:${t}))*)`),a={};e.exports=e=>{if(a[e])return a[e];const t=o.exec(e);if(!t)return;const l={weight:"normal",style:"normal",stretch:"normal",variant:"normal",size:parseFloat(t[1]),unit:t[2],family:t[3].replace(/["']/g,"").replace(/ *, */g,",")};let c,u,d,h;const p=e.substring(0,t.index);switch((c=r.exec(p))&&(l.weight=c[1]),(u=n.exec(p))&&(l.style=u[1]),(d=i.exec(p))&&(l.variant=d[1]),(h=s.exec(p))&&(l.stretch=h[1]),l.unit){case"pt":l.size/=.75;break;case"pc":l.size*=16;break;case"in":l.size*=96;break;case"cm":l.size*=96/2.54;break;case"mm":l.size*=96/25.4;break;case"%":break;case"em":case"rem":l.size*=16/.75;break;case"q":l.size*=96/25.4/4}return a[e]=l}},84306:e=>{"use strict";e.exports=function(e){for(var t=1,r=1;r<e.length;++r)for(var n=0;n<r;++n)if(e[r]<e[n])t=-t;else if(e[n]===e[r])return 0;return t}},78035:(e,t)=>{var r;!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var s=typeof r;if("string"===s||"number"===s)e.push(r);else if(Array.isArray(r)){if(r.length){var o=i.apply(null,r);o&&e.push(o)}}else if("object"===s){if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]")){e.push(r.toString());continue}for(var a in r)n.call(r,a)&&r[a]&&e.push(a)}}}return e.join(" ")}e.exports?(i.default=i,e.exports=i):void 0===(r=function(){return i}.apply(t,[]))||(e.exports=r)}()},70630:e=>{e.exports=function(e,n){var i=e.length,s=e.length-n.length;if(s)return s;switch(i){case 0:return 0;case 1:return e[0]-n[0];case 2:return e[0]+e[1]-n[0]-n[1]||t(e[0],e[1])-t(n[0],n[1]);case 3:var o=e[0]+e[1],a=n[0]+n[1];if(s=o+e[2]-(a+n[2]))return s;var l=t(e[0],e[1]),c=t(n[0],n[1]);return t(l,e[2])-t(c,n[2])||t(l+e[2],o)-t(c+n[2],a);case 4:var u=e[0],d=e[1],h=e[2],p=e[3],m=n[0],f=n[1],g=n[2],y=n[3];return u+d+h+p-(m+f+g+y)||t(u,d,h,p)-t(m,f,g,y,m)||t(u+d,u+h,u+p,d+h,d+p,h+p)-t(m+f,m+g,m+y,f+g,f+y,g+y)||t(u+d+h,u+d+p,u+h+p,d+h+p)-t(m+f+g,m+f+y,m+g+y,f+g+y);default:for(var b=e.slice().sort(r),v=n.slice().sort(r),_=0;_<i;++_)if(s=b[_]-v[_])return s;return 0}};var t=Math.min;function r(e,t){return e-t}},52991:(e,t,r)=>{"use strict";var n=r(70630),i=r(84306);e.exports=function(e,t){return n(e,t)||i(e)-i(t)}},76926:function(e,t){var r;!function(n){"use strict";var i=Math.cosh||function(e){return Math.abs(e)<1e-9?1-e:.5*(Math.exp(e)+Math.exp(-e))},s=Math.sinh||function(e){return Math.abs(e)<1e-9?e:.5*(Math.exp(e)-Math.exp(-e))},o=function(){throw SyntaxError("Invalid Param")};function a(e,t){var r=Math.abs(e),n=Math.abs(t);return 0===e?Math.log(n):0===t?Math.log(r):r<3e3&&n<3e3?.5*Math.log(e*e+t*t):(e/=2,t/=2,.5*Math.log(e*e+t*t)+Math.LN2)}function Complex(e,t){if(!(this instanceof Complex))return new Complex(e,t);var r=function(e,t){var r={re:0,im:0};if(null==e)r.re=r.im=0;else if(void 0!==t)r.re=e,r.im=t;else switch(typeof e){case"object":if("im"in e&&"re"in e)r.re=e.re,r.im=e.im;else if("abs"in e&&"arg"in e){if(!Number.isFinite(e.abs)&&Number.isFinite(e.arg))return Complex.INFINITY;r.re=e.abs*Math.cos(e.arg),r.im=e.abs*Math.sin(e.arg)}else if("r"in e&&"phi"in e){if(!Number.isFinite(e.r)&&Number.isFinite(e.phi))return Complex.INFINITY;r.re=e.r*Math.cos(e.phi),r.im=e.r*Math.sin(e.phi)}else 2===e.length?(r.re=e[0],r.im=e[1]):o();break;case"string":r.im=r.re=0;var n=e.match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),i=1,s=0;null===n&&o();for(var a=0;a<n.length;a++){var l=n[a];" "===l||"\t"===l||"\n"===l||("+"===l?i++:"-"===l?s++:"i"===l||"I"===l?(i+s===0&&o()," "===n[a+1]||isNaN(n[a+1])?r.im+=parseFloat((s%2?"-":"")+"1"):(r.im+=parseFloat((s%2?"-":"")+n[a+1]),a++),i=s=0):((i+s===0||isNaN(l))&&o(),"i"===n[a+1]||"I"===n[a+1]?(r.im+=parseFloat((s%2?"-":"")+l),a++):r.re+=parseFloat((s%2?"-":"")+l),i=s=0))}i+s>0&&o();break;case"number":r.im=0,r.re=e;break;default:o()}return isNaN(r.re)||isNaN(r.im),r}(e,t);this.re=r.re,this.im=r.im}Complex.prototype={re:0,im:0,sign:function(){var e=this.abs();return new Complex(this.re/e,this.im/e)},add:function(e,t){var r=new Complex(e,t);return this.isInfinite()&&r.isInfinite()?Complex.NAN:this.isInfinite()||r.isInfinite()?Complex.INFINITY:new Complex(this.re+r.re,this.im+r.im)},sub:function(e,t){var r=new Complex(e,t);return this.isInfinite()&&r.isInfinite()?Complex.NAN:this.isInfinite()||r.isInfinite()?Complex.INFINITY:new Complex(this.re-r.re,this.im-r.im)},mul:function(e,t){var r=new Complex(e,t);return this.isInfinite()&&r.isZero()||this.isZero()&&r.isInfinite()?Complex.NAN:this.isInfinite()||r.isInfinite()?Complex.INFINITY:0===r.im&&0===this.im?new Complex(this.re*r.re,0):new Complex(this.re*r.re-this.im*r.im,this.re*r.im+this.im*r.re)},div:function(e,t){var r=new Complex(e,t);if(this.isZero()&&r.isZero()||this.isInfinite()&&r.isInfinite())return Complex.NAN;if(this.isInfinite()||r.isZero())return Complex.INFINITY;if(this.isZero()||r.isInfinite())return Complex.ZERO;e=this.re,t=this.im;var n,i,s=r.re,o=r.im;return 0===o?new Complex(e/s,t/s):Math.abs(s)<Math.abs(o)?new Complex((e*(i=s/o)+t)/(n=s*i+o),(t*i-e)/n):new Complex((e+t*(i=o/s))/(n=o*i+s),(t-e*i)/n)},pow:function(e,t){var r=new Complex(e,t);if(e=this.re,t=this.im,r.isZero())return Complex.ONE;if(0===r.im){if(0===t&&e>0)return new Complex(Math.pow(e,r.re),0);if(0===e)switch((r.re%4+4)%4){case 0:return new Complex(Math.pow(t,r.re),0);case 1:return new Complex(0,Math.pow(t,r.re));case 2:return new Complex(-Math.pow(t,r.re),0);case 3:return new Complex(0,-Math.pow(t,r.re))}}if(0===e&&0===t&&r.re>0&&r.im>=0)return Complex.ZERO;var n=Math.atan2(t,e),i=a(e,t);return e=Math.exp(r.re*i-r.im*n),t=r.im*i+r.re*n,new Complex(e*Math.cos(t),e*Math.sin(t))},sqrt:function(){var e,t,r=this.re,n=this.im,i=this.abs();if(r>=0){if(0===n)return new Complex(Math.sqrt(r),0);e=.5*Math.sqrt(2*(i+r))}else e=Math.abs(n)/Math.sqrt(2*(i-r));return t=r<=0?.5*Math.sqrt(2*(i-r)):Math.abs(n)/Math.sqrt(2*(i+r)),new Complex(e,n<0?-t:t)},exp:function(){var e=Math.exp(this.re);return this.im,new Complex(e*Math.cos(this.im),e*Math.sin(this.im))},expm1:function(){var e=this.re,t=this.im;return new Complex(Math.expm1(e)*Math.cos(t)+function(e){var t=Math.PI/4;if(-t>e||e>t)return Math.cos(e)-1;var r=e*e;return r*(r*(r*(r*(r*(r*(r*(r/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-.5)}(t),Math.exp(e)*Math.sin(t))},log:function(){var e=this.re,t=this.im;return new Complex(a(e,t),Math.atan2(t,e))},abs:function(){return e=this.re,t=this.im,r=Math.abs(e),n=Math.abs(t),r<3e3&&n<3e3?Math.sqrt(r*r+n*n):(r<n?(r=n,n=e/t):n=t/e,r*Math.sqrt(1+n*n));var e,t,r,n},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){var e=this.re,t=this.im;return new Complex(Math.sin(e)*i(t),Math.cos(e)*s(t))},cos:function(){var e=this.re,t=this.im;return new Complex(Math.cos(e)*i(t),-Math.sin(e)*s(t))},tan:function(){var e=2*this.re,t=2*this.im,r=Math.cos(e)+i(t);return new Complex(Math.sin(e)/r,s(t)/r)},cot:function(){var e=2*this.re,t=2*this.im,r=Math.cos(e)-i(t);return new Complex(-Math.sin(e)/r,s(t)/r)},sec:function(){var e=this.re,t=this.im,r=.5*i(2*t)+.5*Math.cos(2*e);return new Complex(Math.cos(e)*i(t)/r,Math.sin(e)*s(t)/r)},csc:function(){var e=this.re,t=this.im,r=.5*i(2*t)-.5*Math.cos(2*e);return new Complex(Math.sin(e)*i(t)/r,-Math.cos(e)*s(t)/r)},asin:function(){var e=this.re,t=this.im,r=new Complex(t*t-e*e+1,-2*e*t).sqrt(),n=new Complex(r.re-t,r.im+e).log();return new Complex(n.im,-n.re)},acos:function(){var e=this.re,t=this.im,r=new Complex(t*t-e*e+1,-2*e*t).sqrt(),n=new Complex(r.re-t,r.im+e).log();return new Complex(Math.PI/2-n.im,n.re)},atan:function(){var e=this.re,t=this.im;if(0===e){if(1===t)return new Complex(0,1/0);if(-1===t)return new Complex(0,-1/0)}var r=e*e+(1-t)*(1-t),n=new Complex((1-t*t-e*e)/r,-2*e/r).log();return new Complex(-.5*n.im,.5*n.re)},acot:function(){var e=this.re,t=this.im;if(0===t)return new Complex(Math.atan2(1,e),0);var r=e*e+t*t;return 0!==r?new Complex(e/r,-t/r).atan():new Complex(0!==e?e/0:0,0!==t?-t/0:0).atan()},asec:function(){var e=this.re,t=this.im;if(0===e&&0===t)return new Complex(0,1/0);var r=e*e+t*t;return 0!==r?new Complex(e/r,-t/r).acos():new Complex(0!==e?e/0:0,0!==t?-t/0:0).acos()},acsc:function(){var e=this.re,t=this.im;if(0===e&&0===t)return new Complex(Math.PI/2,1/0);var r=e*e+t*t;return 0!==r?new Complex(e/r,-t/r).asin():new Complex(0!==e?e/0:0,0!==t?-t/0:0).asin()},sinh:function(){var e=this.re,t=this.im;return new Complex(s(e)*Math.cos(t),i(e)*Math.sin(t))},cosh:function(){var e=this.re,t=this.im;return new Complex(i(e)*Math.cos(t),s(e)*Math.sin(t))},tanh:function(){var e=2*this.re,t=2*this.im,r=i(e)+Math.cos(t);return new Complex(s(e)/r,Math.sin(t)/r)},coth:function(){var e=2*this.re,t=2*this.im,r=i(e)-Math.cos(t);return new Complex(s(e)/r,-Math.sin(t)/r)},csch:function(){var e=this.re,t=this.im,r=Math.cos(2*t)-i(2*e);return new Complex(-2*s(e)*Math.cos(t)/r,2*i(e)*Math.sin(t)/r)},sech:function(){var e=this.re,t=this.im,r=Math.cos(2*t)+i(2*e);return new Complex(2*i(e)*Math.cos(t)/r,-2*s(e)*Math.sin(t)/r)},asinh:function(){var e=this.im;this.im=-this.re,this.re=e;var t=this.asin();return this.re=-this.im,this.im=e,e=t.re,t.re=-t.im,t.im=e,t},acosh:function(){var e=this.acos();if(e.im<=0){var t=e.re;e.re=-e.im,e.im=t}else{t=e.im;e.im=-e.re,e.re=t}return e},atanh:function(){var e=this.re,t=this.im,r=e>1&&0===t,n=1-e,i=1+e,s=n*n+t*t,o=0!==s?new Complex((i*n-t*t)/s,(t*n+i*t)/s):new Complex(-1!==e?e/0:0,0!==t?t/0:0),l=o.re;return o.re=a(o.re,o.im)/2,o.im=Math.atan2(o.im,l)/2,r&&(o.im=-o.im),o},acoth:function(){var e=this.re,t=this.im;if(0===e&&0===t)return new Complex(0,Math.PI/2);var r=e*e+t*t;return 0!==r?new Complex(e/r,-t/r).atanh():new Complex(0!==e?e/0:0,0!==t?-t/0:0).atanh()},acsch:function(){var e=this.re,t=this.im;if(0===t)return new Complex(0!==e?Math.log(e+Math.sqrt(e*e+1)):1/0,0);var r=e*e+t*t;return 0!==r?new Complex(e/r,-t/r).asinh():new Complex(0!==e?e/0:0,0!==t?-t/0:0).asinh()},asech:function(){var e=this.re,t=this.im;if(this.isZero())return Complex.INFINITY;var r=e*e+t*t;return 0!==r?new Complex(e/r,-t/r).acosh():new Complex(0!==e?e/0:0,0!==t?-t/0:0).acosh()},inverse:function(){if(this.isZero())return Complex.INFINITY;if(this.isInfinite())return Complex.ZERO;var e=this.re,t=this.im,r=e*e+t*t;return new Complex(e/r,-t/r)},conjugate:function(){return new Complex(this.re,-this.im)},neg:function(){return new Complex(-this.re,-this.im)},ceil:function(e){return e=Math.pow(10,e||0),new Complex(Math.ceil(this.re*e)/e,Math.ceil(this.im*e)/e)},floor:function(e){return e=Math.pow(10,e||0),new Complex(Math.floor(this.re*e)/e,Math.floor(this.im*e)/e)},round:function(e){return e=Math.pow(10,e||0),new Complex(Math.round(this.re*e)/e,Math.round(this.im*e)/e)},equals:function(e,t){var r=new Complex(e,t);return Math.abs(r.re-this.re)<=Complex.EPSILON&&Math.abs(r.im-this.im)<=Complex.EPSILON},clone:function(){return new Complex(this.re,this.im)},toString:function(){var e=this.re,t=this.im,r="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(e)<Complex.EPSILON&&(e=0),Math.abs(t)<Complex.EPSILON&&(t=0),0===t?r+e:(0!==e?(r+=e,r+=" ",t<0?(t=-t,r+="-"):r+="+",r+=" "):t<0&&(t=-t,r+="-"),1!==t&&(r+=t),r+"i"))},toVector:function(){return[this.re,this.im]},valueOf:function(){return 0===this.im?this.re:null},isNaN:function(){return isNaN(this.re)||isNaN(this.im)},isZero:function(){return 0===this.im&&0===this.re},isFinite:function(){return isFinite(this.re)&&isFinite(this.im)},isInfinite:function(){return!(this.isNaN()||this.isFinite())}},Complex.ZERO=new Complex(0,0),Complex.ONE=new Complex(1,0),Complex.I=new Complex(0,1),Complex.PI=new Complex(Math.PI,0),Complex.E=new Complex(Math.E,0),Complex.INFINITY=new Complex(1/0,1/0),Complex.NAN=new Complex(NaN,NaN),Complex.EPSILON=1e-15,void 0===(r=function(){return Complex}.apply(t,[]))||(e.exports=r)}()},1343:(e,t,r)=>{"use strict";var n=r(64506),i=r(65840),s=TypeError;e.exports=function(e){if(n(e))return e;throw s(i(e)+" is not a function")}},32747:(e,t,r)=>{"use strict";var n=r(51372),i=r(65840),s=TypeError;e.exports=function(e){if(n(e))return e;throw s(i(e)+" is not a constructor")}},66571:(e,t,r)=>{"use strict";var n=r(64506),i=String,s=TypeError;e.exports=function(e){if("object"==typeof e||n(e))return e;throw s("Can't set "+i(e)+" as a prototype")}},76380:(e,t,r)=>{"use strict";var n=r(60664),i=r(6731),s=r(58204).f,o=n("unscopables"),a=Array.prototype;void 0===a[o]&&s(a,o,{configurable:!0,value:i(null)}),e.exports=function(e){a[o][e]=!0}},22056:(e,t,r)=>{"use strict";var n=r(67710).charAt;e.exports=function(e,t,r){return t+(r?n(e,t).length:1)}},15036:(e,t,r)=>{"use strict";var n=r(11624),i=TypeError;e.exports=function(e,t){if(n(t,e))return e;throw i("Incorrect invocation")}},66688:(e,t,r)=>{"use strict";var n=r(21629),i=String,s=TypeError;e.exports=function(e){if(n(e))return e;throw s(i(e)+" is not an object")}},27410:e=>{"use strict";e.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},28695:(e,t,r)=>{"use strict";var n=r(63388);e.exports=n((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}}))},87545:(e,t,r)=>{"use strict";var n,i,s,o=r(27410),a=r(26471),l=r(19042),c=r(64506),u=r(21629),d=r(98284),h=r(57228),p=r(65840),m=r(43882),f=r(70119),g=r(60851),y=r(11624),b=r(38740),v=r(15592),_=r(60664),x=r(33043),w=r(76980),R=w.enforce,k=w.get,j=l.Int8Array,z=j&&j.prototype,q=l.Uint8ClampedArray,$=q&&q.prototype,Z=j&&b(j),X=z&&b(z),Y=Object.prototype,ee=l.TypeError,te=_("toStringTag"),re=x("TYPED_ARRAY_TAG"),ne="TypedArrayConstructor",ie=o&&!!v&&"Opera"!==h(l.opera),se=!1,oe={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},ae={BigInt64Array:8,BigUint64Array:8},le=function(e){var t=b(e);if(u(t)){var r=k(t);return r&&d(r,ne)?r[ne]:le(t)}},ce=function(e){if(!u(e))return!1;var t=h(e);return d(oe,t)||d(ae,t)};for(n in oe)(s=(i=l[n])&&i.prototype)?R(s)[ne]=i:ie=!1;for(n in ae)(s=(i=l[n])&&i.prototype)&&(R(s)[ne]=i);if((!ie||!c(Z)||Z===Function.prototype)&&(Z=function(){throw ee("Incorrect invocation")},ie))for(n in oe)l[n]&&v(l[n],Z);if((!ie||!X||X===Y)&&(X=Z.prototype,ie))for(n in oe)l[n]&&v(l[n].prototype,X);if(ie&&b($)!==X&&v($,X),a&&!d(X,te))for(n in se=!0,g(X,te,{configurable:!0,get:function(){return u(this)?this[re]:void 0}}),oe)l[n]&&m(l[n],re,n);e.exports={NATIVE_ARRAY_BUFFER_VIEWS:ie,TYPED_ARRAY_TAG:se&&re,aTypedArray:function(e){if(ce(e))return e;throw ee("Target is not a typed array")},aTypedArrayConstructor:function(e){if(c(e)&&(!v||y(Z,e)))return e;throw ee(p(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,r,n){if(a){if(r)for(var i in oe){var s=l[i];if(s&&d(s.prototype,e))try{delete s.prototype[e]}catch(r){try{s.prototype[e]=t}catch(e){}}}X[e]&&!r||f(X,e,r?t:ie&&z[e]||t,n)}},exportTypedArrayStaticMethod:function(e,t,r){var n,i;if(a){if(v){if(r)for(n in oe)if((i=l[n])&&d(i,e))try{delete i[e]}catch(e){}if(Z[e]&&!r)return;try{return f(Z,e,r?t:ie&&Z[e]||t)}catch(e){}}for(n in oe)!(i=l[n])||i[e]&&!r||f(i,e,t)}},getTypedArrayConstructor:le,isView:function(e){if(!u(e))return!1;var t=h(e);return"DataView"===t||d(oe,t)||d(ae,t)},isTypedArray:ce,TypedArray:Z,TypedArrayPrototype:X}},93679:(e,t,r)=>{"use strict";var n=r(19042),i=r(43171),s=r(26471),o=r(27410),a=r(5265),l=r(43882),c=r(60851),u=r(60114),d=r(63388),h=r(15036),p=r(71738),m=r(64001),f=r(8473),g=r(66549),y=r(38740),b=r(15592),v=r(68843).f,_=r(52024),x=r(31538),w=r(99176),R=r(76980),k=a.PROPER,j=a.CONFIGURABLE,z="ArrayBuffer",q="DataView",$="prototype",Z="Wrong index",X=R.getterFor(z),Y=R.getterFor(q),ee=R.set,te=n[z],re=te,ne=re&&re[$],ie=n[q],se=ie&&ie[$],oe=Object.prototype,ae=n.Array,le=n.RangeError,ce=i(_),ue=i([].reverse),de=g.pack,he=g.unpack,pe=function(e){return[255&e]},me=function(e){return[255&e,e>>8&255]},fe=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},ge=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},ye=function(e){return de(e,23,4)},be=function(e){return de(e,52,8)},ve=function(e,t,r){c(e[$],t,{configurable:!0,get:function(){return r(this)[t]}})},_e=function(e,t,r,n){var i=Y(e),s=f(r),o=!!n;if(s+t>i.byteLength)throw le(Z);var a=i.bytes,l=s+i.byteOffset,c=x(a,l,l+t);return o?c:ue(c)},xe=function(e,t,r,n,i,s){var o=Y(e),a=f(r),l=n(+i),c=!!s;if(a+t>o.byteLength)throw le(Z);for(var u=o.bytes,d=a+o.byteOffset,h=0;h<t;h++)u[d+h]=l[c?h:t-h-1]};if(o){var we=k&&te.name!==z;if(d((function(){te(1)}))&&d((function(){new te(-1)}))&&!d((function(){return new te,new te(1.5),new te(NaN),1!==te.length||we&&!j})))we&&j&&l(te,"name",z);else{(re=function(e){return h(this,ne),new te(f(e))})[$]=ne;for(var Se,Pe=v(te),Te=0;Pe.length>Te;)(Se=Pe[Te++])in re||l(re,Se,te[Se]);ne.constructor=re}b&&y(se)!==oe&&b(se,oe);var Re=new ie(new re(2)),ke=i(se.setInt8);Re.setInt8(0,2147483648),Re.setInt8(1,2147483649),!Re.getInt8(0)&&Re.getInt8(1)||u(se,{setInt8:function(e,t){ke(this,e,t<<24>>24)},setUint8:function(e,t){ke(this,e,t<<24>>24)}},{unsafe:!0})}else ne=(re=function(e){h(this,ne);var t=f(e);ee(this,{type:z,bytes:ce(ae(t),0),byteLength:t}),s||(this.byteLength=t,this.detached=!1)})[$],se=(ie=function(e,t,r){h(this,se),h(e,ne);var n=X(e),i=n.byteLength,o=p(t);if(o<0||o>i)throw le("Wrong offset");if(o+(r=void 0===r?i-o:m(r))>i)throw le("Wrong length");ee(this,{type:q,buffer:e,byteLength:r,byteOffset:o,bytes:n.bytes}),s||(this.buffer=e,this.byteLength=r,this.byteOffset=o)})[$],s&&(ve(re,"byteLength",X),ve(ie,"buffer",Y),ve(ie,"byteLength",Y),ve(ie,"byteOffset",Y)),u(se,{getInt8:function(e){return _e(this,1,e)[0]<<24>>24},getUint8:function(e){return _e(this,1,e)[0]},getInt16:function(e){var t=_e(this,2,e,arguments.length>1&&arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=_e(this,2,e,arguments.length>1&&arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return ge(_e(this,4,e,arguments.length>1&&arguments[1]))},getUint32:function(e){return ge(_e(this,4,e,arguments.length>1&&arguments[1]))>>>0},getFloat32:function(e){return he(_e(this,4,e,arguments.length>1&&arguments[1]),23)},getFloat64:function(e){return he(_e(this,8,e,arguments.length>1&&arguments[1]),52)},setInt8:function(e,t){xe(this,1,e,pe,t)},setUint8:function(e,t){xe(this,1,e,pe,t)},setInt16:function(e,t){xe(this,2,e,me,t,arguments.length>2&&arguments[2])},setUint16:function(e,t){xe(this,2,e,me,t,arguments.length>2&&arguments[2])},setInt32:function(e,t){xe(this,4,e,fe,t,arguments.length>2&&arguments[2])},setUint32:function(e,t){xe(this,4,e,fe,t,arguments.length>2&&arguments[2])},setFloat32:function(e,t){xe(this,4,e,ye,t,arguments.length>2&&arguments[2])},setFloat64:function(e,t){xe(this,8,e,be,t,arguments.length>2&&arguments[2])}});w(re,z),w(ie,q),e.exports={ArrayBuffer:re,DataView:ie}},9866:(e,t,r)=>{"use strict";var n=r(58258),i=r(96017),s=r(46799),o=r(9719),a=Math.min;e.exports=[].copyWithin||function(e,t){var r=n(this),l=s(r),c=i(e,l),u=i(t,l),d=arguments.length>2?arguments[2]:void 0,h=a((void 0===d?l:i(d,l))-u,l-c),p=1;for(u<c&&c<u+h&&(p=-1,u+=h-1,c+=h-1);h-- >0;)u in r?r[c]=r[u]:o(r,c),c+=p,u+=p;return r}},52024:(e,t,r)=>{"use strict";var n=r(58258),i=r(96017),s=r(46799);e.exports=function(e){for(var t=n(this),r=s(t),o=arguments.length,a=i(o>1?arguments[1]:void 0,r),l=o>2?arguments[2]:void 0,c=void 0===l?r:i(l,r);c>a;)t[a++]=e;return t}},24338:(e,t,r)=>{"use strict";var n=r(68214).forEach,i=r(89479)("forEach");e.exports=i?[].forEach:function(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}},9157:(e,t,r)=>{"use strict";var n=r(46799);e.exports=function(e,t){for(var r=0,i=n(t),s=new e(i);i>r;)s[r]=t[r++];return s}},91565:(e,t,r)=>{"use strict";var n=r(64615),i=r(69562),s=r(58258),o=r(90930),a=r(15300),l=r(51372),c=r(46799),u=r(90071),d=r(87916),h=r(60248),p=Array;e.exports=function(e){var t=s(e),r=l(this),m=arguments.length,f=m>1?arguments[1]:void 0,g=void 0!==f;g&&(f=n(f,m>2?arguments[2]:void 0));var y,b,v,_,x,w,R=h(t),k=0;if(!R||this===p&&a(R))for(y=c(t),b=r?new this(y):p(y);y>k;k++)w=g?f(t[k],k):t[k],u(b,k,w);else for(x=(_=d(t,R)).next,b=r?new this:[];!(v=i(x,_)).done;k++)w=g?o(_,f,[v.value,k],!0):v.value,u(b,k,w);return b.length=k,b}},26484:(e,t,r)=>{"use strict";var n=r(20990),i=r(96017),s=r(46799),o=function(e){return function(t,r,o){var a,l=n(t),c=s(l),u=i(o,c);if(e&&r!=r){for(;c>u;)if((a=l[u++])!=a)return!0}else for(;c>u;u++)if((e||u in l)&&l[u]===r)return e||u||0;return!e&&-1}};e.exports={includes:o(!0),indexOf:o(!1)}},41508:(e,t,r)=>{"use strict";var n=r(64615),i=r(87394),s=r(58258),o=r(46799),a=function(e){var t=1===e;return function(r,a,l){for(var c,u=s(r),d=i(u),h=n(a,l),p=o(d);p-- >0;)if(h(c=d[p],p,u))switch(e){case 0:return c;case 1:return p}return t?-1:void 0}};e.exports={findLast:a(0),findLastIndex:a(1)}},68214:(e,t,r)=>{"use strict";var n=r(64615),i=r(43171),s=r(87394),o=r(58258),a=r(46799),l=r(34168),c=i([].push),u=function(e){var t=1===e,r=2===e,i=3===e,u=4===e,d=6===e,h=7===e,p=5===e||d;return function(m,f,g,y){for(var b,v,_=o(m),x=s(_),w=n(f,g),R=a(x),k=0,j=y||l,z=t?j(m,R):r||h?j(m,0):void 0;R>k;k++)if((p||k in x)&&(v=w(b=x[k],k,_),e))if(t)z[k]=v;else if(v)switch(e){case 3:return!0;case 5:return b;case 6:return k;case 2:c(z,b)}else switch(e){case 4:return!1;case 7:c(z,b)}return d?-1:i||u?u:z}};e.exports={forEach:u(0),map:u(1),filter:u(2),some:u(3),every:u(4),find:u(5),findIndex:u(6),filterReject:u(7)}},68488:(e,t,r)=>{"use strict";var n=r(88168),i=r(20990),s=r(71738),o=r(46799),a=r(89479),l=Math.min,c=[].lastIndexOf,u=!!c&&1/[1].lastIndexOf(1,-0)<0,d=a("lastIndexOf"),h=u||!d;e.exports=h?function(e){if(u)return n(c,this,arguments)||0;var t=i(this),r=o(t),a=r-1;for(arguments.length>1&&(a=l(a,s(arguments[1]))),a<0&&(a=r+a);a>=0;a--)if(a in t&&t[a]===e)return a||0;return-1}:c},56240:(e,t,r)=>{"use strict";var n=r(63388),i=r(60664),s=r(91795),o=i("species");e.exports=function(e){return s>=51||!n((function(){var t=[];return(t.constructor={})[o]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},89479:(e,t,r)=>{"use strict";var n=r(63388);e.exports=function(e,t){var r=[][e];return!!r&&n((function(){r.call(null,t||function(){return 1},1)}))}},71379:(e,t,r)=>{"use strict";var n=r(1343),i=r(58258),s=r(87394),o=r(46799),a=TypeError,l=function(e){return function(t,r,l,c){n(r);var u=i(t),d=s(u),h=o(u),p=e?h-1:0,m=e?-1:1;if(l<2)for(;;){if(p in d){c=d[p],p+=m;break}if(p+=m,e?p<0:h<=p)throw a("Reduce of empty array with no initial value")}for(;e?p>=0:h>p;p+=m)p in d&&(c=r(c,d[p],p,u));return c}};e.exports={left:l(!1),right:l(!0)}},59978:(e,t,r)=>{"use strict";var n=r(26471),i=r(84321),s=TypeError,o=Object.getOwnPropertyDescriptor,a=n&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=a?function(e,t){if(i(e)&&!o(e,"length").writable)throw s("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},31538:(e,t,r)=>{"use strict";var n=r(96017),i=r(46799),s=r(90071),o=Array,a=Math.max;e.exports=function(e,t,r){for(var l=i(e),c=n(t,l),u=n(void 0===r?l:r,l),d=o(a(u-c,0)),h=0;c<u;c++,h++)s(d,h,e[c]);return d.length=h,d}},34147:(e,t,r)=>{"use strict";var n=r(43171);e.exports=n([].slice)},58337:(e,t,r)=>{"use strict";var n=r(31538),i=Math.floor,s=function(e,t){var r=e.length,l=i(r/2);return r<8?o(e,t):a(e,s(n(e,0,l),t),s(n(e,l),t),t)},o=function(e,t){for(var r,n,i=e.length,s=1;s<i;){for(n=s,r=e[s];n&&t(e[n-1],r)>0;)e[n]=e[--n];n!==s++&&(e[n]=r)}return e},a=function(e,t,r,n){for(var i=t.length,s=r.length,o=0,a=0;o<i||a<s;)e[o+a]=o<i&&a<s?n(t[o],r[a])<=0?t[o++]:r[a++]:o<i?t[o++]:r[a++];return e};e.exports=s},31322:(e,t,r)=>{"use strict";var n=r(84321),i=r(51372),s=r(21629),o=r(60664)("species"),a=Array;e.exports=function(e){var t;return n(e)&&(t=e.constructor,(i(t)&&(t===a||n(t.prototype))||s(t)&&null===(t=t[o]))&&(t=void 0)),void 0===t?a:t}},34168:(e,t,r)=>{"use strict";var n=r(31322);e.exports=function(e,t){return new(n(e))(0===t?0:t)}},26399:(e,t,r)=>{"use strict";var n=r(46799);e.exports=function(e,t){for(var r=n(e),i=new t(r),s=0;s<r;s++)i[s]=e[r-s-1];return i}},59957:(e,t,r)=>{"use strict";var n=r(46799),i=r(71738),s=RangeError;e.exports=function(e,t,r,o){var a=n(e),l=i(r),c=l<0?a+l:l;if(c>=a||c<0)throw s("Incorrect index");for(var u=new t(a),d=0;d<a;d++)u[d]=d===c?o:e[d];return u}},77749:e=>{"use strict";for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r={},n=0;n<66;n++)r[t.charAt(n)]=n;e.exports={itoc:t,ctoi:r}},90930:(e,t,r)=>{"use strict";var n=r(66688),i=r(93930);e.exports=function(e,t,r,s){try{return s?t(n(r)[0],r[1]):t(r)}catch(t){i(e,"throw",t)}}},78489:(e,t,r)=>{"use strict";var n=r(60664)("iterator"),i=!1;try{var s=0,o={next:function(){return{done:!!s++}},return:function(){i=!0}};o[n]=function(){return this},Array.from(o,(function(){throw 2}))}catch(e){}e.exports=function(e,t){try{if(!t&&!i)return!1}catch(e){return!1}var r=!1;try{var s={};s[n]=function(){return{next:function(){return{done:r=!0}}}},e(s)}catch(e){}return r}},67839:(e,t,r)=>{"use strict";var n=r(43171),i=n({}.toString),s=n("".slice);e.exports=function(e){return s(i(e),8,-1)}},57228:(e,t,r)=>{"use strict";var n=r(63647),i=r(64506),s=r(67839),o=r(60664)("toStringTag"),a=Object,l="Arguments"===s(function(){return arguments}());e.exports=n?s:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=a(e),o))?r:l?s(t):"Object"===(n=s(t))&&i(t.callee)?"Arguments":n}},14169:(e,t,r)=>{"use strict";var n=r(6731),i=r(60851),s=r(60114),o=r(64615),a=r(15036),l=r(74192),c=r(3079),u=r(70407),d=r(93166),h=r(93886),p=r(26471),m=r(98268).fastKey,f=r(76980),g=f.set,y=f.getterFor;e.exports={getConstructor:function(e,t,r,u){var d=e((function(e,i){a(e,h),g(e,{type:t,index:n(null),first:void 0,last:void 0,size:0}),p||(e.size=0),l(i)||c(i,e[u],{that:e,AS_ENTRIES:r})})),h=d.prototype,f=y(t),b=function(e,t,r){var n,i,s=f(e),o=v(e,t);return o?o.value=r:(s.last=o={index:i=m(t,!0),key:t,value:r,previous:n=s.last,next:void 0,removed:!1},s.first||(s.first=o),n&&(n.next=o),p?s.size++:e.size++,"F"!==i&&(s.index[i]=o)),e},v=function(e,t){var r,n=f(e),i=m(t);if("F"!==i)return n.index[i];for(r=n.first;r;r=r.next)if(r.key===t)return r};return s(h,{clear:function(){for(var e=f(this),t=e.index,r=e.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete t[r.index],r=r.next;e.first=e.last=void 0,p?e.size=0:this.size=0},delete:function(e){var t=this,r=f(t),n=v(t,e);if(n){var i=n.next,s=n.previous;delete r.index[n.index],n.removed=!0,s&&(s.next=i),i&&(i.previous=s),r.first===n&&(r.first=i),r.last===n&&(r.last=s),p?r.size--:t.size--}return!!n},forEach:function(e){for(var t,r=f(this),n=o(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:r.first;)for(n(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!v(this,e)}}),s(h,r?{get:function(e){var t=v(this,e);return t&&t.value},set:function(e,t){return b(this,0===e?0:e,t)}}:{add:function(e){return b(this,e=0===e?0:e,e)}}),p&&i(h,"size",{configurable:!0,get:function(){return f(this).size}}),d},setStrong:function(e,t,r){var n=t+" Iterator",i=y(t),s=y(n);u(e,t,(function(e,t){g(this,{type:n,target:e,state:i(e),kind:t,last:void 0})}),(function(){for(var e=s(this),t=e.kind,r=e.last;r&&r.removed;)r=r.previous;return e.target&&(e.last=r=r?r.next:e.state.first)?d("keys"===t?r.key:"values"===t?r.value:[r.key,r.value],!1):(e.target=void 0,d(void 0,!0))}),r?"entries":"values",!r,!0),h(t)}}},54974:(e,t,r)=>{"use strict";var n=r(43171),i=r(60114),s=r(98268).getWeakData,o=r(15036),a=r(66688),l=r(74192),c=r(21629),u=r(3079),d=r(68214),h=r(98284),p=r(76980),m=p.set,f=p.getterFor,g=d.find,y=d.findIndex,b=n([].splice),v=0,_=function(e){return e.frozen||(e.frozen=new UncaughtFrozenStore)},UncaughtFrozenStore=function(){this.entries=[]},x=function(e,t){return g(e.entries,(function(e){return e[0]===t}))};UncaughtFrozenStore.prototype={get:function(e){var t=x(this,e);if(t)return t[1]},has:function(e){return!!x(this,e)},set:function(e,t){var r=x(this,e);r?r[1]=t:this.entries.push([e,t])},delete:function(e){var t=y(this.entries,(function(t){return t[0]===e}));return~t&&b(this.entries,t,1),!!~t}},e.exports={getConstructor:function(e,t,r,n){var d=e((function(e,i){o(e,p),m(e,{type:t,id:v++,frozen:void 0}),l(i)||u(i,e[n],{that:e,AS_ENTRIES:r})})),p=d.prototype,g=f(t),y=function(e,t,r){var n=g(e),i=s(a(t),!0);return!0===i?_(n).set(t,r):i[n.id]=r,e};return i(p,{delete:function(e){var t=g(this);if(!c(e))return!1;var r=s(e);return!0===r?_(t).delete(e):r&&h(r,t.id)&&delete r[t.id]},has:function(e){var t=g(this);if(!c(e))return!1;var r=s(e);return!0===r?_(t).has(e):r&&h(r,t.id)}}),i(p,r?{get:function(e){var t=g(this);if(c(e)){var r=s(e);return!0===r?_(t).get(e):r?r[t.id]:void 0}},set:function(e,t){return y(this,e,t)}}:{add:function(e){return y(this,e,!0)}}),d}}},49225:(e,t,r)=>{"use strict";var n=r(90915),i=r(19042),s=r(43171),o=r(71767),a=r(70119),l=r(98268),c=r(3079),u=r(15036),d=r(64506),h=r(74192),p=r(21629),m=r(63388),f=r(78489),g=r(99176),y=r(15540);e.exports=function(e,t,r){var b=-1!==e.indexOf("Map"),v=-1!==e.indexOf("Weak"),_=b?"set":"add",x=i[e],w=x&&x.prototype,R=x,k={},j=function(e){var t=s(w[e]);a(w,e,"add"===e?function(e){return t(this,0===e?0:e),this}:"delete"===e?function(e){return!(v&&!p(e))&&t(this,0===e?0:e)}:"get"===e?function(e){return v&&!p(e)?void 0:t(this,0===e?0:e)}:"has"===e?function(e){return!(v&&!p(e))&&t(this,0===e?0:e)}:function(e,r){return t(this,0===e?0:e,r),this})};if(o(e,!d(x)||!(v||w.forEach&&!m((function(){(new x).entries().next()})))))R=r.getConstructor(t,e,b,_),l.enable();else if(o(e,!0)){var z=new R,q=z[_](v?{}:-0,1)!==z,$=m((function(){z.has(1)})),Z=f((function(e){new x(e)})),X=!v&&m((function(){for(var e=new x,t=5;t--;)e[_](t,t);return!e.has(-0)}));Z||((R=t((function(e,t){u(e,w);var r=y(new x,e,R);return h(t)||c(t,r[_],{that:r,AS_ENTRIES:b}),r}))).prototype=w,w.constructor=R),($||X)&&(j("delete"),j("has"),b&&j("get")),(X||q)&&j(_),v&&w.clear&&delete w.clear}return k[e]=R,n({global:!0,constructor:!0,forced:R!==x},k),g(R,e),v||r.setStrong(R,e,b),R}},44123:(e,t,r)=>{"use strict";var n=r(98284),i=r(33618),s=r(66790),o=r(58204);e.exports=function(e,t,r){for(var a=i(t),l=o.f,c=s.f,u=0;u<a.length;u++){var d=a[u];n(e,d)||r&&n(r,d)||l(e,d,c(t,d))}}},12407:(e,t,r)=>{"use strict";var n=r(60664)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[n]=!1,"/./"[e](t)}catch(e){}}return!1}},42582:(e,t,r)=>{"use strict";var n=r(63388);e.exports=!n((function(){function F(){}return F.prototype.constructor=null,Object.getPrototypeOf(new F)!==F.prototype}))},1935:(e,t,r)=>{"use strict";var n=r(43171),i=r(1455),s=r(34336),o=/"/g,a=n("".replace);e.exports=function(e,t,r,n){var l=s(i(e)),c="<"+t;return""!==r&&(c+=" "+r+'="'+a(s(n),o,"&quot;")+'"'),c+">"+l+"</"+t+">"}},93166:e=>{"use strict";e.exports=function(e,t){return{value:e,done:t}}},43882:(e,t,r)=>{"use strict";var n=r(26471),i=r(58204),s=r(63833);e.exports=n?function(e,t,r){return i.f(e,t,s(1,r))}:function(e,t,r){return e[t]=r,e}},63833:e=>{"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},90071:(e,t,r)=>{"use strict";var n=r(90422),i=r(58204),s=r(63833);e.exports=function(e,t,r){var o=n(t);o in e?i.f(e,o,s(0,r)):e[o]=r}},31525:(e,t,r)=>{"use strict";var n=r(43171),i=r(63388),s=r(83932).start,o=RangeError,a=isFinite,l=Math.abs,c=Date.prototype,u=c.toISOString,d=n(c.getTime),h=n(c.getUTCDate),p=n(c.getUTCFullYear),m=n(c.getUTCHours),f=n(c.getUTCMilliseconds),g=n(c.getUTCMinutes),y=n(c.getUTCMonth),b=n(c.getUTCSeconds);e.exports=i((function(){return"0385-07-25T07:06:39.999Z"!==u.call(new Date(-50000000000001))}))||!i((function(){u.call(new Date(NaN))}))?function(){if(!a(d(this)))throw o("Invalid time value");var e=this,t=p(e),r=f(e),n=t<0?"-":t>9999?"+":"";return n+s(l(t),n?6:4,0)+"-"+s(y(e)+1,2,0)+"-"+s(h(e),2,0)+"T"+s(m(e),2,0)+":"+s(g(e),2,0)+":"+s(b(e),2,0)+"."+s(r,3,0)+"Z"}:u},98855:(e,t,r)=>{"use strict";var n=r(66688),i=r(88309),s=TypeError;e.exports=function(e){if(n(this),"string"===e||"default"===e)e="string";else if("number"!==e)throw s("Incorrect hint");return i(this,e)}},60851:(e,t,r)=>{"use strict";var n=r(6440),i=r(58204);e.exports=function(e,t,r){return r.get&&n(r.get,t,{getter:!0}),r.set&&n(r.set,t,{setter:!0}),i.f(e,t,r)}},70119:(e,t,r)=>{"use strict";var n=r(64506),i=r(58204),s=r(6440),o=r(34900);e.exports=function(e,t,r,a){a||(a={});var l=a.enumerable,c=void 0!==a.name?a.name:t;if(n(r)&&s(r,c,a),a.global)l?e[t]=r:o(t,r);else{try{a.unsafe?e[t]&&(l=!0):delete e[t]}catch(e){}l?e[t]=r:i.f(e,t,{value:r,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return e}},60114:(e,t,r)=>{"use strict";var n=r(70119);e.exports=function(e,t,r){for(var i in t)n(e,i,t[i],r);return e}},34900:(e,t,r)=>{"use strict";var n=r(19042),i=Object.defineProperty;e.exports=function(e,t){try{i(n,e,{value:t,configurable:!0,writable:!0})}catch(r){n[e]=t}return t}},9719:(e,t,r)=>{"use strict";var n=r(65840),i=TypeError;e.exports=function(e,t){if(!delete e[t])throw i("Cannot delete property "+n(t)+" of "+n(e))}},26471:(e,t,r)=>{"use strict";var n=r(63388);e.exports=!n((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},55434:e=>{"use strict";var t="object"==typeof document&&document.all,r=void 0===t&&void 0!==t;e.exports={all:t,IS_HTMLDDA:r}},50880:(e,t,r)=>{"use strict";var n=r(19042),i=r(21629),s=n.document,o=i(s)&&i(s.createElement);e.exports=function(e){return o?s.createElement(e):{}}},12264:e=>{"use strict";var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},16729:e=>{"use strict";e.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},40231:e=>{"use strict";e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},76909:(e,t,r)=>{"use strict";var n=r(50880)("span").classList,i=n&&n.constructor&&n.constructor.prototype;e.exports=i===Object.prototype?void 0:i},39161:(e,t,r)=>{"use strict";var n=r(66819).match(/firefox\/(\d+)/i);e.exports=!!n&&+n[1]},47677:(e,t,r)=>{"use strict";var n=r(54361),i=r(47285);e.exports=!n&&!i&&"object"==typeof window&&"object"==typeof document},84820:e=>{"use strict";e.exports="function"==typeof Bun&&Bun&&"string"==typeof Bun.version},54361:e=>{"use strict";e.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},84487:(e,t,r)=>{"use strict";var n=r(66819);e.exports=/MSIE|Trident/.test(n)},37205:(e,t,r)=>{"use strict";var n=r(66819);e.exports=/ipad|iphone|ipod/i.test(n)&&"undefined"!=typeof Pebble},25388:(e,t,r)=>{"use strict";var n=r(66819);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},47285:(e,t,r)=>{"use strict";var n=r(19042),i=r(67839);e.exports="process"===i(n.process)},95488:(e,t,r)=>{"use strict";var n=r(66819);e.exports=/web0s(?!.*chrome)/i.test(n)},66819:e=>{"use strict";e.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},91795:(e,t,r)=>{"use strict";var n,i,s=r(19042),o=r(66819),a=s.process,l=s.Deno,c=a&&a.versions||l&&l.version,u=c&&c.v8;u&&(i=(n=u.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!i&&o&&(!(n=o.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=o.match(/Chrome\/(\d+)/))&&(i=+n[1]),e.exports=i},44091:(e,t,r)=>{"use strict";var n=r(66819).match(/AppleWebKit\/(\d+)\./);e.exports=!!n&&+n[1]},90999:(e,t,r)=>{"use strict";var n=r(19042);e.exports=function(e){return n[e].prototype}},7304:e=>{"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},57554:(e,t,r)=>{"use strict";var n=r(43171),i=Error,s=n("".replace),o=String(i("zxcasd").stack),a=/\n\s*at [^:]*:[^\n]*/,l=a.test(o);e.exports=function(e,t){if(l&&"string"==typeof e&&!i.prepareStackTrace)for(;t--;)e=s(e,a,"");return e}},14028:(e,t,r)=>{"use strict";var n=r(43882),i=r(57554),s=r(12192),o=Error.captureStackTrace;e.exports=function(e,t,r,a){s&&(o?o(e,t):n(e,"stack",i(r,a)))}},12192:(e,t,r)=>{"use strict";var n=r(63388),i=r(63833);e.exports=!n((function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",i(1,7)),7!==e.stack)}))},4119:(e,t,r)=>{"use strict";var n=r(26471),i=r(63388),s=r(66688),o=r(6731),a=r(90800),l=Error.prototype.toString,c=i((function(){if(n){var e=o(Object.defineProperty({},"name",{get:function(){return this===e}}));if("true"!==l.call(e))return!0}return"2: 1"!==l.call({message:1,name:2})||"Error"!==l.call({})}));e.exports=c?function(){var e=s(this),t=a(e.name,"Error"),r=a(e.message);return t?r?t+": "+r:t:r}:l},90915:(e,t,r)=>{"use strict";var n=r(19042),i=r(66790).f,s=r(43882),o=r(70119),a=r(34900),l=r(44123),c=r(71767);e.exports=function(e,t){var r,u,d,h,p,m=e.target,f=e.global,g=e.stat;if(r=f?n:g?n[m]||a(m,{}):(n[m]||{}).prototype)for(u in t){if(h=t[u],d=e.dontCallGetSet?(p=i(r,u))&&p.value:r[u],!c(f?u:m+(g?".":"#")+u,e.forced)&&void 0!==d){if(typeof h==typeof d)continue;l(h,d)}(e.sham||d&&d.sham)&&s(h,"sham",!0),o(r,u,h,e)}}},63388:e=>{"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},47165:(e,t,r)=>{"use strict";r(89430);var n=r(17337),i=r(70119),s=r(57604),o=r(63388),a=r(60664),l=r(43882),c=a("species"),u=RegExp.prototype;e.exports=function(e,t,r,d){var h=a(e),p=!o((function(){var t={};return t[h]=function(){return 7},7!==""[e](t)})),m=p&&!o((function(){var t=!1,r=/a/;return"split"===e&&((r={}).constructor={},r.constructor[c]=function(){return r},r.flags="",r[h]=/./[h]),r.exec=function(){return t=!0,null},r[h](""),!t}));if(!p||!m||r){var f=n(/./[h]),g=t(h,""[e],(function(e,t,r,i,o){var a=n(e),l=t.exec;return l===s||l===u.exec?p&&!o?{done:!0,value:f(t,r,i)}:{done:!0,value:a(r,t,i)}:{done:!1}}));i(String.prototype,e,g[0]),i(u,h,g[1])}d&&l(u[h],"sham",!0)}},83334:(e,t,r)=>{"use strict";var n=r(84321),i=r(46799),s=r(12264),o=r(64615),a=function(e,t,r,l,c,u,d,h){for(var p,m,f=c,g=0,y=!!d&&o(d,h);g<l;)g in r&&(p=y?y(r[g],g,t):r[g],u>0&&n(p)?(m=i(p),f=a(e,t,p,m,f,u-1)-1):(s(f+1),e[f]=p),f++),g++;return f};e.exports=a},81745:(e,t,r)=>{"use strict";var n=r(63388);e.exports=!n((function(){return Object.isExtensible(Object.preventExtensions({}))}))},88168:(e,t,r)=>{"use strict";var n=r(50001),i=Function.prototype,s=i.apply,o=i.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n?o.bind(s):function(){return o.apply(s,arguments)})},64615:(e,t,r)=>{"use strict";var n=r(17337),i=r(1343),s=r(50001),o=n(n.bind);e.exports=function(e,t){return i(e),void 0===t?e:s?o(e,t):function(){return e.apply(t,arguments)}}},50001:(e,t,r)=>{"use strict";var n=r(63388);e.exports=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},9617:(e,t,r)=>{"use strict";var n=r(43171),i=r(1343),s=r(21629),o=r(98284),a=r(34147),l=r(50001),c=Function,u=n([].concat),d=n([].join),h={};e.exports=l?c.bind:function(e){var t=i(this),r=t.prototype,n=a(arguments,1),l=function(){var r=u(n,a(arguments));return this instanceof l?function(e,t,r){if(!o(h,t)){for(var n=[],i=0;i<t;i++)n[i]="a["+i+"]";h[t]=c("C,a","return new C("+d(n,",")+")")}return h[t](e,r)}(t,r.length,r):t.apply(e,r)};return s(r)&&(l.prototype=r),l}},69562:(e,t,r)=>{"use strict";var n=r(50001),i=Function.prototype.call;e.exports=n?i.bind(i):function(){return i.apply(i,arguments)}},5265:(e,t,r)=>{"use strict";var n=r(26471),i=r(98284),s=Function.prototype,o=n&&Object.getOwnPropertyDescriptor,a=i(s,"name"),l=a&&"something"===function(){}.name,c=a&&(!n||n&&o(s,"name").configurable);e.exports={EXISTS:a,PROPER:l,CONFIGURABLE:c}},3023:(e,t,r)=>{"use strict";var n=r(43171),i=r(1343);e.exports=function(e,t,r){try{return n(i(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(e){}}},17337:(e,t,r)=>{"use strict";var n=r(67839),i=r(43171);e.exports=function(e){if("Function"===n(e))return i(e)}},43171:(e,t,r)=>{"use strict";var n=r(50001),i=Function.prototype,s=i.call,o=n&&i.bind.bind(s,s);e.exports=n?o:function(e){return function(){return s.apply(e,arguments)}}},84830:(e,t,r)=>{"use strict";var n=r(19042),i=r(64506);e.exports=function(e,t){return arguments.length<2?(r=n[e],i(r)?r:void 0):n[e]&&n[e][t];var r}},60248:(e,t,r)=>{"use strict";var n=r(57228),i=r(84839),s=r(74192),o=r(46782),a=r(60664)("iterator");e.exports=function(e){if(!s(e))return i(e,a)||i(e,"@@iterator")||o[n(e)]}},87916:(e,t,r)=>{"use strict";var n=r(69562),i=r(1343),s=r(66688),o=r(65840),a=r(60248),l=TypeError;e.exports=function(e,t){var r=arguments.length<2?a(e):t;if(i(r))return s(n(r,e));throw l(o(e)+" is not iterable")}},11520:(e,t,r)=>{"use strict";var n=r(43171),i=r(84321),s=r(64506),o=r(67839),a=r(34336),l=n([].push);e.exports=function(e){if(s(e))return e;if(i(e)){for(var t=e.length,r=[],n=0;n<t;n++){var c=e[n];"string"==typeof c?l(r,c):"number"!=typeof c&&"Number"!==o(c)&&"String"!==o(c)||l(r,a(c))}var u=r.length,d=!0;return function(e,t){if(d)return d=!1,t;if(i(this))return t;for(var n=0;n<u;n++)if(r[n]===e)return t}}}},84839:(e,t,r)=>{"use strict";var n=r(1343),i=r(74192);e.exports=function(e,t){var r=e[t];return i(r)?void 0:n(r)}},66023:(e,t,r)=>{"use strict";var n=r(43171),i=r(58258),s=Math.floor,o=n("".charAt),a=n("".replace),l=n("".slice),c=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,u=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,r,n,d,h){var p=r+e.length,m=n.length,f=u;return void 0!==d&&(d=i(d),f=c),a(h,f,(function(i,a){var c;switch(o(a,0)){case"$":return"$";case"&":return e;case"`":return l(t,0,r);case"'":return l(t,p);case"<":c=d[l(a,1,-1)];break;default:var u=+a;if(0===u)return i;if(u>m){var h=s(u/10);return 0===h?i:h<=m?void 0===n[h-1]?o(a,1):n[h-1]+o(a,1):i}c=n[u-1]}return void 0===c?"":c}))}},19042:function(e,t,r){"use strict";var n=function(e){return e&&e.Math===Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof r.g&&r.g)||function(){return this}()||this||Function("return this")()},98284:(e,t,r)=>{"use strict";var n=r(43171),i=r(58258),s=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return s(i(e),t)}},14226:e=>{"use strict";e.exports={}},11776:e=>{"use strict";e.exports=function(e,t){try{1===arguments.length?console.error(e):console.error(e,t)}catch(e){}}},87328:(e,t,r)=>{"use strict";var n=r(84830);e.exports=n("document","documentElement")},54336:(e,t,r)=>{"use strict";var n=r(26471),i=r(63388),s=r(50880);e.exports=!n&&!i((function(){return 7!==Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a}))},66549:(e,t,r)=>{"use strict";var n=r(1729),i=r(99208),s=Array,o=Math.abs,a=Math.pow,l=Math.floor,c=Math.log,u=Math.LN2,d=function(e){var t=i(e),r=o(e-t);return r>.5||.5===r&&t%2!=0?t+n(e):t};e.exports={pack:function(e,t,r){var n,i,h,p=s(r),m=8*r-t-1,f=(1<<m)-1,g=f>>1,y=23===t?a(2,-24)-a(2,-77):0,b=e<0||0===e&&1/e<0?1:0,v=0;for((e=o(e))!=e||e===1/0?(i=e!=e?1:0,n=f):(n=l(c(e)/u),e*(h=a(2,-n))<1&&(n--,h*=2),(e+=n+g>=1?y/h:y*a(2,1-g))*h>=2&&(n++,h/=2),n+g>=f?(i=0,n=f):n+g>=1?(i=d((e*h-1)*a(2,t)),n+=g):(i=d(e*a(2,g-1)*a(2,t)),n=0));t>=8;)p[v++]=255&i,i/=256,t-=8;for(n=n<<t|i,m+=t;m>0;)p[v++]=255&n,n/=256,m-=8;return p[--v]|=128*b,p},unpack:function(e,t){var r,n=e.length,i=8*n-t-1,s=(1<<i)-1,o=s>>1,l=i-7,c=n-1,u=e[c--],d=127&u;for(u>>=7;l>0;)d=256*d+e[c--],l-=8;for(r=d&(1<<-l)-1,d>>=-l,l+=t;l>0;)r=256*r+e[c--],l-=8;if(0===d)d=1-o;else{if(d===s)return r?NaN:u?-1/0:1/0;r+=a(2,t),d-=o}return(u?-1:1)*r*a(2,d-t)}}},87394:(e,t,r)=>{"use strict";var n=r(43171),i=r(63388),s=r(67839),o=Object,a=n("".split);e.exports=i((function(){return!o("z").propertyIsEnumerable(0)}))?function(e){return"String"===s(e)?a(e,""):o(e)}:o},15540:(e,t,r)=>{"use strict";var n=r(64506),i=r(21629),s=r(15592);e.exports=function(e,t,r){var o,a;return s&&n(o=t.constructor)&&o!==r&&i(a=o.prototype)&&a!==r.prototype&&s(e,a),e}},3127:(e,t,r)=>{"use strict";var n=r(43171),i=r(64506),s=r(93712),o=n(Function.toString);i(s.inspectSource)||(s.inspectSource=function(e){return o(e)}),e.exports=s.inspectSource},1451:(e,t,r)=>{"use strict";var n=r(21629),i=r(43882);e.exports=function(e,t){n(t)&&"cause"in t&&i(e,"cause",t.cause)}},98268:(e,t,r)=>{"use strict";var n=r(90915),i=r(43171),s=r(14226),o=r(21629),a=r(98284),l=r(58204).f,c=r(68843),u=r(50703),d=r(66109),h=r(33043),p=r(81745),m=!1,f=h("meta"),g=0,y=function(e){l(e,f,{value:{objectID:"O"+g++,weakData:{}}})},b=e.exports={enable:function(){b.enable=function(){},m=!0;var e=c.f,t=i([].splice),r={};r[f]=1,e(r).length&&(c.f=function(r){for(var n=e(r),i=0,s=n.length;i<s;i++)if(n[i]===f){t(n,i,1);break}return n},n({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:u.f}))},fastKey:function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!a(e,f)){if(!d(e))return"F";if(!t)return"E";y(e)}return e[f].objectID},getWeakData:function(e,t){if(!a(e,f)){if(!d(e))return!0;if(!t)return!1;y(e)}return e[f].weakData},onFreeze:function(e){return p&&m&&d(e)&&!a(e,f)&&y(e),e}};s[f]=!0},76980:(e,t,r)=>{"use strict";var n,i,s,o=r(78167),a=r(19042),l=r(21629),c=r(43882),u=r(98284),d=r(93712),h=r(88890),p=r(14226),m="Object already initialized",f=a.TypeError,g=a.WeakMap;if(o||d.state){var y=d.state||(d.state=new g);y.get=y.get,y.has=y.has,y.set=y.set,n=function(e,t){if(y.has(e))throw f(m);return t.facade=e,y.set(e,t),t},i=function(e){return y.get(e)||{}},s=function(e){return y.has(e)}}else{var b=h("state");p[b]=!0,n=function(e,t){if(u(e,b))throw f(m);return t.facade=e,c(e,b,t),t},i=function(e){return u(e,b)?e[b]:{}},s=function(e){return u(e,b)}}e.exports={set:n,get:i,has:s,enforce:function(e){return s(e)?i(e):n(e,{})},getterFor:function(e){return function(t){var r;if(!l(t)||(r=i(t)).type!==e)throw f("Incompatible receiver, "+e+" required");return r}}}},15300:(e,t,r)=>{"use strict";var n=r(60664),i=r(46782),s=n("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||o[s]===e)}},84321:(e,t,r)=>{"use strict";var n=r(67839);e.exports=Array.isArray||function(e){return"Array"===n(e)}},47006:(e,t,r)=>{"use strict";var n=r(57228);e.exports=function(e){var t=n(e);return"BigInt64Array"===t||"BigUint64Array"===t}},64506:(e,t,r)=>{"use strict";var n=r(55434),i=n.all;e.exports=n.IS_HTMLDDA?function(e){return"function"==typeof e||e===i}:function(e){return"function"==typeof e}},51372:(e,t,r)=>{"use strict";var n=r(43171),i=r(63388),s=r(64506),o=r(57228),a=r(84830),l=r(3127),c=function(){},u=[],d=a("Reflect","construct"),h=/^\s*(?:class|function)\b/,p=n(h.exec),m=!h.exec(c),f=function(e){if(!s(e))return!1;try{return d(c,u,e),!0}catch(e){return!1}},g=function(e){if(!s(e))return!1;switch(o(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return m||!!p(h,l(e))}catch(e){return!0}};g.sham=!0,e.exports=!d||i((function(){var e;return f(f.call)||!f(Object)||!f((function(){e=!0}))||e}))?g:f},8250:(e,t,r)=>{"use strict";var n=r(98284);e.exports=function(e){return void 0!==e&&(n(e,"value")||n(e,"writable"))}},71767:(e,t,r)=>{"use strict";var n=r(63388),i=r(64506),s=/#|\.prototype\./,o=function(e,t){var r=l[a(e)];return r===u||r!==c&&(i(t)?n(t):!!t)},a=o.normalize=function(e){return String(e).replace(s,".").toLowerCase()},l=o.data={},c=o.NATIVE="N",u=o.POLYFILL="P";e.exports=o},26410:(e,t,r)=>{"use strict";var n=r(21629),i=Math.floor;e.exports=Number.isInteger||function(e){return!n(e)&&isFinite(e)&&i(e)===e}},74192:e=>{"use strict";e.exports=function(e){return null==e}},21629:(e,t,r)=>{"use strict";var n=r(64506),i=r(55434),s=i.all;e.exports=i.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:n(e)||e===s}:function(e){return"object"==typeof e?null!==e:n(e)}},37792:e=>{"use strict";e.exports=!1},10951:(e,t,r)=>{"use strict";var n=r(21629),i=r(67839),s=r(60664)("match");e.exports=function(e){var t;return n(e)&&(void 0!==(t=e[s])?!!t:"RegExp"===i(e))}},85706:(e,t,r)=>{"use strict";var n=r(84830),i=r(64506),s=r(11624),o=r(50871),a=Object;e.exports=o?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return i(t)&&s(t.prototype,a(e))}},3079:(e,t,r)=>{"use strict";var n=r(64615),i=r(69562),s=r(66688),o=r(65840),a=r(15300),l=r(46799),c=r(11624),u=r(87916),d=r(60248),h=r(93930),p=TypeError,Result=function(e,t){this.stopped=e,this.result=t},m=Result.prototype;e.exports=function(e,t,r){var f,g,y,b,v,_,x,w=r&&r.that,R=!(!r||!r.AS_ENTRIES),k=!(!r||!r.IS_RECORD),j=!(!r||!r.IS_ITERATOR),z=!(!r||!r.INTERRUPTED),q=n(t,w),$=function(e){return f&&h(f,"normal",e),new Result(!0,e)},Z=function(e){return R?(s(e),z?q(e[0],e[1],$):q(e[0],e[1])):z?q(e,$):q(e)};if(k)f=e.iterator;else if(j)f=e;else{if(!(g=d(e)))throw p(o(e)+" is not iterable");if(a(g)){for(y=0,b=l(e);b>y;y++)if((v=Z(e[y]))&&c(m,v))return v;return new Result(!1)}f=u(e,g)}for(_=k?e.next:f.next;!(x=i(_,f)).done;){try{v=Z(x.value)}catch(e){h(f,"throw",e)}if("object"==typeof v&&v&&c(m,v))return v}return new Result(!1)}},93930:(e,t,r)=>{"use strict";var n=r(69562),i=r(66688),s=r(84839);e.exports=function(e,t,r){var o,a;i(e);try{if(!(o=s(e,"return"))){if("throw"===t)throw r;return r}o=n(o,e)}catch(e){a=!0,o=e}if("throw"===t)throw r;if(a)throw o;return i(o),r}},90973:(e,t,r)=>{"use strict";var n=r(67900).IteratorPrototype,i=r(6731),s=r(63833),o=r(99176),a=r(46782),l=function(){return this};e.exports=function(e,t,r,c){var u=t+" Iterator";return e.prototype=i(n,{next:s(+!c,r)}),o(e,u,!1,!0),a[u]=l,e}},70407:(e,t,r)=>{"use strict";var n=r(90915),i=r(69562),s=r(37792),o=r(5265),a=r(64506),l=r(90973),c=r(38740),u=r(15592),d=r(99176),h=r(43882),p=r(70119),m=r(60664),f=r(46782),g=r(67900),y=o.PROPER,b=o.CONFIGURABLE,v=g.IteratorPrototype,_=g.BUGGY_SAFARI_ITERATORS,x=m("iterator"),w="keys",R="values",k="entries",j=function(){return this};e.exports=function(e,t,r,o,m,g,z){l(r,t,o);var q,$,Z,X=function(e){if(e===m&&ne)return ne;if(!_&&e&&e in te)return te[e];switch(e){case w:case R:case k:return function(){return new r(this,e)}}return function(){return new r(this)}},Y=t+" Iterator",ee=!1,te=e.prototype,re=te[x]||te["@@iterator"]||m&&te[m],ne=!_&&re||X(m),ie="Array"===t&&te.entries||re;if(ie&&(q=c(ie.call(new e)))!==Object.prototype&&q.next&&(s||c(q)===v||(u?u(q,v):a(q[x])||p(q,x,j)),d(q,Y,!0,!0),s&&(f[Y]=j)),y&&m===R&&re&&re.name!==R&&(!s&&b?h(te,"name",R):(ee=!0,ne=function(){return i(re,this)})),m)if($={values:X(R),keys:g?ne:X(w),entries:X(k)},z)for(Z in $)(_||ee||!(Z in te))&&p(te,Z,$[Z]);else n({target:t,proto:!0,forced:_||ee},$);return s&&!z||te[x]===ne||p(te,x,ne,{name:m}),f[t]=ne,$}},67900:(e,t,r)=>{"use strict";var n,i,s,o=r(63388),a=r(64506),l=r(21629),c=r(6731),u=r(38740),d=r(70119),h=r(60664),p=r(37792),m=h("iterator"),f=!1;[].keys&&("next"in(s=[].keys())?(i=u(u(s)))!==Object.prototype&&(n=i):f=!0),!l(n)||o((function(){var e={};return n[m].call(e)!==e}))?n={}:p&&(n=c(n)),a(n[m])||d(n,m,(function(){return this})),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:f}},46782:e=>{"use strict";e.exports={}},46799:(e,t,r)=>{"use strict";var n=r(64001);e.exports=function(e){return n(e.length)}},6440:(e,t,r)=>{"use strict";var n=r(43171),i=r(63388),s=r(64506),o=r(98284),a=r(26471),l=r(5265).CONFIGURABLE,c=r(3127),u=r(76980),d=u.enforce,h=u.get,p=String,m=Object.defineProperty,f=n("".slice),g=n("".replace),y=n([].join),b=a&&!i((function(){return 8!==m((function(){}),"length",{value:8}).length})),v=String(String).split("String"),_=e.exports=function(e,t,r){"Symbol("===f(p(t),0,7)&&(t="["+g(p(t),/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!o(e,"name")||l&&e.name!==t)&&(a?m(e,"name",{value:t,configurable:!0}):e.name=t),b&&r&&o(r,"arity")&&e.length!==r.arity&&m(e,"length",{value:r.arity});try{r&&o(r,"constructor")&&r.constructor?a&&m(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=d(e);return o(n,"source")||(n.source=y(v,"string"==typeof t?t:"")),e};Function.prototype.toString=_((function(){return s(this)&&h(this).source||c(this)}),"toString")},61575:(e,t,r)=>{"use strict";var n=r(43171),i=Map.prototype;e.exports={Map,set:n(i.set),get:n(i.get),has:n(i.has),remove:n(i.delete),proto:i}},43635:e=>{"use strict";var t=Math.expm1,r=Math.exp;e.exports=!t||t(10)>22025.465794806718||t(10)<22025.465794806718||-2e-17!==t(-2e-17)?function(e){var t=+e;return 0===t?t:t>-1e-6&&t<1e-6?t+t*t/2:r(t)-1}:t},14478:(e,t,r)=>{"use strict";var n=r(1729),i=Math.abs,s=Math.pow,o=s(2,-52),a=s(2,-23),l=s(2,127)*(2-a),c=s(2,-126);e.exports=Math.fround||function(e){var t,r,s=+e,u=i(s),d=n(s);return u<c?d*function(e){return e+1/o-1/o}(u/c/a)*c*a:(r=(t=(1+a/o)*u)-(t-u))>l||r!=r?d*(1/0):d*r}},48317:e=>{"use strict";var t=Math.log,r=Math.LOG10E;e.exports=Math.log10||function(e){return t(e)*r}},32445:e=>{"use strict";var t=Math.log;e.exports=Math.log1p||function(e){var r=+e;return r>-1e-8&&r<1e-8?r-r*r/2:t(1+r)}},1729:e=>{"use strict";e.exports=Math.sign||function(e){var t=+e;return 0===t||t!=t?t:t<0?-1:1}},99208:e=>{"use strict";var t=Math.ceil,r=Math.floor;e.exports=Math.trunc||function(e){var n=+e;return(n>0?r:t)(n)}},91284:(e,t,r)=>{"use strict";var n,i,s,o,a,l=r(19042),c=r(64615),u=r(66790).f,d=r(80400).set,h=r(50026),p=r(25388),m=r(37205),f=r(95488),g=r(47285),y=l.MutationObserver||l.WebKitMutationObserver,b=l.document,v=l.process,_=l.Promise,x=u(l,"queueMicrotask"),w=x&&x.value;if(!w){var R=new h,k=function(){var e,t;for(g&&(e=v.domain)&&e.exit();t=R.get();)try{t()}catch(e){throw R.head&&n(),e}e&&e.enter()};p||g||f||!y||!b?!m&&_&&_.resolve?((o=_.resolve(void 0)).constructor=_,a=c(o.then,o),n=function(){a(k)}):g?n=function(){v.nextTick(k)}:(d=c(d,l),n=function(){d(k)}):(i=!0,s=b.createTextNode(""),new y(k).observe(s,{characterData:!0}),n=function(){s.data=i=!i}),w=function(e){R.head||n(),R.add(e)}}e.exports=w},98798:(e,t,r)=>{"use strict";var n=r(1343),i=TypeError,PromiseCapability=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw i("Bad Promise constructor");t=e,r=n})),this.resolve=n(t),this.reject=n(r)};e.exports.f=function(e){return new PromiseCapability(e)}},90800:(e,t,r)=>{"use strict";var n=r(34336);e.exports=function(e,t){return void 0===e?arguments.length<2?"":t:n(e)}},12762:(e,t,r)=>{"use strict";var n=r(10951),i=TypeError;e.exports=function(e){if(n(e))throw i("The method doesn't accept regular expressions");return e}},61285:(e,t,r)=>{"use strict";var n=r(19042).isFinite;e.exports=Number.isFinite||function(e){return"number"==typeof e&&n(e)}},91837:(e,t,r)=>{"use strict";var n=r(19042),i=r(63388),s=r(43171),o=r(34336),a=r(72889).trim,l=r(60235),c=s("".charAt),u=n.parseFloat,d=n.Symbol,h=d&&d.iterator,p=1/u(l+"-0")!=-1/0||h&&!i((function(){u(Object(h))}));e.exports=p?function(e){var t=a(o(e)),r=u(t);return 0===r&&"-"===c(t,0)?-0:r}:u},7802:(e,t,r)=>{"use strict";var n=r(19042),i=r(63388),s=r(43171),o=r(34336),a=r(72889).trim,l=r(60235),c=n.parseInt,u=n.Symbol,d=u&&u.iterator,h=/^[+-]?0x/i,p=s(h.exec),m=8!==c(l+"08")||22!==c(l+"0x16")||d&&!i((function(){c(Object(d))}));e.exports=m?function(e,t){var r=a(o(e));return c(r,t>>>0||(p(h,r)?16:10))}:c},92850:(e,t,r)=>{"use strict";var n=r(26471),i=r(43171),s=r(69562),o=r(63388),a=r(83435),l=r(64754),c=r(1054),u=r(58258),d=r(87394),h=Object.assign,p=Object.defineProperty,m=i([].concat);e.exports=!h||o((function(){if(n&&1!==h({b:1},h(p({},"a",{enumerable:!0,get:function(){p(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol("assign detection"),i="abcdefghijklmnopqrst";return e[r]=7,i.split("").forEach((function(e){t[e]=e})),7!==h({},e)[r]||a(h({},t)).join("")!==i}))?function(e,t){for(var r=u(e),i=arguments.length,o=1,h=l.f,p=c.f;i>o;)for(var f,g=d(arguments[o++]),y=h?m(a(g),h(g)):a(g),b=y.length,v=0;b>v;)f=y[v++],n&&!s(p,g,f)||(r[f]=g[f]);return r}:h},6731:(e,t,r)=>{"use strict";var n,i=r(66688),s=r(96700),o=r(7304),a=r(14226),l=r(87328),c=r(50880),u=r(88890),d="prototype",h="script",p=u("IE_PROTO"),EmptyConstructor=function(){},m=function(e){return"<"+h+">"+e+"</"+h+">"},NullProtoObjectViaActiveX=function(e){e.write(m("")),e.close();var t=e.parentWindow.Object;return e=null,t},NullProtoObject=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}var e,t,r;NullProtoObject="undefined"!=typeof document?document.domain&&n?NullProtoObjectViaActiveX(n):(t=c("iframe"),r="java"+h+":",t.style.display="none",l.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(m("document.F=Object")),e.close(),e.F):NullProtoObjectViaActiveX(n);for(var i=o.length;i--;)delete NullProtoObject[d][o[i]];return NullProtoObject()};a[p]=!0,e.exports=Object.create||function(e,t){var r;return null!==e?(EmptyConstructor[d]=i(e),r=new EmptyConstructor,EmptyConstructor[d]=null,r[p]=e):r=NullProtoObject(),void 0===t?r:s.f(r,t)}},96700:(e,t,r)=>{"use strict";var n=r(26471),i=r(46229),s=r(58204),o=r(66688),a=r(20990),l=r(83435);t.f=n&&!i?Object.defineProperties:function(e,t){o(e);for(var r,n=a(t),i=l(t),c=i.length,u=0;c>u;)s.f(e,r=i[u++],n[r]);return e}},58204:(e,t,r)=>{"use strict";var n=r(26471),i=r(54336),s=r(46229),o=r(66688),a=r(90422),l=TypeError,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d="enumerable",h="configurable",p="writable";t.f=n?s?function(e,t,r){if(o(e),t=a(t),o(r),"function"==typeof e&&"prototype"===t&&"value"in r&&p in r&&!r[p]){var n=u(e,t);n&&n[p]&&(e[t]=r.value,r={configurable:h in r?r[h]:n[h],enumerable:d in r?r[d]:n[d],writable:!1})}return c(e,t,r)}:c:function(e,t,r){if(o(e),t=a(t),o(r),i)try{return c(e,t,r)}catch(e){}if("get"in r||"set"in r)throw l("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},66790:(e,t,r)=>{"use strict";var n=r(26471),i=r(69562),s=r(1054),o=r(63833),a=r(20990),l=r(90422),c=r(98284),u=r(54336),d=Object.getOwnPropertyDescriptor;t.f=n?d:function(e,t){if(e=a(e),t=l(t),u)try{return d(e,t)}catch(e){}if(c(e,t))return o(!i(s.f,e,t),e[t])}},50703:(e,t,r)=>{"use strict";var n=r(67839),i=r(20990),s=r(68843).f,o=r(31538),a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return a&&"Window"===n(e)?function(e){try{return s(e)}catch(e){return o(a)}}(e):s(i(e))}},68843:(e,t,r)=>{"use strict";var n=r(89493),i=r(7304).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,i)}},64754:(e,t)=>{"use strict";t.f=Object.getOwnPropertySymbols},38740:(e,t,r)=>{"use strict";var n=r(98284),i=r(64506),s=r(58258),o=r(88890),a=r(42582),l=o("IE_PROTO"),c=Object,u=c.prototype;e.exports=a?c.getPrototypeOf:function(e){var t=s(e);if(n(t,l))return t[l];var r=t.constructor;return i(r)&&t instanceof r?r.prototype:t instanceof c?u:null}},66109:(e,t,r)=>{"use strict";var n=r(63388),i=r(21629),s=r(67839),o=r(28695),a=Object.isExtensible,l=n((function(){a(1)}));e.exports=l||o?function(e){return!!i(e)&&((!o||"ArrayBuffer"!==s(e))&&(!a||a(e)))}:a},11624:(e,t,r)=>{"use strict";var n=r(43171);e.exports=n({}.isPrototypeOf)},89493:(e,t,r)=>{"use strict";var n=r(43171),i=r(98284),s=r(20990),o=r(26484).indexOf,a=r(14226),l=n([].push);e.exports=function(e,t){var r,n=s(e),c=0,u=[];for(r in n)!i(a,r)&&i(n,r)&&l(u,r);for(;t.length>c;)i(n,r=t[c++])&&(~o(u,r)||l(u,r));return u}},83435:(e,t,r)=>{"use strict";var n=r(89493),i=r(7304);e.exports=Object.keys||function(e){return n(e,i)}},1054:(e,t)=>{"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,i=n&&!r.call({1:2},1);t.f=i?function(e){var t=n(this,e);return!!t&&t.enumerable}:r},10208:(e,t,r)=>{"use strict";var n=r(37792),i=r(19042),s=r(63388),o=r(44091);e.exports=n||!s((function(){if(!(o&&o<535)){var e=Math.random();__defineSetter__.call(null,e,(function(){})),delete i[e]}}))},15592:(e,t,r)=>{"use strict";var n=r(3023),i=r(66688),s=r(66571);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=n(Object.prototype,"__proto__","set"))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return i(r),s(n),t?e(r,n):r.__proto__=n,r}}():void 0)},75338:(e,t,r)=>{"use strict";var n=r(26471),i=r(63388),s=r(43171),o=r(38740),a=r(83435),l=r(20990),c=s(r(1054).f),u=s([].push),d=n&&i((function(){var e=Object.create(null);return e[2]=2,!c(e,2)})),h=function(e){return function(t){for(var r,i=l(t),s=a(i),h=d&&null===o(i),p=s.length,m=0,f=[];p>m;)r=s[m++],n&&!(h?r in i:c(i,r))||u(f,e?[r,i[r]]:i[r]);return f}};e.exports={entries:h(!0),values:h(!1)}},87758:(e,t,r)=>{"use strict";var n=r(63647),i=r(57228);e.exports=n?{}.toString:function(){return"[object "+i(this)+"]"}},88309:(e,t,r)=>{"use strict";var n=r(69562),i=r(64506),s=r(21629),o=TypeError;e.exports=function(e,t){var r,a;if("string"===t&&i(r=e.toString)&&!s(a=n(r,e)))return a;if(i(r=e.valueOf)&&!s(a=n(r,e)))return a;if("string"!==t&&i(r=e.toString)&&!s(a=n(r,e)))return a;throw o("Can't convert object to primitive value")}},33618:(e,t,r)=>{"use strict";var n=r(84830),i=r(43171),s=r(68843),o=r(64754),a=r(66688),l=i([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=s.f(a(e)),r=o.f;return r?l(t,r(e)):t}},18814:(e,t,r)=>{"use strict";var n=r(19042);e.exports=n},52068:e=>{"use strict";e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},35567:(e,t,r)=>{"use strict";var n=r(19042),i=r(6231),s=r(64506),o=r(71767),a=r(3127),l=r(60664),c=r(47677),u=r(54361),d=r(37792),h=r(91795),p=i&&i.prototype,m=l("species"),f=!1,g=s(n.PromiseRejectionEvent),y=o("Promise",(function(){var e=a(i),t=e!==String(i);if(!t&&66===h)return!0;if(d&&(!p.catch||!p.finally))return!0;if(!h||h<51||!/native code/.test(e)){var r=new i((function(e){e(1)})),FakePromise=function(e){e((function(){}),(function(){}))};if((r.constructor={})[m]=FakePromise,!(f=r.then((function(){}))instanceof FakePromise))return!0}return!t&&(c||u)&&!g}));e.exports={CONSTRUCTOR:y,REJECTION_EVENT:g,SUBCLASSING:f}},6231:(e,t,r)=>{"use strict";var n=r(19042);e.exports=n.Promise},60545:(e,t,r)=>{"use strict";var n=r(66688),i=r(21629),s=r(98798);e.exports=function(e,t){if(n(e),i(t)&&t.constructor===e)return t;var r=s.f(e);return(0,r.resolve)(t),r.promise}},27138:(e,t,r)=>{"use strict";var n=r(6231),i=r(78489),s=r(35567).CONSTRUCTOR;e.exports=s||!i((function(e){n.all(e).then(void 0,(function(){}))}))},26269:(e,t,r)=>{"use strict";var n=r(58204).f;e.exports=function(e,t,r){r in e||n(e,r,{configurable:!0,get:function(){return t[r]},set:function(e){t[r]=e}})}},50026:e=>{"use strict";var Queue=function(){this.head=null,this.tail=null};Queue.prototype={add:function(e){var t={item:e,next:null},r=this.tail;r?r.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}},e.exports=Queue},69163:(e,t,r)=>{"use strict";var n=r(69562),i=r(66688),s=r(64506),o=r(67839),a=r(57604),l=TypeError;e.exports=function(e,t){var r=e.exec;if(s(r)){var c=n(r,e,t);return null!==c&&i(c),c}if("RegExp"===o(e))return n(a,e,t);throw l("RegExp#exec called on incompatible receiver")}},57604:(e,t,r)=>{"use strict";var n,i,s=r(69562),o=r(43171),a=r(34336),l=r(28342),c=r(2422),u=r(30728),d=r(6731),h=r(76980).get,p=r(2390),m=r(79827),f=u("native-string-replace",String.prototype.replace),g=RegExp.prototype.exec,y=g,b=o("".charAt),v=o("".indexOf),_=o("".replace),x=o("".slice),w=(i=/b*/g,s(g,n=/a/,"a"),s(g,i,"a"),0!==n.lastIndex||0!==i.lastIndex),R=c.BROKEN_CARET,k=void 0!==/()??/.exec("")[1];(w||k||R||p||m)&&(y=function(e){var t,r,n,i,o,c,u,p=this,m=h(p),j=a(e),z=m.raw;if(z)return z.lastIndex=p.lastIndex,t=s(y,z,j),p.lastIndex=z.lastIndex,t;var q=m.groups,$=R&&p.sticky,Z=s(l,p),X=p.source,Y=0,ee=j;if($&&(Z=_(Z,"y",""),-1===v(Z,"g")&&(Z+="g"),ee=x(j,p.lastIndex),p.lastIndex>0&&(!p.multiline||p.multiline&&"\n"!==b(j,p.lastIndex-1))&&(X="(?: "+X+")",ee=" "+ee,Y++),r=new RegExp("^(?:"+X+")",Z)),k&&(r=new RegExp("^"+X+"$(?!\\s)",Z)),w&&(n=p.lastIndex),i=s(g,$?r:p,ee),$?i?(i.input=x(i.input,Y),i[0]=x(i[0],Y),i.index=p.lastIndex,p.lastIndex+=i[0].length):p.lastIndex=0:w&&i&&(p.lastIndex=p.global?i.index+i[0].length:n),k&&i&&i.length>1&&s(f,i[0],r,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(i[o]=void 0)})),i&&q)for(i.groups=c=d(null),o=0;o<q.length;o++)c[(u=q[o])[0]]=i[u[1]];return i}),e.exports=y},28342:(e,t,r)=>{"use strict";var n=r(66688);e.exports=function(){var e=n(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}},28263:(e,t,r)=>{"use strict";var n=r(69562),i=r(98284),s=r(11624),o=r(28342),a=RegExp.prototype;e.exports=function(e){var t=e.flags;return void 0!==t||"flags"in a||i(e,"flags")||!s(a,e)?t:n(o,e)}},2422:(e,t,r)=>{"use strict";var n=r(63388),i=r(19042).RegExp,s=n((function(){var e=i("a","y");return e.lastIndex=2,null!==e.exec("abcd")})),o=s||n((function(){return!i("a","y").sticky})),a=s||n((function(){var e=i("^r","gy");return e.lastIndex=2,null!==e.exec("str")}));e.exports={BROKEN_CARET:a,MISSED_STICKY:o,UNSUPPORTED_Y:s}},2390:(e,t,r)=>{"use strict";var n=r(63388),i=r(19042).RegExp;e.exports=n((function(){var e=i(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)}))},79827:(e,t,r)=>{"use strict";var n=r(63388),i=r(19042).RegExp;e.exports=n((function(){var e=i("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")}))},1455:(e,t,r)=>{"use strict";var n=r(74192),i=TypeError;e.exports=function(e){if(n(e))throw i("Can't call method on "+e);return e}},24371:e=>{"use strict";e.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},39173:(e,t,r)=>{"use strict";var n,i=r(19042),s=r(88168),o=r(64506),a=r(84820),l=r(66819),c=r(34147),u=r(46147),d=i.Function,h=/MSIE .\./.test(l)||a&&((n=i.Bun.version.split(".")).length<3||"0"===n[0]&&(n[1]<3||"3"===n[1]&&"0"===n[2]));e.exports=function(e,t){var r=t?2:1;return h?function(n,i){var a=u(arguments.length,1)>r,l=o(n)?n:d(n),h=a?c(arguments,r):[],p=a?function(){s(l,this,h)}:l;return t?e(p,i):e(p)}:e}},8201:(e,t,r)=>{"use strict";var n=r(43171),i=Set.prototype;e.exports={Set,add:n(i.add),has:n(i.has),remove:n(i.delete),proto:i}},93886:(e,t,r)=>{"use strict";var n=r(84830),i=r(60851),s=r(60664),o=r(26471),a=s("species");e.exports=function(e){var t=n(e);o&&t&&!t[a]&&i(t,a,{configurable:!0,get:function(){return this}})}},99176:(e,t,r)=>{"use strict";var n=r(58204).f,i=r(98284),s=r(60664)("toStringTag");e.exports=function(e,t,r){e&&!r&&(e=e.prototype),e&&!i(e,s)&&n(e,s,{configurable:!0,value:t})}},88890:(e,t,r)=>{"use strict";var n=r(30728),i=r(33043),s=n("keys");e.exports=function(e){return s[e]||(s[e]=i(e))}},93712:(e,t,r)=>{"use strict";var n=r(19042),i=r(34900),s="__core-js_shared__",o=n[s]||i(s,{});e.exports=o},30728:(e,t,r)=>{"use strict";var n=r(37792),i=r(93712);(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.32.2",mode:n?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.32.2/LICENSE",source:"https://github.com/zloirock/core-js"})},2418:(e,t,r)=>{"use strict";var n=r(66688),i=r(32747),s=r(74192),o=r(60664)("species");e.exports=function(e,t){var r,a=n(e).constructor;return void 0===a||s(r=n(a)[o])?t:i(r)}},78916:(e,t,r)=>{"use strict";var n=r(63388);e.exports=function(e){return n((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}))}},67710:(e,t,r)=>{"use strict";var n=r(43171),i=r(71738),s=r(34336),o=r(1455),a=n("".charAt),l=n("".charCodeAt),c=n("".slice),u=function(e){return function(t,r){var n,u,d=s(o(t)),h=i(r),p=d.length;return h<0||h>=p?e?"":void 0:(n=l(d,h))<55296||n>56319||h+1===p||(u=l(d,h+1))<56320||u>57343?e?a(d,h):n:e?c(d,h,h+2):u-56320+(n-55296<<10)+65536}};e.exports={codeAt:u(!1),charAt:u(!0)}},98436:(e,t,r)=>{"use strict";var n=r(66819);e.exports=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(n)},83932:(e,t,r)=>{"use strict";var n=r(43171),i=r(64001),s=r(34336),o=r(32562),a=r(1455),l=n(o),c=n("".slice),u=Math.ceil,d=function(e){return function(t,r,n){var o,d,h=s(a(t)),p=i(r),m=h.length,f=void 0===n?" ":s(n);return p<=m||""===f?h:((d=l(f,u((o=p-m)/f.length))).length>o&&(d=c(d,0,o)),e?h+d:d+h)}};e.exports={start:d(!1),end:d(!0)}},68292:(e,t,r)=>{"use strict";var n=r(43171),i=2147483647,s=/[^\0-\u007E]/,o=/[.\u3002\uFF0E\uFF61]/g,a="Overflow: input needs wider integers to process",l=RangeError,c=n(o.exec),u=Math.floor,d=String.fromCharCode,h=n("".charCodeAt),p=n([].join),m=n([].push),f=n("".replace),g=n("".split),y=n("".toLowerCase),b=function(e){return e+22+75*(e<26)},v=function(e,t,r){var n=0;for(e=r?u(e/700):e>>1,e+=u(e/t);e>455;)e=u(e/35),n+=36;return u(n+36*e/(e+38))},_=function(e){var t=[];e=function(e){for(var t=[],r=0,n=e.length;r<n;){var i=h(e,r++);if(i>=55296&&i<=56319&&r<n){var s=h(e,r++);56320==(64512&s)?m(t,((1023&i)<<10)+(1023&s)+65536):(m(t,i),r--)}else m(t,i)}return t}(e);var r,n,s=e.length,o=128,c=0,f=72;for(r=0;r<e.length;r++)(n=e[r])<128&&m(t,d(n));var g=t.length,y=g;for(g&&m(t,"-");y<s;){var _=i;for(r=0;r<e.length;r++)(n=e[r])>=o&&n<_&&(_=n);var x=y+1;if(_-o>u((i-c)/x))throw l(a);for(c+=(_-o)*x,o=_,r=0;r<e.length;r++){if((n=e[r])<o&&++c>i)throw l(a);if(n===o){for(var w=c,R=36;;){var k=R<=f?1:R>=f+26?26:R-f;if(w<k)break;var j=w-k,z=36-k;m(t,d(b(k+j%z))),w=u(j/z),R+=36}m(t,d(b(w))),f=v(c,x,y===g),c=0,y++}}c++,o++}return p(t,"")};e.exports=function(e){var t,r,n=[],i=g(f(y(e),o,"."),".");for(t=0;t<i.length;t++)r=i[t],m(n,c(s,r)?"xn--"+_(r):r);return p(n,".")}},32562:(e,t,r)=>{"use strict";var n=r(71738),i=r(34336),s=r(1455),o=RangeError;e.exports=function(e){var t=i(s(this)),r="",a=n(e);if(a<0||a===1/0)throw o("Wrong number of repetitions");for(;a>0;(a>>>=1)&&(t+=t))1&a&&(r+=t);return r}},19353:(e,t,r)=>{"use strict";var n=r(72889).end,i=r(42395);e.exports=i("trimEnd")?function(){return n(this)}:"".trimEnd},42395:(e,t,r)=>{"use strict";var n=r(5265).PROPER,i=r(63388),s=r(60235);e.exports=function(e){return i((function(){return!!s[e]()||"​᠎"!=="​᠎"[e]()||n&&s[e].name!==e}))}},62344:(e,t,r)=>{"use strict";var n=r(72889).start,i=r(42395);e.exports=i("trimStart")?function(){return n(this)}:"".trimStart},72889:(e,t,r)=>{"use strict";var n=r(43171),i=r(1455),s=r(34336),o=r(60235),a=n("".replace),l=RegExp("^["+o+"]+"),c=RegExp("(^|[^"+o+"])["+o+"]+$"),u=function(e){return function(t){var r=s(i(t));return 1&e&&(r=a(r,l,"")),2&e&&(r=a(r,c,"$1")),r}};e.exports={start:u(1),end:u(2),trim:u(3)}},2645:(e,t,r)=>{"use strict";var n=r(19042),i=r(63388),s=r(91795),o=r(47677),a=r(54361),l=r(47285),c=n.structuredClone;e.exports=!!c&&!i((function(){if(a&&s>92||l&&s>94||o&&s>97)return!1;var e=new ArrayBuffer(8),t=c(e,{transfer:[e]});return 0!==e.byteLength||8!==t.byteLength}))},51766:(e,t,r)=>{"use strict";var n=r(91795),i=r(63388),s=r(19042).String;e.exports=!!Object.getOwnPropertySymbols&&!i((function(){var e=Symbol("symbol detection");return!s(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},59355:(e,t,r)=>{"use strict";var n=r(69562),i=r(84830),s=r(60664),o=r(70119);e.exports=function(){var e=i("Symbol"),t=e&&e.prototype,r=t&&t.valueOf,a=s("toPrimitive");t&&!t[a]&&o(t,a,(function(e){return n(r,this)}),{arity:1})}},38507:(e,t,r)=>{"use strict";var n=r(51766);e.exports=n&&!!Symbol.for&&!!Symbol.keyFor},80400:(e,t,r)=>{"use strict";var n,i,s,o,a=r(19042),l=r(88168),c=r(64615),u=r(64506),d=r(98284),h=r(63388),p=r(87328),m=r(34147),f=r(50880),g=r(46147),y=r(25388),b=r(47285),v=a.setImmediate,_=a.clearImmediate,x=a.process,w=a.Dispatch,R=a.Function,k=a.MessageChannel,j=a.String,z=0,q={},$="onreadystatechange";h((function(){n=a.location}));var Z=function(e){if(d(q,e)){var t=q[e];delete q[e],t()}},X=function(e){return function(){Z(e)}},Y=function(e){Z(e.data)},ee=function(e){a.postMessage(j(e),n.protocol+"//"+n.host)};v&&_||(v=function(e){g(arguments.length,1);var t=u(e)?e:R(e),r=m(arguments,1);return q[++z]=function(){l(t,void 0,r)},i(z),z},_=function(e){delete q[e]},b?i=function(e){x.nextTick(X(e))}:w&&w.now?i=function(e){w.now(X(e))}:k&&!y?(o=(s=new k).port2,s.port1.onmessage=Y,i=c(o.postMessage,o)):a.addEventListener&&u(a.postMessage)&&!a.importScripts&&n&&"file:"!==n.protocol&&!h(ee)?(i=ee,a.addEventListener("message",Y,!1)):i=$ in f("script")?function(e){p.appendChild(f("script"))[$]=function(){p.removeChild(this),Z(e)}}:function(e){setTimeout(X(e),0)}),e.exports={set:v,clear:_}},85007:(e,t,r)=>{"use strict";var n=r(43171);e.exports=n(1..valueOf)},96017:(e,t,r)=>{"use strict";var n=r(71738),i=Math.max,s=Math.min;e.exports=function(e,t){var r=n(e);return r<0?i(r+t,0):s(r,t)}},98923:(e,t,r)=>{"use strict";var n=r(39356),i=TypeError;e.exports=function(e){var t=n(e,"number");if("number"==typeof t)throw i("Can't convert number to bigint");return BigInt(t)}},8473:(e,t,r)=>{"use strict";var n=r(71738),i=r(64001),s=RangeError;e.exports=function(e){if(void 0===e)return 0;var t=n(e),r=i(t);if(t!==r)throw s("Wrong length or index");return r}},20990:(e,t,r)=>{"use strict";var n=r(87394),i=r(1455);e.exports=function(e){return n(i(e))}},71738:(e,t,r)=>{"use strict";var n=r(99208);e.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}},64001:(e,t,r)=>{"use strict";var n=r(71738),i=Math.min;e.exports=function(e){return e>0?i(n(e),9007199254740991):0}},58258:(e,t,r)=>{"use strict";var n=r(1455),i=Object;e.exports=function(e){return i(n(e))}},78118:(e,t,r)=>{"use strict";var n=r(91753),i=RangeError;e.exports=function(e,t){var r=n(e);if(r%t)throw i("Wrong offset");return r}},91753:(e,t,r)=>{"use strict";var n=r(71738),i=RangeError;e.exports=function(e){var t=n(e);if(t<0)throw i("The argument can't be less than 0");return t}},39356:(e,t,r)=>{"use strict";var n=r(69562),i=r(21629),s=r(85706),o=r(84839),a=r(88309),l=r(60664),c=TypeError,u=l("toPrimitive");e.exports=function(e,t){if(!i(e)||s(e))return e;var r,l=o(e,u);if(l){if(void 0===t&&(t="default"),r=n(l,e,t),!i(r)||s(r))return r;throw c("Can't convert object to primitive value")}return void 0===t&&(t="number"),a(e,t)}},90422:(e,t,r)=>{"use strict";var n=r(39356),i=r(85706);e.exports=function(e){var t=n(e,"string");return i(t)?t:t+""}},63647:(e,t,r)=>{"use strict";var n={};n[r(60664)("toStringTag")]="z",e.exports="[object z]"===String(n)},34336:(e,t,r)=>{"use strict";var n=r(57228),i=String;e.exports=function(e){if("Symbol"===n(e))throw TypeError("Cannot convert a Symbol value to a string");return i(e)}},85286:e=>{"use strict";var t=Math.round;e.exports=function(e){var r=t(e);return r<0?0:r>255?255:255&r}},78795:(e,t,r)=>{"use strict";var n=r(47285);e.exports=function(e){try{if(n)return Function('return require("'+e+'")')()}catch(e){}}},65840:e=>{"use strict";var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},49300:(e,t,r)=>{"use strict";var n=r(90915),i=r(19042),s=r(69562),o=r(26471),a=r(5882),l=r(87545),c=r(93679),u=r(15036),d=r(63833),h=r(43882),p=r(26410),m=r(64001),f=r(8473),g=r(78118),y=r(85286),b=r(90422),v=r(98284),_=r(57228),x=r(21629),w=r(85706),R=r(6731),k=r(11624),j=r(15592),z=r(68843).f,q=r(28046),$=r(68214).forEach,Z=r(93886),X=r(60851),Y=r(58204),ee=r(66790),te=r(76980),re=r(15540),ne=te.get,ie=te.set,se=te.enforce,oe=Y.f,ae=ee.f,le=i.RangeError,ce=c.ArrayBuffer,ue=ce.prototype,de=c.DataView,he=l.NATIVE_ARRAY_BUFFER_VIEWS,pe=l.TYPED_ARRAY_TAG,me=l.TypedArray,fe=l.TypedArrayPrototype,ge=l.aTypedArrayConstructor,ye=l.isTypedArray,be="BYTES_PER_ELEMENT",ve="Wrong length",_e=function(e,t){ge(e);for(var r=0,n=t.length,i=new e(n);n>r;)i[r]=t[r++];return i},xe=function(e,t){X(e,t,{configurable:!0,get:function(){return ne(this)[t]}})},we=function(e){var t;return k(ue,e)||"ArrayBuffer"===(t=_(e))||"SharedArrayBuffer"===t},Se=function(e,t){return ye(e)&&!w(t)&&t in e&&p(+t)&&t>=0},Pe=function(e,t){return t=b(t),Se(e,t)?d(2,e[t]):ae(e,t)},Te=function(e,t,r){return t=b(t),!(Se(e,t)&&x(r)&&v(r,"value"))||v(r,"get")||v(r,"set")||r.configurable||v(r,"writable")&&!r.writable||v(r,"enumerable")&&!r.enumerable?oe(e,t,r):(e[t]=r.value,e)};o?(he||(ee.f=Pe,Y.f=Te,xe(fe,"buffer"),xe(fe,"byteOffset"),xe(fe,"byteLength"),xe(fe,"length")),n({target:"Object",stat:!0,forced:!he},{getOwnPropertyDescriptor:Pe,defineProperty:Te}),e.exports=function(e,t,r){var o=e.match(/\d+/)[0]/8,l=e+(r?"Clamped":"")+"Array",c="get"+e,d="set"+e,p=i[l],b=p,v=b&&b.prototype,_={},w=function(e,t){oe(e,t,{get:function(){return function(e,t){var r=ne(e);return r.view[c](t*o+r.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,n){var i=ne(e);i.view[d](t*o+i.byteOffset,r?y(n):n,!0)}(this,t,e)},enumerable:!0})};he?a&&(b=t((function(e,t,r,n){return u(e,v),re(x(t)?we(t)?void 0!==n?new p(t,g(r,o),n):void 0!==r?new p(t,g(r,o)):new p(t):ye(t)?_e(b,t):s(q,b,t):new p(f(t)),e,b)})),j&&j(b,me),$(z(p),(function(e){e in b||h(b,e,p[e])})),b.prototype=v):(b=t((function(e,t,r,n){u(e,v);var i,a,l,c=0,d=0;if(x(t)){if(!we(t))return ye(t)?_e(b,t):s(q,b,t);i=t,d=g(r,o);var h=t.byteLength;if(void 0===n){if(h%o)throw le(ve);if((a=h-d)<0)throw le(ve)}else if((a=m(n)*o)+d>h)throw le(ve);l=a/o}else l=f(t),i=new ce(a=l*o);for(ie(e,{buffer:i,byteOffset:d,byteLength:a,length:l,view:new de(i)});c<l;)w(e,c++)})),j&&j(b,me),v=b.prototype=R(fe)),v.constructor!==b&&h(v,"constructor",b),se(v).TypedArrayConstructor=b,pe&&h(v,pe,l);var k=b!==p;_[l]=b,n({global:!0,constructor:!0,forced:k,sham:!he},_),be in b||h(b,be,o),be in v||h(v,be,o),Z(l)}):e.exports=function(){}},5882:(e,t,r)=>{"use strict";var n=r(19042),i=r(63388),s=r(78489),o=r(87545).NATIVE_ARRAY_BUFFER_VIEWS,a=n.ArrayBuffer,l=n.Int8Array;e.exports=!o||!i((function(){l(1)}))||!i((function(){new l(-1)}))||!s((function(e){new l,new l(null),new l(1.5),new l(e)}),!0)||i((function(){return 1!==new l(new a(2),1,void 0).length}))},11266:(e,t,r)=>{"use strict";var n=r(9157),i=r(56647);e.exports=function(e,t){return n(i(e),t)}},28046:(e,t,r)=>{"use strict";var n=r(64615),i=r(69562),s=r(32747),o=r(58258),a=r(46799),l=r(87916),c=r(60248),u=r(15300),d=r(47006),h=r(87545).aTypedArrayConstructor,p=r(98923);e.exports=function(e){var t,r,m,f,g,y,b,v,_=s(this),x=o(e),w=arguments.length,R=w>1?arguments[1]:void 0,k=void 0!==R,j=c(x);if(j&&!u(j))for(v=(b=l(x,j)).next,x=[];!(y=i(v,b)).done;)x.push(y.value);for(k&&w>2&&(R=n(R,arguments[2])),r=a(x),m=new(h(_))(r),f=d(m),t=0;r>t;t++)g=k?R(x[t],t):x[t],m[t]=f?p(g):+g;return m}},56647:(e,t,r)=>{"use strict";var n=r(87545),i=r(2418),s=n.aTypedArrayConstructor,o=n.getTypedArrayConstructor;e.exports=function(e){return s(i(e,o(e)))}},33043:(e,t,r)=>{"use strict";var n=r(43171),i=0,s=Math.random(),o=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+o(++i+s,36)}},18423:(e,t,r)=>{"use strict";var n=r(63388),i=r(60664),s=r(26471),o=r(37792),a=i("iterator");e.exports=!n((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,r=new URLSearchParams("a=1&a=2&b=3"),n="";return e.pathname="c%20d",t.forEach((function(e,r){t.delete("b"),n+=r+e})),r.delete("a",2),r.delete("b",void 0),o&&(!e.toJSON||!r.has("a",1)||r.has("a",2)||!r.has("a",void 0)||r.has("b"))||!t.size&&(o||!s)||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[a]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host}))},50871:(e,t,r)=>{"use strict";var n=r(51766);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},46229:(e,t,r)=>{"use strict";var n=r(26471),i=r(63388);e.exports=n&&i((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},46147:e=>{"use strict";var t=TypeError;e.exports=function(e,r){if(e<r)throw t("Not enough arguments");return e}},78167:(e,t,r)=>{"use strict";var n=r(19042),i=r(64506),s=n.WeakMap;e.exports=i(s)&&/native code/.test(String(s))},46654:(e,t,r)=>{"use strict";var n=r(18814),i=r(98284),s=r(4128),o=r(58204).f;e.exports=function(e){var t=n.Symbol||(n.Symbol={});i(t,e)||o(t,e,{value:s.f(e)})}},4128:(e,t,r)=>{"use strict";var n=r(60664);t.f=n},60664:(e,t,r)=>{"use strict";var n=r(19042),i=r(30728),s=r(98284),o=r(33043),a=r(51766),l=r(50871),c=n.Symbol,u=i("wks"),d=l?c.for||c:c&&c.withoutSetter||o;e.exports=function(e){return s(u,e)||(u[e]=a&&s(c,e)?c[e]:d("Symbol."+e)),u[e]}},60235:e=>{"use strict";e.exports="\t\n\v\f\r                　\u2028\u2029\ufeff"},50190:(e,t,r)=>{"use strict";var n=r(84830),i=r(98284),s=r(43882),o=r(11624),a=r(15592),l=r(44123),c=r(26269),u=r(15540),d=r(90800),h=r(1451),p=r(14028),m=r(26471),f=r(37792);e.exports=function(e,t,r,g){var y="stackTraceLimit",b=g?2:1,v=e.split("."),_=v[v.length-1],x=n.apply(null,v);if(x){var w=x.prototype;if(!f&&i(w,"cause")&&delete w.cause,!r)return x;var R=n("Error"),k=t((function(e,t){var r=d(g?t:e,void 0),n=g?new x(e):new x;return void 0!==r&&s(n,"message",r),p(n,k,n.stack,2),this&&o(w,this)&&u(n,this,k),arguments.length>b&&h(n,arguments[b]),n}));if(k.prototype=w,"Error"!==_?a?a(k,R):l(k,R,{name:!0}):m&&y in x&&(c(k,x,y),c(k,x,"prepareStackTrace")),l(k,x),!f)try{w.name!==_&&s(w,"name",_),w.constructor=k}catch(e){}return k}}},99555:(e,t,r)=>{"use strict";var n=r(90915),i=r(84830),s=r(88168),o=r(63388),a=r(50190),l="AggregateError",c=i(l),u=!o((function(){return 1!==c([1]).errors[0]}))&&o((function(){return 7!==c([1],l,{cause:7}).cause}));n({global:!0,constructor:!0,arity:2,forced:u},{AggregateError:a(l,(function(e){return function(t,r){return s(e,this,arguments)}}),u,!0)})},47664:(e,t,r)=>{"use strict";var n=r(90915),i=r(11624),s=r(38740),o=r(15592),a=r(44123),l=r(6731),c=r(43882),u=r(63833),d=r(1451),h=r(14028),p=r(3079),m=r(90800),f=r(60664)("toStringTag"),g=Error,y=[].push,b=function(e,t){var r,n=i(v,this);o?r=o(g(),n?s(this):v):(r=n?this:l(v),c(r,f,"Error")),void 0!==t&&c(r,"message",m(t)),h(r,b,r.stack,1),arguments.length>2&&d(r,arguments[2]);var a=[];return p(e,y,{that:a}),c(r,"errors",a),r};o?o(b,g):a(b,g,{name:!0});var v=b.prototype=l(g.prototype,{constructor:u(1,b),message:u(1,""),name:u(1,"AggregateError")});n({global:!0,constructor:!0,arity:2},{AggregateError:b})},73574:(e,t,r)=>{"use strict";r(47664)},47364:(e,t,r)=>{"use strict";var n=r(90915),i=r(19042),s=r(93679),o=r(93886),a="ArrayBuffer",l=s[a];n({global:!0,constructor:!0,forced:i[a]!==l},{ArrayBuffer:l}),o(a)},48634:(e,t,r)=>{"use strict";var n=r(90915),i=r(87545);n({target:"ArrayBuffer",stat:!0,forced:!i.NATIVE_ARRAY_BUFFER_VIEWS},{isView:i.isView})},53794:(e,t,r)=>{"use strict";var n=r(90915),i=r(17337),s=r(63388),o=r(93679),a=r(66688),l=r(96017),c=r(64001),u=r(2418),d=o.ArrayBuffer,h=o.DataView,p=h.prototype,m=i(d.prototype.slice),f=i(p.getUint8),g=i(p.setUint8);n({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:s((function(){return!new d(2).slice(1,void 0).byteLength}))},{slice:function(e,t){if(m&&void 0===t)return m(a(this),e);for(var r=a(this).byteLength,n=l(e,r),i=l(void 0===t?r:t,r),s=new(u(this,d))(c(i-n)),o=new h(this),p=new h(s),y=0;n<i;)g(p,y++,f(o,n++));return s}})},73168:(e,t,r)=>{"use strict";var n=r(90915),i=r(58258),s=r(46799),o=r(71738),a=r(76380);n({target:"Array",proto:!0},{at:function(e){var t=i(this),r=s(t),n=o(e),a=n>=0?n:r+n;return a<0||a>=r?void 0:t[a]}}),a("at")},64065:(e,t,r)=>{"use strict";var n=r(90915),i=r(63388),s=r(84321),o=r(21629),a=r(58258),l=r(46799),c=r(12264),u=r(90071),d=r(34168),h=r(56240),p=r(60664),m=r(91795),f=p("isConcatSpreadable"),g=m>=51||!i((function(){var e=[];return e[f]=!1,e.concat()[0]!==e})),y=function(e){if(!o(e))return!1;var t=e[f];return void 0!==t?!!t:s(e)};n({target:"Array",proto:!0,arity:1,forced:!g||!h("concat")},{concat:function(e){var t,r,n,i,s,o=a(this),h=d(o,0),p=0;for(t=-1,n=arguments.length;t<n;t++)if(y(s=-1===t?o:arguments[t]))for(i=l(s),c(p+i),r=0;r<i;r++,p++)r in s&&u(h,p,s[r]);else c(p+1),u(h,p++,s);return h.length=p,h}})},91178:(e,t,r)=>{"use strict";var n=r(90915),i=r(9866),s=r(76380);n({target:"Array",proto:!0},{copyWithin:i}),s("copyWithin")},47030:(e,t,r)=>{"use strict";var n=r(90915),i=r(68214).every;n({target:"Array",proto:!0,forced:!r(89479)("every")},{every:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},84472:(e,t,r)=>{"use strict";var n=r(90915),i=r(52024),s=r(76380);n({target:"Array",proto:!0},{fill:i}),s("fill")},63583:(e,t,r)=>{"use strict";var n=r(90915),i=r(68214).filter;n({target:"Array",proto:!0,forced:!r(56240)("filter")},{filter:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},21303:(e,t,r)=>{"use strict";var n=r(90915),i=r(68214).findIndex,s=r(76380),o="findIndex",a=!0;o in[]&&Array(1)[o]((function(){a=!1})),n({target:"Array",proto:!0,forced:a},{findIndex:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),s(o)},96338:(e,t,r)=>{"use strict";var n=r(90915),i=r(41508).findLastIndex,s=r(76380);n({target:"Array",proto:!0},{findLastIndex:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),s("findLastIndex")},3587:(e,t,r)=>{"use strict";var n=r(90915),i=r(41508).findLast,s=r(76380);n({target:"Array",proto:!0},{findLast:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),s("findLast")},50402:(e,t,r)=>{"use strict";var n=r(90915),i=r(68214).find,s=r(76380),o="find",a=!0;o in[]&&Array(1)[o]((function(){a=!1})),n({target:"Array",proto:!0,forced:a},{find:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),s(o)},96437:(e,t,r)=>{"use strict";var n=r(90915),i=r(83334),s=r(1343),o=r(58258),a=r(46799),l=r(34168);n({target:"Array",proto:!0},{flatMap:function(e){var t,r=o(this),n=a(r);return s(e),(t=l(r,0)).length=i(t,r,r,n,0,1,e,arguments.length>1?arguments[1]:void 0),t}})},83490:(e,t,r)=>{"use strict";var n=r(90915),i=r(83334),s=r(58258),o=r(46799),a=r(71738),l=r(34168);n({target:"Array",proto:!0},{flat:function(){var e=arguments.length?arguments[0]:void 0,t=s(this),r=o(t),n=l(t,0);return n.length=i(n,t,t,r,0,void 0===e?1:a(e)),n}})},65170:(e,t,r)=>{"use strict";var n=r(90915),i=r(24338);n({target:"Array",proto:!0,forced:[].forEach!==i},{forEach:i})},7661:(e,t,r)=>{"use strict";var n=r(90915),i=r(91565);n({target:"Array",stat:!0,forced:!r(78489)((function(e){Array.from(e)}))},{from:i})},67316:(e,t,r)=>{"use strict";var n=r(90915),i=r(26484).includes,s=r(63388),o=r(76380);n({target:"Array",proto:!0,forced:s((function(){return!Array(1).includes()}))},{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),o("includes")},23047:(e,t,r)=>{"use strict";var n=r(90915),i=r(17337),s=r(26484).indexOf,o=r(89479),a=i([].indexOf),l=!!a&&1/a([1],1,-0)<0;n({target:"Array",proto:!0,forced:l||!o("indexOf")},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return l?a(this,e,t)||0:s(this,e,t)}})},10873:(e,t,r)=>{"use strict";r(90915)({target:"Array",stat:!0},{isArray:r(84321)})},22867:(e,t,r)=>{"use strict";var n=r(20990),i=r(76380),s=r(46782),o=r(76980),a=r(58204).f,l=r(70407),c=r(93166),u=r(37792),d=r(26471),h="Array Iterator",p=o.set,m=o.getterFor(h);e.exports=l(Array,"Array",(function(e,t){p(this,{type:h,target:n(e),index:0,kind:t})}),(function(){var e=m(this),t=e.target,r=e.kind,n=e.index++;if(!t||n>=t.length)return e.target=void 0,c(void 0,!0);switch(r){case"keys":return c(n,!1);case"values":return c(t[n],!1)}return c([n,t[n]],!1)}),"values");var f=s.Arguments=s.Array;if(i("keys"),i("values"),i("entries"),!u&&d&&"values"!==f.name)try{a(f,"name",{value:"values"})}catch(e){}},67221:(e,t,r)=>{"use strict";var n=r(90915),i=r(43171),s=r(87394),o=r(20990),a=r(89479),l=i([].join);n({target:"Array",proto:!0,forced:s!==Object||!a("join",",")},{join:function(e){return l(o(this),void 0===e?",":e)}})},42280:(e,t,r)=>{"use strict";var n=r(90915),i=r(68488);n({target:"Array",proto:!0,forced:i!==[].lastIndexOf},{lastIndexOf:i})},91407:(e,t,r)=>{"use strict";var n=r(90915),i=r(68214).map;n({target:"Array",proto:!0,forced:!r(56240)("map")},{map:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},69876:(e,t,r)=>{"use strict";var n=r(90915),i=r(63388),s=r(51372),o=r(90071),a=Array;n({target:"Array",stat:!0,forced:i((function(){function F(){}return!(a.of.call(F)instanceof F)}))},{of:function(){for(var e=0,t=arguments.length,r=new(s(this)?this:a)(t);t>e;)o(r,e,arguments[e++]);return r.length=t,r}})},53921:(e,t,r)=>{"use strict";var n=r(90915),i=r(58258),s=r(46799),o=r(59978),a=r(12264);n({target:"Array",proto:!0,arity:1,forced:r(63388)((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=i(this),r=s(t),n=arguments.length;a(r+n);for(var l=0;l<n;l++)t[r]=arguments[l],r++;return o(t,r),r}})},81244:(e,t,r)=>{"use strict";var n=r(90915),i=r(71379).right,s=r(89479),o=r(91795);n({target:"Array",proto:!0,forced:!r(47285)&&o>79&&o<83||!s("reduceRight")},{reduceRight:function(e){return i(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}})},82451:(e,t,r)=>{"use strict";var n=r(90915),i=r(71379).left,s=r(89479),o=r(91795);n({target:"Array",proto:!0,forced:!r(47285)&&o>79&&o<83||!s("reduce")},{reduce:function(e){var t=arguments.length;return i(this,e,t,t>1?arguments[1]:void 0)}})},37279:(e,t,r)=>{"use strict";var n=r(90915),i=r(43171),s=r(84321),o=i([].reverse),a=[1,2];n({target:"Array",proto:!0,forced:String(a)===String(a.reverse())},{reverse:function(){return s(this)&&(this.length=this.length),o(this)}})},38371:(e,t,r)=>{"use strict";var n=r(90915),i=r(84321),s=r(51372),o=r(21629),a=r(96017),l=r(46799),c=r(20990),u=r(90071),d=r(60664),h=r(56240),p=r(34147),m=h("slice"),f=d("species"),g=Array,y=Math.max;n({target:"Array",proto:!0,forced:!m},{slice:function(e,t){var r,n,d,h=c(this),m=l(h),b=a(e,m),v=a(void 0===t?m:t,m);if(i(h)&&(r=h.constructor,(s(r)&&(r===g||i(r.prototype))||o(r)&&null===(r=r[f]))&&(r=void 0),r===g||void 0===r))return p(h,b,v);for(n=new(void 0===r?g:r)(y(v-b,0)),d=0;b<v;b++,d++)b in h&&u(n,d,h[b]);return n.length=d,n}})},53129:(e,t,r)=>{"use strict";var n=r(90915),i=r(68214).some;n({target:"Array",proto:!0,forced:!r(89479)("some")},{some:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},90785:(e,t,r)=>{"use strict";var n=r(90915),i=r(43171),s=r(1343),o=r(58258),a=r(46799),l=r(9719),c=r(34336),u=r(63388),d=r(58337),h=r(89479),p=r(39161),m=r(84487),f=r(91795),g=r(44091),y=[],b=i(y.sort),v=i(y.push),_=u((function(){y.sort(void 0)})),x=u((function(){y.sort(null)})),w=h("sort"),R=!u((function(){if(f)return f<70;if(!(p&&p>3)){if(m)return!0;if(g)return g<603;var e,t,r,n,i="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(n=0;n<47;n++)y.push({k:t+n,v:r})}for(y.sort((function(e,t){return t.v-e.v})),n=0;n<y.length;n++)t=y[n].k.charAt(0),i.charAt(i.length-1)!==t&&(i+=t);return"DGBEFHACIJK"!==i}}));n({target:"Array",proto:!0,forced:_||!x||!w||!R},{sort:function(e){void 0!==e&&s(e);var t=o(this);if(R)return void 0===e?b(t):b(t,e);var r,n,i=[],u=a(t);for(n=0;n<u;n++)n in t&&v(i,t[n]);for(d(i,function(e){return function(t,r){return void 0===r?-1:void 0===t?1:void 0!==e?+e(t,r)||0:c(t)>c(r)?1:-1}}(e)),r=a(i),n=0;n<r;)t[n]=i[n++];for(;n<u;)l(t,n++);return t}})},83755:(e,t,r)=>{"use strict";r(93886)("Array")},88577:(e,t,r)=>{"use strict";var n=r(90915),i=r(58258),s=r(96017),o=r(71738),a=r(46799),l=r(59978),c=r(12264),u=r(34168),d=r(90071),h=r(9719),p=r(56240)("splice"),m=Math.max,f=Math.min;n({target:"Array",proto:!0,forced:!p},{splice:function(e,t){var r,n,p,g,y,b,v=i(this),_=a(v),x=s(e,_),w=arguments.length;for(0===w?r=n=0:1===w?(r=0,n=_-x):(r=w-2,n=f(m(o(t),0),_-x)),c(_+r-n),p=u(v,n),g=0;g<n;g++)(y=x+g)in v&&d(p,g,v[y]);if(p.length=n,r<n){for(g=x;g<_-n;g++)b=g+r,(y=g+n)in v?v[b]=v[y]:h(v,b);for(g=_;g>_-n+r;g--)h(v,g-1)}else if(r>n)for(g=_-n;g>x;g--)b=g+r-1,(y=g+n-1)in v?v[b]=v[y]:h(v,b);for(g=0;g<r;g++)v[g+x]=arguments[g+2];return l(v,_-n+r),p}})},7711:(e,t,r)=>{"use strict";var n=r(90915),i=r(26399),s=r(20990),o=r(76380),a=Array;n({target:"Array",proto:!0},{toReversed:function(){return i(s(this),a)}}),o("toReversed")},99032:(e,t,r)=>{"use strict";var n=r(90915),i=r(43171),s=r(1343),o=r(20990),a=r(9157),l=r(90999),c=r(76380),u=Array,d=i(l("Array").sort);n({target:"Array",proto:!0},{toSorted:function(e){void 0!==e&&s(e);var t=o(this),r=a(u,t);return d(r,e)}}),c("toSorted")},43413:(e,t,r)=>{"use strict";var n=r(90915),i=r(76380),s=r(12264),o=r(46799),a=r(96017),l=r(20990),c=r(71738),u=Array,d=Math.max,h=Math.min;n({target:"Array",proto:!0},{toSpliced:function(e,t){var r,n,i,p,m=l(this),f=o(m),g=a(e,f),y=arguments.length,b=0;for(0===y?r=n=0:1===y?(r=0,n=f-g):(r=y-2,n=h(d(c(t),0),f-g)),i=s(f+r-n),p=u(i);b<g;b++)p[b]=m[b];for(;b<g+r;b++)p[b]=arguments[b-g+2];for(;b<i;b++)p[b]=m[b+n-r];return p}}),i("toSpliced")},87630:(e,t,r)=>{"use strict";r(76380)("flatMap")},95953:(e,t,r)=>{"use strict";r(76380)("flat")},39132:(e,t,r)=>{"use strict";var n=r(90915),i=r(58258),s=r(46799),o=r(59978),a=r(9719),l=r(12264);n({target:"Array",proto:!0,arity:1,forced:1!==[].unshift(0)||!function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(e){return e instanceof TypeError}}()},{unshift:function(e){var t=i(this),r=s(t),n=arguments.length;if(n){l(r+n);for(var c=r;c--;){var u=c+n;c in t?t[u]=t[c]:a(t,u)}for(var d=0;d<n;d++)t[d]=arguments[d]}return o(t,r+n)}})},92405:(e,t,r)=>{"use strict";var n=r(90915),i=r(59957),s=r(20990),o=Array;n({target:"Array",proto:!0},{with:function(e,t){return i(s(this),o,e,t)}})},65682:(e,t,r)=>{"use strict";var n=r(90915),i=r(93679);n({global:!0,constructor:!0,forced:!r(27410)},{DataView:i.DataView})},98380:(e,t,r)=>{"use strict";r(65682)},21846:(e,t,r)=>{"use strict";var n=r(90915),i=r(43171),s=r(63388)((function(){return 120!==new Date(16e11).getYear()})),o=i(Date.prototype.getFullYear);n({target:"Date",proto:!0,forced:s},{getYear:function(){return o(this)-1900}})},76562:(e,t,r)=>{"use strict";var n=r(90915),i=r(43171),s=Date,o=i(s.prototype.getTime);n({target:"Date",stat:!0},{now:function(){return o(new s)}})},54218:(e,t,r)=>{"use strict";var n=r(90915),i=r(43171),s=r(71738),o=Date.prototype,a=i(o.getTime),l=i(o.setFullYear);n({target:"Date",proto:!0},{setYear:function(e){a(this);var t=s(e);return l(this,t>=0&&t<=99?t+1900:t)}})},80556:(e,t,r)=>{"use strict";r(90915)({target:"Date",proto:!0},{toGMTString:Date.prototype.toUTCString})},92563:(e,t,r)=>{"use strict";var n=r(90915),i=r(31525);n({target:"Date",proto:!0,forced:Date.prototype.toISOString!==i},{toISOString:i})},10552:(e,t,r)=>{"use strict";var n=r(90915),i=r(63388),s=r(58258),o=r(39356);n({target:"Date",proto:!0,arity:1,forced:i((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}))},{toJSON:function(e){var t=s(this),r=o(t,"number");return"number"!=typeof r||isFinite(r)?t.toISOString():null}})},27417:(e,t,r)=>{"use strict";var n=r(98284),i=r(70119),s=r(98855),o=r(60664)("toPrimitive"),a=Date.prototype;n(a,o)||i(a,o,s)},3103:(e,t,r)=>{"use strict";var n=r(43171),i=r(70119),s=Date.prototype,o="Invalid Date",a="toString",l=n(s[a]),c=n(s.getTime);String(new Date(NaN))!==o&&i(s,a,(function(){var e=c(this);return e==e?l(this):o}))},52717:(e,t,r)=>{"use strict";var n=r(90915),i=r(19042),s=r(88168),o=r(50190),a="WebAssembly",l=i[a],c=7!==Error("e",{cause:7}).cause,u=function(e,t){var r={};r[e]=o(e,t,c),n({global:!0,constructor:!0,arity:1,forced:c},r)},d=function(e,t){if(l&&l[e]){var r={};r[e]=o(a+"."+e,t,c),n({target:a,stat:!0,constructor:!0,arity:1,forced:c},r)}};u("Error",(function(e){return function(t){return s(e,this,arguments)}})),u("EvalError",(function(e){return function(t){return s(e,this,arguments)}})),u("RangeError",(function(e){return function(t){return s(e,this,arguments)}})),u("ReferenceError",(function(e){return function(t){return s(e,this,arguments)}})),u("SyntaxError",(function(e){return function(t){return s(e,this,arguments)}})),u("TypeError",(function(e){return function(t){return s(e,this,arguments)}})),u("URIError",(function(e){return function(t){return s(e,this,arguments)}})),d("CompileError",(function(e){return function(t){return s(e,this,arguments)}})),d("LinkError",(function(e){return function(t){return s(e,this,arguments)}})),d("RuntimeError",(function(e){return function(t){return s(e,this,arguments)}}))},47059:(e,t,r)=>{"use strict";var n=r(70119),i=r(4119),s=Error.prototype;s.toString!==i&&n(s,"toString",i)},94279:(e,t,r)=>{"use strict";var n=r(90915),i=r(43171),s=r(34336),o=i("".charAt),a=i("".charCodeAt),l=i(/./.exec),c=i(1..toString),u=i("".toUpperCase),d=/[\w*+\-./@]/,h=function(e,t){for(var r=c(e,16);r.length<t;)r="0"+r;return r};n({global:!0},{escape:function(e){for(var t,r,n=s(e),i="",c=n.length,p=0;p<c;)t=o(n,p++),l(d,t)?i+=t:i+=(r=a(t,0))<256?"%"+h(r,2):"%u"+u(h(r,4));return i}})},86299:(e,t,r)=>{"use strict";var n=r(90915),i=r(9617);n({target:"Function",proto:!0,forced:Function.bind!==i},{bind:i})},13028:(e,t,r)=>{"use strict";var n=r(64506),i=r(21629),s=r(58204),o=r(38740),a=r(60664),l=r(6440),c=a("hasInstance"),u=Function.prototype;c in u||s.f(u,c,{value:l((function(e){if(!n(this)||!i(e))return!1;var t=this.prototype;if(!i(t))return e instanceof this;for(;e=o(e);)if(t===e)return!0;return!1}),c)})},33271:(e,t,r)=>{"use strict";var n=r(26471),i=r(5265).EXISTS,s=r(43171),o=r(60851),a=Function.prototype,l=s(a.toString),c=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,u=s(c.exec);n&&!i&&o(a,"name",{configurable:!0,get:function(){try{return u(c,l(this))[1]}catch(e){return""}}})},28904:(e,t,r)=>{"use strict";var n=r(90915),i=r(19042);n({global:!0,forced:i.globalThis!==i},{globalThis:i})},43881:(e,t,r)=>{"use strict";var n=r(90915),i=r(84830),s=r(88168),o=r(69562),a=r(43171),l=r(63388),c=r(64506),u=r(85706),d=r(34147),h=r(11520),p=r(51766),m=String,f=i("JSON","stringify"),g=a(/./.exec),y=a("".charAt),b=a("".charCodeAt),v=a("".replace),_=a(1..toString),x=/[\uD800-\uDFFF]/g,w=/^[\uD800-\uDBFF]$/,R=/^[\uDC00-\uDFFF]$/,k=!p||l((function(){var e=i("Symbol")("stringify detection");return"[null]"!==f([e])||"{}"!==f({a:e})||"{}"!==f(Object(e))})),j=l((function(){return'"\\udf06\\ud834"'!==f("\udf06\ud834")||'"\\udead"'!==f("\udead")})),z=function(e,t){var r=d(arguments),n=h(t);if(c(n)||void 0!==e&&!u(e))return r[1]=function(e,t){if(c(n)&&(t=o(n,this,m(e),t)),!u(t))return t},s(f,null,r)},q=function(e,t,r){var n=y(r,t-1),i=y(r,t+1);return g(w,e)&&!g(R,i)||g(R,e)&&!g(w,n)?"\\u"+_(b(e,0),16):e};f&&n({target:"JSON",stat:!0,arity:3,forced:k||j},{stringify:function(e,t,r){var n=d(arguments),i=s(k?z:f,null,n);return j&&"string"==typeof i?v(i,x,q):i}})},71072:(e,t,r)=>{"use strict";var n=r(19042);r(99176)(n.JSON,"JSON",!0)},9258:(e,t,r)=>{"use strict";r(49225)("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),r(14169))},25988:(e,t,r)=>{"use strict";r(9258)},42758:(e,t,r)=>{"use strict";var n=r(90915),i=r(32445),s=Math.acosh,o=Math.log,a=Math.sqrt,l=Math.LN2;n({target:"Math",stat:!0,forced:!s||710!==Math.floor(s(Number.MAX_VALUE))||s(1/0)!==1/0},{acosh:function(e){var t=+e;return t<1?NaN:t>94906265.62425156?o(t)+l:i(t-1+a(t-1)*a(t+1))}})},67405:(e,t,r)=>{"use strict";var n=r(90915),i=Math.asinh,s=Math.log,o=Math.sqrt;n({target:"Math",stat:!0,forced:!(i&&1/i(0)>0)},{asinh:function e(t){var r=+t;return isFinite(r)&&0!==r?r<0?-e(-r):s(r+o(r*r+1)):r}})},50286:(e,t,r)=>{"use strict";var n=r(90915),i=Math.atanh,s=Math.log;n({target:"Math",stat:!0,forced:!(i&&1/i(-0)<0)},{atanh:function(e){var t=+e;return 0===t?t:s((1+t)/(1-t))/2}})},34889:(e,t,r)=>{"use strict";var n=r(90915),i=r(1729),s=Math.abs,o=Math.pow;n({target:"Math",stat:!0},{cbrt:function(e){var t=+e;return i(t)*o(s(t),1/3)}})},83338:(e,t,r)=>{"use strict";var n=r(90915),i=Math.floor,s=Math.log,o=Math.LOG2E;n({target:"Math",stat:!0},{clz32:function(e){var t=e>>>0;return t?31-i(s(t+.5)*o):32}})},82283:(e,t,r)=>{"use strict";var n=r(90915),i=r(43635),s=Math.cosh,o=Math.abs,a=Math.E;n({target:"Math",stat:!0,forced:!s||s(710)===1/0},{cosh:function(e){var t=i(o(e)-1)+1;return(t+1/(t*a*a))*(a/2)}})},63733:(e,t,r)=>{"use strict";var n=r(90915),i=r(43635);n({target:"Math",stat:!0,forced:i!==Math.expm1},{expm1:i})},70476:(e,t,r)=>{"use strict";r(90915)({target:"Math",stat:!0},{fround:r(14478)})},23646:(e,t,r)=>{"use strict";var n=r(90915),i=Math.hypot,s=Math.abs,o=Math.sqrt;n({target:"Math",stat:!0,arity:2,forced:!!i&&i(1/0,NaN)!==1/0},{hypot:function(e,t){for(var r,n,i=0,a=0,l=arguments.length,c=0;a<l;)c<(r=s(arguments[a++]))?(i=i*(n=c/r)*n+1,c=r):i+=r>0?(n=r/c)*n:r;return c===1/0?1/0:c*o(i)}})},28781:(e,t,r)=>{"use strict";var n=r(90915),i=r(63388),s=Math.imul;n({target:"Math",stat:!0,forced:i((function(){return-5!==s(4294967295,5)||2!==s.length}))},{imul:function(e,t){var r=65535,n=+e,i=+t,s=r&n,o=r&i;return 0|s*o+((r&n>>>16)*o+s*(r&i>>>16)<<16>>>0)}})},79231:(e,t,r)=>{"use strict";r(90915)({target:"Math",stat:!0},{log10:r(48317)})},63359:(e,t,r)=>{"use strict";r(90915)({target:"Math",stat:!0},{log1p:r(32445)})},65626:(e,t,r)=>{"use strict";var n=r(90915),i=Math.log,s=Math.LN2;n({target:"Math",stat:!0},{log2:function(e){return i(e)/s}})},84379:(e,t,r)=>{"use strict";r(90915)({target:"Math",stat:!0},{sign:r(1729)})},40212:(e,t,r)=>{"use strict";var n=r(90915),i=r(63388),s=r(43635),o=Math.abs,a=Math.exp,l=Math.E;n({target:"Math",stat:!0,forced:i((function(){return-2e-17!==Math.sinh(-2e-17)}))},{sinh:function(e){var t=+e;return o(t)<1?(s(t)-s(-t))/2:(a(t-1)-a(-t-1))*(l/2)}})},73775:(e,t,r)=>{"use strict";var n=r(90915),i=r(43635),s=Math.exp;n({target:"Math",stat:!0},{tanh:function(e){var t=+e,r=i(t),n=i(-t);return r===1/0?1:n===1/0?-1:(r-n)/(s(t)+s(-t))}})},65324:(e,t,r)=>{"use strict";r(99176)(Math,"Math",!0)},68422:(e,t,r)=>{"use strict";r(90915)({target:"Math",stat:!0},{trunc:r(99208)})},9579:(e,t,r)=>{"use strict";var n=r(90915),i=r(37792),s=r(26471),o=r(19042),a=r(18814),l=r(43171),c=r(71767),u=r(98284),d=r(15540),h=r(11624),p=r(85706),m=r(39356),f=r(63388),g=r(68843).f,y=r(66790).f,b=r(58204).f,v=r(85007),_=r(72889).trim,x="Number",w=o[x],R=a[x],k=w.prototype,j=o.TypeError,z=l("".slice),q=l("".charCodeAt),$=function(e){var t,r,n,i,s,o,a,l,c=m(e,"number");if(p(c))throw j("Cannot convert a Symbol value to a number");if("string"==typeof c&&c.length>2)if(c=_(c),43===(t=q(c,0))||45===t){if(88===(r=q(c,2))||120===r)return NaN}else if(48===t){switch(q(c,1)){case 66:case 98:n=2,i=49;break;case 79:case 111:n=8,i=55;break;default:return+c}for(o=(s=z(c,2)).length,a=0;a<o;a++)if((l=q(s,a))<48||l>i)return NaN;return parseInt(s,n)}return+c},Z=c(x,!w(" 0o1")||!w("0b1")||w("+0x1")),NumberWrapper=function(e){var t,r=arguments.length<1?0:w(function(e){var t=m(e,"number");return"bigint"==typeof t?t:$(t)}(e));return h(k,t=this)&&f((function(){v(t)}))?d(Object(r),this,NumberWrapper):r};NumberWrapper.prototype=k,Z&&!i&&(k.constructor=NumberWrapper),n({global:!0,constructor:!0,wrap:!0,forced:Z},{Number:NumberWrapper});var X=function(e,t){for(var r,n=s?g(t):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),i=0;n.length>i;i++)u(t,r=n[i])&&!u(e,r)&&b(e,r,y(t,r))};i&&R&&X(a[x],R),(Z||i)&&X(a[x],w)},93053:(e,t,r)=>{"use strict";r(90915)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{EPSILON:Math.pow(2,-52)})},72775:(e,t,r)=>{"use strict";r(90915)({target:"Number",stat:!0},{isFinite:r(61285)})},86068:(e,t,r)=>{"use strict";r(90915)({target:"Number",stat:!0},{isInteger:r(26410)})},7863:(e,t,r)=>{"use strict";r(90915)({target:"Number",stat:!0},{isNaN:function(e){return e!=e}})},62449:(e,t,r)=>{"use strict";var n=r(90915),i=r(26410),s=Math.abs;n({target:"Number",stat:!0},{isSafeInteger:function(e){return i(e)&&s(e)<=9007199254740991}})},59152:(e,t,r)=>{"use strict";r(90915)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MAX_SAFE_INTEGER:9007199254740991})},56034:(e,t,r)=>{"use strict";r(90915)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MIN_SAFE_INTEGER:-9007199254740991})},18787:(e,t,r)=>{"use strict";var n=r(90915),i=r(91837);n({target:"Number",stat:!0,forced:Number.parseFloat!==i},{parseFloat:i})},1956:(e,t,r)=>{"use strict";var n=r(90915),i=r(7802);n({target:"Number",stat:!0,forced:Number.parseInt!==i},{parseInt:i})},16192:(e,t,r)=>{"use strict";var n=r(90915),i=r(43171),s=r(71738),o=r(85007),a=r(32562),l=r(48317),c=r(63388),u=RangeError,d=String,h=isFinite,p=Math.abs,m=Math.floor,f=Math.pow,g=Math.round,y=i(1..toExponential),b=i(a),v=i("".slice),_="-6.9000e-11"===y(-69e-12,4)&&"1.25e+0"===y(1.255,2)&&"1.235e+4"===y(12345,3)&&"3e+1"===y(25,0);n({target:"Number",proto:!0,forced:!_||!(c((function(){y(1,1/0)}))&&c((function(){y(1,-1/0)})))||!!c((function(){y(1/0,1/0),y(NaN,1/0)}))},{toExponential:function(e){var t=o(this);if(void 0===e)return y(t);var r=s(e);if(!h(t))return String(t);if(r<0||r>20)throw u("Incorrect fraction digits");if(_)return y(t,r);var n="",i="",a=0,c="",x="";if(t<0&&(n="-",t=-t),0===t)a=0,i=b("0",r+1);else{var w=l(t);a=m(w);var R=0,k=f(10,a-r);2*t>=(2*(R=g(t/k))+1)*k&&(R+=1),R>=f(10,r+1)&&(R/=10,a+=1),i=d(R)}return 0!==r&&(i=v(i,0,1)+"."+v(i,1)),0===a?(c="+",x="0"):(c=a>0?"+":"-",x=d(p(a))),n+(i+="e"+c+x)}})},4889:(e,t,r)=>{"use strict";var n=r(90915),i=r(43171),s=r(71738),o=r(85007),a=r(32562),l=r(63388),c=RangeError,u=String,d=Math.floor,h=i(a),p=i("".slice),m=i(1..toFixed),f=function(e,t,r){return 0===t?r:t%2==1?f(e,t-1,r*e):f(e*e,t/2,r)},g=function(e,t,r){for(var n=-1,i=r;++n<6;)i+=t*e[n],e[n]=i%1e7,i=d(i/1e7)},y=function(e,t){for(var r=6,n=0;--r>=0;)n+=e[r],e[r]=d(n/t),n=n%t*1e7},b=function(e){for(var t=6,r="";--t>=0;)if(""!==r||0===t||0!==e[t]){var n=u(e[t]);r=""===r?n:r+h("0",7-n.length)+n}return r};n({target:"Number",proto:!0,forced:l((function(){return"0.000"!==m(8e-5,3)||"1"!==m(.9,0)||"1.25"!==m(1.255,2)||"1000000000000000128"!==m(0xde0b6b3a7640080,0)}))||!l((function(){m({})}))},{toFixed:function(e){var t,r,n,i,a=o(this),l=s(e),d=[0,0,0,0,0,0],m="",v="0";if(l<0||l>20)throw c("Incorrect fraction digits");if(a!=a)return"NaN";if(a<=-1e21||a>=1e21)return u(a);if(a<0&&(m="-",a=-a),a>1e-21)if(r=(t=function(e){for(var t=0,r=e;r>=4096;)t+=12,r/=4096;for(;r>=2;)t+=1,r/=2;return t}(a*f(2,69,1))-69)<0?a*f(2,-t,1):a/f(2,t,1),r*=4503599627370496,(t=52-t)>0){for(g(d,0,r),n=l;n>=7;)g(d,1e7,0),n-=7;for(g(d,f(10,n,1),0),n=t-1;n>=23;)y(d,1<<23),n-=23;y(d,1<<n),g(d,1,1),y(d,2),v=b(d)}else g(d,0,r),g(d,1<<-t,0),v=b(d)+h("0",l);return v=l>0?m+((i=v.length)<=l?"0."+h("0",l-i)+v:p(v,0,i-l)+"."+p(v,i-l)):m+v}})},63423:(e,t,r)=>{"use strict";var n=r(90915),i=r(43171),s=r(63388),o=r(85007),a=i(1..toPrecision);n({target:"Number",proto:!0,forced:s((function(){return"1"!==a(1,void 0)}))||!s((function(){a({})}))},{toPrecision:function(e){return void 0===e?a(o(this)):a(o(this),e)}})},70300:(e,t,r)=>{"use strict";var n=r(90915),i=r(92850);n({target:"Object",stat:!0,arity:2,forced:Object.assign!==i},{assign:i})},33853:(e,t,r)=>{"use strict";r(90915)({target:"Object",stat:!0,sham:!r(26471)},{create:r(6731)})},74520:(e,t,r)=>{"use strict";var n=r(90915),i=r(26471),s=r(10208),o=r(1343),a=r(58258),l=r(58204);i&&n({target:"Object",proto:!0,forced:s},{__defineGetter__:function(e,t){l.f(a(this),e,{get:o(t),enumerable:!0,configurable:!0})}})},76300:(e,t,r)=>{"use strict";var n=r(90915),i=r(26471),s=r(96700).f;n({target:"Object",stat:!0,forced:Object.defineProperties!==s,sham:!i},{defineProperties:s})},53390:(e,t,r)=>{"use strict";var n=r(90915),i=r(26471),s=r(58204).f;n({target:"Object",stat:!0,forced:Object.defineProperty!==s,sham:!i},{defineProperty:s})},66332:(e,t,r)=>{"use strict";var n=r(90915),i=r(26471),s=r(10208),o=r(1343),a=r(58258),l=r(58204);i&&n({target:"Object",proto:!0,forced:s},{__defineSetter__:function(e,t){l.f(a(this),e,{set:o(t),enumerable:!0,configurable:!0})}})},55737:(e,t,r)=>{"use strict";var n=r(90915),i=r(75338).entries;n({target:"Object",stat:!0},{entries:function(e){return i(e)}})},81390:(e,t,r)=>{"use strict";var n=r(90915),i=r(81745),s=r(63388),o=r(21629),a=r(98268).onFreeze,l=Object.freeze;n({target:"Object",stat:!0,forced:s((function(){l(1)})),sham:!i},{freeze:function(e){return l&&o(e)?l(a(e)):e}})},83664:(e,t,r)=>{"use strict";var n=r(90915),i=r(3079),s=r(90071);n({target:"Object",stat:!0},{fromEntries:function(e){var t={};return i(e,(function(e,r){s(t,e,r)}),{AS_ENTRIES:!0}),t}})},91932:(e,t,r)=>{"use strict";var n=r(90915),i=r(63388),s=r(20990),o=r(66790).f,a=r(26471);n({target:"Object",stat:!0,forced:!a||i((function(){o(1)})),sham:!a},{getOwnPropertyDescriptor:function(e,t){return o(s(e),t)}})},14739:(e,t,r)=>{"use strict";var n=r(90915),i=r(26471),s=r(33618),o=r(20990),a=r(66790),l=r(90071);n({target:"Object",stat:!0,sham:!i},{getOwnPropertyDescriptors:function(e){for(var t,r,n=o(e),i=a.f,c=s(n),u={},d=0;c.length>d;)void 0!==(r=i(n,t=c[d++]))&&l(u,t,r);return u}})},38657:(e,t,r)=>{"use strict";var n=r(90915),i=r(63388),s=r(50703).f;n({target:"Object",stat:!0,forced:i((function(){return!Object.getOwnPropertyNames(1)}))},{getOwnPropertyNames:s})},12784:(e,t,r)=>{"use strict";var n=r(90915),i=r(51766),s=r(63388),o=r(64754),a=r(58258);n({target:"Object",stat:!0,forced:!i||s((function(){o.f(1)}))},{getOwnPropertySymbols:function(e){var t=o.f;return t?t(a(e)):[]}})},42118:(e,t,r)=>{"use strict";var n=r(90915),i=r(63388),s=r(58258),o=r(38740),a=r(42582);n({target:"Object",stat:!0,forced:i((function(){o(1)})),sham:!a},{getPrototypeOf:function(e){return o(s(e))}})},18440:(e,t,r)=>{"use strict";r(90915)({target:"Object",stat:!0},{hasOwn:r(98284)})},26595:(e,t,r)=>{"use strict";var n=r(90915),i=r(66109);n({target:"Object",stat:!0,forced:Object.isExtensible!==i},{isExtensible:i})},52920:(e,t,r)=>{"use strict";var n=r(90915),i=r(63388),s=r(21629),o=r(67839),a=r(28695),l=Object.isFrozen;n({target:"Object",stat:!0,forced:a||i((function(){l(1)}))},{isFrozen:function(e){return!s(e)||(!(!a||"ArrayBuffer"!==o(e))||!!l&&l(e))}})},78010:(e,t,r)=>{"use strict";var n=r(90915),i=r(63388),s=r(21629),o=r(67839),a=r(28695),l=Object.isSealed;n({target:"Object",stat:!0,forced:a||i((function(){l(1)}))},{isSealed:function(e){return!s(e)||(!(!a||"ArrayBuffer"!==o(e))||!!l&&l(e))}})},54285:(e,t,r)=>{"use strict";r(90915)({target:"Object",stat:!0},{is:r(24371)})},36405:(e,t,r)=>{"use strict";var n=r(90915),i=r(58258),s=r(83435);n({target:"Object",stat:!0,forced:r(63388)((function(){s(1)}))},{keys:function(e){return s(i(e))}})},62635:(e,t,r)=>{"use strict";var n=r(90915),i=r(26471),s=r(10208),o=r(58258),a=r(90422),l=r(38740),c=r(66790).f;i&&n({target:"Object",proto:!0,forced:s},{__lookupGetter__:function(e){var t,r=o(this),n=a(e);do{if(t=c(r,n))return t.get}while(r=l(r))}})},36751:(e,t,r)=>{"use strict";var n=r(90915),i=r(26471),s=r(10208),o=r(58258),a=r(90422),l=r(38740),c=r(66790).f;i&&n({target:"Object",proto:!0,forced:s},{__lookupSetter__:function(e){var t,r=o(this),n=a(e);do{if(t=c(r,n))return t.set}while(r=l(r))}})},778:(e,t,r)=>{"use strict";var n=r(90915),i=r(21629),s=r(98268).onFreeze,o=r(81745),a=r(63388),l=Object.preventExtensions;n({target:"Object",stat:!0,forced:a((function(){l(1)})),sham:!o},{preventExtensions:function(e){return l&&i(e)?l(s(e)):e}})},563:(e,t,r)=>{"use strict";var n=r(26471),i=r(60851),s=r(21629),o=r(58258),a=r(1455),l=Object.getPrototypeOf,c=Object.setPrototypeOf,u=Object.prototype,d="__proto__";if(n&&l&&c&&!(d in u))try{i(u,d,{configurable:!0,get:function(){return l(o(this))},set:function(e){var t=a(this);(s(e)||null===e)&&s(t)&&c(t,e)}})}catch(e){}},49848:(e,t,r)=>{"use strict";var n=r(90915),i=r(21629),s=r(98268).onFreeze,o=r(81745),a=r(63388),l=Object.seal;n({target:"Object",stat:!0,forced:a((function(){l(1)})),sham:!o},{seal:function(e){return l&&i(e)?l(s(e)):e}})},96178:(e,t,r)=>{"use strict";r(90915)({target:"Object",stat:!0},{setPrototypeOf:r(15592)})},73272:(e,t,r)=>{"use strict";var n=r(63647),i=r(70119),s=r(87758);n||i(Object.prototype,"toString",s,{unsafe:!0})},1491:(e,t,r)=>{"use strict";var n=r(90915),i=r(75338).values;n({target:"Object",stat:!0},{values:function(e){return i(e)}})},23790:(e,t,r)=>{"use strict";var n=r(90915),i=r(91837);n({global:!0,forced:parseFloat!==i},{parseFloat:i})},28961:(e,t,r)=>{"use strict";var n=r(90915),i=r(7802);n({global:!0,forced:parseInt!==i},{parseInt:i})},92922:(e,t,r)=>{"use strict";var n=r(90915),i=r(69562),s=r(1343),o=r(98798),a=r(52068),l=r(3079);n({target:"Promise",stat:!0,forced:r(27138)},{allSettled:function(e){var t=this,r=o.f(t),n=r.resolve,c=r.reject,u=a((function(){var r=s(t.resolve),o=[],a=0,c=1;l(e,(function(e){var s=a++,l=!1;c++,i(r,t,e).then((function(e){l||(l=!0,o[s]={status:"fulfilled",value:e},--c||n(o))}),(function(e){l||(l=!0,o[s]={status:"rejected",reason:e},--c||n(o))}))})),--c||n(o)}));return u.error&&c(u.value),r.promise}})},83254:(e,t,r)=>{"use strict";var n=r(90915),i=r(69562),s=r(1343),o=r(98798),a=r(52068),l=r(3079);n({target:"Promise",stat:!0,forced:r(27138)},{all:function(e){var t=this,r=o.f(t),n=r.resolve,c=r.reject,u=a((function(){var r=s(t.resolve),o=[],a=0,u=1;l(e,(function(e){var s=a++,l=!1;u++,i(r,t,e).then((function(e){l||(l=!0,o[s]=e,--u||n(o))}),c)})),--u||n(o)}));return u.error&&c(u.value),r.promise}})},94479:(e,t,r)=>{"use strict";var n=r(90915),i=r(69562),s=r(1343),o=r(84830),a=r(98798),l=r(52068),c=r(3079),u=r(27138),d="No one promise resolved";n({target:"Promise",stat:!0,forced:u},{any:function(e){var t=this,r=o("AggregateError"),n=a.f(t),u=n.resolve,h=n.reject,p=l((function(){var n=s(t.resolve),o=[],a=0,l=1,p=!1;c(e,(function(e){var s=a++,c=!1;l++,i(n,t,e).then((function(e){c||p||(p=!0,u(e))}),(function(e){c||p||(c=!0,o[s]=e,--l||h(new r(o,d)))}))})),--l||h(new r(o,d))}));return p.error&&h(p.value),n.promise}})},74954:(e,t,r)=>{"use strict";var n=r(90915),i=r(37792),s=r(35567).CONSTRUCTOR,o=r(6231),a=r(84830),l=r(64506),c=r(70119),u=o&&o.prototype;if(n({target:"Promise",proto:!0,forced:s,real:!0},{catch:function(e){return this.then(void 0,e)}}),!i&&l(o)){var d=a("Promise").prototype.catch;u.catch!==d&&c(u,"catch",d,{unsafe:!0})}},17697:(e,t,r)=>{"use strict";var n,i,s,o=r(90915),a=r(37792),l=r(47285),c=r(19042),u=r(69562),d=r(70119),h=r(15592),p=r(99176),m=r(93886),f=r(1343),g=r(64506),y=r(21629),b=r(15036),v=r(2418),_=r(80400).set,x=r(91284),w=r(11776),R=r(52068),k=r(50026),j=r(76980),z=r(6231),q=r(35567),$=r(98798),Z="Promise",X=q.CONSTRUCTOR,Y=q.REJECTION_EVENT,ee=q.SUBCLASSING,te=j.getterFor(Z),re=j.set,ne=z&&z.prototype,ie=z,se=ne,oe=c.TypeError,ae=c.document,le=c.process,ce=$.f,ue=ce,de=!!(ae&&ae.createEvent&&c.dispatchEvent),he="unhandledrejection",pe=function(e){var t;return!(!y(e)||!g(t=e.then))&&t},me=function(e,t){var r,n,i,s=t.value,o=1===t.state,a=o?e.ok:e.fail,l=e.resolve,c=e.reject,d=e.domain;try{a?(o||(2===t.rejection&&ve(t),t.rejection=1),!0===a?r=s:(d&&d.enter(),r=a(s),d&&(d.exit(),i=!0)),r===e.promise?c(oe("Promise-chain cycle")):(n=pe(r))?u(n,r,l,c):l(r)):c(s)}catch(e){d&&!i&&d.exit(),c(e)}},fe=function(e,t){e.notified||(e.notified=!0,x((function(){for(var r,n=e.reactions;r=n.get();)me(r,e);e.notified=!1,t&&!e.rejection&&ye(e)})))},ge=function(e,t,r){var n,i;de?((n=ae.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),c.dispatchEvent(n)):n={promise:t,reason:r},!Y&&(i=c["on"+e])?i(n):e===he&&w("Unhandled promise rejection",r)},ye=function(e){u(_,c,(function(){var t,r=e.facade,n=e.value;if(be(e)&&(t=R((function(){l?le.emit("unhandledRejection",n,r):ge(he,r,n)})),e.rejection=l||be(e)?2:1,t.error))throw t.value}))},be=function(e){return 1!==e.rejection&&!e.parent},ve=function(e){u(_,c,(function(){var t=e.facade;l?le.emit("rejectionHandled",t):ge("rejectionhandled",t,e.value)}))},_e=function(e,t,r){return function(n){e(t,n,r)}},xe=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,fe(e,!0))},we=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw oe("Promise can't be resolved itself");var n=pe(t);n?x((function(){var r={done:!1};try{u(n,t,_e(we,r,e),_e(xe,r,e))}catch(t){xe(r,t,e)}})):(e.value=t,e.state=1,fe(e,!1))}catch(t){xe({done:!1},t,e)}}};if(X&&(se=(ie=function(e){b(this,se),f(e),u(n,this);var t=te(this);try{e(_e(we,t),_e(xe,t))}catch(e){xe(t,e)}}).prototype,(n=function(e){re(this,{type:Z,done:!1,notified:!1,parent:!1,reactions:new k,rejection:!1,state:0,value:void 0})}).prototype=d(se,"then",(function(e,t){var r=te(this),n=ce(v(this,ie));return r.parent=!0,n.ok=!g(e)||e,n.fail=g(t)&&t,n.domain=l?le.domain:void 0,0===r.state?r.reactions.add(n):x((function(){me(n,r)})),n.promise})),i=function(){var e=new n,t=te(e);this.promise=e,this.resolve=_e(we,t),this.reject=_e(xe,t)},$.f=ce=function(e){return e===ie||undefined===e?new i(e):ue(e)},!a&&g(z)&&ne!==Object.prototype)){s=ne.then,ee||d(ne,"then",(function(e,t){var r=this;return new ie((function(e,t){u(s,r,e,t)})).then(e,t)}),{unsafe:!0});try{delete ne.constructor}catch(e){}h&&h(ne,se)}o({global:!0,constructor:!0,wrap:!0,forced:X},{Promise:ie}),p(ie,Z,!1,!0),m(Z)},89138:(e,t,r)=>{"use strict";var n=r(90915),i=r(37792),s=r(6231),o=r(63388),a=r(84830),l=r(64506),c=r(2418),u=r(60545),d=r(70119),h=s&&s.prototype;if(n({target:"Promise",proto:!0,real:!0,forced:!!s&&o((function(){h.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=c(this,a("Promise")),r=l(e);return this.then(r?function(r){return u(t,e()).then((function(){return r}))}:e,r?function(r){return u(t,e()).then((function(){throw r}))}:e)}}),!i&&l(s)){var p=a("Promise").prototype.finally;h.finally!==p&&d(h,"finally",p,{unsafe:!0})}},18715:(e,t,r)=>{"use strict";r(17697),r(83254),r(74954),r(25104),r(51158),r(11081)},25104:(e,t,r)=>{"use strict";var n=r(90915),i=r(69562),s=r(1343),o=r(98798),a=r(52068),l=r(3079);n({target:"Promise",stat:!0,forced:r(27138)},{race:function(e){var t=this,r=o.f(t),n=r.reject,c=a((function(){var o=s(t.resolve);l(e,(function(e){i(o,t,e).then(r.resolve,n)}))}));return c.error&&n(c.value),r.promise}})},51158:(e,t,r)=>{"use strict";var n=r(90915),i=r(69562),s=r(98798);n({target:"Promise",stat:!0,forced:r(35567).CONSTRUCTOR},{reject:function(e){var t=s.f(this);return i(t.reject,void 0,e),t.promise}})},11081:(e,t,r)=>{"use strict";var n=r(90915),i=r(84830),s=r(37792),o=r(6231),a=r(35567).CONSTRUCTOR,l=r(60545),c=i("Promise"),u=s&&!a;n({target:"Promise",stat:!0,forced:s||a},{resolve:function(e){return l(u&&this===c?o:this,e)}})},28401:(e,t,r)=>{"use strict";var n=r(90915),i=r(88168),s=r(1343),o=r(66688);n({target:"Reflect",stat:!0,forced:!r(63388)((function(){Reflect.apply((function(){}))}))},{apply:function(e,t,r){return i(s(e),t,o(r))}})},86548:(e,t,r)=>{"use strict";var n=r(90915),i=r(84830),s=r(88168),o=r(9617),a=r(32747),l=r(66688),c=r(21629),u=r(6731),d=r(63388),h=i("Reflect","construct"),p=Object.prototype,m=[].push,f=d((function(){function F(){}return!(h((function(){}),[],F)instanceof F)})),g=!d((function(){h((function(){}))})),y=f||g;n({target:"Reflect",stat:!0,forced:y,sham:y},{construct:function(e,t){a(e),l(t);var r=arguments.length<3?e:a(arguments[2]);if(g&&!f)return h(e,t,r);if(e===r){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var n=[null];return s(m,n,t),new(s(o,e,n))}var i=r.prototype,d=u(c(i)?i:p),y=s(e,d,t);return c(y)?y:d}})},95622:(e,t,r)=>{"use strict";var n=r(90915),i=r(26471),s=r(66688),o=r(90422),a=r(58204);n({target:"Reflect",stat:!0,forced:r(63388)((function(){Reflect.defineProperty(a.f({},1,{value:1}),1,{value:2})})),sham:!i},{defineProperty:function(e,t,r){s(e);var n=o(t);s(r);try{return a.f(e,n,r),!0}catch(e){return!1}}})},39702:(e,t,r)=>{"use strict";var n=r(90915),i=r(66688),s=r(66790).f;n({target:"Reflect",stat:!0},{deleteProperty:function(e,t){var r=s(i(e),t);return!(r&&!r.configurable)&&delete e[t]}})},28468:(e,t,r)=>{"use strict";var n=r(90915),i=r(26471),s=r(66688),o=r(66790);n({target:"Reflect",stat:!0,sham:!i},{getOwnPropertyDescriptor:function(e,t){return o.f(s(e),t)}})},17790:(e,t,r)=>{"use strict";var n=r(90915),i=r(66688),s=r(38740);n({target:"Reflect",stat:!0,sham:!r(42582)},{getPrototypeOf:function(e){return s(i(e))}})},34717:(e,t,r)=>{"use strict";var n=r(90915),i=r(69562),s=r(21629),o=r(66688),a=r(8250),l=r(66790),c=r(38740);n({target:"Reflect",stat:!0},{get:function e(t,r){var n,u,d=arguments.length<3?t:arguments[2];return o(t)===d?t[r]:(n=l.f(t,r))?a(n)?n.value:void 0===n.get?void 0:i(n.get,d):s(u=c(t))?e(u,r,d):void 0}})},90673:(e,t,r)=>{"use strict";r(90915)({target:"Reflect",stat:!0},{has:function(e,t){return t in e}})},35371:(e,t,r)=>{"use strict";var n=r(90915),i=r(66688),s=r(66109);n({target:"Reflect",stat:!0},{isExtensible:function(e){return i(e),s(e)}})},36082:(e,t,r)=>{"use strict";r(90915)({target:"Reflect",stat:!0},{ownKeys:r(33618)})},10322:(e,t,r)=>{"use strict";var n=r(90915),i=r(84830),s=r(66688);n({target:"Reflect",stat:!0,sham:!r(81745)},{preventExtensions:function(e){s(e);try{var t=i("Object","preventExtensions");return t&&t(e),!0}catch(e){return!1}}})},88170:(e,t,r)=>{"use strict";var n=r(90915),i=r(66688),s=r(66571),o=r(15592);o&&n({target:"Reflect",stat:!0},{setPrototypeOf:function(e,t){i(e),s(t);try{return o(e,t),!0}catch(e){return!1}}})},19033:(e,t,r)=>{"use strict";var n=r(90915),i=r(69562),s=r(66688),o=r(21629),a=r(8250),l=r(63388),c=r(58204),u=r(66790),d=r(38740),h=r(63833);n({target:"Reflect",stat:!0,forced:l((function(){var Constructor=function(){},e=c.f(new Constructor,"a",{configurable:!0});return!1!==Reflect.set(Constructor.prototype,"a",1,e)}))},{set:function e(t,r,n){var l,p,m,f=arguments.length<4?t:arguments[3],g=u.f(s(t),r);if(!g){if(o(p=d(t)))return e(p,r,n,f);g=h(0)}if(a(g)){if(!1===g.writable||!o(f))return!1;if(l=u.f(f,r)){if(l.get||l.set||!1===l.writable)return!1;l.value=n,c.f(f,r,l)}else c.f(f,r,h(0,n))}else{if(void 0===(m=g.set))return!1;i(m,f,n)}return!0}})},34789:(e,t,r)=>{"use strict";var n=r(90915),i=r(19042),s=r(99176);n({global:!0},{Reflect:{}}),s(i.Reflect,"Reflect",!0)},15983:(e,t,r)=>{"use strict";var n=r(26471),i=r(19042),s=r(43171),o=r(71767),a=r(15540),l=r(43882),c=r(68843).f,u=r(11624),d=r(10951),h=r(34336),p=r(28263),m=r(2422),f=r(26269),g=r(70119),y=r(63388),b=r(98284),v=r(76980).enforce,_=r(93886),x=r(60664),w=r(2390),R=r(79827),k=x("match"),j=i.RegExp,z=j.prototype,q=i.SyntaxError,$=s(z.exec),Z=s("".charAt),X=s("".replace),Y=s("".indexOf),ee=s("".slice),te=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,re=/a/g,ne=/a/g,ie=new j(re)!==re,se=m.MISSED_STICKY,oe=m.UNSUPPORTED_Y,ae=n&&(!ie||se||w||R||y((function(){return ne[k]=!1,j(re)!==re||j(ne)===ne||"/a/i"!==String(j(re,"i"))})));if(o("RegExp",ae)){for(var RegExpWrapper=function(e,t){var r,n,i,s,o,c,m=u(z,this),f=d(e),g=void 0===t,y=[],_=e;if(!m&&f&&g&&e.constructor===RegExpWrapper)return e;if((f||u(z,e))&&(e=e.source,g&&(t=p(_))),e=void 0===e?"":h(e),t=void 0===t?"":h(t),_=e,w&&"dotAll"in re&&(n=!!t&&Y(t,"s")>-1)&&(t=X(t,/s/g,"")),r=t,se&&"sticky"in re&&(i=!!t&&Y(t,"y")>-1)&&oe&&(t=X(t,/y/g,"")),R&&(s=function(e){for(var t,r=e.length,n=0,i="",s=[],o={},a=!1,l=!1,c=0,u="";n<=r;n++){if("\\"===(t=Z(e,n)))t+=Z(e,++n);else if("]"===t)a=!1;else if(!a)switch(!0){case"["===t:a=!0;break;case"("===t:$(te,ee(e,n+1))&&(n+=2,l=!0),i+=t,c++;continue;case">"===t&&l:if(""===u||b(o,u))throw new q("Invalid capture group name");o[u]=!0,s[s.length]=[u,c],l=!1,u="";continue}l?u+=t:i+=t}return[i,s]}(e),e=s[0],y=s[1]),o=a(j(e,t),m?this:z,RegExpWrapper),(n||i||y.length)&&(c=v(o),n&&(c.dotAll=!0,c.raw=RegExpWrapper(function(e){for(var t,r=e.length,n=0,i="",s=!1;n<=r;n++)"\\"!==(t=Z(e,n))?s||"."!==t?("["===t?s=!0:"]"===t&&(s=!1),i+=t):i+="[\\s\\S]":i+=t+Z(e,++n);return i}(e),r)),i&&(c.sticky=!0),y.length&&(c.groups=y)),e!==_)try{l(o,"source",""===_?"(?:)":_)}catch(e){}return o},le=c(j),ce=0;le.length>ce;)f(RegExpWrapper,j,le[ce++]);z.constructor=RegExpWrapper,RegExpWrapper.prototype=z,g(i,"RegExp",RegExpWrapper,{constructor:!0})}_("RegExp")},89282:(e,t,r)=>{"use strict";var n=r(26471),i=r(2390),s=r(67839),o=r(60851),a=r(76980).get,l=RegExp.prototype,c=TypeError;n&&i&&o(l,"dotAll",{configurable:!0,get:function(){if(this!==l){if("RegExp"===s(this))return!!a(this).dotAll;throw c("Incompatible receiver, RegExp required")}}})},89430:(e,t,r)=>{"use strict";var n=r(90915),i=r(57604);n({target:"RegExp",proto:!0,forced:/./.exec!==i},{exec:i})},72764:(e,t,r)=>{"use strict";var n=r(19042),i=r(26471),s=r(60851),o=r(28342),a=r(63388),l=n.RegExp,c=l.prototype;i&&a((function(){var e=!0;try{l(".","d")}catch(t){e=!1}var t={},r="",n=e?"dgimsy":"gimsy",i=function(e,n){Object.defineProperty(t,e,{get:function(){return r+=n,!0}})},s={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var o in e&&(s.hasIndices="d"),s)i(o,s[o]);return Object.getOwnPropertyDescriptor(c,"flags").get.call(t)!==n||r!==n}))&&s(c,"flags",{configurable:!0,get:o})},45684:(e,t,r)=>{"use strict";var n=r(26471),i=r(2422).MISSED_STICKY,s=r(67839),o=r(60851),a=r(76980).get,l=RegExp.prototype,c=TypeError;n&&i&&o(l,"sticky",{configurable:!0,get:function(){if(this!==l){if("RegExp"===s(this))return!!a(this).sticky;throw c("Incompatible receiver, RegExp required")}}})},26303:(e,t,r)=>{"use strict";r(89430);var n,i,s=r(90915),o=r(69562),a=r(64506),l=r(66688),c=r(34336),u=(n=!1,(i=/[ac]/).exec=function(){return n=!0,/./.exec.apply(this,arguments)},!0===i.test("abc")&&n),d=/./.test;s({target:"RegExp",proto:!0,forced:!u},{test:function(e){var t=l(this),r=c(e),n=t.exec;if(!a(n))return o(d,t,r);var i=o(n,t,r);return null!==i&&(l(i),!0)}})},53330:(e,t,r)=>{"use strict";var n=r(5265).PROPER,i=r(70119),s=r(66688),o=r(34336),a=r(63388),l=r(28263),c="toString",u=RegExp.prototype[c],d=a((function(){return"/a/b"!==u.call({source:"a",flags:"b"})})),h=n&&u.name!==c;(d||h)&&i(RegExp.prototype,c,(function(){var e=s(this);return"/"+o(e.source)+"/"+o(l(e))}),{unsafe:!0})},96128:(e,t,r)=>{"use strict";r(49225)("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),r(14169))},8342:(e,t,r)=>{"use strict";r(96128)},11630:(e,t,r)=>{"use strict";var n=r(90915),i=r(1935);n({target:"String",proto:!0,forced:r(78916)("anchor")},{anchor:function(e){return i(this,"a","name",e)}})},60884:(e,t,r)=>{"use strict";var n=r(90915),i=r(43171),s=r(1455),o=r(71738),a=r(34336),l=r(63388),c=i("".charAt);n({target:"String",proto:!0,forced:l((function(){return"\ud842"!=="𠮷".at(-2)}))},{at:function(e){var t=a(s(this)),r=t.length,n=o(e),i=n>=0?n:r+n;return i<0||i>=r?void 0:c(t,i)}})},35949:(e,t,r)=>{"use strict";var n=r(90915),i=r(1935);n({target:"String",proto:!0,forced:r(78916)("big")},{big:function(){return i(this,"big","","")}})},60461:(e,t,r)=>{"use strict";var n=r(90915),i=r(1935);n({target:"String",proto:!0,forced:r(78916)("blink")},{blink:function(){return i(this,"blink","","")}})},88892:(e,t,r)=>{"use strict";var n=r(90915),i=r(1935);n({target:"String",proto:!0,forced:r(78916)("bold")},{bold:function(){return i(this,"b","","")}})},57903:(e,t,r)=>{"use strict";var n=r(90915),i=r(67710).codeAt;n({target:"String",proto:!0},{codePointAt:function(e){return i(this,e)}})},4254:(e,t,r)=>{"use strict";var n,i=r(90915),s=r(17337),o=r(66790).f,a=r(64001),l=r(34336),c=r(12762),u=r(1455),d=r(12407),h=r(37792),p=s("".endsWith),m=s("".slice),f=Math.min,g=d("endsWith");i({target:"String",proto:!0,forced:!!(h||g||(n=o(String.prototype,"endsWith"),!n||n.writable))&&!g},{endsWith:function(e){var t=l(u(this));c(e);var r=arguments.length>1?arguments[1]:void 0,n=t.length,i=void 0===r?n:f(a(r),n),s=l(e);return p?p(t,s,i):m(t,i-s.length,i)===s}})},38625:(e,t,r)=>{"use strict";var n=r(90915),i=r(1935);n({target:"String",proto:!0,forced:r(78916)("fixed")},{fixed:function(){return i(this,"tt","","")}})},59075:(e,t,r)=>{"use strict";var n=r(90915),i=r(1935);n({target:"String",proto:!0,forced:r(78916)("fontcolor")},{fontcolor:function(e){return i(this,"font","color",e)}})},15263:(e,t,r)=>{"use strict";var n=r(90915),i=r(1935);n({target:"String",proto:!0,forced:r(78916)("fontsize")},{fontsize:function(e){return i(this,"font","size",e)}})},88946:(e,t,r)=>{"use strict";var n=r(90915),i=r(43171),s=r(96017),o=RangeError,a=String.fromCharCode,l=String.fromCodePoint,c=i([].join);n({target:"String",stat:!0,arity:1,forced:!!l&&1!==l.length},{fromCodePoint:function(e){for(var t,r=[],n=arguments.length,i=0;n>i;){if(t=+arguments[i++],s(t,1114111)!==t)throw o(t+" is not a valid code point");r[i]=t<65536?a(t):a(55296+((t-=65536)>>10),t%1024+56320)}return c(r,"")}})},67786:(e,t,r)=>{"use strict";var n=r(90915),i=r(43171),s=r(12762),o=r(1455),a=r(34336),l=r(12407),c=i("".indexOf);n({target:"String",proto:!0,forced:!l("includes")},{includes:function(e){return!!~c(a(o(this)),a(s(e)),arguments.length>1?arguments[1]:void 0)}})},91814:(e,t,r)=>{"use strict";var n=r(90915),i=r(43171),s=r(1455),o=r(34336),a=i("".charCodeAt);n({target:"String",proto:!0},{isWellFormed:function(){for(var e=o(s(this)),t=e.length,r=0;r<t;r++){var n=a(e,r);if(55296==(63488&n)&&(n>=56320||++r>=t||56320!=(64512&a(e,r))))return!1}return!0}})},19670:(e,t,r)=>{"use strict";var n=r(90915),i=r(1935);n({target:"String",proto:!0,forced:r(78916)("italics")},{italics:function(){return i(this,"i","","")}})},67073:(e,t,r)=>{"use strict";var n=r(67710).charAt,i=r(34336),s=r(76980),o=r(70407),a=r(93166),l="String Iterator",c=s.set,u=s.getterFor(l);o(String,"String",(function(e){c(this,{type:l,string:i(e),index:0})}),(function(){var e,t=u(this),r=t.string,i=t.index;return i>=r.length?a(void 0,!0):(e=n(r,i),t.index+=e.length,a(e,!1))}))},85651:(e,t,r)=>{"use strict";var n=r(90915),i=r(1935);n({target:"String",proto:!0,forced:r(78916)("link")},{link:function(e){return i(this,"a","href",e)}})},67440:(e,t,r)=>{"use strict";var n=r(90915),i=r(69562),s=r(17337),o=r(90973),a=r(93166),l=r(1455),c=r(64001),u=r(34336),d=r(66688),h=r(74192),p=r(67839),m=r(10951),f=r(28263),g=r(84839),y=r(70119),b=r(63388),v=r(60664),_=r(2418),x=r(22056),w=r(69163),R=r(76980),k=r(37792),j=v("matchAll"),z="RegExp String",q=z+" Iterator",$=R.set,Z=R.getterFor(q),X=RegExp.prototype,Y=TypeError,ee=s("".indexOf),te=s("".matchAll),re=!!te&&!b((function(){te("a",/./)})),ne=o((function(e,t,r,n){$(this,{type:q,regexp:e,string:t,global:r,unicode:n,done:!1})}),z,(function(){var e=Z(this);if(e.done)return a(void 0,!0);var t=e.regexp,r=e.string,n=w(t,r);return null===n?(e.done=!0,a(void 0,!0)):e.global?(""===u(n[0])&&(t.lastIndex=x(r,c(t.lastIndex),e.unicode)),a(n,!1)):(e.done=!0,a(n,!1))})),ie=function(e){var t,r,n,i=d(this),s=u(e),o=_(i,RegExp),a=u(f(i));return t=new o(o===RegExp?i.source:i,a),r=!!~ee(a,"g"),n=!!~ee(a,"u"),t.lastIndex=c(i.lastIndex),new ne(t,s,r,n)};n({target:"String",proto:!0,forced:re},{matchAll:function(e){var t,r,n,s,o=l(this);if(h(e)){if(re)return te(o,e)}else{if(m(e)&&(t=u(l(f(e))),!~ee(t,"g")))throw Y("`.matchAll` does not allow non-global regexes");if(re)return te(o,e);if(void 0===(n=g(e,j))&&k&&"RegExp"===p(e)&&(n=ie),n)return i(n,e,o)}return r=u(o),s=new RegExp(e,"g"),k?i(ie,s,r):s[j](r)}}),k||j in X||y(X,j,ie)},11678:(e,t,r)=>{"use strict";var n=r(69562),i=r(47165),s=r(66688),o=r(74192),a=r(64001),l=r(34336),c=r(1455),u=r(84839),d=r(22056),h=r(69163);i("match",(function(e,t,r){return[function(t){var r=c(this),i=o(t)?void 0:u(t,e);return i?n(i,t,r):new RegExp(t)[e](l(r))},function(e){var n=s(this),i=l(e),o=r(t,n,i);if(o.done)return o.value;if(!n.global)return h(n,i);var c=n.unicode;n.lastIndex=0;for(var u,p=[],m=0;null!==(u=h(n,i));){var f=l(u[0]);p[m]=f,""===f&&(n.lastIndex=d(i,a(n.lastIndex),c)),m++}return 0===m?null:p}]}))},77154:(e,t,r)=>{"use strict";var n=r(90915),i=r(83932).end;n({target:"String",proto:!0,forced:r(98436)},{padEnd:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},3551:(e,t,r)=>{"use strict";var n=r(90915),i=r(83932).start;n({target:"String",proto:!0,forced:r(98436)},{padStart:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},33909:(e,t,r)=>{"use strict";var n=r(90915),i=r(43171),s=r(20990),o=r(58258),a=r(34336),l=r(46799),c=i([].push),u=i([].join);n({target:"String",stat:!0},{raw:function(e){var t=s(o(e).raw),r=l(t);if(!r)return"";for(var n=arguments.length,i=[],d=0;;){if(c(i,a(t[d++])),d===r)return u(i,"");d<n&&c(i,a(arguments[d]))}}})},13984:(e,t,r)=>{"use strict";r(90915)({target:"String",proto:!0},{repeat:r(32562)})},23169:(e,t,r)=>{"use strict";var n=r(90915),i=r(69562),s=r(43171),o=r(1455),a=r(64506),l=r(74192),c=r(10951),u=r(34336),d=r(84839),h=r(28263),p=r(66023),m=r(60664),f=r(37792),g=m("replace"),y=TypeError,b=s("".indexOf),v=s("".replace),_=s("".slice),x=Math.max,w=function(e,t,r){return r>e.length?-1:""===t?r:b(e,t,r)};n({target:"String",proto:!0},{replaceAll:function(e,t){var r,n,s,m,R,k,j,z,q,$=o(this),Z=0,X=0,Y="";if(!l(e)){if((r=c(e))&&(n=u(o(h(e))),!~b(n,"g")))throw y("`.replaceAll` does not allow non-global regexes");if(s=d(e,g))return i(s,e,$,t);if(f&&r)return v(u($),e,t)}for(m=u($),R=u(e),(k=a(t))||(t=u(t)),j=R.length,z=x(1,j),Z=w(m,R,0);-1!==Z;)q=k?u(t(R,Z,m)):p(R,m,Z,[],void 0,t),Y+=_(m,X,Z)+q,X=Z+j,Z=w(m,R,Z+z);return X<m.length&&(Y+=_(m,X)),Y}})},34779:(e,t,r)=>{"use strict";var n=r(88168),i=r(69562),s=r(43171),o=r(47165),a=r(63388),l=r(66688),c=r(64506),u=r(74192),d=r(71738),h=r(64001),p=r(34336),m=r(1455),f=r(22056),g=r(84839),y=r(66023),b=r(69163),v=r(60664)("replace"),_=Math.max,x=Math.min,w=s([].concat),R=s([].push),k=s("".indexOf),j=s("".slice),z="$0"==="a".replace(/./,"$0"),q=!!/./[v]&&""===/./[v]("a","$0");o("replace",(function(e,t,r){var s=q?"$":"$0";return[function(e,r){var n=m(this),s=u(e)?void 0:g(e,v);return s?i(s,e,n,r):i(t,p(n),e,r)},function(e,i){var o=l(this),a=p(e);if("string"==typeof i&&-1===k(i,s)&&-1===k(i,"$<")){var u=r(t,o,a,i);if(u.done)return u.value}var m=c(i);m||(i=p(i));var g,v=o.global;v&&(g=o.unicode,o.lastIndex=0);for(var z,q=[];null!==(z=b(o,a))&&(R(q,z),v);){""===p(z[0])&&(o.lastIndex=f(a,h(o.lastIndex),g))}for(var $,Z="",X=0,Y=0;Y<q.length;Y++){for(var ee,te=p((z=q[Y])[0]),re=_(x(d(z.index),a.length),0),ne=[],ie=1;ie<z.length;ie++)R(ne,void 0===($=z[ie])?$:String($));var se=z.groups;if(m){var oe=w([te],ne,re,a);void 0!==se&&R(oe,se),ee=p(n(i,void 0,oe))}else ee=y(te,a,re,ne,se,i);re>=X&&(Z+=j(a,X,re)+ee,X=re+te.length)}return Z+j(a,X)}]}),!!a((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!z||q)},30887:(e,t,r)=>{"use strict";var n=r(69562),i=r(47165),s=r(66688),o=r(74192),a=r(1455),l=r(24371),c=r(34336),u=r(84839),d=r(69163);i("search",(function(e,t,r){return[function(t){var r=a(this),i=o(t)?void 0:u(t,e);return i?n(i,t,r):new RegExp(t)[e](c(r))},function(e){var n=s(this),i=c(e),o=r(t,n,i);if(o.done)return o.value;var a=n.lastIndex;l(a,0)||(n.lastIndex=0);var u=d(n,i);return l(n.lastIndex,a)||(n.lastIndex=a),null===u?-1:u.index}]}))},42216:(e,t,r)=>{"use strict";var n=r(90915),i=r(1935);n({target:"String",proto:!0,forced:r(78916)("small")},{small:function(){return i(this,"small","","")}})},80243:(e,t,r)=>{"use strict";var n=r(88168),i=r(69562),s=r(43171),o=r(47165),a=r(66688),l=r(74192),c=r(10951),u=r(1455),d=r(2418),h=r(22056),p=r(64001),m=r(34336),f=r(84839),g=r(31538),y=r(69163),b=r(57604),v=r(2422),_=r(63388),x=v.UNSUPPORTED_Y,w=4294967295,R=Math.min,k=[].push,j=s(/./.exec),z=s(k),q=s("".slice);o("split",(function(e,t,r){var s;return s="c"==="abbc".split(/(b)*/)[1]||4!=="test".split(/(?:)/,-1).length||2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,r){var s=m(u(this)),o=void 0===r?w:r>>>0;if(0===o)return[];if(void 0===e)return[s];if(!c(e))return i(t,s,e,o);for(var a,l,d,h=[],p=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),f=0,y=new RegExp(e.source,p+"g");(a=i(b,y,s))&&!((l=y.lastIndex)>f&&(z(h,q(s,f,a.index)),a.length>1&&a.index<s.length&&n(k,h,g(a,1)),d=a[0].length,f=l,h.length>=o));)y.lastIndex===a.index&&y.lastIndex++;return f===s.length?!d&&j(y,"")||z(h,""):z(h,q(s,f)),h.length>o?g(h,0,o):h}:"0".split(void 0,0).length?function(e,r){return void 0===e&&0===r?[]:i(t,this,e,r)}:t,[function(t,r){var n=u(this),o=l(t)?void 0:f(t,e);return o?i(o,t,n,r):i(s,m(n),t,r)},function(e,n){var i=a(this),o=m(e),l=r(s,i,o,n,s!==t);if(l.done)return l.value;var c=d(i,RegExp),u=i.unicode,f=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(x?"g":"y"),g=new c(x?"^(?:"+i.source+")":i,f),b=void 0===n?w:n>>>0;if(0===b)return[];if(0===o.length)return null===y(g,o)?[o]:[];for(var v=0,_=0,k=[];_<o.length;){g.lastIndex=x?0:_;var j,$=y(g,x?q(o,_):o);if(null===$||(j=R(p(g.lastIndex+(x?_:0)),o.length))===v)_=h(o,_,u);else{if(z(k,q(o,v,_)),k.length===b)return k;for(var Z=1;Z<=$.length-1;Z++)if(z(k,$[Z]),k.length===b)return k;_=v=j}}return z(k,q(o,v)),k}]}),!!_((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var r="ab".split(e);return 2!==r.length||"a"!==r[0]||"b"!==r[1]})),x)},63627:(e,t,r)=>{"use strict";var n,i=r(90915),s=r(17337),o=r(66790).f,a=r(64001),l=r(34336),c=r(12762),u=r(1455),d=r(12407),h=r(37792),p=s("".startsWith),m=s("".slice),f=Math.min,g=d("startsWith");i({target:"String",proto:!0,forced:!!(h||g||(n=o(String.prototype,"startsWith"),!n||n.writable))&&!g},{startsWith:function(e){var t=l(u(this));c(e);var r=a(f(arguments.length>1?arguments[1]:void 0,t.length)),n=l(e);return p?p(t,n,r):m(t,r,r+n.length)===n}})},37329:(e,t,r)=>{"use strict";var n=r(90915),i=r(1935);n({target:"String",proto:!0,forced:r(78916)("strike")},{strike:function(){return i(this,"strike","","")}})},43113:(e,t,r)=>{"use strict";var n=r(90915),i=r(1935);n({target:"String",proto:!0,forced:r(78916)("sub")},{sub:function(){return i(this,"sub","","")}})},18234:(e,t,r)=>{"use strict";var n=r(90915),i=r(43171),s=r(1455),o=r(71738),a=r(34336),l=i("".slice),c=Math.max,u=Math.min;n({target:"String",proto:!0,forced:!"".substr||"b"!=="ab".substr(-1)},{substr:function(e,t){var r,n,i=a(s(this)),d=i.length,h=o(e);return h===1/0&&(h=0),h<0&&(h=c(d+h,0)),(r=void 0===t?d:o(t))<=0||r===1/0||h>=(n=u(h+r,d))?"":l(i,h,n)}})},3575:(e,t,r)=>{"use strict";var n=r(90915),i=r(1935);n({target:"String",proto:!0,forced:r(78916)("sup")},{sup:function(){return i(this,"sup","","")}})},21091:(e,t,r)=>{"use strict";var n=r(90915),i=r(69562),s=r(43171),o=r(1455),a=r(34336),l=r(63388),c=Array,u=s("".charAt),d=s("".charCodeAt),h=s([].join),p="".toWellFormed,m=p&&l((function(){return"1"!==i(p,1)}));n({target:"String",proto:!0,forced:m},{toWellFormed:function(){var e=a(o(this));if(m)return i(p,e);for(var t=e.length,r=c(t),n=0;n<t;n++){var s=d(e,n);55296!=(63488&s)?r[n]=u(e,n):s>=56320||n+1>=t||56320!=(64512&d(e,n+1))?r[n]="�":(r[n]=u(e,n),r[++n]=u(e,n))}return h(r,"")}})},96019:(e,t,r)=>{"use strict";r(67720);var n=r(90915),i=r(19353);n({target:"String",proto:!0,name:"trimEnd",forced:"".trimEnd!==i},{trimEnd:i})},20161:(e,t,r)=>{"use strict";var n=r(90915),i=r(62344);n({target:"String",proto:!0,name:"trimStart",forced:"".trimLeft!==i},{trimLeft:i})},67720:(e,t,r)=>{"use strict";var n=r(90915),i=r(19353);n({target:"String",proto:!0,name:"trimEnd",forced:"".trimRight!==i},{trimRight:i})},43758:(e,t,r)=>{"use strict";r(20161);var n=r(90915),i=r(62344);n({target:"String",proto:!0,name:"trimStart",forced:"".trimStart!==i},{trimStart:i})},2967:(e,t,r)=>{"use strict";var n=r(90915),i=r(72889).trim;n({target:"String",proto:!0,forced:r(42395)("trim")},{trim:function(){return i(this)}})},76397:(e,t,r)=>{"use strict";r(46654)("asyncIterator")},842:(e,t,r)=>{"use strict";var n=r(90915),i=r(19042),s=r(69562),o=r(43171),a=r(37792),l=r(26471),c=r(51766),u=r(63388),d=r(98284),h=r(11624),p=r(66688),m=r(20990),f=r(90422),g=r(34336),y=r(63833),b=r(6731),v=r(83435),_=r(68843),x=r(50703),w=r(64754),R=r(66790),k=r(58204),j=r(96700),z=r(1054),q=r(70119),$=r(60851),Z=r(30728),X=r(88890),Y=r(14226),ee=r(33043),te=r(60664),re=r(4128),ne=r(46654),ie=r(59355),se=r(99176),oe=r(76980),ae=r(68214).forEach,le=X("hidden"),ce="Symbol",ue="prototype",de=oe.set,he=oe.getterFor(ce),pe=Object[ue],me=i.Symbol,fe=me&&me[ue],ge=i.TypeError,ye=i.QObject,be=R.f,ve=k.f,_e=x.f,xe=z.f,we=o([].push),Se=Z("symbols"),Pe=Z("op-symbols"),Te=Z("wks"),Re=!ye||!ye[ue]||!ye[ue].findChild,ke=l&&u((function(){return 7!==b(ve({},"a",{get:function(){return ve(this,"a",{value:7}).a}})).a}))?function(e,t,r){var n=be(pe,t);n&&delete pe[t],ve(e,t,r),n&&e!==pe&&ve(pe,t,n)}:ve,Ie=function(e,t){var r=Se[e]=b(fe);return de(r,{type:ce,tag:e,description:t}),l||(r.description=t),r},je=function(e,t,r){e===pe&&je(Pe,t,r),p(e);var n=f(t);return p(r),d(Se,n)?(r.enumerable?(d(e,le)&&e[le][n]&&(e[le][n]=!1),r=b(r,{enumerable:y(0,!1)})):(d(e,le)||ve(e,le,y(1,{})),e[le][n]=!0),ke(e,n,r)):ve(e,n,r)},He=function(e,t){p(e);var r=m(t),n=v(r).concat(Ve(r));return ae(n,(function(t){l&&!s(ze,r,t)||je(e,t,r[t])})),e},ze=function(e){var t=f(e),r=s(xe,this,t);return!(this===pe&&d(Se,t)&&!d(Pe,t))&&(!(r||!d(this,t)||!d(Se,t)||d(this,le)&&this[le][t])||r)},Ge=function(e,t){var r=m(e),n=f(t);if(r!==pe||!d(Se,n)||d(Pe,n)){var i=be(r,n);return!i||!d(Se,n)||d(r,le)&&r[le][n]||(i.enumerable=!0),i}},We=function(e){var t=_e(m(e)),r=[];return ae(t,(function(e){d(Se,e)||d(Y,e)||we(r,e)})),r},Ve=function(e){var t=e===pe,r=_e(t?Pe:m(e)),n=[];return ae(r,(function(e){!d(Se,e)||t&&!d(pe,e)||we(n,Se[e])})),n};c||(q(fe=(me=function(){if(h(fe,this))throw ge("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?g(arguments[0]):void 0,t=ee(e),r=function(e){this===pe&&s(r,Pe,e),d(this,le)&&d(this[le],t)&&(this[le][t]=!1),ke(this,t,y(1,e))};return l&&Re&&ke(pe,t,{configurable:!0,set:r}),Ie(t,e)})[ue],"toString",(function(){return he(this).tag})),q(me,"withoutSetter",(function(e){return Ie(ee(e),e)})),z.f=ze,k.f=je,j.f=He,R.f=Ge,_.f=x.f=We,w.f=Ve,re.f=function(e){return Ie(te(e),e)},l&&($(fe,"description",{configurable:!0,get:function(){return he(this).description}}),a||q(pe,"propertyIsEnumerable",ze,{unsafe:!0}))),n({global:!0,constructor:!0,wrap:!0,forced:!c,sham:!c},{Symbol:me}),ae(v(Te),(function(e){ne(e)})),n({target:ce,stat:!0,forced:!c},{useSetter:function(){Re=!0},useSimple:function(){Re=!1}}),n({target:"Object",stat:!0,forced:!c,sham:!l},{create:function(e,t){return void 0===t?b(e):He(b(e),t)},defineProperty:je,defineProperties:He,getOwnPropertyDescriptor:Ge}),n({target:"Object",stat:!0,forced:!c},{getOwnPropertyNames:We}),ie(),se(me,ce),Y[le]=!0},33404:(e,t,r)=>{"use strict";var n=r(90915),i=r(26471),s=r(19042),o=r(43171),a=r(98284),l=r(64506),c=r(11624),u=r(34336),d=r(60851),h=r(44123),p=s.Symbol,m=p&&p.prototype;if(i&&l(p)&&(!("description"in m)||void 0!==p().description)){var f={},SymbolWrapper=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:u(arguments[0]),t=c(m,this)?new p(e):void 0===e?p():p(e);return""===e&&(f[t]=!0),t};h(SymbolWrapper,p),SymbolWrapper.prototype=m,m.constructor=SymbolWrapper;var g="Symbol(description detection)"===String(p("description detection")),y=o(m.valueOf),b=o(m.toString),v=/^Symbol\((.*)\)[^)]+$/,_=o("".replace),x=o("".slice);d(m,"description",{configurable:!0,get:function(){var e=y(this);if(a(f,e))return"";var t=b(e),r=g?x(t,7,-1):_(t,v,"$1");return""===r?void 0:r}}),n({global:!0,constructor:!0,forced:!0},{Symbol:SymbolWrapper})}},31857:(e,t,r)=>{"use strict";var n=r(90915),i=r(84830),s=r(98284),o=r(34336),a=r(30728),l=r(38507),c=a("string-to-symbol-registry"),u=a("symbol-to-string-registry");n({target:"Symbol",stat:!0,forced:!l},{for:function(e){var t=o(e);if(s(c,t))return c[t];var r=i("Symbol")(t);return c[t]=r,u[r]=t,r}})},57748:(e,t,r)=>{"use strict";r(46654)("hasInstance")},52873:(e,t,r)=>{"use strict";r(46654)("isConcatSpreadable")},13546:(e,t,r)=>{"use strict";r(46654)("iterator")},28068:(e,t,r)=>{"use strict";r(842),r(31857),r(62223),r(43881),r(12784)},62223:(e,t,r)=>{"use strict";var n=r(90915),i=r(98284),s=r(85706),o=r(65840),a=r(30728),l=r(38507),c=a("symbol-to-string-registry");n({target:"Symbol",stat:!0,forced:!l},{keyFor:function(e){if(!s(e))throw TypeError(o(e)+" is not a symbol");if(i(c,e))return c[e]}})},45905:(e,t,r)=>{"use strict";r(46654)("matchAll")},47083:(e,t,r)=>{"use strict";r(46654)("match")},96630:(e,t,r)=>{"use strict";r(46654)("replace")},12064:(e,t,r)=>{"use strict";r(46654)("search")},59036:(e,t,r)=>{"use strict";r(46654)("species")},49010:(e,t,r)=>{"use strict";r(46654)("split")},12213:(e,t,r)=>{"use strict";var n=r(46654),i=r(59355);n("toPrimitive"),i()},58170:(e,t,r)=>{"use strict";var n=r(84830),i=r(46654),s=r(99176);i("toStringTag"),s(n("Symbol"),"Symbol")},87069:(e,t,r)=>{"use strict";r(46654)("unscopables")},97063:(e,t,r)=>{"use strict";var n=r(87545),i=r(46799),s=r(71738),o=n.aTypedArray;(0,n.exportTypedArrayMethod)("at",(function(e){var t=o(this),r=i(t),n=s(e),a=n>=0?n:r+n;return a<0||a>=r?void 0:t[a]}))},14807:(e,t,r)=>{"use strict";var n=r(43171),i=r(87545),s=n(r(9866)),o=i.aTypedArray;(0,i.exportTypedArrayMethod)("copyWithin",(function(e,t){return s(o(this),e,t,arguments.length>2?arguments[2]:void 0)}))},99059:(e,t,r)=>{"use strict";var n=r(87545),i=r(68214).every,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("every",(function(e){return i(s(this),e,arguments.length>1?arguments[1]:void 0)}))},70807:(e,t,r)=>{"use strict";var n=r(87545),i=r(52024),s=r(98923),o=r(57228),a=r(69562),l=r(43171),c=r(63388),u=n.aTypedArray,d=n.exportTypedArrayMethod,h=l("".slice);d("fill",(function(e){var t=arguments.length;u(this);var r="Big"===h(o(this),0,3)?s(e):+e;return a(i,this,r,t>1?arguments[1]:void 0,t>2?arguments[2]:void 0)}),c((function(){var e=0;return new Int8Array(2).fill({valueOf:function(){return e++}}),1!==e})))},63532:(e,t,r)=>{"use strict";var n=r(87545),i=r(68214).filter,s=r(11266),o=n.aTypedArray;(0,n.exportTypedArrayMethod)("filter",(function(e){var t=i(o(this),e,arguments.length>1?arguments[1]:void 0);return s(this,t)}))},44208:(e,t,r)=>{"use strict";var n=r(87545),i=r(68214).findIndex,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("findIndex",(function(e){return i(s(this),e,arguments.length>1?arguments[1]:void 0)}))},55943:(e,t,r)=>{"use strict";var n=r(87545),i=r(41508).findLastIndex,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("findLastIndex",(function(e){return i(s(this),e,arguments.length>1?arguments[1]:void 0)}))},15666:(e,t,r)=>{"use strict";var n=r(87545),i=r(41508).findLast,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("findLast",(function(e){return i(s(this),e,arguments.length>1?arguments[1]:void 0)}))},43741:(e,t,r)=>{"use strict";var n=r(87545),i=r(68214).find,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("find",(function(e){return i(s(this),e,arguments.length>1?arguments[1]:void 0)}))},76835:(e,t,r)=>{"use strict";r(49300)("Float32",(function(e){return function(t,r,n){return e(this,t,r,n)}}))},74172:(e,t,r)=>{"use strict";r(49300)("Float64",(function(e){return function(t,r,n){return e(this,t,r,n)}}))},17841:(e,t,r)=>{"use strict";var n=r(87545),i=r(68214).forEach,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("forEach",(function(e){i(s(this),e,arguments.length>1?arguments[1]:void 0)}))},89142:(e,t,r)=>{"use strict";var n=r(5882);(0,r(87545).exportTypedArrayStaticMethod)("from",r(28046),n)},58179:(e,t,r)=>{"use strict";var n=r(87545),i=r(26484).includes,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("includes",(function(e){return i(s(this),e,arguments.length>1?arguments[1]:void 0)}))},61824:(e,t,r)=>{"use strict";var n=r(87545),i=r(26484).indexOf,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("indexOf",(function(e){return i(s(this),e,arguments.length>1?arguments[1]:void 0)}))},15954:(e,t,r)=>{"use strict";r(49300)("Int16",(function(e){return function(t,r,n){return e(this,t,r,n)}}))},90548:(e,t,r)=>{"use strict";r(49300)("Int32",(function(e){return function(t,r,n){return e(this,t,r,n)}}))},27321:(e,t,r)=>{"use strict";r(49300)("Int8",(function(e){return function(t,r,n){return e(this,t,r,n)}}))},81940:(e,t,r)=>{"use strict";var n=r(19042),i=r(63388),s=r(43171),o=r(87545),a=r(22867),l=r(60664)("iterator"),c=n.Uint8Array,u=s(a.values),d=s(a.keys),h=s(a.entries),p=o.aTypedArray,m=o.exportTypedArrayMethod,f=c&&c.prototype,g=!i((function(){f[l].call([1])})),y=!!f&&f.values&&f[l]===f.values&&"values"===f.values.name,b=function(){return u(p(this))};m("entries",(function(){return h(p(this))}),g),m("keys",(function(){return d(p(this))}),g),m("values",b,g||!y,{name:"values"}),m(l,b,g||!y,{name:"values"})},48106:(e,t,r)=>{"use strict";var n=r(87545),i=r(43171),s=n.aTypedArray,o=n.exportTypedArrayMethod,a=i([].join);o("join",(function(e){return a(s(this),e)}))},26509:(e,t,r)=>{"use strict";var n=r(87545),i=r(88168),s=r(68488),o=n.aTypedArray;(0,n.exportTypedArrayMethod)("lastIndexOf",(function(e){var t=arguments.length;return i(s,o(this),t>1?[e,arguments[1]]:[e])}))},85058:(e,t,r)=>{"use strict";var n=r(87545),i=r(68214).map,s=r(56647),o=n.aTypedArray;(0,n.exportTypedArrayMethod)("map",(function(e){return i(o(this),e,arguments.length>1?arguments[1]:void 0,(function(e,t){return new(s(e))(t)}))}))},959:(e,t,r)=>{"use strict";var n=r(87545),i=r(5882),s=n.aTypedArrayConstructor;(0,n.exportTypedArrayStaticMethod)("of",(function(){for(var e=0,t=arguments.length,r=new(s(this))(t);t>e;)r[e]=arguments[e++];return r}),i)},66251:(e,t,r)=>{"use strict";var n=r(87545),i=r(71379).right,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("reduceRight",(function(e){var t=arguments.length;return i(s(this),e,t,t>1?arguments[1]:void 0)}))},78188:(e,t,r)=>{"use strict";var n=r(87545),i=r(71379).left,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("reduce",(function(e){var t=arguments.length;return i(s(this),e,t,t>1?arguments[1]:void 0)}))},30998:(e,t,r)=>{"use strict";var n=r(87545),i=n.aTypedArray,s=n.exportTypedArrayMethod,o=Math.floor;s("reverse",(function(){for(var e,t=this,r=i(t).length,n=o(r/2),s=0;s<n;)e=t[s],t[s++]=t[--r],t[r]=e;return t}))},79960:(e,t,r)=>{"use strict";var n=r(19042),i=r(69562),s=r(87545),o=r(46799),a=r(78118),l=r(58258),c=r(63388),u=n.RangeError,d=n.Int8Array,h=d&&d.prototype,p=h&&h.set,m=s.aTypedArray,f=s.exportTypedArrayMethod,g=!c((function(){var e=new Uint8ClampedArray(2);return i(p,e,{length:1,0:3},1),3!==e[1]})),y=g&&s.NATIVE_ARRAY_BUFFER_VIEWS&&c((function(){var e=new d(2);return e.set(1),e.set("2",1),0!==e[0]||2!==e[1]}));f("set",(function(e){m(this);var t=a(arguments.length>1?arguments[1]:void 0,1),r=l(e);if(g)return i(p,this,r,t);var n=this.length,s=o(r),c=0;if(s+t>n)throw u("Wrong length");for(;c<s;)this[t+c]=r[c++]}),!g||y)},19018:(e,t,r)=>{"use strict";var n=r(87545),i=r(56647),s=r(63388),o=r(34147),a=n.aTypedArray;(0,n.exportTypedArrayMethod)("slice",(function(e,t){for(var r=o(a(this),e,t),n=i(this),s=0,l=r.length,c=new n(l);l>s;)c[s]=r[s++];return c}),s((function(){new Int8Array(1).slice()})))},80746:(e,t,r)=>{"use strict";var n=r(87545),i=r(68214).some,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("some",(function(e){return i(s(this),e,arguments.length>1?arguments[1]:void 0)}))},37090:(e,t,r)=>{"use strict";var n=r(19042),i=r(17337),s=r(63388),o=r(1343),a=r(58337),l=r(87545),c=r(39161),u=r(84487),d=r(91795),h=r(44091),p=l.aTypedArray,m=l.exportTypedArrayMethod,f=n.Uint16Array,g=f&&i(f.prototype.sort),y=!(!g||s((function(){g(new f(2),null)}))&&s((function(){g(new f(2),{})}))),b=!!g&&!s((function(){if(d)return d<74;if(c)return c<67;if(u)return!0;if(h)return h<602;var e,t,r=new f(516),n=Array(516);for(e=0;e<516;e++)t=e%4,r[e]=515-e,n[e]=e-2*t+3;for(g(r,(function(e,t){return(e/4|0)-(t/4|0)})),e=0;e<516;e++)if(r[e]!==n[e])return!0}));m("sort",(function(e){return void 0!==e&&o(e),b?g(this,e):a(p(this),function(e){return function(t,r){return void 0!==e?+e(t,r)||0:r!=r?-1:t!=t?1:0===t&&0===r?1/t>0&&1/r<0?1:-1:t>r}}(e))}),!b||y)},39137:(e,t,r)=>{"use strict";var n=r(87545),i=r(64001),s=r(96017),o=r(56647),a=n.aTypedArray;(0,n.exportTypedArrayMethod)("subarray",(function(e,t){var r=a(this),n=r.length,l=s(e,n);return new(o(r))(r.buffer,r.byteOffset+l*r.BYTES_PER_ELEMENT,i((void 0===t?n:s(t,n))-l))}))},786:(e,t,r)=>{"use strict";var n=r(19042),i=r(88168),s=r(87545),o=r(63388),a=r(34147),l=n.Int8Array,c=s.aTypedArray,u=s.exportTypedArrayMethod,d=[].toLocaleString,h=!!l&&o((function(){d.call(new l(1))}));u("toLocaleString",(function(){return i(d,h?a(c(this)):c(this),a(arguments))}),o((function(){return[1,2].toLocaleString()!==new l([1,2]).toLocaleString()}))||!o((function(){l.prototype.toLocaleString.call([1,2])})))},77546:(e,t,r)=>{"use strict";var n=r(26399),i=r(87545),s=i.aTypedArray,o=i.exportTypedArrayMethod,a=i.getTypedArrayConstructor;o("toReversed",(function(){return n(s(this),a(this))}))},51661:(e,t,r)=>{"use strict";var n=r(87545),i=r(43171),s=r(1343),o=r(9157),a=n.aTypedArray,l=n.getTypedArrayConstructor,c=n.exportTypedArrayMethod,u=i(n.TypedArrayPrototype.sort);c("toSorted",(function(e){void 0!==e&&s(e);var t=a(this),r=o(l(t),t);return u(r,e)}))},64601:(e,t,r)=>{"use strict";var n=r(87545).exportTypedArrayMethod,i=r(63388),s=r(19042),o=r(43171),a=s.Uint8Array,l=a&&a.prototype||{},c=[].toString,u=o([].join);i((function(){c.call({})}))&&(c=function(){return u(this)});var d=l.toString!==c;n("toString",c,d)},84921:(e,t,r)=>{"use strict";r(49300)("Uint16",(function(e){return function(t,r,n){return e(this,t,r,n)}}))},5551:(e,t,r)=>{"use strict";r(49300)("Uint32",(function(e){return function(t,r,n){return e(this,t,r,n)}}))},45384:(e,t,r)=>{"use strict";r(49300)("Uint8",(function(e){return function(t,r,n){return e(this,t,r,n)}}))},47003:(e,t,r)=>{"use strict";r(49300)("Uint8",(function(e){return function(t,r,n){return e(this,t,r,n)}}),!0)},40986:(e,t,r)=>{"use strict";var n=r(59957),i=r(87545),s=r(47006),o=r(71738),a=r(98923),l=i.aTypedArray,c=i.getTypedArrayConstructor,u=i.exportTypedArrayMethod,d=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(e){return 8===e}}();u("with",{with:function(e,t){var r=l(this),i=o(e),u=s(r)?a(t):+t;return n(r,c(r),i,u)}}.with,!d)},40976:(e,t,r)=>{"use strict";var n=r(90915),i=r(43171),s=r(34336),o=String.fromCharCode,a=i("".charAt),l=i(/./.exec),c=i("".slice),u=/^[\da-f]{2}$/i,d=/^[\da-f]{4}$/i;n({global:!0},{unescape:function(e){for(var t,r,n=s(e),i="",h=n.length,p=0;p<h;){if("%"===(t=a(n,p++)))if("u"===a(n,p)){if(r=c(n,p+1,p+5),l(d,r)){i+=o(parseInt(r,16)),p+=5;continue}}else if(r=c(n,p,p+2),l(u,r)){i+=o(parseInt(r,16)),p+=2;continue}i+=t}return i}})},35361:(e,t,r)=>{"use strict";var n,i=r(81745),s=r(19042),o=r(43171),a=r(60114),l=r(98268),c=r(49225),u=r(54974),d=r(21629),h=r(76980).enforce,p=r(63388),m=r(78167),f=Object,g=Array.isArray,y=f.isExtensible,b=f.isFrozen,v=f.isSealed,_=f.freeze,x=f.seal,w={},R={},k=!s.ActiveXObject&&"ActiveXObject"in s,j=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},z=c("WeakMap",j,u),q=z.prototype,$=o(q.set);if(m)if(k){n=u.getConstructor(j,"WeakMap",!0),l.enable();var Z=o(q.delete),X=o(q.has),Y=o(q.get);a(q,{delete:function(e){if(d(e)&&!y(e)){var t=h(this);return t.frozen||(t.frozen=new n),Z(this,e)||t.frozen.delete(e)}return Z(this,e)},has:function(e){if(d(e)&&!y(e)){var t=h(this);return t.frozen||(t.frozen=new n),X(this,e)||t.frozen.has(e)}return X(this,e)},get:function(e){if(d(e)&&!y(e)){var t=h(this);return t.frozen||(t.frozen=new n),X(this,e)?Y(this,e):t.frozen.get(e)}return Y(this,e)},set:function(e,t){if(d(e)&&!y(e)){var r=h(this);r.frozen||(r.frozen=new n),X(this,e)?$(this,e,t):r.frozen.set(e,t)}else $(this,e,t);return this}})}else i&&p((function(){var e=_([]);return $(new z,e,1),!b(e)}))&&a(q,{set:function(e,t){var r;return g(e)&&(b(e)?r=w:v(e)&&(r=R)),$(this,e,t),r===w&&_(e),r===R&&x(e),this}})},75611:(e,t,r)=>{"use strict";r(35361)},4503:(e,t,r)=>{"use strict";r(49225)("WeakSet",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),r(54974))},32053:(e,t,r)=>{"use strict";r(4503)},42500:(e,t,r)=>{"use strict";var n=r(90915),i=r(19042),s=r(84830),o=r(43171),a=r(69562),l=r(63388),c=r(34336),u=r(98284),d=r(46147),h=r(77749).ctoi,p=/[^\d+/a-z]/i,m=/[\t\n\f\r ]+/g,f=/[=]{1,2}$/,g=s("atob"),y=String.fromCharCode,b=o("".charAt),v=o("".replace),_=o(p.exec),x=l((function(){return""!==g(" ")})),w=!l((function(){g("a")})),R=!x&&!w&&!l((function(){g()})),k=!x&&!w&&1!==g.length;n({global:!0,bind:!0,enumerable:!0,forced:x||w||R||k},{atob:function(e){if(d(arguments.length,1),R||k)return a(g,i,e);var t,r,n=v(c(e),m,""),o="",l=0,x=0;if(n.length%4==0&&(n=v(n,f,"")),n.length%4==1||_(p,n))throw new(s("DOMException"))("The string is not correctly encoded","InvalidCharacterError");for(;t=b(n,l++);)u(h,t)&&(r=x%4?64*r+h[t]:h[t],x++%4&&(o+=y(255&r>>(-2*x&6))));return o}})},45634:(e,t,r)=>{"use strict";var n=r(90915),i=r(19042),s=r(84830),o=r(43171),a=r(69562),l=r(63388),c=r(34336),u=r(46147),d=r(77749).itoc,h=s("btoa"),p=o("".charAt),m=o("".charCodeAt),f=!!h&&!l((function(){h()})),g=!!h&&l((function(){return"bnVsbA=="!==h(null)})),y=!!h&&1!==h.length;n({global:!0,bind:!0,enumerable:!0,forced:f||g||y},{btoa:function(e){if(u(arguments.length,1),f||g||y)return a(h,i,c(e));for(var t,r,n=c(e),o="",l=0,b=d;p(n,l)||(b="=",l%1);){if((r=m(n,l+=3/4))>255)throw new(s("DOMException"))("The string contains characters outside of the Latin1 range","InvalidCharacterError");o+=p(b,63&(t=t<<8|r)>>8-l%1*8)}return o}})},64847:(e,t,r)=>{"use strict";var n=r(90915),i=r(19042),s=r(80400).clear;n({global:!0,bind:!0,enumerable:!0,forced:i.clearImmediate!==s},{clearImmediate:s})},3069:(e,t,r)=>{"use strict";var n=r(19042),i=r(40231),s=r(76909),o=r(24338),a=r(43882),l=function(e){if(e&&e.forEach!==o)try{a(e,"forEach",o)}catch(t){e.forEach=o}};for(var c in i)i[c]&&l(n[c]&&n[c].prototype);l(s)},39968:(e,t,r)=>{"use strict";var n=r(19042),i=r(40231),s=r(76909),o=r(22867),a=r(43882),l=r(60664),c=l("iterator"),u=l("toStringTag"),d=o.values,h=function(e,t){if(e){if(e[c]!==d)try{a(e,c,d)}catch(t){e[c]=d}if(e[u]||a(e,u,t),i[t])for(var r in o)if(e[r]!==o[r])try{a(e,r,o[r])}catch(t){e[r]=o[r]}}};for(var p in i)h(n[p]&&n[p].prototype,p);h(s,"DOMTokenList")},88068:(e,t,r)=>{"use strict";var n=r(90915),i=r(78795),s=r(84830),o=r(63388),a=r(6731),l=r(63833),c=r(58204).f,u=r(70119),d=r(60851),h=r(98284),p=r(15036),m=r(66688),f=r(4119),g=r(90800),y=r(16729),b=r(57554),v=r(76980),_=r(26471),x=r(37792),w="DOMException",R="DATA_CLONE_ERR",k=s("Error"),j=s(w)||function(){try{(new(s("MessageChannel")||i("worker_threads").MessageChannel)).port1.postMessage(new WeakMap)}catch(e){if(e.name===R&&25===e.code)return e.constructor}}(),z=j&&j.prototype,q=k.prototype,$=v.set,Z=v.getterFor(w),X="stack"in k(w),Y=function(e){return h(y,e)&&y[e].m?y[e].c:0},ee=function(){p(this,te);var e=arguments.length,t=g(e<1?void 0:arguments[0]),r=g(e<2?void 0:arguments[1],"Error"),n=Y(r);if($(this,{type:w,name:r,message:t,code:n}),_||(this.name=r,this.message=t,this.code=n),X){var i=k(t);i.name=w,c(this,"stack",l(1,b(i.stack,1)))}},te=ee.prototype=a(q),re=function(e){return{enumerable:!0,configurable:!0,get:e}},ne=function(e){return re((function(){return Z(this)[e]}))};_&&(d(te,"code",ne("code")),d(te,"message",ne("message")),d(te,"name",ne("name"))),c(te,"constructor",l(1,ee));var ie=o((function(){return!(new j instanceof k)})),se=ie||o((function(){return q.toString!==f||"2: 1"!==String(new j(1,2))})),oe=ie||o((function(){return 25!==new j(1,"DataCloneError").code})),ae=ie||25!==j[R]||25!==z[R],le=x?se||oe||ae:ie;n({global:!0,constructor:!0,forced:le},{DOMException:le?ee:j});var ce=s(w),ue=ce.prototype;for(var de in se&&(x||j===ce)&&u(ue,"toString",f),oe&&_&&j===ce&&d(ue,"code",re((function(){return Y(m(this).name)}))),y)if(h(y,de)){var he=y[de],pe=he.s,me=l(6,he.c);h(ce,pe)||c(ce,pe,me),h(ue,pe)||c(ue,pe,me)}},36316:(e,t,r)=>{"use strict";var n=r(90915),i=r(19042),s=r(84830),o=r(63833),a=r(58204).f,l=r(98284),c=r(15036),u=r(15540),d=r(90800),h=r(16729),p=r(57554),m=r(26471),f=r(37792),g="DOMException",y=s("Error"),b=s(g),v=function(){c(this,_);var e=arguments.length,t=d(e<1?void 0:arguments[0]),r=d(e<2?void 0:arguments[1],"Error"),n=new b(t,r),i=y(t);return i.name=g,a(n,"stack",o(1,p(i.stack,1))),u(n,this,v),n},_=v.prototype=b.prototype,x="stack"in y(g),w="stack"in new b(1,2),R=b&&m&&Object.getOwnPropertyDescriptor(i,g),k=!(!R||R.writable&&R.configurable),j=x&&!k&&!w;n({global:!0,constructor:!0,forced:f||j},{DOMException:j?v:b});var z=s(g),q=z.prototype;if(q.constructor!==z)for(var $ in f||a(q,"constructor",o(1,z)),h)if(l(h,$)){var Z=h[$],X=Z.s;l(z,X)||a(z,X,o(6,Z.c))}},95132:(e,t,r)=>{"use strict";var n=r(84830),i="DOMException";r(99176)(n(i),i)},85279:(e,t,r)=>{"use strict";r(64847),r(60398)},55609:(e,t,r)=>{"use strict";var n=r(90915),i=r(19042),s=r(91284),o=r(1343),a=r(46147),l=r(47285),c=i.process;n({global:!0,enumerable:!0,dontCallGetSet:!0},{queueMicrotask:function(e){a(arguments.length,1),o(e);var t=l&&c.domain;s(t?t.bind(e):e)}})},45186:(e,t,r)=>{"use strict";var n=r(90915),i=r(19042),s=r(60851),o=r(26471),a=TypeError,l=Object.defineProperty,c=i.self!==i;try{if(o){var u=Object.getOwnPropertyDescriptor(i,"self");!c&&u&&u.get&&u.enumerable||s(i,"self",{get:function(){return i},set:function(e){if(this!==i)throw a("Illegal invocation");l(i,"self",{value:e,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}else n({global:!0,simple:!0,forced:c},{self:i})}catch(e){}},60398:(e,t,r)=>{"use strict";var n=r(90915),i=r(19042),s=r(80400).set,o=r(39173),a=i.setImmediate?o(s,!1):s;n({global:!0,bind:!0,enumerable:!0,forced:i.setImmediate!==a},{setImmediate:a})},82698:(e,t,r)=>{"use strict";var n=r(90915),i=r(19042),s=r(39173)(i.setInterval,!0);n({global:!0,bind:!0,forced:i.setInterval!==s},{setInterval:s})},92496:(e,t,r)=>{"use strict";var n=r(90915),i=r(19042),s=r(39173)(i.setTimeout,!0);n({global:!0,bind:!0,forced:i.setTimeout!==s},{setTimeout:s})},48451:(e,t,r)=>{"use strict";var n,i=r(37792),s=r(90915),o=r(19042),a=r(84830),l=r(43171),c=r(63388),u=r(33043),d=r(64506),h=r(51372),p=r(74192),m=r(21629),f=r(85706),g=r(3079),y=r(66688),b=r(57228),v=r(98284),_=r(90071),x=r(43882),w=r(46799),R=r(46147),k=r(28263),j=r(61575),z=r(8201),q=r(12192),$=r(2645),Z=o.Object,X=o.Array,Y=o.Date,ee=o.Error,te=o.EvalError,re=o.RangeError,ne=o.ReferenceError,ie=o.SyntaxError,se=o.TypeError,oe=o.URIError,ae=o.PerformanceMark,le=o.WebAssembly,ce=le&&le.CompileError||ee,ue=le&&le.LinkError||ee,de=le&&le.RuntimeError||ee,he=a("DOMException"),pe=j.Map,me=j.has,fe=j.get,ge=j.set,ye=z.Set,be=z.add,ve=a("Object","keys"),_e=l([].push),xe=l((!0).valueOf),we=l(1..valueOf),Se=l("".valueOf),Pe=l(Y.prototype.getTime),Te=u("structuredClone"),Re="DataCloneError",ke="Transferring",Ie=function(e){return!c((function(){var t=new o.Set([7]),r=e(t),n=e(Z(7));return r===t||!r.has(7)||"object"!=typeof n||7!=+n}))&&e},je=function(e,t){return!c((function(){var r=new t,n=e({a:r,b:r});return!(n&&n.a===n.b&&n.a instanceof t&&n.a.stack===r.stack)}))},He=o.structuredClone,ze=i||!je(He,ee)||!je(He,he)||(n=He,!!c((function(){var e=n(new o.AggregateError([1],Te,{cause:3}));return"AggregateError"!==e.name||1!==e.errors[0]||e.message!==Te||3!==e.cause}))),Ge=!He&&Ie((function(e){return new ae(Te,{detail:e}).detail})),We=Ie(He)||Ge,Ve=function(e){throw new he("Uncloneable type: "+e,Re)},qe=function(e,t){throw new he((t||"Cloning")+" of "+e+" cannot be properly polyfilled in this engine",Re)},$e=function(e,t){return We||qe(t),We(e)},Xe=function(e,t,r){if(me(t,e))return fe(t,e);var n,i,s,a,l,c;if("SharedArrayBuffer"===(r||b(e)))n=We?We(e):e;else{var u=o.DataView;u||"function"==typeof e.slice||qe("ArrayBuffer");try{if("function"!=typeof e.slice||e.resizable){i=e.byteLength,s="maxByteLength"in e?{maxByteLength:e.maxByteLength}:void 0,n=new ArrayBuffer(i,s),a=new u(e),l=new u(n);for(c=0;c<i;c++)l.setUint8(c,a.getUint8(c))}else n=e.slice(0)}catch(e){throw new he("ArrayBuffer is detached",Re)}}return ge(t,e,n),n},Ye=function(e,t,r,n,i){var s=o[t];return m(s)||qe(t),new s(Xe(e.buffer,i),r,n)},Placeholder=function(e,t,r){this.object=e,this.type=t,this.metadata=r},Qe=function(e,t,r){if(f(e)&&Ve("Symbol"),!m(e))return e;if(t){if(me(t,e))return fe(t,e)}else t=new pe;var n,i,s,l,c,u,h,p,g=b(e);switch(g){case"Array":s=X(w(e));break;case"Object":s={};break;case"Map":s=new pe;break;case"Set":s=new ye;break;case"RegExp":s=new RegExp(e.source,k(e));break;case"Error":switch(i=e.name){case"AggregateError":s=a("AggregateError")([]);break;case"EvalError":s=te();break;case"RangeError":s=re();break;case"ReferenceError":s=ne();break;case"SyntaxError":s=ie();break;case"TypeError":s=se();break;case"URIError":s=oe();break;case"CompileError":s=ce();break;case"LinkError":s=ue();break;case"RuntimeError":s=de();break;default:s=ee()}break;case"DOMException":s=new he(e.message,e.name);break;case"ArrayBuffer":case"SharedArrayBuffer":s=r?new Placeholder(e,g):Xe(e,t,g);break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float16Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":u="DataView"===g?e.byteLength:e.length,s=r?new Placeholder(e,g,{offset:e.byteOffset,length:u}):Ye(e,g,e.byteOffset,u,t);break;case"DOMQuad":try{s=new DOMQuad(Qe(e.p1,t,r),Qe(e.p2,t,r),Qe(e.p3,t,r),Qe(e.p4,t,r))}catch(t){s=$e(e,g)}break;case"File":if(We)try{s=We(e),b(s)!==g&&(s=void 0)}catch(e){}if(!s)try{s=new File([e],e.name,e)}catch(e){}s||qe(g);break;case"FileList":if(l=function(){var e;try{e=new o.DataTransfer}catch(t){try{e=new o.ClipboardEvent("").clipboardData}catch(e){}}return e&&e.items&&e.files?e:null}()){for(c=0,u=w(e);c<u;c++)l.items.add(Qe(e[c],t,r));s=l.files}else s=$e(e,g);break;case"ImageData":try{s=new ImageData(Qe(e.data,t,r),e.width,e.height,{colorSpace:e.colorSpace})}catch(t){s=$e(e,g)}break;default:if(We)s=We(e);else switch(g){case"BigInt":s=Z(e.valueOf());break;case"Boolean":s=Z(xe(e));break;case"Number":s=Z(we(e));break;case"String":s=Z(Se(e));break;case"Date":s=new Y(Pe(e));break;case"Blob":try{s=e.slice(0,e.size,e.type)}catch(e){qe(g)}break;case"DOMPoint":case"DOMPointReadOnly":n=o[g];try{s=n.fromPoint?n.fromPoint(e):new n(e.x,e.y,e.z,e.w)}catch(e){qe(g)}break;case"DOMRect":case"DOMRectReadOnly":n=o[g];try{s=n.fromRect?n.fromRect(e):new n(e.x,e.y,e.width,e.height)}catch(e){qe(g)}break;case"DOMMatrix":case"DOMMatrixReadOnly":n=o[g];try{s=n.fromMatrix?n.fromMatrix(e):new n(e)}catch(e){qe(g)}break;case"AudioData":case"VideoFrame":d(e.clone)||qe(g);try{s=e.clone()}catch(e){Ve(g)}break;case"CropTarget":case"CryptoKey":case"FileSystemDirectoryHandle":case"FileSystemFileHandle":case"FileSystemHandle":case"GPUCompilationInfo":case"GPUCompilationMessage":case"ImageBitmap":case"RTCCertificate":case"WebAssembly.Module":qe(g);default:Ve(g)}}switch(ge(t,e,s),g){case"Array":case"Object":for(h=ve(e),c=0,u=w(h);c<u;c++)p=h[c],_(s,p,Qe(e[p],t,r));break;case"Map":e.forEach((function(e,n){ge(s,Qe(n,t,r),Qe(e,t,r))}));break;case"Set":e.forEach((function(e){be(s,Qe(e,t,r))}));break;case"Error":x(s,"message",Qe(e.message,t,r)),v(e,"cause")&&x(s,"cause",Qe(e.cause,t,r)),"AggregateError"===i&&(s.errors=Qe(e.errors,t,r));case"DOMException":q&&x(s,"stack",Qe(e.stack,t,r))}return s},et=function(e,t){if(!m(e))return e;if(me(t,e))return fe(t,e);var r,n,i,s,o,a,l,c;if(e instanceof Placeholder)switch(r=e.type,n=e.object,r){case"ArrayBuffer":case"SharedArrayBuffer":c=Xe(n,t,r);break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float16Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":i=e.metadata,c=Ye(n,r,i.offset,i.length,t)}else switch(b(e)){case"Array":case"Object":for(a=ve(e),s=0,o=w(a);s<o;s++)e[l=a[s]]=et(e[l],t);break;case"Map":c=new pe,e.forEach((function(e,r){ge(c,et(r,t),et(e,t))}));break;case"Set":c=new ye,e.forEach((function(e){be(c,et(e,t))}));break;case"Error":e.message=et(e.message,t),v(e,"cause")&&(e.cause=et(e.cause,t)),"AggregateError"===e.name&&(e.errors=et(e.errors,t));case"DOMException":q&&(e.stack=et(e.stack,t))}return ge(t,e,c||e),c||e};s({global:!0,enumerable:!0,sham:!$,forced:ze},{structuredClone:function(e){var t,r,n=R(arguments.length,1)>1&&!p(arguments[1])?y(arguments[1]):void 0,i=n?n.transfer:void 0,s=!1;void 0!==i&&(r=function(e,t){if(!m(e))throw se("Transfer option cannot be converted to a sequence");var r=[];g(e,(function(e){_e(r,y(e))}));for(var n,i,s,a,l,c=0,u=w(r),p=[];c<u;)if(n=r[c++],"ArrayBuffer"!==(i=b(n))){if(me(t,n))throw new he("Duplicate transferable",Re);if($)a=He(n,{transfer:[n]});else switch(i){case"ImageBitmap":s=o.OffscreenCanvas,h(s)||qe(i,ke);try{(l=new s(n.width,n.height)).getContext("bitmaprenderer").transferFromImageBitmap(n),a=l.transferToImageBitmap()}catch(e){}break;case"AudioData":case"VideoFrame":d(n.clone)&&d(n.close)||qe(i,ke);try{a=n.clone(),n.close()}catch(e){}break;case"MediaSourceHandle":case"MessagePort":case"OffscreenCanvas":case"ReadableStream":case"TransformStream":case"WritableStream":qe(i,ke)}if(void 0===a)throw new he("This object cannot be transferred: "+i,Re);ge(t,n,a)}else _e(p,n);return p}(i,t=new pe),s=!!w(r));var a=Qe(e,t,s);return s&&(function(e,t){for(var r,n,i=0,s=w(e);i<s;){if(r=e[i++],me(t,r))throw new he("Duplicate transferable",Re);$?n=He(r,{transfer:[r]}):(d(r.transfer)||qe("ArrayBuffer",ke),n=r.transfer()),ge(t,r,n)}}(i,t=new pe),a=et(a,t)),a}})},70830:(e,t,r)=>{"use strict";r(82698),r(92496)},73009:(e,t,r)=>{"use strict";r(22867);var n=r(90915),i=r(19042),s=r(69562),o=r(43171),a=r(26471),l=r(18423),c=r(70119),u=r(60851),d=r(60114),h=r(99176),p=r(90973),m=r(76980),f=r(15036),g=r(64506),y=r(98284),b=r(64615),v=r(57228),_=r(66688),x=r(21629),w=r(34336),R=r(6731),k=r(63833),j=r(87916),z=r(60248),q=r(46147),$=r(60664),Z=r(58337),X=$("iterator"),Y="URLSearchParams",ee=Y+"Iterator",te=m.set,re=m.getterFor(Y),ne=m.getterFor(ee),ie=Object.getOwnPropertyDescriptor,se=function(e){if(!a)return i[e];var t=ie(i,e);return t&&t.value},oe=se("fetch"),ae=se("Request"),le=se("Headers"),ce=ae&&ae.prototype,ue=le&&le.prototype,de=i.RegExp,he=i.TypeError,pe=i.decodeURIComponent,me=i.encodeURIComponent,fe=o("".charAt),ge=o([].join),ye=o([].push),be=o("".replace),ve=o([].shift),_e=o([].splice),xe=o("".split),we=o("".slice),Se=/\+/g,Pe=Array(4),Te=function(e){return Pe[e-1]||(Pe[e-1]=de("((?:%[\\da-f]{2}){"+e+"})","gi"))},Re=function(e){try{return pe(e)}catch(t){return e}},ke=function(e){var t=be(e,Se," "),r=4;try{return pe(t)}catch(e){for(;r;)t=be(t,Te(r--),Re);return t}},Ie=/[!'()~]|%20/g,je={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},He=function(e){return je[e]},ze=function(e){return be(me(e),Ie,He)},Ge=p((function(e,t){te(this,{type:ee,iterator:j(re(e).entries),kind:t})}),"Iterator",(function(){var e=ne(this),t=e.kind,r=e.iterator.next(),n=r.value;return r.done||(r.value="keys"===t?n.key:"values"===t?n.value:[n.key,n.value]),r}),!0),URLSearchParamsState=function(e){this.entries=[],this.url=null,void 0!==e&&(x(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===fe(e,0)?we(e,1):e:w(e)))};URLSearchParamsState.prototype={type:Y,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,r,n,i,o,a,l,c=z(e);if(c)for(r=(t=j(e,c)).next;!(n=s(r,t)).done;){if(o=(i=j(_(n.value))).next,(a=s(o,i)).done||(l=s(o,i)).done||!s(o,i).done)throw he("Expected sequence with length 2");ye(this.entries,{key:w(a.value),value:w(l.value)})}else for(var u in e)y(e,u)&&ye(this.entries,{key:u,value:w(e[u])})},parseQuery:function(e){if(e)for(var t,r,n=xe(e,"&"),i=0;i<n.length;)(t=n[i++]).length&&(r=xe(t,"="),ye(this.entries,{key:ke(ve(r)),value:ke(ge(r,"="))}))},serialize:function(){for(var e,t=this.entries,r=[],n=0;n<t.length;)e=t[n++],ye(r,ze(e.key)+"="+ze(e.value));return ge(r,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var URLSearchParamsConstructor=function(){f(this,We);var e=te(this,new URLSearchParamsState(arguments.length>0?arguments[0]:void 0));a||(this.size=e.entries.length)},We=URLSearchParamsConstructor.prototype;if(d(We,{append:function(e,t){var r=re(this);q(arguments.length,2),ye(r.entries,{key:w(e),value:w(t)}),a||this.length++,r.updateURL()},delete:function(e){for(var t=re(this),r=q(arguments.length,1),n=t.entries,i=w(e),s=r<2?void 0:arguments[1],o=void 0===s?s:w(s),l=0;l<n.length;){var c=n[l];if(c.key!==i||void 0!==o&&c.value!==o)l++;else if(_e(n,l,1),void 0!==o)break}a||(this.size=n.length),t.updateURL()},get:function(e){var t=re(this).entries;q(arguments.length,1);for(var r=w(e),n=0;n<t.length;n++)if(t[n].key===r)return t[n].value;return null},getAll:function(e){var t=re(this).entries;q(arguments.length,1);for(var r=w(e),n=[],i=0;i<t.length;i++)t[i].key===r&&ye(n,t[i].value);return n},has:function(e){for(var t=re(this).entries,r=q(arguments.length,1),n=w(e),i=r<2?void 0:arguments[1],s=void 0===i?i:w(i),o=0;o<t.length;){var a=t[o++];if(a.key===n&&(void 0===s||a.value===s))return!0}return!1},set:function(e,t){var r=re(this);q(arguments.length,1);for(var n,i=r.entries,s=!1,o=w(e),l=w(t),c=0;c<i.length;c++)(n=i[c]).key===o&&(s?_e(i,c--,1):(s=!0,n.value=l));s||ye(i,{key:o,value:l}),a||(this.size=i.length),r.updateURL()},sort:function(){var e=re(this);Z(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,r=re(this).entries,n=b(e,arguments.length>1?arguments[1]:void 0),i=0;i<r.length;)n((t=r[i++]).value,t.key,this)},keys:function(){return new Ge(this,"keys")},values:function(){return new Ge(this,"values")},entries:function(){return new Ge(this,"entries")}},{enumerable:!0}),c(We,X,We.entries,{name:"entries"}),c(We,"toString",(function(){return re(this).serialize()}),{enumerable:!0}),a&&u(We,"size",{get:function(){return re(this).entries.length},configurable:!0,enumerable:!0}),h(URLSearchParamsConstructor,Y),n({global:!0,constructor:!0,forced:!l},{URLSearchParams:URLSearchParamsConstructor}),!l&&g(le)){var Ve=o(ue.has),qe=o(ue.set),$e=function(e){if(x(e)){var t,r=e.body;if(v(r)===Y)return t=e.headers?new le(e.headers):new le,Ve(t,"content-type")||qe(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),R(e,{body:k(0,w(r)),headers:k(0,t)})}return e};if(g(oe)&&n({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return oe(e,arguments.length>1?$e(arguments[1]):{})}}),g(ae)){var RequestConstructor=function(e){return f(this,ce),new ae(e,arguments.length>1?$e(arguments[1]):{})};ce.constructor=RequestConstructor,RequestConstructor.prototype=ce,n({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:RequestConstructor})}}e.exports={URLSearchParams:URLSearchParamsConstructor,getState:re}},51602:(e,t,r)=>{"use strict";var n=r(70119),i=r(43171),s=r(34336),o=r(46147),a=URLSearchParams,l=a.prototype,c=i(l.append),u=i(l.delete),d=i(l.forEach),h=i([].push),p=new a("a=1&a=2&b=3");p.delete("a",1),p.delete("b",void 0),p+""!="a=2"&&n(l,"delete",(function(e){var t=arguments.length,r=t<2?void 0:arguments[1];if(t&&void 0===r)return u(this,e);var n=[];d(this,(function(e,t){h(n,{key:t,value:e})})),o(t,1);for(var i,a=s(e),l=s(r),p=0,m=0,f=!1,g=n.length;p<g;)i=n[p++],f||i.key===a?(f=!0,u(this,i.key)):m++;for(;m<g;)(i=n[m++]).key===a&&i.value===l||c(this,i.key,i.value)}),{enumerable:!0,unsafe:!0})},17377:(e,t,r)=>{"use strict";var n=r(70119),i=r(43171),s=r(34336),o=r(46147),a=URLSearchParams,l=a.prototype,c=i(l.getAll),u=i(l.has),d=new a("a=1");!d.has("a",2)&&d.has("a",void 0)||n(l,"has",(function(e){var t=arguments.length,r=t<2?void 0:arguments[1];if(t&&void 0===r)return u(this,e);var n=c(this,e);o(t,1);for(var i=s(r),a=0;a<n.length;)if(n[a++]===i)return!0;return!1}),{enumerable:!0,unsafe:!0})},90379:(e,t,r)=>{"use strict";r(73009)},18212:(e,t,r)=>{"use strict";var n=r(26471),i=r(43171),s=r(60851),o=URLSearchParams.prototype,a=i(o.forEach);n&&!("size"in o)&&s(o,"size",{get:function(){var e=0;return a(this,(function(){e++})),e},configurable:!0,enumerable:!0})},42413:(e,t,r)=>{"use strict";var n=r(90915),i=r(84830),s=r(63388),o=r(46147),a=r(34336),l=r(18423),c=i("URL");n({target:"URL",stat:!0,forced:!(l&&s((function(){c.canParse()})))},{canParse:function(e){var t=o(arguments.length,1),r=a(e),n=t<2||void 0===arguments[1]?void 0:a(arguments[1]);try{return!!new c(r,n)}catch(e){return!1}}})},99837:(e,t,r)=>{"use strict";r(67073);var n,i=r(90915),s=r(26471),o=r(18423),a=r(19042),l=r(64615),c=r(43171),u=r(70119),d=r(60851),h=r(15036),p=r(98284),m=r(92850),f=r(91565),g=r(31538),y=r(67710).codeAt,b=r(68292),v=r(34336),_=r(99176),x=r(46147),w=r(73009),R=r(76980),k=R.set,j=R.getterFor("URL"),z=w.URLSearchParams,q=w.getState,$=a.URL,Z=a.TypeError,X=a.parseInt,Y=Math.floor,ee=Math.pow,te=c("".charAt),re=c(/./.exec),ne=c([].join),ie=c(1..toString),se=c([].pop),oe=c([].push),ae=c("".replace),le=c([].shift),ce=c("".split),ue=c("".slice),de=c("".toLowerCase),he=c([].unshift),pe="Invalid scheme",me="Invalid host",fe="Invalid port",ge=/[a-z]/i,ye=/[\d+-.a-z]/i,be=/\d/,ve=/^0x/i,_e=/^[0-7]+$/,xe=/^\d+$/,we=/^[\da-f]+$/i,Se=/[\0\t\n\r #%/:<>?@[\\\]^|]/,Pe=/[\0\t\n\r #/:<>?@[\\\]^|]/,Te=/^[\u0000-\u0020]+/,Re=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,ke=/[\t\n\r]/g,Ie=function(e){var t,r,n,i;if("number"==typeof e){for(t=[],r=0;r<4;r++)he(t,e%256),e=Y(e/256);return ne(t,".")}if("object"==typeof e){for(t="",n=function(e){for(var t=null,r=1,n=null,i=0,s=0;s<8;s++)0!==e[s]?(i>r&&(t=n,r=i),n=null,i=0):(null===n&&(n=s),++i);return i>r&&(t=n,r=i),t}(e),r=0;r<8;r++)i&&0===e[r]||(i&&(i=!1),n===r?(t+=r?":":"::",i=!0):(t+=ie(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},je={},He=m({},je,{" ":1,'"':1,"<":1,">":1,"`":1}),ze=m({},He,{"#":1,"?":1,"{":1,"}":1}),Ge=m({},ze,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),We=function(e,t){var r=y(e,0);return r>32&&r<127&&!p(t,e)?e:encodeURIComponent(e)},Ve={ftp:21,file:null,http:80,https:443,ws:80,wss:443},qe=function(e,t){var r;return 2===e.length&&re(ge,te(e,0))&&(":"===(r=te(e,1))||!t&&"|"===r)},$e=function(e){var t;return e.length>1&&qe(ue(e,0,2))&&(2===e.length||"/"===(t=te(e,2))||"\\"===t||"?"===t||"#"===t)},Xe=function(e){return"."===e||"%2e"===de(e)},Ye={},Qe={},et={},tt={},rt={},nt={},it={},st={},ot={},at={},lt={},ct={},ut={},dt={},ht={},pt={},mt={},ft={},gt={},yt={},bt={},URLState=function(e,t,r){var n,i,s,o=v(e);if(t){if(i=this.parse(o))throw Z(i);this.searchParams=null}else{if(void 0!==r&&(n=new URLState(r,!0)),i=this.parse(o,null,n))throw Z(i);(s=q(new z)).bindURL(this),this.searchParams=s}};URLState.prototype={type:"URL",parse:function(e,t,r){var i,s,o,a,l,c=this,u=t||Ye,d=0,h="",m=!1,y=!1,b=!1;for(e=v(e),t||(c.scheme="",c.username="",c.password="",c.host=null,c.port=null,c.path=[],c.query=null,c.fragment=null,c.cannotBeABaseURL=!1,e=ae(e,Te,""),e=ae(e,Re,"$1")),e=ae(e,ke,""),i=f(e);d<=i.length;){switch(s=i[d],u){case Ye:if(!s||!re(ge,s)){if(t)return pe;u=et;continue}h+=de(s),u=Qe;break;case Qe:if(s&&(re(ye,s)||"+"===s||"-"===s||"."===s))h+=de(s);else{if(":"!==s){if(t)return pe;h="",u=et,d=0;continue}if(t&&(c.isSpecial()!==p(Ve,h)||"file"===h&&(c.includesCredentials()||null!==c.port)||"file"===c.scheme&&!c.host))return;if(c.scheme=h,t)return void(c.isSpecial()&&Ve[c.scheme]===c.port&&(c.port=null));h="","file"===c.scheme?u=dt:c.isSpecial()&&r&&r.scheme===c.scheme?u=tt:c.isSpecial()?u=st:"/"===i[d+1]?(u=rt,d++):(c.cannotBeABaseURL=!0,oe(c.path,""),u=gt)}break;case et:if(!r||r.cannotBeABaseURL&&"#"!==s)return pe;if(r.cannotBeABaseURL&&"#"===s){c.scheme=r.scheme,c.path=g(r.path),c.query=r.query,c.fragment="",c.cannotBeABaseURL=!0,u=bt;break}u="file"===r.scheme?dt:nt;continue;case tt:if("/"!==s||"/"!==i[d+1]){u=nt;continue}u=ot,d++;break;case rt:if("/"===s){u=at;break}u=ft;continue;case nt:if(c.scheme=r.scheme,s===n)c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=g(r.path),c.query=r.query;else if("/"===s||"\\"===s&&c.isSpecial())u=it;else if("?"===s)c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=g(r.path),c.query="",u=yt;else{if("#"!==s){c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=g(r.path),c.path.length--,u=ft;continue}c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=g(r.path),c.query=r.query,c.fragment="",u=bt}break;case it:if(!c.isSpecial()||"/"!==s&&"\\"!==s){if("/"!==s){c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,u=ft;continue}u=at}else u=ot;break;case st:if(u=ot,"/"!==s||"/"!==te(h,d+1))continue;d++;break;case ot:if("/"!==s&&"\\"!==s){u=at;continue}break;case at:if("@"===s){m&&(h="%40"+h),m=!0,o=f(h);for(var _=0;_<o.length;_++){var x=o[_];if(":"!==x||b){var w=We(x,Ge);b?c.password+=w:c.username+=w}else b=!0}h=""}else if(s===n||"/"===s||"?"===s||"#"===s||"\\"===s&&c.isSpecial()){if(m&&""===h)return"Invalid authority";d-=f(h).length+1,h="",u=lt}else h+=s;break;case lt:case ct:if(t&&"file"===c.scheme){u=pt;continue}if(":"!==s||y){if(s===n||"/"===s||"?"===s||"#"===s||"\\"===s&&c.isSpecial()){if(c.isSpecial()&&""===h)return me;if(t&&""===h&&(c.includesCredentials()||null!==c.port))return;if(a=c.parseHost(h))return a;if(h="",u=mt,t)return;continue}"["===s?y=!0:"]"===s&&(y=!1),h+=s}else{if(""===h)return me;if(a=c.parseHost(h))return a;if(h="",u=ut,t===ct)return}break;case ut:if(!re(be,s)){if(s===n||"/"===s||"?"===s||"#"===s||"\\"===s&&c.isSpecial()||t){if(""!==h){var R=X(h,10);if(R>65535)return fe;c.port=c.isSpecial()&&R===Ve[c.scheme]?null:R,h=""}if(t)return;u=mt;continue}return fe}h+=s;break;case dt:if(c.scheme="file","/"===s||"\\"===s)u=ht;else{if(!r||"file"!==r.scheme){u=ft;continue}switch(s){case n:c.host=r.host,c.path=g(r.path),c.query=r.query;break;case"?":c.host=r.host,c.path=g(r.path),c.query="",u=yt;break;case"#":c.host=r.host,c.path=g(r.path),c.query=r.query,c.fragment="",u=bt;break;default:$e(ne(g(i,d),""))||(c.host=r.host,c.path=g(r.path),c.shortenPath()),u=ft;continue}}break;case ht:if("/"===s||"\\"===s){u=pt;break}r&&"file"===r.scheme&&!$e(ne(g(i,d),""))&&(qe(r.path[0],!0)?oe(c.path,r.path[0]):c.host=r.host),u=ft;continue;case pt:if(s===n||"/"===s||"\\"===s||"?"===s||"#"===s){if(!t&&qe(h))u=ft;else if(""===h){if(c.host="",t)return;u=mt}else{if(a=c.parseHost(h))return a;if("localhost"===c.host&&(c.host=""),t)return;h="",u=mt}continue}h+=s;break;case mt:if(c.isSpecial()){if(u=ft,"/"!==s&&"\\"!==s)continue}else if(t||"?"!==s)if(t||"#"!==s){if(s!==n&&(u=ft,"/"!==s))continue}else c.fragment="",u=bt;else c.query="",u=yt;break;case ft:if(s===n||"/"===s||"\\"===s&&c.isSpecial()||!t&&("?"===s||"#"===s)){if(".."===(l=de(l=h))||"%2e."===l||".%2e"===l||"%2e%2e"===l?(c.shortenPath(),"/"===s||"\\"===s&&c.isSpecial()||oe(c.path,"")):Xe(h)?"/"===s||"\\"===s&&c.isSpecial()||oe(c.path,""):("file"===c.scheme&&!c.path.length&&qe(h)&&(c.host&&(c.host=""),h=te(h,0)+":"),oe(c.path,h)),h="","file"===c.scheme&&(s===n||"?"===s||"#"===s))for(;c.path.length>1&&""===c.path[0];)le(c.path);"?"===s?(c.query="",u=yt):"#"===s&&(c.fragment="",u=bt)}else h+=We(s,ze);break;case gt:"?"===s?(c.query="",u=yt):"#"===s?(c.fragment="",u=bt):s!==n&&(c.path[0]+=We(s,je));break;case yt:t||"#"!==s?s!==n&&("'"===s&&c.isSpecial()?c.query+="%27":c.query+="#"===s?"%23":We(s,je)):(c.fragment="",u=bt);break;case bt:s!==n&&(c.fragment+=We(s,He))}d++}},parseHost:function(e){var t,r,n;if("["===te(e,0)){if("]"!==te(e,e.length-1))return me;if(t=function(e){var t,r,n,i,s,o,a,l=[0,0,0,0,0,0,0,0],c=0,u=null,d=0,h=function(){return te(e,d)};if(":"===h()){if(":"!==te(e,1))return;d+=2,u=++c}for(;h();){if(8===c)return;if(":"!==h()){for(t=r=0;r<4&&re(we,h());)t=16*t+X(h(),16),d++,r++;if("."===h()){if(0===r)return;if(d-=r,c>6)return;for(n=0;h();){if(i=null,n>0){if(!("."===h()&&n<4))return;d++}if(!re(be,h()))return;for(;re(be,h());){if(s=X(h(),10),null===i)i=s;else{if(0===i)return;i=10*i+s}if(i>255)return;d++}l[c]=256*l[c]+i,2!=++n&&4!==n||c++}if(4!==n)return;break}if(":"===h()){if(d++,!h())return}else if(h())return;l[c++]=t}else{if(null!==u)return;d++,u=++c}}if(null!==u)for(o=c-u,c=7;0!==c&&o>0;)a=l[c],l[c--]=l[u+o-1],l[u+--o]=a;else if(8!==c)return;return l}(ue(e,1,-1)),!t)return me;this.host=t}else if(this.isSpecial()){if(e=b(e),re(Se,e))return me;if(t=function(e){var t,r,n,i,s,o,a,l=ce(e,".");if(l.length&&""===l[l.length-1]&&l.length--,(t=l.length)>4)return e;for(r=[],n=0;n<t;n++){if(""===(i=l[n]))return e;if(s=10,i.length>1&&"0"===te(i,0)&&(s=re(ve,i)?16:8,i=ue(i,8===s?1:2)),""===i)o=0;else{if(!re(10===s?xe:8===s?_e:we,i))return e;o=X(i,s)}oe(r,o)}for(n=0;n<t;n++)if(o=r[n],n===t-1){if(o>=ee(256,5-t))return null}else if(o>255)return null;for(a=se(r),n=0;n<r.length;n++)a+=r[n]*ee(256,3-n);return a}(e),null===t)return me;this.host=t}else{if(re(Pe,e))return me;for(t="",r=f(e),n=0;n<r.length;n++)t+=We(r[n],je);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"===this.scheme},includesCredentials:function(){return""!==this.username||""!==this.password},isSpecial:function(){return p(Ve,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"===this.scheme&&1===t&&qe(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,r=e.username,n=e.password,i=e.host,s=e.port,o=e.path,a=e.query,l=e.fragment,c=t+":";return null!==i?(c+="//",e.includesCredentials()&&(c+=r+(n?":"+n:"")+"@"),c+=Ie(i),null!==s&&(c+=":"+s)):"file"===t&&(c+="//"),c+=e.cannotBeABaseURL?o[0]:o.length?"/"+ne(o,"/"):"",null!==a&&(c+="?"+a),null!==l&&(c+="#"+l),c},setHref:function(e){var t=this.parse(e);if(t)throw Z(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"===e)try{return new URLConstructor(e.path[0]).origin}catch(e){return"null"}return"file"!==e&&this.isSpecial()?e+"://"+Ie(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(v(e)+":",Ye)},getUsername:function(){return this.username},setUsername:function(e){var t=f(v(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=We(t[r],Ge)}},getPassword:function(){return this.password},setPassword:function(e){var t=f(v(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=We(t[r],Ge)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?Ie(e):Ie(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,lt)},getHostname:function(){var e=this.host;return null===e?"":Ie(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,ct)},getPort:function(){var e=this.port;return null===e?"":v(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""===(e=v(e))?this.port=null:this.parse(e,ut))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+ne(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,mt))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""===(e=v(e))?this.query=null:("?"===te(e,0)&&(e=ue(e,1)),this.query="",this.parse(e,yt)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!==(e=v(e))?("#"===te(e,0)&&(e=ue(e,1)),this.fragment="",this.parse(e,bt)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var URLConstructor=function(e){var t=h(this,vt),r=x(arguments.length,1)>1?arguments[1]:void 0,n=k(t,new URLState(e,!1,r));s||(t.href=n.serialize(),t.origin=n.getOrigin(),t.protocol=n.getProtocol(),t.username=n.getUsername(),t.password=n.getPassword(),t.host=n.getHost(),t.hostname=n.getHostname(),t.port=n.getPort(),t.pathname=n.getPathname(),t.search=n.getSearch(),t.searchParams=n.getSearchParams(),t.hash=n.getHash())},vt=URLConstructor.prototype,_t=function(e,t){return{get:function(){return j(this)[e]()},set:t&&function(e){return j(this)[t](e)},configurable:!0,enumerable:!0}};if(s&&(d(vt,"href",_t("serialize","setHref")),d(vt,"origin",_t("getOrigin")),d(vt,"protocol",_t("getProtocol","setProtocol")),d(vt,"username",_t("getUsername","setUsername")),d(vt,"password",_t("getPassword","setPassword")),d(vt,"host",_t("getHost","setHost")),d(vt,"hostname",_t("getHostname","setHostname")),d(vt,"port",_t("getPort","setPort")),d(vt,"pathname",_t("getPathname","setPathname")),d(vt,"search",_t("getSearch","setSearch")),d(vt,"searchParams",_t("getSearchParams")),d(vt,"hash",_t("getHash","setHash"))),u(vt,"toJSON",(function(){return j(this).serialize()}),{enumerable:!0}),u(vt,"toString",(function(){return j(this).serialize()}),{enumerable:!0}),$){var xt=$.createObjectURL,wt=$.revokeObjectURL;xt&&u(URLConstructor,"createObjectURL",l(xt,$)),wt&&u(URLConstructor,"revokeObjectURL",l(wt,$))}_(URLConstructor,"URL"),i({global:!0,constructor:!0,forced:!o,sham:!s},{URL:URLConstructor})},78975:(e,t,r)=>{"use strict";r(99837)},95663:(e,t,r)=>{"use strict";var n=r(90915),i=r(69562);n({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return i(URL.prototype.toString,this)}})},76302:(e,t,r)=>{"use strict";r(28068),r(33404),r(76397),r(57748),r(52873),r(13546),r(47083),r(45905),r(96630),r(12064),r(59036),r(49010),r(12213),r(58170),r(87069),r(52717),r(47059),r(73574),r(99555),r(73168),r(64065),r(91178),r(47030),r(84472),r(63583),r(50402),r(21303),r(3587),r(96338),r(83490),r(96437),r(65170),r(7661),r(67316),r(23047),r(10873),r(22867),r(67221),r(42280),r(91407),r(69876),r(53921),r(82451),r(81244),r(37279),r(38371),r(53129),r(90785),r(83755),r(88577),r(7711),r(99032),r(43413),r(95953),r(87630),r(39132),r(92405),r(47364),r(48634),r(53794),r(98380),r(21846),r(76562),r(54218),r(80556),r(92563),r(10552),r(27417),r(3103),r(94279),r(86299),r(13028),r(33271),r(28904),r(43881),r(71072),r(25988),r(42758),r(67405),r(50286),r(34889),r(83338),r(82283),r(63733),r(70476),r(23646),r(28781),r(79231),r(63359),r(65626),r(84379),r(40212),r(73775),r(65324),r(68422),r(9579),r(93053),r(72775),r(86068),r(7863),r(62449),r(59152),r(56034),r(18787),r(1956),r(16192),r(4889),r(63423),r(70300),r(33853),r(74520),r(76300),r(53390),r(66332),r(55737),r(81390),r(83664),r(91932),r(14739),r(38657),r(42118),r(18440),r(54285),r(26595),r(52920),r(78010),r(36405),r(62635),r(36751),r(778),r(563),r(49848),r(96178),r(73272),r(1491),r(23790),r(28961),r(18715),r(92922),r(94479),r(89138),r(28401),r(86548),r(95622),r(39702),r(34717),r(28468),r(17790),r(90673),r(35371),r(36082),r(10322),r(19033),r(88170),r(34789),r(15983),r(89282),r(89430),r(72764),r(45684),r(26303),r(53330),r(8342),r(60884),r(57903),r(4254),r(88946),r(67786),r(91814),r(67073),r(11678),r(67440),r(77154),r(3551),r(33909),r(13984),r(34779),r(23169),r(30887),r(80243),r(63627),r(18234),r(21091),r(2967),r(96019),r(43758),r(11630),r(35949),r(60461),r(88892),r(38625),r(59075),r(15263),r(19670),r(85651),r(42216),r(37329),r(43113),r(3575),r(76835),r(74172),r(27321),r(15954),r(90548),r(45384),r(47003),r(84921),r(5551),r(97063),r(14807),r(99059),r(70807),r(63532),r(43741),r(44208),r(15666),r(55943),r(17841),r(89142),r(58179),r(61824),r(81940),r(48106),r(26509),r(85058),r(959),r(78188),r(66251),r(30998),r(79960),r(19018),r(80746),r(37090),r(39137),r(786),r(77546),r(51661),r(64601),r(40986),r(40976),r(75611),r(32053),r(42500),r(45634),r(3069),r(39968),r(88068),r(36316),r(95132),r(85279),r(55609),r(45186),r(48451),r(70830),r(78975),r(42413),r(95663),r(90379),r(51602),r(17377),r(18212),r(18814)},13944:function(e,t,r){var n;!function(i){"use strict";var s,o,a,l=9e15,c=1e9,u="0123456789abcdef",d="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",h="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",p={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-l,maxE:l,crypto:!1},m=!0,f="[DecimalError] ",g=f+"Invalid argument: ",y=f+"Precision limit exceeded",b=f+"crypto unavailable",v="[object Decimal]",_=Math.floor,x=Math.pow,w=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,R=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,k=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,j=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,z=1e7,q=7,$=d.length-1,Z=h.length-1,X={toStringTag:v};function Y(e){var t,r,n,i=e.length-1,s="",o=e[0];if(i>0){for(s+=o,t=1;t<i;t++)n=e[t]+"",(r=q-n.length)&&(s+=ue(r)),s+=n;o=e[t],(r=q-(n=o+"").length)&&(s+=ue(r))}else if(0===o)return"0";for(;o%10==0;)o/=10;return s+o}function ee(e,t,r){if(e!==~~e||e<t||e>r)throw Error(g+e)}function te(e,t,r,n){var i,s,o,a;for(s=e[0];s>=10;s/=10)--t;return--t<0?(t+=q,i=0):(i=Math.ceil((t+1)/q),t%=q),s=x(10,q-t),a=e[i]%s|0,null==n?t<3?(0==t?a=a/100|0:1==t&&(a=a/10|0),o=r<4&&99999==a||r>3&&49999==a||5e4==a||0==a):o=(r<4&&a+1==s||r>3&&a+1==s/2)&&(e[i+1]/s/100|0)==x(10,t-2)-1||(a==s/2||0==a)&&0==(e[i+1]/s/100|0):t<4?(0==t?a=a/1e3|0:1==t?a=a/100|0:2==t&&(a=a/10|0),o=(n||r<4)&&9999==a||!n&&r>3&&4999==a):o=((n||r<4)&&a+1==s||!n&&r>3&&a+1==s/2)&&(e[i+1]/s/1e3|0)==x(10,t-3)-1,o}function re(e,t,r){for(var n,i,s=[0],o=0,a=e.length;o<a;){for(i=s.length;i--;)s[i]*=t;for(s[0]+=u.indexOf(e.charAt(o++)),n=0;n<s.length;n++)s[n]>r-1&&(void 0===s[n+1]&&(s[n+1]=0),s[n+1]+=s[n]/r|0,s[n]%=r)}return s.reverse()}X.absoluteValue=X.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),ie(e)},X.ceil=function(){return ie(new this.constructor(this),this.e+1,2)},X.clampedTo=X.clamp=function(e,t){var r=this,n=r.constructor;if(e=new n(e),t=new n(t),!e.s||!t.s)return new n(NaN);if(e.gt(t))throw Error(g+t);return r.cmp(e)<0?e:r.cmp(t)>0?t:new n(r)},X.comparedTo=X.cmp=function(e){var t,r,n,i,s=this,o=s.d,a=(e=new s.constructor(e)).d,l=s.s,c=e.s;if(!o||!a)return l&&c?l!==c?l:o===a?0:!o^l<0?1:-1:NaN;if(!o[0]||!a[0])return o[0]?l:a[0]?-c:0;if(l!==c)return l;if(s.e!==e.e)return s.e>e.e^l<0?1:-1;for(t=0,r=(n=o.length)<(i=a.length)?n:i;t<r;++t)if(o[t]!==a[t])return o[t]>a[t]^l<0?1:-1;return n===i?0:n>i^l<0?1:-1},X.cosine=X.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+q,n.rounding=1,r=function(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?i=(1/ve(4,r=Math.ceil(n/3))).toString():(r=16,i="2.3283064365386962890625e-10");e.precision+=r,t=be(e,1,t.times(i),new e(1));for(var s=r;s--;){var o=t.times(t);t=o.times(o).minus(o).times(8).plus(1)}return e.precision-=r,t}(n,_e(n,r)),n.precision=e,n.rounding=t,ie(2==a||3==a?r.neg():r,e,t,!0)):new n(1):new n(NaN)},X.cubeRoot=X.cbrt=function(){var e,t,r,n,i,s,o,a,l,c,u=this,d=u.constructor;if(!u.isFinite()||u.isZero())return new d(u);for(m=!1,(s=u.s*x(u.s*u,1/3))&&Math.abs(s)!=1/0?n=new d(s.toString()):(r=Y(u.d),(s=((e=u.e)-r.length+1)%3)&&(r+=1==s||-2==s?"0":"00"),s=x(r,1/3),e=_((e+1)/3)-(e%3==(e<0?-1:2)),(n=new d(r=s==1/0?"5e"+e:(r=s.toExponential()).slice(0,r.indexOf("e")+1)+e)).s=u.s),o=(e=d.precision)+3;;)if(c=(l=(a=n).times(a).times(a)).plus(u),n=ne(c.plus(u).times(a),c.plus(l),o+2,1),Y(a.d).slice(0,o)===(r=Y(n.d)).slice(0,o)){if("9999"!=(r=r.slice(o-3,o+1))&&(i||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(ie(n,e+1,1),t=!n.times(n).times(n).eq(u));break}if(!i&&(ie(a,e+1,0),a.times(a).times(a).eq(u))){n=a;break}o+=4,i=1}return m=!0,ie(n,e,d.rounding,t)},X.decimalPlaces=X.dp=function(){var e,t=this.d,r=NaN;if(t){if(r=((e=t.length-1)-_(this.e/q))*q,e=t[e])for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r},X.dividedBy=X.div=function(e){return ne(this,new this.constructor(e))},X.dividedToIntegerBy=X.divToInt=function(e){var t=this.constructor;return ie(ne(this,new t(e),0,1,1),t.precision,t.rounding)},X.equals=X.eq=function(e){return 0===this.cmp(e)},X.floor=function(){return ie(new this.constructor(this),this.e+1,3)},X.greaterThan=X.gt=function(e){return this.cmp(e)>0},X.greaterThanOrEqualTo=X.gte=function(e){var t=this.cmp(e);return 1==t||0===t},X.hyperbolicCosine=X.cosh=function(){var e,t,r,n,i,s=this,o=s.constructor,a=new o(1);if(!s.isFinite())return new o(s.s?1/0:NaN);if(s.isZero())return a;r=o.precision,n=o.rounding,o.precision=r+Math.max(s.e,s.sd())+4,o.rounding=1,(i=s.d.length)<32?t=(1/ve(4,e=Math.ceil(i/3))).toString():(e=16,t="2.3283064365386962890625e-10"),s=be(o,1,s.times(t),new o(1),!0);for(var l,c=e,u=new o(8);c--;)l=s.times(s),s=a.minus(l.times(u.minus(l.times(u))));return ie(s,o.precision=r,o.rounding=n,!0)},X.hyperbolicSine=X.sinh=function(){var e,t,r,n,i=this,s=i.constructor;if(!i.isFinite()||i.isZero())return new s(i);if(t=s.precision,r=s.rounding,s.precision=t+Math.max(i.e,i.sd())+4,s.rounding=1,(n=i.d.length)<3)i=be(s,2,i,i,!0);else{e=(e=1.4*Math.sqrt(n))>16?16:0|e,i=be(s,2,i=i.times(1/ve(5,e)),i,!0);for(var o,a=new s(5),l=new s(16),c=new s(20);e--;)o=i.times(i),i=i.times(a.plus(o.times(l.times(o).plus(c))))}return s.precision=t,s.rounding=r,ie(i,t,r,!0)},X.hyperbolicTangent=X.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,ne(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)},X.inverseCosine=X.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),i=r.precision,s=r.rounding;return-1!==n?0===n?t.isNeg()?le(r,i,s):new r(0):new r(NaN):t.isZero()?le(r,i+4,s).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=le(r,i+4,s).times(.5),r.precision=i,r.rounding=s,e.minus(t))},X.inverseHyperbolicCosine=X.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,m=!1,r=r.times(r).minus(1).sqrt().plus(r),m=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)},X.inverseHyperbolicSine=X.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,m=!1,r=r.times(r).plus(1).sqrt().plus(r),m=!0,n.precision=e,n.rounding=t,r.ln())},X.inverseHyperbolicTangent=X.atanh=function(){var e,t,r,n,i=this,s=i.constructor;return i.isFinite()?i.e>=0?new s(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=s.precision,t=s.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?ie(new s(i),e,t,!0):(s.precision=r=n-i.e,i=ne(i.plus(1),new s(1).minus(i),r+e,1),s.precision=e+4,s.rounding=1,i=i.ln(),s.precision=e,s.rounding=t,i.times(.5))):new s(NaN)},X.inverseSine=X.asin=function(){var e,t,r,n,i=this,s=i.constructor;return i.isZero()?new s(i):(t=i.abs().cmp(1),r=s.precision,n=s.rounding,-1!==t?0===t?((e=le(s,r+4,n).times(.5)).s=i.s,e):new s(NaN):(s.precision=r+6,s.rounding=1,i=i.div(new s(1).minus(i.times(i)).sqrt().plus(1)).atan(),s.precision=r,s.rounding=n,i.times(2)))},X.inverseTangent=X.atan=function(){var e,t,r,n,i,s,o,a,l,c=this,u=c.constructor,d=u.precision,h=u.rounding;if(c.isFinite()){if(c.isZero())return new u(c);if(c.abs().eq(1)&&d+4<=Z)return(o=le(u,d+4,h).times(.25)).s=c.s,o}else{if(!c.s)return new u(NaN);if(d+4<=Z)return(o=le(u,d+4,h).times(.5)).s=c.s,o}for(u.precision=a=d+10,u.rounding=1,e=r=Math.min(28,a/q+2|0);e;--e)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(m=!1,t=Math.ceil(a/q),n=1,l=c.times(c),o=new u(c),i=c;-1!==e;)if(i=i.times(l),s=o.minus(i.div(n+=2)),i=i.times(l),void 0!==(o=s.plus(i.div(n+=2))).d[t])for(e=t;o.d[e]===s.d[e]&&e--;);return r&&(o=o.times(2<<r-1)),m=!0,ie(o,u.precision=d,u.rounding=h,!0)},X.isFinite=function(){return!!this.d},X.isInteger=X.isInt=function(){return!!this.d&&_(this.e/q)>this.d.length-2},X.isNaN=function(){return!this.s},X.isNegative=X.isNeg=function(){return this.s<0},X.isPositive=X.isPos=function(){return this.s>0},X.isZero=function(){return!!this.d&&0===this.d[0]},X.lessThan=X.lt=function(e){return this.cmp(e)<0},X.lessThanOrEqualTo=X.lte=function(e){return this.cmp(e)<1},X.logarithm=X.log=function(e){var t,r,n,i,s,o,a,l,c=this,u=c.constructor,d=u.precision,h=u.rounding;if(null==e)e=new u(10),t=!0;else{if(r=(e=new u(e)).d,e.s<0||!r||!r[0]||e.eq(1))return new u(NaN);t=e.eq(10)}if(r=c.d,c.s<0||!r||!r[0]||c.eq(1))return new u(r&&!r[0]?-1/0:1!=c.s?NaN:r?0:1/0);if(t)if(r.length>1)s=!0;else{for(i=r[0];i%10==0;)i/=10;s=1!==i}if(m=!1,o=fe(c,a=d+5),n=t?ae(u,a+10):fe(e,a),te((l=ne(o,n,a,1)).d,i=d,h))do{if(o=fe(c,a+=10),n=t?ae(u,a+10):fe(e,a),l=ne(o,n,a,1),!s){+Y(l.d).slice(i+1,i+15)+1==1e14&&(l=ie(l,d+1,0));break}}while(te(l.d,i+=10,h));return m=!0,ie(l,d,h)},X.minus=X.sub=function(e){var t,r,n,i,s,o,a,l,c,u,d,h,p=this,f=p.constructor;if(e=new f(e),!p.d||!e.d)return p.s&&e.s?p.d?e.s=-e.s:e=new f(e.d||p.s!==e.s?p:NaN):e=new f(NaN),e;if(p.s!=e.s)return e.s=-e.s,p.plus(e);if(c=p.d,h=e.d,a=f.precision,l=f.rounding,!c[0]||!h[0]){if(h[0])e.s=-e.s;else{if(!c[0])return new f(3===l?-0:0);e=new f(p)}return m?ie(e,a,l):e}if(r=_(e.e/q),u=_(p.e/q),c=c.slice(),s=u-r){for((d=s<0)?(t=c,s=-s,o=h.length):(t=h,r=u,o=c.length),s>(n=Math.max(Math.ceil(a/q),o)+2)&&(s=n,t.length=1),t.reverse(),n=s;n--;)t.push(0);t.reverse()}else{for((d=(n=c.length)<(o=h.length))&&(o=n),n=0;n<o;n++)if(c[n]!=h[n]){d=c[n]<h[n];break}s=0}for(d&&(t=c,c=h,h=t,e.s=-e.s),o=c.length,n=h.length-o;n>0;--n)c[o++]=0;for(n=h.length;n>s;){if(c[--n]<h[n]){for(i=n;i&&0===c[--i];)c[i]=z-1;--c[i],c[n]+=z}c[n]-=h[n]}for(;0===c[--o];)c.pop();for(;0===c[0];c.shift())--r;return c[0]?(e.d=c,e.e=oe(c,r),m?ie(e,a,l):e):new f(3===l?-0:0)},X.modulo=X.mod=function(e){var t,r=this,n=r.constructor;return e=new n(e),!r.d||!e.s||e.d&&!e.d[0]?new n(NaN):!e.d||r.d&&!r.d[0]?ie(new n(r),n.precision,n.rounding):(m=!1,9==n.modulo?(t=ne(r,e.abs(),0,3,1)).s*=e.s:t=ne(r,e,0,n.modulo,1),t=t.times(e),m=!0,r.minus(t))},X.naturalExponential=X.exp=function(){return me(this)},X.naturalLogarithm=X.ln=function(){return fe(this)},X.negated=X.neg=function(){var e=new this.constructor(this);return e.s=-e.s,ie(e)},X.plus=X.add=function(e){var t,r,n,i,s,o,a,l,c,u,d=this,h=d.constructor;if(e=new h(e),!d.d||!e.d)return d.s&&e.s?d.d||(e=new h(e.d||d.s===e.s?d:NaN)):e=new h(NaN),e;if(d.s!=e.s)return e.s=-e.s,d.minus(e);if(c=d.d,u=e.d,a=h.precision,l=h.rounding,!c[0]||!u[0])return u[0]||(e=new h(d)),m?ie(e,a,l):e;if(s=_(d.e/q),n=_(e.e/q),c=c.slice(),i=s-n){for(i<0?(r=c,i=-i,o=u.length):(r=u,n=s,o=c.length),i>(o=(s=Math.ceil(a/q))>o?s+1:o+1)&&(i=o,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for((o=c.length)-(i=u.length)<0&&(i=o,r=u,u=c,c=r),t=0;i;)t=(c[--i]=c[i]+u[i]+t)/z|0,c[i]%=z;for(t&&(c.unshift(t),++n),o=c.length;0==c[--o];)c.pop();return e.d=c,e.e=oe(c,n),m?ie(e,a,l):e},X.precision=X.sd=function(e){var t,r=this;if(void 0!==e&&e!==!!e&&1!==e&&0!==e)throw Error(g+e);return r.d?(t=ce(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t},X.round=function(){var e=this,t=e.constructor;return ie(new t(e),e.e+1,t.rounding)},X.sine=X.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+q,n.rounding=1,r=function(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:be(e,2,t,t);r=(r=1.4*Math.sqrt(n))>16?16:0|r,t=t.times(1/ve(5,r)),t=be(e,2,t,t);for(var i,s=new e(5),o=new e(16),a=new e(20);r--;)i=t.times(t),t=t.times(s.plus(i.times(o.times(i).minus(a))));return t}(n,_e(n,r)),n.precision=e,n.rounding=t,ie(a>2?r.neg():r,e,t,!0)):new n(NaN)},X.squareRoot=X.sqrt=function(){var e,t,r,n,i,s,o=this,a=o.d,l=o.e,c=o.s,u=o.constructor;if(1!==c||!a||!a[0])return new u(!c||c<0&&(!a||a[0])?NaN:a?o:1/0);for(m=!1,0==(c=Math.sqrt(+o))||c==1/0?(((t=Y(a)).length+l)%2==0&&(t+="0"),c=Math.sqrt(t),l=_((l+1)/2)-(l<0||l%2),n=new u(t=c==1/0?"5e"+l:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+l)):n=new u(c.toString()),r=(l=u.precision)+3;;)if(n=(s=n).plus(ne(o,s,r+2,1)).times(.5),Y(s.d).slice(0,r)===(t=Y(n.d)).slice(0,r)){if("9999"!=(t=t.slice(r-3,r+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(ie(n,l+1,1),e=!n.times(n).eq(o));break}if(!i&&(ie(s,l+1,0),s.times(s).eq(o))){n=s;break}r+=4,i=1}return m=!0,ie(n,l,u.rounding,e)},X.tangent=X.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,(r=r.sin()).s=1,r=ne(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,ie(2==a||4==a?r.neg():r,e,t,!0)):new n(NaN)},X.times=X.mul=function(e){var t,r,n,i,s,o,a,l,c,u=this,d=u.constructor,h=u.d,p=(e=new d(e)).d;if(e.s*=u.s,!(h&&h[0]&&p&&p[0]))return new d(!e.s||h&&!h[0]&&!p||p&&!p[0]&&!h?NaN:h&&p?0*e.s:e.s/0);for(r=_(u.e/q)+_(e.e/q),(l=h.length)<(c=p.length)&&(s=h,h=p,p=s,o=l,l=c,c=o),s=[],n=o=l+c;n--;)s.push(0);for(n=c;--n>=0;){for(t=0,i=l+n;i>n;)a=s[i]+p[n]*h[i-n-1]+t,s[i--]=a%z|0,t=a/z|0;s[i]=(s[i]+t)%z|0}for(;!s[--o];)s.pop();return t?++r:s.shift(),e.d=s,e.e=oe(s,r),m?ie(e,d.precision,d.rounding):e},X.toBinary=function(e,t){return xe(this,2,e,t)},X.toDecimalPlaces=X.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),void 0===e?r:(ee(e,0,c),void 0===t?t=n.rounding:ee(t,0,8),ie(r,e+r.e+1,t))},X.toExponential=function(e,t){var r,n=this,i=n.constructor;return void 0===e?r=se(n,!0):(ee(e,0,c),void 0===t?t=i.rounding:ee(t,0,8),r=se(n=ie(new i(n),e+1,t),!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r},X.toFixed=function(e,t){var r,n,i=this,s=i.constructor;return void 0===e?r=se(i):(ee(e,0,c),void 0===t?t=s.rounding:ee(t,0,8),r=se(n=ie(new s(i),e+i.e+1,t),!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r},X.toFraction=function(e){var t,r,n,i,s,o,a,l,c,u,d,h,p=this,f=p.d,y=p.constructor;if(!f)return new y(p);if(c=r=new y(1),n=l=new y(0),o=(s=(t=new y(n)).e=ce(f)-p.e-1)%q,t.d[0]=x(10,o<0?q+o:o),null==e)e=s>0?t:c;else{if(!(a=new y(e)).isInt()||a.lt(c))throw Error(g+a);e=a.gt(t)?s>0?t:c:a}for(m=!1,a=new y(Y(f)),u=y.precision,y.precision=s=f.length*q*2;d=ne(a,t,0,1,1),1!=(i=r.plus(d.times(n))).cmp(e);)r=n,n=i,i=c,c=l.plus(d.times(i)),l=i,i=t,t=a.minus(d.times(i)),a=i;return i=ne(e.minus(r),n,0,1,1),l=l.plus(i.times(c)),r=r.plus(i.times(n)),l.s=c.s=p.s,h=ne(c,n,s,1).minus(p).abs().cmp(ne(l,r,s,1).minus(p).abs())<1?[c,n]:[l,r],y.precision=u,m=!0,h},X.toHexadecimal=X.toHex=function(e,t){return xe(this,16,e,t)},X.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),null==e){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),void 0===t?t=n.rounding:ee(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(m=!1,r=ne(r,e,0,t,1).times(e),m=!0,ie(r)):(e.s=r.s,r=e),r},X.toNumber=function(){return+this},X.toOctal=function(e,t){return xe(this,8,e,t)},X.toPower=X.pow=function(e){var t,r,n,i,s,o,a=this,l=a.constructor,c=+(e=new l(e));if(!(a.d&&e.d&&a.d[0]&&e.d[0]))return new l(x(+a,c));if((a=new l(a)).eq(1))return a;if(n=l.precision,s=l.rounding,e.eq(1))return ie(a,n,s);if((t=_(e.e/q))>=e.d.length-1&&(r=c<0?-c:c)<=9007199254740991)return i=de(l,a,r,n),e.s<0?new l(1).div(i):ie(i,n,s);if((o=a.s)<0){if(t<e.d.length-1)return new l(NaN);if(0==(1&e.d[t])&&(o=1),0==a.e&&1==a.d[0]&&1==a.d.length)return a.s=o,a}return(t=0!=(r=x(+a,c))&&isFinite(r)?new l(r+"").e:_(c*(Math.log("0."+Y(a.d))/Math.LN10+a.e+1)))>l.maxE+1||t<l.minE-1?new l(t>0?o/0:0):(m=!1,l.rounding=a.s=1,r=Math.min(12,(t+"").length),(i=me(e.times(fe(a,n+r)),n)).d&&te((i=ie(i,n+5,1)).d,n,s)&&(t=n+10,+Y((i=ie(me(e.times(fe(a,t+r)),t),t+5,1)).d).slice(n+1,n+15)+1==1e14&&(i=ie(i,n+1,0))),i.s=o,m=!0,l.rounding=s,ie(i,n,s))},X.toPrecision=function(e,t){var r,n=this,i=n.constructor;return void 0===e?r=se(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(ee(e,1,c),void 0===t?t=i.rounding:ee(t,0,8),r=se(n=ie(new i(n),e,t),e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r},X.toSignificantDigits=X.toSD=function(e,t){var r=this.constructor;return void 0===e?(e=r.precision,t=r.rounding):(ee(e,1,c),void 0===t?t=r.rounding:ee(t,0,8)),ie(new r(this),e,t)},X.toString=function(){var e=this,t=e.constructor,r=se(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r},X.truncated=X.trunc=function(){return ie(new this.constructor(this),this.e+1,1)},X.valueOf=X.toJSON=function(){var e=this,t=e.constructor,r=se(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};var ne=function(){function e(e,t,r){var n,i=0,s=e.length;for(e=e.slice();s--;)n=e[s]*t+i,e[s]=n%r|0,i=n/r|0;return i&&e.unshift(i),e}function t(e,t,r,n){var i,s;if(r!=n)s=r>n?1:-1;else for(i=s=0;i<r;i++)if(e[i]!=t[i]){s=e[i]>t[i]?1:-1;break}return s}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;)e.shift()}return function(n,i,s,a,l,c){var u,d,h,p,m,f,g,y,b,v,x,w,R,k,j,$,Z,X,Y,ee,te=n.constructor,re=n.s==i.s?1:-1,ne=n.d,se=i.d;if(!(ne&&ne[0]&&se&&se[0]))return new te(n.s&&i.s&&(ne?!se||ne[0]!=se[0]:se)?ne&&0==ne[0]||!se?0*re:re/0:NaN);for(c?(m=1,d=n.e-i.e):(c=z,m=q,d=_(n.e/m)-_(i.e/m)),Y=se.length,Z=ne.length,v=(b=new te(re)).d=[],h=0;se[h]==(ne[h]||0);h++);if(se[h]>(ne[h]||0)&&d--,null==s?(k=s=te.precision,a=te.rounding):k=l?s+(n.e-i.e)+1:s,k<0)v.push(1),f=!0;else{if(k=k/m+2|0,h=0,1==Y){for(p=0,se=se[0],k++;(h<Z||p)&&k--;h++)j=p*c+(ne[h]||0),v[h]=j/se|0,p=j%se|0;f=p||h<Z}else{for((p=c/(se[0]+1)|0)>1&&(se=e(se,p,c),ne=e(ne,p,c),Y=se.length,Z=ne.length),$=Y,w=(x=ne.slice(0,Y)).length;w<Y;)x[w++]=0;(ee=se.slice()).unshift(0),X=se[0],se[1]>=c/2&&++X;do{p=0,(u=t(se,x,Y,w))<0?(R=x[0],Y!=w&&(R=R*c+(x[1]||0)),(p=R/X|0)>1?(p>=c&&(p=c-1),1==(u=t(g=e(se,p,c),x,y=g.length,w=x.length))&&(p--,r(g,Y<y?ee:se,y,c))):(0==p&&(u=p=1),g=se.slice()),(y=g.length)<w&&g.unshift(0),r(x,g,w,c),-1==u&&(u=t(se,x,Y,w=x.length))<1&&(p++,r(x,Y<w?ee:se,w,c)),w=x.length):0===u&&(p++,x=[0]),v[h++]=p,u&&x[0]?x[w++]=ne[$]||0:(x=[ne[$]],w=1)}while(($++<Z||void 0!==x[0])&&k--);f=void 0!==x[0]}v[0]||v.shift()}if(1==m)b.e=d,o=f;else{for(h=1,p=v[0];p>=10;p/=10)h++;b.e=h+d*m-1,ie(b,l?s+b.e+1:s,a,f)}return b}}();function ie(e,t,r,n){var i,s,o,a,l,c,u,d,h,p=e.constructor;e:if(null!=t){if(!(d=e.d))return e;for(i=1,a=d[0];a>=10;a/=10)i++;if((s=t-i)<0)s+=q,o=t,l=(u=d[h=0])/x(10,i-o-1)%10|0;else if((h=Math.ceil((s+1)/q))>=(a=d.length)){if(!n)break e;for(;a++<=h;)d.push(0);u=l=0,i=1,o=(s%=q)-q+1}else{for(u=a=d[h],i=1;a>=10;a/=10)i++;l=(o=(s%=q)-q+i)<0?0:u/x(10,i-o-1)%10|0}if(n=n||t<0||void 0!==d[h+1]||(o<0?u:u%x(10,i-o-1)),c=r<4?(l||n)&&(0==r||r==(e.s<0?3:2)):l>5||5==l&&(4==r||n||6==r&&(s>0?o>0?u/x(10,i-o):0:d[h-1])%10&1||r==(e.s<0?8:7)),t<1||!d[0])return d.length=0,c?(t-=e.e+1,d[0]=x(10,(q-t%q)%q),e.e=-t||0):d[0]=e.e=0,e;if(0==s?(d.length=h,a=1,h--):(d.length=h+1,a=x(10,q-s),d[h]=o>0?(u/x(10,i-o)%x(10,o)|0)*a:0),c)for(;;){if(0==h){for(s=1,o=d[0];o>=10;o/=10)s++;for(o=d[0]+=a,a=1;o>=10;o/=10)a++;s!=a&&(e.e++,d[0]==z&&(d[0]=1));break}if(d[h]+=a,d[h]!=z)break;d[h--]=0,a=1}for(s=d.length;0===d[--s];)d.pop()}return m&&(e.e>p.maxE?(e.d=null,e.e=NaN):e.e<p.minE&&(e.e=0,e.d=[0])),e}function se(e,t,r){if(!e.isFinite())return ge(e);var n,i=e.e,s=Y(e.d),o=s.length;return t?(r&&(n=r-o)>0?s=s.charAt(0)+"."+s.slice(1)+ue(n):o>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(e.e<0?"e":"e+")+e.e):i<0?(s="0."+ue(-i-1)+s,r&&(n=r-o)>0&&(s+=ue(n))):i>=o?(s+=ue(i+1-o),r&&(n=r-i-1)>0&&(s=s+"."+ue(n))):((n=i+1)<o&&(s=s.slice(0,n)+"."+s.slice(n)),r&&(n=r-o)>0&&(i+1===o&&(s+="."),s+=ue(n))),s}function oe(e,t){var r=e[0];for(t*=q;r>=10;r/=10)t++;return t}function ae(e,t,r){if(t>$)throw m=!0,r&&(e.precision=r),Error(y);return ie(new e(d),t,1,!0)}function le(e,t,r){if(t>Z)throw Error(y);return ie(new e(h),t,r,!0)}function ce(e){var t=e.length-1,r=t*q+1;if(t=e[t]){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function ue(e){for(var t="";e--;)t+="0";return t}function de(e,t,r,n){var i,s=new e(1),o=Math.ceil(n/q+4);for(m=!1;;){if(r%2&&we((s=s.times(t)).d,o)&&(i=!0),0===(r=_(r/2))){r=s.d.length-1,i&&0===s.d[r]&&++s.d[r];break}we((t=t.times(t)).d,o)}return m=!0,s}function he(e){return 1&e.d[e.d.length-1]}function pe(e,t,r){for(var n,i=new e(t[0]),s=0;++s<t.length;){if(!(n=new e(t[s])).s){i=n;break}i[r](n)&&(i=n)}return i}function me(e,t){var r,n,i,s,o,a,l,c=0,u=0,d=0,h=e.constructor,p=h.rounding,f=h.precision;if(!e.d||!e.d[0]||e.e>17)return new h(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(null==t?(m=!1,l=f):l=t,a=new h(.03125);e.e>-2;)e=e.times(a),d+=5;for(l+=n=Math.log(x(2,d))/Math.LN10*2+5|0,r=s=o=new h(1),h.precision=l;;){if(s=ie(s.times(e),l,1),r=r.times(++u),Y((a=o.plus(ne(s,r,l,1))).d).slice(0,l)===Y(o.d).slice(0,l)){for(i=d;i--;)o=ie(o.times(o),l,1);if(null!=t)return h.precision=f,o;if(!(c<3&&te(o.d,l-n,p,c)))return ie(o,h.precision=f,p,m=!0);h.precision=l+=10,r=s=a=new h(1),u=0,c++}o=a}}function fe(e,t){var r,n,i,s,o,a,l,c,u,d,h,p=1,f=e,g=f.d,y=f.constructor,b=y.rounding,v=y.precision;if(f.s<0||!g||!g[0]||!f.e&&1==g[0]&&1==g.length)return new y(g&&!g[0]?-1/0:1!=f.s?NaN:g?0:f);if(null==t?(m=!1,u=v):u=t,y.precision=u+=10,n=(r=Y(g)).charAt(0),!(Math.abs(s=f.e)<15e14))return c=ae(y,u+2,v).times(s+""),f=fe(new y(n+"."+r.slice(1)),u-10).plus(c),y.precision=v,null==t?ie(f,v,b,m=!0):f;for(;n<7&&1!=n||1==n&&r.charAt(1)>3;)n=(r=Y((f=f.times(e)).d)).charAt(0),p++;for(s=f.e,n>1?(f=new y("0."+r),s++):f=new y(n+"."+r.slice(1)),d=f,l=o=f=ne(f.minus(1),f.plus(1),u,1),h=ie(f.times(f),u,1),i=3;;){if(o=ie(o.times(h),u,1),Y((c=l.plus(ne(o,new y(i),u,1))).d).slice(0,u)===Y(l.d).slice(0,u)){if(l=l.times(2),0!==s&&(l=l.plus(ae(y,u+2,v).times(s+""))),l=ne(l,new y(p),u,1),null!=t)return y.precision=v,l;if(!te(l.d,u-10,b,a))return ie(l,y.precision=v,b,m=!0);y.precision=u+=10,c=o=f=ne(d.minus(1),d.plus(1),u,1),h=ie(f.times(f),u,1),i=a=1}l=c,i+=2}}function ge(e){return String(e.s*e.s/0)}function ye(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;48===t.charCodeAt(n);n++);for(i=t.length;48===t.charCodeAt(i-1);--i);if(t=t.slice(n,i)){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%q,r<0&&(n+=q),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=q;n<i;)e.d.push(+t.slice(n,n+=q));t=t.slice(n),n=q-t.length}else n-=i;for(;n--;)t+="0";e.d.push(+t),m&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function be(e,t,r,n,i){var s,o,a,l,c=e.precision,u=Math.ceil(c/q);for(m=!1,l=r.times(r),a=new e(n);;){if(o=ne(a.times(l),new e(t++*t++),c,1),a=i?n.plus(o):n.minus(o),n=ne(o.times(l),new e(t++*t++),c,1),void 0!==(o=a.plus(n)).d[u]){for(s=u;o.d[s]===a.d[s]&&s--;);if(-1==s)break}s=a,a=n,n=o,o=s}return m=!0,o.d.length=u+1,o}function ve(e,t){for(var r=e;--t;)r*=e;return r}function _e(e,t){var r,n=t.s<0,i=le(e,e.precision,1),s=i.times(.5);if((t=t.abs()).lte(s))return a=n?4:1,t;if((r=t.divToInt(i)).isZero())a=n?3:2;else{if((t=t.minus(r.times(i))).lte(s))return a=he(r)?n?2:3:n?4:1,t;a=he(r)?n?1:4:n?3:2}return t.minus(i).abs()}function xe(e,t,r,n){var i,s,a,l,d,h,p,m,f,g=e.constructor,y=void 0!==r;if(y?(ee(r,1,c),void 0===n?n=g.rounding:ee(n,0,8)):(r=g.precision,n=g.rounding),e.isFinite()){for(y?(i=2,16==t?r=4*r-3:8==t&&(r=3*r-2)):i=t,(a=(p=se(e)).indexOf("."))>=0&&(p=p.replace(".",""),(f=new g(1)).e=p.length-a,f.d=re(se(f),10,i),f.e=f.d.length),s=d=(m=re(p,10,i)).length;0==m[--d];)m.pop();if(m[0]){if(a<0?s--:((e=new g(e)).d=m,e.e=s,m=(e=ne(e,f,r,n,0,i)).d,s=e.e,h=o),a=m[r],l=i/2,h=h||void 0!==m[r+1],h=n<4?(void 0!==a||h)&&(0===n||n===(e.s<0?3:2)):a>l||a===l&&(4===n||h||6===n&&1&m[r-1]||n===(e.s<0?8:7)),m.length=r,h)for(;++m[--r]>i-1;)m[r]=0,r||(++s,m.unshift(1));for(d=m.length;!m[d-1];--d);for(a=0,p="";a<d;a++)p+=u.charAt(m[a]);if(y){if(d>1)if(16==t||8==t){for(a=16==t?4:3,--d;d%a;d++)p+="0";for(d=(m=re(p,i,t)).length;!m[d-1];--d);for(a=1,p="1.";a<d;a++)p+=u.charAt(m[a])}else p=p.charAt(0)+"."+p.slice(1);p=p+(s<0?"p":"p+")+s}else if(s<0){for(;++s;)p="0"+p;p="0."+p}else if(++s>d)for(s-=d;s--;)p+="0";else s<d&&(p=p.slice(0,s)+"."+p.slice(s))}else p=y?"0p+0":"0";p=(16==t?"0x":2==t?"0b":8==t?"0o":"")+p}else p=ge(e);return e.s<0?"-"+p:p}function we(e,t){if(e.length>t)return e.length=t,!0}function Se(e){return new this(e).abs()}function Pe(e){return new this(e).acos()}function Te(e){return new this(e).acosh()}function Re(e,t){return new this(e).plus(t)}function ke(e){return new this(e).asin()}function Ie(e){return new this(e).asinh()}function je(e){return new this(e).atan()}function He(e){return new this(e).atanh()}function ze(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,s=n+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(r=t.s<0?le(this,n,i):new this(0)).s=e.s:!e.d||t.isZero()?(r=le(this,s,1).times(.5)).s=e.s:t.s<0?(this.precision=s,this.rounding=1,r=this.atan(ne(e,t,s,1)),t=le(this,s,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(ne(e,t,s,1)):(r=le(this,s,1).times(t.s>0?.25:.75)).s=e.s:r=new this(NaN),r}function Ge(e){return new this(e).cbrt()}function We(e){return ie(e=new this(e),e.e+1,2)}function Ve(e,t,r){return new this(e).clamp(t,r)}function qe(e){if(!e||"object"!=typeof e)throw Error(f+"Object expected");var t,r,n,i=!0===e.defaults,s=["precision",1,c,"rounding",0,8,"toExpNeg",-l,0,"toExpPos",0,l,"maxE",0,l,"minE",-l,0,"modulo",0,9];for(t=0;t<s.length;t+=3)if(r=s[t],i&&(this[r]=p[r]),void 0!==(n=e[r])){if(!(_(n)===n&&n>=s[t+1]&&n<=s[t+2]))throw Error(g+r+": "+n);this[r]=n}if(r="crypto",i&&(this[r]=p[r]),void 0!==(n=e[r])){if(!0!==n&&!1!==n&&0!==n&&1!==n)throw Error(g+r+": "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(b);this[r]=!0}else this[r]=!1}return this}function $e(e){return new this(e).cos()}function Xe(e){return new this(e).cosh()}function Ye(e,t){return new this(e).div(t)}function Qe(e){return new this(e).exp()}function et(e){return ie(e=new this(e),e.e+1,3)}function tt(){var e,t,r=new this(0);for(m=!1,e=0;e<arguments.length;)if((t=new this(arguments[e++])).d)r.d&&(r=r.plus(t.times(t)));else{if(t.s)return m=!0,new this(1/0);r=t}return m=!0,r.sqrt()}function rt(e){return e instanceof s||e&&e.toStringTag===v||!1}function nt(e){return new this(e).ln()}function it(e,t){return new this(e).log(t)}function st(e){return new this(e).log(2)}function ot(e){return new this(e).log(10)}function at(){return pe(this,arguments,"lt")}function lt(){return pe(this,arguments,"gt")}function ct(e,t){return new this(e).mod(t)}function ut(e,t){return new this(e).mul(t)}function dt(e,t){return new this(e).pow(t)}function ht(e){var t,r,n,i,s=0,o=new this(1),a=[];if(void 0===e?e=this.precision:ee(e,1,c),n=Math.ceil(e/q),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(n));s<n;)(i=t[s])>=429e7?t[s]=crypto.getRandomValues(new Uint32Array(1))[0]:a[s++]=i%1e7;else{if(!crypto.randomBytes)throw Error(b);for(t=crypto.randomBytes(n*=4);s<n;)(i=t[s]+(t[s+1]<<8)+(t[s+2]<<16)+((127&t[s+3])<<24))>=214e7?crypto.randomBytes(4).copy(t,s):(a.push(i%1e7),s+=4);s=n/4}else for(;s<n;)a[s++]=1e7*Math.random()|0;for(n=a[--s],e%=q,n&&e&&(i=x(10,q-e),a[s]=(n/i|0)*i);0===a[s];s--)a.pop();if(s<0)r=0,a=[0];else{for(r=-1;0===a[0];r-=q)a.shift();for(n=1,i=a[0];i>=10;i/=10)n++;n<q&&(r-=q-n)}return o.e=r,o.d=a,o}function pt(e){return ie(e=new this(e),e.e+1,this.rounding)}function mt(e){return(e=new this(e)).d?e.d[0]?e.s:0*e.s:e.s||NaN}function ft(e){return new this(e).sin()}function gt(e){return new this(e).sinh()}function yt(e){return new this(e).sqrt()}function bt(e,t){return new this(e).sub(t)}function vt(){var e=0,t=arguments,r=new this(t[e]);for(m=!1;r.s&&++e<t.length;)r=r.plus(t[e]);return m=!0,ie(r,this.precision,this.rounding)}function _t(e){return new this(e).tan()}function xt(e){return new this(e).tanh()}function wt(e){return ie(e=new this(e),e.e+1,1)}s=function e(t){var r,n,i;function Decimal2(e){var t,r,n,i=this;if(!(i instanceof Decimal2))return new Decimal2(e);if(i.constructor=Decimal2,rt(e))return i.s=e.s,void(m?!e.d||e.e>Decimal2.maxE?(i.e=NaN,i.d=null):e.e<Decimal2.minE?(i.e=0,i.d=[0]):(i.e=e.e,i.d=e.d.slice()):(i.e=e.e,i.d=e.d?e.d.slice():e.d));if("number"===(n=typeof e)){if(0===e)return i.s=1/e<0?-1:1,i.e=0,void(i.d=[0]);if(e<0?(e=-e,i.s=-1):i.s=1,e===~~e&&e<1e7){for(t=0,r=e;r>=10;r/=10)t++;return void(m?t>Decimal2.maxE?(i.e=NaN,i.d=null):t<Decimal2.minE?(i.e=0,i.d=[0]):(i.e=t,i.d=[e]):(i.e=t,i.d=[e]))}return 0*e!=0?(e||(i.s=NaN),i.e=NaN,void(i.d=null)):ye(i,e.toString())}if("string"!==n)throw Error(g+e);return 45===(r=e.charCodeAt(0))?(e=e.slice(1),i.s=-1):(43===r&&(e=e.slice(1)),i.s=1),j.test(e)?ye(i,e):function(e,t){var r,n,i,o,a,l,c,u,d;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),j.test(t))return ye(e,t)}else if("Infinity"===t||"NaN"===t)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(R.test(t))r=16,t=t.toLowerCase();else if(w.test(t))r=2;else{if(!k.test(t))throw Error(g+t);r=8}for((o=t.search(/p/i))>0?(c=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),a=(o=t.indexOf("."))>=0,n=e.constructor,a&&(o=(l=(t=t.replace(".","")).length)-o,i=de(n,new n(r),o,2*o)),o=d=(u=re(t,r,z)).length-1;0===u[o];--o)u.pop();return o<0?new n(0*e.s):(e.e=oe(u,d),e.d=u,m=!1,a&&(e=ne(e,i,4*l)),c&&(e=e.times(Math.abs(c)<54?x(2,c):s.pow(2,c))),m=!0,e)}(i,e)}if(Decimal2.prototype=X,Decimal2.ROUND_UP=0,Decimal2.ROUND_DOWN=1,Decimal2.ROUND_CEIL=2,Decimal2.ROUND_FLOOR=3,Decimal2.ROUND_HALF_UP=4,Decimal2.ROUND_HALF_DOWN=5,Decimal2.ROUND_HALF_EVEN=6,Decimal2.ROUND_HALF_CEIL=7,Decimal2.ROUND_HALF_FLOOR=8,Decimal2.EUCLID=9,Decimal2.config=Decimal2.set=qe,Decimal2.clone=e,Decimal2.isDecimal=rt,Decimal2.abs=Se,Decimal2.acos=Pe,Decimal2.acosh=Te,Decimal2.add=Re,Decimal2.asin=ke,Decimal2.asinh=Ie,Decimal2.atan=je,Decimal2.atanh=He,Decimal2.atan2=ze,Decimal2.cbrt=Ge,Decimal2.ceil=We,Decimal2.clamp=Ve,Decimal2.cos=$e,Decimal2.cosh=Xe,Decimal2.div=Ye,Decimal2.exp=Qe,Decimal2.floor=et,Decimal2.hypot=tt,Decimal2.ln=nt,Decimal2.log=it,Decimal2.log10=ot,Decimal2.log2=st,Decimal2.max=at,Decimal2.min=lt,Decimal2.mod=ct,Decimal2.mul=ut,Decimal2.pow=dt,Decimal2.random=ht,Decimal2.round=pt,Decimal2.sign=mt,Decimal2.sin=ft,Decimal2.sinh=gt,Decimal2.sqrt=yt,Decimal2.sub=bt,Decimal2.sum=vt,Decimal2.tan=_t,Decimal2.tanh=xt,Decimal2.trunc=wt,void 0===t&&(t={}),t&&!0!==t.defaults)for(i=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],r=0;r<i.length;)t.hasOwnProperty(n=i[r++])||(t[n]=this[n]);return Decimal2.config(t),Decimal2}(p),s.prototype.constructor=s,s.default=s.Decimal=s,d=new s(d),h=new s(h),void 0===(n=function(){return s}.call(t,r,t,e))||(e.exports=n)}()},49048:(e,t,r)=>{var n=r(93267),i=r(55962),s=r(93063),o=r(21617),a=r(16852),l=r(70118),c=Date.prototype.getTime;function u(e,t,r){var p=r||{};return!!(p.strict?s(e,t):e===t)||(!e||!t||"object"!=typeof e&&"object"!=typeof t?p.strict?s(e,t):e==t:function(e,t,r){var s,p;if(typeof e!=typeof t)return!1;if(d(e)||d(t))return!1;if(e.prototype!==t.prototype)return!1;if(i(e)!==i(t))return!1;var m=o(e),f=o(t);if(m!==f)return!1;if(m||f)return e.source===t.source&&a(e)===a(t);if(l(e)&&l(t))return c.call(e)===c.call(t);var g=h(e),y=h(t);if(g!==y)return!1;if(g||y){if(e.length!==t.length)return!1;for(s=0;s<e.length;s++)if(e[s]!==t[s])return!1;return!0}if(typeof e!=typeof t)return!1;try{var b=n(e),v=n(t)}catch(e){return!1}if(b.length!==v.length)return!1;for(b.sort(),v.sort(),s=b.length-1;s>=0;s--)if(b[s]!=v[s])return!1;for(s=b.length-1;s>=0;s--)if(!u(e[p=b[s]],t[p],r))return!1;return!0}(e,t,p))}function d(e){return null==e}function h(e){return!(!e||"object"!=typeof e||"number"!=typeof e.length)&&("function"==typeof e.copy&&"function"==typeof e.slice&&!(e.length>0&&"number"!=typeof e[0]))}e.exports=u},2488:(e,t,r)=>{"use strict";var n=r(17156).functionsHaveConfigurableNames(),i=Object,s=TypeError;e.exports=function(){if(null!=this&&this!==i(this))throw new s("RegExp.prototype.flags getter called on non-object");var e="";return this.hasIndices&&(e+="d"),this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),this.dotAll&&(e+="s"),this.unicode&&(e+="u"),this.sticky&&(e+="y"),e},n&&Object.defineProperty&&Object.defineProperty(e.exports,"name",{value:"get flags"})},16852:(e,t,r)=>{"use strict";var n=r(64450),i=r(84481),s=r(2488),o=r(82045),a=r(43227),l=i(o());n(l,{getPolyfill:o,implementation:s,shim:a}),e.exports=l},82045:(e,t,r)=>{"use strict";var n=r(2488),i=r(64450).supportsDescriptors,s=Object.getOwnPropertyDescriptor;e.exports=function(){if(i&&"gim"===/a/gim.flags){var e=s(RegExp.prototype,"flags");if(e&&"function"==typeof e.get&&"boolean"==typeof RegExp.prototype.dotAll&&"boolean"==typeof RegExp.prototype.hasIndices){var t="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){t+="d"}}),Object.defineProperty(r,"sticky",{get:function(){t+="y"}}),"dy"===t)return e.get}}return n}},43227:(e,t,r)=>{"use strict";var n=r(64450).supportsDescriptors,i=r(82045),s=Object.getOwnPropertyDescriptor,o=Object.defineProperty,a=TypeError,l=Object.getPrototypeOf,c=/a/;e.exports=function(){if(!n||!l)throw new a("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var e=i(),t=l(c),r=s(t,"flags");return r&&r.get===e||o(t,"flags",{configurable:!0,enumerable:!1,get:e}),e}},88839:(e,t,r)=>{"use strict";var n=r(7905),i=r(92962),s=r(58921),o=r(81909);e.exports=function(e,t,r){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new s("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new s("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new s("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new s("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new s("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new s("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,u=arguments.length>6&&arguments[6],d=!!o&&o(e,t);if(n)n(e,t,{configurable:null===c&&d?d.configurable:!c,enumerable:null===a&&d?d.enumerable:!a,value:r,writable:null===l&&d?d.writable:!l});else{if(!u&&(a||l||c))throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=r}}},64450:(e,t,r)=>{"use strict";var n=r(93267),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),s=Object.prototype.toString,o=Array.prototype.concat,a=r(88839),l=r(16402)(),c=function(e,t,r,n){if(t in e)if(!0===n){if(e[t]===r)return}else if("function"!=typeof(i=n)||"[object Function]"!==s.call(i)||!n())return;var i;l?a(e,t,r,!0):a(e,t,r)},u=function(e,t){var r=arguments.length>2?arguments[2]:{},s=n(t);i&&(s=o.call(s,Object.getOwnPropertySymbols(t)));for(var a=0;a<s.length;a+=1)c(e,s[a],t[s[a]],r[s[a]])};u.supportsDescriptors=!!l,e.exports=u},3986:e=>{"use strict";var t={single_source_shortest_paths:function(e,r,n){var i={},s={};s[r]=0;var o,a,l,c,u,d,h,p=t.PriorityQueue.make();for(p.push(r,0);!p.empty();)for(l in a=(o=p.pop()).value,c=o.cost,u=e[a]||{})u.hasOwnProperty(l)&&(d=c+u[l],h=s[l],(void 0===s[l]||h>d)&&(s[l]=d,p.push(l,d),i[l]=a));if(void 0!==n&&void 0===s[n]){var m=["Could not find a path from ",r," to ",n,"."].join("");throw new Error(m)}return i},extract_shortest_path_from_predecessor_list:function(e,t){for(var r=[],n=t;n;)r.push(n),e[n],n=e[n];return r.reverse(),r},find_path:function(e,r,n){var i=t.single_source_shortest_paths(e,r,n);return t.extract_shortest_path_from_predecessor_list(i,n)},PriorityQueue:{make:function(e){var r,n=t.PriorityQueue,i={};for(r in e=e||{},n)n.hasOwnProperty(r)&&(i[r]=n[r]);return i.queue=[],i.sorter=e.sorter||n.default_sorter,i},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var r={value:e,cost:t};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};e.exports=t},17583:e=>{"use strict";e.exports=function(e){for(var t=[],r=e.length,n=0;n<r;n++){var i=e.charCodeAt(n);if(i>=55296&&i<=56319&&r>n+1){var s=e.charCodeAt(n+1);s>=56320&&s<=57343&&(i=1024*(i-55296)+s-56320+65536,n+=1)}i<128?t.push(i):i<2048?(t.push(i>>6|192),t.push(63&i|128)):i<55296||i>=57344&&i<65536?(t.push(i>>12|224),t.push(i>>6&63|128),t.push(63&i|128)):i>=65536&&i<=1114111?(t.push(i>>18|240),t.push(i>>12&63|128),t.push(i>>6&63|128),t.push(63&i|128)):t.push(239,191,189)}return new Uint8Array(t).buffer}},7905:(e,t,r)=>{"use strict";var n=r(77664)("%Object.defineProperty%",!0)||!1;if(n)try{n({},"a",{value:1})}catch(e){n=!1}e.exports=n},53335:e=>{"use strict";e.exports=EvalError},57669:e=>{"use strict";e.exports=Error},92912:e=>{"use strict";e.exports=RangeError},96404:e=>{"use strict";e.exports=ReferenceError},92962:e=>{"use strict";e.exports=SyntaxError},58921:e=>{"use strict";e.exports=TypeError},27471:e=>{"use strict";e.exports=URIError},69110:e=>{"use strict";var t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},r={"{":"\\{","}":"\\}","\\":"\\textbackslash{}","#":"\\#",$:"\\$","%":"\\%","&":"\\&","^":"\\textasciicircum{}",_:"\\_","~":"\\textasciitilde{}"},n={"–":"\\--","—":"\\---"," ":"~","\t":"\\qquad{}","\r\n":"\\newline{}","\n":"\\newline{}"},i=function(e,r){return t({},e,r)};e.exports=function(e){for(var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=s.preserveFormatting,a=void 0!==o&&o,l=s.escapeMapFn,c=void 0===l?i:l,u=String(e),d="",h=c(t({},r),a?t({},n):{}),p=Object.keys(h),m=function(){var e=!1;p.forEach((function(t,r){e||u.length>=t.length&&u.slice(0,t.length)===t&&(d+=h[p[r]],u=u.slice(t.length,u.length),e=!0)})),e||(d+=u.slice(0,1),u=u.slice(1,u.length))};u;)m();return d}},70380:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>ne});var n=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],i={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:"object"==typeof window&&-1===window.navigator.userAgent.indexOf("MSIE"),ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(e){return"undefined"!=typeof console&&console.warn(e)},getWeek:function(e){var t=new Date(e.getTime());t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var r=new Date(t.getFullYear(),0,4);return 1+Math.round(((t.getTime()-r.getTime())/864e5-3+(r.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},s={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var t=e%100;if(t>3&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1};const o=s;var a=function(e,t){return void 0===t&&(t=2),("000"+e).slice(-1*t)},l=function(e){return!0===e?1:0};function c(e,t){var r;return function(){var n=this,i=arguments;clearTimeout(r),r=setTimeout((function(){return e.apply(n,i)}),t)}}var u=function(e){return e instanceof Array?e:[e]};function d(e,t,r){if(!0===r)return e.classList.add(t);e.classList.remove(t)}function h(e,t,r){var n=window.document.createElement(e);return t=t||"",r=r||"",n.className=t,void 0!==r&&(n.textContent=r),n}function p(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function m(e,t){return t(e)?e:e.parentNode?m(e.parentNode,t):void 0}function f(e,t){var r=h("div","numInputWrapper"),n=h("input","numInput "+e),i=h("span","arrowUp"),s=h("span","arrowDown");if(-1===navigator.userAgent.indexOf("MSIE 9.0")?n.type="number":(n.type="text",n.pattern="\\d*"),void 0!==t)for(var o in t)n.setAttribute(o,t[o]);return r.appendChild(n),r.appendChild(i),r.appendChild(s),r}function g(e){try{return"function"==typeof e.composedPath?e.composedPath()[0]:e.target}catch(t){return e.target}}var y=function(){},b=function(e,t,r){return r.months[t?"shorthand":"longhand"][e]},v={D:y,F:function(e,t,r){e.setMonth(r.months.longhand.indexOf(t))},G:function(e,t){e.setHours((e.getHours()>=12?12:0)+parseFloat(t))},H:function(e,t){e.setHours(parseFloat(t))},J:function(e,t){e.setDate(parseFloat(t))},K:function(e,t,r){e.setHours(e.getHours()%12+12*l(new RegExp(r.amPM[1],"i").test(t)))},M:function(e,t,r){e.setMonth(r.months.shorthand.indexOf(t))},S:function(e,t){e.setSeconds(parseFloat(t))},U:function(e,t){return new Date(1e3*parseFloat(t))},W:function(e,t,r){var n=parseInt(t),i=new Date(e.getFullYear(),0,2+7*(n-1),0,0,0,0);return i.setDate(i.getDate()-i.getDay()+r.firstDayOfWeek),i},Y:function(e,t){e.setFullYear(parseFloat(t))},Z:function(e,t){return new Date(t)},d:function(e,t){e.setDate(parseFloat(t))},h:function(e,t){e.setHours((e.getHours()>=12?12:0)+parseFloat(t))},i:function(e,t){e.setMinutes(parseFloat(t))},j:function(e,t){e.setDate(parseFloat(t))},l:y,m:function(e,t){e.setMonth(parseFloat(t)-1)},n:function(e,t){e.setMonth(parseFloat(t)-1)},s:function(e,t){e.setSeconds(parseFloat(t))},u:function(e,t){return new Date(parseFloat(t))},w:y,y:function(e,t){e.setFullYear(2e3+parseFloat(t))}},_={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},x={Z:function(e){return e.toISOString()},D:function(e,t,r){return t.weekdays.shorthand[x.w(e,t,r)]},F:function(e,t,r){return b(x.n(e,t,r)-1,!1,t)},G:function(e,t,r){return a(x.h(e,t,r))},H:function(e){return a(e.getHours())},J:function(e,t){return void 0!==t.ordinal?e.getDate()+t.ordinal(e.getDate()):e.getDate()},K:function(e,t){return t.amPM[l(e.getHours()>11)]},M:function(e,t){return b(e.getMonth(),!0,t)},S:function(e){return a(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,t,r){return r.getWeek(e)},Y:function(e){return a(e.getFullYear(),4)},d:function(e){return a(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return a(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,t){return t.weekdays.longhand[e.getDay()]},m:function(e){return a(e.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},u:function(e){return e.getTime()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},w=function(e){var t=e.config,r=void 0===t?i:t,n=e.l10n,o=void 0===n?s:n,a=e.isMobile,l=void 0!==a&&a;return function(e,t,n){var i=n||o;return void 0===r.formatDate||l?t.split("").map((function(t,n,s){return x[t]&&"\\"!==s[n-1]?x[t](e,i,r):"\\"!==t?t:""})).join(""):r.formatDate(e,t,i)}},R=function(e){var t=e.config,r=void 0===t?i:t,n=e.l10n,o=void 0===n?s:n;return function(e,t,n,s){if(0===e||e){var a,l=s||o,c=e;if(e instanceof Date)a=new Date(e.getTime());else if("string"!=typeof e&&void 0!==e.toFixed)a=new Date(e);else if("string"==typeof e){var u=t||(r||i).dateFormat,d=String(e).trim();if("today"===d)a=new Date,n=!0;else if(r&&r.parseDate)a=r.parseDate(e,u);else if(/Z$/.test(d)||/GMT$/.test(d))a=new Date(e);else{for(var h=void 0,p=[],m=0,f=0,g="";m<u.length;m++){var y=u[m],b="\\"===y,x="\\"===u[m-1]||b;if(_[y]&&!x){g+=_[y];var w=new RegExp(g).exec(e);w&&(h=!0)&&p["Y"!==y?"push":"unshift"]({fn:v[y],val:w[++f]})}else b||(g+=".")}a=r&&r.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0),p.forEach((function(e){var t=e.fn,r=e.val;return a=t(a,r,l)||a})),a=h?a:void 0}}if(a instanceof Date&&!isNaN(a.getTime()))return!0===n&&a.setHours(0,0,0,0),a;r.errorHandler(new Error("Invalid date provided: "+c))}}};function k(e,t,r){return void 0===r&&(r=!0),!1!==r?new Date(e.getTime()).setHours(0,0,0,0)-new Date(t.getTime()).setHours(0,0,0,0):e.getTime()-t.getTime()}var j=function(e,t,r){return e>Math.min(t,r)&&e<Math.max(t,r)},z=function(e,t,r){return 3600*e+60*t+r},q=function(e){var t=Math.floor(e/3600),r=(e-3600*t)/60;return[t,r,e-3600*t-60*r]},$={DAY:864e5};function Z(e){var t=e.defaultHour,r=e.defaultMinute,n=e.defaultSeconds;if(void 0!==e.minDate){var i=e.minDate.getHours(),s=e.minDate.getMinutes(),o=e.minDate.getSeconds();t<i&&(t=i),t===i&&r<s&&(r=s),t===i&&r===s&&n<o&&(n=e.minDate.getSeconds())}if(void 0!==e.maxDate){var a=e.maxDate.getHours(),l=e.maxDate.getMinutes();(t=Math.min(t,a))===a&&(r=Math.min(l,r)),t===a&&r===l&&(n=e.maxDate.getSeconds())}return{hours:t,minutes:r,seconds:n}}r(50680);var X=function(){return X=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},X.apply(this,arguments)},Y=function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),i=0;for(t=0;t<r;t++)for(var s=arguments[t],o=0,a=s.length;o<a;o++,i++)n[i]=s[o];return n},ee=300;function FlatpickrInstance(e,t){var r={config:X(X({},i),re.defaultConfig),l10n:o};function s(){var e;return(null===(e=r.calendarContainer)||void 0===e?void 0:e.getRootNode()).activeElement||document.activeElement}function y(e){return e.bind(r)}function v(){var e=r.config;!1===e.weekNumbers&&1===e.showMonths||!0!==e.noCalendar&&window.requestAnimationFrame((function(){if(void 0!==r.calendarContainer&&(r.calendarContainer.style.visibility="hidden",r.calendarContainer.style.display="block"),void 0!==r.daysContainer){var t=(r.days.offsetWidth+1)*e.showMonths;r.daysContainer.style.width=t+"px",r.calendarContainer.style.width=t+(void 0!==r.weekWrapper?r.weekWrapper.offsetWidth:0)+"px",r.calendarContainer.style.removeProperty("visibility"),r.calendarContainer.style.removeProperty("display")}}))}function x(e){if(0===r.selectedDates.length){var t=void 0===r.config.minDate||k(new Date,r.config.minDate)>=0?new Date:new Date(r.config.minDate.getTime()),n=Z(r.config);t.setHours(n.hours,n.minutes,n.seconds,t.getMilliseconds()),r.selectedDates=[t],r.latestSelectedDateObj=t}void 0!==e&&"blur"!==e.type&&function(e){e.preventDefault();var t="keydown"===e.type,n=g(e),i=n;void 0!==r.amPM&&n===r.amPM&&(r.amPM.textContent=r.l10n.amPM[l(r.amPM.textContent===r.l10n.amPM[0])]);var s=parseFloat(i.getAttribute("min")),o=parseFloat(i.getAttribute("max")),c=parseFloat(i.getAttribute("step")),u=parseInt(i.value,10),d=e.delta||(t?38===e.which?1:-1:0),h=u+c*d;if(void 0!==i.value&&2===i.value.length){var p=i===r.hourElement,m=i===r.minuteElement;h<s?(h=o+h+l(!p)+(l(p)&&l(!r.amPM)),m&&ue(void 0,-1,r.hourElement)):h>o&&(h=i===r.hourElement?h-o-l(!r.amPM):s,m&&ue(void 0,1,r.hourElement)),r.amPM&&p&&(1===c?h+u===23:Math.abs(h-u)>c)&&(r.amPM.textContent=r.l10n.amPM[l(r.amPM.textContent===r.l10n.amPM[0])]),i.value=a(h)}}(e);var i=r._input.value;te(),lt(),r._input.value!==i&&r._debouncedChange()}function te(){if(void 0!==r.hourElement&&void 0!==r.minuteElement){var e,t,n=(parseInt(r.hourElement.value.slice(-2),10)||0)%24,i=(parseInt(r.minuteElement.value,10)||0)%60,s=void 0!==r.secondElement?(parseInt(r.secondElement.value,10)||0)%60:0;void 0!==r.amPM&&(e=n,t=r.amPM.textContent,n=e%12+12*l(t===r.l10n.amPM[1]));var o=void 0!==r.config.minTime||r.config.minDate&&r.minDateHasTime&&r.latestSelectedDateObj&&0===k(r.latestSelectedDateObj,r.config.minDate,!0),a=void 0!==r.config.maxTime||r.config.maxDate&&r.maxDateHasTime&&r.latestSelectedDateObj&&0===k(r.latestSelectedDateObj,r.config.maxDate,!0);if(void 0!==r.config.maxTime&&void 0!==r.config.minTime&&r.config.minTime>r.config.maxTime){var c=z(r.config.minTime.getHours(),r.config.minTime.getMinutes(),r.config.minTime.getSeconds()),u=z(r.config.maxTime.getHours(),r.config.maxTime.getMinutes(),r.config.maxTime.getSeconds()),d=z(n,i,s);if(d>u&&d<c){var h=q(c);n=h[0],i=h[1],s=h[2]}}else{if(a){var p=void 0!==r.config.maxTime?r.config.maxTime:r.config.maxDate;(n=Math.min(n,p.getHours()))===p.getHours()&&(i=Math.min(i,p.getMinutes())),i===p.getMinutes()&&(s=Math.min(s,p.getSeconds()))}if(o){var m=void 0!==r.config.minTime?r.config.minTime:r.config.minDate;(n=Math.max(n,m.getHours()))===m.getHours()&&i<m.getMinutes()&&(i=m.getMinutes()),i===m.getMinutes()&&(s=Math.max(s,m.getSeconds()))}}ie(n,i,s)}}function ne(e){var t=e||r.latestSelectedDateObj;t&&t instanceof Date&&ie(t.getHours(),t.getMinutes(),t.getSeconds())}function ie(e,t,n){void 0!==r.latestSelectedDateObj&&r.latestSelectedDateObj.setHours(e%24,t,n||0,0),r.hourElement&&r.minuteElement&&!r.isMobile&&(r.hourElement.value=a(r.config.time_24hr?e:(12+e)%12+12*l(e%12==0)),r.minuteElement.value=a(t),void 0!==r.amPM&&(r.amPM.textContent=r.l10n.amPM[l(e>=12)]),void 0!==r.secondElement&&(r.secondElement.value=a(n)))}function se(e){var t=g(e),r=parseInt(t.value)+(e.delta||0);(r/1e3>1||"Enter"===e.key&&!/[^\d]/.test(r.toString()))&&Te(r)}function oe(e,t,n,i){return t instanceof Array?t.forEach((function(t){return oe(e,t,n,i)})):e instanceof Array?e.forEach((function(e){return oe(e,t,n,i)})):(e.addEventListener(t,n,i),void r._handlers.push({remove:function(){return e.removeEventListener(t,n,i)}}))}function ae(){nt("onChange")}function le(e,t){var n=void 0!==e?r.parseDate(e):r.latestSelectedDateObj||(r.config.minDate&&r.config.minDate>r.now?r.config.minDate:r.config.maxDate&&r.config.maxDate<r.now?r.config.maxDate:r.now),i=r.currentYear,s=r.currentMonth;try{void 0!==n&&(r.currentYear=n.getFullYear(),r.currentMonth=n.getMonth())}catch(e){e.message="Invalid date supplied: "+n,r.config.errorHandler(e)}t&&r.currentYear!==i&&(nt("onYearChange"),ye()),!t||r.currentYear===i&&r.currentMonth===s||nt("onMonthChange"),r.redraw()}function ce(e){var t=g(e);~t.className.indexOf("arrow")&&ue(e,t.classList.contains("arrowUp")?1:-1)}function ue(e,t,r){var n=e&&g(e),i=r||n&&n.parentNode&&n.parentNode.firstChild,s=it("increment");s.delta=t,i&&i.dispatchEvent(s)}function de(e,t,n,i){var s=Re(t,!0),o=h("span",e,t.getDate().toString());return o.dateObj=t,o.$i=i,o.setAttribute("aria-label",r.formatDate(t,r.config.ariaDateFormat)),-1===e.indexOf("hidden")&&0===k(t,r.now)&&(r.todayDateElem=o,o.classList.add("today"),o.setAttribute("aria-current","date")),s?(o.tabIndex=-1,st(t)&&(o.classList.add("selected"),r.selectedDateElem=o,"range"===r.config.mode&&(d(o,"startRange",r.selectedDates[0]&&0===k(t,r.selectedDates[0],!0)),d(o,"endRange",r.selectedDates[1]&&0===k(t,r.selectedDates[1],!0)),"nextMonthDay"===e&&o.classList.add("inRange")))):o.classList.add("flatpickr-disabled"),"range"===r.config.mode&&function(e){return!("range"!==r.config.mode||r.selectedDates.length<2)&&(k(e,r.selectedDates[0])>=0&&k(e,r.selectedDates[1])<=0)}(t)&&!st(t)&&o.classList.add("inRange"),r.weekNumbers&&1===r.config.showMonths&&"prevMonthDay"!==e&&i%7==6&&r.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+r.config.getWeek(t)+"</span>"),nt("onDayCreate",o),o}function he(e){e.focus(),"range"===r.config.mode&&He(e)}function pe(e){for(var t=e>0?0:r.config.showMonths-1,n=e>0?r.config.showMonths:-1,i=t;i!=n;i+=e)for(var s=r.daysContainer.children[i],o=e>0?0:s.children.length-1,a=e>0?s.children.length:-1,l=o;l!=a;l+=e){var c=s.children[l];if(-1===c.className.indexOf("hidden")&&Re(c.dateObj))return c}}function me(e,t){var n=s(),i=ke(n||document.body),o=void 0!==e?e:i?n:void 0!==r.selectedDateElem&&ke(r.selectedDateElem)?r.selectedDateElem:void 0!==r.todayDateElem&&ke(r.todayDateElem)?r.todayDateElem:pe(t>0?1:-1);void 0===o?r._input.focus():i?function(e,t){for(var n=-1===e.className.indexOf("Month")?e.dateObj.getMonth():r.currentMonth,i=t>0?r.config.showMonths:-1,s=t>0?1:-1,o=n-r.currentMonth;o!=i;o+=s)for(var a=r.daysContainer.children[o],l=n-r.currentMonth===o?e.$i+t:t<0?a.children.length-1:0,c=a.children.length,u=l;u>=0&&u<c&&u!=(t>0?c:-1);u+=s){var d=a.children[u];if(-1===d.className.indexOf("hidden")&&Re(d.dateObj)&&Math.abs(e.$i-u)>=Math.abs(t))return he(d)}r.changeMonth(s),me(pe(s),0)}(o,t):he(o)}function fe(e,t){for(var n=(new Date(e,t,1).getDay()-r.l10n.firstDayOfWeek+7)%7,i=r.utils.getDaysInMonth((t-1+12)%12,e),s=r.utils.getDaysInMonth(t,e),o=window.document.createDocumentFragment(),a=r.config.showMonths>1,l=a?"prevMonthDay hidden":"prevMonthDay",c=a?"nextMonthDay hidden":"nextMonthDay",u=i+1-n,d=0;u<=i;u++,d++)o.appendChild(de("flatpickr-day "+l,new Date(e,t-1,u),0,d));for(u=1;u<=s;u++,d++)o.appendChild(de("flatpickr-day",new Date(e,t,u),0,d));for(var p=s+1;p<=42-n&&(1===r.config.showMonths||d%7!=0);p++,d++)o.appendChild(de("flatpickr-day "+c,new Date(e,t+1,p%s),0,d));var m=h("div","dayContainer");return m.appendChild(o),m}function ge(){if(void 0!==r.daysContainer){p(r.daysContainer),r.weekNumbers&&p(r.weekNumbers);for(var e=document.createDocumentFragment(),t=0;t<r.config.showMonths;t++){var n=new Date(r.currentYear,r.currentMonth,1);n.setMonth(r.currentMonth+t),e.appendChild(fe(n.getFullYear(),n.getMonth()))}r.daysContainer.appendChild(e),r.days=r.daysContainer.firstChild,"range"===r.config.mode&&1===r.selectedDates.length&&He()}}function ye(){if(!(r.config.showMonths>1||"dropdown"!==r.config.monthSelectorType)){var e;r.monthsDropdownContainer.tabIndex=-1,r.monthsDropdownContainer.innerHTML="";for(var t=0;t<12;t++)if(e=t,!(void 0!==r.config.minDate&&r.currentYear===r.config.minDate.getFullYear()&&e<r.config.minDate.getMonth()||void 0!==r.config.maxDate&&r.currentYear===r.config.maxDate.getFullYear()&&e>r.config.maxDate.getMonth())){var n=h("option","flatpickr-monthDropdown-month");n.value=new Date(r.currentYear,t).getMonth().toString(),n.textContent=b(t,r.config.shorthandCurrentMonth,r.l10n),n.tabIndex=-1,r.currentMonth===t&&(n.selected=!0),r.monthsDropdownContainer.appendChild(n)}}}function be(){var e,t=h("div","flatpickr-month"),n=window.document.createDocumentFragment();r.config.showMonths>1||"static"===r.config.monthSelectorType?e=h("span","cur-month"):(r.monthsDropdownContainer=h("select","flatpickr-monthDropdown-months"),r.monthsDropdownContainer.setAttribute("aria-label",r.l10n.monthAriaLabel),oe(r.monthsDropdownContainer,"change",(function(e){var t=g(e),n=parseInt(t.value,10);r.changeMonth(n-r.currentMonth),nt("onMonthChange")})),ye(),e=r.monthsDropdownContainer);var i=f("cur-year",{tabindex:"-1"}),s=i.getElementsByTagName("input")[0];s.setAttribute("aria-label",r.l10n.yearAriaLabel),r.config.minDate&&s.setAttribute("min",r.config.minDate.getFullYear().toString()),r.config.maxDate&&(s.setAttribute("max",r.config.maxDate.getFullYear().toString()),s.disabled=!!r.config.minDate&&r.config.minDate.getFullYear()===r.config.maxDate.getFullYear());var o=h("div","flatpickr-current-month");return o.appendChild(e),o.appendChild(i),n.appendChild(o),t.appendChild(n),{container:t,yearElement:s,monthElement:e}}function ve(){p(r.monthNav),r.monthNav.appendChild(r.prevMonthNav),r.config.showMonths&&(r.yearElements=[],r.monthElements=[]);for(var e=r.config.showMonths;e--;){var t=be();r.yearElements.push(t.yearElement),r.monthElements.push(t.monthElement),r.monthNav.appendChild(t.container)}r.monthNav.appendChild(r.nextMonthNav)}function _e(){r.weekdayContainer?p(r.weekdayContainer):r.weekdayContainer=h("div","flatpickr-weekdays");for(var e=r.config.showMonths;e--;){var t=h("div","flatpickr-weekdaycontainer");r.weekdayContainer.appendChild(t)}return xe(),r.weekdayContainer}function xe(){if(r.weekdayContainer){var e=r.l10n.firstDayOfWeek,t=Y(r.l10n.weekdays.shorthand);e>0&&e<t.length&&(t=Y(t.splice(e,t.length),t.splice(0,e)));for(var n=r.config.showMonths;n--;)r.weekdayContainer.children[n].innerHTML="\n      <span class='flatpickr-weekday'>\n        "+t.join("</span><span class='flatpickr-weekday'>")+"\n      </span>\n      "}}function we(e,t){void 0===t&&(t=!0);var n=t?e:e-r.currentMonth;n<0&&!0===r._hidePrevMonthArrow||n>0&&!0===r._hideNextMonthArrow||(r.currentMonth+=n,(r.currentMonth<0||r.currentMonth>11)&&(r.currentYear+=r.currentMonth>11?1:-1,r.currentMonth=(r.currentMonth+12)%12,nt("onYearChange"),ye()),ge(),nt("onMonthChange"),ot())}function Se(e){return r.calendarContainer.contains(e)}function Pe(e){if(r.isOpen&&!r.config.inline){var t=g(e),n=Se(t),i=!(t===r.input||t===r.altInput||r.element.contains(t)||e.path&&e.path.indexOf&&(~e.path.indexOf(r.input)||~e.path.indexOf(r.altInput)))&&!n&&!Se(e.relatedTarget),s=!r.config.ignoredFocusElements.some((function(e){return e.contains(t)}));i&&s&&(r.config.allowInput&&r.setDate(r._input.value,!1,r.config.altInput?r.config.altFormat:r.config.dateFormat),void 0!==r.timeContainer&&void 0!==r.minuteElement&&void 0!==r.hourElement&&""!==r.input.value&&void 0!==r.input.value&&x(),r.close(),r.config&&"range"===r.config.mode&&1===r.selectedDates.length&&r.clear(!1))}}function Te(e){if(!(!e||r.config.minDate&&e<r.config.minDate.getFullYear()||r.config.maxDate&&e>r.config.maxDate.getFullYear())){var t=e,n=r.currentYear!==t;r.currentYear=t||r.currentYear,r.config.maxDate&&r.currentYear===r.config.maxDate.getFullYear()?r.currentMonth=Math.min(r.config.maxDate.getMonth(),r.currentMonth):r.config.minDate&&r.currentYear===r.config.minDate.getFullYear()&&(r.currentMonth=Math.max(r.config.minDate.getMonth(),r.currentMonth)),n&&(r.redraw(),nt("onYearChange"),ye())}}function Re(e,t){var n;void 0===t&&(t=!0);var i=r.parseDate(e,void 0,t);if(r.config.minDate&&i&&k(i,r.config.minDate,void 0!==t?t:!r.minDateHasTime)<0||r.config.maxDate&&i&&k(i,r.config.maxDate,void 0!==t?t:!r.maxDateHasTime)>0)return!1;if(!r.config.enable&&0===r.config.disable.length)return!0;if(void 0===i)return!1;for(var s=!!r.config.enable,o=null!==(n=r.config.enable)&&void 0!==n?n:r.config.disable,a=0,l=void 0;a<o.length;a++){if("function"==typeof(l=o[a])&&l(i))return s;if(l instanceof Date&&void 0!==i&&l.getTime()===i.getTime())return s;if("string"==typeof l){var c=r.parseDate(l,void 0,!0);return c&&c.getTime()===i.getTime()?s:!s}if("object"==typeof l&&void 0!==i&&l.from&&l.to&&i.getTime()>=l.from.getTime()&&i.getTime()<=l.to.getTime())return s}return!s}function ke(e){return void 0!==r.daysContainer&&(-1===e.className.indexOf("hidden")&&-1===e.className.indexOf("flatpickr-disabled")&&r.daysContainer.contains(e))}function Ie(e){var t=e.target===r._input,n=r._input.value.trimEnd()!==at();!t||!n||e.relatedTarget&&Se(e.relatedTarget)||r.setDate(r._input.value,!0,e.target===r.altInput?r.config.altFormat:r.config.dateFormat)}function je(t){var n=g(t),i=r.config.wrap?e.contains(n):n===r._input,o=r.config.allowInput,a=r.isOpen&&(!o||!i),l=r.config.inline&&i&&!o;if(13===t.keyCode&&i){if(o)return r.setDate(r._input.value,!0,n===r.altInput?r.config.altFormat:r.config.dateFormat),r.close(),n.blur();r.open()}else if(Se(n)||a||l){var c=!!r.timeContainer&&r.timeContainer.contains(n);switch(t.keyCode){case 13:c?(t.preventDefault(),x(),Xe()):Ye(t);break;case 27:t.preventDefault(),Xe();break;case 8:case 46:i&&!r.config.allowInput&&(t.preventDefault(),r.clear());break;case 37:case 39:if(c||i)r.hourElement&&r.hourElement.focus();else{t.preventDefault();var u=s();if(void 0!==r.daysContainer&&(!1===o||u&&ke(u))){var d=39===t.keyCode?1:-1;t.ctrlKey?(t.stopPropagation(),we(d),me(pe(1),0)):me(void 0,d)}}break;case 38:case 40:t.preventDefault();var h=40===t.keyCode?1:-1;r.daysContainer&&void 0!==n.$i||n===r.input||n===r.altInput?t.ctrlKey?(t.stopPropagation(),Te(r.currentYear-h),me(pe(1),0)):c||me(void 0,7*h):n===r.currentYearElement?Te(r.currentYear-h):r.config.enableTime&&(!c&&r.hourElement&&r.hourElement.focus(),x(t),r._debouncedChange());break;case 9:if(c){var p=[r.hourElement,r.minuteElement,r.secondElement,r.amPM].concat(r.pluginElements).filter((function(e){return e})),m=p.indexOf(n);if(-1!==m){var f=p[m+(t.shiftKey?-1:1)];t.preventDefault(),(f||r._input).focus()}}else!r.config.noCalendar&&r.daysContainer&&r.daysContainer.contains(n)&&t.shiftKey&&(t.preventDefault(),r._input.focus())}}if(void 0!==r.amPM&&n===r.amPM)switch(t.key){case r.l10n.amPM[0].charAt(0):case r.l10n.amPM[0].charAt(0).toLowerCase():r.amPM.textContent=r.l10n.amPM[0],te(),lt();break;case r.l10n.amPM[1].charAt(0):case r.l10n.amPM[1].charAt(0).toLowerCase():r.amPM.textContent=r.l10n.amPM[1],te(),lt()}(i||Se(n))&&nt("onKeyDown",t)}function He(e,t){if(void 0===t&&(t="flatpickr-day"),1===r.selectedDates.length&&(!e||e.classList.contains(t)&&!e.classList.contains("flatpickr-disabled"))){for(var n=e?e.dateObj.getTime():r.days.firstElementChild.dateObj.getTime(),i=r.parseDate(r.selectedDates[0],void 0,!0).getTime(),s=Math.min(n,r.selectedDates[0].getTime()),o=Math.max(n,r.selectedDates[0].getTime()),a=!1,l=0,c=0,u=s;u<o;u+=$.DAY)Re(new Date(u),!0)||(a=a||u>s&&u<o,u<i&&(!l||u>l)?l=u:u>i&&(!c||u<c)&&(c=u));Array.from(r.rContainer.querySelectorAll("*:nth-child(-n+"+r.config.showMonths+") > ."+t)).forEach((function(t){var s=t.dateObj.getTime(),o=l>0&&s<l||c>0&&s>c;if(o)return t.classList.add("notAllowed"),void["inRange","startRange","endRange"].forEach((function(e){t.classList.remove(e)}));a&&!o||(["startRange","inRange","endRange","notAllowed"].forEach((function(e){t.classList.remove(e)})),void 0!==e&&(e.classList.add(n<=r.selectedDates[0].getTime()?"startRange":"endRange"),i<n&&s===i?t.classList.add("startRange"):i>n&&s===i&&t.classList.add("endRange"),s>=l&&(0===c||s<=c)&&j(s,i,n)&&t.classList.add("inRange")))}))}}function ze(){!r.isOpen||r.config.static||r.config.inline||qe()}function Ge(e){return function(t){var n=r.config["_"+e+"Date"]=r.parseDate(t,r.config.dateFormat),i=r.config["_"+("min"===e?"max":"min")+"Date"];void 0!==n&&(r["min"===e?"minDateHasTime":"maxDateHasTime"]=n.getHours()>0||n.getMinutes()>0||n.getSeconds()>0),r.selectedDates&&(r.selectedDates=r.selectedDates.filter((function(e){return Re(e)})),r.selectedDates.length||"min"!==e||ne(n),lt()),r.daysContainer&&($e(),void 0!==n?r.currentYearElement[e]=n.getFullYear().toString():r.currentYearElement.removeAttribute(e),r.currentYearElement.disabled=!!i&&void 0!==n&&i.getFullYear()===n.getFullYear())}}function We(){return r.config.wrap?e.querySelector("[data-input]"):e}function Ve(){"object"!=typeof r.config.locale&&void 0===re.l10ns[r.config.locale]&&r.config.errorHandler(new Error("flatpickr: invalid locale "+r.config.locale)),r.l10n=X(X({},re.l10ns.default),"object"==typeof r.config.locale?r.config.locale:"default"!==r.config.locale?re.l10ns[r.config.locale]:void 0),_.D="("+r.l10n.weekdays.shorthand.join("|")+")",_.l="("+r.l10n.weekdays.longhand.join("|")+")",_.M="("+r.l10n.months.shorthand.join("|")+")",_.F="("+r.l10n.months.longhand.join("|")+")",_.K="("+r.l10n.amPM[0]+"|"+r.l10n.amPM[1]+"|"+r.l10n.amPM[0].toLowerCase()+"|"+r.l10n.amPM[1].toLowerCase()+")",void 0===X(X({},t),JSON.parse(JSON.stringify(e.dataset||{}))).time_24hr&&void 0===re.defaultConfig.time_24hr&&(r.config.time_24hr=r.l10n.time_24hr),r.formatDate=w(r),r.parseDate=R({config:r.config,l10n:r.l10n})}function qe(e){if("function"!=typeof r.config.position){if(void 0!==r.calendarContainer){nt("onPreCalendarPosition");var t=e||r._positionElement,n=Array.prototype.reduce.call(r.calendarContainer.children,(function(e,t){return e+t.offsetHeight}),0),i=r.calendarContainer.offsetWidth,s=r.config.position.split(" "),o=s[0],a=s.length>1?s[1]:null,l=t.getBoundingClientRect(),c=window.innerHeight-l.bottom,u="above"===o||"below"!==o&&c<n&&l.top>n,h=window.pageYOffset+l.top+(u?-n-2:t.offsetHeight+2);if(d(r.calendarContainer,"arrowTop",!u),d(r.calendarContainer,"arrowBottom",u),!r.config.inline){var p=window.pageXOffset+l.left,m=!1,f=!1;"center"===a?(p-=(i-l.width)/2,m=!0):"right"===a&&(p-=i-l.width,f=!0),d(r.calendarContainer,"arrowLeft",!m&&!f),d(r.calendarContainer,"arrowCenter",m),d(r.calendarContainer,"arrowRight",f);var g=window.document.body.offsetWidth-(window.pageXOffset+l.right),y=p+i>window.document.body.offsetWidth,b=g+i>window.document.body.offsetWidth;if(d(r.calendarContainer,"rightMost",y),!r.config.static)if(r.calendarContainer.style.top=h+"px",y)if(b){var v=function(){for(var e=null,t=0;t<document.styleSheets.length;t++){var r=document.styleSheets[t];if(r.cssRules){try{r.cssRules}catch(e){continue}e=r;break}}return null!=e?e:(n=document.createElement("style"),document.head.appendChild(n),n.sheet);var n}();if(void 0===v)return;var _=window.document.body.offsetWidth,x=Math.max(0,_/2-i/2),w=v.cssRules.length,R="{left:"+l.left+"px;right:auto;}";d(r.calendarContainer,"rightMost",!1),d(r.calendarContainer,"centerMost",!0),v.insertRule(".flatpickr-calendar.centerMost:before,.flatpickr-calendar.centerMost:after"+R,w),r.calendarContainer.style.left=x+"px",r.calendarContainer.style.right="auto"}else r.calendarContainer.style.left="auto",r.calendarContainer.style.right=g+"px";else r.calendarContainer.style.left=p+"px",r.calendarContainer.style.right="auto"}}}else r.config.position(r,e)}function $e(){r.config.noCalendar||r.isMobile||(ye(),ot(),ge())}function Xe(){r._input.focus(),-1!==window.navigator.userAgent.indexOf("MSIE")||void 0!==navigator.msMaxTouchPoints?setTimeout(r.close,0):r.close()}function Ye(e){e.preventDefault(),e.stopPropagation();var t=m(g(e),(function(e){return e.classList&&e.classList.contains("flatpickr-day")&&!e.classList.contains("flatpickr-disabled")&&!e.classList.contains("notAllowed")}));if(void 0!==t){var n=t,i=r.latestSelectedDateObj=new Date(n.dateObj.getTime()),s=(i.getMonth()<r.currentMonth||i.getMonth()>r.currentMonth+r.config.showMonths-1)&&"range"!==r.config.mode;if(r.selectedDateElem=n,"single"===r.config.mode)r.selectedDates=[i];else if("multiple"===r.config.mode){var o=st(i);o?r.selectedDates.splice(parseInt(o),1):r.selectedDates.push(i)}else"range"===r.config.mode&&(2===r.selectedDates.length&&r.clear(!1,!1),r.latestSelectedDateObj=i,r.selectedDates.push(i),0!==k(i,r.selectedDates[0],!0)&&r.selectedDates.sort((function(e,t){return e.getTime()-t.getTime()})));if(te(),s){var a=r.currentYear!==i.getFullYear();r.currentYear=i.getFullYear(),r.currentMonth=i.getMonth(),a&&(nt("onYearChange"),ye()),nt("onMonthChange")}if(ot(),ge(),lt(),s||"range"===r.config.mode||1!==r.config.showMonths?void 0!==r.selectedDateElem&&void 0===r.hourElement&&r.selectedDateElem&&r.selectedDateElem.focus():he(n),void 0!==r.hourElement&&void 0!==r.hourElement&&r.hourElement.focus(),r.config.closeOnSelect){var l="single"===r.config.mode&&!r.config.enableTime,c="range"===r.config.mode&&2===r.selectedDates.length&&!r.config.enableTime;(l||c)&&Xe()}ae()}}r.parseDate=R({config:r.config,l10n:r.l10n}),r._handlers=[],r.pluginElements=[],r.loadedPlugins=[],r._bind=oe,r._setHoursFromDate=ne,r._positionCalendar=qe,r.changeMonth=we,r.changeYear=Te,r.clear=function(e,t){void 0===e&&(e=!0);void 0===t&&(t=!0);r.input.value="",void 0!==r.altInput&&(r.altInput.value="");void 0!==r.mobileInput&&(r.mobileInput.value="");r.selectedDates=[],r.latestSelectedDateObj=void 0,!0===t&&(r.currentYear=r._initialDate.getFullYear(),r.currentMonth=r._initialDate.getMonth());if(!0===r.config.enableTime){var n=Z(r.config);ie(n.hours,n.minutes,n.seconds)}r.redraw(),e&&nt("onChange")},r.close=function(){r.isOpen=!1,r.isMobile||(void 0!==r.calendarContainer&&r.calendarContainer.classList.remove("open"),void 0!==r._input&&r._input.classList.remove("active"));nt("onClose")},r.onMouseOver=He,r._createElement=h,r.createDay=de,r.destroy=function(){void 0!==r.config&&nt("onDestroy");for(var e=r._handlers.length;e--;)r._handlers[e].remove();if(r._handlers=[],r.mobileInput)r.mobileInput.parentNode&&r.mobileInput.parentNode.removeChild(r.mobileInput),r.mobileInput=void 0;else if(r.calendarContainer&&r.calendarContainer.parentNode)if(r.config.static&&r.calendarContainer.parentNode){var t=r.calendarContainer.parentNode;if(t.lastChild&&t.removeChild(t.lastChild),t.parentNode){for(;t.firstChild;)t.parentNode.insertBefore(t.firstChild,t);t.parentNode.removeChild(t)}}else r.calendarContainer.parentNode.removeChild(r.calendarContainer);r.altInput&&(r.input.type="text",r.altInput.parentNode&&r.altInput.parentNode.removeChild(r.altInput),delete r.altInput);r.input&&(r.input.type=r.input._type,r.input.classList.remove("flatpickr-input"),r.input.removeAttribute("readonly"));["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach((function(e){try{delete r[e]}catch(e){}}))},r.isEnabled=Re,r.jumpToDate=le,r.updateValue=lt,r.open=function(e,t){void 0===t&&(t=r._positionElement);if(!0===r.isMobile){if(e){e.preventDefault();var n=g(e);n&&n.blur()}return void 0!==r.mobileInput&&(r.mobileInput.focus(),r.mobileInput.click()),void nt("onOpen")}if(r._input.disabled||r.config.inline)return;var i=r.isOpen;r.isOpen=!0,i||(r.calendarContainer.classList.add("open"),r._input.classList.add("active"),nt("onOpen"),qe(t));!0===r.config.enableTime&&!0===r.config.noCalendar&&(!1!==r.config.allowInput||void 0!==e&&r.timeContainer.contains(e.relatedTarget)||setTimeout((function(){return r.hourElement.select()}),50))},r.redraw=$e,r.set=function(e,t){if(null!==e&&"object"==typeof e)for(var i in Object.assign(r.config,e),e)void 0!==Qe[i]&&Qe[i].forEach((function(e){return e()}));else r.config[e]=t,void 0!==Qe[e]?Qe[e].forEach((function(e){return e()})):n.indexOf(e)>-1&&(r.config[e]=u(t));r.redraw(),lt(!0)},r.setDate=function(e,t,n){void 0===t&&(t=!1);void 0===n&&(n=r.config.dateFormat);if(0!==e&&!e||e instanceof Array&&0===e.length)return r.clear(t);et(e,n),r.latestSelectedDateObj=r.selectedDates[r.selectedDates.length-1],r.redraw(),le(void 0,t),ne(),0===r.selectedDates.length&&r.clear(!1);lt(t),t&&nt("onChange")},r.toggle=function(e){if(!0===r.isOpen)return r.close();r.open(e)};var Qe={locale:[Ve,xe],showMonths:[ve,v,_e],minDate:[le],maxDate:[le],positionElement:[rt],clickOpens:[function(){!0===r.config.clickOpens?(oe(r._input,"focus",r.open),oe(r._input,"click",r.open)):(r._input.removeEventListener("focus",r.open),r._input.removeEventListener("click",r.open))}]};function et(e,t){var n=[];if(e instanceof Array)n=e.map((function(e){return r.parseDate(e,t)}));else if(e instanceof Date||"number"==typeof e)n=[r.parseDate(e,t)];else if("string"==typeof e)switch(r.config.mode){case"single":case"time":n=[r.parseDate(e,t)];break;case"multiple":n=e.split(r.config.conjunction).map((function(e){return r.parseDate(e,t)}));break;case"range":n=e.split(r.l10n.rangeSeparator).map((function(e){return r.parseDate(e,t)}))}else r.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(e)));r.selectedDates=r.config.allowInvalidPreload?n:n.filter((function(e){return e instanceof Date&&Re(e,!1)})),"range"===r.config.mode&&r.selectedDates.sort((function(e,t){return e.getTime()-t.getTime()}))}function tt(e){return e.slice().map((function(e){return"string"==typeof e||"number"==typeof e||e instanceof Date?r.parseDate(e,void 0,!0):e&&"object"==typeof e&&e.from&&e.to?{from:r.parseDate(e.from,void 0),to:r.parseDate(e.to,void 0)}:e})).filter((function(e){return e}))}function rt(){r._positionElement=r.config.positionElement||r._input}function nt(e,t){if(void 0!==r.config){var n=r.config[e];if(void 0!==n&&n.length>0)for(var i=0;n[i]&&i<n.length;i++)n[i](r.selectedDates,r.input.value,r,t);"onChange"===e&&(r.input.dispatchEvent(it("change")),r.input.dispatchEvent(it("input")))}}function it(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!0),t}function st(e){for(var t=0;t<r.selectedDates.length;t++){var n=r.selectedDates[t];if(n instanceof Date&&0===k(n,e))return""+t}return!1}function ot(){r.config.noCalendar||r.isMobile||!r.monthNav||(r.yearElements.forEach((function(e,t){var n=new Date(r.currentYear,r.currentMonth,1);n.setMonth(r.currentMonth+t),r.config.showMonths>1||"static"===r.config.monthSelectorType?r.monthElements[t].textContent=b(n.getMonth(),r.config.shorthandCurrentMonth,r.l10n)+" ":r.monthsDropdownContainer.value=n.getMonth().toString(),e.value=n.getFullYear().toString()})),r._hidePrevMonthArrow=void 0!==r.config.minDate&&(r.currentYear===r.config.minDate.getFullYear()?r.currentMonth<=r.config.minDate.getMonth():r.currentYear<r.config.minDate.getFullYear()),r._hideNextMonthArrow=void 0!==r.config.maxDate&&(r.currentYear===r.config.maxDate.getFullYear()?r.currentMonth+1>r.config.maxDate.getMonth():r.currentYear>r.config.maxDate.getFullYear()))}function at(e){var t=e||(r.config.altInput?r.config.altFormat:r.config.dateFormat);return r.selectedDates.map((function(e){return r.formatDate(e,t)})).filter((function(e,t,n){return"range"!==r.config.mode||r.config.enableTime||n.indexOf(e)===t})).join("range"!==r.config.mode?r.config.conjunction:r.l10n.rangeSeparator)}function lt(e){void 0===e&&(e=!0),void 0!==r.mobileInput&&r.mobileFormatStr&&(r.mobileInput.value=void 0!==r.latestSelectedDateObj?r.formatDate(r.latestSelectedDateObj,r.mobileFormatStr):""),r.input.value=at(r.config.dateFormat),void 0!==r.altInput&&(r.altInput.value=at(r.config.altFormat)),!1!==e&&nt("onValueUpdate")}function ct(e){var t=g(e),n=r.prevMonthNav.contains(t),i=r.nextMonthNav.contains(t);n||i?we(n?-1:1):r.yearElements.indexOf(t)>=0?t.select():t.classList.contains("arrowUp")?r.changeYear(r.currentYear+1):t.classList.contains("arrowDown")&&r.changeYear(r.currentYear-1)}return function(){r.element=r.input=e,r.isOpen=!1,function(){var s=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],o=X(X({},JSON.parse(JSON.stringify(e.dataset||{}))),t),a={};r.config.parseDate=o.parseDate,r.config.formatDate=o.formatDate,Object.defineProperty(r.config,"enable",{get:function(){return r.config._enable},set:function(e){r.config._enable=tt(e)}}),Object.defineProperty(r.config,"disable",{get:function(){return r.config._disable},set:function(e){r.config._disable=tt(e)}});var l="time"===o.mode;if(!o.dateFormat&&(o.enableTime||l)){var c=re.defaultConfig.dateFormat||i.dateFormat;a.dateFormat=o.noCalendar||l?"H:i"+(o.enableSeconds?":S":""):c+" H:i"+(o.enableSeconds?":S":"")}if(o.altInput&&(o.enableTime||l)&&!o.altFormat){var d=re.defaultConfig.altFormat||i.altFormat;a.altFormat=o.noCalendar||l?"h:i"+(o.enableSeconds?":S K":" K"):d+" h:i"+(o.enableSeconds?":S":"")+" K"}Object.defineProperty(r.config,"minDate",{get:function(){return r.config._minDate},set:Ge("min")}),Object.defineProperty(r.config,"maxDate",{get:function(){return r.config._maxDate},set:Ge("max")});var h=function(e){return function(t){r.config["min"===e?"_minTime":"_maxTime"]=r.parseDate(t,"H:i:S")}};Object.defineProperty(r.config,"minTime",{get:function(){return r.config._minTime},set:h("min")}),Object.defineProperty(r.config,"maxTime",{get:function(){return r.config._maxTime},set:h("max")}),"time"===o.mode&&(r.config.noCalendar=!0,r.config.enableTime=!0);Object.assign(r.config,a,o);for(var p=0;p<s.length;p++)r.config[s[p]]=!0===r.config[s[p]]||"true"===r.config[s[p]];n.filter((function(e){return void 0!==r.config[e]})).forEach((function(e){r.config[e]=u(r.config[e]||[]).map(y)})),r.isMobile=!r.config.disableMobile&&!r.config.inline&&"single"===r.config.mode&&!r.config.disable.length&&!r.config.enable&&!r.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(p=0;p<r.config.plugins.length;p++){var m=r.config.plugins[p](r)||{};for(var f in m)n.indexOf(f)>-1?r.config[f]=u(m[f]).map(y).concat(r.config[f]):void 0===o[f]&&(r.config[f]=m[f])}o.altInputClass||(r.config.altInputClass=We().className+" "+r.config.altInputClass);nt("onParseConfig")}(),Ve(),function(){if(r.input=We(),!r.input)return void r.config.errorHandler(new Error("Invalid input element specified"));r.input._type=r.input.type,r.input.type="text",r.input.classList.add("flatpickr-input"),r._input=r.input,r.config.altInput&&(r.altInput=h(r.input.nodeName,r.config.altInputClass),r._input=r.altInput,r.altInput.placeholder=r.input.placeholder,r.altInput.disabled=r.input.disabled,r.altInput.required=r.input.required,r.altInput.tabIndex=r.input.tabIndex,r.altInput.type="text",r.input.setAttribute("type","hidden"),!r.config.static&&r.input.parentNode&&r.input.parentNode.insertBefore(r.altInput,r.input.nextSibling));r.config.allowInput||r._input.setAttribute("readonly","readonly");rt()}(),function(){r.selectedDates=[],r.now=r.parseDate(r.config.now)||new Date;var e=r.config.defaultDate||("INPUT"!==r.input.nodeName&&"TEXTAREA"!==r.input.nodeName||!r.input.placeholder||r.input.value!==r.input.placeholder?r.input.value:null);e&&et(e,r.config.dateFormat);r._initialDate=r.selectedDates.length>0?r.selectedDates[0]:r.config.minDate&&r.config.minDate.getTime()>r.now.getTime()?r.config.minDate:r.config.maxDate&&r.config.maxDate.getTime()<r.now.getTime()?r.config.maxDate:r.now,r.currentYear=r._initialDate.getFullYear(),r.currentMonth=r._initialDate.getMonth(),r.selectedDates.length>0&&(r.latestSelectedDateObj=r.selectedDates[0]);void 0!==r.config.minTime&&(r.config.minTime=r.parseDate(r.config.minTime,"H:i"));void 0!==r.config.maxTime&&(r.config.maxTime=r.parseDate(r.config.maxTime,"H:i"));r.minDateHasTime=!!r.config.minDate&&(r.config.minDate.getHours()>0||r.config.minDate.getMinutes()>0||r.config.minDate.getSeconds()>0),r.maxDateHasTime=!!r.config.maxDate&&(r.config.maxDate.getHours()>0||r.config.maxDate.getMinutes()>0||r.config.maxDate.getSeconds()>0)}(),r.utils={getDaysInMonth:function(e,t){return void 0===e&&(e=r.currentMonth),void 0===t&&(t=r.currentYear),1===e&&(t%4==0&&t%100!=0||t%400==0)?29:r.l10n.daysInMonth[e]}},r.isMobile||function(){var e=window.document.createDocumentFragment();if(r.calendarContainer=h("div","flatpickr-calendar"),r.calendarContainer.tabIndex=-1,!r.config.noCalendar){if(e.appendChild((r.monthNav=h("div","flatpickr-months"),r.yearElements=[],r.monthElements=[],r.prevMonthNav=h("span","flatpickr-prev-month"),r.prevMonthNav.innerHTML=r.config.prevArrow,r.nextMonthNav=h("span","flatpickr-next-month"),r.nextMonthNav.innerHTML=r.config.nextArrow,ve(),Object.defineProperty(r,"_hidePrevMonthArrow",{get:function(){return r.__hidePrevMonthArrow},set:function(e){r.__hidePrevMonthArrow!==e&&(d(r.prevMonthNav,"flatpickr-disabled",e),r.__hidePrevMonthArrow=e)}}),Object.defineProperty(r,"_hideNextMonthArrow",{get:function(){return r.__hideNextMonthArrow},set:function(e){r.__hideNextMonthArrow!==e&&(d(r.nextMonthNav,"flatpickr-disabled",e),r.__hideNextMonthArrow=e)}}),r.currentYearElement=r.yearElements[0],ot(),r.monthNav)),r.innerContainer=h("div","flatpickr-innerContainer"),r.config.weekNumbers){var t=function(){r.calendarContainer.classList.add("hasWeeks");var e=h("div","flatpickr-weekwrapper");e.appendChild(h("span","flatpickr-weekday",r.l10n.weekAbbreviation));var t=h("div","flatpickr-weeks");return e.appendChild(t),{weekWrapper:e,weekNumbers:t}}(),n=t.weekWrapper,i=t.weekNumbers;r.innerContainer.appendChild(n),r.weekNumbers=i,r.weekWrapper=n}r.rContainer=h("div","flatpickr-rContainer"),r.rContainer.appendChild(_e()),r.daysContainer||(r.daysContainer=h("div","flatpickr-days"),r.daysContainer.tabIndex=-1),ge(),r.rContainer.appendChild(r.daysContainer),r.innerContainer.appendChild(r.rContainer),e.appendChild(r.innerContainer)}r.config.enableTime&&e.appendChild(function(){r.calendarContainer.classList.add("hasTime"),r.config.noCalendar&&r.calendarContainer.classList.add("noCalendar");var e=Z(r.config);r.timeContainer=h("div","flatpickr-time"),r.timeContainer.tabIndex=-1;var t=h("span","flatpickr-time-separator",":"),n=f("flatpickr-hour",{"aria-label":r.l10n.hourAriaLabel});r.hourElement=n.getElementsByTagName("input")[0];var i=f("flatpickr-minute",{"aria-label":r.l10n.minuteAriaLabel});r.minuteElement=i.getElementsByTagName("input")[0],r.hourElement.tabIndex=r.minuteElement.tabIndex=-1,r.hourElement.value=a(r.latestSelectedDateObj?r.latestSelectedDateObj.getHours():r.config.time_24hr?e.hours:function(e){switch(e%24){case 0:case 12:return 12;default:return e%12}}(e.hours)),r.minuteElement.value=a(r.latestSelectedDateObj?r.latestSelectedDateObj.getMinutes():e.minutes),r.hourElement.setAttribute("step",r.config.hourIncrement.toString()),r.minuteElement.setAttribute("step",r.config.minuteIncrement.toString()),r.hourElement.setAttribute("min",r.config.time_24hr?"0":"1"),r.hourElement.setAttribute("max",r.config.time_24hr?"23":"12"),r.hourElement.setAttribute("maxlength","2"),r.minuteElement.setAttribute("min","0"),r.minuteElement.setAttribute("max","59"),r.minuteElement.setAttribute("maxlength","2"),r.timeContainer.appendChild(n),r.timeContainer.appendChild(t),r.timeContainer.appendChild(i),r.config.time_24hr&&r.timeContainer.classList.add("time24hr");if(r.config.enableSeconds){r.timeContainer.classList.add("hasSeconds");var s=f("flatpickr-second");r.secondElement=s.getElementsByTagName("input")[0],r.secondElement.value=a(r.latestSelectedDateObj?r.latestSelectedDateObj.getSeconds():e.seconds),r.secondElement.setAttribute("step",r.minuteElement.getAttribute("step")),r.secondElement.setAttribute("min","0"),r.secondElement.setAttribute("max","59"),r.secondElement.setAttribute("maxlength","2"),r.timeContainer.appendChild(h("span","flatpickr-time-separator",":")),r.timeContainer.appendChild(s)}r.config.time_24hr||(r.amPM=h("span","flatpickr-am-pm",r.l10n.amPM[l((r.latestSelectedDateObj?r.hourElement.value:r.config.defaultHour)>11)]),r.amPM.title=r.l10n.toggleTitle,r.amPM.tabIndex=-1,r.timeContainer.appendChild(r.amPM));return r.timeContainer}());d(r.calendarContainer,"rangeMode","range"===r.config.mode),d(r.calendarContainer,"animate",!0===r.config.animate),d(r.calendarContainer,"multiMonth",r.config.showMonths>1),r.calendarContainer.appendChild(e);var s=void 0!==r.config.appendTo&&void 0!==r.config.appendTo.nodeType;if((r.config.inline||r.config.static)&&(r.calendarContainer.classList.add(r.config.inline?"inline":"static"),r.config.inline&&(!s&&r.element.parentNode?r.element.parentNode.insertBefore(r.calendarContainer,r._input.nextSibling):void 0!==r.config.appendTo&&r.config.appendTo.appendChild(r.calendarContainer)),r.config.static)){var o=h("div","flatpickr-wrapper");r.element.parentNode&&r.element.parentNode.insertBefore(o,r.element),o.appendChild(r.element),r.altInput&&o.appendChild(r.altInput),o.appendChild(r.calendarContainer)}r.config.static||r.config.inline||(void 0!==r.config.appendTo?r.config.appendTo:window.document.body).appendChild(r.calendarContainer)}(),function(){r.config.wrap&&["open","close","toggle","clear"].forEach((function(e){Array.prototype.forEach.call(r.element.querySelectorAll("[data-"+e+"]"),(function(t){return oe(t,"click",r[e])}))}));if(r.isMobile)return void function(){var e=r.config.enableTime?r.config.noCalendar?"time":"datetime-local":"date";r.mobileInput=h("input",r.input.className+" flatpickr-mobile"),r.mobileInput.tabIndex=1,r.mobileInput.type=e,r.mobileInput.disabled=r.input.disabled,r.mobileInput.required=r.input.required,r.mobileInput.placeholder=r.input.placeholder,r.mobileFormatStr="datetime-local"===e?"Y-m-d\\TH:i:S":"date"===e?"Y-m-d":"H:i:S",r.selectedDates.length>0&&(r.mobileInput.defaultValue=r.mobileInput.value=r.formatDate(r.selectedDates[0],r.mobileFormatStr));r.config.minDate&&(r.mobileInput.min=r.formatDate(r.config.minDate,"Y-m-d"));r.config.maxDate&&(r.mobileInput.max=r.formatDate(r.config.maxDate,"Y-m-d"));r.input.getAttribute("step")&&(r.mobileInput.step=String(r.input.getAttribute("step")));r.input.type="hidden",void 0!==r.altInput&&(r.altInput.type="hidden");try{r.input.parentNode&&r.input.parentNode.insertBefore(r.mobileInput,r.input.nextSibling)}catch(e){}oe(r.mobileInput,"change",(function(e){r.setDate(g(e).value,!1,r.mobileFormatStr),nt("onChange"),nt("onClose")}))}();var e=c(ze,50);r._debouncedChange=c(ae,ee),r.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&oe(r.daysContainer,"mouseover",(function(e){"range"===r.config.mode&&He(g(e))}));oe(r._input,"keydown",je),void 0!==r.calendarContainer&&oe(r.calendarContainer,"keydown",je);r.config.inline||r.config.static||oe(window,"resize",e);void 0!==window.ontouchstart?oe(window.document,"touchstart",Pe):oe(window.document,"mousedown",Pe);oe(window.document,"focus",Pe,{capture:!0}),!0===r.config.clickOpens&&(oe(r._input,"focus",r.open),oe(r._input,"click",r.open));void 0!==r.daysContainer&&(oe(r.monthNav,"click",ct),oe(r.monthNav,["keyup","increment"],se),oe(r.daysContainer,"click",Ye));if(void 0!==r.timeContainer&&void 0!==r.minuteElement&&void 0!==r.hourElement){var t=function(e){return g(e).select()};oe(r.timeContainer,["increment"],x),oe(r.timeContainer,"blur",x,{capture:!0}),oe(r.timeContainer,"click",ce),oe([r.hourElement,r.minuteElement],["focus","click"],t),void 0!==r.secondElement&&oe(r.secondElement,"focus",(function(){return r.secondElement&&r.secondElement.select()})),void 0!==r.amPM&&oe(r.amPM,"click",(function(e){x(e)}))}r.config.allowInput&&oe(r._input,"blur",Ie)}(),(r.selectedDates.length||r.config.noCalendar)&&(r.config.enableTime&&ne(r.config.noCalendar?r.latestSelectedDateObj:void 0),lt(!1)),v();var s=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!r.isMobile&&s&&qe(),nt("onReady")}(),r}function te(e,t){for(var r=Array.prototype.slice.call(e).filter((function(e){return e instanceof HTMLElement})),n=[],i=0;i<r.length;i++){var s=r[i];try{if(null!==s.getAttribute("data-fp-omit"))continue;void 0!==s._flatpickr&&(s._flatpickr.destroy(),s._flatpickr=void 0),s._flatpickr=FlatpickrInstance(s,t||{}),n.push(s._flatpickr)}catch(e){console.error(e)}}return 1===n.length?n[0]:n}"undefined"!=typeof HTMLElement&&"undefined"!=typeof HTMLCollection&&"undefined"!=typeof NodeList&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(e){return te(this,e)},HTMLElement.prototype.flatpickr=function(e){return te([this],e)});var re=function(e,t){return"string"==typeof e?te(window.document.querySelectorAll(e),t):e instanceof Node?te([e],t):te(e,t)};re.defaultConfig={},re.l10ns={en:X({},o),default:X({},o)},re.localize=function(e){re.l10ns.default=X(X({},re.l10ns.default),e)},re.setDefaults=function(e){re.defaultConfig=X(X({},re.defaultConfig),e)},re.parseDate=R({}),re.formatDate=w({}),re.compareDates=k,"undefined"!=typeof jQuery&&void 0!==jQuery.fn&&(jQuery.fn.flatpickr=function(e){return te(this,e)}),Date.prototype.fp_incr=function(e){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+("string"==typeof e?parseInt(e,10):e))},"undefined"!=typeof window&&(window.flatpickr=re);const ne=re},50680:()=>{"use strict";"function"!=typeof Object.assign&&(Object.assign=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(!e)throw TypeError("Cannot convert undefined or null to object");for(var n=function(t){t&&Object.keys(t).forEach((function(r){return e[r]=t[r]}))},i=0,s=t;i<s.length;i++){n(s[i])}return e})},70919:e=>{"use strict";var t=Object.prototype.toString,r=Math.max,n=function(e,t){for(var r=[],n=0;n<e.length;n+=1)r[n]=e[n];for(var i=0;i<t.length;i+=1)r[i+e.length]=t[i];return r};e.exports=function(e){var i=this;if("function"!=typeof i||"[object Function]"!==t.apply(i))throw new TypeError("Function.prototype.bind called on incompatible "+i);for(var s,o=function(e,t){for(var r=[],n=t||0,i=0;n<e.length;n+=1,i+=1)r[i]=e[n];return r}(arguments,1),a=r(0,i.length-o.length),l=[],c=0;c<a;c++)l[c]="$"+c;if(s=Function("binder","return function ("+function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r}(l,",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof s){var t=i.apply(this,n(o,arguments));return Object(t)===t?t:this}return i.apply(e,n(o,arguments))})),i.prototype){var Empty=function(){};Empty.prototype=i.prototype,s.prototype=new Empty,Empty.prototype=null}return s}},5905:(e,t,r)=>{"use strict";var n=r(70919);e.exports=Function.prototype.bind||n},17156:e=>{"use strict";var t=function(){return"string"==typeof function(){}.name},r=Object.getOwnPropertyDescriptor;if(r)try{r([],"length")}catch(e){r=null}t.functionsHaveConfigurableNames=function(){if(!t()||!r)return!1;var e=r((function(){}),"name");return!!e&&!!e.configurable};var n=Function.prototype.bind;t.boundFunctionsHaveNames=function(){return t()&&"function"==typeof n&&""!==function(){}.bind().name},e.exports=t},77664:(e,t,r)=>{"use strict";var n,i=r(57669),s=r(53335),o=r(92912),a=r(96404),l=r(92962),c=r(58921),u=r(27471),d=Function,h=function(e){try{return d('"use strict"; return ('+e+").constructor;")()}catch(e){}},p=Object.getOwnPropertyDescriptor;if(p)try{p({},"")}catch(e){p=null}var m=function(){throw new c},f=p?function(){try{return m}catch(e){try{return p(arguments,"callee").get}catch(e){return m}}}():m,g=r(73937)(),y=r(42265)(),b=Object.getPrototypeOf||(y?function(e){return e.__proto__}:null),v={},_="undefined"!=typeof Uint8Array&&b?b(Uint8Array):n,x={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":g&&b?b([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":v,"%AsyncGenerator%":v,"%AsyncGeneratorFunction%":v,"%AsyncIteratorPrototype%":v,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":s,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":d,"%GeneratorFunction%":v,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":g&&b?b(b([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&g&&b?b((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":o,"%ReferenceError%":a,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&g&&b?b((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&b?b(""[Symbol.iterator]()):n,"%Symbol%":g?Symbol:n,"%SyntaxError%":l,"%ThrowTypeError%":f,"%TypedArray%":_,"%TypeError%":c,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":u,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};if(b)try{null.error}catch(e){var w=b(b(e));x["%Error.prototype%"]=w}var R=function e(t){var r;if("%AsyncFunction%"===t)r=h("async function () {}");else if("%GeneratorFunction%"===t)r=h("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=h("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&b&&(r=b(i.prototype))}return x[t]=r,r},k={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},j=r(5905),z=r(83607),q=j.call(Function.call,Array.prototype.concat),$=j.call(Function.apply,Array.prototype.splice),Z=j.call(Function.call,String.prototype.replace),X=j.call(Function.call,String.prototype.slice),Y=j.call(Function.call,RegExp.prototype.exec),ee=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,te=/\\(\\)?/g,re=function(e,t){var r,n=e;if(z(k,n)&&(n="%"+(r=k[n])[0]+"%"),z(x,n)){var i=x[n];if(i===v&&(i=R(n)),void 0===i&&!t)throw new c("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new l("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new c('"allowMissing" argument must be a boolean');if(null===Y(/^%?[^%]*%?$/,e))throw new l("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=X(e,0,1),r=X(e,-1);if("%"===t&&"%"!==r)throw new l("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new l("invalid intrinsic syntax, expected opening `%`");var n=[];return Z(e,ee,(function(e,t,r,i){n[n.length]=r?Z(i,te,"$1"):t||e})),n}(e),n=r.length>0?r[0]:"",i=re("%"+n+"%",t),s=i.name,o=i.value,a=!1,u=i.alias;u&&(n=u[0],$(r,q([0,1],u)));for(var d=1,h=!0;d<r.length;d+=1){var m=r[d],f=X(m,0,1),g=X(m,-1);if(('"'===f||"'"===f||"`"===f||'"'===g||"'"===g||"`"===g)&&f!==g)throw new l("property names with quotes must have matching quotes");if("constructor"!==m&&h||(a=!0),z(x,s="%"+(n+="."+m)+"%"))o=x[s];else if(null!=o){if(!(m in o)){if(!t)throw new c("base intrinsic for "+e+" exists, but the property is not available.");return}if(p&&d+1>=r.length){var y=p(o,m);o=(h=!!y)&&"get"in y&&!("originalValue"in y.get)?y.get:o[m]}else h=z(o,m),o=o[m];h&&!a&&(x[s]=o)}}return o}},81909:(e,t,r)=>{"use strict";var n=r(77664)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},3933:(e,t,r)=>{"use strict";var n="__global_unique_id__";e.exports=function(){return r.g[n]=(r.g[n]||0)+1}},16402:(e,t,r)=>{"use strict";var n=r(7905),i=function(){return!!n};i.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},e.exports=i},42265:e=>{"use strict";var t={__proto__:null,foo:{}},r=Object;e.exports=function(){return{__proto__:t}.foo===t.foo&&!(t instanceof r)}},73937:(e,t,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(579);e.exports=function(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&i())))}},579:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},85930:(e,t,r)=>{"use strict";var n=r(579);e.exports=function(){return n()&&!!Symbol.toStringTag}},83607:(e,t,r)=>{"use strict";var n=Function.prototype.call,i=Object.prototype.hasOwnProperty,s=r(5905);e.exports=s.call(n,i)},68587:(e,t,r)=>{"use strict";r.r(t),r.d(t,{createBrowserHistory:()=>k,createHashHistory:()=>X,createLocation:()=>g,createMemoryHistory:()=>ee,createPath:()=>f,locationsAreEqual:()=>y,parsePath:()=>m});var n=r(238);function i(e){return"/"===e.charAt(0)}function s(e,t){for(var r=t,n=r+1,i=e.length;n<i;r+=1,n+=1)e[r]=e[n];e.pop()}const o=function(e,t){void 0===t&&(t="");var r,n=e&&e.split("/")||[],o=t&&t.split("/")||[],a=e&&i(e),l=t&&i(t),c=a||l;if(e&&i(e)?o=n:n.length&&(o.pop(),o=o.concat(n)),!o.length)return"/";if(o.length){var u=o[o.length-1];r="."===u||".."===u||""===u}else r=!1;for(var d=0,h=o.length;h>=0;h--){var p=o[h];"."===p?s(o,h):".."===p?(s(o,h),d++):d&&(s(o,h),d--)}if(!c)for(;d--;d)o.unshift("..");!c||""===o[0]||o[0]&&i(o[0])||o.unshift("");var m=o.join("/");return r&&"/"!==m.substr(-1)&&(m+="/"),m};function a(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}const l=function e(t,r){if(t===r)return!0;if(null==t||null==r)return!1;if(Array.isArray(t))return Array.isArray(r)&&t.length===r.length&&t.every((function(t,n){return e(t,r[n])}));if("object"==typeof t||"object"==typeof r){var n=a(t),i=a(r);return n!==t||i!==r?e(n,i):Object.keys(Object.assign({},t,r)).every((function(n){return e(t[n],r[n])}))}return!1};var c=r(88631);function u(e){return"/"===e.charAt(0)?e:"/"+e}function d(e){return"/"===e.charAt(0)?e.substr(1):e}function h(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function p(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function m(e){var t=e||"/",r="",n="",i=t.indexOf("#");-1!==i&&(n=t.substr(i),t=t.substr(0,i));var s=t.indexOf("?");return-1!==s&&(r=t.substr(s),t=t.substr(0,s)),{pathname:t,search:"?"===r?"":r,hash:"#"===n?"":n}}function f(e){var t=e.pathname,r=e.search,n=e.hash,i=t||"/";return r&&"?"!==r&&(i+="?"===r.charAt(0)?r:"?"+r),n&&"#"!==n&&(i+="#"===n.charAt(0)?n:"#"+n),i}function g(e,t,r,i){var s;"string"==typeof e?(s=m(e)).state=t:(void 0===(s=(0,n.A)({},e)).pathname&&(s.pathname=""),s.search?"?"!==s.search.charAt(0)&&(s.search="?"+s.search):s.search="",s.hash?"#"!==s.hash.charAt(0)&&(s.hash="#"+s.hash):s.hash="",void 0!==t&&void 0===s.state&&(s.state=t));try{s.pathname=decodeURI(s.pathname)}catch(e){throw e instanceof URIError?new URIError('Pathname "'+s.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):e}return r&&(s.key=r),i?s.pathname?"/"!==s.pathname.charAt(0)&&(s.pathname=o(s.pathname,i.pathname)):s.pathname=i.pathname:s.pathname||(s.pathname="/"),s}function y(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&e.key===t.key&&l(e.state,t.state)}function b(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,r,n,i){if(null!=e){var s="function"==typeof e?e(t,r):e;"string"==typeof s?"function"==typeof n?n(s,i):i(!0):i(!1!==s)}else i(!0)},appendListener:function(e){var r=!0;function n(){r&&e.apply(void 0,arguments)}return t.push(n),function(){r=!1,t=t.filter((function(e){return e!==n}))}},notifyListeners:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t.forEach((function(e){return e.apply(void 0,r)}))}}}var v=!("undefined"==typeof window||!window.document||!window.document.createElement);function _(e,t){t(window.confirm(e))}var x="popstate",w="hashchange";function R(){try{return window.history.state||{}}catch(e){return{}}}function k(e){void 0===e&&(e={}),v||(0,c.A)(!1);var t,r=window.history,i=(-1===(t=window.navigator.userAgent).indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&window.history&&"pushState"in window.history,s=!(-1===window.navigator.userAgent.indexOf("Trident")),o=e,a=o.forceRefresh,l=void 0!==a&&a,d=o.getUserConfirmation,m=void 0===d?_:d,y=o.keyLength,k=void 0===y?6:y,j=e.basename?p(u(e.basename)):"";function z(e){var t=e||{},r=t.key,n=t.state,i=window.location,s=i.pathname+i.search+i.hash;return j&&(s=h(s,j)),g(s,n,r)}function q(){return Math.random().toString(36).substr(2,k)}var $=b();function Z(e){(0,n.A)(ce,e),ce.length=r.length,$.notifyListeners(ce.location,ce.action)}function X(e){(function(e){return void 0===e.state&&-1===navigator.userAgent.indexOf("CriOS")})(e)||te(z(e.state))}function Y(){te(z(R()))}var ee=!1;function te(e){if(ee)ee=!1,Z();else{$.confirmTransitionTo(e,"POP",m,(function(t){t?Z({action:"POP",location:e}):function(e){var t=ce.location,r=ne.indexOf(t.key);-1===r&&(r=0);var n=ne.indexOf(e.key);-1===n&&(n=0);var i=r-n;i&&(ee=!0,se(i))}(e)}))}}var re=z(R()),ne=[re.key];function ie(e){return j+f(e)}function se(e){r.go(e)}var oe=0;function ae(e){1===(oe+=e)&&1===e?(window.addEventListener(x,X),s&&window.addEventListener(w,Y)):0===oe&&(window.removeEventListener(x,X),s&&window.removeEventListener(w,Y))}var le=!1;var ce={length:r.length,action:"POP",location:re,createHref:ie,push:function(e,t){var n="PUSH",s=g(e,t,q(),ce.location);$.confirmTransitionTo(s,n,m,(function(e){if(e){var t=ie(s),o=s.key,a=s.state;if(i)if(r.pushState({key:o,state:a},null,t),l)window.location.href=t;else{var c=ne.indexOf(ce.location.key),u=ne.slice(0,c+1);u.push(s.key),ne=u,Z({action:n,location:s})}else window.location.href=t}}))},replace:function(e,t){var n="REPLACE",s=g(e,t,q(),ce.location);$.confirmTransitionTo(s,n,m,(function(e){if(e){var t=ie(s),o=s.key,a=s.state;if(i)if(r.replaceState({key:o,state:a},null,t),l)window.location.replace(t);else{var c=ne.indexOf(ce.location.key);-1!==c&&(ne[c]=s.key),Z({action:n,location:s})}else window.location.replace(t)}}))},go:se,goBack:function(){se(-1)},goForward:function(){se(1)},block:function(e){void 0===e&&(e=!1);var t=$.setPrompt(e);return le||(ae(1),le=!0),function(){return le&&(le=!1,ae(-1)),t()}},listen:function(e){var t=$.appendListener(e);return ae(1),function(){ae(-1),t()}}};return ce}var j="hashchange",z={hashbang:{encodePath:function(e){return"!"===e.charAt(0)?e:"!/"+d(e)},decodePath:function(e){return"!"===e.charAt(0)?e.substr(1):e}},noslash:{encodePath:d,decodePath:u},slash:{encodePath:u,decodePath:u}};function q(e){var t=e.indexOf("#");return-1===t?e:e.slice(0,t)}function $(){var e=window.location.href,t=e.indexOf("#");return-1===t?"":e.substring(t+1)}function Z(e){window.location.replace(q(window.location.href)+"#"+e)}function X(e){void 0===e&&(e={}),v||(0,c.A)(!1);var t=window.history,r=(window.navigator.userAgent.indexOf("Firefox"),e),i=r.getUserConfirmation,s=void 0===i?_:i,o=r.hashType,a=void 0===o?"slash":o,l=e.basename?p(u(e.basename)):"",d=z[a],m=d.encodePath,y=d.decodePath;function x(){var e=y($());return l&&(e=h(e,l)),g(e)}var w=b();function R(e){(0,n.A)(le,e),le.length=t.length,w.notifyListeners(le.location,le.action)}var k=!1,X=null;function Y(){var e,t,r=$(),n=m(r);if(r!==n)Z(n);else{var i=x(),o=le.location;if(!k&&(t=i,(e=o).pathname===t.pathname&&e.search===t.search&&e.hash===t.hash))return;if(X===f(i))return;X=null,function(e){if(k)k=!1,R();else{var t="POP";w.confirmTransitionTo(e,t,s,(function(r){r?R({action:t,location:e}):function(e){var t=le.location,r=ne.lastIndexOf(f(t));-1===r&&(r=0);var n=ne.lastIndexOf(f(e));-1===n&&(n=0);var i=r-n;i&&(k=!0,ie(i))}(e)}))}}(i)}}var ee=$(),te=m(ee);ee!==te&&Z(te);var re=x(),ne=[f(re)];function ie(e){t.go(e)}var se=0;function oe(e){1===(se+=e)&&1===e?window.addEventListener(j,Y):0===se&&window.removeEventListener(j,Y)}var ae=!1;var le={length:t.length,action:"POP",location:re,createHref:function(e){var t=document.querySelector("base"),r="";return t&&t.getAttribute("href")&&(r=q(window.location.href)),r+"#"+m(l+f(e))},push:function(e,t){var r="PUSH",n=g(e,void 0,void 0,le.location);w.confirmTransitionTo(n,r,s,(function(e){if(e){var t=f(n),i=m(l+t);if($()!==i){X=t,function(e){window.location.hash=e}(i);var s=ne.lastIndexOf(f(le.location)),o=ne.slice(0,s+1);o.push(t),ne=o,R({action:r,location:n})}else R()}}))},replace:function(e,t){var r="REPLACE",n=g(e,void 0,void 0,le.location);w.confirmTransitionTo(n,r,s,(function(e){if(e){var t=f(n),i=m(l+t);$()!==i&&(X=t,Z(i));var s=ne.indexOf(f(le.location));-1!==s&&(ne[s]=t),R({action:r,location:n})}}))},go:ie,goBack:function(){ie(-1)},goForward:function(){ie(1)},block:function(e){void 0===e&&(e=!1);var t=w.setPrompt(e);return ae||(oe(1),ae=!0),function(){return ae&&(ae=!1,oe(-1)),t()}},listen:function(e){var t=w.appendListener(e);return oe(1),function(){oe(-1),t()}}};return le}function Y(e,t,r){return Math.min(Math.max(e,t),r)}function ee(e){void 0===e&&(e={});var t=e,r=t.getUserConfirmation,i=t.initialEntries,s=void 0===i?["/"]:i,o=t.initialIndex,a=void 0===o?0:o,l=t.keyLength,c=void 0===l?6:l,u=b();function d(e){(0,n.A)(_,e),_.length=_.entries.length,u.notifyListeners(_.location,_.action)}function h(){return Math.random().toString(36).substr(2,c)}var p=Y(a,0,s.length-1),m=s.map((function(e){return g(e,void 0,"string"==typeof e?h():e.key||h())})),y=f;function v(e){var t=Y(_.index+e,0,_.entries.length-1),n=_.entries[t];u.confirmTransitionTo(n,"POP",r,(function(e){e?d({action:"POP",location:n,index:t}):d()}))}var _={length:m.length,action:"POP",location:m[p],index:p,entries:m,createHref:y,push:function(e,t){var n="PUSH",i=g(e,t,h(),_.location);u.confirmTransitionTo(i,n,r,(function(e){if(e){var t=_.index+1,r=_.entries.slice(0);r.length>t?r.splice(t,r.length-t,i):r.push(i),d({action:n,location:i,index:t,entries:r})}}))},replace:function(e,t){var n="REPLACE",i=g(e,t,h(),_.location);u.confirmTransitionTo(i,n,r,(function(e){e&&(_.entries[_.index]=i,d({action:n,location:i}))}))},go:v,goBack:function(){v(-1)},goForward:function(){v(1)},canGo:function(e){var t=_.index+e;return t>=0&&t<_.entries.length},block:function(e){return void 0===e&&(e=!1),u.setPrompt(e)},listen:function(e){return u.appendListener(e)}};return _}},74944:(e,t,r)=>{"use strict";var n=r(94649),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},s={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function l(e){return n.isMemo(e)?o:a[e.$$typeof]||i}a[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[n.Memo]=o;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,h=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,m=Object.prototype;e.exports=function e(t,r,n){if("string"!=typeof r){if(m){var i=p(r);i&&i!==m&&e(t,i,n)}var o=u(r);d&&(o=o.concat(d(r)));for(var a=l(t),f=l(r),g=0;g<o.length;++g){var y=o[g];if(!(s[y]||n&&n[y]||f&&f[y]||a&&a[y])){var b=h(r,y);try{c(t,y,b)}catch(e){}}}}return t}},44292:function(e){e.exports=function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(t,r){var n=[];function i(t){if(!t||"object"!==e(t))return!1;for(var r=0;r<n.length;r++)if(n[r]===t)return!0;return n.push(t),!1}function s(t){return!/function|symbol/.test(e(t))&&null!==t&&("object"!==e(t)||void 0!==t.hasOwnProperty)}function o(t,n){if(n||(n=0),n>=r)return"[DEPTH]";if(!s(t))return Object.prototype.toString.call(t);if(i(t))return"[RECURSION]";if(Array.isArray(t))return t.map((function(e){return o(e,n+1)}));if("object"===e(t)){var a={};for(var l in t){var c=t[l];Object.prototype.hasOwnProperty.call(t,l)&&null!=l&&null!=c&&(a[l]=o(c,n+1))}return a}return t}return o(t)}function r(e){if(!e||!e.tagName)return"";var t=e.tagName.toLowerCase();if("html"===t)return"";e.id&&(t+="#".concat(e.id));var r=e.getAttribute("class");r&&r.split(/\s+/).forEach((function(e){t+=".".concat(e)})),["alt","name","title","type"].forEach((function(r){var n=e.getAttribute(r);n&&(t+="[".concat(r,'="').concat(n,'"]'))}));var n=c(e);return n.length>1&&(t+=":nth-child(".concat(Array.prototype.indexOf.call(n,e)+1,")")),t}function n(e){var t=r(e);if(e.parentNode&&e.parentNode.tagName){var i=n(e.parentNode);if(i.length>0)return"".concat(i," > ").concat(t)}return t}function i(e){var t=e.textContent||e.innerText||"";return t||"submit"!==e.type&&"button"!==e.type||(t=e.value),u(t.trim(),300)}function s(){if(!window.fetch)return!1;if(o(window.fetch))return!0;try{var e=document.createElement("iframe");e.style.display="none",document.head.appendChild(e);var t=e.contentWindow.fetch&&o(e.contentWindow.fetch);return document.head.removeChild(e),t}catch(e){console&&console.warn&&console.warn("failed to detect native fetch via iframe: "+e)}return!1}function o(e){return-1!==e.toString().indexOf("native")}function a(e){var t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/)||{};return{protocol:t[2],host:t[4],pathname:t[5]}}function l(e){var t=a(e),r=a(document.URL);return t.host&&t.protocol?t.protocol===r.protocol&&t.host===r.host?t.pathname:"".concat(t.protocol,"://").concat(t.host).concat(t.pathname):t.pathname}function c(e){try{var t=e.parentNode.childNodes,r=[];return Array.prototype.forEach.call(t,(function(t){t.tagName&&t.tagName===e.tagName&&r.push(t)})),r}catch(e){return[]}}function u(e,t){return e.length>t&&(e=e.substr(0,t)+"..."),e}function d(){var o,a="2.3.0",c={name:"honeybadger-js",url:"https://github.com/honeybadger-io/honeybadger-js",version:a,language:"javascript"},u=!1,d=!1,h=0;function p(e,t){var r={};for(var n in e)r[n]=e[n];for(var n in t)r[n]=t[n];return r}function m(t){if("object"!==e(t))return{};var r={};for(var n in t)r[n]=t[n];return r}function f(e,t){var r=p(e,t);return e.context&&t.context&&(r.context=p(e.context,t.context)),r}function g(e){return!!o&&o.name===e.name&&o.message===e.message&&o.stack===e.stack}function y(e,t){return!!Array.isArray(t)&&t.some((function(t){return t.test(e.message)}))}function b(t){if("object"===e(t)){var r=[];for(var n in t)r.push(n+"="+t[n]);return r.join(";")}}function v(e){return e.stacktrace||e.stack||void 0}function _(e){var t,r=10;if(e&&(t=v(e)))return{stack:t,generator:void 0};try{throw new Error("")}catch(e){if(t=v(e))return{stack:t,generator:"throw"}}t=["<call-stack>"];for(var n=arguments.callee;n&&t.length<r;){/function(?:\s+([\w$]+))+\s*\(/.test(n.toString())?t.push(RegExp.$1||"<anonymous>"):t.push("<anonymous>");try{n=n.caller}catch(e){break}}return{stack:t.join("\n"),generator:"walk"}}function x(e,t,r){var n,i;for(n=0,i=e.length;n<i;n++)if(!1===(0,e[n])(t,r))return!0;return!1}function w(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function R(e){return"function"!=typeof Object.isExtensible||Object.isExtensible(e)}var k=function(k){var j=1===(h+=1),z=!j,q=[],$=[],Z={context:{},beforeNotifyHandlers:[],afterNotifyHandlers:[],breadcrumbs:[],errorsSent:0,breadcrumbsEnabled:{dom:!0,network:!0,navigation:!0,console:!0}};if("object"===e(k))for(var X in k)Z[X]=k[X];function Y(){var e=window.console;if(e){var t=Array.prototype.slice.call(arguments);t.unshift("[Honeybadger]"),e.log.apply(e,t)}}function ee(){if(te("debug"))return Y.apply(this,arguments)}function te(e,t){var r=Z[e];return void 0===r&&(r=Z[e.toLowerCase()]),"false"===r&&(r=!1),void 0!==r?r:t}function re(){return!z&&te("onerror",!0)}function ne(){return!z&&te("onunhandledrejection",!0)}function ie(e){return!0===Z.breadcrumbsEnabled||(e?!0===Z.breadcrumbsEnabled[e]:!1!==Z.breadcrumbsEnabled)}function se(){return"http"+(te("ssl",!0)?"s":"")+"://"+te("host","api.honeybadger.io")}function oe(e,r){try{var n=le(r),i=new XMLHttpRequest;i.open("POST",se()+"/v1/notices/js",te("async",!0)),i.setRequestHeader("X-API-Key",e),i.setRequestHeader("Content-Type","application/json"),i.setRequestHeader("Accept","text/json, application/json"),i.send(JSON.stringify(t(n,te("max_depth",8)))),i.onload=function(){var e=Array.prototype.slice.call(Z.afterNotifyHandlers);if(r.afterNotify&&e.unshift(r.afterNotify),201!==i.status)return x(e,new Error("Bad HTTP response: ".concat(i.status)),r),void ee("Unable to send error report: ".concat(i.status,": ").concat(i.statusText),i,r);x(e,void 0,p(r,{id:JSON.parse(i.response).id})),ee("Error report sent",n)}}catch(e){x(Z.afterNotifyHandlers,e,r),Y("Unable to send error report: error while initializing request",e,r)}}function ae(e){if(o=null,te("disabled",!1))return ee("Dropping notice: honeybadger.js is disabled",e),!1;var t=te("apiKey",te("api_key"));return t?ge()?(ee("Dropping notice: max errors exceeded",e),!1):(fe(),oe(t,e),!0):(Y("Unable to send error report: no API key has been configured"),!1)}function le(t){var r={};return t.userAgent&&(r.HTTP_USER_AGENT=t.userAgent),t.referrer&&(r.HTTP_REFERER=t.referrer),"string"==typeof t.cookies?r.HTTP_COOKIE=t.cookies:"object"===e(t.cookies)&&(r.HTTP_COOKIE=b(t.cookies)),{notifier:c,breadcrumbs:{enabled:ie(),trail:t.breadcrumbs},error:{class:t.name,message:t.message,backtrace:t.stack,generator:t.generator,fingerprint:t.fingerprint},request:{url:t.url,component:t.component,action:t.action,context:t.context,cgi_data:r,params:t.params},server:{project_root:t.projectRoot,environment_name:t.environment,revision:t.revision}}}function ce(t,r){if(t||(t={}),"[object Error]"===Object.prototype.toString.call(t)){var n=t;t=p(t,{name:n.name,message:n.message,stack:v(n)})}if("object"!==e(t)){var i=String(t);t={message:i}}if(g(t))return!1;if(o&&u&&ae(o),w(t))return!1;var s;r&&(t.stack=r.stack,s=r.generator),t=p(t,{name:t.name||"Error",context:p(Z.context,t.context),url:t.url||document.URL,projectRoot:t.projectRoot||t.project_root||te("projectRoot",te("project_root",window.location.protocol+"//"+window.location.host)),environment:t.environment||te("environment"),component:t.component||te("component"),action:t.action||te("action"),revision:t.revision||te("revision"),userAgent:t.userAgent||navigator.userAgent,referrer:t.referrer||document.referrer}),Z.addBreadcrumb("Honeybadger Notice",{category:"notice",metadata:{message:t.message,name:t.name,stack:t.stack}}),t.breadcrumbs=Z.breadcrumbs.slice();var a=t.stack;return!x(Z.beforeNotifyHandlers,t)&&(t.stack!=a&&(s=void 0),!y(t,te("ignorePatterns"))&&(t.generator=s,o=t,u?(ee("Deferring notice",t),window.setTimeout((function(){g(t)&&ae(t)}))):(ee("Queuing notice",t),$.push(t)),t))}var ue=!0;if(window.atob||(ue=!1),window.ErrorEvent)try{0===new window.ErrorEvent("").colno&&(ue=!1)}catch(e){}function de(e,t){t||(t={});try{return"function"!=typeof e?e:R(e)?(e.___hb||(e.___hb=function(){var r=re();if(!(ue&&(r||t.force)||t.force&&!r))return e.apply(this,arguments);try{return e.apply(this,arguments)}catch(e){var n={stack:v(e)};throw Z.addBreadcrumb(t.component?"".concat(t.component,": ").concat(e.name):e.name,{category:"error",metadata:{message:e.message,name:e.name,stack:n.stack}}),ce(e,n),e}}),e.___hb.___hb=e.___hb,e.___hb):e}catch(t){return e}}Z.notify=function(t,r,n){if(t||(t={}),"[object Error]"===Object.prototype.toString.call(t)){var i=t;t=p(t,{name:i.name,message:i.message,stack:v(i)})}return"object"!==e(t)&&(t={message:String(t)}),r&&"object"!==e(r)&&(r={name:String(r)}),r&&(t=f(t,r)),"object"===e(n)&&(t=f(t,n)),ce(t,_(t))},Z.wrap=function(e){return de(e,{force:!0})},Z.setContext=function(t){return"object"===e(t)&&(Z.context=p(Z.context,t)),Z},Z.resetContext=function(t){return"object"===e(t)?Z.context=p({},t):Z.context={},Z},Z.configure=function(e){for(var t in e)Z[t]=e[t];return j&&!d&&(d=!0,pe.forEach((function(e){return e()}))),Z},Z.beforeNotify=function(e){return Z.beforeNotifyHandlers.push(e),Z},Z.afterNotify=function(e){return Z.afterNotifyHandlers.push(e),Z};var he=[].indexOf||function(e){for(var t=0,r=this.length;t<r;t++)if(t in this&&this[t]===e)return t;return-1};Z.reset=function(){for(var e in Z.context={},Z.beforeNotifyHandlers=[],Z.breadcrumbs=[],Z)-1==he.call(q,e)&&(Z[e]=void 0);return Z.resetMaxErrors(),Z},Z.resetMaxErrors=function(){return Z.errorsSent=0},Z.getVersion=function(){return a},Z.addBreadcrumb=function(e,t){if(ie()){var r=m((t=t||{}).metadata),n=t.category||"custom",i=(new Date).toISOString();Z.breadcrumbs.push({category:n,message:e,metadata:r,timestamp:i});var s=te("maxBreadcrumbs",40);return Z.breadcrumbs.length>s&&(Z.breadcrumbs=Z.breadcrumbs.slice(Z.breadcrumbs.length-s)),Z}};var pe=[];function me(e,t,r){if(!z&&e&&t&&r&&t in e){for(var n=e[t];n&&n.__hb_original;)n=n.__hb_original;e[t]=r(n),e[t].__hb_original=n}}function fe(){return Z.errorsSent++}function ge(){var e=te("maxErrors");return e&&Z.errorsSent>=e}for(var X in pe.push((function(){ie("dom")&&window.addEventListener("click",(function(e){var t,s,o;try{t=r(e.target),s=n(e.target),o=i(e.target)}catch(e){t="UI Click",s="[unknown]",o="[unknown]"}0!==t.length&&Z.addBreadcrumb(t,{category:"ui.click",metadata:{selector:s,text:o,event:e}})}),!0)})),pe.push((function(){ie("network")&&(me(XMLHttpRequest.prototype,"open",(function(e){return function(){var t=this,r=arguments[1],n="string"==typeof arguments[0]?arguments[0].toUpperCase():arguments[0],i="".concat(n," ").concat(l(r));this.__hb_xhr={type:"xhr",method:n,url:r,message:i},"function"==typeof e&&e.apply(t,arguments)}})),me(XMLHttpRequest.prototype,"send",(function(e){return function(){var t=this;function r(){var e;4===t.readyState&&(t.__hb_xhr&&(t.__hb_xhr.status_code=t.status,e=t.__hb_xhr.message,delete t.__hb_xhr.message),Z.addBreadcrumb(e||"XMLHttpRequest",{category:"request",metadata:t.__hb_xhr}))}"onreadystatechange"in t&&"function"==typeof t.onreadystatechange?me(t,"onreadystatechange",(function(e){return function(){r(),"function"==typeof e&&e.apply(this,arguments)}})):t.onreadystatechange=r,"function"==typeof e&&e.apply(t,arguments)}})))})),pe.push((function(){ie("network")&&s()&&me(window,"fetch",(function(e){return function(){var t,r=arguments[0],n="GET";"string"==typeof r?t=r:"Request"in window&&r instanceof Request?(t=r.url,r.method&&(n=r.method)):t=String(r),arguments[1]&&arguments[1].method&&(n=arguments[1].method),"string"==typeof n&&(n=n.toUpperCase());var i="".concat(n," ").concat(l(t)),s={type:"fetch",method:n,url:t};return e.apply(this,arguments).then((function(e){return s.status_code=e.status,Z.addBreadcrumb(i,{category:"request",metadata:s}),e})).catch((function(e){throw Z.addBreadcrumb("fetch error",{category:"error",metadata:s}),e}))}}))})),pe.push((function(){if(ie("navigation")){var e=window.location.href;me(window,"onpopstate",(function(r){return function(){if(t(e,window.location.href),r)return r.apply(this,arguments)}})),me(window.history,"pushState",r),me(window.history,"replaceState",r)}function t(t,r){e=r,Z.addBreadcrumb("Page changed",{category:"navigation",metadata:{from:t,to:r}})}function r(r){return function(){var n=arguments.length>2?arguments[2]:void 0;return n&&t(e,String(n)),r.apply(this,arguments)}}})),pe.push((function(){function e(e){return Array.isArray(e)?e.map((function(e){try{return String(e)}catch(e){return"[unknown]"}})).join(" "):""}ie("console")&&["debug","info","warn","error","log"].forEach((function(r){me(window.console,r,(function(n){return function(){var i=Array.prototype.slice.call(arguments),s=e(i),o={category:"log",metadata:{level:r,arguments:t(i,3)}};Z.addBreadcrumb(s,o),"function"==typeof n&&Function.prototype.apply.call(n,window.console,arguments)}}))}))})),function(){function e(e){return function(t){return function(r,n){if("function"==typeof r){var i=Array.prototype.slice.call(arguments,2);return r=de(r,e),t((function(){r.apply(null,i)}),n)}return t(r,n)}}}me(window,"setTimeout",e({component:"setTimeout"})),me(window,"setInterval",e({component:"setInterval"}))}(),"EventTarget Window Node ApplicationCache AudioTrackList ChannelMergerNode CryptoOperation EventSource FileReader HTMLUnknownElement IDBDatabase IDBRequest IDBTransaction KeyOperation MediaController MessagePort ModalWindow Notification SVGElementInstance Screen TextTrack TextTrackCue TextTrackList WebSocket WebSocketWorker Worker XMLHttpRequest XMLHttpRequestEventTarget XMLHttpRequestUpload".replace(/\w+/g,(function(e){var t=window[e]&&window[e].prototype;t&&t.hasOwnProperty&&t.hasOwnProperty("addEventListener")&&(me(t,"addEventListener",(function(t){var r={component:"".concat(e,".prototype.addEventListener")};return function(e,n,i,s){try{n&&null!=n.handleEvent&&(n.handleEvent=de(n.handleEvent,r))}catch(e){Y(e)}return t.call(this,e,de(n,r),i,s)}})),me(t,"removeEventListener",(function(e){return function(t,r,n,i){return e.call(this,t,r,n,i),e.call(this,t,de(r),n,i)}})))})),me(window,"onerror",(function(e){function t(e,t,r,n,i){if(ee("window.onerror callback invoked",arguments),!o&&re())if(0===r&&/Script error\.?/.test(e))Y("Ignoring cross-domain script error: enable CORS to track these types of errors",arguments);else{var s,a=[e,"\n    at ? (",t||"unknown",":",r||0,":",n||0,")"].join("");i?(s={stack:v(i)}).stack||(s={stack:a}):i={name:"window.onerror",message:e,stack:a},Z.addBreadcrumb("window.onerror"!==i.name&&i.name?"window.onerror: ".concat(i.name):"window.onerror",{category:"error",metadata:{message:i.message,name:i.name,stack:s?s.stack:i.stack}}),ce(i,s)}}return function(r,n,i,s,o){return t(r,n,i,s,o),!("function"!=typeof e||!te("_onerror_call_orig",!0))&&e.apply(this,arguments)}})),me(window,"onunhandledrejection",(function(e){function t(e){if(ee("window.onunhandledrejection callback invoked",arguments),!o&&ne()){var t=e.reason;if(t instanceof Error){var r=t.fileName||"unknown",n=t.lineNumber||0,i="".concat(t.message,"\n    at ? (").concat(r,":").concat(n,")"),s=v(t)||i,a={name:t.name,message:"UnhandledPromiseRejectionWarning: ".concat(t),stack:s};return Z.addBreadcrumb("window.onunhandledrejection: ".concat(a.name),{category:"error",metadata:a}),void ce(a)}var l="string"==typeof t?t:JSON.stringify(t);ce({name:"window.onunhandledrejection",message:"UnhandledPromiseRejectionWarning: ".concat(l)})}}return function(r){t(r),"function"==typeof e&&e.apply(this,arguments)}})),Z)q.push(X);if(ee("Initializing honeybadger.js "+a),/complete|interactive|loaded/.test(document.readyState))u=!0,ee("honeybadger.js "+a+" ready");else{ee("Installing ready handler");var ye=function(){var e;for(u=!0,ee("honeybadger.js "+a+" ready");e=$.pop();)ae(e)};document.addEventListener?document.addEventListener("DOMContentLoaded",ye,!0):window.attachEvent("onload",ye)}return Z};return k}var h=d(),p=h();return p.factory=h,p}()},58013:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>k});const n="undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function i(e,t,r,n){e.addEventListener?e.addEventListener(t,r,n):e.attachEvent&&e.attachEvent("on".concat(t),r)}function s(e,t,r,n){e.removeEventListener?e.removeEventListener(t,r,n):e.detachEvent&&e.detachEvent("on".concat(t),r)}function o(e,t){const r=t.slice(0,t.length-1);for(let t=0;t<r.length;t++)r[t]=e[r[t].toLowerCase()];return r}function a(e){"string"!=typeof e&&(e="");const t=(e=e.replace(/\s/g,"")).split(",");let r=t.lastIndexOf("");for(;r>=0;)t[r-1]+=",",t.splice(r,1),r=t.lastIndexOf("");return t}const l={backspace:8,"⌫":8,tab:9,clear:12,enter:13,"↩":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":n?173:189,"=":n?61:187,";":n?59:186,"'":222,"[":219,"]":221,"\\":220},c={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},u={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},d={16:!1,18:!1,17:!1,91:!1},h={};for(let e=1;e<20;e++)l["f".concat(e)]=111+e;let p=[],m=null,f="all";const g=new Map,y=e=>l[e.toLowerCase()]||c[e.toLowerCase()]||e.toUpperCase().charCodeAt(0);function b(e){f=e||"all"}function v(){return f||"all"}function _(e){if(void 0===e)Object.keys(h).forEach((e=>{Array.isArray(h[e])&&h[e].forEach((e=>x(e))),delete h[e]})),j(null);else if(Array.isArray(e))e.forEach((e=>{e.key&&x(e)}));else if("object"==typeof e)e.key&&x(e);else if("string"==typeof e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];let[i,s]=r;"function"==typeof i&&(s=i,i=""),x({key:e,scope:i,method:s,splitKey:"+"})}}const x=e=>{let{key:t,scope:r,method:n,splitKey:i="+"}=e;a(t).forEach((e=>{const t=e.split(i),s=t.length,a=t[s-1],l="*"===a?"*":y(a);if(!h[l])return;r||(r=v());const u=s>1?o(c,t):[],d=[];h[l]=h[l].filter((e=>{const t=(!n||e.method===n)&&e.scope===r&&function(e,t){const r=e.length>=t.length?e:t,n=e.length>=t.length?t:e;let i=!0;for(let e=0;e<r.length;e++)-1===n.indexOf(r[e])&&(i=!1);return i}(e.mods,u);return t&&d.push(e.element),!t})),d.forEach((e=>j(e)))}))};function w(e,t,r,n){if(t.element!==n)return;let i;if(t.scope===r||"all"===t.scope){i=t.mods.length>0;for(const e in d)Object.prototype.hasOwnProperty.call(d,e)&&(!d[e]&&t.mods.indexOf(+e)>-1||d[e]&&-1===t.mods.indexOf(+e))&&(i=!1);(0!==t.mods.length||d[16]||d[18]||d[17]||d[91])&&!i&&"*"!==t.shortcut||(t.keys=[],t.keys=t.keys.concat(p),!1===t.method(e,t)&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0)))}}function R(e,t){const r=h["*"];let n=e.keyCode||e.which||e.charCode;if(!k.filter.call(this,e))return;if(93!==n&&224!==n||(n=91),-1===p.indexOf(n)&&229!==n&&p.push(n),["ctrlKey","altKey","shiftKey","metaKey"].forEach((t=>{const r=u[t];e[t]&&-1===p.indexOf(r)?p.push(r):!e[t]&&p.indexOf(r)>-1?p.splice(p.indexOf(r),1):"metaKey"===t&&e[t]&&3===p.length&&(e.ctrlKey||e.shiftKey||e.altKey||(p=p.slice(p.indexOf(r))))})),n in d){d[n]=!0;for(const e in c)c[e]===n&&(k[e]=!0);if(!r)return}for(const t in d)Object.prototype.hasOwnProperty.call(d,t)&&(d[t]=e[u[t]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(-1===p.indexOf(17)&&p.push(17),-1===p.indexOf(18)&&p.push(18),d[17]=!0,d[18]=!0);const i=v();if(r)for(let n=0;n<r.length;n++)r[n].scope===i&&("keydown"===e.type&&r[n].keydown||"keyup"===e.type&&r[n].keyup)&&w(e,r[n],i,t);if(!(n in h))return;const s=h[n],o=s.length;for(let r=0;r<o;r++)if(("keydown"===e.type&&s[r].keydown||"keyup"===e.type&&s[r].keyup)&&s[r].key){const n=s[r],{splitKey:o}=n,a=n.key.split(o),l=[];for(let e=0;e<a.length;e++)l.push(y(a[e]));l.sort().join("")===p.sort().join("")&&w(e,n,i,t)}}function k(e,t,r){p=[];const n=a(e);let s=[],l="all",u=document,f=0,b=!1,v=!0,x="+",w=!1,j=!1;for(void 0===r&&"function"==typeof t&&(r=t),"[object Object]"===Object.prototype.toString.call(t)&&(t.scope&&(l=t.scope),t.element&&(u=t.element),t.keyup&&(b=t.keyup),void 0!==t.keydown&&(v=t.keydown),void 0!==t.capture&&(w=t.capture),"string"==typeof t.splitKey&&(x=t.splitKey),!0===t.single&&(j=!0)),"string"==typeof t&&(l=t),j&&_(e,l);f<n.length;f++)s=[],(e=n[f].split(x)).length>1&&(s=o(c,e)),(e="*"===(e=e[e.length-1])?"*":y(e))in h||(h[e]=[]),h[e].push({keyup:b,keydown:v,scope:l,mods:s,shortcut:n[f],method:r,key:n[f],splitKey:x,element:u});if(void 0!==u&&window){if(!g.has(u)){const e=function(){return R(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.event,u)},t=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.event;R(e,u),function(e){let t=e.keyCode||e.which||e.charCode;const r=p.indexOf(t);if(r>=0&&p.splice(r,1),e.key&&"meta"===e.key.toLowerCase()&&p.splice(0,p.length),93!==t&&224!==t||(t=91),t in d){d[t]=!1;for(const e in c)c[e]===t&&(k[e]=!1)}}(e)};g.set(u,{keydownListener:e,keyupListenr:t,capture:w}),i(u,"keydown",e,w),i(u,"keyup",t,w)}if(!m){const e=()=>{p=[]};m={listener:e,capture:w},i(window,"focus",e,w)}}}function j(e){const t=Object.values(h).flat();if(t.findIndex((t=>{let{element:r}=t;return r===e}))<0){const{keydownListener:t,keyupListenr:r,capture:n}=g.get(e)||{};t&&r&&(s(e,"keyup",r,n),s(e,"keydown",t,n),g.delete(e))}if(t.length<=0||g.size<=0){if(Object.keys(g).forEach((e=>{const{keydownListener:t,keyupListenr:r,capture:n}=g.get(e)||{};t&&r&&(s(e,"keyup",r,n),s(e,"keydown",t,n),g.delete(e))})),g.clear(),Object.keys(h).forEach((e=>delete h[e])),m){const{listener:e,capture:t}=m;s(window,"focus",e,t),m=null}}}const z={getPressedKeyString:function(){return p.map((e=>{return t=e,Object.keys(l).find((e=>l[e]===t))||(e=>Object.keys(c).find((t=>c[t]===e)))(e)||String.fromCharCode(e);var t}))},setScope:b,getScope:v,deleteScope:function(e,t){let r,n;e||(e=v());for(const t in h)if(Object.prototype.hasOwnProperty.call(h,t))for(r=h[t],n=0;n<r.length;)if(r[n].scope===e){r.splice(n,1).forEach((e=>{let{element:t}=e;return j(t)}))}else n++;v()===e&&b(t||"all")},getPressedKeyCodes:function(){return p.slice(0)},getAllKeyCodes:function(){const e=[];return Object.keys(h).forEach((t=>{h[t].forEach((t=>{let{key:r,scope:n,mods:i,shortcut:s}=t;e.push({scope:n,shortcut:s,mods:i,keys:r.split("+").map((e=>y(e)))})}))})),e},isPressed:function(e){return"string"==typeof e&&(e=y(e)),-1!==p.indexOf(e)},filter:function(e){const t=e.target||e.srcElement,{tagName:r}=t;let n=!0;const i="INPUT"===r&&!["checkbox","radio","range","button","file","reset","submit","color"].includes(t.type);return(t.isContentEditable||(i||"TEXTAREA"===r||"SELECT"===r)&&!t.readOnly)&&(n=!1),n},trigger:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all";Object.keys(h).forEach((r=>{h[r].filter((r=>r.scope===t&&r.shortcut===e)).forEach((e=>{e&&e.method&&e.method()}))}))},unbind:_,keyMap:l,modifier:c,modifierMap:u};for(const e in z)Object.prototype.hasOwnProperty.call(z,e)&&(k[e]=z[e]);if("undefined"!=typeof window){const e=window.hotkeys;k.noConflict=t=>(t&&window.hotkeys===k&&(window.hotkeys=e),k),window.hotkeys=k}},85530:function(e,t,r){var n,i;i=this,n=function(){return function(e){"use strict";var t=e&&e.I18n||{},r=Array.prototype.slice,n=function(e){return("0"+e.toString()).substr(-2)},i=function(e,t){return p("round",e,-t).toFixed(t)},s=function(e){var t=typeof e;return"function"===t||"object"===t},o=function(e){return"function"==typeof e},a=function(e){return null!=e},l=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===Object.prototype.toString.call(e)},c=function(e){return"string"==typeof e||"[object String]"===Object.prototype.toString.call(e)},u=function(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)},d=function(e){return!0===e||!1===e},h=function(e){return null===e},p=function(e,t,r){return void 0===r||0==+r?Math[e](t):(t=+t,r=+r,isNaN(t)||"number"!=typeof r||r%1!=0?NaN:(t=t.toString().split("e"),+((t=(t=Math[e](+(t[0]+"e"+(t[1]?+t[1]-r:-r)))).toString().split("e"))[0]+"e"+(t[1]?+t[1]+r:r))))},m=function(e,t){return o(e)?e(t):e},f=function(e,t){var r,n;for(r in t)t.hasOwnProperty(r)&&(n=t[r],c(n)||u(n)||d(n)||l(n)||h(n)?e[r]=n:(null==e[r]&&(e[r]={}),f(e[r],n)));return e},g={day_names:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbr_day_names:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],month_names:[null,"January","February","March","April","May","June","July","August","September","October","November","December"],abbr_month_names:[null,"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],meridian:["AM","PM"]},y={precision:3,separator:".",delimiter:",",strip_insignificant_zeros:!1},b={unit:"$",precision:2,format:"%u%n",sign_first:!0,delimiter:",",separator:"."},v={unit:"%",precision:3,format:"%n%u",separator:".",delimiter:""},_=[null,"kb","mb","gb","tb"],x={defaultLocale:"en",locale:"en",defaultSeparator:".",placeholder:/(?:\{\{|%\{)(.*?)(?:\}\}?)/gm,fallbacks:!1,translations:{},missingBehaviour:"message",missingTranslationPrefix:""};return t.reset=function(){var e;for(e in x)this[e]=x[e]},t.initializeOptions=function(){var e;for(e in x)a(this[e])||(this[e]=x[e])},t.initializeOptions(),t.locales={},t.locales.get=function(e){var r=this[e]||this[t.locale]||this.default;return o(r)&&(r=r(e)),!1===l(r)&&(r=[r]),r},t.locales.default=function(e){var r=[],n=[];return e&&r.push(e),!e&&t.locale&&r.push(t.locale),t.fallbacks&&t.defaultLocale&&r.push(t.defaultLocale),r.forEach((function(e){var r=e.split("-"),i=null,s=null;3===r.length?(i=[r[0],r[1]].join("-"),s=r[0]):2===r.length&&(i=r[0]),-1===n.indexOf(e)&&n.push(e),t.fallbacks&&[i,s].forEach((function(t){null!=t&&t!==e&&-1===n.indexOf(t)&&n.push(t)}))})),r.length||r.push("en"),n},t.pluralization={},t.pluralization.get=function(e){return this[e]||this[t.locale]||this.default},t.pluralization.default=function(e){switch(e){case 0:return["zero","other"];case 1:return["one"];default:return["other"]}},t.currentLocale=function(){return this.locale||this.defaultLocale},t.isSet=a,t.lookup=function(e,t){t=t||{};var r,n,i,s,o=this.locales.get(t.locale).slice();for(i=this.getFullScope(e,t);o.length;)if(r=o.shift(),n=i.split(t.separator||this.defaultSeparator),s=this.translations[r]){for(;n.length&&null!=(s=s[n.shift()]););if(null!=s)return s}if(a(t.defaultValue))return m(t.defaultValue,e)},t.pluralizationLookupWithoutFallback=function(e,t,r){var n,i,o=this.pluralization.get(t)(e);if(r&&s(r))for(;o.length;)if(n=o.shift(),a(r[n])){i=r[n];break}return i},t.pluralizationLookup=function(e,t,r){r=r||{};var n,i,o,l,c=this.locales.get(r.locale).slice();for(t=this.getFullScope(t,r);c.length;)if(n=c.shift(),i=t.split(r.separator||this.defaultSeparator),o=this.translations[n]){for(;i.length&&(o=o[i.shift()],s(o));)0===i.length&&(l=this.pluralizationLookupWithoutFallback(e,n,o));if(null!=l)break}return null==l&&a(r.defaultValue)&&(l=s(r.defaultValue)?this.pluralizationLookupWithoutFallback(e,r.locale,r.defaultValue):r.defaultValue,o=r.defaultValue),{message:l,translations:o}},t.meridian=function(){var e=this.lookup("time"),t=this.lookup("date");return e&&e.am&&e.pm?[e.am,e.pm]:t&&t.meridian?t.meridian:g.meridian},t.prepareOptions=function(){for(var e,t=r.call(arguments),n={};t.length;)if("object"==typeof(e=t.shift()))for(var i in e)e.hasOwnProperty(i)&&(a(n[i])||(n[i]=e[i]));return n},t.createTranslationOptions=function(e,t){var r=[{scope:e}];return a(t.defaults)&&(r=r.concat(t.defaults)),a(t.defaultValue)&&r.push({message:t.defaultValue}),r},t.translate=function(e,t){t=t||{};var r,n=this.createTranslationOptions(e,t),i=e,o=this.prepareOptions(t);return delete o.defaultValue,n.some((function(t){if(a(t.scope)?(i=t.scope,r=this.lookup(i,o)):a(t.message)&&(r=m(t.message,e)),null!=r)return!0}),this)?("string"==typeof r?r=this.interpolate(r,t):l(r)?r=r.map((function(e){return"string"==typeof e?this.interpolate(e,t):e}),this):s(r)&&a(t.count)&&(r=this.pluralize(t.count,i,t)),r):this.missingTranslation(e,t)},t.interpolate=function(e,t){if(null==e)return e;t=t||{};var r,n,i,s,o=e.match(this.placeholder);if(!o)return e;for(;o.length;)i=(r=o.shift()).replace(this.placeholder,"$1"),n=a(t[i])?t[i].toString().replace(/\$/gm,"_#$#_"):i in t?this.nullPlaceholder(r,e,t):this.missingPlaceholder(r,e,t),s=new RegExp(r.replace(/{/gm,"\\{").replace(/}/gm,"\\}")),e=e.replace(s,n);return e.replace(/_#\$#_/g,"$")},t.pluralize=function(e,t,r){var n,i;return r=this.prepareOptions({count:String(e)},r),void 0===(i=this.pluralizationLookup(e,t,r)).translations||null==i.translations?this.missingTranslation(t,r):void 0!==i.message&&null!=i.message?this.interpolate(i.message,r):(n=this.pluralization.get(r.locale),this.missingTranslation(t+"."+n(e)[0],r))},t.missingTranslation=function(e,t){if("guess"===this.missingBehaviour){var r=e.split(".").slice(-1)[0];return(this.missingTranslationPrefix.length>0?this.missingTranslationPrefix:"")+r.replace(/_/g," ").replace(/([a-z])([A-Z])/g,(function(e,t,r){return t+" "+r.toLowerCase()}))}return'[missing "'+[null!=t&&null!=t.locale?t.locale:this.currentLocale(),this.getFullScope(e,t)].join(t.separator||this.defaultSeparator)+'" translation]'},t.missingPlaceholder=function(e,t,r){return"[missing "+e+" value]"},t.nullPlaceholder=function(){return t.missingPlaceholder.apply(t,arguments)},t.toNumber=function(e,t){t=this.prepareOptions(t,this.lookup("number.format"),y);var r,n,s=e<0,o=i(Math.abs(e),t.precision).toString().split("."),a=[],l=t.format||"%n",c=s?"-":"";for(e=o[0],r=o[1];e.length>0;)a.unshift(e.substr(Math.max(0,e.length-3),3)),e=e.substr(0,e.length-3);return n=a.join(t.delimiter),t.strip_insignificant_zeros&&r&&(r=r.replace(/0+$/,"")),t.precision>0&&r&&(n+=t.separator+r),n=(l=t.sign_first?"%s"+l:l.replace("%n","%s%n")).replace("%u",t.unit).replace("%n",n).replace("%s",c)},t.toCurrency=function(e,t){return t=this.prepareOptions(t,this.lookup("number.currency.format",t),this.lookup("number.format",t),b),this.toNumber(e,t)},t.localize=function(e,t,r){switch(r||(r={}),e){case"currency":return this.toCurrency(t,r);case"number":return e=this.lookup("number.format",r),this.toNumber(t,e);case"percentage":return this.toPercentage(t,r);default:var n;return n=e.match(/^(date|time)/)?this.toTime(e,t,r):t.toString(),this.interpolate(n,r)}},t.parseDate=function(e){var t,r,n;if(null==e)return e;if("object"==typeof e)return e;if(t=e.toString().match(/(\d{4})-(\d{2})-(\d{2})(?:[ T](\d{2}):(\d{2}):(\d{2})([\.,]\d{1,3})?)?(Z|\+00:?00)?/)){for(var i=1;i<=6;i++)t[i]=parseInt(t[i],10)||0;t[2]-=1,n=t[7]?1e3*("0"+t[7]):null,r=t[8]?new Date(Date.UTC(t[1],t[2],t[3],t[4],t[5],t[6],n)):new Date(t[1],t[2],t[3],t[4],t[5],t[6],n)}else"number"==typeof e?(r=new Date).setTime(e):e.match(/([A-Z][a-z]{2}) ([A-Z][a-z]{2}) (\d+) (\d+:\d+:\d+) ([+-]\d+) (\d+)/)?(r=new Date).setTime(Date.parse([RegExp.$1,RegExp.$2,RegExp.$3,RegExp.$6,RegExp.$4,RegExp.$5].join(" "))):(e.match(/\d+ \d+:\d+:\d+ [+-]\d+ \d+/),(r=new Date).setTime(Date.parse(e)));return r},t.strftime=function(e,r,i){i=this.lookup("date",i);var s=t.meridian();if(i||(i={}),i=this.prepareOptions(i,g),isNaN(e.getTime()))throw new Error("I18n.strftime() requires a valid date object, but received an invalid date.");var o=e.getDay(),a=e.getDate(),l=e.getFullYear(),c=e.getMonth()+1,u=e.getHours(),d=u,h=u>11?1:0,p=e.getSeconds(),m=e.getMinutes(),f=e.getTimezoneOffset(),y=Math.floor(Math.abs(f/60)),b=Math.abs(f)-60*y,v=(f>0?"-":"+")+(y.toString().length<2?"0"+y:y)+(b.toString().length<2?"0"+b:b);return d>12?d-=12:0===d&&(d=12),r=(r=(r=(r=(r=(r=(r=(r=(r=(r=(r=(r=(r=(r=(r=(r=(r=(r=(r=(r=(r=(r=(r=(r=(r=(r=(r=r.replace("%a",i.abbr_day_names[o])).replace("%A",i.day_names[o])).replace("%b",i.abbr_month_names[c])).replace("%B",i.month_names[c])).replace("%d",n(a))).replace("%e",a)).replace("%-d",a)).replace("%H",n(u))).replace("%-H",u)).replace("%k",u)).replace("%I",n(d))).replace("%-I",d)).replace("%l",d)).replace("%m",n(c))).replace("%-m",c)).replace("%M",n(m))).replace("%-M",m)).replace("%p",s[h])).replace("%P",s[h].toLowerCase())).replace("%S",n(p))).replace("%-S",p)).replace("%w",o)).replace("%y",n(l))).replace("%-y",n(l).replace(/^0+/,""))).replace("%Y",l)).replace("%z",v)).replace("%Z",v)},t.toTime=function(e,t,r){var n=this.parseDate(t),i=this.lookup(e,r);if(null==n)return n;var s=n.toString();return s.match(/invalid/i)?s:i?this.strftime(n,i,r):s},t.toPercentage=function(e,t){return t=this.prepareOptions(t,this.lookup("number.percentage.format",t),this.lookup("number.format",t),v),this.toNumber(e,t)},t.toHumanSize=function(e,t){for(var r,n,i,s=1024,o=e,a=0;o>=s&&a<4;)o/=s,a+=1;return 0===a?(i=this.getFullScope("number.human.storage_units.units.byte",t),r=this.t(i,{count:o}),n=0):(i=this.getFullScope("number.human.storage_units.units."+_[a],t),r=this.t(i),n=o-Math.floor(o)==0?0:1),t=this.prepareOptions(t,{unit:r,precision:n,format:"%n%u",delimiter:""}),this.toNumber(o,t)},t.getFullScope=function(e,t){return t=t||{},l(e)&&(e=e.join(t.separator||this.defaultSeparator)),t.scope&&(e=[t.scope,e].join(t.separator||this.defaultSeparator)),e},t.extend=function(e,t){return void 0===e&&void 0===t?{}:f(e,t)},t.t=t.translate.bind(t),t.l=t.localize.bind(t),t.p=t.pluralize.bind(t),t}(i)}.call(t,r,t,e),void 0===n||(e.exports=n)},55962:(e,t,r)=>{"use strict";var n=r(85930)(),i=r(51281)("Object.prototype.toString"),s=function(e){return!(n&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===i(e)},o=function(e){return!!s(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"[object Function]"===i(e.callee)},a=function(){return s(arguments)}();s.isLegacyArguments=o,e.exports=a?s:o},70118:(e,t,r)=>{"use strict";var n=Date.prototype.getDay,i=Object.prototype.toString,s=r(85930)();e.exports=function(e){return"object"==typeof e&&null!==e&&(s?function(e){try{return n.call(e),!0}catch(e){return!1}}(e):"[object Date]"===i.call(e))}},21617:(e,t,r)=>{"use strict";var n,i,s,o,a=r(51281),l=r(85930)();if(l){n=a("Object.prototype.hasOwnProperty"),i=a("RegExp.prototype.exec"),s={};var c=function(){throw s};o={toString:c,valueOf:c},"symbol"==typeof Symbol.toPrimitive&&(o[Symbol.toPrimitive]=c)}var u=a("Object.prototype.toString"),d=Object.getOwnPropertyDescriptor;e.exports=l?function(e){if(!e||"object"!=typeof e)return!1;var t=d(e,"lastIndex");if(!(t&&n(t,"value")))return!1;try{i(e,o)}catch(e){return e===s}}:function(e){return!(!e||"object"!=typeof e&&"function"!=typeof e)&&"[object RegExp]"===u(e)}},28214:e=>{e.exports=function e(t,r){"use strict";var n,i,s=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,o=/(^[ ]*|[ ]*$)/g,a=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,l=/^0x[0-9a-f]+$/i,c=/^0/,u=function(t){return e.insensitive&&(""+t).toLowerCase()||""+t},d=u(t).replace(o,"")||"",h=u(r).replace(o,"")||"",p=d.replace(s,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),m=h.replace(s,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),f=parseInt(d.match(l),16)||1!==p.length&&d.match(a)&&Date.parse(d),g=parseInt(h.match(l),16)||f&&h.match(a)&&Date.parse(h)||null;if(g){if(f<g)return-1;if(f>g)return 1}for(var y=0,b=Math.max(p.length,m.length);y<b;y++){if(n=!(p[y]||"").match(c)&&parseFloat(p[y])||p[y]||0,i=!(m[y]||"").match(c)&&parseFloat(m[y])||m[y]||0,isNaN(n)!==isNaN(i))return isNaN(n)?1:-1;if(typeof n!=typeof i&&(n+="",i+=""),n<i)return-1;if(n>i)return 1}return 0}},97436:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Math,n=Math.pow(2,-52),i=function(){return function(e,t){this.real=e,this.imag=t}}();function s(e){var t=r.floor(e),n=r.ceil(e),i=Math.abs(e-t),s=Math.abs(e-n);return i>s?s:i}function o(e,t,r,n,i){var s=t*e,o=s+r,a=o*e+n;return{Q:a*e+i,dQ:(s+o)*e+a,B1:o,C2:a}}function a(e,t,n){var o=-t/2,a=function(e,t,n){var i=e,o=t,a=n;if(0===r.abs(r.floor(e)-e)&&0===r.abs(r.floor(o)-o)&&0===r.abs(r.floor(n)-n)){i*a>0&&(i=r.abs(e),a=r.abs(n));var l=!1;do{if(l=!1,i<a){var c=i;i=a,a=c}var u=s(o/a);if(0!==u){var d=i-u*o;d>=-i&&(i=d-u*(o-=u*a))>0&&(l=!0)}}while(l)}return o*o-i*a}(e,o,n),l=0,c=0,u=0,d=0;if(a<0){var h=o/e,p=r.sqrt(-a)/e;l=h,c=p,u=h,d=-p}else{c=0,d=0;var m=o+r.sign(o)*r.sqrt(a);0===m?(l=n/e,u=-n/e):(l=n/m,u=m/e)}return[new i(l,c),new i(u,d)]}t.getLinearRoot=function(e,t){return 0!==e?[new i(-t/e,0)]:[]},t.getQuadraticRoots=function(e,t,r){return a(e,t,r)},t.getCubicRoots=function(e,t,s,l){var c,u,d,h;if(0===e)u=t,d=s,h=l;else if(0===l)c=0,u=e,d=t,h=s;else{u=e;var p=o(c=-t/e/3,e,t,s,l),m=p.Q,f=p.dQ;d=p.B1,h=p.C2;var g=m/e,y=r.pow(r.abs(g),1/3),b=r.sign(g);(g=-f/e)>0&&(y=1.324717957244746*r.max(y,r.sqrt(g)));var v=c-b*y;if(v!==c){var _=1+100*n;do{m=(p=o(c=v,e,t,s,l)).Q,f=p.dQ,d=p.B1,h=p.C2,v=0===f?c:c-m/f/_}while(b*v>b*c);r.abs(e)*c*c>r.abs(l/c)&&(d=((h=-l/c)-s)/c)}}var x=[];void 0!==c&&x.push(new i(c,0));var w=a(u,d,h);return x.concat(w)},t.getQuarticRoots=function(e,n,i,s,o){if(0===e)return t.getCubicRoots(n,i,s,o);var a=(i-3*n*n/(8*e))/e,l=(s-n*i/(2*e)+n*n*n/(8*e*e))/e,c=(o-n*s/(4*e)+n*n*i/(16*e*e)-3*n*n*n*n/(256*e*e*e))/e,u=function(e,t){void 0===t&&(t=1e-14);var n=[];return e.forEach((function(e){n.reduce((function(n,i){return n||r.abs(i.real-e.real)<t&&r.abs(i.imag-e.imag)<t}),!1)||n.push(e)})),n}(t.getCubicRoots(1,2*a,a*a-4*c,-l*l).filter((function(e){return 0===e.imag})).map((function(e){return e.real})).filter((function(e){return e>0})).reduce((function(e,t){var r=Math.sqrt(t),n=-r,i=.5*(a+t),s=i-l/(2*r),o=i-l/(2*n);return e.push({m:r,n:s}),e.push({m:n,n:o}),e}),[]).reduce((function(e,r){var n=r.m,i=r.n,s=t.getQuadraticRoots(1,n,i);e.push.apply(e,s);var o=t.getQuadraticRoots(1,-n,c/i);return e.push.apply(e,o),e}),[]));return u.forEach((function(t){t.real+=-n/(4*e)})),u}},88078:(e,t,r)=>{"use strict";r.r(t),r.d(t,{MobXProviderContext:()=>ze,Observer:()=>ObserverComponent,PropTypes:()=>rt,Provider:()=>Provider,disposeOnUnmount:()=>Xe,inject:()=>We,isUsingStaticRendering:()=>f,observer:()=>je,observerBatching:()=>h,useAsObservableSource:()=>te,useLocalStore:()=>re,useObserver:()=>q,useStaticRendering:()=>m});var n=r(63737),i=r(23770);if(!i.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!n.spy)throw new Error("mobx-react-lite requires mobx at least version 4 to be available");var s=r(47723),o=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return o};function a(){var e=o((0,i.useState)(0),2)[1];return(0,i.useCallback)((function(){e((function(e){return e+1}))}),[])}var l={};var c,u=(c="observerBatching","function"==typeof Symbol?Symbol.for(c):"__$mobx-react "+c+"__");function d(e){e()}function h(e){e||(e=d),(0,n.configure)({reactionScheduler:e}),("undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:l)[u]=!0}var p=!1;function m(e){p=e}function f(){return p}function g(e){return(0,n.getDependencyTree)(e)}var y,b=1e4,v=1e4,_=new Set;function x(){void 0===y&&(y=setTimeout(w,v))}function w(){y=void 0;var e=Date.now();_.forEach((function(t){var r=t.current;r&&e>=r.cleanAt&&(r.reaction.dispose(),t.current=null,_.delete(t))})),_.size>0&&x()}var R=!1,k=[];var j={};function z(e){return"observer"+e}function q(e,t,r){if(void 0===t&&(t="observed"),void 0===r&&(r=j),f())return e();var s,o=function(e){return function(){R?k.push(e):e()}}((r.useForceUpdate||a)()),l=i.useRef(null);if(!l.current){var c=new n.Reaction(z(t),(function(){u.mounted?o():(c.dispose(),l.current=null)})),u=function(e){return{cleanAt:Date.now()+b,reaction:e}}(c);l.current=u,s=l,_.add(s),x()}var d=l.current.reaction;return i.useDebugValue(d,g),i.useEffect((function(){var e;return e=l,_.delete(e),l.current?l.current.mounted=!0:(l.current={reaction:new n.Reaction(z(t),(function(){o()})),cleanAt:1/0},o()),function(){l.current.reaction.dispose(),l.current=null}}),[]),function(e){R=!0,k=[];try{var t=e();R=!1;var r=k.length>0?k:void 0;return i.useLayoutEffect((function(){r&&r.forEach((function(e){return e()}))}),[r]),t}finally{R=!1}}((function(){var t,r;if(d.track((function(){try{t=e()}catch(e){r=e}})),r)throw r;return t}))}var $=function(){return $=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},$.apply(this,arguments)};function Z(e,t){if(f())return e;var r,n,s,o=$({forwardRef:!1},t),a=e.displayName||e.name,l=function(t,r){return q((function(){return e(t,r)}),a)};return l.displayName=a,r=o.forwardRef?(0,i.memo)((0,i.forwardRef)(l)):(0,i.memo)(l),n=e,s=r,Object.keys(n).forEach((function(e){X[e]||Object.defineProperty(s,e,Object.getOwnPropertyDescriptor(n,e))})),r.displayName=a,r}var X={$$typeof:!0,render:!0,compare:!0,type:!0};function ObserverComponent(e){var t=e.children,r=e.render,n=t||r;return"function"!=typeof n?null:q(n)}function ObserverPropsCheck(e,t,r,n,i){var s="children"===t?"render":"children",o="function"==typeof e[t],a="function"==typeof e[s];return o&&a?new Error("MobX Observer: Do not use children and render in the same time in`"+r):o||a?null:new Error("Invalid prop `"+i+"` of type `"+typeof e[t]+"` supplied to `"+r+"`, expected `function`.")}ObserverComponent.propTypes={children:ObserverPropsCheck,render:ObserverPropsCheck},ObserverComponent.displayName="Observer";var Y=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return o};function ee(e,t){if(!t||void 0!==e){0;var r=Y(i.useState((function(){return(0,n.observable)(e,{},{deep:!1})})),1)[0];return(0,n.runInAction)((function(){Object.assign(r,e)})),r}}function te(e){return ee(e,!1)}function re(e,t){var r=ee(t,!0);return i.useState((function(){var t=(0,n.observable)(e(r));return function(e){if(!e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);return!t||t===Object.prototype}(t)&&(0,n.runInAction)((function(){Object.keys(t).forEach((function(e){var r,i,s=t[e];"function"==typeof s&&(t[e]=(r=s,i=t,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(0,n.transaction)((function(){return r.apply(i,e)}))}))}))})),t}))[0]}h(s.unstable_batchedUpdates);var ne=0;var ie={};function se(e){return ie[e]||(ie[e]=function(e){if("function"==typeof Symbol)return Symbol(e);var t="__$mobx-react "+e+" ("+ne+")";return ne++,t}(e)),ie[e]}function oe(e,t){if(ae(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(var i=0;i<r.length;i++)if(!Object.hasOwnProperty.call(t,r[i])||!ae(e[r[i]],t[r[i]]))return!1;return!0}function ae(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}var le={$$typeof:1,render:1,compare:1,type:1,childContextTypes:1,contextType:1,contextTypes:1,defaultProps:1,getDefaultProps:1,getDerivedStateFromError:1,getDerivedStateFromProps:1,mixins:1,propTypes:1};function ce(e,t,r){Object.hasOwnProperty.call(e,t)?e[t]=r:Object.defineProperty(e,t,{enumerable:!1,configurable:!0,writable:!0,value:r})}var ue=se("patchMixins"),de=se("patchedDefinition");function he(e,t){for(var r=this,n=arguments.length,i=new Array(n>2?n-2:0),s=2;s<n;s++)i[s-2]=arguments[s];t.locks++;try{var o;return null!=e&&(o=e.apply(this,i)),o}finally{t.locks--,0===t.locks&&t.methods.forEach((function(e){e.apply(r,i)}))}}function pe(e,t){return function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];he.call.apply(he,[this,e,t].concat(n))}}function me(e,t,r){var n=function(e,t){var r=e[ue]=e[ue]||{},n=r[t]=r[t]||{};return n.locks=n.locks||0,n.methods=n.methods||[],n}(e,t);n.methods.indexOf(r)<0&&n.methods.push(r);var i=Object.getOwnPropertyDescriptor(e,t);if(!i||!i[de]){var s=e[t],o=fe(e,t,i?i.enumerable:void 0,n,s);Object.defineProperty(e,t,o)}}function fe(e,t,r,n,i){var s,o=pe(i,n);return(s={})[de]=!0,s.get=function(){return o},s.set=function(i){if(this===e)o=pe(i,n);else{var s=fe(this,t,r,n,i);Object.defineProperty(this,t,s)}},s.configurable=!0,s.enumerable=r,s}var ge=n.$mobx||"$mobx",ye=se("isMobXReactObserver"),be=se("isUnmounted"),ve=se("skipRender"),_e=se("isForcingUpdate");function xe(e){var t=e.prototype;if(e[ye]){var r=we(t);console.warn("The provided component class ("+r+") \n                has already been declared as an observer component.")}else e[ye]=!0;if(t.componentWillReact)throw new Error("The componentWillReact life-cycle event is no longer supported");if(e.__proto__!==i.PureComponent)if(t.shouldComponentUpdate){if(t.shouldComponentUpdate!==Pe)throw new Error("It is not allowed to use shouldComponentUpdate in observer based components.")}else t.shouldComponentUpdate=Pe;Te(t,"props"),Te(t,"state");var n=t.render;return t.render=function(){return Se.call(this,n)},me(t,"componentWillUnmount",(function(){var e;if(!0!==f()&&(null===(e=this.render[ge])||void 0===e||e.dispose(),this[be]=!0,!this.render[ge])){var t=we(this);console.warn("The reactive render of an observer class component ("+t+") \n                was overriden after MobX attached. This may result in a memory leak if the \n                overriden reactive render was not properly disposed.")}})),e}function we(e){return e.displayName||e.name||e.constructor&&(e.constructor.displayName||e.constructor.name)||"<component>"}function Se(e){var t=this;if(!0===f())return e.call(this);ce(this,ve,!1),ce(this,_e,!1);var r=we(this),s=e.bind(this),o=!1,a=new n.Reaction(r+".render()",(function(){if(!o&&(o=!0,!0!==t[be])){var e=!0;try{ce(t,_e,!0),t[ve]||i.Component.prototype.forceUpdate.call(t),e=!1}finally{ce(t,_e,!1),e&&a.dispose()}}}));function l(){o=!1;var e=void 0,t=void 0;if(a.track((function(){try{t=(0,n._allowStateChanges)(!1,s)}catch(t){e=t}})),e)throw e;return t}return a.reactComponent=this,l[ge]=a,this.render=l,l.call(this)}function Pe(e,t){return f()&&console.warn("[mobx-react] It seems that a re-rendering of a React component is triggered while in static (server-side) mode. Please make sure components are rendered only once server-side."),this.state!==t||!oe(this.props,e)}function Te(e,t){var r=se("reactProp_"+t+"_valueHolder"),i=se("reactProp_"+t+"_atomHolder");function s(){return this[i]||ce(this,i,(0,n.createAtom)("reactive "+t)),this[i]}Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){var e=!1;return n._allowStateReadsStart&&n._allowStateReadsEnd&&(e=(0,n._allowStateReadsStart)(!0)),s.call(this).reportObserved(),n._allowStateReadsStart&&n._allowStateReadsEnd&&(0,n._allowStateReadsEnd)(e),this[r]},set:function(e){this[_e]||oe(this[r],e)?ce(this,r,e):(ce(this,r,e),ce(this,ve,!0),s.call(this).reportChanged(),ce(this,ve,!1))}})}var Re="function"==typeof Symbol&&Symbol.for,ke=Re?Symbol.for("react.forward_ref"):"function"==typeof i.forwardRef&&(0,i.forwardRef)((function(e){return null})).$$typeof,Ie=Re?Symbol.for("react.memo"):"function"==typeof i.memo&&(0,i.memo)((function(e){return null})).$$typeof;function je(e){if(!0===e.isMobxInjector&&console.warn("Mobx observer: You are trying to use 'observer' on a component that already has 'inject'. Please apply 'observer' before applying 'inject'"),Ie&&e.$$typeof===Ie)throw new Error("Mobx observer: You are trying to use 'observer' on a function component wrapped in either another observer or 'React.memo'. The observer already applies 'React.memo' for you.");if(ke&&e.$$typeof===ke){var t=e.render;if("function"!=typeof t)throw new Error("render property of ForwardRef was not a function");return(0,i.forwardRef)((function(){var e=arguments;return(0,i.createElement)(ObserverComponent,null,(function(){return t.apply(void 0,e)}))}))}return"function"!=typeof e||e.prototype&&e.prototype.render||e.isReactClass||Object.prototype.isPrototypeOf.call(i.Component,e)?xe(e):Z(e)}function He(){return He=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},He.apply(this,arguments)}var ze=i.createContext({});function Provider(e){var t=e.children,r=function(e,t){if(null==e)return{};var r,n,i={},s=Object.keys(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,["children"]),n=i.useContext(ze),s=i.useRef(He({},n,r)).current;return i.createElement(ze.Provider,{value:s},t)}function Ge(e,t,r,n){var s,o,a,l=i.forwardRef((function(r,n){var s=He({},r),o=i.useContext(ze);return Object.assign(s,e(o||{},s)||{}),n&&(s.ref=n),i.createElement(t,s)}));return n&&(l=je(l)),l.isMobxInjector=!0,s=t,o=l,a=Object.getOwnPropertyNames(Object.getPrototypeOf(s)),Object.getOwnPropertyNames(s).forEach((function(e){le[e]||-1!==a.indexOf(e)||Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(s,e))})),l.wrappedComponent=t,l.displayName=function(e,t){var r,n=e.displayName||e.name||e.constructor&&e.constructor.name||"Component";r=t?"inject-with-"+t+"("+n+")":"inject("+n+")";return r}(t,r),l}function We(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if("function"==typeof arguments[0]){var n=arguments[0];return function(e){return Ge(n,e,n.name,!0)}}return function(e){return Ge(function(e){return function(t,r){return e.forEach((function(e){if(!(e in r)){if(!(e in t))throw new Error("MobX injector: Store '"+e+"' is not available! Make sure it is provided by some Provider");r[e]=t[e]}})),r}}(t),e,t.join("-"),!1)}}Provider.displayName="MobXProvider";var Ve=se("disposeOnUnmountProto"),qe=se("disposeOnUnmountInst");function $e(){var e=this;[].concat(this[Ve]||[],this[qe]||[]).forEach((function(t){var r="string"==typeof t?e[t]:t;null!=r&&(Array.isArray(r)?r.map((function(e){return e()})):r())}))}function Xe(e,t){if(Array.isArray(t))return t.map((function(t){return Xe(e,t)}));var r=Object.getPrototypeOf(e).constructor,n=Object.getPrototypeOf(e.constructor),s=Object.getPrototypeOf(Object.getPrototypeOf(e));if(r!==i.Component&&r!==i.PureComponent&&n!==i.Component&&n!==i.PureComponent&&s!==i.Component&&s!==i.PureComponent)throw new Error("[mobx-react] disposeOnUnmount only supports direct subclasses of React.Component or React.PureComponent.");if("string"!=typeof t&&"function"!=typeof t&&!Array.isArray(t))throw new Error("[mobx-react] disposeOnUnmount only works if the parameter is either a property key or a function.");var o="string"==typeof t,a=!!e[Ve]||!!e[qe];return(o?e[Ve]||(e[Ve]=[]):e[qe]||(e[qe]=[])).push(t),a||me(e,"componentWillUnmount",$e),"string"!=typeof t?t:void 0}function Ye(e){function t(t,r,i,s,o,a){for(var l=arguments.length,c=new Array(l>6?l-6:0),u=6;u<l;u++)c[u-6]=arguments[u];return(0,n.untracked)((function(){if(s=s||"<<anonymous>>",a=a||i,null==r[i]){if(t){var n=null===r[i]?"null":"undefined";return new Error("The "+o+" `"+a+"` is marked as required in `"+s+"`, but its value is `"+n+"`.")}return null}return e.apply(void 0,[r,i,s,o,a].concat(c))}))}var r=t.bind(null,!1);return r.isRequired=t.bind(null,!0),r}function Qe(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||"Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol}(t,e)?"symbol":t}function et(e,t){return Ye((function(r,i,s,o,a){return(0,n.untracked)((function(){if(e&&Qe(r[i])===t.toLowerCase())return null;var o;switch(t){case"Array":o=n.isObservableArray;break;case"Object":o=n.isObservableObject;break;case"Map":o=n.isObservableMap;break;default:throw new Error("Unexpected mobxType: "+t)}var l=r[i];if(!o(l)){var c=function(e){var t=Qe(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}(l),u=e?" or javascript `"+t.toLowerCase()+"`":"";return new Error("Invalid prop `"+a+"` of type `"+c+"` supplied to `"+s+"`, expected `mobx.Observable"+t+"`"+u+".")}return null}))}))}function tt(e,t){return Ye((function(r,i,s,o,a){for(var l=arguments.length,c=new Array(l>5?l-5:0),u=5;u<l;u++)c[u-5]=arguments[u];return(0,n.untracked)((function(){if("function"!=typeof t)return new Error("Property `"+a+"` of component `"+s+"` has invalid PropType notation.");var n=et(e,"Array")(r,i,s,o,a);if(n instanceof Error)return n;for(var l=r[i],u=0;u<l.length;u++)if((n=t.apply(void 0,[l,u,s,o,a+"["+u+"]"].concat(c)))instanceof Error)return n;return null}))}))}var rt={observableArray:et(!1,"Array"),observableArrayOf:tt.bind(null,!1),observableMap:et(!1,"Map"),observableObject:et(!1,"Object"),arrayOrObservableArray:et(!0,"Array"),arrayOrObservableArrayOf:tt.bind(null,!0),objectOrObservableObject:et(!0,"Object")};if(!i.Component)throw new Error("mobx-react requires React to be available");if(!n.observable)throw new Error("mobx-react requires mobx to be available")},63737:(e,t,r)=>{"use strict";r.r(t),r.d(t,{$mobx:()=>w,FlowCancellationError:()=>FlowCancellationError,IDerivationState:()=>ve,ObservableMap:()=>Qr,ObservableSet:()=>rn,Reaction:()=>Rt,_allowStateChanges:()=>ot,_allowStateChangesInsideComputed:()=>ct,_allowStateReadsEnd:()=>Xe,_allowStateReadsStart:()=>$e,_endAction:()=>st,_getAdministration:()=>pn,_getGlobalState:()=>wt,_interceptReads:()=>hr,_isComputingDerivation:()=>je,_resetGlobalState:()=>St,_startAction:()=>it,action:()=>zt,autorun:()=>qt,comparer:()=>z,computed:()=>Te,configure:()=>Qt,createAtom:()=>j,decorate:()=>er,entries:()=>wr,extendObservable:()=>tr,flow:()=>ur,get:()=>Mr,getAtom:()=>hn,getDebugName:()=>mn,getDependencyTree:()=>ir,getObserverTree:()=>or,has:()=>Er,intercept:()=>pr,isAction:()=>Wt,isArrayLike:()=>f,isBoxedObservable:()=>dt,isComputed:()=>fr,isComputedProp:()=>gr,isFlowCancellationError:()=>cr,isObservable:()=>br,isObservableArray:()=>Xr,isObservableMap:()=>en,isObservableObject:()=>dn,isObservableProp:()=>vr,isObservableSet:()=>nn,keys:()=>_r,observable:()=>ye,observe:()=>Cr,onBecomeObserved:()=>Xt,onBecomeUnobserved:()=>Yt,onReactionError:()=>Lt,reaction:()=>Kt,remove:()=>Pr,runInAction:()=>Gt,set:()=>Sr,spy:()=>jt,toJS:()=>Or,trace:()=>Rr,transaction:()=>Lr,untracked:()=>We,values:()=>xr,when:()=>kr});var n="An invariant failed, however the error is obfuscated because this is a production build.",i=[];Object.freeze(i);var s={};function o(){return++xt.mobxGuid}function a(e){throw l(!1,e),"X"}function l(e,t){if(!e)throw new Error("[mobx] "+(t||n))}Object.freeze(s);function c(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var u=function(){};function d(e){return null!==e&&"object"==typeof e}function h(e){if(null===e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function p(e,t,r){Object.defineProperty(e,t,{enumerable:!1,writable:!0,configurable:!0,value:r})}function m(e,t){var r="isMobX"+e;return t.prototype[r]=!0,function(e){return d(e)&&!0===e[r]}}function f(e){return Array.isArray(e)||Xr(e)}function g(e){return e instanceof Map}function y(e){return e instanceof Set}function b(e){var t=new Set;for(var r in e)t.add(r);return Object.getOwnPropertySymbols(e).forEach((function(r){Object.getOwnPropertyDescriptor(e,r).enumerable&&t.add(r)})),Array.from(t)}function v(e){return e&&e.toString?e.toString():new String(e).toString()}function _(e){return null===e?null:"object"==typeof e?""+e:e}var x="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,w=Symbol("mobx administration"),R=function(){function Atom2(e){void 0===e&&(e="Atom@"+o()),this.name=e,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers=new Set,this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=ve.NOT_TRACKING}return Atom2.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach((function(e){return e()}))},Atom2.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach((function(e){return e()}))},Atom2.prototype.reportObserved=function(){return Tt(this)},Atom2.prototype.reportChanged=function(){Ct(),function(e){if(e.lowestObserverState===ve.STALE)return;e.lowestObserverState=ve.STALE,e.observers.forEach((function(t){t.dependenciesState===ve.UP_TO_DATE&&(t.isTracing!==xe.NONE&&Dt(t,e),t.onBecomeStale()),t.dependenciesState=ve.STALE}))}(this),At()},Atom2.prototype.toString=function(){return this.name},Atom2}(),k=m("Atom",R);function j(e,t,r){void 0===t&&(t=u),void 0===r&&(r=u);var n=new R(e);return t!==u&&Xt(n,t),r!==u&&Yt(n,r),n}var z={identity:function(e,t){return e===t},structural:function(e,t){return gn(e,t)},default:function(e,t){return Object.is(e,t)},shallow:function(e,t){return gn(e,t,1)}},q=function(e,t){return(q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};var $=function(){return $=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},$.apply(this,arguments)};function Z(e){var t="function"==typeof Symbol&&e[Symbol.iterator],r=0;return t?t.call(e):{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}function X(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return o}function Y(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(X(arguments[t]));return e}var ee=Symbol("mobx did run lazy initializers"),te=Symbol("mobx pending decorators"),re={},ne={};function ie(e){var t,r;if(!0!==e[ee]){var n=e[te];if(n){p(e,ee,!0);var i=Y(Object.getOwnPropertySymbols(n),Object.keys(n));try{for(var s=Z(i),o=s.next();!o.done;o=s.next()){var a=n[o.value];a.propertyCreator(e,a.prop,a.descriptor,a.decoratorTarget,a.decoratorArguments)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}}}}function se(e,t){return function(){var r,n,s=function(n,i,s,o){if(!0===o)return t(n,i,s,n,r),null;if(!Object.prototype.hasOwnProperty.call(n,te)){var a=n[te];p(n,te,$({},a))}return n[te][i]={prop:i,propertyCreator:t,descriptor:s,decoratorTarget:n,decoratorArguments:r},function(e,t){var r=t?re:ne;return r[e]||(r[e]={configurable:!0,enumerable:t,get:function(){return ie(this),this[e]},set:function(t){ie(this),this[e]=t}})}(i,e)};return(2===(n=arguments).length||3===n.length)&&("string"==typeof n[1]||"symbol"==typeof n[1])||4===n.length&&!0===n[3]?(r=i,s.apply(null,arguments)):(r=Array.prototype.slice.call(arguments),s)}}function oe(e,t,r){return br(e)?e:Array.isArray(e)?ye.array(e,{name:r}):h(e)?ye.object(e,void 0,{name:r}):g(e)?ye.map(e,{name:r}):y(e)?ye.set(e,{name:r}):e}function ae(e){return e}function le(e){l(e);var t=se(!0,(function(t,r,n,i,s){var o=n?n.initializer?n.initializer.call(t):n.value:void 0;on(t).addObservableProp(r,o,e)})),r=("undefined"!=typeof process&&process.env,t);return r.enhancer=e,r}var ce={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};function ue(e){return null==e?ce:"string"==typeof e?{name:e,deep:!0,proxy:!0}:e}Object.freeze(ce);var de=le(oe),he=le((function(e,t,r){return null==e||dn(e)||Xr(e)||en(e)||nn(e)?e:Array.isArray(e)?ye.array(e,{name:r,deep:!1}):h(e)?ye.object(e,void 0,{name:r,deep:!1}):g(e)?ye.map(e,{name:r,deep:!1}):y(e)?ye.set(e,{name:r,deep:!1}):a(!1)})),pe=le(ae),me=le((function(e,t,r){return gn(e,t)?t:e}));function fe(e){return e.defaultDecorator?e.defaultDecorator.enhancer:!1===e.deep?ae:oe}var ge={box:function(e,t){arguments.length>2&&be("box");var r=ue(t);return new ut(e,fe(r),r.name,!0,r.equals)},array:function(e,t){arguments.length>2&&be("array");var r=ue(t);return function(e,t,r,n){void 0===r&&(r="ObservableArray@"+o());void 0===n&&(n=!1);var i=new qr(r,t,n);s=i.values,a=w,l=i,Object.defineProperty(s,a,{enumerable:!1,writable:!1,configurable:!0,value:l});var s,a,l;var c=new Proxy(i.values,Vr);if(i.proxy=c,e&&e.length){var u=at(!0);i.spliceWithArray(0,0,e),lt(u)}return c}(e,fe(r),r.name)},map:function(e,t){arguments.length>2&&be("map");var r=ue(t);return new Qr(e,fe(r),r.name)},set:function(e,t){arguments.length>2&&be("set");var r=ue(t);return new rn(e,fe(r),r.name)},object:function(e,t,r){"string"==typeof arguments[1]&&be("object");var n=ue(r);if(!1===n.proxy)return tr({},e,t,n);var i=rr(n),s=function(e){var t=new Proxy(e,Br);return e[w].proxy=t,t}(tr({},void 0,void 0,n));return nr(s,e,t,i),s},ref:pe,shallow:he,deep:de,struct:me},ye=function(e,t,r){if("string"==typeof arguments[1]||"symbol"==typeof arguments[1])return de.apply(null,arguments);if(br(e))return e;var n=h(e)?ye.object(e,t,r):Array.isArray(e)?ye.array(e,t):g(e)?ye.map(e,t):y(e)?ye.set(e,t):e;if(n!==e)return n;a(!1)};function be(e){a("Expected one or two arguments to observable."+e+". Did you accidentally try to use observable."+e+" as decorator?")}Object.keys(ge).forEach((function(e){return ye[e]=ge[e]}));var ve,_e,xe,we,Se=se(!1,(function(e,t,r,n,i){var s=r.get,o=r.set,a=i[0]||{};on(e).addComputedProp(e,t,$({get:s,set:o,context:e},a))})),Pe=Se({equals:z.structural}),Te=function(e,t,r){if("string"==typeof t)return Se.apply(null,arguments);if(null!==e&&"object"==typeof e&&1===arguments.length)return Se.apply(null,arguments);var n="object"==typeof t?t:{};return n.get=e,n.set="function"==typeof t?t:n.set,n.name=n.name||e.name||"",new ht(n)};Te.struct=Pe,(_e=ve||(ve={}))[_e.NOT_TRACKING=-1]="NOT_TRACKING",_e[_e.UP_TO_DATE=0]="UP_TO_DATE",_e[_e.POSSIBLY_STALE=1]="POSSIBLY_STALE",_e[_e.STALE=2]="STALE",(we=xe||(xe={}))[we.NONE=0]="NONE",we[we.LOG=1]="LOG",we[we.BREAK=2]="BREAK";var Re=function(){return function(e){this.cause=e}}();function ke(e){return e instanceof Re}function Ie(e){switch(e.dependenciesState){case ve.UP_TO_DATE:return!1;case ve.NOT_TRACKING:case ve.STALE:return!0;case ve.POSSIBLY_STALE:for(var t=$e(!0),r=Ve(),n=e.observing,i=n.length,s=0;s<i;s++){var o=n[s];if(pt(o)){if(xt.disableErrorBoundaries)o.get();else try{o.get()}catch(e){return qe(r),Xe(t),!0}if(e.dependenciesState===ve.STALE)return qe(r),Xe(t),!0}}return Ye(e),qe(r),Xe(t),!1}}function je(){return null!==xt.trackingDerivation}function He(e){var t=e.observers.size>0;xt.computationDepth>0&&t&&a(!1),xt.allowStateChanges||!t&&"strict"!==xt.enforceActions||a(!1)}function ze(e,t,r){var n=$e(!0);Ye(e),e.newObserving=new Array(e.observing.length+100),e.unboundDepsCount=0,e.runId=++xt.runId;var i,s=xt.trackingDerivation;if(xt.trackingDerivation=e,!0===xt.disableErrorBoundaries)i=t.call(r);else try{i=t.call(r)}catch(e){i=new Re(e)}return xt.trackingDerivation=s,function(e){for(var t=e.observing,r=e.observing=e.newObserving,n=ve.UP_TO_DATE,i=0,s=e.unboundDepsCount,o=0;o<s;o++){0===(a=r[o]).diffValue&&(a.diffValue=1,i!==o&&(r[i]=a),i++),a.dependenciesState>n&&(n=a.dependenciesState)}r.length=i,e.newObserving=null,s=t.length;for(;s--;){0===(a=t[s]).diffValue&&Et(a,e),a.diffValue=0}for(;i--;){var a;1===(a=r[i]).diffValue&&(a.diffValue=0,Pt(a,e))}n!==ve.UP_TO_DATE&&(e.dependenciesState=n,e.onBecomeStale())}(e),Xe(n),i}function Ge(e){var t=e.observing;e.observing=[];for(var r=t.length;r--;)Et(t[r],e);e.dependenciesState=ve.NOT_TRACKING}function We(e){var t=Ve();try{return e()}finally{qe(t)}}function Ve(){var e=xt.trackingDerivation;return xt.trackingDerivation=null,e}function qe(e){xt.trackingDerivation=e}function $e(e){var t=xt.allowStateReads;return xt.allowStateReads=e,t}function Xe(e){xt.allowStateReads=e}function Ye(e){if(e.dependenciesState!==ve.UP_TO_DATE){e.dependenciesState=ve.UP_TO_DATE;for(var t=e.observing,r=t.length;r--;)t[r].lowestObserverState=ve.UP_TO_DATE}}var Qe=0,et=1,tt=Object.getOwnPropertyDescriptor((function(){}),"name");tt&&tt.configurable;function rt(e,t,r){var n=function(){return nt(e,t,r||this,arguments)};return n.isMobxAction=!0,n}function nt(e,t,r,n){var i=it(e,r,n);try{return t.apply(r,n)}catch(e){throw i.error=e,e}finally{st(i)}}function it(e,t,r){var n=Ve();Ct();var i={prevDerivation:n,prevAllowStateChanges:at(!0),prevAllowStateReads:$e(!0),notifySpy:false,startTime:0,actionId:et++,parentActionId:Qe};return Qe=i.actionId,i}function st(e){Qe!==e.actionId&&a("invalid action stack. did you forget to finish an action?"),Qe=e.parentActionId,void 0!==e.error&&(xt.suppressReactionErrors=!0),lt(e.prevAllowStateChanges),Xe(e.prevAllowStateReads),At(),qe(e.prevDerivation),e.notifySpy,xt.suppressReactionErrors=!1}function ot(e,t){var r,n=at(e);try{r=t()}finally{lt(n)}return r}function at(e){var t=xt.allowStateChanges;return xt.allowStateChanges=e,t}function lt(e){xt.allowStateChanges=e}function ct(e){var t,r=xt.computationDepth;xt.computationDepth=0;try{t=e()}finally{xt.computationDepth=r}return t}var ut=function(e){function ObservableValue2(t,r,n,i,s){void 0===n&&(n="ObservableValue@"+o()),void 0===i&&(i=!0),void 0===s&&(s=z.default);var a=e.call(this,n)||this;return a.enhancer=r,a.name=n,a.equals=s,a.hasUnreportedChange=!1,a.value=r(t,void 0,n),a}return function(e,t){function r(){this.constructor=e}q(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(ObservableValue2,e),ObservableValue2.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},ObservableValue2.prototype.set=function(e){this.value;if((e=this.prepareNewValue(e))!==xt.UNCHANGED){false,this.setNewValue(e)}},ObservableValue2.prototype.prepareNewValue=function(e){if(He(this),jr(this)){var t=Ur(this,{object:this,type:"update",newValue:e});if(!t)return xt.UNCHANGED;e=t.newValue}return e=this.enhancer(e,this.value,this.name),this.equals(this.value,e)?xt.UNCHANGED:e},ObservableValue2.prototype.setNewValue=function(e){var t=this.value;this.value=e,this.reportChanged(),zr(this)&&Wr(this,{type:"update",object:this,newValue:e,oldValue:t})},ObservableValue2.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},ObservableValue2.prototype.intercept=function(e){return Hr(this,e)},ObservableValue2.prototype.observe=function(e,t){return t&&e({object:this,type:"update",newValue:this.value,oldValue:void 0}),Gr(this,e)},ObservableValue2.prototype.toJSON=function(){return this.get()},ObservableValue2.prototype.toString=function(){return this.name+"["+this.value+"]"},ObservableValue2.prototype.valueOf=function(){return _(this.get())},ObservableValue2.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},ObservableValue2}(R),dt=m("ObservableValue",ut),ht=function(){function ComputedValue2(e){this.dependenciesState=ve.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isBeingObserved=!1,this.isPendingUnobservation=!1,this.observers=new Set,this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=ve.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+o(),this.value=new Re(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=xe.NONE,l(e.get,"missing option for computed: get"),this.derivation=e.get,this.name=e.name||"ComputedValue@"+o(),e.set&&(this.setter=rt(this.name+"-setter",e.set)),this.equals=e.equals||(e.compareStructural||e.struct?z.structural:z.default),this.scope=e.context,this.requiresReaction=!!e.requiresReaction,this.keepAlive=!!e.keepAlive}return ComputedValue2.prototype.onBecomeStale=function(){!function(e){if(e.lowestObserverState!==ve.UP_TO_DATE)return;e.lowestObserverState=ve.POSSIBLY_STALE,e.observers.forEach((function(t){t.dependenciesState===ve.UP_TO_DATE&&(t.dependenciesState=ve.POSSIBLY_STALE,t.isTracing!==xe.NONE&&Dt(t,e),t.onBecomeStale())}))}(this)},ComputedValue2.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach((function(e){return e()}))},ComputedValue2.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach((function(e){return e()}))},ComputedValue2.prototype.get=function(){this.isComputing&&a("Cycle detected in computation "+this.name+": "+this.derivation),0!==xt.inBatch||0!==this.observers.size||this.keepAlive?(Tt(this),Ie(this)&&this.trackAndCompute()&&function(e){if(e.lowestObserverState===ve.STALE)return;e.lowestObserverState=ve.STALE,e.observers.forEach((function(t){t.dependenciesState===ve.POSSIBLY_STALE?t.dependenciesState=ve.STALE:t.dependenciesState===ve.UP_TO_DATE&&(e.lowestObserverState=ve.UP_TO_DATE)}))}(this)):Ie(this)&&(this.warnAboutUntrackedRead(),Ct(),this.value=this.computeValue(!1),At());var e=this.value;if(ke(e))throw e.cause;return e},ComputedValue2.prototype.peek=function(){var e=this.computeValue(!1);if(ke(e))throw e.cause;return e},ComputedValue2.prototype.set=function(e){if(this.setter){l(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,e)}finally{this.isRunningSetter=!1}}else l(!1,!1)},ComputedValue2.prototype.trackAndCompute=function(){var e=this.value,t=this.dependenciesState===ve.NOT_TRACKING,r=this.computeValue(!0),n=t||ke(e)||ke(r)||!this.equals(e,r);return n&&(this.value=r),n},ComputedValue2.prototype.computeValue=function(e){var t;if(this.isComputing=!0,xt.computationDepth++,e)t=ze(this,this.derivation,this.scope);else if(!0===xt.disableErrorBoundaries)t=this.derivation.call(this.scope);else try{t=this.derivation.call(this.scope)}catch(e){t=new Re(e)}return xt.computationDepth--,this.isComputing=!1,t},ComputedValue2.prototype.suspend=function(){this.keepAlive||(Ge(this),this.value=void 0)},ComputedValue2.prototype.observe=function(e,t){var r=this,n=!0,i=void 0;return qt((function(){var s=r.get();if(!n||t){var o=Ve();e({type:"update",object:r,newValue:s,oldValue:i}),qe(o)}n=!1,i=s}))},ComputedValue2.prototype.warnAboutUntrackedRead=function(){},ComputedValue2.prototype.toJSON=function(){return this.get()},ComputedValue2.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},ComputedValue2.prototype.valueOf=function(){return _(this.get())},ComputedValue2.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},ComputedValue2}(),pt=m("ComputedValue",ht),mt=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","allowStateReads","disableErrorBoundaries","runId","UNCHANGED"],ft=function(){return function(){this.version=5,this.UNCHANGED={},this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.allowStateReads=!0,this.enforceActions=!1,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.computedConfigurable=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1}}(),gt={};function yt(){return"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:gt}var bt,vt=!0,_t=!1,xt=((bt=yt()).__mobxInstanceCount>0&&!bt.__mobxGlobals&&(vt=!1),bt.__mobxGlobals&&bt.__mobxGlobals.version!==(new ft).version&&(vt=!1),vt?bt.__mobxGlobals?(bt.__mobxInstanceCount+=1,bt.__mobxGlobals.UNCHANGED||(bt.__mobxGlobals.UNCHANGED={}),bt.__mobxGlobals):(bt.__mobxInstanceCount=1,bt.__mobxGlobals=new ft):(setTimeout((function(){_t||a("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")}),1),new ft));function wt(){return xt}function St(){var e=new ft;for(var t in e)-1===mt.indexOf(t)&&(xt[t]=e[t]);xt.allowStateChanges=!xt.enforceActions}function Pt(e,t){e.observers.add(t),e.lowestObserverState>t.dependenciesState&&(e.lowestObserverState=t.dependenciesState)}function Et(e,t){e.observers.delete(t),0===e.observers.size&&Mt(e)}function Mt(e){!1===e.isPendingUnobservation&&(e.isPendingUnobservation=!0,xt.pendingUnobservations.push(e))}function Ct(){xt.inBatch++}function At(){if(0==--xt.inBatch){Ft();for(var e=xt.pendingUnobservations,t=0;t<e.length;t++){var r=e[t];r.isPendingUnobservation=!1,0===r.observers.size&&(r.isBeingObserved&&(r.isBeingObserved=!1,r.onBecomeUnobserved()),r instanceof ht&&r.suspend())}xt.pendingUnobservations=[]}}function Tt(e){var t=xt.trackingDerivation;return null!==t?(t.runId!==e.lastAccessedBy&&(e.lastAccessedBy=t.runId,t.newObserving[t.unboundDepsCount++]=e,e.isBeingObserved||(e.isBeingObserved=!0,e.onBecomeObserved())),!0):(0===e.observers.size&&xt.inBatch>0&&Mt(e),!1)}function Dt(e,t){if(console.log("[mobx.trace] '"+e.name+"' is invalidated due to a change in: '"+t.name+"'"),e.isTracing===xe.BREAK){var r=[];Ot(ir(e),r,1),new Function("debugger;\n/*\nTracing '"+e.name+"'\n\nYou are entering this break point because derivation '"+e.name+"' is being traced and '"+t.name+"' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n"+(e instanceof ht?e.derivation.toString().replace(/[*]\//g,"/"):"")+"\n\nThe dependencies for this derivation are:\n\n"+r.join("\n")+"\n*/\n    ")()}}function Ot(e,t,r){t.length>=1e3?t.push("(and many more)"):(t.push(""+new Array(r).join("\t")+e.name),e.dependencies&&e.dependencies.forEach((function(e){return Ot(e,t,r+1)})))}var Rt=function(){function Reaction2(e,t,r,n){void 0===e&&(e="Reaction@"+o()),void 0===n&&(n=!1),this.name=e,this.onInvalidate=t,this.errorHandler=r,this.requiresObservable=n,this.observing=[],this.newObserving=[],this.dependenciesState=ve.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+o(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=xe.NONE}return Reaction2.prototype.onBecomeStale=function(){this.schedule()},Reaction2.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,xt.pendingReactions.push(this),Ft())},Reaction2.prototype.isScheduled=function(){return this._isScheduled},Reaction2.prototype.runReaction=function(){if(!this.isDisposed){if(Ct(),this._isScheduled=!1,Ie(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending}catch(e){this.reportExceptionInDerivation(e)}}At()}},Reaction2.prototype.track=function(e){if(!this.isDisposed){Ct();false,this._isRunning=!0;var t=ze(this,e,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&Ge(this),ke(t)&&this.reportExceptionInDerivation(t.cause),At()}},Reaction2.prototype.reportExceptionInDerivation=function(e){var t=this;if(this.errorHandler)this.errorHandler(e,this);else{if(xt.disableErrorBoundaries)throw e;var r="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";xt.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(r,e),xt.globalReactionErrorHandlers.forEach((function(r){return r(e,t)}))}},Reaction2.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(Ct(),Ge(this),At()))},Reaction2.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e[w]=this,e},Reaction2.prototype.toString=function(){return"Reaction["+this.name+"]"},Reaction2.prototype.trace=function(e){void 0===e&&(e=!1),Rr(this,e)},Reaction2}();function Lt(e){return xt.globalReactionErrorHandlers.push(e),function(){var t=xt.globalReactionErrorHandlers.indexOf(e);t>=0&&xt.globalReactionErrorHandlers.splice(t,1)}}var kt=100,Nt=function(e){return e()};function Ft(){xt.inBatch>0||xt.isRunningReactions||Nt(It)}function It(){xt.isRunningReactions=!0;for(var e=xt.pendingReactions,t=0;e.length>0;){++t===kt&&(console.error("Reaction doesn't converge to a stable state after "+kt+" iterations. Probably there is a cycle in the reactive function: "+e[0]),e.splice(0));for(var r=e.splice(0),n=0,i=r.length;n<i;n++)r[n].runReaction()}xt.isRunningReactions=!1}var Bt=m("Reaction",Rt);function jt(e){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}function Ht(){a(!1)}function Ut(e){return function(t,r,n){if(n){if(n.value)return{value:rt(e,n.value),enumerable:!1,configurable:!0,writable:!0};var i=n.initializer;return{enumerable:!1,configurable:!0,writable:!0,initializer:function(){return rt(e,i.call(this))}}}return function(e){return function(t,r,n){Object.defineProperty(t,r,{configurable:!0,enumerable:!1,get:function(){},set:function(t){p(this,r,zt(e,t))}})}}(e).apply(this,arguments)}}var zt=function(e,t,r,n){return 1===arguments.length&&"function"==typeof e?rt(e.name||"<unnamed action>",e):2===arguments.length&&"function"==typeof t?rt(e,t):1===arguments.length&&"string"==typeof e?Ut(e):!0!==n?Ut(t).apply(null,arguments):void p(e,t,rt(e.name||t,r.value,this))};function Gt(e,t){return nt("string"==typeof e?e:e.name||"<unnamed action>","function"==typeof e?e:t,this,void 0)}function Wt(e){return"function"==typeof e&&!0===e.isMobxAction}function Vt(e,t,r){p(e,t,rt(t,r.bind(e)))}function qt(e,t){void 0===t&&(t=s);var r,n=t&&t.name||e.name||"Autorun@"+o();if(!t.scheduler&&!t.delay)r=new Rt(n,(function(){this.track(l)}),t.onError,t.requiresObservable);else{var i=Zt(t),a=!1;r=new Rt(n,(function(){a||(a=!0,i((function(){a=!1,r.isDisposed||r.track(l)})))}),t.onError,t.requiresObservable)}function l(){e(r)}return r.schedule(),r.getDisposer()}zt.bound=function(e,t,r,n){return!0===n?(Vt(e,t,r.value),null):r?{configurable:!0,enumerable:!1,get:function(){return Vt(this,t,r.value||r.initializer.call(this)),this[t]},set:Ht}:{enumerable:!1,configurable:!0,set:function(e){Vt(this,t,e)},get:function(){}}};var $t=function(e){return e()};function Zt(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:$t}function Kt(e,t,r){void 0===r&&(r=s);var n,i,a,l=r.name||"Reaction@"+o(),c=zt(l,r.onError?(n=r.onError,i=t,function(){try{return i.apply(this,arguments)}catch(e){n.call(this,e)}}):t),u=!r.scheduler&&!r.delay,d=Zt(r),h=!0,p=!1,m=r.compareStructural?z.structural:r.equals||z.default,f=new Rt(l,(function(){h||u?g():p||(p=!0,d(g))}),r.onError,r.requiresObservable);function g(){if(p=!1,!f.isDisposed){var t=!1;f.track((function(){var r=e(f);t=h||!m(a,r),a=r})),h&&r.fireImmediately&&c(a,f),h||!0!==t||c(a,f),h&&(h=!1)}}return f.schedule(),f.getDisposer()}function Xt(e,t,r){return Jt("onBecomeObserved",e,t,r)}function Yt(e,t,r){return Jt("onBecomeUnobserved",e,t,r)}function Jt(e,t,r,n){var i="function"==typeof n?hn(t,r):hn(t),s="function"==typeof n?n:r,o=e+"Listeners";return i[o]?i[o].add(s):i[o]=new Set([s]),"function"!=typeof i[e]?a(!1):function(){var e=i[o];e&&(e.delete(s),0===e.size&&delete i[o])}}function Qt(e){var t,r,n=e.enforceActions,i=e.computedRequiresReaction,s=e.computedConfigurable,o=e.disableErrorBoundaries,l=e.reactionScheduler,c=e.reactionRequiresObservable,u=e.observableRequiresReaction;if(!0===e.isolateGlobalState&&((xt.pendingReactions.length||xt.inBatch||xt.isRunningReactions)&&a("isolateGlobalState should be called before MobX is running any reactions"),_t=!0,vt&&(0==--yt().__mobxInstanceCount&&(yt().__mobxGlobals=void 0),xt=new ft)),void 0!==n){var d=void 0;switch(n){case!0:case"observed":d=!0;break;case!1:case"never":d=!1;break;case"strict":case"always":d="strict";break;default:a("Invalid value for 'enforceActions': '"+n+"', expected 'never', 'always' or 'observed'")}xt.enforceActions=d,xt.allowStateChanges=!0!==d&&"strict"!==d}void 0!==i&&(xt.computedRequiresReaction=!!i),void 0!==c&&(xt.reactionRequiresObservable=!!c),void 0!==u&&(xt.observableRequiresReaction=!!u,xt.allowStateReads=!xt.observableRequiresReaction),void 0!==s&&(xt.computedConfigurable=!!s),void 0!==o&&(!0===o&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled."),xt.disableErrorBoundaries=!!o),l&&(t=l,r=Nt,Nt=function(e){return t((function(){return r(e)}))})}function er(e,t){var r="function"==typeof e?e.prototype:e,n=function(e){var n=t[e];Array.isArray(n)||(n=[n]);var i=Object.getOwnPropertyDescriptor(r,e),s=n.reduce((function(t,n){return n(r,e,t)}),i);s&&Object.defineProperty(r,e,s)};for(var i in t)n(i);return e}function tr(e,t,r,n){var i=rr(n=ue(n));return ie(e),on(e,n.name,i.enhancer),t&&nr(e,t,r,i),e}function rr(e){return e.defaultDecorator||(!1===e.deep?pe:de)}function nr(e,t,r,n){var i,s;Ct();try{var o=x(t);try{for(var a=Z(o),l=a.next();!l.done;l=a.next()){var c=l.value,u=Object.getOwnPropertyDescriptor(t,c);0;var d=(r&&c in r?r[c]:u.get?Se:n)(e,c,u,!0);d&&Object.defineProperty(e,c,d)}}catch(e){i={error:e}}finally{try{l&&!l.done&&(s=a.return)&&s.call(a)}finally{if(i)throw i.error}}}finally{At()}}function ir(e,t){return sr(hn(e,t))}function sr(e){var t,r,n={name:e.name};return e.observing&&e.observing.length>0&&(n.dependencies=(t=e.observing,r=[],t.forEach((function(e){-1===r.indexOf(e)&&r.push(e)})),r).map(sr)),n}function or(e,t){return ar(hn(e,t))}function ar(e){var t,r={name:e.name};return(t=e).observers&&t.observers.size>0&&(r.observers=Array.from(function(e){return e.observers}(e)).map(ar)),r}var lr=0;function FlowCancellationError(){this.message="FLOW_CANCELLED"}function cr(e){return e instanceof FlowCancellationError}function ur(e){1!==arguments.length&&a("Flow expects 1 argument and cannot be used as decorator");var t=e.name||"<unnamed flow>";return function(){var r,n=arguments,i=++lr,s=zt(t+" - runid: "+i+" - init",e).apply(this,n),o=void 0,a=new Promise((function(e,n){var a=0;function l(e){var r;o=void 0;try{r=zt(t+" - runid: "+i+" - yield "+a++,s.next).call(s,e)}catch(e){return n(e)}u(r)}function c(e){var r;o=void 0;try{r=zt(t+" - runid: "+i+" - yield "+a++,s.throw).call(s,e)}catch(e){return n(e)}u(r)}function u(t){if(!t||"function"!=typeof t.then)return t.done?e(t.value):(o=Promise.resolve(t.value)).then(l,c);t.then(u,n)}r=n,l(void 0)}));return a.cancel=zt(t+" - runid: "+i+" - cancel",(function(){try{o&&dr(o);var e=s.return(void 0),t=Promise.resolve(e.value);t.then(u,u),dr(t),r(new FlowCancellationError)}catch(e){r(e)}})),a}}function dr(e){"function"==typeof e.cancel&&e.cancel()}function hr(e,t,r){var n;if(en(e)||Xr(e)||dt(e))n=pn(e);else{if(!dn(e))return a(!1);if("string"!=typeof t)return a(!1);n=pn(e,t)}return void 0!==n.dehancer?a(!1):(n.dehancer="function"==typeof t?t:r,function(){n.dehancer=void 0})}function pr(e,t,r){return"function"==typeof r?function(e,t,r){return pn(e,t).intercept(r)}(e,t,r):function(e,t){return pn(e).intercept(t)}(e,t)}function mr(e,t){if(null==e)return!1;if(void 0!==t){if(!1===dn(e))return!1;if(!e[w].values.has(t))return!1;var r=hn(e,t);return pt(r)}return pt(e)}function fr(e){return arguments.length>1?a(!1):mr(e)}function gr(e,t){return"string"!=typeof t?a(!1):mr(e,t)}function yr(e,t){return null!=e&&(void 0!==t?!!dn(e)&&e[w].values.has(t):dn(e)||!!e[w]||k(e)||Bt(e)||pt(e))}function br(e){return 1!==arguments.length&&a(!1),yr(e)}function vr(e,t){return"string"!=typeof t?a(!1):yr(e,t)}function _r(e){return dn(e)?e[w].getKeys():en(e)||nn(e)?Array.from(e.keys()):Xr(e)?e.map((function(e,t){return t})):a(!1)}function xr(e){return dn(e)?_r(e).map((function(t){return e[t]})):en(e)?_r(e).map((function(t){return e.get(t)})):nn(e)?Array.from(e.values()):Xr(e)?e.slice():a(!1)}function wr(e){return dn(e)?_r(e).map((function(t){return[t,e[t]]})):en(e)?_r(e).map((function(t){return[t,e.get(t)]})):nn(e)?Array.from(e.entries()):Xr(e)?e.map((function(e,t){return[t,e]})):a(!1)}function Sr(e,t,r){if(2!==arguments.length||nn(e))if(dn(e)){var n=e[w];n.values.get(t)?n.write(t,r):n.addObservableProp(t,r,n.defaultEnhancer)}else if(en(e))e.set(t,r);else if(nn(e))e.add(t);else{if(!Xr(e))return a(!1);"number"!=typeof t&&(t=parseInt(t,10)),l(t>=0,"Not a valid index: '"+t+"'"),Ct(),t>=e.length&&(e.length=t+1),e[t]=r,At()}else{Ct();var i=t;try{for(var s in i)Sr(e,s,i[s])}finally{At()}}}function Pr(e,t){if(dn(e))e[w].remove(t);else if(en(e))e.delete(t);else if(nn(e))e.delete(t);else{if(!Xr(e))return a(!1);"number"!=typeof t&&(t=parseInt(t,10)),l(t>=0,"Not a valid index: '"+t+"'"),e.splice(t,1)}}function Er(e,t){return dn(e)?pn(e).has(t):en(e)||nn(e)?e.has(t):Xr(e)?t>=0&&t<e.length:a(!1)}function Mr(e,t){if(Er(e,t))return dn(e)?e[t]:en(e)?e.get(t):Xr(e)?e[t]:a(!1)}function Cr(e,t,r,n){return"function"==typeof r?function(e,t,r,n){return pn(e,t).observe(r,n)}(e,t,r,n):function(e,t,r){return pn(e).observe(t,r)}(e,t,r)}FlowCancellationError.prototype=Object.create(Error.prototype);var Ar={detectCycles:!0,exportMapsAsObjects:!0,recurseEverything:!1};function Tr(e,t,r,n){return n.detectCycles&&e.set(t,r),r}function Dr(e,t,r){if(!t.recurseEverything&&!br(e))return e;if("object"!=typeof e)return e;if(null===e)return null;if(e instanceof Date)return e;if(dt(e))return Dr(e.get(),t,r);if(br(e)&&_r(e),!0===t.detectCycles&&null!==e&&r.has(e))return r.get(e);if(Xr(e)||Array.isArray(e)){var n=Tr(r,e,[],t),i=e.map((function(e){return Dr(e,t,r)}));n.length=i.length;for(var s=0,o=i.length;s<o;s++)n[s]=i[s];return n}if(nn(e)||Object.getPrototypeOf(e)===Set.prototype){if(!1===t.exportMapsAsObjects){var a=Tr(r,e,new Set,t);return e.forEach((function(e){a.add(Dr(e,t,r))})),a}var l=Tr(r,e,[],t);return e.forEach((function(e){l.push(Dr(e,t,r))})),l}if(en(e)||Object.getPrototypeOf(e)===Map.prototype){if(!1===t.exportMapsAsObjects){var c=Tr(r,e,new Map,t);return e.forEach((function(e,n){c.set(n,Dr(e,t,r))})),c}var u=Tr(r,e,{},t);return e.forEach((function(e,n){u[n]=Dr(e,t,r)})),u}var d=Tr(r,e,{},t);return b(e).forEach((function(n){d[n]=Dr(e[n],t,r)})),d}function Or(e,t){var r;return"boolean"==typeof t&&(t={detectCycles:t}),t||(t=Ar),t.detectCycles=void 0===t.detectCycles?!0===t.recurseEverything:!0===t.detectCycles,t.detectCycles&&(r=new Map),Dr(e,t,r)}function Rr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=!1;"boolean"==typeof e[e.length-1]&&(r=e.pop());var n=function(e){switch(e.length){case 0:return xt.trackingDerivation;case 1:return hn(e[0]);case 2:return hn(e[0],e[1])}}(e);if(!n)return a(!1);n.isTracing===xe.NONE&&console.log("[mobx.trace] '"+n.name+"' tracing enabled"),n.isTracing=r?xe.BREAK:xe.LOG}function Lr(e,t){void 0===t&&(t=void 0),Ct();try{return e.apply(t)}finally{At()}}function kr(e,t,r){return 1===arguments.length||t&&"object"==typeof t?function(e,t){0;var r,n=new Promise((function(n,i){var s=Nr(e,n,$($({},t),{onError:i}));r=function(){s(),i("WHEN_CANCELLED")}}));return n.cancel=r,n}(e,t):Nr(e,t,r||{})}function Nr(e,t,r){var n;"number"==typeof r.timeout&&(n=setTimeout((function(){if(!s[w].isDisposed){s();var e=new Error("WHEN_TIMEOUT");if(!r.onError)throw e;r.onError(e)}}),r.timeout)),r.name=r.name||"When@"+o();var i=rt(r.name+"-effect",t),s=qt((function(t){e()&&(t.dispose(),n&&clearTimeout(n),i())}),r);return s}function Fr(e){return e[w]}function Ir(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e}var Br={has:function(e,t){if(t===w||"constructor"===t||t===ee)return!0;var r=Fr(e);return Ir(t)?r.has(t):t in e},get:function(e,t){if(t===w||"constructor"===t||t===ee)return e[t];var r=Fr(e),n=r.values.get(t);if(n instanceof R){var i=n.get();return void 0===i&&r.has(t),i}return Ir(t)&&r.has(t),e[t]},set:function(e,t,r){return!!Ir(t)&&(Sr(e,t,r),!0)},deleteProperty:function(e,t){return!!Ir(t)&&(Fr(e).remove(t),!0)},ownKeys:function(e){return Fr(e).keysAtom.reportObserved(),Reflect.ownKeys(e)},preventExtensions:function(e){return a("Dynamic observable objects cannot be frozen"),!1}};function jr(e){return void 0!==e.interceptors&&e.interceptors.length>0}function Hr(e,t){var r=e.interceptors||(e.interceptors=[]);return r.push(t),c((function(){var e=r.indexOf(t);-1!==e&&r.splice(e,1)}))}function Ur(e,t){var r=Ve();try{for(var n=Y(e.interceptors||[]),i=0,s=n.length;i<s&&(l(!(t=n[i](t))||t.type,"Intercept handlers should return nothing or a change object"),t);i++);return t}finally{qe(r)}}function zr(e){return void 0!==e.changeListeners&&e.changeListeners.length>0}function Gr(e,t){var r=e.changeListeners||(e.changeListeners=[]);return r.push(t),c((function(){var e=r.indexOf(t);-1!==e&&r.splice(e,1)}))}function Wr(e,t){var r=Ve(),n=e.changeListeners;if(n){for(var i=0,s=(n=n.slice()).length;i<s;i++)n[i](t);qe(r)}}var Vr={get:function(e,t){return t===w?e[w]:"length"===t?e[w].getArrayLength():"number"==typeof t?$r.get.call(e,t):"string"!=typeof t||isNaN(t)?$r.hasOwnProperty(t)?$r[t]:e[t]:$r.get.call(e,parseInt(t))},set:function(e,t,r){return"length"===t&&e[w].setArrayLength(r),"number"==typeof t&&$r.set.call(e,t,r),"symbol"==typeof t||isNaN(t)?e[t]=r:$r.set.call(e,parseInt(t),r),!0},preventExtensions:function(e){return a("Observable arrays cannot be frozen"),!1}};var qr=function(){function ObservableArrayAdministration2(e,t,r){this.owned=r,this.values=[],this.proxy=void 0,this.lastKnownLength=0,this.atom=new R(e||"ObservableArray@"+o()),this.enhancer=function(r,n){return t(r,n,e+"[..]")}}return ObservableArrayAdministration2.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},ObservableArrayAdministration2.prototype.dehanceValues=function(e){return void 0!==this.dehancer&&e.length>0?e.map(this.dehancer):e},ObservableArrayAdministration2.prototype.intercept=function(e){return Hr(this,e)},ObservableArrayAdministration2.prototype.observe=function(e,t){return void 0===t&&(t=!1),t&&e({object:this.proxy,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),Gr(this,e)},ObservableArrayAdministration2.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},ObservableArrayAdministration2.prototype.setArrayLength=function(e){if("number"!=typeof e||e<0)throw new Error("[mobx.array] Out of range: "+e);var t=this.values.length;if(e!==t)if(e>t){for(var r=new Array(e-t),n=0;n<e-t;n++)r[n]=void 0;this.spliceWithArray(t,0,r)}else this.spliceWithArray(e,t-e)},ObservableArrayAdministration2.prototype.updateArrayLength=function(e,t){if(e!==this.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed.");this.lastKnownLength+=t},ObservableArrayAdministration2.prototype.spliceWithArray=function(e,t,r){var n=this;He(this.atom);var s=this.values.length;if(void 0===e?e=0:e>s?e=s:e<0&&(e=Math.max(0,s+e)),t=1===arguments.length?s-e:null==t?0:Math.max(0,Math.min(t,s-e)),void 0===r&&(r=i),jr(this)){var o=Ur(this,{object:this.proxy,type:"splice",index:e,removedCount:t,added:r});if(!o)return i;t=o.removedCount,r=o.added}r=0===r.length?r:r.map((function(e){return n.enhancer(e,void 0)}));var a=this.spliceItemsIntoValues(e,t,r);return 0===t&&0===r.length||this.notifyArraySplice(e,r,a),this.dehanceValues(a)},ObservableArrayAdministration2.prototype.spliceItemsIntoValues=function(e,t,r){var n;if(r.length<1e4)return(n=this.values).splice.apply(n,Y([e,t],r));var i=this.values.slice(e,e+t);return this.values=this.values.slice(0,e).concat(r,this.values.slice(e+t)),i},ObservableArrayAdministration2.prototype.notifyArrayChildUpdate=function(e,t,r){var n=!this.owned&&!1,i=zr(this),s=i||n?{object:this.proxy,type:"update",index:e,newValue:t,oldValue:r}:null;this.atom.reportChanged(),i&&Wr(this,s)},ObservableArrayAdministration2.prototype.notifyArraySplice=function(e,t,r){var n=!this.owned&&!1,i=zr(this),s=i||n?{object:this.proxy,type:"splice",index:e,removed:r,added:t,removedCount:r.length,addedCount:t.length}:null;this.atom.reportChanged(),i&&Wr(this,s)},ObservableArrayAdministration2}(),$r={intercept:function(e){return this[w].intercept(e)},observe:function(e,t){return void 0===t&&(t=!1),this[w].observe(e,t)},clear:function(){return this.splice(0)},replace:function(e){var t=this[w];return t.spliceWithArray(0,t.values.length,e)},toJS:function(){return this.slice()},toJSON:function(){return this.toJS()},splice:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=this[w];switch(arguments.length){case 0:return[];case 1:return i.spliceWithArray(e);case 2:return i.spliceWithArray(e,t)}return i.spliceWithArray(e,t,r)},spliceWithArray:function(e,t,r){return this[w].spliceWithArray(e,t,r)},push:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=this[w];return r.spliceWithArray(r.values.length,0,e),r.values.length},pop:function(){return this.splice(Math.max(this[w].values.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=this[w];return r.spliceWithArray(0,0,e),r.values.length},reverse:function(){var e=this.slice();return e.reverse.apply(e,arguments)},sort:function(e){var t=this.slice();return t.sort.apply(t,arguments)},remove:function(e){var t=this[w],r=t.dehanceValues(t.values).indexOf(e);return r>-1&&(this.splice(r,1),!0)},get:function(e){var t=this[w];if(t){if(e<t.values.length)return t.atom.reportObserved(),t.dehanceValue(t.values[e]);console.warn("[mobx.array] Attempt to read an array index ("+e+") that is out of bounds ("+t.values.length+"). Please check length first. Out of bound indices will not be tracked by MobX")}},set:function(e,t){var r=this[w],n=r.values;if(e<n.length){He(r.atom);var i=n[e];if(jr(r)){var s=Ur(r,{type:"update",object:r.proxy,index:e,newValue:t});if(!s)return;t=s.newValue}(t=r.enhancer(t,i))!==i&&(n[e]=t,r.notifyArrayChildUpdate(e,t,i))}else{if(e!==n.length)throw new Error("[mobx.array] Index out of bounds, "+e+" is larger than "+n.length);r.spliceWithArray(e,0,[t])}}};["concat","flat","includes","indexOf","join","lastIndexOf","slice","toString","toLocaleString"].forEach((function(e){"function"==typeof Array.prototype[e]&&($r[e]=function(){var t=this[w];t.atom.reportObserved();var r=t.dehanceValues(t.values);return r[e].apply(r,arguments)})})),["every","filter","find","findIndex","flatMap","forEach","map","some"].forEach((function(e){"function"==typeof Array.prototype[e]&&($r[e]=function(t,r){var n=this,i=this[w];return i.atom.reportObserved(),i.dehanceValues(i.values)[e]((function(e,i){return t.call(r,e,i,n)}),r)})})),["reduce","reduceRight"].forEach((function(e){$r[e]=function(){var t=this,r=this[w];r.atom.reportObserved();var n=arguments[0];return arguments[0]=function(e,i,s){return i=r.dehanceValue(i),n(e,i,s,t)},r.values[e].apply(r.values,arguments)}}));var Zr,Kr=m("ObservableArrayAdministration",qr);function Xr(e){return d(e)&&Kr(e[w])}var Yr,Jr={},Qr=function(){function ObservableMap2(e,t,r){if(void 0===t&&(t=oe),void 0===r&&(r="ObservableMap@"+o()),this.enhancer=t,this.name=r,this[Zr]=Jr,this._keysAtom=j(this.name+".keys()"),this[Symbol.toStringTag]="Map","function"!=typeof Map)throw new Error("mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js");this._data=new Map,this._hasMap=new Map,this.merge(e)}return ObservableMap2.prototype._has=function(e){return this._data.has(e)},ObservableMap2.prototype.has=function(e){var t=this;if(!xt.trackingDerivation)return this._has(e);var r=this._hasMap.get(e);if(!r){var n=r=new ut(this._has(e),ae,this.name+"."+v(e)+"?",!1);this._hasMap.set(e,n),Yt(n,(function(){return t._hasMap.delete(e)}))}return r.get()},ObservableMap2.prototype.set=function(e,t){var r=this._has(e);if(jr(this)){var n=Ur(this,{type:r?"update":"add",object:this,newValue:t,name:e});if(!n)return this;t=n.newValue}return r?this._updateValue(e,t):this._addValue(e,t),this},ObservableMap2.prototype.delete=function(e){var t=this;if((He(this._keysAtom),jr(this))&&!(n=Ur(this,{type:"delete",object:this,name:e})))return!1;if(this._has(e)){var r=zr(this),n=r?{type:"delete",object:this,oldValue:this._data.get(e).value,name:e}:null;return Lr((function(){t._keysAtom.reportChanged(),t._updateHasMapEntry(e,!1),t._data.get(e).setNewValue(void 0),t._data.delete(e)})),r&&Wr(this,n),!0}return!1},ObservableMap2.prototype._updateHasMapEntry=function(e,t){var r=this._hasMap.get(e);r&&r.setNewValue(t)},ObservableMap2.prototype._updateValue=function(e,t){var r=this._data.get(e);if((t=r.prepareNewValue(t))!==xt.UNCHANGED){var n=!1,i=zr(this),s=i?{type:"update",object:this,oldValue:r.value,name:e,newValue:t}:null;n,r.setNewValue(t),i&&Wr(this,s)}},ObservableMap2.prototype._addValue=function(e,t){var r=this;He(this._keysAtom),Lr((function(){var n=new ut(t,r.enhancer,r.name+"."+v(e),!1);r._data.set(e,n),t=n.value,r._updateHasMapEntry(e,!0),r._keysAtom.reportChanged()}));var n=!1,i=zr(this);i&&Wr(this,i?{type:"add",object:this,name:e,newValue:t}:null)},ObservableMap2.prototype.get=function(e){return this.has(e)?this.dehanceValue(this._data.get(e).get()):this.dehanceValue(void 0)},ObservableMap2.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},ObservableMap2.prototype.keys=function(){return this._keysAtom.reportObserved(),this._data.keys()},ObservableMap2.prototype.values=function(){var e=this,t=this.keys();return _n({next:function(){var r=t.next(),n=r.done,i=r.value;return{done:n,value:n?void 0:e.get(i)}}})},ObservableMap2.prototype.entries=function(){var e=this,t=this.keys();return _n({next:function(){var r=t.next(),n=r.done,i=r.value;return{done:n,value:n?void 0:[i,e.get(i)]}}})},ObservableMap2.prototype[(Zr=w,Symbol.iterator)]=function(){return this.entries()},ObservableMap2.prototype.forEach=function(e,t){var r,n;try{for(var i=Z(this),s=i.next();!s.done;s=i.next()){var o=X(s.value,2),a=o[0],l=o[1];e.call(t,l,a,this)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}},ObservableMap2.prototype.merge=function(e){var t=this;return en(e)&&(e=e.toJS()),Lr((function(){var r=at(!0);try{h(e)?b(e).forEach((function(r){return t.set(r,e[r])})):Array.isArray(e)?e.forEach((function(e){var r=X(e,2),n=r[0],i=r[1];return t.set(n,i)})):g(e)?(e.constructor!==Map&&a("Cannot initialize from classes that inherit from Map: "+e.constructor.name),e.forEach((function(e,r){return t.set(r,e)}))):null!=e&&a("Cannot initialize map from "+e)}finally{lt(r)}})),this},ObservableMap2.prototype.clear=function(){var e=this;Lr((function(){We((function(){var t,r;try{for(var n=Z(e.keys()),i=n.next();!i.done;i=n.next()){var s=i.value;e.delete(s)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}}))}))},ObservableMap2.prototype.replace=function(e){var t=this;return Lr((function(){var r,n,i,s,o=function(e){if(g(e)||en(e))return e;if(Array.isArray(e))return new Map(e);if(h(e)){var t=new Map;for(var r in e)t.set(r,e[r]);return t}return a("Cannot convert to map from '"+e+"'")}(e),l=new Map,c=!1;try{for(var u=Z(t._data.keys()),d=u.next();!d.done;d=u.next()){var p=d.value;if(!o.has(p))if(t.delete(p))c=!0;else{var m=t._data.get(p);l.set(p,m)}}}catch(e){r={error:e}}finally{try{d&&!d.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}try{for(var f=Z(o.entries()),y=f.next();!y.done;y=f.next()){var b=X(y.value,2),v=(p=b[0],m=b[1],t._data.has(p));if(t.set(p,m),t._data.has(p)){var _=t._data.get(p);l.set(p,_),v||(c=!0)}}}catch(e){i={error:e}}finally{try{y&&!y.done&&(s=f.return)&&s.call(f)}finally{if(i)throw i.error}}if(!c)if(t._data.size!==l.size)t._keysAtom.reportChanged();else for(var x=t._data.keys(),w=l.keys(),R=x.next(),k=w.next();!R.done;){if(R.value!==k.value){t._keysAtom.reportChanged();break}R=x.next(),k=w.next()}t._data=l})),this},Object.defineProperty(ObservableMap2.prototype,"size",{get:function(){return this._keysAtom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),ObservableMap2.prototype.toPOJO=function(){var e,t,r={};try{for(var n=Z(this),i=n.next();!i.done;i=n.next()){var s=X(i.value,2),o=s[0],a=s[1];r["symbol"==typeof o?o:v(o)]=a}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return r},ObservableMap2.prototype.toJS=function(){return new Map(this)},ObservableMap2.prototype.toJSON=function(){return this.toPOJO()},ObservableMap2.prototype.toString=function(){var e=this;return this.name+"[{ "+Array.from(this.keys()).map((function(t){return v(t)+": "+e.get(t)})).join(", ")+" }]"},ObservableMap2.prototype.observe=function(e,t){return Gr(this,e)},ObservableMap2.prototype.intercept=function(e){return Hr(this,e)},ObservableMap2}(),en=m("ObservableMap",Qr),tn={},rn=function(){function ObservableSet2(e,t,r){if(void 0===t&&(t=oe),void 0===r&&(r="ObservableSet@"+o()),this.name=r,this[Yr]=tn,this._data=new Set,this._atom=j(this.name),this[Symbol.toStringTag]="Set","function"!=typeof Set)throw new Error("mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js");this.enhancer=function(e,n){return t(e,n,r)},e&&this.replace(e)}return ObservableSet2.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},ObservableSet2.prototype.clear=function(){var e=this;Lr((function(){We((function(){var t,r;try{for(var n=Z(e._data.values()),i=n.next();!i.done;i=n.next()){var s=i.value;e.delete(s)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}}))}))},ObservableSet2.prototype.forEach=function(e,t){var r,n;try{for(var i=Z(this),s=i.next();!s.done;s=i.next()){var o=s.value;e.call(t,o,o,this)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}},Object.defineProperty(ObservableSet2.prototype,"size",{get:function(){return this._atom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),ObservableSet2.prototype.add=function(e){var t=this;if((He(this._atom),jr(this))&&!(i=Ur(this,{type:"add",object:this,newValue:e})))return this;if(!this.has(e)){Lr((function(){t._data.add(t.enhancer(e,void 0)),t._atom.reportChanged()}));var r=!1,n=zr(this),i=n?{type:"add",object:this,newValue:e}:null;r,n&&Wr(this,i)}return this},ObservableSet2.prototype.delete=function(e){var t=this;if(jr(this)&&!(n=Ur(this,{type:"delete",object:this,oldValue:e})))return!1;if(this.has(e)){var r=zr(this),n=r?{type:"delete",object:this,oldValue:e}:null;return Lr((function(){t._atom.reportChanged(),t._data.delete(e)})),r&&Wr(this,n),!0}return!1},ObservableSet2.prototype.has=function(e){return this._atom.reportObserved(),this._data.has(this.dehanceValue(e))},ObservableSet2.prototype.entries=function(){var e=0,t=Array.from(this.keys()),r=Array.from(this.values());return _n({next:function(){var n=e;return e+=1,n<r.length?{value:[t[n],r[n]],done:!1}:{done:!0}}})},ObservableSet2.prototype.keys=function(){return this.values()},ObservableSet2.prototype.values=function(){this._atom.reportObserved();var e=this,t=0,r=Array.from(this._data.values());return _n({next:function(){return t<r.length?{value:e.dehanceValue(r[t++]),done:!1}:{done:!0}}})},ObservableSet2.prototype.replace=function(e){var t=this;return nn(e)&&(e=e.toJS()),Lr((function(){var r=at(!0);try{Array.isArray(e)||y(e)?(t.clear(),e.forEach((function(e){return t.add(e)}))):null!=e&&a("Cannot initialize set from "+e)}finally{lt(r)}})),this},ObservableSet2.prototype.observe=function(e,t){return Gr(this,e)},ObservableSet2.prototype.intercept=function(e){return Hr(this,e)},ObservableSet2.prototype.toJS=function(){return new Set(this)},ObservableSet2.prototype.toString=function(){return this.name+"[ "+Array.from(this).join(", ")+" ]"},ObservableSet2.prototype[(Yr=w,Symbol.iterator)]=function(){return this.values()},ObservableSet2}(),nn=m("ObservableSet",rn),sn=function(){function ObservableObjectAdministration2(e,t,r,n){void 0===t&&(t=new Map),this.target=e,this.values=t,this.name=r,this.defaultEnhancer=n,this.keysAtom=new R(r+".keys")}return ObservableObjectAdministration2.prototype.read=function(e){return this.values.get(e).get()},ObservableObjectAdministration2.prototype.write=function(e,t){var r=this.target,n=this.values.get(e);if(n instanceof ht)n.set(t);else{if(jr(this)){if(!(o=Ur(this,{type:"update",object:this.proxy||r,name:e,newValue:t})))return;t=o.newValue}if((t=n.prepareNewValue(t))!==xt.UNCHANGED){var i=zr(this),s=!1,o=i?{type:"update",object:this.proxy||r,oldValue:n.value,name:e,newValue:t}:null;s,n.setNewValue(t),i&&Wr(this,o)}}},ObservableObjectAdministration2.prototype.has=function(e){var t=this.pendingKeys||(this.pendingKeys=new Map),r=t.get(e);if(r)return r.get();var n=!!this.values.get(e);return r=new ut(n,ae,this.name+"."+v(e)+"?",!1),t.set(e,r),r.get()},ObservableObjectAdministration2.prototype.addObservableProp=function(e,t,r){void 0===r&&(r=this.defaultEnhancer);var n=this.target;if(jr(this)){var i=Ur(this,{object:this.proxy||n,name:e,type:"add",newValue:t});if(!i)return;t=i.newValue}var s=new ut(t,r,this.name+"."+v(e),!1);this.values.set(e,s),t=s.value,Object.defineProperty(n,e,function(e){return an[e]||(an[e]={configurable:!0,enumerable:!0,get:function(){return this[w].read(e)},set:function(t){this[w].write(e,t)}})}(e)),this.notifyPropertyAddition(e,t)},ObservableObjectAdministration2.prototype.addComputedProp=function(e,t,r){var n,i,s,o=this.target;r.name=r.name||this.name+"."+v(t),this.values.set(t,new ht(r)),(e===o||(n=e,i=t,!(s=Object.getOwnPropertyDescriptor(n,i))||!1!==s.configurable&&!1!==s.writable))&&Object.defineProperty(e,t,function(e){return ln[e]||(ln[e]={configurable:xt.computedConfigurable,enumerable:!1,get:function(){return cn(this).read(e)},set:function(t){cn(this).write(e,t)}})}(t))},ObservableObjectAdministration2.prototype.remove=function(e){if(this.values.has(e)){var t=this.target;if(jr(this))if(!(a=Ur(this,{object:this.proxy||t,name:e,type:"remove"})))return;try{Ct();var r=zr(this),n=!1,i=this.values.get(e),s=i&&i.get();if(i&&i.set(void 0),this.keysAtom.reportChanged(),this.values.delete(e),this.pendingKeys){var o=this.pendingKeys.get(e);o&&o.set(!1)}delete this.target[e];var a=r?{type:"remove",object:this.proxy||t,oldValue:s,name:e}:null;n,r&&Wr(this,a)}finally{At()}}},ObservableObjectAdministration2.prototype.illegalAccess=function(e,t){console.warn("Property '"+t+"' of '"+e+"' was accessed through the prototype chain. Use 'decorate' instead to declare the prop or access it statically through it's owner")},ObservableObjectAdministration2.prototype.observe=function(e,t){return Gr(this,e)},ObservableObjectAdministration2.prototype.intercept=function(e){return Hr(this,e)},ObservableObjectAdministration2.prototype.notifyPropertyAddition=function(e,t){var r=zr(this),n=r?{type:"add",object:this.proxy||this.target,name:e,newValue:t}:null;if(r&&Wr(this,n),this.pendingKeys){var i=this.pendingKeys.get(e);i&&i.set(!0)}this.keysAtom.reportChanged()},ObservableObjectAdministration2.prototype.getKeys=function(){var e,t;this.keysAtom.reportObserved();var r=[];try{for(var n=Z(this.values),i=n.next();!i.done;i=n.next()){var s=X(i.value,2),o=s[0];s[1]instanceof ut&&r.push(o)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return r},ObservableObjectAdministration2}();function on(e,t,r){if(void 0===t&&(t=""),void 0===r&&(r=oe),Object.prototype.hasOwnProperty.call(e,w))return e[w];h(e)||(t=(e.constructor.name||"ObservableObject")+"@"+o()),t||(t="ObservableObject@"+o());var n=new sn(e,new Map,v(t),r);return p(e,w,n),n}var an=Object.create(null),ln=Object.create(null);function cn(e){var t=e[w];return t||(ie(e),e[w])}var un=m("ObservableObjectAdministration",sn);function dn(e){return!!d(e)&&(ie(e),un(e[w]))}function hn(e,t){if("object"==typeof e&&null!==e){if(Xr(e))return void 0!==t&&a(!1),e[w].atom;if(nn(e))return e[w];if(en(e)){var r=e;return void 0===t?r._keysAtom:((n=r._data.get(t)||r._hasMap.get(t))||a(!1),n)}var n;if(ie(e),t&&!e[w]&&e[t],dn(e))return t?((n=e[w].values.get(t))||a(!1),n):a(!1);if(k(e)||pt(e)||Bt(e))return e}else if("function"==typeof e&&Bt(e[w]))return e[w];return a(!1)}function pn(e,t){return e||a("Expecting some object"),void 0!==t?pn(hn(e,t)):k(e)||pt(e)||Bt(e)||en(e)||nn(e)?e:(ie(e),e[w]?e[w]:void a(!1))}function mn(e,t){return(void 0!==t?hn(e,t):dn(e)||en(e)||nn(e)?pn(e):hn(e)).name}var fn=Object.prototype.toString;function gn(e,t,r){return void 0===r&&(r=-1),yn(e,t,r)}function yn(e,t,r,n,i){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return!1;if(e!=e)return t!=t;var s=typeof e;if("function"!==s&&"object"!==s&&"object"!=typeof t)return!1;var o=fn.call(e);if(o!==fn.call(t))return!1;switch(o){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:0==+e?1/+e==1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return"undefined"!=typeof Symbol&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t);case"[object Map]":case"[object Set]":r>=0&&r++}e=bn(e),t=bn(t);var a="[object Array]"===o;if(!a){if("object"!=typeof e||"object"!=typeof t)return!1;var l=e.constructor,c=t.constructor;if(l!==c&&!("function"==typeof l&&l instanceof l&&"function"==typeof c&&c instanceof c)&&"constructor"in e&&"constructor"in t)return!1}if(0===r)return!1;r<0&&(r=-1),i=i||[];for(var u=(n=n||[]).length;u--;)if(n[u]===e)return i[u]===t;if(n.push(e),i.push(t),a){if((u=e.length)!==t.length)return!1;for(;u--;)if(!yn(e[u],t[u],r-1,n,i))return!1}else{var d=Object.keys(e),h=void 0;if(u=d.length,Object.keys(t).length!==u)return!1;for(;u--;)if(!vn(t,h=d[u])||!yn(e[h],t[h],r-1,n,i))return!1}return n.pop(),i.pop(),!0}function bn(e){return Xr(e)?e.slice():g(e)||en(e)||y(e)||nn(e)?Array.from(e.entries()):e}function vn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function _n(e){return e[Symbol.iterator]=xn,e}function xn(){return this}if("undefined"==typeof Proxy||"undefined"==typeof Symbol)throw new Error("[mobx] MobX 5+ requires Proxy and Symbol objects. If your environment doesn't support Symbol or Proxy objects, please downgrade to MobX 4. For React Native Android, consider upgrading JSCore.");"object"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:jt,extras:{getDebugName:mn},$mobx:w})},28578:e=>{"use strict";var t=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,i){for(var s,o,a=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),l=1;l<arguments.length;l++){for(var c in s=Object(arguments[l]))r.call(s,c)&&(a[c]=s[c]);if(t){o=t(s);for(var u=0;u<o.length;u++)n.call(s,o[u])&&(a[o[u]]=s[o[u]])}}return a}},68857:e=>{"use strict";var t=function(e){return e!=e};e.exports=function(e,r){return 0===e&&0===r?1/e==1/r:e===r||!(!t(e)||!t(r))}},93063:(e,t,r)=>{"use strict";var n=r(64450),i=r(84481),s=r(68857),o=r(59500),a=r(37062),l=i(o(),Object);n(l,{getPolyfill:o,implementation:s,shim:a}),e.exports=l},59500:(e,t,r)=>{"use strict";var n=r(68857);e.exports=function(){return"function"==typeof Object.is?Object.is:n}},37062:(e,t,r)=>{"use strict";var n=r(59500),i=r(64450);e.exports=function(){var e=n();return i(Object,{is:e},{is:function(){return Object.is!==e}}),e}},58309:(e,t,r)=>{"use strict";var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,s=Object.prototype.toString,o=r(96923),a=Object.prototype.propertyIsEnumerable,l=!a.call({toString:null},"toString"),c=a.call((function(){}),"prototype"),u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],d=function(e){var t=e.constructor;return t&&t.prototype===e},h={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},p=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!h["$"+e]&&i.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{d(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();n=function(e){var t=null!==e&&"object"==typeof e,r="[object Function]"===s.call(e),n=o(e),a=t&&"[object String]"===s.call(e),h=[];if(!t&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var m=c&&r;if(a&&e.length>0&&!i.call(e,0))for(var f=0;f<e.length;++f)h.push(String(f));if(n&&e.length>0)for(var g=0;g<e.length;++g)h.push(String(g));else for(var y in e)m&&"prototype"===y||!i.call(e,y)||h.push(String(y));if(l)for(var b=function(e){if("undefined"==typeof window||!p)return d(e);try{return d(e)}catch(e){return!1}}(e),v=0;v<u.length;++v)b&&"constructor"===u[v]||!i.call(e,u[v])||h.push(u[v]);return h}}e.exports=n},93267:(e,t,r)=>{"use strict";var n=Array.prototype.slice,i=r(96923),s=Object.keys,o=s?function(e){return s(e)}:r(58309),a=Object.keys;o.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return i(e)?a(n.call(e)):a(e)})}else Object.keys=o;return Object.keys||o},e.exports=o},96923:e=>{"use strict";var t=Object.prototype.toString;e.exports=function(e){var r=t.call(e),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),n}},81126:function(e){e.exports=function(){"use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function r(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}var n=function Node2(t,r){e(this,Node2),this.next=null,this.key=t,this.data=r,this.left=null,this.right=null};function DEFAULT_COMPARE(e,t){return e>t?1:e<t?-1:0}function i(e,t,r){for(var i=new n(null,null),s=i,o=i;;){var a=r(e,t.key);if(a<0){if(null===t.left)break;if(r(e,t.left.key)<0){var l=t.left;if(t.left=l.right,l.right=t,null===(t=l).left)break}o.left=t,o=t,t=t.left}else{if(!(a>0))break;if(null===t.right)break;if(r(e,t.right.key)>0){var c=t.right;if(t.right=c.left,c.left=t,null===(t=c).right)break}s.right=t,s=t,t=t.right}}return s.right=t.left,o.left=t.right,t.left=i.right,t.right=i.left,t}function s(e,t,r,s){var o=new n(e,t);if(null===r)return o.left=o.right=null,o;var a=s(e,(r=i(e,r,s)).key);return a<0?(o.left=r.left,o.right=r,r.left=null):a>=0&&(o.right=r.right,o.left=r,r.right=null),o}function o(e,t,r){var n=null,s=null;if(t){var o=r((t=i(e,t,r)).key,e);0===o?(n=t.left,s=t.right):o<0?(s=t.right,t.right=null,n=t):(n=t.left,t.left=null,s=t)}return{left:n,right:s}}function a(e,t,r){return null===t?e:(null===e||((t=i(e.key,t,r)).left=e),t)}function l(e,t,r,n,i){if(e){n("".concat(t).concat(r?"└── ":"├── ").concat(i(e),"\n"));var s=t+(r?"    ":"│   ");e.left&&l(e.left,s,!1,n,i),e.right&&l(e.right,s,!0,n,i)}}var c=function(){function Tree2(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:DEFAULT_COMPARE;e(this,Tree2),this._root=null,this._size=0,this._comparator=t}return r(Tree2,[{key:"insert",value:function(e,t){return this._size++,this._root=s(e,t,this._root,this._comparator)}},{key:"add",value:function(e,t){var r=new n(e,t);null===this._root&&(r.left=r.right=null,this._size++,this._root=r);var s=this._comparator,o=i(e,this._root,s),a=s(e,o.key);return 0===a?this._root=o:(a<0?(r.left=o.left,r.right=o,o.left=null):a>0&&(r.right=o.right,r.left=o,o.right=null),this._size++,this._root=r),this._root}},{key:"remove",value:function(e){this._root=this._remove(e,this._root,this._comparator)}},{key:"_remove",value:function(e,t,r){var n;return null===t?null:0===r(e,(t=i(e,t,r)).key)?(null===t.left?n=t.right:(n=i(e,t.left,r)).right=t.right,this._size--,n):t}},{key:"pop",value:function(){var e=this._root;if(e){for(;e.left;)e=e.left;return this._root=i(e.key,this._root,this._comparator),this._root=this._remove(e.key,this._root,this._comparator),{key:e.key,data:e.data}}return null}},{key:"findStatic",value:function(e){for(var t=this._root,r=this._comparator;t;){var n=r(e,t.key);if(0===n)return t;t=n<0?t.left:t.right}return null}},{key:"find",value:function(e){return this._root&&(this._root=i(e,this._root,this._comparator),0!==this._comparator(e,this._root.key))?null:this._root}},{key:"contains",value:function(e){for(var t=this._root,r=this._comparator;t;){var n=r(e,t.key);if(0===n)return!0;t=n<0?t.left:t.right}return!1}},{key:"forEach",value:function(e,t){for(var r=this._root,n=[],i=!1;!i;)null!==r?(n.push(r),r=r.left):0!==n.length?(r=n.pop(),e.call(t,r),r=r.right):i=!0;return this}},{key:"range",value:function(e,t,r,n){for(var i=[],s=this._comparator,o=this._root;0!==i.length||o;)if(o)i.push(o),o=o.left;else{if(s((o=i.pop()).key,t)>0)break;if(s(o.key,e)>=0&&r.call(n,o))return this;o=o.right}return this}},{key:"keys",value:function(){var e=[];return this.forEach((function(t){var r=t.key;return e.push(r)})),e}},{key:"values",value:function(){var e=[];return this.forEach((function(t){var r=t.data;return e.push(r)})),e}},{key:"min",value:function(){return this._root?this.minNode(this._root).key:null}},{key:"max",value:function(){return this._root?this.maxNode(this._root).key:null}},{key:"minNode",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._root;if(e)for(;e.left;)e=e.left;return e}},{key:"maxNode",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._root;if(e)for(;e.right;)e=e.right;return e}},{key:"at",value:function(e){for(var t=this._root,r=!1,n=0,i=[];!r;)if(t)i.push(t),t=t.left;else if(i.length>0){if(t=i.pop(),n===e)return t;n++,t=t.right}else r=!0;return null}},{key:"next",value:function(e){var t=this._root,r=null;if(e.right){for(r=e.right;r.left;)r=r.left;return r}for(var n=this._comparator;t;){var i=n(e.key,t.key);if(0===i)break;i<0?(r=t,t=t.left):t=t.right}return r}},{key:"prev",value:function(e){var t=this._root,r=null;if(null!==e.left){for(r=e.left;r.right;)r=r.right;return r}for(var n=this._comparator;t;){var i=n(e.key,t.key);if(0===i)break;i<0?t=t.left:(r=t,t=t.right)}return r}},{key:"clear",value:function(){return this._root=null,this._size=0,this}},{key:"toList",value:function(){return h(this._root)}},{key:"load",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e.length,i=this._comparator;if(r&&f(e,t,0,n-1,i),null===this._root)this._root=u(e,t,0,n),this._size=n;else{var s=m(this.toList(),d(e,t),i);n=this._size+n,this._root=p({head:s},0,n)}return this}},{key:"isEmpty",value:function(){return null===this._root}},{key:"toString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(e){return String(e.key)},t=[];return l(this._root,"",!0,(function(e){return t.push(e)}),e),t.join("")}},{key:"update",value:function(e,t,r){var n=this._comparator,i=o(e,this._root,n),l=i.left,c=i.right;n(e,t)<0?c=s(t,r,c,n):l=s(t,r,l,n),this._root=a(l,c,n)}},{key:"split",value:function(e){return o(e,this._root,this._comparator)}},{key:"size",get:function(){return this._size}},{key:"root",get:function(){return this._root}}]),Tree2}();function u(e,t,r,i){var s=i-r;if(s>0){var o=r+Math.floor(s/2),a=e[o],l=t[o],c=new n(a,l);return c.left=u(e,t,r,o),c.right=u(e,t,o+1,i),c}return null}function d(e,t){for(var r=new n(null,null),i=r,s=0;s<e.length;s++)i=i.next=new n(e[s],t[s]);return i.next=null,r.next}function h(e){for(var t=e,r=[],i=!1,s=new n(null,null),o=s;!i;)t?(r.push(t),t=t.left):r.length>0?t=(t=o=o.next=r.pop()).right:i=!0;return o.next=null,s.next}function p(e,t,r){var n=r-t;if(n>0){var i=t+Math.floor(n/2),s=p(e,t,i),o=e.head;return o.left=s,e.head=e.head.next,o.right=p(e,i+1,r),o}return null}function m(e,t,r){for(var i=new n(null,null),s=i,o=e,a=t;null!==o&&null!==a;)r(o.key,a.key)<0?(s.next=o,o=o.next):(s.next=a,a=a.next),s=s.next;return null!==o?s.next=o:null!==a&&(s.next=a),i.next}function f(e,t,r,n,i){if(!(r>=n)){for(var s=e[r+n>>1],o=r-1,a=n+1;;){do{o++}while(i(e[o],s)<0);do{a--}while(i(e[a],s)>0);if(o>=a)break;var l=e[o];e[o]=e[a],e[a]=l,l=t[o],t[o]=t[a],t[a]=l}f(e,t,r,a,i),f(e,t,a+1,n,i)}}var g=function(e,t){return e.ll.x<=t.x&&t.x<=e.ur.x&&e.ll.y<=t.y&&t.y<=e.ur.y},y=function(e,t){if(t.ur.x<e.ll.x||e.ur.x<t.ll.x||t.ur.y<e.ll.y||e.ur.y<t.ll.y)return null;var r=e.ll.x<t.ll.x?t.ll.x:e.ll.x,n=e.ur.x<t.ur.x?e.ur.x:t.ur.x;return{ll:{x:r,y:e.ll.y<t.ll.y?t.ll.y:e.ll.y},ur:{x:n,y:e.ur.y<t.ur.y?e.ur.y:t.ur.y}}},b=Number.EPSILON;void 0===b&&(b=Math.pow(2,-52));var v=b*b,_=function(e,t){if(-b<e&&e<b&&-b<t&&t<b)return 0;var r=e-t;return r*r<v*e*t?0:e<t?-1:1},x=function(){function PtRounder2(){e(this,PtRounder2),this.reset()}return r(PtRounder2,[{key:"reset",value:function(){this.xRounder=new w,this.yRounder=new w}},{key:"round",value:function(e,t){return{x:this.xRounder.round(e),y:this.yRounder.round(t)}}}]),PtRounder2}(),w=function(){function CoordRounder2(){e(this,CoordRounder2),this.tree=new c,this.round(0)}return r(CoordRounder2,[{key:"round",value:function(e){var t=this.tree.add(e),r=this.tree.prev(t);if(null!==r&&0===_(t.key,r.key))return this.tree.remove(e),r.key;var n=this.tree.next(t);return null!==n&&0===_(t.key,n.key)?(this.tree.remove(e),n.key):e}}]),CoordRounder2}(),R=new x,k=function(e,t){return e.x*t.y-e.y*t.x},j=function(e,t){return e.x*t.x+e.y*t.y},z=function(e,t,r){var n={x:t.x-e.x,y:t.y-e.y},i={x:r.x-e.x,y:r.y-e.y},s=k(n,i);return _(s,0)},q=function(e){return Math.sqrt(j(e,e))},$=function(e,t,r){var n={x:t.x-e.x,y:t.y-e.y},i={x:r.x-e.x,y:r.y-e.y};return k(i,n)/q(i)/q(n)},Z=function(e,t,r){var n={x:t.x-e.x,y:t.y-e.y},i={x:r.x-e.x,y:r.y-e.y};return j(i,n)/q(i)/q(n)},X=function(e,t,r){return 0===t.y?null:{x:e.x+t.x/t.y*(r-e.y),y:r}},Y=function(e,t,r){return 0===t.x?null:{x:r,y:e.y+t.y/t.x*(r-e.x)}},ee=function(e,t,r,n){if(0===t.x)return Y(r,n,e.x);if(0===n.x)return Y(e,t,r.x);if(0===t.y)return X(r,n,e.y);if(0===n.y)return X(e,t,r.y);var i=k(t,n);if(0==i)return null;var s={x:r.x-e.x,y:r.y-e.y},o=k(s,t)/i,a=k(s,n)/i;return{x:(e.x+a*t.x+(r.x+o*n.x))/2,y:(e.y+a*t.y+(r.y+o*n.y))/2}},te=function(){function SweepEvent2(t,r){e(this,SweepEvent2),void 0===t.events?t.events=[this]:t.events.push(this),this.point=t,this.isLeft=r}return r(SweepEvent2,null,[{key:"compare",value:function(e,t){var r=SweepEvent2.comparePoints(e.point,t.point);return 0!==r?r:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:ne.compare(e.segment,t.segment))}},{key:"comparePoints",value:function(e,t){return e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0}}]),r(SweepEvent2,[{key:"link",value:function(e){if(e.point===this.point)throw new Error("Tried to link already linked events");for(var t=e.point.events,r=0,n=t.length;r<n;r++){var i=t[r];this.point.events.push(i),i.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var e=this.point.events.length,t=0;t<e;t++){var r=this.point.events[t];if(void 0===r.segment.consumedBy)for(var n=t+1;n<e;n++){var i=this.point.events[n];void 0===i.consumedBy&&r.otherSE.point.events===i.otherSE.point.events&&r.segment.consume(i.segment)}}}},{key:"getAvailableLinkedEvents",value:function(){for(var e=[],t=0,r=this.point.events.length;t<r;t++){var n=this.point.events[t];n!==this&&!n.segment.ringOut&&n.segment.isInResult()&&e.push(n)}return e}},{key:"getLeftmostComparator",value:function(e){var t=this,r=new Map,n=function(n){var i=n.otherSE;r.set(n,{sine:$(t.point,e.point,i.point),cosine:Z(t.point,e.point,i.point)})};return function(e,t){r.has(e)||n(e),r.has(t)||n(t);var i=r.get(e),s=i.sine,o=i.cosine,a=r.get(t),l=a.sine,c=a.cosine;return s>=0&&l>=0?o<c?1:o>c?-1:0:s<0&&l<0?o<c?-1:o>c?1:0:l<s?-1:l>s?1:0}}}]),SweepEvent2}(),re=0,ne=function(){function Segment2(t,r,n,i){e(this,Segment2),this.id=++re,this.leftSE=t,t.segment=this,t.otherSE=r,this.rightSE=r,r.segment=this,r.otherSE=t,this.rings=n,this.windings=i}return r(Segment2,null,[{key:"compare",value:function(e,t){var r=e.leftSE.point.x,n=t.leftSE.point.x,i=e.rightSE.point.x,s=t.rightSE.point.x;if(s<r)return 1;if(i<n)return-1;var o=e.leftSE.point.y,a=t.leftSE.point.y,l=e.rightSE.point.y,c=t.rightSE.point.y;if(r<n){if(a<o&&a<l)return 1;if(a>o&&a>l)return-1;var u=e.comparePoint(t.leftSE.point);if(u<0)return 1;if(u>0)return-1;var d=t.comparePoint(e.rightSE.point);return 0!==d?d:-1}if(r>n){if(o<a&&o<c)return-1;if(o>a&&o>c)return 1;var h=t.comparePoint(e.leftSE.point);if(0!==h)return h;var p=e.comparePoint(t.rightSE.point);return p<0?1:p>0?-1:1}if(o<a)return-1;if(o>a)return 1;if(i<s){var m=t.comparePoint(e.rightSE.point);if(0!==m)return m}if(i>s){var f=e.comparePoint(t.rightSE.point);if(f<0)return 1;if(f>0)return-1}if(i!==s){var g=l-o,y=i-r,b=c-a,v=s-n;if(g>y&&b<v)return 1;if(g<y&&b>v)return-1}return i>s?1:i<s||l<c?-1:l>c?1:e.id<t.id?-1:e.id>t.id?1:0}}]),r(Segment2,[{key:"replaceRightSE",value:function(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var e=this.leftSE.point.y,t=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e<t?e:t},ur:{x:this.rightSE.point.x,y:e>t?e:t}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}},{key:"comparePoint",value:function(e){if(this.isAnEndpoint(e))return 0;var t=this.leftSE.point,r=this.rightSE.point,n=this.vector();if(t.x===r.x)return e.x===t.x?0:e.x<t.x?1:-1;var i=(e.y-t.y)/n.y,s=t.x+i*n.x;if(e.x===s)return 0;var o=(e.x-t.x)/n.x,a=t.y+o*n.y;return e.y===a?0:e.y<a?-1:1}},{key:"getIntersection",value:function(e){var t=this.bbox(),r=e.bbox(),n=y(t,r);if(null===n)return null;var i=this.leftSE.point,s=this.rightSE.point,o=e.leftSE.point,a=e.rightSE.point,l=g(t,o)&&0===this.comparePoint(o),c=g(r,i)&&0===e.comparePoint(i),u=g(t,a)&&0===this.comparePoint(a),d=g(r,s)&&0===e.comparePoint(s);if(c&&l)return d&&!u?s:!d&&u?a:null;if(c)return u&&i.x===a.x&&i.y===a.y?null:i;if(l)return d&&s.x===o.x&&s.y===o.y?null:o;if(d&&u)return null;if(d)return s;if(u)return a;var h=ee(i,this.vector(),o,e.vector());return null===h?null:g(n,h)?R.round(h.x,h.y):null}},{key:"split",value:function(e){var t=[],r=void 0!==e.events,n=new te(e,!0),i=new te(e,!1),s=this.rightSE;this.replaceRightSE(i),t.push(i),t.push(n);var o=new Segment2(n,s,this.rings.slice(),this.windings.slice());return te.comparePoints(o.leftSE.point,o.rightSE.point)>0&&o.swapEvents(),te.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),r&&(n.checkForConsuming(),i.checkForConsuming()),t}},{key:"swapEvents",value:function(){var e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var t=0,r=this.windings.length;t<r;t++)this.windings[t]*=-1}},{key:"consume",value:function(e){for(var t=this,r=e;t.consumedBy;)t=t.consumedBy;for(;r.consumedBy;)r=r.consumedBy;var n=Segment2.compare(t,r);if(0!==n){if(n>0){var i=t;t=r,r=i}if(t.prev===r){var s=t;t=r,r=s}for(var o=0,a=r.rings.length;o<a;o++){var l=r.rings[o],c=r.windings[o],u=t.rings.indexOf(l);-1===u?(t.rings.push(l),t.windings.push(c)):t.windings[u]+=c}r.rings=null,r.windings=null,r.consumedBy=t,r.leftSE.consumedBy=t.leftSE,r.rightSE.consumedBy=t.rightSE}}},{key:"prevInResult",value:function(){return void 0!==this._prevInResult||(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null),this._prevInResult}},{key:"beforeState",value:function(){if(void 0!==this._beforeState)return this._beforeState;if(this.prev){var e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}else this._beforeState={rings:[],windings:[],multiPolys:[]};return this._beforeState}},{key:"afterState",value:function(){if(void 0!==this._afterState)return this._afterState;var e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};for(var t=this._afterState.rings,r=this._afterState.windings,n=this._afterState.multiPolys,i=0,s=this.rings.length;i<s;i++){var o=this.rings[i],a=this.windings[i],l=t.indexOf(o);-1===l?(t.push(o),r.push(a)):r[l]+=a}for(var c=[],u=[],d=0,h=t.length;d<h;d++)if(0!==r[d]){var p=t[d],m=p.poly;if(-1===u.indexOf(m))if(p.isExterior)c.push(m);else{-1===u.indexOf(m)&&u.push(m);var f=c.indexOf(p.poly);-1!==f&&c.splice(f,1)}}for(var g=0,y=c.length;g<y;g++){var b=c[g].multiPoly;-1===n.indexOf(b)&&n.push(b)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(void 0!==this._isInResult)return this._isInResult;var e=this.beforeState().multiPolys,t=this.afterState().multiPolys;switch(de.type){case"union":var r=0===e.length,n=0===t.length;this._isInResult=r!==n;break;case"intersection":var i,s;e.length<t.length?(i=e.length,s=t.length):(i=t.length,s=e.length),this._isInResult=s===de.numMultiPolys&&i<s;break;case"xor":var o=Math.abs(e.length-t.length);this._isInResult=o%2==1;break;case"difference":var a=function(e){return 1===e.length&&e[0].isSubject};this._isInResult=a(e)!==a(t);break;default:throw new Error("Unrecognized operation type found ".concat(de.type))}return this._isInResult}}],[{key:"fromRing",value:function(e,t,r){var n,i,s,o=te.comparePoints(e,t);if(o<0)n=e,i=t,s=1;else{if(!(o>0))throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));n=t,i=e,s=-1}return new Segment2(new te(n,!0),new te(i,!1),[r],[s])}}]),Segment2}(),ie=function(){function RingIn2(t,r,n){if(e(this,RingIn2),!Array.isArray(t)||0===t.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=r,this.isExterior=n,this.segments=[],"number"!=typeof t[0][0]||"number"!=typeof t[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var i=R.round(t[0][0],t[0][1]);this.bbox={ll:{x:i.x,y:i.y},ur:{x:i.x,y:i.y}};for(var s=i,o=1,a=t.length;o<a;o++){if("number"!=typeof t[o][0]||"number"!=typeof t[o][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var l=R.round(t[o][0],t[o][1]);l.x===s.x&&l.y===s.y||(this.segments.push(ne.fromRing(s,l,this)),l.x<this.bbox.ll.x&&(this.bbox.ll.x=l.x),l.y<this.bbox.ll.y&&(this.bbox.ll.y=l.y),l.x>this.bbox.ur.x&&(this.bbox.ur.x=l.x),l.y>this.bbox.ur.y&&(this.bbox.ur.y=l.y),s=l)}i.x===s.x&&i.y===s.y||this.segments.push(ne.fromRing(s,i,this))}return r(RingIn2,[{key:"getSweepEvents",value:function(){for(var e=[],t=0,r=this.segments.length;t<r;t++){var n=this.segments[t];e.push(n.leftSE),e.push(n.rightSE)}return e}}]),RingIn2}(),se=function(){function PolyIn2(t,r){if(e(this,PolyIn2),!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new ie(t[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(var n=1,i=t.length;n<i;n++){var s=new ie(t[n],this,!1);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.interiorRings.push(s)}this.multiPoly=r}return r(PolyIn2,[{key:"getSweepEvents",value:function(){for(var e=this.exteriorRing.getSweepEvents(),t=0,r=this.interiorRings.length;t<r;t++)for(var n=this.interiorRings[t].getSweepEvents(),i=0,s=n.length;i<s;i++)e.push(n[i]);return e}}]),PolyIn2}(),oe=function(){function MultiPolyIn2(t,r){if(e(this,MultiPolyIn2),!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{"number"==typeof t[0][0][0]&&(t=[t])}catch(e){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var n=0,i=t.length;n<i;n++){var s=new se(t[n],this);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.polys.push(s)}this.isSubject=r}return r(MultiPolyIn2,[{key:"getSweepEvents",value:function(){for(var e=[],t=0,r=this.polys.length;t<r;t++)for(var n=this.polys[t].getSweepEvents(),i=0,s=n.length;i<s;i++)e.push(n[i]);return e}}]),MultiPolyIn2}(),ae=function(){function RingOut2(t){e(this,RingOut2),this.events=t;for(var r=0,n=t.length;r<n;r++)t[r].segment.ringOut=this;this.poly=null}return r(RingOut2,null,[{key:"factory",value:function(e){for(var t=[],r=0,n=e.length;r<n;r++){var i=e[r];if(i.isInResult()&&!i.ringOut){for(var s=null,o=i.leftSE,a=i.rightSE,l=[o],c=o.point,u=[];s=o,o=a,l.push(o),o.point!==c;)for(;;){var d=o.getAvailableLinkedEvents();if(0===d.length){var h=l[0].point,p=l[l.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(h.x,",")+" ".concat(h.y,"]. Last matching segment found ends at")+" [".concat(p.x,", ").concat(p.y,"]."))}if(1===d.length){a=d[0].otherSE;break}for(var m=null,f=0,g=u.length;f<g;f++)if(u[f].point===o.point){m=f;break}if(null===m){u.push({index:l.length,point:o.point});var y=o.getLeftmostComparator(s);a=d.sort(y)[0].otherSE;break}var b=u.splice(m)[0],v=l.splice(b.index);v.unshift(v[0].otherSE),t.push(new RingOut2(v.reverse()))}t.push(new RingOut2(l))}}return t}}]),r(RingOut2,[{key:"getGeom",value:function(){for(var e=this.events[0].point,t=[e],r=1,n=this.events.length-1;r<n;r++){var i=this.events[r].point,s=this.events[r+1].point;0!==z(i,e,s)&&(t.push(i),e=i)}if(1===t.length)return null;var o=t[0],a=t[1];0===z(o,e,a)&&t.shift(),t.push(t[0]);for(var l=this.isExteriorRing()?1:-1,c=this.isExteriorRing()?0:t.length-1,u=this.isExteriorRing()?t.length:-1,d=[],h=c;h!=u;h+=l)d.push([t[h].x,t[h].y]);return d}},{key:"isExteriorRing",value:function(){if(void 0===this._isExteriorRing){var e=this.enclosingRing();this._isExteriorRing=!e||!e.isExteriorRing()}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return void 0===this._enclosingRing&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var e=this.events[0],t=1,r=this.events.length;t<r;t++){var n=this.events[t];te.compare(e,n)>0&&(e=n)}for(var i=e.segment.prevInResult(),s=i?i.prevInResult():null;;){if(!i)return null;if(!s)return i.ringOut;if(s.ringOut!==i.ringOut)return s.ringOut.enclosingRing()!==i.ringOut?i.ringOut:i.ringOut.enclosingRing();i=s.prevInResult(),s=i?i.prevInResult():null}}}]),RingOut2}(),le=function(){function PolyOut2(t){e(this,PolyOut2),this.exteriorRing=t,t.poly=this,this.interiorRings=[]}return r(PolyOut2,[{key:"addInterior",value:function(e){this.interiorRings.push(e),e.poly=this}},{key:"getGeom",value:function(){var e=[this.exteriorRing.getGeom()];if(null===e[0])return null;for(var t=0,r=this.interiorRings.length;t<r;t++){var n=this.interiorRings[t].getGeom();null!==n&&e.push(n)}return e}}]),PolyOut2}(),ce=function(){function MultiPolyOut2(t){e(this,MultiPolyOut2),this.rings=t,this.polys=this._composePolys(t)}return r(MultiPolyOut2,[{key:"getGeom",value:function(){for(var e=[],t=0,r=this.polys.length;t<r;t++){var n=this.polys[t].getGeom();null!==n&&e.push(n)}return e}},{key:"_composePolys",value:function(e){for(var t=[],r=0,n=e.length;r<n;r++){var i=e[r];if(!i.poly)if(i.isExteriorRing())t.push(new le(i));else{var s=i.enclosingRing();s.poly||t.push(new le(s)),s.poly.addInterior(i)}}return t}}]),MultiPolyOut2}(),ue=function(){function SweepLine2(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ne.compare;e(this,SweepLine2),this.queue=t,this.tree=new c(r),this.segments=[]}return r(SweepLine2,[{key:"process",value:function(e){var t=e.segment,r=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(t),r;var n=e.isLeft?this.tree.insert(t):this.tree.find(t);if(!n)throw new Error("Unable to find segment #".concat(t.id," ")+"[".concat(t.leftSE.point.x,", ").concat(t.leftSE.point.y,"] -> ")+"[".concat(t.rightSE.point.x,", ").concat(t.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var i=n,s=n,o=void 0,a=void 0;void 0===o;)null===(i=this.tree.prev(i))?o=null:void 0===i.key.consumedBy&&(o=i.key);for(;void 0===a;)null===(s=this.tree.next(s))?a=null:void 0===s.key.consumedBy&&(a=s.key);if(e.isLeft){var l=null;if(o){var c=o.getIntersection(t);if(null!==c&&(t.isAnEndpoint(c)||(l=c),!o.isAnEndpoint(c)))for(var u=this._splitSafely(o,c),d=0,h=u.length;d<h;d++)r.push(u[d])}var p=null;if(a){var m=a.getIntersection(t);if(null!==m&&(t.isAnEndpoint(m)||(p=m),!a.isAnEndpoint(m)))for(var f=this._splitSafely(a,m),g=0,y=f.length;g<y;g++)r.push(f[g])}if(null!==l||null!==p){var b=null;b=null===l?p:null===p||te.comparePoints(l,p)<=0?l:p,this.queue.remove(t.rightSE),r.push(t.rightSE);for(var v=t.split(b),_=0,x=v.length;_<x;_++)r.push(v[_])}r.length>0?(this.tree.remove(t),r.push(e)):(this.segments.push(t),t.prev=o)}else{if(o&&a){var w=o.getIntersection(a);if(null!==w){if(!o.isAnEndpoint(w))for(var R=this._splitSafely(o,w),k=0,j=R.length;k<j;k++)r.push(R[k]);if(!a.isAnEndpoint(w))for(var z=this._splitSafely(a,w),q=0,$=z.length;q<$;q++)r.push(z[q])}}this.tree.remove(t)}return r}},{key:"_splitSafely",value:function(e,t){this.tree.remove(e);var r=e.rightSE;this.queue.remove(r);var n=e.split(t);return n.push(r),void 0===e.consumedBy&&this.tree.insert(e),n}}]),SweepLine2}(),de=new(function(){function Operation2(){e(this,Operation2)}return r(Operation2,[{key:"run",value:function(e,t,r){de.type=e,R.reset();for(var n=[new oe(t,!0)],i=0,s=r.length;i<s;i++)n.push(new oe(r[i],!1));if(de.numMultiPolys=n.length,"difference"===de.type)for(var o=n[0],a=1;a<n.length;)null!==y(n[a].bbox,o.bbox)?a++:n.splice(a,1);if("intersection"===de.type)for(var l=0,u=n.length;l<u;l++)for(var d=n[l],h=l+1,p=n.length;h<p;h++)if(null===y(d.bbox,n[h].bbox))return[];for(var m=new c(te.compare),f=0,g=n.length;f<g;f++)for(var b=n[f].getSweepEvents(),v=0,_=b.length;v<_;v++)m.insert(b[v]);for(var x=new ue(m),w=m.size,k=m.pop();k;){var j=k.key;if(m.size===w){var z=j.segment;throw new Error("Unable to pop() ".concat(j.isLeft?"left":"right"," SweepEvent ")+"[".concat(j.point.x,", ").concat(j.point.y,"] from segment #").concat(z.id," ")+"[".concat(z.leftSE.point.x,", ").concat(z.leftSE.point.y,"] -> ")+"[".concat(z.rightSE.point.x,", ").concat(z.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}for(var q=x.process(j),$=0,Z=q.length;$<Z;$++){var X=q[$];void 0===X.consumedBy&&m.insert(X)}w=m.size,k=m.pop()}R.reset();var Y=ae.factory(x.segments);return new ce(Y).getGeom()}}]),Operation2}()),he=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return de.run("union",e,r)},pe=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return de.run("intersection",e,r)},me=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return de.run("xor",e,r)},fe=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return de.run("difference",e,r)};return{union:he,intersection:pe,xor:me,difference:fe}}()},12092:(e,t,r)=>{"use strict";var n=r(58539);function i(){}function s(){}s.resetWarningCache=i,e.exports=function(){function e(e,t,r,i,s,o){if(o!==n){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:s,resetWarningCache:i};return r.PropTypes=r,r}},69722:(e,t,r)=>{e.exports=r(12092)()},58539:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},40353:(e,t,r)=>{const n=r(49987),i=r(13627),s=r(61777),o=r(78214);function a(e,t,r,s,o){const a=[].slice.call(arguments,1),l=a.length,c="function"==typeof a[l-1];if(!c&&!n())throw new Error("Callback required as last argument");if(!c){if(l<1)throw new Error("Too few arguments provided");return 1===l?(r=t,t=s=void 0):2!==l||t.getContext||(s=r,r=t,t=void 0),new Promise((function(n,o){try{const o=i.create(r,s);n(e(o,t,s))}catch(e){o(e)}}))}if(l<2)throw new Error("Too few arguments provided");2===l?(o=r,r=t,t=s=void 0):3===l&&(t.getContext&&void 0===o?(o=s,s=void 0):(o=s,s=r,r=t,t=void 0));try{const n=i.create(r,s);o(null,e(n,t,s))}catch(e){o(e)}}t.create=i.create,t.toCanvas=a.bind(null,s.render),t.toDataURL=a.bind(null,s.renderToDataURL),t.toString=a.bind(null,(function(e,t,r){return o.render(e,r)}))},49987:e=>{e.exports=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then}},59095:(e,t,r)=>{const n=r(86704).getSymbolSize;t.getRowColCoords=function(e){if(1===e)return[];const t=Math.floor(e/7)+2,r=n(e),i=145===r?26:2*Math.ceil((r-13)/(2*t-2)),s=[r-7];for(let e=1;e<t-1;e++)s[e]=s[e-1]-i;return s.push(6),s.reverse()},t.getPositions=function(e){const r=[],n=t.getRowColCoords(e),i=n.length;for(let e=0;e<i;e++)for(let t=0;t<i;t++)0===e&&0===t||0===e&&t===i-1||e===i-1&&0===t||r.push([n[e],n[t]]);return r}},73907:(e,t,r)=>{const n=r(12822),i=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function AlphanumericData(e){this.mode=n.ALPHANUMERIC,this.data=e}AlphanumericData.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},AlphanumericData.prototype.getLength=function(){return this.data.length},AlphanumericData.prototype.getBitsLength=function(){return AlphanumericData.getBitsLength(this.data.length)},AlphanumericData.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let r=45*i.indexOf(this.data[t]);r+=i.indexOf(this.data[t+1]),e.put(r,11)}this.data.length%2&&e.put(i.indexOf(this.data[t]),6)},e.exports=AlphanumericData},77937:e=>{function BitBuffer(){this.buffer=[],this.length=0}BitBuffer.prototype={get:function(e){const t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(let r=0;r<t;r++)this.putBit(1==(e>>>t-r-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},e.exports=BitBuffer},35606:e=>{function BitMatrix(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}BitMatrix.prototype.set=function(e,t,r,n){const i=e*this.size+t;this.data[i]=r,n&&(this.reservedBit[i]=!0)},BitMatrix.prototype.get=function(e,t){return this.data[e*this.size+t]},BitMatrix.prototype.xor=function(e,t,r){this.data[e*this.size+t]^=r},BitMatrix.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},e.exports=BitMatrix},74888:(e,t,r)=>{const n=r(17583),i=r(12822);function ByteData(e){this.mode=i.BYTE,"string"==typeof e&&(e=n(e)),this.data=new Uint8Array(e)}ByteData.getBitsLength=function(e){return 8*e},ByteData.prototype.getLength=function(){return this.data.length},ByteData.prototype.getBitsLength=function(){return ByteData.getBitsLength(this.data.length)},ByteData.prototype.write=function(e){for(let t=0,r=this.data.length;t<r;t++)e.put(this.data[t],8)},e.exports=ByteData},77672:(e,t,r)=>{const n=r(68059),i=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],s=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];t.getBlocksCount=function(e,t){switch(t){case n.L:return i[4*(e-1)+0];case n.M:return i[4*(e-1)+1];case n.Q:return i[4*(e-1)+2];case n.H:return i[4*(e-1)+3];default:return}},t.getTotalCodewordsCount=function(e,t){switch(t){case n.L:return s[4*(e-1)+0];case n.M:return s[4*(e-1)+1];case n.Q:return s[4*(e-1)+2];case n.H:return s[4*(e-1)+3];default:return}}},68059:(e,t)=>{t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2},t.isValid=function(e){return e&&void 0!==e.bit&&e.bit>=0&&e.bit<4},t.from=function(e,r){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+e)}}(e)}catch(e){return r}}},65954:(e,t,r)=>{const n=r(86704).getSymbolSize;t.getPositions=function(e){const t=n(e);return[[0,0],[t-7,0],[0,t-7]]}},13579:(e,t,r)=>{const n=r(86704),i=n.getBCHDigit(1335);t.getEncodedBits=function(e,t){const r=e.bit<<3|t;let s=r<<10;for(;n.getBCHDigit(s)-i>=0;)s^=1335<<n.getBCHDigit(s)-i;return 21522^(r<<10|s)}},44885:(e,t)=>{const r=new Uint8Array(512),n=new Uint8Array(256);!function(){let e=1;for(let t=0;t<255;t++)r[t]=e,n[e]=t,e<<=1,256&e&&(e^=285);for(let e=255;e<512;e++)r[e]=r[e-255]}(),t.log=function(e){if(e<1)throw new Error("log("+e+")");return n[e]},t.exp=function(e){return r[e]},t.mul=function(e,t){return 0===e||0===t?0:r[n[e]+n[t]]}},9395:(e,t,r)=>{const n=r(12822),i=r(86704);function KanjiData(e){this.mode=n.KANJI,this.data=e}KanjiData.getBitsLength=function(e){return 13*e},KanjiData.prototype.getLength=function(){return this.data.length},KanjiData.prototype.getBitsLength=function(){return KanjiData.getBitsLength(this.data.length)},KanjiData.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let r=i.toSJIS(this.data[t]);if(r>=33088&&r<=40956)r-=33088;else{if(!(r>=57408&&r<=60351))throw new Error("Invalid SJIS character: "+this.data[t]+"\nMake sure your charset is UTF-8");r-=49472}r=192*(r>>>8&255)+(255&r),e.put(r,13)}},e.exports=KanjiData},50934:(e,t)=>{t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const r=3,n=3,i=40,s=10;function o(e,r,n){switch(e){case t.Patterns.PATTERN000:return(r+n)%2==0;case t.Patterns.PATTERN001:return r%2==0;case t.Patterns.PATTERN010:return n%3==0;case t.Patterns.PATTERN011:return(r+n)%3==0;case t.Patterns.PATTERN100:return(Math.floor(r/2)+Math.floor(n/3))%2==0;case t.Patterns.PATTERN101:return r*n%2+r*n%3==0;case t.Patterns.PATTERN110:return(r*n%2+r*n%3)%2==0;case t.Patterns.PATTERN111:return(r*n%3+(r+n)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}}t.isValid=function(e){return null!=e&&""!==e&&!isNaN(e)&&e>=0&&e<=7},t.from=function(e){return t.isValid(e)?parseInt(e,10):void 0},t.getPenaltyN1=function(e){const t=e.size;let n=0,i=0,s=0,o=null,a=null;for(let l=0;l<t;l++){i=s=0,o=a=null;for(let c=0;c<t;c++){let t=e.get(l,c);t===o?i++:(i>=5&&(n+=r+(i-5)),o=t,i=1),t=e.get(c,l),t===a?s++:(s>=5&&(n+=r+(s-5)),a=t,s=1)}i>=5&&(n+=r+(i-5)),s>=5&&(n+=r+(s-5))}return n},t.getPenaltyN2=function(e){const t=e.size;let r=0;for(let n=0;n<t-1;n++)for(let i=0;i<t-1;i++){const t=e.get(n,i)+e.get(n,i+1)+e.get(n+1,i)+e.get(n+1,i+1);4!==t&&0!==t||r++}return r*n},t.getPenaltyN3=function(e){const t=e.size;let r=0,n=0,s=0;for(let i=0;i<t;i++){n=s=0;for(let o=0;o<t;o++)n=n<<1&2047|e.get(i,o),o>=10&&(1488===n||93===n)&&r++,s=s<<1&2047|e.get(o,i),o>=10&&(1488===s||93===s)&&r++}return r*i},t.getPenaltyN4=function(e){let t=0;const r=e.data.length;for(let n=0;n<r;n++)t+=e.data[n];return Math.abs(Math.ceil(100*t/r/5)-10)*s},t.applyMask=function(e,t){const r=t.size;for(let n=0;n<r;n++)for(let i=0;i<r;i++)t.isReserved(i,n)||t.xor(i,n,o(e,i,n))},t.getBestMask=function(e,r){const n=Object.keys(t.Patterns).length;let i=0,s=1/0;for(let o=0;o<n;o++){r(o),t.applyMask(o,e);const n=t.getPenaltyN1(e)+t.getPenaltyN2(e)+t.getPenaltyN3(e)+t.getPenaltyN4(e);t.applyMask(o,e),n<s&&(s=n,i=o)}return i}},12822:(e,t,r)=>{const n=r(41252),i=r(85826);t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(e,t){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!n.isValid(t))throw new Error("Invalid version: "+t);return t>=1&&t<10?e.ccBits[0]:t<27?e.ccBits[1]:e.ccBits[2]},t.getBestModeForData=function(e){return i.testNumeric(e)?t.NUMERIC:i.testAlphanumeric(e)?t.ALPHANUMERIC:i.testKanji(e)?t.KANJI:t.BYTE},t.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},t.isValid=function(e){return e&&e.bit&&e.ccBits},t.from=function(e,r){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+e)}}(e)}catch(e){return r}}},75723:(e,t,r)=>{const n=r(12822);function NumericData(e){this.mode=n.NUMERIC,this.data=e.toString()}NumericData.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},NumericData.prototype.getLength=function(){return this.data.length},NumericData.prototype.getBitsLength=function(){return NumericData.getBitsLength(this.data.length)},NumericData.prototype.write=function(e){let t,r,n;for(t=0;t+3<=this.data.length;t+=3)r=this.data.substr(t,3),n=parseInt(r,10),e.put(n,10);const i=this.data.length-t;i>0&&(r=this.data.substr(t),n=parseInt(r,10),e.put(n,3*i+1))},e.exports=NumericData},77159:(e,t,r)=>{const n=r(44885);t.mul=function(e,t){const r=new Uint8Array(e.length+t.length-1);for(let i=0;i<e.length;i++)for(let s=0;s<t.length;s++)r[i+s]^=n.mul(e[i],t[s]);return r},t.mod=function(e,t){let r=new Uint8Array(e);for(;r.length-t.length>=0;){const e=r[0];for(let i=0;i<t.length;i++)r[i]^=n.mul(t[i],e);let i=0;for(;i<r.length&&0===r[i];)i++;r=r.slice(i)}return r},t.generateECPolynomial=function(e){let r=new Uint8Array([1]);for(let i=0;i<e;i++)r=t.mul(r,new Uint8Array([1,n.exp(i)]));return r}},13627:(e,t,r)=>{const n=r(86704),i=r(68059),s=r(77937),o=r(35606),a=r(59095),l=r(65954),c=r(50934),u=r(77672),d=r(87238),h=r(60141),p=r(13579),m=r(12822),f=r(94819);function g(e,t,r){const n=e.size,i=p.getEncodedBits(t,r);let s,o;for(s=0;s<15;s++)o=1==(i>>s&1),s<6?e.set(s,8,o,!0):s<8?e.set(s+1,8,o,!0):e.set(n-15+s,8,o,!0),s<8?e.set(8,n-s-1,o,!0):s<9?e.set(8,15-s-1+1,o,!0):e.set(8,15-s-1,o,!0);e.set(n-8,8,1,!0)}function y(e,t,r){const i=new s;r.forEach((function(t){i.put(t.mode.bit,4),i.put(t.getLength(),m.getCharCountIndicator(t.mode,e)),t.write(i)}));const o=8*(n.getSymbolTotalCodewords(e)-u.getTotalCodewordsCount(e,t));for(i.getLengthInBits()+4<=o&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(0);const a=(o-i.getLengthInBits())/8;for(let e=0;e<a;e++)i.put(e%2?17:236,8);return function(e,t,r){const i=n.getSymbolTotalCodewords(t),s=u.getTotalCodewordsCount(t,r),o=i-s,a=u.getBlocksCount(t,r),l=i%a,c=a-l,h=Math.floor(i/a),p=Math.floor(o/a),m=p+1,f=h-p,g=new d(f);let y=0;const b=new Array(a),v=new Array(a);let _=0;const x=new Uint8Array(e.buffer);for(let e=0;e<a;e++){const t=e<c?p:m;b[e]=x.slice(y,y+t),v[e]=g.encode(b[e]),y+=t,_=Math.max(_,t)}const w=new Uint8Array(i);let R,k,j=0;for(R=0;R<_;R++)for(k=0;k<a;k++)R<b[k].length&&(w[j++]=b[k][R]);for(R=0;R<f;R++)for(k=0;k<a;k++)w[j++]=v[k][R];return w}(i,e,t)}function b(e,t,r,i){let s;if(Array.isArray(e))s=f.fromArray(e);else{if("string"!=typeof e)throw new Error("Invalid data");{let n=t;if(!n){const t=f.rawSplit(e);n=h.getBestVersionForData(t,r)}s=f.fromString(e,n||40)}}const u=h.getBestVersionForData(s,r);if(!u)throw new Error("The amount of data is too big to be stored in a QR Code");if(t){if(t<u)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+u+".\n")}else t=u;const d=y(t,r,s),p=n.getSymbolSize(t),m=new o(p);return function(e,t){const r=e.size,n=l.getPositions(t);for(let t=0;t<n.length;t++){const i=n[t][0],s=n[t][1];for(let t=-1;t<=7;t++)if(!(i+t<=-1||r<=i+t))for(let n=-1;n<=7;n++)s+n<=-1||r<=s+n||(t>=0&&t<=6&&(0===n||6===n)||n>=0&&n<=6&&(0===t||6===t)||t>=2&&t<=4&&n>=2&&n<=4?e.set(i+t,s+n,!0,!0):e.set(i+t,s+n,!1,!0))}}(m,t),function(e){const t=e.size;for(let r=8;r<t-8;r++){const t=r%2==0;e.set(r,6,t,!0),e.set(6,r,t,!0)}}(m),function(e,t){const r=a.getPositions(t);for(let t=0;t<r.length;t++){const n=r[t][0],i=r[t][1];for(let t=-2;t<=2;t++)for(let r=-2;r<=2;r++)-2===t||2===t||-2===r||2===r||0===t&&0===r?e.set(n+t,i+r,!0,!0):e.set(n+t,i+r,!1,!0)}}(m,t),g(m,r,0),t>=7&&function(e,t){const r=e.size,n=h.getEncodedBits(t);let i,s,o;for(let t=0;t<18;t++)i=Math.floor(t/3),s=t%3+r-8-3,o=1==(n>>t&1),e.set(i,s,o,!0),e.set(s,i,o,!0)}(m,t),function(e,t){const r=e.size;let n=-1,i=r-1,s=7,o=0;for(let a=r-1;a>0;a-=2)for(6===a&&a--;;){for(let r=0;r<2;r++)if(!e.isReserved(i,a-r)){let n=!1;o<t.length&&(n=1==(t[o]>>>s&1)),e.set(i,a-r,n),s--,-1===s&&(o++,s=7)}if(i+=n,i<0||r<=i){i-=n,n=-n;break}}}(m,d),isNaN(i)&&(i=c.getBestMask(m,g.bind(null,m,r))),c.applyMask(i,m),g(m,r,i),{modules:m,version:t,errorCorrectionLevel:r,maskPattern:i,segments:s}}t.create=function(e,t){if(void 0===e||""===e)throw new Error("No input text");let r,s,o=i.M;return void 0!==t&&(o=i.from(t.errorCorrectionLevel,i.M),r=h.from(t.version),s=c.from(t.maskPattern),t.toSJISFunc&&n.setToSJISFunction(t.toSJISFunc)),b(e,r,o,s)}},87238:(e,t,r)=>{const n=r(77159);function ReedSolomonEncoder(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}ReedSolomonEncoder.prototype.initialize=function(e){this.degree=e,this.genPoly=n.generateECPolynomial(this.degree)},ReedSolomonEncoder.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(e.length+this.degree);t.set(e);const r=n.mod(t,this.genPoly),i=this.degree-r.length;if(i>0){const e=new Uint8Array(this.degree);return e.set(r,i),e}return r},e.exports=ReedSolomonEncoder},85826:(e,t)=>{const r="[0-9]+";let n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";n=n.replace(/u/g,"\\u");const i="(?:(?![A-Z0-9 $%*+\\-./:]|"+n+")(?:.|[\r\n]))+";t.KANJI=new RegExp(n,"g"),t.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),t.BYTE=new RegExp(i,"g"),t.NUMERIC=new RegExp(r,"g"),t.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");const s=new RegExp("^"+n+"$"),o=new RegExp("^"+r+"$"),a=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");t.testKanji=function(e){return s.test(e)},t.testNumeric=function(e){return o.test(e)},t.testAlphanumeric=function(e){return a.test(e)}},94819:(e,t,r)=>{const n=r(12822),i=r(75723),s=r(73907),o=r(74888),a=r(9395),l=r(85826),c=r(86704),u=r(3986);function d(e){return unescape(encodeURIComponent(e)).length}function h(e,t,r){const n=[];let i;for(;null!==(i=e.exec(r));)n.push({data:i[0],index:i.index,mode:t,length:i[0].length});return n}function p(e){const t=h(l.NUMERIC,n.NUMERIC,e),r=h(l.ALPHANUMERIC,n.ALPHANUMERIC,e);let i,s;c.isKanjiModeEnabled()?(i=h(l.BYTE,n.BYTE,e),s=h(l.KANJI,n.KANJI,e)):(i=h(l.BYTE_KANJI,n.BYTE,e),s=[]);return t.concat(r,i,s).sort((function(e,t){return e.index-t.index})).map((function(e){return{data:e.data,mode:e.mode,length:e.length}}))}function m(e,t){switch(t){case n.NUMERIC:return i.getBitsLength(e);case n.ALPHANUMERIC:return s.getBitsLength(e);case n.KANJI:return a.getBitsLength(e);case n.BYTE:return o.getBitsLength(e)}}function f(e,t){let r;const l=n.getBestModeForData(e);if(r=n.from(t,l),r!==n.BYTE&&r.bit<l.bit)throw new Error('"'+e+'" cannot be encoded with mode '+n.toString(r)+".\n Suggested mode is: "+n.toString(l));switch(r!==n.KANJI||c.isKanjiModeEnabled()||(r=n.BYTE),r){case n.NUMERIC:return new i(e);case n.ALPHANUMERIC:return new s(e);case n.KANJI:return new a(e);case n.BYTE:return new o(e)}}t.fromArray=function(e){return e.reduce((function(e,t){return"string"==typeof t?e.push(f(t,null)):t.data&&e.push(f(t.data,t.mode)),e}),[])},t.fromString=function(e,r){const i=function(e){const t=[];for(let r=0;r<e.length;r++){const i=e[r];switch(i.mode){case n.NUMERIC:t.push([i,{data:i.data,mode:n.ALPHANUMERIC,length:i.length},{data:i.data,mode:n.BYTE,length:i.length}]);break;case n.ALPHANUMERIC:t.push([i,{data:i.data,mode:n.BYTE,length:i.length}]);break;case n.KANJI:t.push([i,{data:i.data,mode:n.BYTE,length:d(i.data)}]);break;case n.BYTE:t.push([{data:i.data,mode:n.BYTE,length:d(i.data)}])}}return t}(p(e,c.isKanjiModeEnabled())),s=function(e,t){const r={},i={start:{}};let s=["start"];for(let o=0;o<e.length;o++){const a=e[o],l=[];for(let e=0;e<a.length;e++){const c=a[e],u=""+o+e;l.push(u),r[u]={node:c,lastCount:0},i[u]={};for(let e=0;e<s.length;e++){const o=s[e];r[o]&&r[o].node.mode===c.mode?(i[o][u]=m(r[o].lastCount+c.length,c.mode)-m(r[o].lastCount,c.mode),r[o].lastCount+=c.length):(r[o]&&(r[o].lastCount=c.length),i[o][u]=m(c.length,c.mode)+4+n.getCharCountIndicator(c.mode,t))}}s=l}for(let e=0;e<s.length;e++)i[s[e]].end=0;return{map:i,table:r}}(i,r),o=u.find_path(s.map,"start","end"),a=[];for(let e=1;e<o.length-1;e++)a.push(s.table[o[e]].node);return t.fromArray(function(e){return e.reduce((function(e,t){const r=e.length-1>=0?e[e.length-1]:null;return r&&r.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)}),[])}(a))},t.rawSplit=function(e){return t.fromArray(p(e,c.isKanjiModeEnabled()))}},86704:(e,t)=>{let r;const n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];t.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return 4*e+17},t.getSymbolTotalCodewords=function(e){return n[e]},t.getBCHDigit=function(e){let t=0;for(;0!==e;)t++,e>>>=1;return t},t.setToSJISFunction=function(e){if("function"!=typeof e)throw new Error('"toSJISFunc" is not a valid function.');r=e},t.isKanjiModeEnabled=function(){return void 0!==r},t.toSJIS=function(e){return r(e)}},41252:(e,t)=>{t.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}},60141:(e,t,r)=>{const n=r(86704),i=r(77672),s=r(68059),o=r(12822),a=r(41252),l=n.getBCHDigit(7973);function c(e,t){return o.getCharCountIndicator(e,t)+4}function u(e,t){let r=0;return e.forEach((function(e){const n=c(e.mode,t);r+=n+e.getBitsLength()})),r}t.from=function(e,t){return a.isValid(e)?parseInt(e,10):t},t.getCapacity=function(e,t,r){if(!a.isValid(e))throw new Error("Invalid QR Code version");void 0===r&&(r=o.BYTE);const s=8*(n.getSymbolTotalCodewords(e)-i.getTotalCodewordsCount(e,t));if(r===o.MIXED)return s;const l=s-c(r,e);switch(r){case o.NUMERIC:return Math.floor(l/10*3);case o.ALPHANUMERIC:return Math.floor(l/11*2);case o.KANJI:return Math.floor(l/13);case o.BYTE:default:return Math.floor(l/8)}},t.getBestVersionForData=function(e,r){let n;const i=s.from(r,s.M);if(Array.isArray(e)){if(e.length>1)return function(e,r){for(let n=1;n<=40;n++)if(u(e,n)<=t.getCapacity(n,r,o.MIXED))return n}(e,i);if(0===e.length)return 1;n=e[0]}else n=e;return function(e,r,n){for(let i=1;i<=40;i++)if(r<=t.getCapacity(i,n,e))return i}(n.mode,n.getLength(),i)},t.getEncodedBits=function(e){if(!a.isValid(e)||e<7)throw new Error("Invalid QR Code version");let t=e<<12;for(;n.getBCHDigit(t)-l>=0;)t^=7973<<n.getBCHDigit(t)-l;return e<<12|t}},61777:(e,t,r)=>{const n=r(2044);t.render=function(e,t,r){let i=r,s=t;void 0!==i||t&&t.getContext||(i=t,t=void 0),t||(s=function(){try{return document.createElement("canvas")}catch(e){throw new Error("You need to specify a canvas element")}}()),i=n.getOptions(i);const o=n.getImageWidth(e.modules.size,i),a=s.getContext("2d"),l=a.createImageData(o,o);return n.qrToImageData(l.data,e,i),function(e,t,r){e.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=r,t.width=r,t.style.height=r+"px",t.style.width=r+"px"}(a,s,o),a.putImageData(l,0,0),s},t.renderToDataURL=function(e,r,n){let i=n;void 0!==i||r&&r.getContext||(i=r,r=void 0),i||(i={});const s=t.render(e,r,i),o=i.type||"image/png",a=i.rendererOpts||{};return s.toDataURL(o,a.quality)}},78214:(e,t,r)=>{const n=r(2044);function i(e,t){const r=e.a/255,n=t+'="'+e.hex+'"';return r<1?n+" "+t+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function s(e,t,r){let n=e+t;return void 0!==r&&(n+=" "+r),n}t.render=function(e,t,r){const o=n.getOptions(t),a=e.modules.size,l=e.modules.data,c=a+2*o.margin,u=o.color.light.a?"<path "+i(o.color.light,"fill")+' d="M0 0h'+c+"v"+c+'H0z"/>':"",d="<path "+i(o.color.dark,"stroke")+' d="'+function(e,t,r){let n="",i=0,o=!1,a=0;for(let l=0;l<e.length;l++){const c=Math.floor(l%t),u=Math.floor(l/t);c||o||(o=!0),e[l]?(a++,l>0&&c>0&&e[l-1]||(n+=o?s("M",c+r,.5+u+r):s("m",i,0),i=0,o=!1),c+1<t&&e[l+1]||(n+=s("h",a),a=0)):i++}return n}(l,a,o.margin)+'"/>',h='viewBox="0 0 '+c+" "+c+'"',p='<svg xmlns="http://www.w3.org/2000/svg" '+(o.width?'width="'+o.width+'" height="'+o.width+'" ':"")+h+' shape-rendering="crispEdges">'+u+d+"</svg>\n";return"function"==typeof r&&r(null,p),p}},2044:(e,t)=>{function r(e){if("number"==typeof e&&(e=e.toString()),"string"!=typeof e)throw new Error("Color should be defined as hex string");let t=e.slice().replace("#","").split("");if(t.length<3||5===t.length||t.length>8)throw new Error("Invalid hex color: "+e);3!==t.length&&4!==t.length||(t=Array.prototype.concat.apply([],t.map((function(e){return[e,e]})))),6===t.length&&t.push("F","F");const r=parseInt(t.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:255&r,hex:"#"+t.slice(0,6).join("")}}t.getOptions=function(e){e||(e={}),e.color||(e.color={});const t=void 0===e.margin||null===e.margin||e.margin<0?4:e.margin,n=e.width&&e.width>=21?e.width:void 0,i=e.scale||4;return{width:n,scale:n?4:i,margin:t,color:{dark:r(e.color.dark||"#000000ff"),light:r(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},t.getScale=function(e,t){return t.width&&t.width>=e+2*t.margin?t.width/(e+2*t.margin):t.scale},t.getImageWidth=function(e,r){const n=t.getScale(e,r);return Math.floor((e+2*r.margin)*n)},t.qrToImageData=function(e,r,n){const i=r.modules.size,s=r.modules.data,o=t.getScale(i,n),a=Math.floor((i+2*n.margin)*o),l=n.margin*o,c=[n.color.light,n.color.dark];for(let t=0;t<a;t++)for(let r=0;r<a;r++){let u=4*(t*a+r),d=n.color.light;if(t>=l&&r>=l&&t<a-l&&r<a-l){d=c[s[Math.floor((t-l)/o)*i+Math.floor((r-l)/o)]?1:0]}e[u++]=d.r,e[u++]=d.g,e[u++]=d.b,e[u]=d.a}}},36109:(e,t,r)=>{"use strict";var n=r(28578),i=r(23770);function s(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=60106,a=60107,l=60108,c=60114,u=60109,d=60110,h=60112,p=60113,m=60120,f=60115,g=60116,y=60121,b=60117,v=60119,_=60129,x=60131;if("function"==typeof Symbol&&Symbol.for){var w=Symbol.for;o=w("react.portal"),a=w("react.fragment"),l=w("react.strict_mode"),c=w("react.profiler"),u=w("react.provider"),d=w("react.context"),h=w("react.forward_ref"),p=w("react.suspense"),m=w("react.suspense_list"),f=w("react.memo"),g=w("react.lazy"),y=w("react.block"),b=w("react.fundamental"),v=w("react.scope"),_=w("react.debug_trace_mode"),x=w("react.legacy_hidden")}function F(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case a:return"Fragment";case o:return"Portal";case c:return"Profiler";case l:return"StrictMode";case p:return"Suspense";case m:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case d:return(e.displayName||"Context")+".Consumer";case u:return(e._context.displayName||"Context")+".Provider";case h:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case f:return F(e.type);case y:return F(e._render);case g:t=e._payload,e=e._init;try{return F(e(t))}catch(e){}}return null}var R=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,k={};function I(e,t){for(var r=0|e._threadCount;r<=t;r++)e[r]=e._currentValue2,e._threadCount=r+1}for(var j=new Uint16Array(16),z=0;15>z;z++)j[z]=z+1;j[15]=0;var q=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,$=Object.prototype.hasOwnProperty,Z={},X={};function Y(e){return!!$.call(X,e)||!$.call(Z,e)&&(q.test(e)?X[e]=!0:(Z[e]=!0,!1))}function M(e,t,r,n,i,s,o){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var ee={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){ee[e]=new M(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];ee[t]=new M(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){ee[e]=new M(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){ee[e]=new M(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){ee[e]=new M(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){ee[e]=new M(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){ee[e]=new M(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){ee[e]=new M(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){ee[e]=new M(e,5,!1,e.toLowerCase(),null,!1,!1)}));var te=/[\-:]([a-z])/g;function re(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(te,re);ee[t]=new M(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(te,re);ee[t]=new M(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(te,re);ee[t]=new M(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){ee[e]=new M(e,1,!1,e.toLowerCase(),null,!1,!1)})),ee.xlinkHref=new M("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){ee[e]=new M(e,1,!1,e.toLowerCase(),null,!0,!0)}));var ne=/["'&<>]/;function O(e){if("boolean"==typeof e||"number"==typeof e)return""+e;e=""+e;var t=ne.exec(e);if(t){var r,n="",i=0;for(r=t.index;r<e.length;r++){switch(e.charCodeAt(r)){case 34:t="&quot;";break;case 38:t="&amp;";break;case 39:t="&#x27;";break;case 60:t="&lt;";break;case 62:t="&gt;";break;default:continue}i!==r&&(n+=e.substring(i,r)),i=r+1,n+=t}e=i!==r?n+e.substring(i,r):n}return e}function ie(e,t){var r,n=ee.hasOwnProperty(e)?ee[e]:null;return(r="style"!==e)&&(r=null!==n?0===n.type:2<e.length&&("o"===e[0]||"O"===e[0])&&("n"===e[1]||"N"===e[1])),r||function(e,t,r,n){if(null==t||function(e,t,r,n){if(null!==r&&0===r.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!n&&(null!==r?!r.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,r,n))return!0;if(n)return!1;if(null!==r)switch(r.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(e,t,n,!1)?"":null!==n?(e=n.attributeName,3===(r=n.type)||4===r&&!0===t?e+'=""':(n.sanitizeURL&&(t=""+t),e+'="'+O(t)+'"')):Y(e)?e+'="'+O(t)+'"':""}var se="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},oe=null,ae=null,le=null,ce=!1,ue=!1,de=null,he=0;function W(){if(null===oe)throw Error(s(321));return oe}function Ba(){if(0<he)throw Error(s(312));return{memoizedState:null,queue:null,next:null}}function Ca(){return null===le?null===ae?(ce=!1,ae=le=Ba()):(ce=!0,le=ae):null===le.next?(ce=!1,le=le.next=Ba()):(ce=!0,le=le.next),le}function Da(e,t,r,n){for(;ue;)ue=!1,he+=1,le=null,r=e(t,n);return Ea(),r}function Ea(){oe=null,ue=!1,ae=null,he=0,le=de=null}function Fa(e,t){return"function"==typeof t?t(e):t}function Ga(e,t,r){if(oe=W(),le=Ca(),ce){var n=le.queue;if(t=n.dispatch,null!==de&&void 0!==(r=de.get(n))){de.delete(n),n=le.memoizedState;do{n=e(n,r.action),r=r.next}while(null!==r);return le.memoizedState=n,[n,t]}return[le.memoizedState,t]}return e=e===Fa?"function"==typeof t?t():t:void 0!==r?r(t):t,le.memoizedState=e,e=(e=le.queue={last:null,dispatch:null}).dispatch=Ha.bind(null,oe,e),[le.memoizedState,e]}function Ia(e,t){if(oe=W(),t=void 0===t?null:t,null!==(le=Ca())){var r=le.memoizedState;if(null!==r&&null!==t){var n=r[1];e:if(null===n)n=!1;else{for(var i=0;i<n.length&&i<t.length;i++)if(!se(t[i],n[i])){n=!1;break e}n=!0}if(n)return r[0]}}return e=e(),le.memoizedState=[e,t],e}function Ha(e,t,r){if(!(25>he))throw Error(s(301));if(e===oe)if(ue=!0,e={action:r,next:null},null===de&&(de=new Map),void 0===(r=de.get(t)))de.set(t,e);else{for(t=r;null!==t.next;)t=t.next;t.next=e}}function Ja(){}var pe=null,me={readContext:function(e){var t=pe.threadID;return I(e,t),e[t]},useContext:function(e){W();var t=pe.threadID;return I(e,t),e[t]},useMemo:Ia,useReducer:Ga,useRef:function(e){oe=W();var t=(le=Ca()).memoizedState;return null===t?(e={current:e},le.memoizedState=e):t},useState:function(e){return Ga(Fa,e)},useLayoutEffect:function(){},useCallback:function(e,t){return Ia((function(){return e}),t)},useImperativeHandle:Ja,useEffect:Ja,useDebugValue:Ja,useDeferredValue:function(e){return W(),e},useTransition:function(){return W(),[function(e){e()},!1]},useOpaqueIdentifier:function(){return(pe.identifierPrefix||"")+"R:"+(pe.uniqueID++).toString(36)},useMutableSource:function(e,t){return W(),t(e._source)}},fe="http://www.w3.org/1999/xhtml";function Ma(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}var ge={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},ye=n({menuitem:!0},ge),be={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ve=["Webkit","ms","Moz","O"];Object.keys(be).forEach((function(e){ve.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),be[t]=be[e]}))}));var _e=/([A-Z])/g,xe=/^ms-/,we=i.Children.toArray,Se=R.ReactCurrentDispatcher,Pe={listing:!0,pre:!0,textarea:!0},Te=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,Re={},ke={};var Ie=Object.prototype.hasOwnProperty,je={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null,suppressHydrationWarning:null};function He(e,t){if(void 0===e)throw Error(s(152,F(t)||"Component"))}function ze(e,t,r){function o(i,o){var a=o.prototype&&o.prototype.isReactComponent,l=function(e,t,r,n){if(n&&"object"==typeof(n=e.contextType)&&null!==n)return I(n,r),n[r];if(e=e.contextTypes){for(var i in r={},e)r[i]=t[i];t=r}else t=k;return t}(o,t,r,a),c=[],u=!1,d={isMounted:function(){return!1},enqueueForceUpdate:function(){if(null===c)return null},enqueueReplaceState:function(e,t){u=!0,c=[t]},enqueueSetState:function(e,t){if(null===c)return null;c.push(t)}};if(a){if(a=new o(i.props,l,d),"function"==typeof o.getDerivedStateFromProps){var h=o.getDerivedStateFromProps.call(null,i.props,a.state);null!=h&&(a.state=n({},a.state,h))}}else if(oe={},a=o(i.props,l,d),null==(a=Da(o,i.props,a,l))||null==a.render)return void He(e=a,o);if(a.props=i.props,a.context=l,a.updater=d,void 0===(d=a.state)&&(a.state=d=null),"function"==typeof a.UNSAFE_componentWillMount||"function"==typeof a.componentWillMount)if("function"==typeof a.componentWillMount&&"function"!=typeof o.getDerivedStateFromProps&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&"function"!=typeof o.getDerivedStateFromProps&&a.UNSAFE_componentWillMount(),c.length){d=c;var p=u;if(c=null,u=!1,p&&1===d.length)a.state=d[0];else{h=p?d[0]:a.state;var m=!0;for(p=p?1:0;p<d.length;p++){var f=d[p];null!=(f="function"==typeof f?f.call(a,h,i.props,l):f)&&(m?(m=!1,h=n({},h,f)):n(h,f))}a.state=h}}else c=null;if(He(e=a.render(),o),"function"==typeof a.getChildContext&&"object"==typeof(i=o.childContextTypes)){var g=a.getChildContext();for(var y in g)if(!(y in i))throw Error(s(108,F(o)||"Unknown",y))}g&&(t=n({},t,g))}for(;i.isValidElement(e);){var a=e,l=a.type;if("function"!=typeof l)break;o(a,l)}return{child:e,context:t}}var Ge=function(){function e(e,t,r){i.isValidElement(e)?e.type!==a?e=[e]:(e=e.props.children,e=i.isValidElement(e)?[e]:we(e)):e=we(e),e={type:null,domNamespace:fe,children:e,childIndex:0,context:k,footer:""};var n=j[0];if(0===n){var o=j,l=2*(n=o.length);if(!(65536>=l))throw Error(s(304));var c=new Uint16Array(l);for(c.set(o),(j=c)[0]=n+1,o=n;o<l-1;o++)j[o]=o+1;j[l-1]=0}else j[0]=j[n];this.threadID=n,this.stack=[e],this.exhausted=!1,this.currentSelectValue=null,this.previousWasTextNode=!1,this.makeStaticMarkup=t,this.suspenseDepth=0,this.contextIndex=-1,this.contextStack=[],this.contextValueStack=[],this.uniqueID=0,this.identifierPrefix=r&&r.identifierPrefix||""}var t=e.prototype;return t.destroy=function(){if(!this.exhausted){this.exhausted=!0,this.clearProviders();var e=this.threadID;j[e]=j[0],j[0]=e}},t.pushProvider=function(e){var t=++this.contextIndex,r=e.type._context,n=this.threadID;I(r,n);var i=r[n];this.contextStack[t]=r,this.contextValueStack[t]=i,r[n]=e.props.value},t.popProvider=function(){var e=this.contextIndex,t=this.contextStack[e],r=this.contextValueStack[e];this.contextStack[e]=null,this.contextValueStack[e]=null,this.contextIndex--,t[this.threadID]=r},t.clearProviders=function(){for(var e=this.contextIndex;0<=e;e--)this.contextStack[e][this.threadID]=this.contextValueStack[e]},t.read=function(e){if(this.exhausted)return null;var t=pe;pe=this;var r=Se.current;Se.current=me;try{for(var n=[""],i=!1;n[0].length<e;){if(0===this.stack.length){this.exhausted=!0;var o=this.threadID;j[o]=j[0],j[0]=o;break}var a=this.stack[this.stack.length-1];if(i||a.childIndex>=a.children.length){var l=a.footer;if(""!==l&&(this.previousWasTextNode=!1),this.stack.pop(),"select"===a.type)this.currentSelectValue=null;else if(null!=a.type&&null!=a.type.type&&a.type.type.$$typeof===u)this.popProvider(a.type);else if(a.type===p){this.suspenseDepth--;var c=n.pop();if(i){i=!1;var d=a.fallbackFrame;if(!d)throw Error(s(303));this.stack.push(d),n[this.suspenseDepth]+="\x3c!--$!--\x3e";continue}n[this.suspenseDepth]+=c}n[this.suspenseDepth]+=l}else{var h=a.children[a.childIndex++],m="";try{m+=this.render(h,a.context,a.domNamespace)}catch(e){if(null!=e&&"function"==typeof e.then)throw Error(s(294));throw e}n.length<=this.suspenseDepth&&n.push(""),n[this.suspenseDepth]+=m}}return n[0]}finally{Se.current=r,pe=t,Ea()}},t.render=function(e,t,r){if("string"==typeof e||"number"==typeof e)return""===(r=""+e)?"":this.makeStaticMarkup?O(r):this.previousWasTextNode?"\x3c!-- --\x3e"+O(r):(this.previousWasTextNode=!0,O(r));if(e=(t=ze(e,t,this.threadID)).child,t=t.context,null===e||!1===e)return"";if(!i.isValidElement(e)){if(null!=e&&null!=e.$$typeof){if((r=e.$$typeof)===o)throw Error(s(257));throw Error(s(258,r.toString()))}return e=we(e),this.stack.push({type:null,domNamespace:r,children:e,childIndex:0,context:t,footer:""}),""}var y=e.type;if("string"==typeof y)return this.renderDOM(e,t,r);switch(y){case x:case _:case l:case c:case m:case a:return e=we(e.props.children),this.stack.push({type:null,domNamespace:r,children:e,childIndex:0,context:t,footer:""}),"";case p:throw Error(s(294));case v:throw Error(s(343))}if("object"==typeof y&&null!==y)switch(y.$$typeof){case h:oe={};var w=y.render(e.props,e.ref);return w=Da(y.render,e.props,w,e.ref),w=we(w),this.stack.push({type:null,domNamespace:r,children:w,childIndex:0,context:t,footer:""}),"";case f:return e=[i.createElement(y.type,n({ref:e.ref},e.props))],this.stack.push({type:null,domNamespace:r,children:e,childIndex:0,context:t,footer:""}),"";case u:return r={type:e,domNamespace:r,children:y=we(e.props.children),childIndex:0,context:t,footer:""},this.pushProvider(e),this.stack.push(r),"";case d:y=e.type,w=e.props;var R=this.threadID;return I(y,R),y=we(w.children(y[R])),this.stack.push({type:e,domNamespace:r,children:y,childIndex:0,context:t,footer:""}),"";case b:throw Error(s(338));case g:return y=(w=(y=e.type)._init)(y._payload),e=[i.createElement(y,n({ref:e.ref},e.props))],this.stack.push({type:null,domNamespace:r,children:e,childIndex:0,context:t,footer:""}),""}throw Error(s(130,null==y?y:typeof y,""))},t.renderDOM=function(e,t,r){var o=e.type.toLowerCase();if(r===fe&&Ma(o),!Re.hasOwnProperty(o)){if(!Te.test(o))throw Error(s(65,o));Re[o]=!0}var a=e.props;if("input"===o)a=n({type:void 0},a,{defaultChecked:void 0,defaultValue:void 0,value:null!=a.value?a.value:a.defaultValue,checked:null!=a.checked?a.checked:a.defaultChecked});else if("textarea"===o){var l=a.value;if(null==l){l=a.defaultValue;var c=a.children;if(null!=c){if(null!=l)throw Error(s(92));if(Array.isArray(c)){if(!(1>=c.length))throw Error(s(93));c=c[0]}l=""+c}null==l&&(l="")}a=n({},a,{value:void 0,children:""+l})}else if("select"===o)this.currentSelectValue=null!=a.value?a.value:a.defaultValue,a=n({},a,{value:void 0});else if("option"===o){c=this.currentSelectValue;var u=function(e){if(null==e)return e;var t="";return i.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}(a.children);if(null!=c){var d=null!=a.value?a.value+"":u;if(l=!1,Array.isArray(c)){for(var h=0;h<c.length;h++)if(""+c[h]===d){l=!0;break}}else l=""+c===d;a=n({selected:void 0,children:void 0},a,{selected:l,children:u})}}if(l=a){if(ye[o]&&(null!=l.children||null!=l.dangerouslySetInnerHTML))throw Error(s(137,o));if(null!=l.dangerouslySetInnerHTML){if(null!=l.children)throw Error(s(60));if("object"!=typeof l.dangerouslySetInnerHTML||!("__html"in l.dangerouslySetInnerHTML))throw Error(s(61))}if(null!=l.style&&"object"!=typeof l.style)throw Error(s(62))}l=a,c=this.makeStaticMarkup,u=1===this.stack.length,d="<"+e.type;e:if(-1===o.indexOf("-"))h="string"==typeof l.is;else switch(o){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":h=!1;break e;default:h=!0}for(x in l)if(Ie.call(l,x)){var p=l[x];if(null!=p){if("style"===x){var m=void 0,f="",g="";for(m in p)if(p.hasOwnProperty(m)){var y=0===m.indexOf("--"),b=p[m];if(null!=b){if(y)var v=m;else if(v=m,ke.hasOwnProperty(v))v=ke[v];else{var _=v.replace(_e,"-$1").toLowerCase().replace(xe,"-ms-");v=ke[v]=_}f+=g+v+":",g=m,f+=y=null==b||"boolean"==typeof b||""===b?"":y||"number"!=typeof b||0===b||be.hasOwnProperty(g)&&be[g]?(""+b).trim():b+"px",g=";"}}p=f||null}m=null,h?je.hasOwnProperty(x)||(m=Y(m=x)&&null!=p?m+'="'+O(p)+'"':""):m=ie(x,p),m&&(d+=" "+m)}}c||u&&(d+=' data-reactroot=""');var x=d;l="",ge.hasOwnProperty(o)?x+="/>":(x+=">",l="</"+e.type+">");e:{if(null!=(c=a.dangerouslySetInnerHTML)){if(null!=c.__html){c=c.__html;break e}}else if("string"==typeof(c=a.children)||"number"==typeof c){c=O(c);break e}c=null}return null!=c?(a=[],Pe.hasOwnProperty(o)&&"\n"===c.charAt(0)&&(x+="\n"),x+=c):a=we(a.children),e=e.type,r=null==r||"http://www.w3.org/1999/xhtml"===r?Ma(e):"http://www.w3.org/2000/svg"===r&&"foreignObject"===e?"http://www.w3.org/1999/xhtml":r,this.stack.push({domNamespace:r,type:o,children:a,childIndex:0,context:t,footer:l}),this.previousWasTextNode=!1,x},e}();t.renderToNodeStream=function(){throw Error(s(207))},t.renderToStaticMarkup=function(e,t){e=new Ge(e,!0,t);try{return e.read(1/0)}finally{e.destroy()}},t.renderToStaticNodeStream=function(){throw Error(s(208))},t.renderToString=function(e,t){e=new Ge(e,!1,t);try{return e.read(1/0)}finally{e.destroy()}},t.version="17.0.2"},32717:(e,t,r)=>{"use strict";var n=r(23770),i=r(28578),s=r(15488);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!n)throw Error(o(227));var a=new Set,l={};function c(e,t){u(e,t),u(e+"Capture",t)}function u(e,t){for(l[e]=t,e=0;e<t.length;e++)a.add(t[e])}var d=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),h=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p=Object.prototype.hasOwnProperty,m={},f={};function B(e,t,r,n,i,s,o){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var g={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){g[e]=new B(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];g[t]=new B(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){g[e]=new B(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){g[e]=new B(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){g[e]=new B(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){g[e]=new B(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){g[e]=new B(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){g[e]=new B(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){g[e]=new B(e,5,!1,e.toLowerCase(),null,!1,!1)}));var y=/[\-:]([a-z])/g;function b(e){return e[1].toUpperCase()}function v(e,t,r,n){var i=g.hasOwnProperty(t)?g[t]:null;(null!==i?0===i.type:!n&&(2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])))||(function(e,t,r,n){if(null==t||function(e,t,r,n){if(null!==r&&0===r.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!n&&(null!==r?!r.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,r,n))return!0;if(n)return!1;if(null!==r)switch(r.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,r,i,n)&&(r=null),n||null===i?function(e){return!!p.call(f,e)||!p.call(m,e)&&(h.test(e)?f[e]=!0:(m[e]=!0,!1))}(t)&&(null===r?e.removeAttribute(t):e.setAttribute(t,""+r)):i.mustUseProperty?e[i.propertyName]=null===r?3!==i.type&&"":r:(t=i.attributeName,n=i.attributeNamespace,null===r?e.removeAttribute(t):(r=3===(i=i.type)||4===i&&!0===r?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(y,b);g[t]=new B(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(y,b);g[t]=new B(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(y,b);g[t]=new B(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){g[e]=new B(e,1,!1,e.toLowerCase(),null,!1,!1)})),g.xlinkHref=new B("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){g[e]=new B(e,1,!1,e.toLowerCase(),null,!0,!0)}));var _=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,x=60103,w=60106,R=60107,k=60108,j=60114,z=60109,q=60110,$=60112,Z=60113,X=60120,Y=60115,ee=60116,te=60121,re=60128,ne=60129,ie=60130,se=60131;if("function"==typeof Symbol&&Symbol.for){var oe=Symbol.for;x=oe("react.element"),w=oe("react.portal"),R=oe("react.fragment"),k=oe("react.strict_mode"),j=oe("react.profiler"),z=oe("react.provider"),q=oe("react.context"),$=oe("react.forward_ref"),Z=oe("react.suspense"),X=oe("react.suspense_list"),Y=oe("react.memo"),ee=oe("react.lazy"),te=oe("react.block"),oe("react.scope"),re=oe("react.opaque.id"),ne=oe("react.debug_trace_mode"),ie=oe("react.offscreen"),se=oe("react.legacy_hidden")}var ae,le="function"==typeof Symbol&&Symbol.iterator;function La(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=le&&e[le]||e["@@iterator"])?e:null}function Na(e){if(void 0===ae)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ae=t&&t[1]||""}return"\n"+ae+e}var ce=!1;function Pa(e,t){if(!e||ce)return"";ce=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var n=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){n=e}e.call(t.prototype)}else{try{throw Error()}catch(e){n=e}e()}}catch(e){if(e&&n&&"string"==typeof e.stack){for(var i=e.stack.split("\n"),s=n.stack.split("\n"),o=i.length-1,a=s.length-1;1<=o&&0<=a&&i[o]!==s[a];)a--;for(;1<=o&&0<=a;o--,a--)if(i[o]!==s[a]){if(1!==o||1!==a)do{if(o--,0>--a||i[o]!==s[a])return"\n"+i[o].replace(" at new "," at ")}while(1<=o&&0<=a);break}}}finally{ce=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Na(e):""}function Qa(e){switch(e.tag){case 5:return Na(e.type);case 16:return Na("Lazy");case 13:return Na("Suspense");case 19:return Na("SuspenseList");case 0:case 2:case 15:return e=Pa(e.type,!1);case 11:return e=Pa(e.type.render,!1);case 22:return e=Pa(e.type._render,!1);case 1:return e=Pa(e.type,!0);default:return""}}function Ra(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case R:return"Fragment";case w:return"Portal";case j:return"Profiler";case k:return"StrictMode";case Z:return"Suspense";case X:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case q:return(e.displayName||"Context")+".Consumer";case z:return(e._context.displayName||"Context")+".Provider";case $:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case Y:return Ra(e.type);case te:return Ra(e._render);case ee:t=e._payload,e=e._init;try{return Ra(e(t))}catch(e){}}return null}function Sa(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function Ta(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function Va(e){e._valueTracker||(e._valueTracker=function(e){var t=Ta(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==r&&"function"==typeof r.get&&"function"==typeof r.set){var i=r.get,s=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=""+e,s.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function Wa(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=Ta(e)?e.checked?"true":"false":e.value),(e=n)!==r&&(t.setValue(e),!0)}function Xa(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function Ya(e,t){var r=t.checked;return i({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=r?r:e._wrapperState.initialChecked})}function Za(e,t){var r=null==t.defaultValue?"":t.defaultValue,n=null!=t.checked?t.checked:t.defaultChecked;r=Sa(null!=t.value?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function ue(e,t){null!=(t=t.checked)&&v(e,"checked",t,!1)}function de(e,t){ue(e,t);var r=Sa(t.value),n=t.type;if(null!=r)"number"===n?(0===r&&""===e.value||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if("submit"===n||"reset"===n)return void e.removeAttribute("value");t.hasOwnProperty("value")?pe(e,t.type,r):t.hasOwnProperty("defaultValue")&&pe(e,t.type,Sa(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function he(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!("submit"!==n&&"reset"!==n||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}""!==(r=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==r&&(e.name=r)}function pe(e,t,r){"number"===t&&Xa(e.ownerDocument)===e||(null==r?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}function me(e,t){return e=i({children:void 0},t),(t=function(e){var t="";return n.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}(t.children))&&(e.children=t),e}function fe(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i<r.length;i++)t["$"+r[i]]=!0;for(r=0;r<e.length;r++)i=t.hasOwnProperty("$"+e[r].value),e[r].selected!==i&&(e[r].selected=i),i&&n&&(e[r].defaultSelected=!0)}else{for(r=""+Sa(r),t=null,i=0;i<e.length;i++){if(e[i].value===r)return e[i].selected=!0,void(n&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function ge(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(o(91));return i({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ye(e,t){var r=t.value;if(null==r){if(r=t.children,t=t.defaultValue,null!=r){if(null!=t)throw Error(o(92));if(Array.isArray(r)){if(!(1>=r.length))throw Error(o(93));r=r[0]}t=r}null==t&&(t=""),r=t}e._wrapperState={initialValue:Sa(r)}}function be(e,t){var r=Sa(t.value),n=Sa(t.defaultValue);null!=r&&((r=""+r)!==e.value&&(e.value=r),null==t.defaultValue&&e.defaultValue!==r&&(e.defaultValue=r)),null!=n&&(e.defaultValue=""+n)}function ve(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var _e={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function xe(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function we(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?xe(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var Se,Pe,Te=(Pe=function(e,t){if(e.namespaceURI!==_e.svg||"innerHTML"in e)e.innerHTML=t;else{for((Se=Se||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Se.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,r,n){MSApp.execUnsafeLocalFunction((function(){return Pe(e,t)}))}:Pe);function Re(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&3===r.nodeType)return void(r.nodeValue=t)}e.textContent=t}var ke={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ie=["Webkit","ms","Moz","O"];function je(e,t,r){return null==t||"boolean"==typeof t||""===t?"":r||"number"!=typeof t||0===t||ke.hasOwnProperty(e)&&ke[e]?(""+t).trim():t+"px"}function He(e,t){for(var r in e=e.style,t)if(t.hasOwnProperty(r)){var n=0===r.indexOf("--"),i=je(r,t[r],n);"float"===r&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}Object.keys(ke).forEach((function(e){Ie.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ke[t]=ke[e]}))}));var ze=i({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ge(e,t){if(t){if(ze[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(o(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(o(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(o(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(o(62))}}function We(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function Ve(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var qe=null,$e=null,Xe=null;function Bb(e){if(e=Cb(e)){if("function"!=typeof qe)throw Error(o(280));var t=e.stateNode;t&&(t=Db(t),qe(e.stateNode,e.type,t))}}function Eb(e){$e?Xe?Xe.push(e):Xe=[e]:$e=e}function Fb(){if($e){var e=$e,t=Xe;if(Xe=$e=null,Bb(e),t)for(e=0;e<t.length;e++)Bb(t[e])}}function Gb(e,t){return e(t)}function Hb(e,t,r,n,i){return e(t,r,n,i)}function Ib(){}var Ye=Gb,Qe=!1,et=!1;function Mb(){null===$e&&null===Xe||(Ib(),Fb())}function Ob(e,t){var r=e.stateNode;if(null===r)return null;var n=Db(r);if(null===n)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(n=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!n;break e;default:e=!1}if(e)return null;if(r&&"function"!=typeof r)throw Error(o(231,t,typeof r));return r}var tt=!1;if(d)try{var rt={};Object.defineProperty(rt,"passive",{get:function(){tt=!0}}),window.addEventListener("test",rt,rt),window.removeEventListener("test",rt,rt)}catch(Pe){tt=!1}function Rb(e,t,r,n,i,s,o,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(r,c)}catch(e){this.onError(e)}}var nt=!1,it=null,st=!1,ot=null,at={onError:function(e){nt=!0,it=e}};function Xb(e,t,r,n,i,s,o,a,l){nt=!1,it=null,Rb.apply(at,arguments)}function Zb(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!=(1026&(t=e).flags)&&(r=t.return),e=t.return}while(e)}return 3===t.tag?r:null}function lt(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function ct(e){if(Zb(e)!==e)throw Error(o(188))}function ut(e){if(e=function(e){var t=e.alternate;if(!t){if(null===(t=Zb(e)))throw Error(o(188));return t!==e?null:e}for(var r=e,n=t;;){var i=r.return;if(null===i)break;var s=i.alternate;if(null===s){if(null!==(n=i.return)){r=n;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===r)return ct(i),e;if(s===n)return ct(i),t;s=s.sibling}throw Error(o(188))}if(r.return!==n.return)r=i,n=s;else{for(var a=!1,l=i.child;l;){if(l===r){a=!0,r=i,n=s;break}if(l===n){a=!0,n=i,r=s;break}l=l.sibling}if(!a){for(l=s.child;l;){if(l===r){a=!0,r=s,n=i;break}if(l===n){a=!0,n=s,r=i;break}l=l.sibling}if(!a)throw Error(o(189))}}if(r.alternate!==n)throw Error(o(190))}if(3!==r.tag)throw Error(o(188));return r.stateNode.current===r?e:t}(e),!e)return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function dt(e,t){for(var r=e.alternate;null!==t;){if(t===e||t===r)return!0;t=t.return}return!1}var ht,pt,mt,ft,gt=!1,yt=[],bt=null,vt=null,_t=null,xt=new Map,wt=new Map,St=[],Pt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Et(e,t,r,n,i){return{blockedOn:e,domEventName:t,eventSystemFlags:16|r,nativeEvent:i,targetContainers:[n]}}function Mt(e,t){switch(e){case"focusin":case"focusout":bt=null;break;case"dragenter":case"dragleave":vt=null;break;case"mouseover":case"mouseout":_t=null;break;case"pointerover":case"pointerout":xt.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":wt.delete(t.pointerId)}}function Ct(e,t,r,n,i,s){return null===e||e.nativeEvent!==s?(e=Et(t,r,n,i,s),null!==t&&(null!==(t=Cb(t))&&pt(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,null!==i&&-1===t.indexOf(i)&&t.push(i),e)}function At(e){var t=jn(e.target);if(null!==t){var r=Zb(t);if(null!==r)if(13===(t=r.tag)){if(null!==(t=lt(r)))return e.blockedOn=t,void ft(e.lanePriority,(function(){s.unstable_runWithPriority(e.priority,(function(){mt(r)}))}))}else if(3===t&&r.stateNode.hydrate)return void(e.blockedOn=3===r.tag?r.stateNode.containerInfo:null)}e.blockedOn=null}function Tt(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var r=Jt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==r)return null!==(t=Cb(r))&&pt(t),e.blockedOn=r,!1;t.shift()}return!0}function Dt(e,t,r){Tt(e)&&r.delete(t)}function Ac(){for(gt=!1;0<yt.length;){var e=yt[0];if(null!==e.blockedOn){null!==(e=Cb(e.blockedOn))&&ht(e);break}for(var t=e.targetContainers;0<t.length;){var r=Jt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==r){e.blockedOn=r;break}t.shift()}null===e.blockedOn&&yt.shift()}null!==bt&&Tt(bt)&&(bt=null),null!==vt&&Tt(vt)&&(vt=null),null!==_t&&Tt(_t)&&(_t=null),xt.forEach(Dt),wt.forEach(Dt)}function Bc(e,t){e.blockedOn===t&&(e.blockedOn=null,gt||(gt=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,Ac)))}function Cc(e){function t(t){return Bc(t,e)}if(0<yt.length){Bc(yt[0],e);for(var r=1;r<yt.length;r++){var n=yt[r];n.blockedOn===e&&(n.blockedOn=null)}}for(null!==bt&&Bc(bt,e),null!==vt&&Bc(vt,e),null!==_t&&Bc(_t,e),xt.forEach(t),wt.forEach(t),r=0;r<St.length;r++)(n=St[r]).blockedOn===e&&(n.blockedOn=null);for(;0<St.length&&null===(r=St[0]).blockedOn;)At(r),null===r.blockedOn&&St.shift()}function Dc(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Ot={animationend:Dc("Animation","AnimationEnd"),animationiteration:Dc("Animation","AnimationIteration"),animationstart:Dc("Animation","AnimationStart"),transitionend:Dc("Transition","TransitionEnd")},Rt={},Lt={};function Hc(e){if(Rt[e])return Rt[e];if(!Ot[e])return e;var t,r=Ot[e];for(t in r)if(r.hasOwnProperty(t)&&t in Lt)return Rt[e]=r[t];return e}d&&(Lt=document.createElement("div").style,"AnimationEvent"in window||(delete Ot.animationend.animation,delete Ot.animationiteration.animation,delete Ot.animationstart.animation),"TransitionEvent"in window||delete Ot.transitionend.transition);var kt=Hc("animationend"),Nt=Hc("animationiteration"),Ft=Hc("animationstart"),It=Hc("transitionend"),Bt=new Map,jt=new Map,Ht=["abort","abort",kt,"animationEnd",Nt,"animationIteration",Ft,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",It,"transitionEnd","waiting","waiting"];function Pc(e,t){for(var r=0;r<e.length;r+=2){var n=e[r],i=e[r+1];i="on"+(i[0].toUpperCase()+i.slice(1)),jt.set(n,t),Bt.set(n,i),c(i,[n])}}(0,s.unstable_now)();var Ut=8;function Rc(e){if(0!=(1&e))return Ut=15,1;if(0!=(2&e))return Ut=14,2;if(0!=(4&e))return Ut=13,4;var t=24&e;return 0!==t?(Ut=12,t):0!=(32&e)?(Ut=11,32):0!==(t=192&e)?(Ut=10,t):0!=(256&e)?(Ut=9,256):0!==(t=3584&e)?(Ut=8,t):0!=(4096&e)?(Ut=7,4096):0!==(t=4186112&e)?(Ut=6,t):0!==(t=62914560&e)?(Ut=5,t):67108864&e?(Ut=4,67108864):0!=(134217728&e)?(Ut=3,134217728):0!==(t=805306368&e)?(Ut=2,t):0!=(1073741824&e)?(Ut=1,1073741824):(Ut=8,e)}function Uc(e,t){var r=e.pendingLanes;if(0===r)return Ut=0;var n=0,i=0,s=e.expiredLanes,o=e.suspendedLanes,a=e.pingedLanes;if(0!==s)n=s,i=Ut=15;else if(0!==(s=134217727&r)){var l=s&~o;0!==l?(n=Rc(l),i=Ut):0!==(a&=s)&&(n=Rc(a),i=Ut)}else 0!==(s=r&~o)?(n=Rc(s),i=Ut):0!==a&&(n=Rc(a),i=Ut);if(0===n)return 0;if(n=r&((0>(n=31-Gt(n))?0:1<<n)<<1)-1,0!==t&&t!==n&&0==(t&o)){if(Rc(t),i<=Ut)return t;Ut=i}if(0!==(t=e.entangledLanes))for(e=e.entanglements,t&=n;0<t;)i=1<<(r=31-Gt(t)),n|=e[r],t&=~i;return n}function Wc(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function Xc(e,t){switch(e){case 15:return 1;case 14:return 2;case 12:return 0===(e=Yc(24&~t))?Xc(10,t):e;case 10:return 0===(e=Yc(192&~t))?Xc(8,t):e;case 8:return 0===(e=Yc(3584&~t))&&(0===(e=Yc(4186112&~t))&&(e=512)),e;case 2:return 0===(t=Yc(805306368&~t))&&(t=268435456),t}throw Error(o(358,e))}function Yc(e){return e&-e}function Zc(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function zt(e,t,r){e.pendingLanes|=t;var n=t-1;e.suspendedLanes&=n,e.pingedLanes&=n,(e=e.eventTimes)[t=31-Gt(t)]=r}var Gt=Math.clz32?Math.clz32:function(e){return 0===e?32:31-(Wt(e)/Vt|0)|0},Wt=Math.log,Vt=Math.LN2;var qt=s.unstable_UserBlockingPriority,$t=s.unstable_runWithPriority,Zt=!0;function Kt(e,t,r,n){Qe||Ib();var i=Yt,s=Qe;Qe=!0;try{Hb(i,e,t,r,n)}finally{(Qe=s)||Mb()}}function Xt(e,t,r,n){$t(qt,Yt.bind(null,e,t,r,n))}function Yt(e,t,r,n){var i;if(Zt)if((i=0==(4&t))&&0<yt.length&&-1<Pt.indexOf(e))e=Et(null,e,t,r,n),yt.push(e);else{var s=Jt(e,t,r,n);if(null===s)i&&Mt(e,n);else{if(i){if(-1<Pt.indexOf(e))return e=Et(s,e,t,r,n),void yt.push(e);if(function(e,t,r,n,i){switch(t){case"focusin":return bt=Ct(bt,e,t,r,n,i),!0;case"dragenter":return vt=Ct(vt,e,t,r,n,i),!0;case"mouseover":return _t=Ct(_t,e,t,r,n,i),!0;case"pointerover":var s=i.pointerId;return xt.set(s,Ct(xt.get(s)||null,e,t,r,n,i)),!0;case"gotpointercapture":return s=i.pointerId,wt.set(s,Ct(wt.get(s)||null,e,t,r,n,i)),!0}return!1}(s,e,t,r,n))return;Mt(e,n)}bn(e,t,n,null,r)}}}function Jt(e,t,r,n){var i=Ve(n);if(null!==(i=jn(i))){var s=Zb(i);if(null===s)i=null;else{var o=s.tag;if(13===o){if(null!==(i=lt(s)))return i;i=null}else if(3===o){if(s.stateNode.hydrate)return 3===s.tag?s.stateNode.containerInfo:null;i=null}else s!==i&&(i=null)}}return bn(e,t,n,i,r),null}var Qt=null,er=null,tr=null;function rr(){if(tr)return tr;var e,t,r=er,n=r.length,i="value"in Qt?Qt.value:Qt.textContent,s=i.length;for(e=0;e<n&&r[e]===i[e];e++);var o=n-e;for(t=1;t<=o&&r[n-t]===i[s-t];t++);return tr=i.slice(e,1<t?1-t:void 0)}function nr(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function ir(){return!0}function sr(){return!1}function or(e){function t(t,r,n,i,s){for(var o in this._reactName=t,this._targetInst=n,this.type=r,this.nativeEvent=i,this.target=s,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(null!=i.defaultPrevented?i.defaultPrevented:!1===i.returnValue)?ir:sr,this.isPropagationStopped=sr,this}return i(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=ir)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=ir)},persist:function(){},isPersistent:ir}),t}var ar,lr,cr,ur={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},dr=or(ur),hr=i({},ur,{view:0,detail:0}),pr=or(hr),mr=i({},hr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Er,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==cr&&(cr&&"mousemove"===e.type?(ar=e.screenX-cr.screenX,lr=e.screenY-cr.screenY):lr=ar=0,cr=e),ar)},movementY:function(e){return"movementY"in e?e.movementY:lr}}),fr=or(mr),gr=or(i({},mr,{dataTransfer:0})),yr=or(i({},hr,{relatedTarget:0})),br=or(i({},ur,{animationName:0,elapsedTime:0,pseudoElement:0})),vr=i({},ur,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),_r=or(vr),xr=or(i({},ur,{data:0})),wr={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Sr={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Pr={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Pd(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Pr[e])&&!!t[e]}function Er(){return Pd}var Mr=i({},hr,{key:function(e){if(e.key){var t=wr[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=nr(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?Sr[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Er,charCode:function(e){return"keypress"===e.type?nr(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?nr(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),Cr=or(Mr),Ar=or(i({},mr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Tr=or(i({},hr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Er})),Dr=or(i({},ur,{propertyName:0,elapsedTime:0,pseudoElement:0})),Or=i({},mr,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Rr=or(Or),Lr=[9,13,27,32],kr=d&&"CompositionEvent"in window,Nr=null;d&&"documentMode"in document&&(Nr=document.documentMode);var Fr=d&&"TextEvent"in window&&!Nr,Ir=d&&(!kr||Nr&&8<Nr&&11>=Nr),Br=String.fromCharCode(32),jr=!1;function Hr(e,t){switch(e){case"keyup":return-1!==Lr.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ur(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var zr=!1;var Gr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Wr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Gr[e.type]:"textarea"===t}function Vr(e,t,r,n){Eb(n),0<(t=_n(t,"onChange")).length&&(r=new dr("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var qr=null,$r=null;function Zr(e){pn(e,0)}function Kr(e){if(Wa(Hn(e)))return e}function Xr(e,t){if("change"===e)return t}var Yr=!1;if(d){var Jr;if(d){var Qr="oninput"in document;if(!Qr){var en=document.createElement("div");en.setAttribute("oninput","return;"),Qr="function"==typeof en.oninput}Jr=Qr}else Jr=!1;Yr=Jr&&(!document.documentMode||9<document.documentMode)}function Ae(){qr&&(qr.detachEvent("onpropertychange",Be),$r=qr=null)}function Be(e){if("value"===e.propertyName&&Kr($r)){var t=[];if(Vr(t,$r,e,Ve(e)),e=Zr,Qe)e(t);else{Qe=!0;try{Gb(e,t)}finally{Qe=!1,Mb()}}}}function Ce(e,t,r){"focusin"===e?(Ae(),$r=r,(qr=t).attachEvent("onpropertychange",Be)):"focusout"===e&&Ae()}function De(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Kr($r)}function Ee(e,t){if("click"===e)return Kr(t)}function Fe(e,t){if("input"===e||"change"===e)return Kr(t)}var tn="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},rn=Object.prototype.hasOwnProperty;function Je(e,t){if(tn(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++)if(!rn.call(t,r[n])||!tn(e[r[n]],t[r[n]]))return!1;return!0}function Ke(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Le(e,t){var r,n=Ke(e);for(e=0;n;){if(3===n.nodeType){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Ke(n)}}function Me(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?Me(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function Ne(){for(var e=window,t=Xa();t instanceof e.HTMLIFrameElement;){try{var r="string"==typeof t.contentWindow.location.href}catch(e){r=!1}if(!r)break;t=Xa((e=t.contentWindow).document)}return t}function Oe(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var nn=d&&"documentMode"in document&&11>=document.documentMode,sn=null,on=null,an=null,ln=!1;function Ue(e,t,r){var n=r.window===r?r.document:9===r.nodeType?r:r.ownerDocument;ln||null==sn||sn!==Xa(n)||("selectionStart"in(n=sn)&&Oe(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},an&&Je(an,n)||(an=n,0<(n=_n(on,"onSelect")).length&&(t=new dr("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=sn)))}Pc("cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focusin focus focusout blur input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0),Pc("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1),Pc(Ht,2);for(var cn="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),un=0;un<cn.length;un++)jt.set(cn[un],0);u("onMouseEnter",["mouseout","mouseover"]),u("onMouseLeave",["mouseout","mouseover"]),u("onPointerEnter",["pointerout","pointerover"]),u("onPointerLeave",["pointerout","pointerover"]),c("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),c("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),c("onBeforeInput",["compositionend","keypress","textInput","paste"]),c("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var dn="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),hn=new Set("cancel close invalid load scroll toggle".split(" ").concat(dn));function Ze(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,function(e,t,r,n,i,s,a,l,c){if(Xb.apply(this,arguments),nt){if(!nt)throw Error(o(198));var u=it;nt=!1,it=null,st||(st=!0,ot=u)}}(n,t,void 0,e),e.currentTarget=null}function pn(e,t){t=0!=(4&t);for(var r=0;r<e.length;r++){var n=e[r],i=n.event;n=n.listeners;e:{var s=void 0;if(t)for(var o=n.length-1;0<=o;o--){var a=n[o],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==s&&i.isPropagationStopped())break e;Ze(i,a,c),s=l}else for(o=0;o<n.length;o++){if(l=(a=n[o]).instance,c=a.currentTarget,a=a.listener,l!==s&&i.isPropagationStopped())break e;Ze(i,a,c),s=l}}}if(st)throw e=ot,st=!1,ot=null,e}function G(e,t){var r=Un(t),n=e+"__bubble";r.has(n)||(yn(t,e,2,!1),r.add(n))}var mn="_reactListening"+Math.random().toString(36).slice(2);function fn(e){e[mn]||(e[mn]=!0,a.forEach((function(t){hn.has(t)||gn(t,!1,e,null),gn(t,!0,e,null)})))}function gn(e,t,r,n){var i=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,s=r;if("selectionchange"===e&&9!==r.nodeType&&(s=r.ownerDocument),null!==n&&!t&&hn.has(e)){if("scroll"!==e)return;i|=2,s=n}var o=Un(s),a=e+"__"+(t?"capture":"bubble");o.has(a)||(t&&(i|=4),yn(s,e,i,t),o.add(a))}function yn(e,t,r,n){var i=jt.get(t);switch(void 0===i?2:i){case 0:i=Kt;break;case 1:i=Xt;break;default:i=Yt}r=i.bind(null,t,r,e),i=void 0,!tt||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(i=!0),n?void 0!==i?e.addEventListener(t,r,{capture:!0,passive:i}):e.addEventListener(t,r,!0):void 0!==i?e.addEventListener(t,r,{passive:i}):e.addEventListener(t,r,!1)}function bn(e,t,r,n,i){var s=n;if(0==(1&t)&&0==(2&t)&&null!==n)e:for(;;){if(null===n)return;var o=n.tag;if(3===o||4===o){var a=n.stateNode.containerInfo;if(a===i||8===a.nodeType&&a.parentNode===i)break;if(4===o)for(o=n.return;null!==o;){var l=o.tag;if((3===l||4===l)&&((l=o.stateNode.containerInfo)===i||8===l.nodeType&&l.parentNode===i))return;o=o.return}for(;null!==a;){if(null===(o=jn(a)))return;if(5===(l=o.tag)||6===l){n=s=o;continue e}a=a.parentNode}}n=n.return}!function(e,t,r){if(et)return e(t,r);et=!0;try{return Ye(e,t,r)}finally{et=!1,Mb()}}((function(){var n=s,i=Ve(r),o=[];e:{var a=Bt.get(e);if(void 0!==a){var l=dr,c=e;switch(e){case"keypress":if(0===nr(r))break e;case"keydown":case"keyup":l=Cr;break;case"focusin":c="focus",l=yr;break;case"focusout":c="blur",l=yr;break;case"beforeblur":case"afterblur":l=yr;break;case"click":if(2===r.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=fr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=gr;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=Tr;break;case kt:case Nt:case Ft:l=br;break;case It:l=Dr;break;case"scroll":l=pr;break;case"wheel":l=Rr;break;case"copy":case"cut":case"paste":l=_r;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=Ar}var u=0!=(4&t),d=!u&&"scroll"===e,h=u?null!==a?a+"Capture":null:a;u=[];for(var p,m=n;null!==m;){var f=(p=m).stateNode;if(5===p.tag&&null!==f&&(p=f,null!==h&&(null!=(f=Ob(m,h))&&u.push(vn(m,f,p)))),d)break;m=m.return}0<u.length&&(a=new l(a,c,null,r,i),o.push({event:a,listeners:u}))}}if(0==(7&t)){if(l="mouseout"===e||"pointerout"===e,(!(a="mouseover"===e||"pointerover"===e)||0!=(16&t)||!(c=r.relatedTarget||r.fromElement)||!jn(c)&&!c[In])&&(l||a)&&(a=i.window===i?i:(a=i.ownerDocument)?a.defaultView||a.parentWindow:window,l?(l=n,null!==(c=(c=r.relatedTarget||r.toElement)?jn(c):null)&&(c!==(d=Zb(c))||5!==c.tag&&6!==c.tag)&&(c=null)):(l=null,c=n),l!==c)){if(u=fr,f="onMouseLeave",h="onMouseEnter",m="mouse","pointerout"!==e&&"pointerover"!==e||(u=Ar,f="onPointerLeave",h="onPointerEnter",m="pointer"),d=null==l?a:Hn(l),p=null==c?a:Hn(c),(a=new u(f,m+"leave",l,r,i)).target=d,a.relatedTarget=p,f=null,jn(i)===n&&((u=new u(h,m+"enter",c,r,i)).target=p,u.relatedTarget=d,f=u),d=f,l&&c)e:{for(h=c,m=0,p=u=l;p;p=xn(p))m++;for(p=0,f=h;f;f=xn(f))p++;for(;0<m-p;)u=xn(u),m--;for(;0<p-m;)h=xn(h),p--;for(;m--;){if(u===h||null!==h&&u===h.alternate)break e;u=xn(u),h=xn(h)}u=null}else u=null;null!==l&&wn(o,a,l,u,!1),null!==c&&null!==d&&wn(o,d,c,u,!0)}if("select"===(l=(a=n?Hn(n):window).nodeName&&a.nodeName.toLowerCase())||"input"===l&&"file"===a.type)var g=Xr;else if(Wr(a))if(Yr)g=Fe;else{g=De;var y=Ce}else(l=a.nodeName)&&"input"===l.toLowerCase()&&("checkbox"===a.type||"radio"===a.type)&&(g=Ee);switch(g&&(g=g(e,n))?Vr(o,g,r,i):(y&&y(e,a,n),"focusout"===e&&(y=a._wrapperState)&&y.controlled&&"number"===a.type&&pe(a,"number",a.value)),y=n?Hn(n):window,e){case"focusin":(Wr(y)||"true"===y.contentEditable)&&(sn=y,on=n,an=null);break;case"focusout":an=on=sn=null;break;case"mousedown":ln=!0;break;case"contextmenu":case"mouseup":case"dragend":ln=!1,Ue(o,r,i);break;case"selectionchange":if(nn)break;case"keydown":case"keyup":Ue(o,r,i)}var b;if(kr)e:{switch(e){case"compositionstart":var v="onCompositionStart";break e;case"compositionend":v="onCompositionEnd";break e;case"compositionupdate":v="onCompositionUpdate";break e}v=void 0}else zr?Hr(e,r)&&(v="onCompositionEnd"):"keydown"===e&&229===r.keyCode&&(v="onCompositionStart");v&&(Ir&&"ko"!==r.locale&&(zr||"onCompositionStart"!==v?"onCompositionEnd"===v&&zr&&(b=rr()):(er="value"in(Qt=i)?Qt.value:Qt.textContent,zr=!0)),0<(y=_n(n,v)).length&&(v=new xr(v,e,null,r,i),o.push({event:v,listeners:y}),b?v.data=b:null!==(b=Ur(r))&&(v.data=b))),(b=Fr?function(e,t){switch(e){case"compositionend":return Ur(t);case"keypress":return 32!==t.which?null:(jr=!0,Br);case"textInput":return(e=t.data)===Br&&jr?null:e;default:return null}}(e,r):function(e,t){if(zr)return"compositionend"===e||!kr&&Hr(e,t)?(e=rr(),tr=er=Qt=null,zr=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Ir&&"ko"!==t.locale?null:t.data}}(e,r))&&(0<(n=_n(n,"onBeforeInput")).length&&(i=new xr("onBeforeInput","beforeinput",null,r,i),o.push({event:i,listeners:n}),i.data=b))}pn(o,t)}))}function vn(e,t,r){return{instance:e,listener:t,currentTarget:r}}function _n(e,t){for(var r=t+"Capture",n=[];null!==e;){var i=e,s=i.stateNode;5===i.tag&&null!==s&&(i=s,null!=(s=Ob(e,r))&&n.unshift(vn(e,s,i)),null!=(s=Ob(e,t))&&n.push(vn(e,s,i))),e=e.return}return n}function xn(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function wn(e,t,r,n,i){for(var s=t._reactName,o=[];null!==r&&r!==n;){var a=r,l=a.alternate,c=a.stateNode;if(null!==l&&l===n)break;5===a.tag&&null!==c&&(a=c,i?null!=(l=Ob(r,s))&&o.unshift(vn(r,l,a)):i||null!=(l=Ob(r,s))&&o.push(vn(r,l,a))),r=r.return}0!==o.length&&e.push({event:t,listeners:o})}function Sn(){}var Pn=null,En=null;function Mn(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function Cn(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var An="function"==typeof setTimeout?setTimeout:void 0,Tn="function"==typeof clearTimeout?clearTimeout:void 0;function Dn(e){1===e.nodeType?e.textContent="":9===e.nodeType&&(null!=(e=e.body)&&(e.textContent=""))}function On(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function Rn(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var r=e.data;if("$"===r||"$!"===r||"$?"===r){if(0===t)return e;t--}else"/$"===r&&t++}e=e.previousSibling}return null}var Ln=0;var kn=Math.random().toString(36).slice(2),Nn="__reactFiber$"+kn,Fn="__reactProps$"+kn,In="__reactContainer$"+kn,Bn="__reactEvents$"+kn;function jn(e){var t=e[Nn];if(t)return t;for(var r=e.parentNode;r;){if(t=r[In]||r[Nn]){if(r=t.alternate,null!==t.child||null!==r&&null!==r.child)for(e=Rn(e);null!==e;){if(r=e[Nn])return r;e=Rn(e)}return t}r=(e=r).parentNode}return null}function Cb(e){return!(e=e[Nn]||e[In])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function Hn(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(o(33))}function Db(e){return e[Fn]||null}function Un(e){var t=e[Bn];return void 0===t&&(t=e[Bn]=new Set),t}var zn=[],Gn=-1;function Bf(e){return{current:e}}function H(e){0>Gn||(e.current=zn[Gn],zn[Gn]=null,Gn--)}function I(e,t){Gn++,zn[Gn]=e.current,e.current=t}var Wn={},Vn=Bf(Wn),qn=Bf(!1),$n=Wn;function Ef(e,t){var r=e.type.contextTypes;if(!r)return Wn;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i,s={};for(i in r)s[i]=t[i];return n&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Ff(e){return null!=(e=e.childContextTypes)}function Gf(){H(qn),H(Vn)}function Hf(e,t,r){if(Vn.current!==Wn)throw Error(o(168));I(Vn,t),I(qn,r)}function If(e,t,r){var n=e.stateNode;if(e=t.childContextTypes,"function"!=typeof n.getChildContext)return r;for(var s in n=n.getChildContext())if(!(s in e))throw Error(o(108,Ra(t)||"Unknown",s));return i({},r,n)}function Jf(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Wn,$n=Vn.current,I(Vn,e),I(qn,qn.current),!0}function Kf(e,t,r){var n=e.stateNode;if(!n)throw Error(o(169));r?(e=If(e,t,$n),n.__reactInternalMemoizedMergedChildContext=e,H(qn),H(Vn),I(Vn,e)):H(qn),I(qn,r)}var Zn=null,Kn=null,Xn=s.unstable_runWithPriority,Yn=s.unstable_scheduleCallback,Jn=s.unstable_cancelCallback,Qn=s.unstable_shouldYield,ei=s.unstable_requestPaint,ti=s.unstable_now,ri=s.unstable_getCurrentPriorityLevel,ni=s.unstable_ImmediatePriority,ii=s.unstable_UserBlockingPriority,si=s.unstable_NormalPriority,oi=s.unstable_LowPriority,ai=s.unstable_IdlePriority,li={},ci=void 0!==ei?ei:function(){},ui=null,di=null,hi=!1,pi=ti(),mi=1e4>pi?ti:function(){return ti()-pi};function fi(){switch(ri()){case ni:return 99;case ii:return 98;case si:return 97;case oi:return 96;case ai:return 95;default:throw Error(o(332))}}function gi(e){switch(e){case 99:return ni;case 98:return ii;case 97:return si;case 96:return oi;case 95:return ai;default:throw Error(o(332))}}function yi(e,t){return e=gi(e),Xn(e,t)}function bi(e,t,r){return e=gi(e),Yn(e,t,r)}function vi(){if(null!==di){var e=di;di=null,Jn(e)}_i()}function _i(){if(!hi&&null!==ui){hi=!0;var e=0;try{var t=ui;yi(99,(function(){for(;e<t.length;e++){var r=t[e];do{r=r(!0)}while(null!==r)}})),ui=null}catch(t){throw null!==ui&&(ui=ui.slice(e+1)),Yn(ni,vi),t}finally{hi=!1}}}var xi=_.ReactCurrentBatchConfig;function wi(e,t){if(e&&e.defaultProps){for(var r in t=i({},t),e=e.defaultProps)void 0===t[r]&&(t[r]=e[r]);return t}return t}var Ei=Bf(null),Ci=null,Ti=null,Di=null;function Oi(){Di=Ti=Ci=null}function Ri(e){var t=Ei.current;H(Ei),e.type._context._currentValue=t}function ki(e,t){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)===t){if(null===r||(r.childLanes&t)===t)break;r.childLanes|=t}else e.childLanes|=t,null!==r&&(r.childLanes|=t);e=e.return}}function Bi(e,t){Ci=e,Di=Ti=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!=(e.lanes&t)&&(zs=!0),e.firstContext=null)}function ji(e,t){if(Di!==e&&!1!==t&&0!==t)if("number"==typeof t&&1073741823!==t||(Di=e,t=1073741823),t={context:e,observedBits:t,next:null},null===Ti){if(null===Ci)throw Error(o(308));Ti=t,Ci.dependencies={lanes:0,firstContext:t,responders:null}}else Ti=Ti.next=t;return e._currentValue}var Hi=!1;function Ui(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function zi(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function qi(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ag(e,t){if(null!==(e=e.updateQueue)){var r=(e=e.shared).pending;null===r?t.next=t:(t.next=r.next,r.next=t),e.pending=t}}function Bg(e,t){var r=e.updateQueue,n=e.alternate;if(null!==n&&r===(n=n.updateQueue)){var i=null,s=null;if(null!==(r=r.firstBaseUpdate)){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};null===s?i=s=o:s=s.next=o,r=r.next}while(null!==r);null===s?i=s=t:s=s.next=t}else i=s=t;return r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:n.shared,effects:n.effects},void(e.updateQueue=r)}null===(e=r.lastBaseUpdate)?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Cg(e,t,r,n){var s=e.updateQueue;Hi=!1;var o=s.firstBaseUpdate,a=s.lastBaseUpdate,l=s.shared.pending;if(null!==l){s.shared.pending=null;var c=l,u=c.next;c.next=null,null===a?o=u:a.next=u,a=c;var d=e.alternate;if(null!==d){var h=(d=d.updateQueue).lastBaseUpdate;h!==a&&(null===h?d.firstBaseUpdate=u:h.next=u,d.lastBaseUpdate=c)}}if(null!==o){for(h=s.baseState,a=0,d=u=c=null;;){l=o.lane;var p=o.eventTime;if((n&l)===l){null!==d&&(d=d.next={eventTime:p,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var m=e,f=o;switch(l=t,p=r,f.tag){case 1:if("function"==typeof(m=f.payload)){h=m.call(p,h,l);break e}h=m;break e;case 3:m.flags=-4097&m.flags|64;case 0:if(null==(l="function"==typeof(m=f.payload)?m.call(p,h,l):m))break e;h=i({},h,l);break e;case 2:Hi=!0}}null!==o.callback&&(e.flags|=32,null===(l=s.effects)?s.effects=[o]:l.push(o))}else p={eventTime:p,lane:l,tag:o.tag,payload:o.payload,callback:o.callback,next:null},null===d?(u=d=p,c=h):d=d.next=p,a|=l;if(null===(o=o.next)){if(null===(l=s.shared.pending))break;o=l.next,l.next=null,s.lastBaseUpdate=l,s.shared.pending=null}}null===d&&(c=h),s.baseState=c,s.firstBaseUpdate=u,s.lastBaseUpdate=d,Io|=a,e.lanes=a,e.memoizedState=h}}function Eg(e,t,r){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var n=e[t],i=n.callback;if(null!==i){if(n.callback=null,n=r,"function"!=typeof i)throw Error(o(191,i));i.call(n)}}}var $i=(new n.Component).refs;function Gg(e,t,r,n){r=null==(r=r(n,t=e.memoizedState))?t:i({},t,r),e.memoizedState=r,0===e.lanes&&(e.updateQueue.baseState=r)}var Ji={isMounted:function(e){return!!(e=e._reactInternals)&&Zb(e)===e},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=Hg(),i=Ig(e),s=qi(n,i);s.payload=t,null!=r&&(s.callback=r),Ag(e,s),Jg(e,i,n)},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=Hg(),i=Ig(e),s=qi(n,i);s.tag=1,s.payload=t,null!=r&&(s.callback=r),Ag(e,s),Jg(e,i,n)},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Hg(),n=Ig(e),i=qi(r,n);i.tag=2,null!=t&&(i.callback=t),Ag(e,i),Jg(e,n,r)}};function Lg(e,t,r,n,i,s,o){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(n,s,o):!t.prototype||!t.prototype.isPureReactComponent||(!Je(r,n)||!Je(i,s))}function Mg(e,t,r){var n=!1,i=Wn,s=t.contextType;return"object"==typeof s&&null!==s?s=ji(s):(i=Ff(t)?$n:Vn.current,s=(n=null!=(n=t.contextTypes))?Ef(e,i):Wn),t=new t(r,s),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=Ji,e.stateNode=t,t._reactInternals=e,n&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function Ng(e,t,r,n){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(r,n),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&Ji.enqueueReplaceState(t,t.state,null)}function Og(e,t,r,n){var i=e.stateNode;i.props=r,i.state=e.memoizedState,i.refs=$i,Ui(e);var s=t.contextType;"object"==typeof s&&null!==s?i.context=ji(s):(s=Ff(t)?$n:Vn.current,i.context=Ef(e,s)),Cg(e,r,i,n),i.state=e.memoizedState,"function"==typeof(s=t.getDerivedStateFromProps)&&(Gg(e,t,s,r),i.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof i.getSnapshotBeforeUpdate||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||(t=i.state,"function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&Ji.enqueueReplaceState(i,i.state,null),Cg(e,r,i,n),i.state=e.memoizedState),"function"==typeof i.componentDidMount&&(e.flags|=4)}var Qi=Array.isArray;function Qg(e,t,r){if(null!==(e=r.ref)&&"function"!=typeof e&&"object"!=typeof e){if(r._owner){if(r=r._owner){if(1!==r.tag)throw Error(o(309));var n=r.stateNode}if(!n)throw Error(o(147,e));var i=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===i?t.ref:((t=function(e){var t=n.refs;t===$i&&(t=n.refs={}),null===e?delete t[i]:t[i]=e})._stringRef=i,t)}if("string"!=typeof e)throw Error(o(284));if(!r._owner)throw Error(o(290,e))}return e}function Rg(e,t){if("textarea"!==e.type)throw Error(o(31,"[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t))}function Sg(e){function t(t,r){if(e){var n=t.lastEffect;null!==n?(n.nextEffect=r,t.lastEffect=r):t.firstEffect=t.lastEffect=r,r.nextEffect=null,r.flags=8}}function r(r,n){if(!e)return null;for(;null!==n;)t(r,n),n=n.sibling;return null}function n(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t){return(e=Tg(e,t)).index=0,e.sibling=null,e}function s(t,r,n){return t.index=n,e?null!==(n=t.alternate)?(n=n.index)<r?(t.flags=2,r):n:(t.flags=2,r):r}function a(t){return e&&null===t.alternate&&(t.flags=2),t}function l(e,t,r,n){return null===t||6!==t.tag?((t=Ug(r,e.mode,n)).return=e,t):((t=i(t,r)).return=e,t)}function c(e,t,r,n){return null!==t&&t.elementType===r.type?((n=i(t,r.props)).ref=Qg(e,t,r),n.return=e,n):((n=Vg(r.type,r.key,r.props,null,e.mode,n)).ref=Qg(e,t,r),n.return=e,n)}function u(e,t,r,n){return null===t||4!==t.tag||t.stateNode.containerInfo!==r.containerInfo||t.stateNode.implementation!==r.implementation?((t=Wg(r,e.mode,n)).return=e,t):((t=i(t,r.children||[])).return=e,t)}function d(e,t,r,n,s){return null===t||7!==t.tag?((t=Xg(r,e.mode,n,s)).return=e,t):((t=i(t,r)).return=e,t)}function A(e,t,r){if("string"==typeof t||"number"==typeof t)return(t=Ug(""+t,e.mode,r)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case x:return(r=Vg(t.type,t.key,t.props,null,e.mode,r)).ref=Qg(e,null,t),r.return=e,r;case w:return(t=Wg(t,e.mode,r)).return=e,t}if(Qi(t)||La(t))return(t=Xg(t,e.mode,r,null)).return=e,t;Rg(e,t)}return null}function h(e,t,r,n){var i=null!==t?t.key:null;if("string"==typeof r||"number"==typeof r)return null!==i?null:l(e,t,""+r,n);if("object"==typeof r&&null!==r){switch(r.$$typeof){case x:return r.key===i?r.type===R?d(e,t,r.props.children,n,i):c(e,t,r,n):null;case w:return r.key===i?u(e,t,r,n):null}if(Qi(r)||La(r))return null!==i?null:d(e,t,r,n,null);Rg(e,r)}return null}function C(e,t,r,n,i){if("string"==typeof n||"number"==typeof n)return l(t,e=e.get(r)||null,""+n,i);if("object"==typeof n&&null!==n){switch(n.$$typeof){case x:return e=e.get(null===n.key?r:n.key)||null,n.type===R?d(t,e,n.props.children,i,n.key):c(t,e,n,i);case w:return u(t,e=e.get(null===n.key?r:n.key)||null,n,i)}if(Qi(n)||La(n))return d(t,e=e.get(r)||null,n,i,null);Rg(t,n)}return null}return function(l,c,u,d){var p="object"==typeof u&&null!==u&&u.type===R&&null===u.key;p&&(u=u.props.children);var m="object"==typeof u&&null!==u;if(m)switch(u.$$typeof){case x:e:{for(m=u.key,p=c;null!==p;){if(p.key===m){if(7===p.tag){if(u.type===R){r(l,p.sibling),(c=i(p,u.props.children)).return=l,l=c;break e}}else if(p.elementType===u.type){r(l,p.sibling),(c=i(p,u.props)).ref=Qg(l,p,u),c.return=l,l=c;break e}r(l,p);break}t(l,p),p=p.sibling}u.type===R?((c=Xg(u.props.children,l.mode,d,u.key)).return=l,l=c):((d=Vg(u.type,u.key,u.props,null,l.mode,d)).ref=Qg(l,c,u),d.return=l,l=d)}return a(l);case w:e:{for(p=u.key;null!==c;){if(c.key===p){if(4===c.tag&&c.stateNode.containerInfo===u.containerInfo&&c.stateNode.implementation===u.implementation){r(l,c.sibling),(c=i(c,u.children||[])).return=l,l=c;break e}r(l,c);break}t(l,c),c=c.sibling}(c=Wg(u,l.mode,d)).return=l,l=c}return a(l)}if("string"==typeof u||"number"==typeof u)return u=""+u,null!==c&&6===c.tag?(r(l,c.sibling),(c=i(c,u)).return=l,l=c):(r(l,c),(c=Ug(u,l.mode,d)).return=l,l=c),a(l);if(Qi(u))return function(i,o,a,l){for(var c=null,u=null,d=o,p=o=0,m=null;null!==d&&p<a.length;p++){d.index>p?(m=d,d=null):m=d.sibling;var f=h(i,d,a[p],l);if(null===f){null===d&&(d=m);break}e&&d&&null===f.alternate&&t(i,d),o=s(f,o,p),null===u?c=f:u.sibling=f,u=f,d=m}if(p===a.length)return r(i,d),c;if(null===d){for(;p<a.length;p++)null!==(d=A(i,a[p],l))&&(o=s(d,o,p),null===u?c=d:u.sibling=d,u=d);return c}for(d=n(i,d);p<a.length;p++)null!==(m=C(d,i,p,a[p],l))&&(e&&null!==m.alternate&&d.delete(null===m.key?p:m.key),o=s(m,o,p),null===u?c=m:u.sibling=m,u=m);return e&&d.forEach((function(e){return t(i,e)})),c}(l,c,u,d);if(La(u))return function(i,a,l,c){var u=La(l);if("function"!=typeof u)throw Error(o(150));if(null==(l=u.call(l)))throw Error(o(151));for(var d=u=null,p=a,m=a=0,f=null,g=l.next();null!==p&&!g.done;m++,g=l.next()){p.index>m?(f=p,p=null):f=p.sibling;var y=h(i,p,g.value,c);if(null===y){null===p&&(p=f);break}e&&p&&null===y.alternate&&t(i,p),a=s(y,a,m),null===d?u=y:d.sibling=y,d=y,p=f}if(g.done)return r(i,p),u;if(null===p){for(;!g.done;m++,g=l.next())null!==(g=A(i,g.value,c))&&(a=s(g,a,m),null===d?u=g:d.sibling=g,d=g);return u}for(p=n(i,p);!g.done;m++,g=l.next())null!==(g=C(p,i,m,g.value,c))&&(e&&null!==g.alternate&&p.delete(null===g.key?m:g.key),a=s(g,a,m),null===d?u=g:d.sibling=g,d=g);return e&&p.forEach((function(e){return t(i,e)})),u}(l,c,u,d);if(m&&Rg(l,u),void 0===u&&!p)switch(l.tag){case 1:case 22:case 0:case 11:case 15:throw Error(o(152,Ra(l.type)||"Component"))}return r(l,c)}}var es=Sg(!0),ts=Sg(!1),rs={},ns=Bf(rs),is=Bf(rs),ss=Bf(rs);function os(e){if(e===rs)throw Error(o(174));return e}function as(e,t){switch(I(ss,t),I(is,e),I(ns,rs),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:we(null,"");break;default:t=we(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}H(ns),I(ns,t)}function ls(){H(ns),H(is),H(ss)}function cs(e){os(ss.current);var t=os(ns.current),r=we(t,e.type);t!==r&&(I(is,e),I(ns,r))}function us(e){is.current===e&&(H(ns),H(is))}var ds=Bf(0);function hs(e){for(var t=e;null!==t;){if(13===t.tag){var r=t.memoizedState;if(null!==r&&(null===(r=r.dehydrated)||"$?"===r.data||"$!"===r.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(64&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ps=null,ms=null,fs=!1;function gs(e,t){var r=ba(5,null,null,0);r.elementType="DELETED",r.type="DELETED",r.stateNode=t,r.return=e,r.flags=8,null!==e.lastEffect?(e.lastEffect.nextEffect=r,e.lastEffect=r):e.firstEffect=e.lastEffect=r}function ys(e,t){switch(e.tag){case 5:var r=e.type;return null!==(t=1!==t.nodeType||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);default:return!1}}function bs(e){if(fs){var t=ms;if(t){var r=t;if(!ys(e,t)){if(!(t=On(r.nextSibling))||!ys(e,t))return e.flags=-1025&e.flags|2,fs=!1,void(ps=e);gs(ps,r)}ps=e,ms=On(t.firstChild)}else e.flags=-1025&e.flags|2,fs=!1,ps=e}}function vs(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;ps=e}function _s(e){if(e!==ps)return!1;if(!fs)return vs(e),fs=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!Cn(t,e.memoizedProps))for(t=ms;t;)gs(e,t),t=On(t.nextSibling);if(vs(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(o(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var r=e.data;if("/$"===r){if(0===t){ms=On(e.nextSibling);break e}t--}else"$"!==r&&"$!"!==r&&"$?"!==r||t++}e=e.nextSibling}ms=null}}else ms=ps?On(e.stateNode.nextSibling):null;return!0}function xs(){ms=ps=null,fs=!1}var ws=[];function Ss(){for(var e=0;e<ws.length;e++)ws[e]._workInProgressVersionPrimary=null;ws.length=0}var Ps=_.ReactCurrentDispatcher,Es=_.ReactCurrentBatchConfig,Ms=0,Cs=null,As=null,Ts=null,Ds=!1,Os=!1;function Ah(){throw Error(o(321))}function Bh(e,t){if(null===t)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!tn(e[r],t[r]))return!1;return!0}function Ch(e,t,r,n,i,s){if(Ms=s,Cs=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ps.current=null===e||null===e.memoizedState?Bs:js,e=r(n,i),Os){s=0;do{if(Os=!1,!(25>s))throw Error(o(301));s+=1,Ts=As=null,t.updateQueue=null,Ps.current=Hs,e=r(n,i)}while(Os)}if(Ps.current=Is,t=null!==As&&null!==As.next,Ms=0,Ts=As=Cs=null,Ds=!1,t)throw Error(o(300));return e}function Hh(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===Ts?Cs.memoizedState=Ts=e:Ts=Ts.next=e,Ts}function Ih(){if(null===As){var e=Cs.alternate;e=null!==e?e.memoizedState:null}else e=As.next;var t=null===Ts?Cs.memoizedState:Ts.next;if(null!==t)Ts=t,As=e;else{if(null===e)throw Error(o(310));e={memoizedState:(As=e).memoizedState,baseState:As.baseState,baseQueue:As.baseQueue,queue:As.queue,next:null},null===Ts?Cs.memoizedState=Ts=e:Ts=Ts.next=e}return Ts}function Jh(e,t){return"function"==typeof t?t(e):t}function Kh(e){var t=Ih(),r=t.queue;if(null===r)throw Error(o(311));r.lastRenderedReducer=e;var n=As,i=n.baseQueue,s=r.pending;if(null!==s){if(null!==i){var a=i.next;i.next=s.next,s.next=a}n.baseQueue=i=s,r.pending=null}if(null!==i){i=i.next,n=n.baseState;var l=a=s=null,c=i;do{var u=c.lane;if((Ms&u)===u)null!==l&&(l=l.next={lane:0,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null}),n=c.eagerReducer===e?c.eagerState:e(n,c.action);else{var d={lane:u,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null};null===l?(a=l=d,s=n):l=l.next=d,Cs.lanes|=u,Io|=u}c=c.next}while(null!==c&&c!==i);null===l?s=n:l.next=a,tn(n,t.memoizedState)||(zs=!0),t.memoizedState=n,t.baseState=s,t.baseQueue=l,r.lastRenderedState=n}return[t.memoizedState,r.dispatch]}function Lh(e){var t=Ih(),r=t.queue;if(null===r)throw Error(o(311));r.lastRenderedReducer=e;var n=r.dispatch,i=r.pending,s=t.memoizedState;if(null!==i){r.pending=null;var a=i=i.next;do{s=e(s,a.action),a=a.next}while(a!==i);tn(s,t.memoizedState)||(zs=!0),t.memoizedState=s,null===t.baseQueue&&(t.baseState=s),r.lastRenderedState=s}return[s,n]}function Mh(e,t,r){var n=t._getVersion;n=n(t._source);var i=t._workInProgressVersionPrimary;if(null!==i?e=i===n:(e=e.mutableReadLanes,(e=(Ms&e)===e)&&(t._workInProgressVersionPrimary=n,ws.push(t))),e)return r(t._source);throw ws.push(t),Error(o(350))}function Nh(e,t,r,n){var i=To;if(null===i)throw Error(o(349));var s=t._getVersion,a=s(t._source),l=Ps.current,c=l.useState((function(){return Mh(i,t,r)})),u=c[1],d=c[0];c=Ts;var h=e.memoizedState,p=h.refs,m=p.getSnapshot,f=h.source;h=h.subscribe;var g=Cs;return e.memoizedState={refs:p,source:t,subscribe:n},l.useEffect((function(){p.getSnapshot=r,p.setSnapshot=u;var e=s(t._source);if(!tn(a,e)){e=r(t._source),tn(d,e)||(u(e),e=Ig(g),i.mutableReadLanes|=e&i.pendingLanes),e=i.mutableReadLanes,i.entangledLanes|=e;for(var n=i.entanglements,o=e;0<o;){var l=31-Gt(o),c=1<<l;n[l]|=e,o&=~c}}}),[r,t,n]),l.useEffect((function(){return n(t._source,(function(){var e=p.getSnapshot,r=p.setSnapshot;try{r(e(t._source));var n=Ig(g);i.mutableReadLanes|=n&i.pendingLanes}catch(e){r((function(){throw e}))}}))}),[t,n]),tn(m,r)&&tn(f,t)&&tn(h,n)||((e={pending:null,dispatch:null,lastRenderedReducer:Jh,lastRenderedState:d}).dispatch=u=Oh.bind(null,Cs,e),c.queue=e,c.baseQueue=null,d=Mh(i,t,r),c.memoizedState=c.baseState=d),d}function Ph(e,t,r){return Nh(Ih(),e,t,r)}function Qh(e){var t=Hh();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:Jh,lastRenderedState:e}).dispatch=Oh.bind(null,Cs,e),[t.memoizedState,e]}function Rh(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},null===(t=Cs.updateQueue)?(t={lastEffect:null},Cs.updateQueue=t,t.lastEffect=e.next=e):null===(r=t.lastEffect)?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e),e}function Sh(e){return e={current:e},Hh().memoizedState=e}function Th(){return Ih().memoizedState}function Uh(e,t,r,n){var i=Hh();Cs.flags|=e,i.memoizedState=Rh(1|t,r,void 0,void 0===n?null:n)}function Vh(e,t,r,n){var i=Ih();n=void 0===n?null:n;var s=void 0;if(null!==As){var o=As.memoizedState;if(s=o.destroy,null!==n&&Bh(n,o.deps))return void Rh(t,r,s,n)}Cs.flags|=e,i.memoizedState=Rh(1|t,r,s,n)}function Wh(e,t){return Uh(516,4,e,t)}function Xh(e,t){return Vh(516,4,e,t)}function Yh(e,t){return Vh(4,2,e,t)}function Zh(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Rs(e,t,r){return r=null!=r?r.concat([e]):null,Vh(4,2,Zh.bind(null,t,e),r)}function Ls(){}function ks(e,t){var r=Ih();t=void 0===t?null:t;var n=r.memoizedState;return null!==n&&null!==t&&Bh(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function Ns(e,t){var r=Ih();t=void 0===t?null:t;var n=r.memoizedState;return null!==n&&null!==t&&Bh(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function Fs(e,t){var r=fi();yi(98>r?98:r,(function(){e(!0)})),yi(97<r?97:r,(function(){var r=Es.transition;Es.transition=1;try{e(!1),t()}finally{Es.transition=r}}))}function Oh(e,t,r){var n=Hg(),i=Ig(e),s={lane:i,action:r,eagerReducer:null,eagerState:null,next:null},o=t.pending;if(null===o?s.next=s:(s.next=o.next,o.next=s),t.pending=s,o=e.alternate,e===Cs||null!==o&&o===Cs)Os=Ds=!0;else{if(0===e.lanes&&(null===o||0===o.lanes)&&null!==(o=t.lastRenderedReducer))try{var a=t.lastRenderedState,l=o(a,r);if(s.eagerReducer=o,s.eagerState=l,tn(l,a))return}catch(e){}Jg(e,i,n)}}var Is={readContext:ji,useCallback:Ah,useContext:Ah,useEffect:Ah,useImperativeHandle:Ah,useLayoutEffect:Ah,useMemo:Ah,useReducer:Ah,useRef:Ah,useState:Ah,useDebugValue:Ah,useDeferredValue:Ah,useTransition:Ah,useMutableSource:Ah,useOpaqueIdentifier:Ah,unstable_isNewReconciler:!1},Bs={readContext:ji,useCallback:function(e,t){return Hh().memoizedState=[e,void 0===t?null:t],e},useContext:ji,useEffect:Wh,useImperativeHandle:function(e,t,r){return r=null!=r?r.concat([e]):null,Uh(4,2,Zh.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Uh(4,2,e,t)},useMemo:function(e,t){var r=Hh();return t=void 0===t?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Hh();return t=void 0!==r?r(t):t,n.memoizedState=n.baseState=t,e=(e=n.queue={pending:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=Oh.bind(null,Cs,e),[n.memoizedState,e]},useRef:Sh,useState:Qh,useDebugValue:Ls,useDeferredValue:function(e){var t=Qh(e),r=t[0],n=t[1];return Wh((function(){var t=Es.transition;Es.transition=1;try{n(e)}finally{Es.transition=t}}),[e]),r},useTransition:function(){var e=Qh(!1),t=e[0];return Sh(e=Fs.bind(null,e[1])),[e,t]},useMutableSource:function(e,t,r){var n=Hh();return n.memoizedState={refs:{getSnapshot:t,setSnapshot:null},source:e,subscribe:r},Nh(n,e,t,r)},useOpaqueIdentifier:function(){if(fs){var e=!1,t=function(e){return{$$typeof:re,toString:e,valueOf:e}}((function(){throw e||(e=!0,r("r:"+(Ln++).toString(36))),Error(o(355))})),r=Qh(t)[1];return 0==(2&Cs.mode)&&(Cs.flags|=516,Rh(5,(function(){r("r:"+(Ln++).toString(36))}),void 0,null)),t}return Qh(t="r:"+(Ln++).toString(36)),t},unstable_isNewReconciler:!1},js={readContext:ji,useCallback:ks,useContext:ji,useEffect:Xh,useImperativeHandle:Rs,useLayoutEffect:Yh,useMemo:Ns,useReducer:Kh,useRef:Th,useState:function(){return Kh(Jh)},useDebugValue:Ls,useDeferredValue:function(e){var t=Kh(Jh),r=t[0],n=t[1];return Xh((function(){var t=Es.transition;Es.transition=1;try{n(e)}finally{Es.transition=t}}),[e]),r},useTransition:function(){var e=Kh(Jh)[0];return[Th().current,e]},useMutableSource:Ph,useOpaqueIdentifier:function(){return Kh(Jh)[0]},unstable_isNewReconciler:!1},Hs={readContext:ji,useCallback:ks,useContext:ji,useEffect:Xh,useImperativeHandle:Rs,useLayoutEffect:Yh,useMemo:Ns,useReducer:Lh,useRef:Th,useState:function(){return Lh(Jh)},useDebugValue:Ls,useDeferredValue:function(e){var t=Lh(Jh),r=t[0],n=t[1];return Xh((function(){var t=Es.transition;Es.transition=1;try{n(e)}finally{Es.transition=t}}),[e]),r},useTransition:function(){var e=Lh(Jh)[0];return[Th().current,e]},useMutableSource:Ph,useOpaqueIdentifier:function(){return Lh(Jh)[0]},unstable_isNewReconciler:!1},Us=_.ReactCurrentOwner,zs=!1;function Gs(e,t,r,n){t.child=null===e?ts(t,null,r,n):es(t,e.child,r,n)}function Ws(e,t,r,n,i){r=r.render;var s=t.ref;return Bi(t,i),n=Ch(e,t,r,n,s,i),null===e||zs?(t.flags|=1,Gs(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~i,uo(e,t,i))}function Vs(e,t,r,n,i,s){if(null===e){var o=r.type;return"function"!=typeof o||va(o)||void 0!==o.defaultProps||null!==r.compare||void 0!==r.defaultProps?((e=Vg(r.type,null,n,t,t.mode,s)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=o,qs(e,t,o,n,i,s))}return o=e.child,0==(i&s)&&(i=o.memoizedProps,(r=null!==(r=r.compare)?r:Je)(i,n)&&e.ref===t.ref)?uo(e,t,s):(t.flags|=1,(e=Tg(o,n)).ref=t.ref,e.return=t,t.child=e)}function qs(e,t,r,n,i,s){if(null!==e&&Je(e.memoizedProps,n)&&e.ref===t.ref){if(zs=!1,0==(s&i))return t.lanes=e.lanes,uo(e,t,s);0!=(16384&e.flags)&&(zs=!0)}return Ks(e,t,r,n,s)}function $s(e,t,r){var n=t.pendingProps,i=n.children,s=null!==e?e.memoizedState:null;if("hidden"===n.mode||"unstable-defer-without-hiding"===n.mode)if(0==(4&t.mode))t.memoizedState={baseLanes:0},la(t,r);else{if(0==(1073741824&r))return e=null!==s?s.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e},la(t,e),null;t.memoizedState={baseLanes:0},la(t,null!==s?s.baseLanes:r)}else null!==s?(n=s.baseLanes|r,t.memoizedState=null):n=r,la(t,n);return Gs(e,t,i,r),t.child}function Zs(e,t){var r=t.ref;(null===e&&null!==r||null!==e&&e.ref!==r)&&(t.flags|=128)}function Ks(e,t,r,n,i){var s=Ff(r)?$n:Vn.current;return s=Ef(t,s),Bi(t,i),r=Ch(e,t,r,n,s,i),null===e||zs?(t.flags|=1,Gs(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~i,uo(e,t,i))}function Xs(e,t,r,n,i){if(Ff(r)){var s=!0;Jf(t)}else s=!1;if(Bi(t,i),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),Mg(t,r,n),Og(t,r,n,i),n=!0;else if(null===e){var o=t.stateNode,a=t.memoizedProps;o.props=a;var l=o.context,c=r.contextType;"object"==typeof c&&null!==c?c=ji(c):c=Ef(t,c=Ff(r)?$n:Vn.current);var u=r.getDerivedStateFromProps,d="function"==typeof u||"function"==typeof o.getSnapshotBeforeUpdate;d||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(a!==n||l!==c)&&Ng(t,o,n,c),Hi=!1;var h=t.memoizedState;o.state=h,Cg(t,n,o,i),l=t.memoizedState,a!==n||h!==l||qn.current||Hi?("function"==typeof u&&(Gg(t,r,u,n),l=t.memoizedState),(a=Hi||Lg(t,r,a,n,h,l,c))?(d||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||("function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount()),"function"==typeof o.componentDidMount&&(t.flags|=4)):("function"==typeof o.componentDidMount&&(t.flags|=4),t.memoizedProps=n,t.memoizedState=l),o.props=n,o.state=l,o.context=c,n=a):("function"==typeof o.componentDidMount&&(t.flags|=4),n=!1)}else{o=t.stateNode,zi(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:wi(t.type,a),o.props=c,d=t.pendingProps,h=o.context,"object"==typeof(l=r.contextType)&&null!==l?l=ji(l):l=Ef(t,l=Ff(r)?$n:Vn.current);var p=r.getDerivedStateFromProps;(u="function"==typeof p||"function"==typeof o.getSnapshotBeforeUpdate)||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(a!==d||h!==l)&&Ng(t,o,n,l),Hi=!1,h=t.memoizedState,o.state=h,Cg(t,n,o,i);var m=t.memoizedState;a!==d||h!==m||qn.current||Hi?("function"==typeof p&&(Gg(t,r,p,n),m=t.memoizedState),(c=Hi||Lg(t,r,c,n,h,m,l))?(u||"function"!=typeof o.UNSAFE_componentWillUpdate&&"function"!=typeof o.componentWillUpdate||("function"==typeof o.componentWillUpdate&&o.componentWillUpdate(n,m,l),"function"==typeof o.UNSAFE_componentWillUpdate&&o.UNSAFE_componentWillUpdate(n,m,l)),"function"==typeof o.componentDidUpdate&&(t.flags|=4),"function"==typeof o.getSnapshotBeforeUpdate&&(t.flags|=256)):("function"!=typeof o.componentDidUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof o.getSnapshotBeforeUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=256),t.memoizedProps=n,t.memoizedState=m),o.props=n,o.state=m,o.context=l,n=c):("function"!=typeof o.componentDidUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof o.getSnapshotBeforeUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=256),n=!1)}return Ys(e,t,r,n,s,i)}function Ys(e,t,r,n,i,s){Zs(e,t);var o=0!=(64&t.flags);if(!n&&!o)return i&&Kf(t,r,!1),uo(e,t,s);n=t.stateNode,Us.current=t;var a=o&&"function"!=typeof r.getDerivedStateFromError?null:n.render();return t.flags|=1,null!==e&&o?(t.child=es(t,e.child,null,s),t.child=es(t,null,a,s)):Gs(e,t,a,s),t.memoizedState=n.state,i&&Kf(t,r,!0),t.child}function Js(e){var t=e.stateNode;t.pendingContext?Hf(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Hf(0,t.context,!1),as(e,t.containerInfo)}var Qs,eo,to,ro,no={dehydrated:null,retryLane:0};function io(e,t,r){var n,i=t.pendingProps,s=ds.current,o=!1;return(n=0!=(64&t.flags))||(n=(null===e||null!==e.memoizedState)&&0!=(2&s)),n?(o=!0,t.flags&=-65):null!==e&&null===e.memoizedState||void 0===i.fallback||!0===i.unstable_avoidThisFallback||(s|=1),I(ds,1&s),null===e?(void 0!==i.fallback&&bs(t),e=i.children,s=i.fallback,o?(e=so(t,e,s,r),t.child.memoizedState={baseLanes:r},t.memoizedState=no,e):"number"==typeof i.unstable_expectedLoadTime?(e=so(t,e,s,r),t.child.memoizedState={baseLanes:r},t.memoizedState=no,t.lanes=33554432,e):((r=_a({mode:"visible",children:e},t.mode,r,null)).return=t,t.child=r)):(e.memoizedState,o?(i=ao(e,t,i.children,i.fallback,r),o=t.child,s=e.child.memoizedState,o.memoizedState=null===s?{baseLanes:r}:{baseLanes:s.baseLanes|r},o.childLanes=e.childLanes&~r,t.memoizedState=no,i):(r=oo(e,t,i.children,r),t.memoizedState=null,r))}function so(e,t,r,n){var i=e.mode,s=e.child;return t={mode:"hidden",children:t},0==(2&i)&&null!==s?(s.childLanes=0,s.pendingProps=t):s=_a(t,i,0,null),r=Xg(r,i,n,null),s.return=e,r.return=e,s.sibling=r,e.child=s,r}function oo(e,t,r,n){var i=e.child;return e=i.sibling,r=Tg(i,{mode:"visible",children:r}),0==(2&t.mode)&&(r.lanes=n),r.return=t,r.sibling=null,null!==e&&(e.nextEffect=null,e.flags=8,t.firstEffect=t.lastEffect=e),t.child=r}function ao(e,t,r,n,i){var s=t.mode,o=e.child;e=o.sibling;var a={mode:"hidden",children:r};return 0==(2&s)&&t.child!==o?((r=t.child).childLanes=0,r.pendingProps=a,null!==(o=r.lastEffect)?(t.firstEffect=r.firstEffect,t.lastEffect=o,o.nextEffect=null):t.firstEffect=t.lastEffect=null):r=Tg(o,a),null!==e?n=Tg(e,n):(n=Xg(n,s,i,null)).flags|=2,n.return=t,r.return=t,r.sibling=n,t.child=r,n}function lo(e,t){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),ki(e.return,t)}function co(e,t,r,n,i,s){var o=e.memoizedState;null===o?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i,lastEffect:s}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=n,o.tail=r,o.tailMode=i,o.lastEffect=s)}function Ai(e,t,r){var n=t.pendingProps,i=n.revealOrder,s=n.tail;if(Gs(e,t,n.children,r),0!=(2&(n=ds.current)))n=1&n|2,t.flags|=64;else{if(null!==e&&0!=(64&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&lo(e,r);else if(19===e.tag)lo(e,r);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(I(ds,n),0==(2&t.mode))t.memoizedState=null;else switch(i){case"forwards":for(r=t.child,i=null;null!==r;)null!==(e=r.alternate)&&null===hs(e)&&(i=r),r=r.sibling;null===(r=i)?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),co(t,!1,i,r,s,t.lastEffect);break;case"backwards":for(r=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===hs(e)){t.child=i;break}e=i.sibling,i.sibling=r,r=i,i=e}co(t,!0,r,null,s,t.lastEffect);break;case"together":co(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}return t.child}function uo(e,t,r){if(null!==e&&(t.dependencies=e.dependencies),Io|=t.lanes,0!=(r&t.childLanes)){if(null!==e&&t.child!==e.child)throw Error(o(153));if(null!==t.child){for(r=Tg(e=t.child,e.pendingProps),t.child=r,r.return=t;null!==e.sibling;)e=e.sibling,(r=r.sibling=Tg(e,e.pendingProps)).return=t;r.sibling=null}return t.child}return null}function Fi(e,t){if(!fs)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;null!==t;)null!==t.alternate&&(r=t),t=t.sibling;null===r?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;null!==r;)null!==r.alternate&&(n=r),r=r.sibling;null===n?t||null===e.tail?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Gi(e,t,r){var n=t.pendingProps;switch(t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:case 17:return Ff(t.type)&&Gf(),null;case 3:return ls(),H(qn),H(Vn),Ss(),(n=t.stateNode).pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||(_s(t)?t.flags|=4:n.hydrate||(t.flags|=256)),eo(t),null;case 5:us(t);var s=os(ss.current);if(r=t.type,null!==e&&null!=t.stateNode)to(e,t,r,n,s),e.ref!==t.ref&&(t.flags|=128);else{if(!n){if(null===t.stateNode)throw Error(o(166));return null}if(e=os(ns.current),_s(t)){n=t.stateNode,r=t.type;var a=t.memoizedProps;switch(n[Nn]=t,n[Fn]=a,r){case"dialog":G("cancel",n),G("close",n);break;case"iframe":case"object":case"embed":G("load",n);break;case"video":case"audio":for(e=0;e<dn.length;e++)G(dn[e],n);break;case"source":G("error",n);break;case"img":case"image":case"link":G("error",n),G("load",n);break;case"details":G("toggle",n);break;case"input":Za(n,a),G("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!a.multiple},G("invalid",n);break;case"textarea":ye(n,a),G("invalid",n)}for(var c in Ge(r,a),e=null,a)a.hasOwnProperty(c)&&(s=a[c],"children"===c?"string"==typeof s?n.textContent!==s&&(e=["children",s]):"number"==typeof s&&n.textContent!==""+s&&(e=["children",""+s]):l.hasOwnProperty(c)&&null!=s&&"onScroll"===c&&G("scroll",n));switch(r){case"input":Va(n),he(n,a,!0);break;case"textarea":Va(n),ve(n);break;case"select":case"option":break;default:"function"==typeof a.onClick&&(n.onclick=Sn)}n=e,t.updateQueue=n,null!==n&&(t.flags|=4)}else{switch(c=9===s.nodeType?s:s.ownerDocument,e===_e.html&&(e=xe(r)),e===_e.html?"script"===r?((e=c.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof n.is?e=c.createElement(r,{is:n.is}):(e=c.createElement(r),"select"===r&&(c=e,n.multiple?c.multiple=!0:n.size&&(c.size=n.size))):e=c.createElementNS(e,r),e[Nn]=t,e[Fn]=n,Qs(e,t,!1,!1),t.stateNode=e,c=We(r,n),r){case"dialog":G("cancel",e),G("close",e),s=n;break;case"iframe":case"object":case"embed":G("load",e),s=n;break;case"video":case"audio":for(s=0;s<dn.length;s++)G(dn[s],e);s=n;break;case"source":G("error",e),s=n;break;case"img":case"image":case"link":G("error",e),G("load",e),s=n;break;case"details":G("toggle",e),s=n;break;case"input":Za(e,n),s=Ya(e,n),G("invalid",e);break;case"option":s=me(e,n);break;case"select":e._wrapperState={wasMultiple:!!n.multiple},s=i({},n,{value:void 0}),G("invalid",e);break;case"textarea":ye(e,n),s=ge(e,n),G("invalid",e);break;default:s=n}Ge(r,s);var u=s;for(a in u)if(u.hasOwnProperty(a)){var d=u[a];"style"===a?He(e,d):"dangerouslySetInnerHTML"===a?null!=(d=d?d.__html:void 0)&&Te(e,d):"children"===a?"string"==typeof d?("textarea"!==r||""!==d)&&Re(e,d):"number"==typeof d&&Re(e,""+d):"suppressContentEditableWarning"!==a&&"suppressHydrationWarning"!==a&&"autoFocus"!==a&&(l.hasOwnProperty(a)?null!=d&&"onScroll"===a&&G("scroll",e):null!=d&&v(e,a,d,c))}switch(r){case"input":Va(e),he(e,n,!1);break;case"textarea":Va(e),ve(e);break;case"option":null!=n.value&&e.setAttribute("value",""+Sa(n.value));break;case"select":e.multiple=!!n.multiple,null!=(a=n.value)?fe(e,!!n.multiple,a,!1):null!=n.defaultValue&&fe(e,!!n.multiple,n.defaultValue,!0);break;default:"function"==typeof s.onClick&&(e.onclick=Sn)}Mn(r,n)&&(t.flags|=4)}null!==t.ref&&(t.flags|=128)}return null;case 6:if(e&&null!=t.stateNode)ro(e,t,e.memoizedProps,n);else{if("string"!=typeof n&&null===t.stateNode)throw Error(o(166));r=os(ss.current),os(ns.current),_s(t)?(n=t.stateNode,r=t.memoizedProps,n[Nn]=t,n.nodeValue!==r&&(t.flags|=4)):((n=(9===r.nodeType?r:r.ownerDocument).createTextNode(n))[Nn]=t,t.stateNode=n)}return null;case 13:return H(ds),n=t.memoizedState,0!=(64&t.flags)?(t.lanes=r,t):(n=null!==n,r=!1,null===e?void 0!==t.memoizedProps.fallback&&_s(t):r=null!==e.memoizedState,n&&!r&&0!=(2&t.mode)&&(null===e&&!0!==t.memoizedProps.unstable_avoidThisFallback||0!=(1&ds.current)?0===ko&&(ko=3):(0!==ko&&3!==ko||(ko=4),null===To||0==(134217727&Io)&&0==(134217727&Bo)||Ii(To,Oo))),(n||r)&&(t.flags|=4),null);case 4:return ls(),eo(t),null===e&&fn(t.stateNode.containerInfo),null;case 10:return Ri(t),null;case 19:if(H(ds),null===(n=t.memoizedState))return null;if(a=0!=(64&t.flags),null===(c=n.rendering))if(a)Fi(n,!1);else{if(0!==ko||null!==e&&0!=(64&e.flags))for(e=t.child;null!==e;){if(null!==(c=hs(e))){for(t.flags|=64,Fi(n,!1),null!==(a=c.updateQueue)&&(t.updateQueue=a,t.flags|=4),null===n.lastEffect&&(t.firstEffect=null),t.lastEffect=n.lastEffect,n=r,r=t.child;null!==r;)e=n,(a=r).flags&=2,a.nextEffect=null,a.firstEffect=null,a.lastEffect=null,null===(c=a.alternate)?(a.childLanes=0,a.lanes=e,a.child=null,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=c.childLanes,a.lanes=c.lanes,a.child=c.child,a.memoizedProps=c.memoizedProps,a.memoizedState=c.memoizedState,a.updateQueue=c.updateQueue,a.type=c.type,e=c.dependencies,a.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return I(ds,1&ds.current|2),t.child}e=e.sibling}null!==n.tail&&mi()>zo&&(t.flags|=64,a=!0,Fi(n,!1),t.lanes=33554432)}else{if(!a)if(null!==(e=hs(c))){if(t.flags|=64,a=!0,null!==(r=e.updateQueue)&&(t.updateQueue=r,t.flags|=4),Fi(n,!0),null===n.tail&&"hidden"===n.tailMode&&!c.alternate&&!fs)return null!==(t=t.lastEffect=n.lastEffect)&&(t.nextEffect=null),null}else 2*mi()-n.renderingStartTime>zo&&1073741824!==r&&(t.flags|=64,a=!0,Fi(n,!1),t.lanes=33554432);n.isBackwards?(c.sibling=t.child,t.child=c):(null!==(r=n.last)?r.sibling=c:t.child=c,n.last=c)}return null!==n.tail?(r=n.tail,n.rendering=r,n.tail=r.sibling,n.lastEffect=t.lastEffect,n.renderingStartTime=mi(),r.sibling=null,t=ds.current,I(ds,a?1&t|2:1&t),r):null;case 23:case 24:return Ki(),null!==e&&null!==e.memoizedState!=(null!==t.memoizedState)&&"unstable-defer-without-hiding"!==n.mode&&(t.flags|=4),null}throw Error(o(156,t.tag))}function Li(e){switch(e.tag){case 1:Ff(e.type)&&Gf();var t=e.flags;return 4096&t?(e.flags=-4097&t|64,e):null;case 3:if(ls(),H(qn),H(Vn),Ss(),0!=(64&(t=e.flags)))throw Error(o(285));return e.flags=-4097&t|64,e;case 5:return us(e),null;case 13:return H(ds),4096&(t=e.flags)?(e.flags=-4097&t|64,e):null;case 19:return H(ds),null;case 4:return ls(),null;case 10:return Ri(e),null;case 23:case 24:return Ki(),null;default:return null}}function Mi(e,t){try{var r="",n=t;do{r+=Qa(n),n=n.return}while(n);var i=r}catch(e){i="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:t,stack:i}}function Ni(e,t){try{console.error(t.value)}catch(e){setTimeout((function(){throw e}))}}Qs=function(e,t){for(var r=t.child;null!==r;){if(5===r.tag||6===r.tag)e.appendChild(r.stateNode);else if(4!==r.tag&&null!==r.child){r.child.return=r,r=r.child;continue}if(r===t)break;for(;null===r.sibling;){if(null===r.return||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}},eo=function(){},to=function(e,t,r,n){var s=e.memoizedProps;if(s!==n){e=t.stateNode,os(ns.current);var o,a=null;switch(r){case"input":s=Ya(e,s),n=Ya(e,n),a=[];break;case"option":s=me(e,s),n=me(e,n),a=[];break;case"select":s=i({},s,{value:void 0}),n=i({},n,{value:void 0}),a=[];break;case"textarea":s=ge(e,s),n=ge(e,n),a=[];break;default:"function"!=typeof s.onClick&&"function"==typeof n.onClick&&(e.onclick=Sn)}for(d in Ge(r,n),r=null,s)if(!n.hasOwnProperty(d)&&s.hasOwnProperty(d)&&null!=s[d])if("style"===d){var c=s[d];for(o in c)c.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else"dangerouslySetInnerHTML"!==d&&"children"!==d&&"suppressContentEditableWarning"!==d&&"suppressHydrationWarning"!==d&&"autoFocus"!==d&&(l.hasOwnProperty(d)?a||(a=[]):(a=a||[]).push(d,null));for(d in n){var u=n[d];if(c=null!=s?s[d]:void 0,n.hasOwnProperty(d)&&u!==c&&(null!=u||null!=c))if("style"===d)if(c){for(o in c)!c.hasOwnProperty(o)||u&&u.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in u)u.hasOwnProperty(o)&&c[o]!==u[o]&&(r||(r={}),r[o]=u[o])}else r||(a||(a=[]),a.push(d,r)),r=u;else"dangerouslySetInnerHTML"===d?(u=u?u.__html:void 0,c=c?c.__html:void 0,null!=u&&c!==u&&(a=a||[]).push(d,u)):"children"===d?"string"!=typeof u&&"number"!=typeof u||(a=a||[]).push(d,""+u):"suppressContentEditableWarning"!==d&&"suppressHydrationWarning"!==d&&(l.hasOwnProperty(d)?(null!=u&&"onScroll"===d&&G("scroll",e),a||c===u||(a=[])):"object"==typeof u&&null!==u&&u.$$typeof===re?u.toString():(a=a||[]).push(d,u))}r&&(a=a||[]).push("style",r);var d=a;(t.updateQueue=d)&&(t.flags|=4)}},ro=function(e,t,r,n){r!==n&&(t.flags|=4)};var ho="function"==typeof WeakMap?WeakMap:Map;function Pi(e,t,r){(r=qi(-1,r)).tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){qo||(qo=!0,$o=n),Ni(0,t)},r}function Si(e,t,r){(r=qi(-1,r)).tag=3;var n=e.type.getDerivedStateFromError;if("function"==typeof n){var i=t.value;r.payload=function(){return Ni(0,t),n(i)}}var s=e.stateNode;return null!==s&&"function"==typeof s.componentDidCatch&&(r.callback=function(){"function"!=typeof n&&(null===Zo?Zo=new Set([this]):Zo.add(this),Ni(0,t));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),r}var po="function"==typeof WeakSet?WeakSet:Set;function Vi(e){var t=e.ref;if(null!==t)if("function"==typeof t)try{t(null)}catch(t){Wi(e,t)}else t.current=null}function Xi(e,t){switch(t.tag){case 0:case 11:case 15:case 22:case 5:case 6:case 4:case 17:return;case 1:if(256&t.flags&&null!==e){var r=e.memoizedProps,n=e.memoizedState;t=(e=t.stateNode).getSnapshotBeforeUpdate(t.elementType===t.type?r:wi(t.type,r),n),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:return void(256&t.flags&&Dn(t.stateNode.containerInfo))}throw Error(o(163))}function Yi(e,t,r){switch(r.tag){case 0:case 11:case 15:case 22:if(null!==(t=null!==(t=r.updateQueue)?t.lastEffect:null)){e=t=t.next;do{if(3==(3&e.tag)){var n=e.create;e.destroy=n()}e=e.next}while(e!==t)}if(null!==(t=null!==(t=r.updateQueue)?t.lastEffect:null)){e=t=t.next;do{var i=e;n=i.next,0!=(4&(i=i.tag))&&0!=(1&i)&&(Zi(r,e),pa(r,e)),e=n}while(e!==t)}return;case 1:return e=r.stateNode,4&r.flags&&(null===t?e.componentDidMount():(n=r.elementType===r.type?t.memoizedProps:wi(r.type,t.memoizedProps),e.componentDidUpdate(n,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate))),void(null!==(t=r.updateQueue)&&Eg(r,t,e));case 3:if(null!==(t=r.updateQueue)){if(e=null,null!==r.child)switch(r.child.tag){case 5:case 1:e=r.child.stateNode}Eg(r,t,e)}return;case 5:return e=r.stateNode,void(null===t&&4&r.flags&&Mn(r.type,r.memoizedProps)&&e.focus());case 6:case 4:case 12:case 19:case 17:case 20:case 21:case 23:case 24:return;case 13:return void(null===r.memoizedState&&(r=r.alternate,null!==r&&(r=r.memoizedState,null!==r&&(r=r.dehydrated,null!==r&&Cc(r)))))}throw Error(o(163))}function mo(e,t){for(var r=e;;){if(5===r.tag){var n=r.stateNode;if(t)"function"==typeof(n=n.style).setProperty?n.setProperty("display","none","important"):n.display="none";else{n=r.stateNode;var i=r.memoizedProps.style;i=null!=i&&i.hasOwnProperty("display")?i.display:null,n.style.display=je("display",i)}}else if(6===r.tag)r.stateNode.nodeValue=t?"":r.memoizedProps;else if((23!==r.tag&&24!==r.tag||null===r.memoizedState||r===e)&&null!==r.child){r.child.return=r,r=r.child;continue}if(r===e)break;for(;null===r.sibling;){if(null===r.return||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}}function fo(e,t){if(Kn&&"function"==typeof Kn.onCommitFiberUnmount)try{Kn.onCommitFiberUnmount(Zn,t)}catch(e){}switch(t.tag){case 0:case 11:case 14:case 15:case 22:if(null!==(e=t.updateQueue)&&null!==(e=e.lastEffect)){var r=e=e.next;do{var n=r,i=n.destroy;if(n=n.tag,void 0!==i)if(0!=(4&n))Zi(t,r);else{n=t;try{i()}catch(e){Wi(n,e)}}r=r.next}while(r!==e)}break;case 1:if(Vi(t),"function"==typeof(e=t.stateNode).componentWillUnmount)try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(e){Wi(t,e)}break;case 5:Vi(t);break;case 4:xo(e,t)}}function go(e){e.alternate=null,e.child=null,e.dependencies=null,e.firstEffect=null,e.lastEffect=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.return=null,e.updateQueue=null}function yo(e){return 5===e.tag||3===e.tag||4===e.tag}function bo(e){e:{for(var t=e.return;null!==t;){if(yo(t))break e;t=t.return}throw Error(o(160))}var r=t;switch(t=r.stateNode,r.tag){case 5:var n=!1;break;case 3:case 4:t=t.containerInfo,n=!0;break;default:throw Error(o(161))}16&r.flags&&(Re(t,""),r.flags&=-17);e:t:for(r=e;;){for(;null===r.sibling;){if(null===r.return||yo(r.return)){r=null;break e}r=r.return}for(r.sibling.return=r.return,r=r.sibling;5!==r.tag&&6!==r.tag&&18!==r.tag;){if(2&r.flags)continue t;if(null===r.child||4===r.tag)continue t;r.child.return=r,r=r.child}if(!(2&r.flags)){r=r.stateNode;break e}}n?vo(e,r,t):_o(e,r,t)}function vo(e,t,r){var n=e.tag,i=5===n||6===n;if(i)e=i?e.stateNode:e.stateNode.instance,t?8===r.nodeType?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(8===r.nodeType?(t=r.parentNode).insertBefore(e,r):(t=r).appendChild(e),null!=(r=r._reactRootContainer)||null!==t.onclick||(t.onclick=Sn));else if(4!==n&&null!==(e=e.child))for(vo(e,t,r),e=e.sibling;null!==e;)vo(e,t,r),e=e.sibling}function _o(e,t,r){var n=e.tag,i=5===n||6===n;if(i)e=i?e.stateNode:e.stateNode.instance,t?r.insertBefore(e,t):r.appendChild(e);else if(4!==n&&null!==(e=e.child))for(_o(e,t,r),e=e.sibling;null!==e;)_o(e,t,r),e=e.sibling}function xo(e,t){for(var r,n,i=t,s=!1;;){if(!s){s=i.return;e:for(;;){if(null===s)throw Error(o(160));switch(r=s.stateNode,s.tag){case 5:n=!1;break e;case 3:case 4:r=r.containerInfo,n=!0;break e}s=s.return}s=!0}if(5===i.tag||6===i.tag){e:for(var a=e,l=i,c=l;;)if(fo(a,c),null!==c.child&&4!==c.tag)c.child.return=c,c=c.child;else{if(c===l)break e;for(;null===c.sibling;){if(null===c.return||c.return===l)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}n?(a=r,l=i.stateNode,8===a.nodeType?a.parentNode.removeChild(l):a.removeChild(l)):r.removeChild(i.stateNode)}else if(4===i.tag){if(null!==i.child){r=i.stateNode.containerInfo,n=!0,i.child.return=i,i=i.child;continue}}else if(fo(e,i),null!==i.child){i.child.return=i,i=i.child;continue}if(i===t)break;for(;null===i.sibling;){if(null===i.return||i.return===t)return;4===(i=i.return).tag&&(s=!1)}i.sibling.return=i.return,i=i.sibling}}function wo(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var n=r=r.next;do{3==(3&n.tag)&&(e=n.destroy,n.destroy=void 0,void 0!==e&&e()),n=n.next}while(n!==r)}return;case 1:case 12:case 17:return;case 5:if(null!=(r=t.stateNode)){n=t.memoizedProps;var i=null!==e?e.memoizedProps:n;e=t.type;var s=t.updateQueue;if(t.updateQueue=null,null!==s){for(r[Fn]=n,"input"===e&&"radio"===n.type&&null!=n.name&&ue(r,n),We(e,i),t=We(e,n),i=0;i<s.length;i+=2){var a=s[i],l=s[i+1];"style"===a?He(r,l):"dangerouslySetInnerHTML"===a?Te(r,l):"children"===a?Re(r,l):v(r,a,l,t)}switch(e){case"input":de(r,n);break;case"textarea":be(r,n);break;case"select":e=r._wrapperState.wasMultiple,r._wrapperState.wasMultiple=!!n.multiple,null!=(s=n.value)?fe(r,!!n.multiple,s,!1):e!==!!n.multiple&&(null!=n.defaultValue?fe(r,!!n.multiple,n.defaultValue,!0):fe(r,!!n.multiple,n.multiple?[]:"",!1))}}}return;case 6:if(null===t.stateNode)throw Error(o(162));return void(t.stateNode.nodeValue=t.memoizedProps);case 3:return void((r=t.stateNode).hydrate&&(r.hydrate=!1,Cc(r.containerInfo)));case 13:return null!==t.memoizedState&&(Uo=mi(),mo(t.child,!0)),void So(t);case 19:return void So(t);case 23:case 24:return void mo(t,null!==t.memoizedState)}throw Error(o(163))}function So(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var r=e.stateNode;null===r&&(r=e.stateNode=new po),t.forEach((function(t){var n=ga.bind(null,e,t);r.has(t)||(r.add(t),t.then(n,n))}))}}function Po(e,t){return null!==e&&(null===(e=e.memoizedState)||null!==e.dehydrated)&&(null!==(t=t.memoizedState)&&null===t.dehydrated)}var Eo=Math.ceil,Mo=_.ReactCurrentDispatcher,Co=_.ReactCurrentOwner,Ao=0,To=null,Do=null,Oo=0,Ro=0,Lo=Bf(0),ko=0,No=null,Fo=0,Io=0,Bo=0,jo=0,Ho=null,Uo=0,zo=1/0;function Go(){zo=mi()+500}var Wo,Vo=null,qo=!1,$o=null,Zo=null,Ko=!1,Xo=null,Yo=90,Jo=[],Qo=[],ea=null,ta=0,ra=null,na=-1,ia=0,sa=0,oa=null,aa=!1;function Hg(){return 0!=(48&Ao)?mi():-1!==na?na:na=mi()}function Ig(e){if(0==(2&(e=e.mode)))return 1;if(0==(4&e))return 99===fi()?1:2;if(0===ia&&(ia=Fo),0!==xi.transition){0!==sa&&(sa=null!==Ho?Ho.pendingLanes:0),e=ia;var t=4186112&~sa;return 0===(t&=-t)&&(0===(t=(e=4186112&~e)&-e)&&(t=8192)),t}return e=fi(),0!=(4&Ao)&&98===e?e=Xc(12,ia):e=Xc(e=function(e){switch(e){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}(e),ia),e}function Jg(e,t,r){if(50<ta)throw ta=0,ra=null,Error(o(185));if(null===(e=Kj(e,t)))return null;zt(e,t,r),e===To&&(Bo|=t,4===ko&&Ii(e,Oo));var n=fi();1===t?0!=(8&Ao)&&0==(48&Ao)?Lj(e):(Mj(e,r),0===Ao&&(Go(),vi())):(0==(4&Ao)||98!==n&&99!==n||(null===ea?ea=new Set([e]):ea.add(e)),Mj(e,r)),Ho=e}function Kj(e,t){e.lanes|=t;var r=e.alternate;for(null!==r&&(r.lanes|=t),r=e,e=e.return;null!==e;)e.childLanes|=t,null!==(r=e.alternate)&&(r.childLanes|=t),r=e,e=e.return;return 3===r.tag?r.stateNode:null}function Mj(e,t){for(var r=e.callbackNode,n=e.suspendedLanes,i=e.pingedLanes,s=e.expirationTimes,a=e.pendingLanes;0<a;){var l=31-Gt(a),c=1<<l,u=s[l];if(-1===u){if(0==(c&n)||0!=(c&i)){u=t,Rc(c);var d=Ut;s[l]=10<=d?u+250:6<=d?u+5e3:-1}}else u<=t&&(e.expiredLanes|=c);a&=~c}if(n=Uc(e,e===To?Oo:0),t=Ut,0===n)null!==r&&(r!==li&&Jn(r),e.callbackNode=null,e.callbackPriority=0);else{if(null!==r){if(e.callbackPriority===t)return;r!==li&&Jn(r)}15===t?(r=Lj.bind(null,e),null===ui?(ui=[r],di=Yn(ni,_i)):ui.push(r),r=li):14===t?r=bi(99,Lj.bind(null,e)):(r=function(e){switch(e){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(o(358,e))}}(t),r=bi(r,Nj.bind(null,e))),e.callbackPriority=t,e.callbackNode=r}}function Nj(e){if(na=-1,sa=ia=0,0!=(48&Ao))throw Error(o(327));var t=e.callbackNode;if(Oj()&&e.callbackNode!==t)return null;var r=Uc(e,e===To?Oo:0);if(0===r)return null;var n=r,i=Ao;Ao|=16;var s=Pj();for(To===e&&Oo===n||(Go(),Qj(e,n));;)try{Rj();break}catch(t){Sj(e,t)}if(Oi(),Mo.current=s,Ao=i,null!==Do?n=0:(To=null,Oo=0,n=ko),0!=(Fo&Bo))Qj(e,0);else if(0!==n){if(2===n&&(Ao|=64,e.hydrate&&(e.hydrate=!1,Dn(e.containerInfo)),0!==(r=Wc(e))&&(n=Tj(e,r))),1===n)throw t=No,Qj(e,0),Ii(e,r),Mj(e,mi()),t;switch(e.finishedWork=e.current.alternate,e.finishedLanes=r,n){case 0:case 1:throw Error(o(345));case 2:case 5:Uj(e);break;case 3:if(Ii(e,r),(62914560&r)===r&&10<(n=Uo+500-mi())){if(0!==Uc(e,0))break;if(((i=e.suspendedLanes)&r)!==r){Hg(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=An(Uj.bind(null,e),n);break}Uj(e);break;case 4:if(Ii(e,r),(4186112&r)===r)break;for(n=e.eventTimes,i=-1;0<r;){var a=31-Gt(r);s=1<<a,(a=n[a])>i&&(i=a),r&=~s}if(r=i,10<(r=(120>(r=mi()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Eo(r/1960))-r)){e.timeoutHandle=An(Uj.bind(null,e),r);break}Uj(e);break;default:throw Error(o(329))}}return Mj(e,mi()),e.callbackNode===t?Nj.bind(null,e):null}function Ii(e,t){for(t&=~jo,t&=~Bo,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Gt(t),n=1<<r;e[r]=-1,t&=~n}}function Lj(e){if(0!=(48&Ao))throw Error(o(327));if(Oj(),e===To&&0!=(e.expiredLanes&Oo)){var t=Oo,r=Tj(e,t);0!=(Fo&Bo)&&(r=Tj(e,t=Uc(e,t)))}else r=Tj(e,t=Uc(e,0));if(0!==e.tag&&2===r&&(Ao|=64,e.hydrate&&(e.hydrate=!1,Dn(e.containerInfo)),0!==(t=Wc(e))&&(r=Tj(e,t))),1===r)throw r=No,Qj(e,0),Ii(e,t),Mj(e,mi()),r;return e.finishedWork=e.current.alternate,e.finishedLanes=t,Uj(e),Mj(e,mi()),null}function Wj(e,t){var r=Ao;Ao|=1;try{return e(t)}finally{0===(Ao=r)&&(Go(),vi())}}function Xj(e,t){var r=Ao;Ao&=-2,Ao|=8;try{return e(t)}finally{0===(Ao=r)&&(Go(),vi())}}function la(e,t){I(Lo,Ro),Ro|=t,Fo|=t}function Ki(){Ro=Lo.current,H(Lo)}function Qj(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(-1!==r&&(e.timeoutHandle=-1,Tn(r)),null!==Do)for(r=Do.return;null!==r;){var n=r;switch(n.tag){case 1:null!=(n=n.type.childContextTypes)&&Gf();break;case 3:ls(),H(qn),H(Vn),Ss();break;case 5:us(n);break;case 4:ls();break;case 13:case 19:H(ds);break;case 10:Ri(n);break;case 23:case 24:Ki()}r=r.return}To=e,Do=Tg(e.current,null),Oo=Ro=Fo=t,ko=0,No=null,jo=Bo=Io=0}function Sj(e,t){for(;;){var r=Do;try{if(Oi(),Ps.current=Is,Ds){for(var n=Cs.memoizedState;null!==n;){var i=n.queue;null!==i&&(i.pending=null),n=n.next}Ds=!1}if(Ms=0,Ts=As=Cs=null,Os=!1,Co.current=null,null===r||null===r.return){ko=1,No=t,Do=null;break}e:{var s=e,o=r.return,a=r,l=t;if(t=Oo,a.flags|=2048,a.firstEffect=a.lastEffect=null,null!==l&&"object"==typeof l&&"function"==typeof l.then){var c=l;if(0==(2&a.mode)){var u=a.alternate;u?(a.updateQueue=u.updateQueue,a.memoizedState=u.memoizedState,a.lanes=u.lanes):(a.updateQueue=null,a.memoizedState=null)}var d=0!=(1&ds.current),h=o;do{var p;if(p=13===h.tag){var m=h.memoizedState;if(null!==m)p=null!==m.dehydrated;else{var f=h.memoizedProps;p=void 0!==f.fallback&&(!0!==f.unstable_avoidThisFallback||!d)}}if(p){var g=h.updateQueue;if(null===g){var y=new Set;y.add(c),h.updateQueue=y}else g.add(c);if(0==(2&h.mode)){if(h.flags|=64,a.flags|=16384,a.flags&=-2981,1===a.tag)if(null===a.alternate)a.tag=17;else{var b=qi(-1,1);b.tag=2,Ag(a,b)}a.lanes|=1;break e}l=void 0,a=t;var v=s.pingCache;if(null===v?(v=s.pingCache=new ho,l=new Set,v.set(c,l)):void 0===(l=v.get(c))&&(l=new Set,v.set(c,l)),!l.has(a)){l.add(a);var _=Yj.bind(null,s,c,a);c.then(_,_)}h.flags|=4096,h.lanes=t;break e}h=h.return}while(null!==h);l=Error((Ra(a.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.")}5!==ko&&(ko=2),l=Mi(l,a),h=o;do{switch(h.tag){case 3:s=l,h.flags|=4096,t&=-t,h.lanes|=t,Bg(h,Pi(0,s,t));break e;case 1:s=l;var x=h.type,w=h.stateNode;if(0==(64&h.flags)&&("function"==typeof x.getDerivedStateFromError||null!==w&&"function"==typeof w.componentDidCatch&&(null===Zo||!Zo.has(w)))){h.flags|=4096,t&=-t,h.lanes|=t,Bg(h,Si(h,s,t));break e}}h=h.return}while(null!==h)}Zj(r)}catch(e){t=e,Do===r&&null!==r&&(Do=r=r.return);continue}break}}function Pj(){var e=Mo.current;return Mo.current=Is,null===e?Is:e}function Tj(e,t){var r=Ao;Ao|=16;var n=Pj();for(To===e&&Oo===t||Qj(e,t);;)try{ca();break}catch(t){Sj(e,t)}if(Oi(),Ao=r,Mo.current=n,null!==Do)throw Error(o(261));return To=null,Oo=0,ko}function ca(){for(;null!==Do;)ua(Do)}function Rj(){for(;null!==Do&&!Qn();)ua(Do)}function ua(e){var t=Wo(e.alternate,e,Ro);e.memoizedProps=e.pendingProps,null===t?Zj(e):Do=t,Co.current=null}function Zj(e){var t=e;do{var r=t.alternate;if(e=t.return,0==(2048&t.flags)){if(null!==(r=Gi(r,t,Ro)))return void(Do=r);if(24!==(r=t).tag&&23!==r.tag||null===r.memoizedState||0!=(1073741824&Ro)||0==(4&r.mode)){for(var n=0,i=r.child;null!==i;)n|=i.lanes|i.childLanes,i=i.sibling;r.childLanes=n}null!==e&&0==(2048&e.flags)&&(null===e.firstEffect&&(e.firstEffect=t.firstEffect),null!==t.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=t.firstEffect),e.lastEffect=t.lastEffect),1<t.flags&&(null!==e.lastEffect?e.lastEffect.nextEffect=t:e.firstEffect=t,e.lastEffect=t))}else{if(null!==(r=Li(t)))return r.flags&=2047,void(Do=r);null!==e&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}if(null!==(t=t.sibling))return void(Do=t);Do=t=e}while(null!==t);0===ko&&(ko=5)}function Uj(e){var t=fi();return yi(99,da.bind(null,e,t)),null}function da(e,t){do{Oj()}while(null!==Xo);if(0!=(48&Ao))throw Error(o(327));var r=e.finishedWork;if(null===r)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(o(177));e.callbackNode=null;var n=r.lanes|r.childLanes,i=n,s=e.pendingLanes&~i;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=i,e.mutableReadLanes&=i,e.entangledLanes&=i,i=e.entanglements;for(var a=e.eventTimes,l=e.expirationTimes;0<s;){var c=31-Gt(s),u=1<<c;i[c]=0,a[c]=-1,l[c]=-1,s&=~u}if(null!==ea&&0==(24&n)&&ea.has(e)&&ea.delete(e),e===To&&(Do=To=null,Oo=0),1<r.flags?null!==r.lastEffect?(r.lastEffect.nextEffect=r,n=r.firstEffect):n=r:n=r.firstEffect,null!==n){if(i=Ao,Ao|=32,Co.current=null,Pn=Zt,Oe(a=Ne())){if("selectionStart"in a)l={start:a.selectionStart,end:a.selectionEnd};else e:if(l=(l=a.ownerDocument)&&l.defaultView||window,(u=l.getSelection&&l.getSelection())&&0!==u.rangeCount){l=u.anchorNode,s=u.anchorOffset,c=u.focusNode,u=u.focusOffset;try{l.nodeType,c.nodeType}catch(e){l=null;break e}var d=0,h=-1,p=-1,m=0,f=0,g=a,y=null;t:for(;;){for(var b;g!==l||0!==s&&3!==g.nodeType||(h=d+s),g!==c||0!==u&&3!==g.nodeType||(p=d+u),3===g.nodeType&&(d+=g.nodeValue.length),null!==(b=g.firstChild);)y=g,g=b;for(;;){if(g===a)break t;if(y===l&&++m===s&&(h=d),y===c&&++f===u&&(p=d),null!==(b=g.nextSibling))break;y=(g=y).parentNode}g=b}l=-1===h||-1===p?null:{start:h,end:p}}else l=null;l=l||{start:0,end:0}}else l=null;En={focusedElem:a,selectionRange:l},Zt=!1,oa=null,aa=!1,Vo=n;do{try{ha()}catch(e){if(null===Vo)throw Error(o(330));Wi(Vo,e),Vo=Vo.nextEffect}}while(null!==Vo);oa=null,Vo=n;do{try{for(a=e;null!==Vo;){var v=Vo.flags;if(16&v&&Re(Vo.stateNode,""),128&v){var _=Vo.alternate;if(null!==_){var x=_.ref;null!==x&&("function"==typeof x?x(null):x.current=null)}}switch(1038&v){case 2:bo(Vo),Vo.flags&=-3;break;case 6:bo(Vo),Vo.flags&=-3,wo(Vo.alternate,Vo);break;case 1024:Vo.flags&=-1025;break;case 1028:Vo.flags&=-1025,wo(Vo.alternate,Vo);break;case 4:wo(Vo.alternate,Vo);break;case 8:xo(a,l=Vo);var w=l.alternate;go(l),null!==w&&go(w)}Vo=Vo.nextEffect}}catch(e){if(null===Vo)throw Error(o(330));Wi(Vo,e),Vo=Vo.nextEffect}}while(null!==Vo);if(x=En,_=Ne(),v=x.focusedElem,a=x.selectionRange,_!==v&&v&&v.ownerDocument&&Me(v.ownerDocument.documentElement,v)){null!==a&&Oe(v)&&(_=a.start,void 0===(x=a.end)&&(x=_),"selectionStart"in v?(v.selectionStart=_,v.selectionEnd=Math.min(x,v.value.length)):(x=(_=v.ownerDocument||document)&&_.defaultView||window).getSelection&&(x=x.getSelection(),l=v.textContent.length,w=Math.min(a.start,l),a=void 0===a.end?w:Math.min(a.end,l),!x.extend&&w>a&&(l=a,a=w,w=l),l=Le(v,w),s=Le(v,a),l&&s&&(1!==x.rangeCount||x.anchorNode!==l.node||x.anchorOffset!==l.offset||x.focusNode!==s.node||x.focusOffset!==s.offset)&&((_=_.createRange()).setStart(l.node,l.offset),x.removeAllRanges(),w>a?(x.addRange(_),x.extend(s.node,s.offset)):(_.setEnd(s.node,s.offset),x.addRange(_))))),_=[];for(x=v;x=x.parentNode;)1===x.nodeType&&_.push({element:x,left:x.scrollLeft,top:x.scrollTop});for("function"==typeof v.focus&&v.focus(),v=0;v<_.length;v++)(x=_[v]).element.scrollLeft=x.left,x.element.scrollTop=x.top}Zt=!!Pn,En=Pn=null,e.current=r,Vo=n;do{try{for(v=e;null!==Vo;){var R=Vo.flags;if(36&R&&Yi(v,Vo.alternate,Vo),128&R){_=void 0;var k=Vo.ref;if(null!==k){var j=Vo.stateNode;Vo.tag,_=j,"function"==typeof k?k(_):k.current=_}}Vo=Vo.nextEffect}}catch(e){if(null===Vo)throw Error(o(330));Wi(Vo,e),Vo=Vo.nextEffect}}while(null!==Vo);Vo=null,ci(),Ao=i}else e.current=r;if(Ko)Ko=!1,Xo=e,Yo=t;else for(Vo=n;null!==Vo;)t=Vo.nextEffect,Vo.nextEffect=null,8&Vo.flags&&((R=Vo).sibling=null,R.stateNode=null),Vo=t;if(0===(n=e.pendingLanes)&&(Zo=null),1===n?e===ra?ta++:(ta=0,ra=e):ta=0,r=r.stateNode,Kn&&"function"==typeof Kn.onCommitFiberRoot)try{Kn.onCommitFiberRoot(Zn,r,void 0,64==(64&r.current.flags))}catch(e){}if(Mj(e,mi()),qo)throw qo=!1,e=$o,$o=null,e;return 0!=(8&Ao)||vi(),null}function ha(){for(;null!==Vo;){var e=Vo.alternate;aa||null===oa||(0!=(8&Vo.flags)?dt(Vo,oa)&&(aa=!0):13===Vo.tag&&Po(e,Vo)&&dt(Vo,oa)&&(aa=!0));var t=Vo.flags;0!=(256&t)&&Xi(e,Vo),0==(512&t)||Ko||(Ko=!0,bi(97,(function(){return Oj(),null}))),Vo=Vo.nextEffect}}function Oj(){if(90!==Yo){var e=97<Yo?97:Yo;return Yo=90,yi(e,ma)}return!1}function pa(e,t){Jo.push(t,e),Ko||(Ko=!0,bi(97,(function(){return Oj(),null})))}function Zi(e,t){Qo.push(t,e),Ko||(Ko=!0,bi(97,(function(){return Oj(),null})))}function ma(){if(null===Xo)return!1;var e=Xo;if(Xo=null,0!=(48&Ao))throw Error(o(331));var t=Ao;Ao|=32;var r=Qo;Qo=[];for(var n=0;n<r.length;n+=2){var i=r[n],s=r[n+1],a=i.destroy;if(i.destroy=void 0,"function"==typeof a)try{a()}catch(e){if(null===s)throw Error(o(330));Wi(s,e)}}for(r=Jo,Jo=[],n=0;n<r.length;n+=2){i=r[n],s=r[n+1];try{var l=i.create;i.destroy=l()}catch(e){if(null===s)throw Error(o(330));Wi(s,e)}}for(l=e.current.firstEffect;null!==l;)e=l.nextEffect,l.nextEffect=null,8&l.flags&&(l.sibling=null,l.stateNode=null),l=e;return Ao=t,vi(),!0}function fa(e,t,r){Ag(e,t=Pi(0,t=Mi(r,t),1)),t=Hg(),null!==(e=Kj(e,1))&&(zt(e,1,t),Mj(e,t))}function Wi(e,t){if(3===e.tag)fa(e,e,t);else for(var r=e.return;null!==r;){if(3===r.tag){fa(r,e,t);break}if(1===r.tag){var n=r.stateNode;if("function"==typeof r.type.getDerivedStateFromError||"function"==typeof n.componentDidCatch&&(null===Zo||!Zo.has(n))){var i=Si(r,e=Mi(t,e),1);if(Ag(r,i),i=Hg(),null!==(r=Kj(r,1)))zt(r,1,i),Mj(r,i);else if("function"==typeof n.componentDidCatch&&(null===Zo||!Zo.has(n)))try{n.componentDidCatch(t,e)}catch(e){}break}}r=r.return}}function Yj(e,t,r){var n=e.pingCache;null!==n&&n.delete(t),t=Hg(),e.pingedLanes|=e.suspendedLanes&r,To===e&&(Oo&r)===r&&(4===ko||3===ko&&(62914560&Oo)===Oo&&500>mi()-Uo?Qj(e,0):jo|=r),Mj(e,t)}function ga(e,t){var r=e.stateNode;null!==r&&r.delete(t),0===(t=0)&&(0==(2&(t=e.mode))?t=1:0==(4&t)?t=99===fi()?1:2:(0===ia&&(ia=Fo),0===(t=Yc(62914560&~ia))&&(t=4194304))),r=Hg(),null!==(e=Kj(e,t))&&(zt(e,t,r),Mj(e,r))}function ya(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function ba(e,t,r,n){return new ya(e,t,r,n)}function va(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Tg(e,t){var r=e.alternate;return null===r?((r=ba(e.tag,t,e.key,e.mode)).elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.nextEffect=null,r.firstEffect=null,r.lastEffect=null),r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Vg(e,t,r,n,i,s){var a=2;if(n=e,"function"==typeof e)va(e)&&(a=1);else if("string"==typeof e)a=5;else e:switch(e){case R:return Xg(r.children,i,s,t);case ne:a=8,i|=16;break;case k:a=8,i|=1;break;case j:return(e=ba(12,r,t,8|i)).elementType=j,e.type=j,e.lanes=s,e;case Z:return(e=ba(13,r,t,i)).type=Z,e.elementType=Z,e.lanes=s,e;case X:return(e=ba(19,r,t,i)).elementType=X,e.lanes=s,e;case ie:return _a(r,i,s,t);case se:return(e=ba(24,r,t,i)).elementType=se,e.lanes=s,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case z:a=10;break e;case q:a=9;break e;case $:a=11;break e;case Y:a=14;break e;case ee:a=16,n=null;break e;case te:a=22;break e}throw Error(o(130,null==e?e:typeof e,""))}return(t=ba(a,r,t,i)).elementType=e,t.type=n,t.lanes=s,t}function Xg(e,t,r,n){return(e=ba(7,e,n,t)).lanes=r,e}function _a(e,t,r,n){return(e=ba(23,e,n,t)).elementType=ie,e.lanes=r,e}function Ug(e,t,r){return(e=ba(6,e,null,t)).lanes=r,e}function Wg(e,t,r){return(t=ba(4,null!==e.children?e.children:[],e.key,t)).lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function xa(e,t,r){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=r,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=Zc(0),this.expirationTimes=Zc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Zc(0),this.mutableSourceEagerHydrationData=null}function wa(e,t,r,n){var i=t.current,s=Hg(),a=Ig(i);e:if(r){t:{if(Zb(r=r._reactInternals)!==r||1!==r.tag)throw Error(o(170));var l=r;do{switch(l.tag){case 3:l=l.stateNode.context;break t;case 1:if(Ff(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break t}}l=l.return}while(null!==l);throw Error(o(171))}if(1===r.tag){var c=r.type;if(Ff(c)){r=If(r,c,l);break e}}r=l}else r=Wn;return null===t.context?t.context=r:t.pendingContext=r,(t=qi(s,a)).payload={element:e},null!==(n=void 0===n?null:n)&&(t.callback=n),Ag(i,t),Jg(i,a,s),a}function Aa(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function Oa(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var r=e.retryLane;e.retryLane=0!==r&&r<t?r:t}}function ka(e,t){Oa(e,t),(e=e.alternate)&&Oa(e,t)}function ja(e,t,r){var n=null!=r&&null!=r.hydrationOptions&&r.hydrationOptions.mutableSources||null;if(r=new xa(e,t,null!=r&&!0===r.hydrate),t=ba(3,null,null,2===t?7:1===t?3:0),r.current=t,t.stateNode=r,Ui(t),e[In]=r.current,fn(8===e.nodeType?e.parentNode:e),n)for(e=0;e<n.length;e++){var i=(t=n[e])._getVersion;i=i(t._source),null==r.mutableSourceEagerHydrationData?r.mutableSourceEagerHydrationData=[t,i]:r.mutableSourceEagerHydrationData.push(t,i)}this._internalRoot=r}function Ua(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function za(e,t,r,n,i){var s=r._reactRootContainer;if(s){var o=s._internalRoot;if("function"==typeof i){var a=i;i=function(){var e=Aa(o);a.call(e)}}wa(t,o,e,i)}else{if(s=r._reactRootContainer=function(e,t){if(t||(t=!(!(t=e?9===e.nodeType?e.documentElement:e.firstChild:null)||1!==t.nodeType||!t.hasAttribute("data-reactroot"))),!t)for(var r;r=e.lastChild;)e.removeChild(r);return new ja(e,0,t?{hydrate:!0}:void 0)}(r,n),o=s._internalRoot,"function"==typeof i){var l=i;i=function(){var e=Aa(o);l.call(e)}}Xj((function(){wa(t,o,e,i)}))}return Aa(o)}function qa(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Ua(t))throw Error(o(200));return function(e,t,r){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:w,key:null==n?null:""+n,children:e,containerInfo:t,implementation:r}}(e,t,null,r)}Wo=function(e,t,r){var n=t.lanes;if(null!==e)if(e.memoizedProps!==t.pendingProps||qn.current)zs=!0;else{if(0==(r&n)){switch(zs=!1,t.tag){case 3:Js(t),xs();break;case 5:cs(t);break;case 1:Ff(t.type)&&Jf(t);break;case 4:as(t,t.stateNode.containerInfo);break;case 10:n=t.memoizedProps.value;var i=t.type._context;I(Ei,i._currentValue),i._currentValue=n;break;case 13:if(null!==t.memoizedState)return 0!=(r&t.child.childLanes)?io(e,t,r):(I(ds,1&ds.current),null!==(t=uo(e,t,r))?t.sibling:null);I(ds,1&ds.current);break;case 19:if(n=0!=(r&t.childLanes),0!=(64&e.flags)){if(n)return Ai(e,t,r);t.flags|=64}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),I(ds,ds.current),n)break;return null;case 23:case 24:return t.lanes=0,$s(e,t,r)}return uo(e,t,r)}zs=0!=(16384&e.flags)}else zs=!1;switch(t.lanes=0,t.tag){case 2:if(n=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=Ef(t,Vn.current),Bi(t,r),i=Ch(null,t,n,e,i,r),t.flags|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ff(n)){var s=!0;Jf(t)}else s=!1;t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,Ui(t);var a=n.getDerivedStateFromProps;"function"==typeof a&&Gg(t,n,a,e),i.updater=Ji,t.stateNode=i,i._reactInternals=t,Og(t,n,e,r),t=Ys(null,t,n,!0,s,r)}else t.tag=0,Gs(null,t,i,r),t=t.child;return t;case 16:i=t.elementType;e:{switch(null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=(s=i._init)(i._payload),t.type=i,s=t.tag=function(e){if("function"==typeof e)return va(e)?1:0;if(null!=e){if((e=e.$$typeof)===$)return 11;if(e===Y)return 14}return 2}(i),e=wi(i,e),s){case 0:t=Ks(null,t,i,e,r);break e;case 1:t=Xs(null,t,i,e,r);break e;case 11:t=Ws(null,t,i,e,r);break e;case 14:t=Vs(null,t,i,wi(i.type,e),n,r);break e}throw Error(o(306,i,""))}return t;case 0:return n=t.type,i=t.pendingProps,Ks(e,t,n,i=t.elementType===n?i:wi(n,i),r);case 1:return n=t.type,i=t.pendingProps,Xs(e,t,n,i=t.elementType===n?i:wi(n,i),r);case 3:if(Js(t),n=t.updateQueue,null===e||null===n)throw Error(o(282));if(n=t.pendingProps,i=null!==(i=t.memoizedState)?i.element:null,zi(e,t),Cg(t,n,null,r),(n=t.memoizedState.element)===i)xs(),t=uo(e,t,r);else{if((s=(i=t.stateNode).hydrate)&&(ms=On(t.stateNode.containerInfo.firstChild),ps=t,s=fs=!0),s){if(null!=(e=i.mutableSourceEagerHydrationData))for(i=0;i<e.length;i+=2)(s=e[i])._workInProgressVersionPrimary=e[i+1],ws.push(s);for(r=ts(t,null,n,r),t.child=r;r;)r.flags=-3&r.flags|1024,r=r.sibling}else Gs(e,t,n,r),xs();t=t.child}return t;case 5:return cs(t),null===e&&bs(t),n=t.type,i=t.pendingProps,s=null!==e?e.memoizedProps:null,a=i.children,Cn(n,i)?a=null:null!==s&&Cn(n,s)&&(t.flags|=16),Zs(e,t),Gs(e,t,a,r),t.child;case 6:return null===e&&bs(t),null;case 13:return io(e,t,r);case 4:return as(t,t.stateNode.containerInfo),n=t.pendingProps,null===e?t.child=es(t,null,n,r):Gs(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,Ws(e,t,n,i=t.elementType===n?i:wi(n,i),r);case 7:return Gs(e,t,t.pendingProps,r),t.child;case 8:case 12:return Gs(e,t,t.pendingProps.children,r),t.child;case 10:e:{n=t.type._context,i=t.pendingProps,a=t.memoizedProps,s=i.value;var l=t.type._context;if(I(Ei,l._currentValue),l._currentValue=s,null!==a)if(l=a.value,0===(s=tn(l,s)?0:0|("function"==typeof n._calculateChangedBits?n._calculateChangedBits(l,s):1073741823))){if(a.children===i.children&&!qn.current){t=uo(e,t,r);break e}}else for(null!==(l=t.child)&&(l.return=t);null!==l;){var c=l.dependencies;if(null!==c){a=l.child;for(var u=c.firstContext;null!==u;){if(u.context===n&&0!=(u.observedBits&s)){1===l.tag&&((u=qi(-1,r&-r)).tag=2,Ag(l,u)),l.lanes|=r,null!==(u=l.alternate)&&(u.lanes|=r),ki(l.return,r),c.lanes|=r;break}u=u.next}}else a=10===l.tag&&l.type===t.type?null:l.child;if(null!==a)a.return=l;else for(a=l;null!==a;){if(a===t){a=null;break}if(null!==(l=a.sibling)){l.return=a.return,a=l;break}a=a.return}l=a}Gs(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=(s=t.pendingProps).children,Bi(t,r),n=n(i=ji(i,s.unstable_observedBits)),t.flags|=1,Gs(e,t,n,r),t.child;case 14:return s=wi(i=t.type,t.pendingProps),Vs(e,t,i,s=wi(i.type,s),n,r);case 15:return qs(e,t,t.type,t.pendingProps,n,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:wi(n,i),null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,Ff(n)?(e=!0,Jf(t)):e=!1,Bi(t,r),Mg(t,n,i),Og(t,n,i,r),Ys(null,t,n,!0,e,r);case 19:return Ai(e,t,r);case 23:case 24:return $s(e,t,r)}throw Error(o(156,t.tag))},ja.prototype.render=function(e){wa(e,this._internalRoot,null,null)},ja.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;wa(null,e,null,(function(){t[In]=null}))},ht=function(e){13===e.tag&&(Jg(e,4,Hg()),ka(e,4))},pt=function(e){13===e.tag&&(Jg(e,67108864,Hg()),ka(e,67108864))},mt=function(e){if(13===e.tag){var t=Hg(),r=Ig(e);Jg(e,r,t),ka(e,r)}},ft=function(e,t){return t()},qe=function(e,t,r){switch(t){case"input":if(de(e,r),t=r.name,"radio"===r.type&&null!=t){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var i=Db(n);if(!i)throw Error(o(90));Wa(n),de(n,i)}}}break;case"textarea":be(e,r);break;case"select":null!=(t=r.value)&&fe(e,!!r.multiple,t,!1)}},Gb=Wj,Hb=function(e,t,r,n,i){var s=Ao;Ao|=4;try{return yi(98,e.bind(null,t,r,n,i))}finally{0===(Ao=s)&&(Go(),vi())}},Ib=function(){0==(49&Ao)&&(function(){if(null!==ea){var e=ea;ea=null,e.forEach((function(e){e.expiredLanes|=24&e.pendingLanes,Mj(e,mi())}))}vi()}(),Oj())},Ye=function(e,t){var r=Ao;Ao|=2;try{return e(t)}finally{0===(Ao=r)&&(Go(),vi())}};var $a={Events:[Cb,Hn,Db,Eb,Fb,Oj,{current:!1}]},Ka={findFiberByHostInstance:jn,bundleType:0,version:"17.0.2",rendererPackageName:"react-dom"},el={bundleType:Ka.bundleType,version:Ka.version,rendererPackageName:Ka.rendererPackageName,rendererConfig:Ka.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:_.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=ut(e))?null:e.stateNode},findFiberByHostInstance:Ka.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var tl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!tl.isDisabled&&tl.supportsFiber)try{Zn=tl.inject(el),Kn=tl}catch(Pe){}}t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=$a,t.createPortal=qa,t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(o(188));throw Error(o(268,Object.keys(e)))}return e=null===(e=ut(t))?null:e.stateNode},t.flushSync=function(e,t){var r=Ao;if(0!=(48&r))return e(t);Ao|=1;try{if(e)return yi(99,e.bind(null,t))}finally{Ao=r,vi()}},t.hydrate=function(e,t,r){if(!Ua(t))throw Error(o(200));return za(null,e,t,!0,r)},t.render=function(e,t,r){if(!Ua(t))throw Error(o(200));return za(null,e,t,!1,r)},t.unmountComponentAtNode=function(e){if(!Ua(e))throw Error(o(40));return!!e._reactRootContainer&&(Xj((function(){za(null,null,e,!1,(function(){e._reactRootContainer=null,e[In]=null}))})),!0)},t.unstable_batchedUpdates=Wj,t.unstable_createPortal=function(e,t){return qa(e,t,2<arguments.length&&void 0!==arguments[2]?arguments[2]:null)},t.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!Ua(r))throw Error(o(200));if(null==e||void 0===e._reactInternals)throw Error(o(38));return za(e,t,r,!1,n)},t.version="17.0.2"},47723:(e,t,r)=>{"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=r(32717)},25990:(e,t,r)=>{"use strict";e.exports=r(36109)},46693:(e,t)=>{"use strict";var r="function"==typeof Symbol&&Symbol.for,n=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,s=r?Symbol.for("react.fragment"):60107,o=r?Symbol.for("react.strict_mode"):60108,a=r?Symbol.for("react.profiler"):60114,l=r?Symbol.for("react.provider"):60109,c=r?Symbol.for("react.context"):60110,u=r?Symbol.for("react.async_mode"):60111,d=r?Symbol.for("react.concurrent_mode"):60111,h=r?Symbol.for("react.forward_ref"):60112,p=r?Symbol.for("react.suspense"):60113,m=r?Symbol.for("react.suspense_list"):60120,f=r?Symbol.for("react.memo"):60115,g=r?Symbol.for("react.lazy"):60116,y=r?Symbol.for("react.block"):60121,b=r?Symbol.for("react.fundamental"):60117,v=r?Symbol.for("react.responder"):60118,_=r?Symbol.for("react.scope"):60119;function x(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case u:case d:case s:case a:case o:case p:return e;default:switch(e=e&&e.$$typeof){case c:case h:case g:case f:case l:return e;default:return t}}case i:return t}}}function A(e){return x(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=l,t.Element=n,t.ForwardRef=h,t.Fragment=s,t.Lazy=g,t.Memo=f,t.Portal=i,t.Profiler=a,t.StrictMode=o,t.Suspense=p,t.isAsyncMode=function(e){return A(e)||x(e)===u},t.isConcurrentMode=A,t.isContextConsumer=function(e){return x(e)===c},t.isContextProvider=function(e){return x(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return x(e)===h},t.isFragment=function(e){return x(e)===s},t.isLazy=function(e){return x(e)===g},t.isMemo=function(e){return x(e)===f},t.isPortal=function(e){return x(e)===i},t.isProfiler=function(e){return x(e)===a},t.isStrictMode=function(e){return x(e)===o},t.isSuspense=function(e){return x(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===s||e===d||e===a||e===o||e===p||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===f||e.$$typeof===l||e.$$typeof===c||e.$$typeof===h||e.$$typeof===b||e.$$typeof===v||e.$$typeof===_||e.$$typeof===y)},t.typeOf=x},94649:(e,t,r)=>{"use strict";e.exports=r(46693)},59231:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Manager:()=>nt,Popper:()=>Popper_Popper,Reference:()=>Reference,placements:()=>ut});var n=r(15105),i=r(238),s=r(16632);function o(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e){var t=function(e,t){if("object"!==a(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===a(t)?t:String(t)}function c(e,t,r){return(t=l(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var u=r(49048),d=r.n(u),h=r(23770),p="undefined"!=typeof window&&"undefined"!=typeof document&&"undefined"!=typeof navigator,m=function(){for(var e=["Edge","Trident","Firefox"],t=0;t<e.length;t+=1)if(p&&navigator.userAgent.indexOf(e[t])>=0)return 1;return 0}();var f=p&&window.Promise?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then((function(){t=!1,e()})))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout((function(){t=!1,e()}),m))}};function g(e){return e&&"[object Function]"==={}.toString.call(e)}function y(e,t){if(1!==e.nodeType)return[];var r=e.ownerDocument.defaultView.getComputedStyle(e,null);return t?r[t]:r}function b(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function v(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=y(e),r=t.overflow,n=t.overflowX,i=t.overflowY;return/(auto|scroll|overlay)/.test(r+i+n)?e:v(b(e))}function _(e){return e&&e.referenceNode?e.referenceNode:e}var x=p&&!(!window.MSInputMethodContext||!document.documentMode),w=p&&/MSIE 10/.test(navigator.userAgent);function R(e){return 11===e?x:10===e?w:x||w}function k(e){if(!e)return document.documentElement;for(var t=R(10)?document.body:null,r=e.offsetParent||null;r===t&&e.nextElementSibling;)r=(e=e.nextElementSibling).offsetParent;var n=r&&r.nodeName;return n&&"BODY"!==n&&"HTML"!==n?-1!==["TH","TD","TABLE"].indexOf(r.nodeName)&&"static"===y(r,"position")?k(r):r:e?e.ownerDocument.documentElement:document.documentElement}function j(e){return null!==e.parentNode?j(e.parentNode):e}function z(e,t){if(!(e&&e.nodeType&&t&&t.nodeType))return document.documentElement;var r=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,n=r?e:t,i=r?t:e,s=document.createRange();s.setStart(n,0),s.setEnd(i,0);var o,a,l=s.commonAncestorContainer;if(e!==l&&t!==l||n.contains(i))return"BODY"===(a=(o=l).nodeName)||"HTML"!==a&&k(o.firstElementChild)!==o?k(l):l;var c=j(e);return c.host?z(c.host,t):z(e,j(t).host)}function q(e){var t="top"===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top")?"scrollTop":"scrollLeft",r=e.nodeName;if("BODY"===r||"HTML"===r){var n=e.ownerDocument.documentElement;return(e.ownerDocument.scrollingElement||n)[t]}return e[t]}function $(e,t){var r="x"===t?"Left":"Top",n="Left"===r?"Right":"Bottom";return parseFloat(e["border"+r+"Width"])+parseFloat(e["border"+n+"Width"])}function Z(e,t,r,n){return Math.max(t["offset"+e],t["scroll"+e],r["client"+e],r["offset"+e],r["scroll"+e],R(10)?parseInt(r["offset"+e])+parseInt(n["margin"+("Height"===e?"Top":"Left")])+parseInt(n["margin"+("Height"===e?"Bottom":"Right")]):0)}function X(e){var t=e.body,r=e.documentElement,n=R(10)&&getComputedStyle(r);return{height:Z("Height",t,r,n),width:Z("Width",t,r,n)}}var Y=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),ee=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},te=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};function re(e){return te({},e,{right:e.left+e.width,bottom:e.top+e.height})}function ne(e){var t={};try{if(R(10)){t=e.getBoundingClientRect();var r=q(e,"top"),n=q(e,"left");t.top+=r,t.left+=n,t.bottom+=r,t.right+=n}else t=e.getBoundingClientRect()}catch(e){}var i={left:t.left,top:t.top,width:t.right-t.left,height:t.bottom-t.top},s="HTML"===e.nodeName?X(e.ownerDocument):{},o=s.width||e.clientWidth||i.width,a=s.height||e.clientHeight||i.height,l=e.offsetWidth-o,c=e.offsetHeight-a;if(l||c){var u=y(e);l-=$(u,"x"),c-=$(u,"y"),i.width-=l,i.height-=c}return re(i)}function ie(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=R(10),i="HTML"===t.nodeName,s=ne(e),o=ne(t),a=v(e),l=y(t),c=parseFloat(l.borderTopWidth),u=parseFloat(l.borderLeftWidth);r&&i&&(o.top=Math.max(o.top,0),o.left=Math.max(o.left,0));var d=re({top:s.top-o.top-c,left:s.left-o.left-u,width:s.width,height:s.height});if(d.marginTop=0,d.marginLeft=0,!n&&i){var h=parseFloat(l.marginTop),p=parseFloat(l.marginLeft);d.top-=c-h,d.bottom-=c-h,d.left-=u-p,d.right-=u-p,d.marginTop=h,d.marginLeft=p}return(n&&!r?t.contains(a):t===a&&"BODY"!==a.nodeName)&&(d=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=q(t,"top"),i=q(t,"left"),s=r?-1:1;return e.top+=n*s,e.bottom+=n*s,e.left+=i*s,e.right+=i*s,e}(d,t)),d}function se(e){var t=e.nodeName;if("BODY"===t||"HTML"===t)return!1;if("fixed"===y(e,"position"))return!0;var r=b(e);return!!r&&se(r)}function oe(e){if(!e||!e.parentElement||R())return document.documentElement;for(var t=e.parentElement;t&&"none"===y(t,"transform");)t=t.parentElement;return t||document.documentElement}function ae(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s={top:0,left:0},o=i?oe(e):z(e,_(t));if("viewport"===n)s=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=e.ownerDocument.documentElement,n=ie(e,r),i=Math.max(r.clientWidth,window.innerWidth||0),s=Math.max(r.clientHeight,window.innerHeight||0),o=t?0:q(r),a=t?0:q(r,"left");return re({top:o-n.top+n.marginTop,left:a-n.left+n.marginLeft,width:i,height:s})}(o,i);else{var a=void 0;"scrollParent"===n?"BODY"===(a=v(b(t))).nodeName&&(a=e.ownerDocument.documentElement):a="window"===n?e.ownerDocument.documentElement:n;var l=ie(a,o,i);if("HTML"!==a.nodeName||se(o))s=l;else{var c=X(e.ownerDocument),u=c.height,d=c.width;s.top+=l.top-l.marginTop,s.bottom=u+l.top,s.left+=l.left-l.marginLeft,s.right=d+l.left}}var h="number"==typeof(r=r||0);return s.left+=h?r:r.left||0,s.top+=h?r:r.top||0,s.right-=h?r:r.right||0,s.bottom-=h?r:r.bottom||0,s}function le(e,t,r,n,i){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var o=ae(r,n,s,i),a={top:{width:o.width,height:t.top-o.top},right:{width:o.right-t.right,height:o.height},bottom:{width:o.width,height:o.bottom-t.bottom},left:{width:t.left-o.left,height:o.height}},l=Object.keys(a).map((function(e){return te({key:e},a[e],{area:(t=a[e],t.width*t.height)});var t})).sort((function(e,t){return t.area-e.area})),c=l.filter((function(e){var t=e.width,n=e.height;return t>=r.clientWidth&&n>=r.clientHeight})),u=c.length>0?c[0].key:l[0].key,d=e.split("-")[1];return u+(d?"-"+d:"")}function ce(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return ie(r,n?oe(t):z(t,_(r)),n)}function ue(e){var t=e.ownerDocument.defaultView.getComputedStyle(e),r=parseFloat(t.marginTop||0)+parseFloat(t.marginBottom||0),n=parseFloat(t.marginLeft||0)+parseFloat(t.marginRight||0);return{width:e.offsetWidth+n,height:e.offsetHeight+r}}function de(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,(function(e){return t[e]}))}function he(e,t,r){r=r.split("-")[0];var n=ue(e),i={width:n.width,height:n.height},s=-1!==["right","left"].indexOf(r),o=s?"top":"left",a=s?"left":"top",l=s?"height":"width",c=s?"width":"height";return i[o]=t[o]+t[l]/2-n[l]/2,i[a]=r===a?t[a]-n[c]:t[de(a)],i}function pe(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function me(e,t,r){return(void 0===r?e:e.slice(0,function(e,t,r){if(Array.prototype.findIndex)return e.findIndex((function(e){return e[t]===r}));var n=pe(e,(function(e){return e[t]===r}));return e.indexOf(n)}(e,"name",r))).forEach((function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var r=e.function||e.fn;e.enabled&&g(r)&&(t.offsets.popper=re(t.offsets.popper),t.offsets.reference=re(t.offsets.reference),t=r(t,e))})),t}function fe(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=ce(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=le(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=he(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=me(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function ge(e,t){return e.some((function(e){var r=e.name;return e.enabled&&r===t}))}function ye(e){for(var t=[!1,"ms","Webkit","Moz","O"],r=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<t.length;n++){var i=t[n],s=i?""+i+r:e;if(void 0!==document.body.style[s])return s}return null}function be(){return this.state.isDestroyed=!0,ge(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.position="",this.popper.style.top="",this.popper.style.left="",this.popper.style.right="",this.popper.style.bottom="",this.popper.style.willChange="",this.popper.style[ye("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function ve(e){var t=e.ownerDocument;return t?t.defaultView:window}function _e(e,t,r,n){var i="BODY"===e.nodeName,s=i?e.ownerDocument.defaultView:e;s.addEventListener(t,r,{passive:!0}),i||_e(v(s.parentNode),t,r,n),n.push(s)}function xe(e,t,r,n){r.updateBound=n,ve(e).addEventListener("resize",r.updateBound,{passive:!0});var i=v(e);return _e(i,"scroll",r.updateBound,r.scrollParents),r.scrollElement=i,r.eventsEnabled=!0,r}function we(){this.state.eventsEnabled||(this.state=xe(this.reference,this.options,this.state,this.scheduleUpdate))}function Se(){var e,t;this.state.eventsEnabled&&(cancelAnimationFrame(this.scheduleUpdate),this.state=(e=this.reference,t=this.state,ve(e).removeEventListener("resize",t.updateBound),t.scrollParents.forEach((function(e){e.removeEventListener("scroll",t.updateBound)})),t.updateBound=null,t.scrollParents=[],t.scrollElement=null,t.eventsEnabled=!1,t))}function Pe(e){return""!==e&&!isNaN(parseFloat(e))&&isFinite(e)}function Te(e,t){Object.keys(t).forEach((function(r){var n="";-1!==["width","height","top","right","bottom","left"].indexOf(r)&&Pe(t[r])&&(n="px"),e.style[r]=t[r]+n}))}var Re=p&&/Firefox/i.test(navigator.userAgent);function ke(e,t,r){var n=pe(e,(function(e){return e.name===t})),i=!!n&&e.some((function(e){return e.name===r&&e.enabled&&e.order<n.order}));if(!i){var s="`"+t+"`",o="`"+r+"`";console.warn(o+" modifier is required by "+s+" modifier in order to work, be sure to include it before "+s+"!")}return i}var Ie=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],je=Ie.slice(3);function He(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=je.indexOf(e),n=je.slice(r+1).concat(je.slice(0,r));return t?n.reverse():n}var ze="flip",Ge="clockwise",We="counterclockwise";function Ve(e,t,r,n){var i=[0,0],s=-1!==["right","left"].indexOf(n),o=e.split(/(\+|\-)/).map((function(e){return e.trim()})),a=o.indexOf(pe(o,(function(e){return-1!==e.search(/,|\s/)})));o[a]&&-1===o[a].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var l=/\s*,\s*|\s+/,c=-1!==a?[o.slice(0,a).concat([o[a].split(l)[0]]),[o[a].split(l)[1]].concat(o.slice(a+1))]:[o];return c=c.map((function(e,n){var i=(1===n?!s:s)?"height":"width",o=!1;return e.reduce((function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,o=!0,e):o?(e[e.length-1]+=t,o=!1,e):e.concat(t)}),[]).map((function(e){return function(e,t,r,n){var i=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),s=+i[1],o=i[2];if(!s)return e;if(0===o.indexOf("%")){return re("%p"===o?r:n)[t]/100*s}if("vh"===o||"vw"===o)return("vh"===o?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*s;return s}(e,i,t,r)}))})),c.forEach((function(e,t){e.forEach((function(r,n){Pe(r)&&(i[t]+=r*("-"===e[n-1]?-1:1))}))})),i}var qe={shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,r=t.split("-")[0],n=t.split("-")[1];if(n){var i=e.offsets,s=i.reference,o=i.popper,a=-1!==["bottom","top"].indexOf(r),l=a?"left":"top",c=a?"width":"height",u={start:ee({},l,s[l]),end:ee({},l,s[l]+s[c]-o[c])};e.offsets.popper=te({},o,u[n])}return e}},offset:{order:200,enabled:!0,fn:function(e,t){var r=t.offset,n=e.placement,i=e.offsets,s=i.popper,o=i.reference,a=n.split("-")[0],l=void 0;return l=Pe(+r)?[+r,0]:Ve(r,s,o,a),"left"===a?(s.top+=l[0],s.left-=l[1]):"right"===a?(s.top+=l[0],s.left+=l[1]):"top"===a?(s.left+=l[0],s.top-=l[1]):"bottom"===a&&(s.left+=l[0],s.top+=l[1]),e.popper=s,e},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var r=t.boundariesElement||k(e.instance.popper);e.instance.reference===r&&(r=k(r));var n=ye("transform"),i=e.instance.popper.style,s=i.top,o=i.left,a=i[n];i.top="",i.left="",i[n]="";var l=ae(e.instance.popper,e.instance.reference,t.padding,r,e.positionFixed);i.top=s,i.left=o,i[n]=a,t.boundaries=l;var c=t.priority,u=e.offsets.popper,d={primary:function(e){var r=u[e];return u[e]<l[e]&&!t.escapeWithReference&&(r=Math.max(u[e],l[e])),ee({},e,r)},secondary:function(e){var r="right"===e?"left":"top",n=u[r];return u[e]>l[e]&&!t.escapeWithReference&&(n=Math.min(u[r],l[e]-("right"===e?u.width:u.height))),ee({},r,n)}};return c.forEach((function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";u=te({},u,d[t](e))})),e.offsets.popper=u,e},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,r=t.popper,n=t.reference,i=e.placement.split("-")[0],s=Math.floor,o=-1!==["top","bottom"].indexOf(i),a=o?"right":"bottom",l=o?"left":"top",c=o?"width":"height";return r[a]<s(n[l])&&(e.offsets.popper[l]=s(n[l])-r[c]),r[l]>s(n[a])&&(e.offsets.popper[l]=s(n[a])),e}},arrow:{order:500,enabled:!0,fn:function(e,t){var r;if(!ke(e.instance.modifiers,"arrow","keepTogether"))return e;var n=t.element;if("string"==typeof n){if(!(n=e.instance.popper.querySelector(n)))return e}else if(!e.instance.popper.contains(n))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var i=e.placement.split("-")[0],s=e.offsets,o=s.popper,a=s.reference,l=-1!==["left","right"].indexOf(i),c=l?"height":"width",u=l?"Top":"Left",d=u.toLowerCase(),h=l?"left":"top",p=l?"bottom":"right",m=ue(n)[c];a[p]-m<o[d]&&(e.offsets.popper[d]-=o[d]-(a[p]-m)),a[d]+m>o[p]&&(e.offsets.popper[d]+=a[d]+m-o[p]),e.offsets.popper=re(e.offsets.popper);var f=a[d]+a[c]/2-m/2,g=y(e.instance.popper),b=parseFloat(g["margin"+u]),v=parseFloat(g["border"+u+"Width"]),_=f-e.offsets.popper[d]-b-v;return _=Math.max(Math.min(o[c]-m,_),0),e.arrowElement=n,e.offsets.arrow=(ee(r={},d,Math.round(_)),ee(r,h,""),r),e},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(e,t){if(ge(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var r=ae(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),n=e.placement.split("-")[0],i=de(n),s=e.placement.split("-")[1]||"",o=[];switch(t.behavior){case ze:o=[n,i];break;case Ge:o=He(n);break;case We:o=He(n,!0);break;default:o=t.behavior}return o.forEach((function(a,l){if(n!==a||o.length===l+1)return e;n=e.placement.split("-")[0],i=de(n);var c=e.offsets.popper,u=e.offsets.reference,d=Math.floor,h="left"===n&&d(c.right)>d(u.left)||"right"===n&&d(c.left)<d(u.right)||"top"===n&&d(c.bottom)>d(u.top)||"bottom"===n&&d(c.top)<d(u.bottom),p=d(c.left)<d(r.left),m=d(c.right)>d(r.right),f=d(c.top)<d(r.top),g=d(c.bottom)>d(r.bottom),y="left"===n&&p||"right"===n&&m||"top"===n&&f||"bottom"===n&&g,b=-1!==["top","bottom"].indexOf(n),v=!!t.flipVariations&&(b&&"start"===s&&p||b&&"end"===s&&m||!b&&"start"===s&&f||!b&&"end"===s&&g),_=!!t.flipVariationsByContent&&(b&&"start"===s&&m||b&&"end"===s&&p||!b&&"start"===s&&g||!b&&"end"===s&&f),x=v||_;(h||y||x)&&(e.flipped=!0,(h||y)&&(n=o[l+1]),x&&(s=function(e){return"end"===e?"start":"start"===e?"end":e}(s)),e.placement=n+(s?"-"+s:""),e.offsets.popper=te({},e.offsets.popper,he(e.instance.popper,e.offsets.reference,e.placement)),e=me(e.instance.modifiers,e,"flip"))})),e},behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,r=t.split("-")[0],n=e.offsets,i=n.popper,s=n.reference,o=-1!==["left","right"].indexOf(r),a=-1===["top","left"].indexOf(r);return i[o?"left":"top"]=s[r]-(a?i[o?"width":"height"]:0),e.placement=de(t),e.offsets.popper=re(i),e}},hide:{order:800,enabled:!0,fn:function(e){if(!ke(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,r=pe(e.instance.modifiers,(function(e){return"preventOverflow"===e.name})).boundaries;if(t.bottom<r.top||t.left>r.right||t.top>r.bottom||t.right<r.left){if(!0===e.hide)return e;e.hide=!0,e.attributes["x-out-of-boundaries"]=""}else{if(!1===e.hide)return e;e.hide=!1,e.attributes["x-out-of-boundaries"]=!1}return e}},computeStyle:{order:850,enabled:!0,fn:function(e,t){var r=t.x,n=t.y,i=e.offsets.popper,s=pe(e.instance.modifiers,(function(e){return"applyStyle"===e.name})).gpuAcceleration;void 0!==s&&console.warn("WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!");var o=void 0!==s?s:t.gpuAcceleration,a=k(e.instance.popper),l=ne(a),c={position:i.position},u=function(e,t){var r=e.offsets,n=r.popper,i=r.reference,s=Math.round,o=Math.floor,a=function(e){return e},l=s(i.width),c=s(n.width),u=-1!==["left","right"].indexOf(e.placement),d=-1!==e.placement.indexOf("-"),h=t?u||d||l%2==c%2?s:o:a,p=t?s:a;return{left:h(l%2==1&&c%2==1&&!d&&t?n.left-1:n.left),top:p(n.top),bottom:p(n.bottom),right:h(n.right)}}(e,window.devicePixelRatio<2||!Re),d="bottom"===r?"top":"bottom",h="right"===n?"left":"right",p=ye("transform"),m=void 0,f=void 0;if(f="bottom"===d?"HTML"===a.nodeName?-a.clientHeight+u.bottom:-l.height+u.bottom:u.top,m="right"===h?"HTML"===a.nodeName?-a.clientWidth+u.right:-l.width+u.right:u.left,o&&p)c[p]="translate3d("+m+"px, "+f+"px, 0)",c[d]=0,c[h]=0,c.willChange="transform";else{var g="bottom"===d?-1:1,y="right"===h?-1:1;c[d]=f*g,c[h]=m*y,c.willChange=d+", "+h}var b={"x-placement":e.placement};return e.attributes=te({},b,e.attributes),e.styles=te({},c,e.styles),e.arrowStyles=te({},e.offsets.arrow,e.arrowStyles),e},gpuAcceleration:!0,x:"bottom",y:"right"},applyStyle:{order:900,enabled:!0,fn:function(e){var t,r;return Te(e.instance.popper,e.styles),t=e.instance.popper,r=e.attributes,Object.keys(r).forEach((function(e){!1!==r[e]?t.setAttribute(e,r[e]):t.removeAttribute(e)})),e.arrowElement&&Object.keys(e.arrowStyles).length&&Te(e.arrowElement,e.arrowStyles),e},onLoad:function(e,t,r,n,i){var s=ce(i,t,e,r.positionFixed),o=le(r.placement,s,t,e,r.modifiers.flip.boundariesElement,r.modifiers.flip.padding);return t.setAttribute("x-placement",o),Te(t,{position:r.positionFixed?"fixed":"absolute"}),r},gpuAcceleration:void 0}},$e={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:qe},Xe=function(){function Popper2(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,Popper2),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=f(this.update.bind(this)),this.options=te({},Popper2.Defaults,n),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=e&&e.jquery?e[0]:e,this.popper=t&&t.jquery?t[0]:t,this.options.modifiers={},Object.keys(te({},Popper2.Defaults.modifiers,n.modifiers)).forEach((function(e){r.options.modifiers[e]=te({},Popper2.Defaults.modifiers[e]||{},n.modifiers?n.modifiers[e]:{})})),this.modifiers=Object.keys(this.options.modifiers).map((function(e){return te({name:e},r.options.modifiers[e])})).sort((function(e,t){return e.order-t.order})),this.modifiers.forEach((function(e){e.enabled&&g(e.onLoad)&&e.onLoad(r.reference,r.popper,r.options,e,r.state)})),this.update();var i=this.options.eventsEnabled;i&&this.enableEventListeners(),this.state.eventsEnabled=i}return Y(Popper2,[{key:"update",value:function(){return fe.call(this)}},{key:"destroy",value:function(){return be.call(this)}},{key:"enableEventListeners",value:function(){return we.call(this)}},{key:"disableEventListeners",value:function(){return Se.call(this)}}]),Popper2}();Xe.Utils=("undefined"!=typeof window?window:r.g).PopperUtils,Xe.placements=Ie,Xe.Defaults=$e;const Ye=Xe;var Qe=r(11526),et=r.n(Qe),tt=et()(),rt=et()(),nt=function(e){function Manager2(){for(var t,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return c(o(o(t=e.call.apply(e,[this].concat(n))||this)),"referenceNode",void 0),c(o(o(t)),"setReferenceNode",(function(e){e&&t.referenceNode!==e&&(t.referenceNode=e,t.forceUpdate())})),t}(0,s.A)(Manager2,e);var t=Manager2.prototype;return t.componentWillUnmount=function(){this.referenceNode=null},t.render=function(){return h.createElement(tt.Provider,{value:this.referenceNode},h.createElement(rt.Provider,{value:this.setReferenceNode},this.props.children))},Manager2}(h.Component),it=function(e){return Array.isArray(e)?e[0]:e},st=function(e){if("function"==typeof e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return e.apply(void 0,r)}},ot=function(e,t){if("function"==typeof e)return st(e,t);null!=e&&(e.current=t)},at={position:"absolute",top:0,left:0,opacity:0,pointerEvents:"none"},lt={},ct=function(e){function InnerPopper2(){for(var t,r=arguments.length,n=new Array(r),s=0;s<r;s++)n[s]=arguments[s];return c(o(o(t=e.call.apply(e,[this].concat(n))||this)),"state",{data:void 0,placement:void 0}),c(o(o(t)),"popperInstance",void 0),c(o(o(t)),"popperNode",null),c(o(o(t)),"arrowNode",null),c(o(o(t)),"setPopperNode",(function(e){e&&t.popperNode!==e&&(ot(t.props.innerRef,e),t.popperNode=e,t.updatePopperInstance())})),c(o(o(t)),"setArrowNode",(function(e){t.arrowNode=e})),c(o(o(t)),"updateStateModifier",{enabled:!0,order:900,fn:function(e){var r=e.placement;return t.setState({data:e,placement:r}),e}}),c(o(o(t)),"getOptions",(function(){return{placement:t.props.placement,eventsEnabled:t.props.eventsEnabled,positionFixed:t.props.positionFixed,modifiers:(0,i.A)({},t.props.modifiers,{arrow:(0,i.A)({},t.props.modifiers&&t.props.modifiers.arrow,{enabled:!!t.arrowNode,element:t.arrowNode}),applyStyle:{enabled:!1},updateStateModifier:t.updateStateModifier})}})),c(o(o(t)),"getPopperStyle",(function(){return t.popperNode&&t.state.data?(0,i.A)({position:t.state.data.offsets.popper.position},t.state.data.styles):at})),c(o(o(t)),"getPopperPlacement",(function(){return t.state.data?t.state.placement:void 0})),c(o(o(t)),"getArrowStyle",(function(){return t.arrowNode&&t.state.data?t.state.data.arrowStyles:lt})),c(o(o(t)),"getOutOfBoundariesState",(function(){return t.state.data?t.state.data.hide:void 0})),c(o(o(t)),"destroyPopperInstance",(function(){t.popperInstance&&(t.popperInstance.destroy(),t.popperInstance=null)})),c(o(o(t)),"updatePopperInstance",(function(){t.destroyPopperInstance();var e=o(o(t)).popperNode,r=t.props.referenceElement;r&&e&&(t.popperInstance=new Ye(r,e,t.getOptions()))})),c(o(o(t)),"scheduleUpdate",(function(){t.popperInstance&&t.popperInstance.scheduleUpdate()})),t}(0,s.A)(InnerPopper2,e);var t=InnerPopper2.prototype;return t.componentDidUpdate=function(e,t){this.props.placement===e.placement&&this.props.referenceElement===e.referenceElement&&this.props.positionFixed===e.positionFixed&&d()(this.props.modifiers,e.modifiers,{strict:!0})?this.props.eventsEnabled!==e.eventsEnabled&&this.popperInstance&&(this.props.eventsEnabled?this.popperInstance.enableEventListeners():this.popperInstance.disableEventListeners()):this.updatePopperInstance(),t.placement!==this.state.placement&&this.scheduleUpdate()},t.componentWillUnmount=function(){ot(this.props.innerRef,null),this.destroyPopperInstance()},t.render=function(){return it(this.props.children)({ref:this.setPopperNode,style:this.getPopperStyle(),placement:this.getPopperPlacement(),outOfBoundaries:this.getOutOfBoundariesState(),scheduleUpdate:this.scheduleUpdate,arrowProps:{ref:this.setArrowNode,style:this.getArrowStyle()}})},InnerPopper2}(h.Component);c(ct,"defaultProps",{placement:"bottom",eventsEnabled:!0,referenceElement:void 0,positionFixed:!1});var ut=Ye.placements;function Popper_Popper(e){var t=e.referenceElement,r=(0,n.A)(e,["referenceElement"]);return h.createElement(tt.Consumer,null,(function(e){return h.createElement(ct,(0,i.A)({referenceElement:void 0!==t?t:e},r))}))}var dt=r(20565),ht=r.n(dt),pt=function(e){function InnerReference2(){for(var t,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return c(o(o(t=e.call.apply(e,[this].concat(n))||this)),"refHandler",(function(e){ot(t.props.innerRef,e),st(t.props.setReferenceNode,e)})),t}(0,s.A)(InnerReference2,e);var t=InnerReference2.prototype;return t.componentWillUnmount=function(){ot(this.props.innerRef,null)},t.render=function(){return ht()(Boolean(this.props.setReferenceNode),"`Reference` should not be used outside of a `Manager` component."),it(this.props.children)({ref:this.refHandler})},InnerReference2}(h.Component);function Reference(e){return h.createElement(rt.Consumer,null,(function(t){return h.createElement(pt,(0,i.A)({setReferenceNode:t},e))}))}},382:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(23770),i=(o(n),o(r(15134))),s=o(r(3933));o(r(20565));function o(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=1073741823;t.default=function(e,t){var r,o,d="__create-react-context-"+(0,s.default)()+"__",h=function(e){function Provider2(){var t,r,n,i;a(this,Provider2);for(var s=arguments.length,o=Array(s),c=0;c<s;c++)o[c]=arguments[c];return t=r=l(this,e.call.apply(e,[this].concat(o))),r.emitter=(n=r.props.value,i=[],{on:function(e){i.push(e)},off:function(e){i=i.filter((function(t){return t!==e}))},get:function(){return n},set:function(e,t){n=e,i.forEach((function(e){return e(n,t)}))}}),l(r,t)}return c(Provider2,e),Provider2.prototype.getChildContext=function(){var e;return(e={})[d]=this.emitter,e},Provider2.prototype.componentWillReceiveProps=function(e){if(this.props.value!==e.value){var r=this.props.value,n=e.value,i=void 0;((s=r)===(o=n)?0!==s||1/s==1/o:s!=s&&o!=o)?i=0:(i="function"==typeof t?t(r,n):u,0!==(i|=0)&&this.emitter.set(e.value,i))}var s,o},Provider2.prototype.render=function(){return this.props.children},Provider2}(n.Component);h.childContextTypes=((r={})[d]=i.default.object.isRequired,r);var p=function(t){function Consumer2(){var e,r;a(this,Consumer2);for(var n=arguments.length,i=Array(n),s=0;s<n;s++)i[s]=arguments[s];return e=r=l(this,t.call.apply(t,[this].concat(i))),r.state={value:r.getValue()},r.onUpdate=function(e,t){0!=((0|r.observedBits)&t)&&r.setState({value:r.getValue()})},l(r,e)}return c(Consumer2,t),Consumer2.prototype.componentWillReceiveProps=function(e){var t=e.observedBits;this.observedBits=null==t?u:t},Consumer2.prototype.componentDidMount=function(){this.context[d]&&this.context[d].on(this.onUpdate);var e=this.props.observedBits;this.observedBits=null==e?u:e},Consumer2.prototype.componentWillUnmount=function(){this.context[d]&&this.context[d].off(this.onUpdate)},Consumer2.prototype.getValue=function(){return this.context[d]?this.context[d].get():e},Consumer2.prototype.render=function(){return(e=this.props.children,Array.isArray(e)?e[0]:e)(this.state.value);var e},Consumer2}(n.Component);return p.contextTypes=((o={})[d]=i.default.object,o),{Provider:h,Consumer:p}},e.exports=t.default},11526:(e,t,r)=>{"use strict";t.__esModule=!0;var n=s(r(23770)),i=s(r(382));function s(e){return e&&e.__esModule?e:{default:e}}t.default=n.default.createContext||i.default,e.exports=t.default},51912:(e,t,r)=>{"use strict";var n=r(68239);function i(){}function s(){}s.resetWarningCache=i,e.exports=function(){function e(e,t,r,i,s,o){if(o!==n){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:s,resetWarningCache:i};return r.PropTypes=r,r}},15134:(e,t,r)=>{e.exports=r(51912)()},68239:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},44886:(e,t,r)=>{"use strict";r.r(t),r.d(t,{BrowserRouter:()=>me,HashRouter:()=>fe,Link:()=>xe,MemoryRouter:()=>w,NavLink:()=>Pe,Prompt:()=>Prompt,Redirect:()=>Redirect,Route:()=>ee,Router:()=>x,StaticRouter:()=>oe,Switch:()=>ae,generatePath:()=>q,matchPath:()=>Y,useHistory:()=>ue,useLocation:()=>de,useParams:()=>he,useRouteMatch:()=>pe,withRouter:()=>le});var n=r(16632),i=r(23770),s=r(69722),o=r.n(s),a=r(68587),l=r(88631),c=r(238),u=r(66031),d=r.n(u),h=(r(94649),r(15105)),p=r(74944),m=r.n(p),f=1073741823,g="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:{};var y=i.createContext||function(e,t){var r,s,a="__create-react-context-"+function(){var e="__global_unique_id__";return g[e]=(g[e]||0)+1}()+"__",l=function(e){function Provider2(){for(var t,r,n,i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return(t=e.call.apply(e,[this].concat(s))||this).emitter=(r=t.props.value,n=[],{on:function(e){n.push(e)},off:function(e){n=n.filter((function(t){return t!==e}))},get:function(){return r},set:function(e,t){r=e,n.forEach((function(e){return e(r,t)}))}}),t}(0,n.A)(Provider2,e);var r=Provider2.prototype;return r.getChildContext=function(){var e;return(e={})[a]=this.emitter,e},r.componentWillReceiveProps=function(e){if(this.props.value!==e.value){var r,n=this.props.value,i=e.value;((s=n)===(o=i)?0!==s||1/s==1/o:s!=s&&o!=o)?r=0:(r="function"==typeof t?t(n,i):f,0!==(r|=0)&&this.emitter.set(e.value,r))}var s,o},r.render=function(){return this.props.children},Provider2}(i.Component);l.childContextTypes=((r={})[a]=o().object.isRequired,r);var c=function(t){function Consumer2(){for(var e,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return(e=t.call.apply(t,[this].concat(n))||this).observedBits=void 0,e.state={value:e.getValue()},e.onUpdate=function(t,r){0!=((0|e.observedBits)&r)&&e.setState({value:e.getValue()})},e}(0,n.A)(Consumer2,t);var r=Consumer2.prototype;return r.componentWillReceiveProps=function(e){var t=e.observedBits;this.observedBits=null==t?f:t},r.componentDidMount=function(){this.context[a]&&this.context[a].on(this.onUpdate);var e=this.props.observedBits;this.observedBits=null==e?f:e},r.componentWillUnmount=function(){this.context[a]&&this.context[a].off(this.onUpdate)},r.getValue=function(){return this.context[a]?this.context[a].get():e},r.render=function(){return(e=this.props.children,Array.isArray(e)?e[0]:e)(this.state.value);var e},Consumer2}(i.Component);return c.contextTypes=((s={})[a]=o().object,s),{Provider:l,Consumer:c}},b=function(e){var t=y();return t.displayName=e,t},v=b("Router-History"),_=b("Router"),x=function(e){function Router2(t){var r;return(r=e.call(this,t)||this).state={location:t.history.location},r._isMounted=!1,r._pendingLocation=null,t.staticContext||(r.unlisten=t.history.listen((function(e){r._pendingLocation=e}))),r}(0,n.A)(Router2,e),Router2.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var t=Router2.prototype;return t.componentDidMount=function(){var e=this;this._isMounted=!0,this.unlisten&&this.unlisten(),this.props.staticContext||(this.unlisten=this.props.history.listen((function(t){e._isMounted&&e.setState({location:t})}))),this._pendingLocation&&this.setState({location:this._pendingLocation})},t.componentWillUnmount=function(){this.unlisten&&(this.unlisten(),this._isMounted=!1,this._pendingLocation=null)},t.render=function(){return i.createElement(_.Provider,{value:{history:this.props.history,location:this.state.location,match:Router2.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},i.createElement(v.Provider,{children:this.props.children||null,value:this.props.history}))},Router2}(i.Component);var w=function(e){function MemoryRouter2(){for(var t,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return(t=e.call.apply(e,[this].concat(n))||this).history=(0,a.createMemoryHistory)(t.props),t}return(0,n.A)(MemoryRouter2,e),MemoryRouter2.prototype.render=function(){return i.createElement(x,{history:this.history,children:this.props.children})},MemoryRouter2}(i.Component);var R=function(e){function Lifecycle2(){return e.apply(this,arguments)||this}(0,n.A)(Lifecycle2,e);var t=Lifecycle2.prototype;return t.componentDidMount=function(){this.props.onMount&&this.props.onMount.call(this,this)},t.componentDidUpdate=function(e){this.props.onUpdate&&this.props.onUpdate.call(this,this,e)},t.componentWillUnmount=function(){this.props.onUnmount&&this.props.onUnmount.call(this,this)},t.render=function(){return null},Lifecycle2}(i.Component);function Prompt(e){var t=e.message,r=e.when,n=void 0===r||r;return i.createElement(_.Consumer,null,(function(e){if(e||(0,l.A)(!1),!n||e.staticContext)return null;var r=e.history.block;return i.createElement(R,{onMount:function(e){e.release=r(t)},onUpdate:function(e,n){n.message!==t&&(e.release(),e.release=r(t))},onUnmount:function(e){e.release()},message:t})}))}var k={},j=1e4,z=0;function q(e,t){return void 0===e&&(e="/"),void 0===t&&(t={}),"/"===e?e:function(e){if(k[e])return k[e];var t=d().compile(e);return z<j&&(k[e]=t,z++),t}(e)(t,{pretty:!0})}function Redirect(e){var t=e.computedMatch,r=e.to,n=e.push,s=void 0!==n&&n;return i.createElement(_.Consumer,null,(function(e){e||(0,l.A)(!1);var n=e.history,o=e.staticContext,u=s?n.push:n.replace,d=(0,a.createLocation)(t?"string"==typeof r?q(r,t.params):(0,c.A)({},r,{pathname:q(r.pathname,t.params)}):r);return o?(u(d),null):i.createElement(R,{onMount:function(){u(d)},onUpdate:function(e,t){var r=(0,a.createLocation)(t.to);(0,a.locationsAreEqual)(r,(0,c.A)({},d,{key:r.key}))||u(d)},to:r})}))}var $={},Z=1e4,X=0;function Y(e,t){void 0===t&&(t={}),("string"==typeof t||Array.isArray(t))&&(t={path:t});var r=t,n=r.path,i=r.exact,s=void 0!==i&&i,o=r.strict,a=void 0!==o&&o,l=r.sensitive,c=void 0!==l&&l;return[].concat(n).reduce((function(t,r){if(!r&&""!==r)return null;if(t)return t;var n=function(e,t){var r=""+t.end+t.strict+t.sensitive,n=$[r]||($[r]={});if(n[e])return n[e];var i=[],s={regexp:d()(e,i,t),keys:i};return X<Z&&(n[e]=s,X++),s}(r,{end:s,strict:a,sensitive:c}),i=n.regexp,o=n.keys,l=i.exec(e);if(!l)return null;var u=l[0],h=l.slice(1),p=e===u;return s&&!p?null:{path:r,url:"/"===r&&""===u?"/":u,isExact:p,params:o.reduce((function(e,t,r){return e[t.name]=h[r],e}),{})}}),null)}var ee=function(e){function Route2(){return e.apply(this,arguments)||this}return(0,n.A)(Route2,e),Route2.prototype.render=function(){var e=this;return i.createElement(_.Consumer,null,(function(t){t||(0,l.A)(!1);var r=e.props.location||t.location,n=e.props.computedMatch?e.props.computedMatch:e.props.path?Y(r.pathname,e.props):t.match,s=(0,c.A)({},t,{location:r,match:n}),o=e.props,a=o.children,u=o.component,d=o.render;return Array.isArray(a)&&function(e){return 0===i.Children.count(e)}(a)&&(a=null),i.createElement(_.Provider,{value:s},s.match?a?"function"==typeof a?a(s):a:u?i.createElement(u,s):d?d(s):null:"function"==typeof a?a(s):null)}))},Route2}(i.Component);function te(e){return"/"===e.charAt(0)?e:"/"+e}function re(e,t){if(!e)return t;var r=te(e);return 0!==t.pathname.indexOf(r)?t:(0,c.A)({},t,{pathname:t.pathname.substr(r.length)})}function ne(e){return"string"==typeof e?e:(0,a.createPath)(e)}function ie(e){return function(){(0,l.A)(!1)}}function se(){}var oe=function(e){function StaticRouter2(){for(var t,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return(t=e.call.apply(e,[this].concat(n))||this).handlePush=function(e){return t.navigateTo(e,"PUSH")},t.handleReplace=function(e){return t.navigateTo(e,"REPLACE")},t.handleListen=function(){return se},t.handleBlock=function(){return se},t}(0,n.A)(StaticRouter2,e);var t=StaticRouter2.prototype;return t.navigateTo=function(e,t){var r=this.props,n=r.basename,i=void 0===n?"":n,s=r.context,o=void 0===s?{}:s;o.action=t,o.location=function(e,t){return e?(0,c.A)({},t,{pathname:te(e)+t.pathname}):t}(i,(0,a.createLocation)(e)),o.url=ne(o.location)},t.render=function(){var e=this.props,t=e.basename,r=void 0===t?"":t,n=e.context,s=void 0===n?{}:n,o=e.location,l=void 0===o?"/":o,u=(0,h.A)(e,["basename","context","location"]),d={createHref:function(e){return te(r+ne(e))},action:"POP",location:re(r,(0,a.createLocation)(l)),push:this.handlePush,replace:this.handleReplace,go:ie(),goBack:ie(),goForward:ie(),listen:this.handleListen,block:this.handleBlock};return i.createElement(x,(0,c.A)({},u,{history:d,staticContext:s}))},StaticRouter2}(i.Component);var ae=function(e){function Switch2(){return e.apply(this,arguments)||this}return(0,n.A)(Switch2,e),Switch2.prototype.render=function(){var e=this;return i.createElement(_.Consumer,null,(function(t){t||(0,l.A)(!1);var r,n,s=e.props.location||t.location;return i.Children.forEach(e.props.children,(function(e){if(null==n&&i.isValidElement(e)){r=e;var o=e.props.path||e.props.from;n=o?Y(s.pathname,(0,c.A)({},e.props,{path:o})):t.match}})),n?i.cloneElement(r,{location:s,computedMatch:n}):null}))},Switch2}(i.Component);function le(e){var t="withRouter("+(e.displayName||e.name)+")",C=function(t){var r=t.wrappedComponentRef,n=(0,h.A)(t,["wrappedComponentRef"]);return i.createElement(_.Consumer,null,(function(t){return t||(0,l.A)(!1),i.createElement(e,(0,c.A)({},n,t,{ref:r}))}))};return C.displayName=t,C.WrappedComponent=e,m()(C,e)}var ce=i.useContext;function ue(){return ce(v)}function de(){return ce(_).location}function he(){var e=ce(_).match;return e?e.params:{}}function pe(e){var t=de(),r=ce(_).match;return e?Y(t.pathname,e):r}var me=function(e){function BrowserRouter2(){for(var t,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return(t=e.call.apply(e,[this].concat(n))||this).history=(0,a.createBrowserHistory)(t.props),t}return(0,n.A)(BrowserRouter2,e),BrowserRouter2.prototype.render=function(){return i.createElement(x,{history:this.history,children:this.props.children})},BrowserRouter2}(i.Component);var fe=function(e){function HashRouter2(){for(var t,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return(t=e.call.apply(e,[this].concat(n))||this).history=(0,a.createHashHistory)(t.props),t}return(0,n.A)(HashRouter2,e),HashRouter2.prototype.render=function(){return i.createElement(x,{history:this.history,children:this.props.children})},HashRouter2}(i.Component);var ge=function(e,t){return"function"==typeof e?e(t):e},ye=function(e,t){return"string"==typeof e?(0,a.createLocation)(e,null,null,t):e},be=function(e){return e},ve=i.forwardRef;void 0===ve&&(ve=be);var _e=ve((function(e,t){var r=e.innerRef,n=e.navigate,s=e.onClick,o=(0,h.A)(e,["innerRef","navigate","onClick"]),a=o.target,l=(0,c.A)({},o,{onClick:function(e){try{s&&s(e)}catch(t){throw e.preventDefault(),t}e.defaultPrevented||0!==e.button||a&&"_self"!==a||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||(e.preventDefault(),n())}});return l.ref=be!==ve&&t||r,i.createElement("a",l)}));var xe=ve((function(e,t){var r=e.component,n=void 0===r?_e:r,s=e.replace,o=e.to,u=e.innerRef,d=(0,h.A)(e,["component","replace","to","innerRef"]);return i.createElement(_.Consumer,null,(function(e){e||(0,l.A)(!1);var r=e.history,h=ye(ge(o,e.location),e.location),p=h?r.createHref(h):"",m=(0,c.A)({},d,{href:p,navigate:function(){var t=ge(o,e.location),n=(0,a.createPath)(e.location)===(0,a.createPath)(ye(t));(s||n?r.replace:r.push)(t)}});return be!==ve?m.ref=t||u:m.innerRef=u,i.createElement(n,m)}))})),we=function(e){return e},Se=i.forwardRef;void 0===Se&&(Se=we);var Pe=Se((function(e,t){var r=e["aria-current"],n=void 0===r?"page":r,s=e.activeClassName,o=void 0===s?"active":s,a=e.activeStyle,u=e.className,d=e.exact,p=e.isActive,m=e.location,f=e.sensitive,g=e.strict,y=e.style,b=e.to,v=e.innerRef,x=(0,h.A)(e,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return i.createElement(_.Consumer,null,(function(e){e||(0,l.A)(!1);var r=m||e.location,s=ye(ge(b,r),r),h=s.pathname,_=h&&h.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),w=_?Y(r.pathname,{path:_,exact:d,sensitive:f,strict:g}):null,R=!!(p?p(w,r):w),k="function"==typeof u?u(R):u,j="function"==typeof y?y(R):y;R&&(k=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter((function(e){return e})).join(" ")}(k,o),j=(0,c.A)({},j,a));var z=(0,c.A)({"aria-current":R&&n||null,className:k,style:j,to:s},x);return we!==Se?z.ref=t||v:z.innerRef=v,i.createElement(xe,z)}))}))},90433:e=>{e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},66031:(e,t,r)=>{var n=r(90433);e.exports=p,e.exports.parse=s,e.exports.compile=function(e,t){return a(s(e,t),t)},e.exports.tokensToFunction=a,e.exports.tokensToRegExp=h;var i=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function s(e,t){for(var r,n=[],s=0,o=0,a="",u=t&&t.delimiter||"/";null!=(r=i.exec(e));){var d=r[0],h=r[1],p=r.index;if(a+=e.slice(o,p),o=p+d.length,h)a+=h[1];else{var m=e[o],f=r[2],g=r[3],y=r[4],b=r[5],v=r[6],_=r[7];a&&(n.push(a),a="");var x=null!=f&&null!=m&&m!==f,w="+"===v||"*"===v,R="?"===v||"*"===v,k=r[2]||u,j=y||b;n.push({name:g||s++,prefix:f||"",delimiter:k,optional:R,repeat:w,partial:x,asterisk:!!_,pattern:j?c(j):_?".*":"[^"+l(k)+"]+?"})}}return o<e.length&&(a+=e.substr(o)),a&&n.push(a),n}function o(e){return encodeURI(e).replace(/[\/?#]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}function a(e,t){for(var r=new Array(e.length),i=0;i<e.length;i++)"object"==typeof e[i]&&(r[i]=new RegExp("^(?:"+e[i].pattern+")$",d(t)));return function(t,i){for(var s="",a=t||{},l=(i||{}).pretty?o:encodeURIComponent,c=0;c<e.length;c++){var u=e[c];if("string"!=typeof u){var d,h=a[u.name];if(null==h){if(u.optional){u.partial&&(s+=u.prefix);continue}throw new TypeError('Expected "'+u.name+'" to be defined')}if(n(h)){if(!u.repeat)throw new TypeError('Expected "'+u.name+'" to not repeat, but received `'+JSON.stringify(h)+"`");if(0===h.length){if(u.optional)continue;throw new TypeError('Expected "'+u.name+'" to not be empty')}for(var p=0;p<h.length;p++){if(d=l(h[p]),!r[c].test(d))throw new TypeError('Expected all "'+u.name+'" to match "'+u.pattern+'", but received `'+JSON.stringify(d)+"`");s+=(0===p?u.prefix:u.delimiter)+d}}else{if(d=u.asterisk?encodeURI(h).replace(/[?#]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})):l(h),!r[c].test(d))throw new TypeError('Expected "'+u.name+'" to match "'+u.pattern+'", but received "'+d+'"');s+=u.prefix+d}}else s+=u}return s}}function l(e){return e.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function c(e){return e.replace(/([=!:$\/()])/g,"\\$1")}function u(e,t){return e.keys=t,e}function d(e){return e&&e.sensitive?"":"i"}function h(e,t,r){n(t)||(r=t||r,t=[]);for(var i=(r=r||{}).strict,s=!1!==r.end,o="",a=0;a<e.length;a++){var c=e[a];if("string"==typeof c)o+=l(c);else{var h=l(c.prefix),p="(?:"+c.pattern+")";t.push(c),c.repeat&&(p+="(?:"+h+p+")*"),o+=p=c.optional?c.partial?h+"("+p+")?":"(?:"+h+"("+p+"))?":h+"("+p+")"}}var m=l(r.delimiter||"/"),f=o.slice(-m.length)===m;return i||(o=(f?o.slice(0,-m.length):o)+"(?:"+m+"(?=$))?"),o+=s?"$":i&&f?"":"(?="+m+"|$)",u(new RegExp("^"+o,d(r)),t)}function p(e,t,r){return n(t)||(r=t||r,t=[]),r=r||{},e instanceof RegExp?function(e,t){var r=e.source.match(/\((?!\?)/g);if(r)for(var n=0;n<r.length;n++)t.push({name:n,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return u(e,t)}(e,t):n(e)?function(e,t,r){for(var n=[],i=0;i<e.length;i++)n.push(p(e[i],t,r).source);return u(new RegExp("(?:"+n.join("|")+")",d(r)),t)}(e,t,r):function(e,t,r){return h(s(e,r),t,r)}(e,t,r)}},22709:(e,t,r)=>{"use strict";var n=r(28578),i=60103,s=60106;t.Fragment=60107,t.StrictMode=60108,t.Profiler=60114;var o=60109,a=60110,l=60112;t.Suspense=60113;var c=60115,u=60116;if("function"==typeof Symbol&&Symbol.for){var d=Symbol.for;i=d("react.element"),s=d("react.portal"),t.Fragment=d("react.fragment"),t.StrictMode=d("react.strict_mode"),t.Profiler=d("react.profiler"),o=d("react.provider"),a=d("react.context"),l=d("react.forward_ref"),t.Suspense=d("react.suspense"),c=d("react.memo"),u=d("react.lazy")}var h="function"==typeof Symbol&&Symbol.iterator;function p(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},f={};function C(e,t,r){this.props=e,this.context=t,this.refs=f,this.updater=r||m}function D(){}function E(e,t,r){this.props=e,this.context=t,this.refs=f,this.updater=r||m}C.prototype.isReactComponent={},C.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(p(85));this.updater.enqueueSetState(this,e,t,"setState")},C.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},D.prototype=C.prototype;var g=E.prototype=new D;g.constructor=E,n(g,C.prototype),g.isPureReactComponent=!0;var y={current:null},b=Object.prototype.hasOwnProperty,v={key:!0,ref:!0,__self:!0,__source:!0};function J(e,t,r){var n,s={},o=null,a=null;if(null!=t)for(n in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(o=""+t.key),t)b.call(t,n)&&!v.hasOwnProperty(n)&&(s[n]=t[n]);var l=arguments.length-2;if(1===l)s.children=r;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];s.children=c}if(e&&e.defaultProps)for(n in l=e.defaultProps)void 0===s[n]&&(s[n]=l[n]);return{$$typeof:i,type:e,key:o,ref:a,props:s,_owner:y.current}}function L(e){return"object"==typeof e&&null!==e&&e.$$typeof===i}var _=/\/+/g;function N(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function O(e,t,r,n,o){var a=typeof e;"undefined"!==a&&"boolean"!==a||(e=null);var l=!1;if(null===e)l=!0;else switch(a){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case i:case s:l=!0}}if(l)return o=o(l=e),e=""===n?"."+N(l,0):n,Array.isArray(o)?(r="",null!=e&&(r=e.replace(_,"$&/")+"/"),O(o,t,r,"",(function(e){return e}))):null!=o&&(L(o)&&(o=function(e,t){return{$$typeof:i,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(o,r+(!o.key||l&&l.key===o.key?"":(""+o.key).replace(_,"$&/")+"/")+e)),t.push(o)),1;if(l=0,n=""===n?".":n+":",Array.isArray(e))for(var c=0;c<e.length;c++){var u=n+N(a=e[c],c);l+=O(a,t,r,u,o)}else if(u=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=h&&e[h]||e["@@iterator"])?e:null}(e),"function"==typeof u)for(e=u.call(e),c=0;!(a=e.next()).done;)l+=O(a=a.value,t,r,u=n+N(a,c++),o);else if("object"===a)throw t=""+e,Error(p(31,"[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t));return l}function P(e,t,r){if(null==e)return e;var n=[],i=0;return O(e,n,"","",(function(e){return t.call(r,e,i++)})),n}function Q(e){if(-1===e._status){var t=e._result;t=t(),e._status=0,e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}if(1===e._status)return e._result;throw e._result}var x={current:null};function S(){var e=x.current;if(null===e)throw Error(p(321));return e}var w={ReactCurrentDispatcher:x,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:y,IsSomeRendererActing:{current:!1},assign:n};t.Children={map:P,forEach:function(e,t,r){P(e,(function(){t.apply(this,arguments)}),r)},count:function(e){var t=0;return P(e,(function(){t++})),t},toArray:function(e){return P(e,(function(e){return e}))||[]},only:function(e){if(!L(e))throw Error(p(143));return e}},t.Component=C,t.PureComponent=E,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=w,t.cloneElement=function(e,t,r){if(null==e)throw Error(p(267,e));var s=n({},e.props),o=e.key,a=e.ref,l=e._owner;if(null!=t){if(void 0!==t.ref&&(a=t.ref,l=y.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(u in t)b.call(t,u)&&!v.hasOwnProperty(u)&&(s[u]=void 0===t[u]&&void 0!==c?c[u]:t[u])}var u=arguments.length-2;if(1===u)s.children=r;else if(1<u){c=Array(u);for(var d=0;d<u;d++)c[d]=arguments[d+2];s.children=c}return{$$typeof:i,type:e.type,key:o,ref:a,props:s,_owner:l}},t.createContext=function(e,t){return void 0===t&&(t=null),(e={$$typeof:a,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:o,_context:e},e.Consumer=e},t.createElement=J,t.createFactory=function(e){var t=J.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:l,render:e}},t.isValidElement=L,t.lazy=function(e){return{$$typeof:u,_payload:{_status:-1,_result:e},_init:Q}},t.memo=function(e,t){return{$$typeof:c,type:e,compare:void 0===t?null:t}},t.useCallback=function(e,t){return S().useCallback(e,t)},t.useContext=function(e,t){return S().useContext(e,t)},t.useDebugValue=function(){},t.useEffect=function(e,t){return S().useEffect(e,t)},t.useImperativeHandle=function(e,t,r){return S().useImperativeHandle(e,t,r)},t.useLayoutEffect=function(e,t){return S().useLayoutEffect(e,t)},t.useMemo=function(e,t){return S().useMemo(e,t)},t.useReducer=function(e,t,r){return S().useReducer(e,t,r)},t.useRef=function(e){return S().useRef(e)},t.useState=function(e){return S().useState(e)},t.version="17.0.2"},23770:(e,t,r)=>{"use strict";e.exports=r(22709)},42282:(e,t,r)=>{var n=r(23770),i=r(47723),s=r(25990),o=r(75454),a=r(39545),l=r(333),c={CLASS_NAME_ATTR:"data-react-class",PROPS_ATTR:"data-react-props",RENDER_ATTR:"data-hydrate",CACHE_ID_ATTR:"data-react-cache-id",TURBOLINKS_PERMANENT_ATTR:"data-turbolinks-permanent",jQuery:"undefined"!=typeof window&&void 0!==window.jQuery&&window.jQuery,components:{},findDOMNodes:function(e){var t,r,n=c.CLASS_NAME_ATTR;switch(typeof e){case"undefined":t="["+n+"]",r=document;break;case"object":t="["+n+"]",r=e;break;case"string":t=e+"["+n+"], "+e+" ["+n+"]",r=document}return c.jQuery?c.jQuery(t,r):r.querySelectorAll(t)},getConstructor:a,useContext:function(e){this.getConstructor=l(e)},serverRender:function(e,t,r){var i=this.getConstructor(t),o=n.createElement(i,r);return s[e](o)},mountComponents:function(e){for(var t=c,r=t.findDOMNodes(e),s=0;s<r.length;++s){var o=r[s],a=o.getAttribute(t.CLASS_NAME_ATTR),l=t.getConstructor(a),u=o.getAttribute(t.PROPS_ATTR),d=u&&JSON.parse(u),h=o.getAttribute(t.RENDER_ATTR),p=o.getAttribute(t.CACHE_ID_ATTR),m=o.hasAttribute(t.TURBOLINKS_PERMANENT_ATTR);if(!l){var f="Cannot find component: '"+a+"'";throw console&&console.log&&console.log("%c[react-rails] %c"+f+" for element","font-weight: bold","",o),new Error(f+". Make sure your component is available to render.")}var g=this.components[p];void 0===g&&(g=n.createElement(l,d),m&&(this.components[p]=g)),g=h&&"function"==typeof i.hydrate?i.hydrate(g,o):i.render(g,o)}},unmountComponents:function(e){for(var t=c.findDOMNodes(e),r=0;r<t.length;++r){var n=t[r];i.unmountComponentAtNode(n)}},detectEvents:function(){o(this)},handleMount:function(e){var t=void 0;e&&e.target&&(t=e.target),c.mountComponents(t)},handleUnmount:function(e){var t=void 0;e&&e.target&&(t=e.target),c.unmountComponents(t)}};"undefined"!=typeof window&&c.detectEvents(),self.ReactRailsUJS=c,e.exports=c},75454:(e,t,r)=>{var n=r(20606),i=r(56182),s=r(78436),o=r(96295),a=r(21986);e.exports=function(e){e.handleEvent&&("undefined"!=typeof Turbolinks&&void 0!==Turbolinks.EVENTS&&a.teardown(e),s.teardown(e),o.teardown(e),i.teardown(e),n.teardown(e)),"addEventListener"in window?(e.handleEvent=function(e,t){document.addEventListener(e,t)},e.removeEvent=function(e,t){document.removeEventListener(e,t)}):(e.handleEvent=function(e,t){window.attachEvent(e,t)},e.removeEvent=function(e,t){window.detachEvent(e,t)}),"undefined"!=typeof Turbolinks&&Turbolinks.supported?void 0!==Turbolinks.EVENTS?a.setup(e):void 0!==Turbolinks.controller?s.setup(e):o.setup(e):"undefined"!=typeof $&&"function"==typeof $.pjax?i.setup(e):n.setup(e)}},20606:e=>{e.exports={setup:function(e){"addEventListener"in window?e.handleEvent("DOMContentLoaded",e.handleMount):e.handleEvent("onload",e.handleMount)},teardown:function(e){e.removeEvent("DOMContentLoaded",e.handleMount),e.removeEvent("onload",e.handleMount)}}},56182:e=>{e.exports={setup:function(e){e.handleEvent("ready",e.handleMount),e.handleEvent("pjax:end",e.handleMount),e.handleEvent("pjax:beforeReplace",e.handleUnmount)},teardown:function(e){e.removeEvent("ready",e.handleMount),e.removeEvent("pjax:end",e.handleMount),e.removeEvent("pjax:beforeReplace",e.handleUnmount)}}},78436:e=>{e.exports={setup:function(e){e.handleEvent("turbolinks:load",e.handleMount),e.handleEvent("turbolinks:before-render",e.handleUnmount)},teardown:function(e){e.removeEvent("turbolinks:load",e.handleMount),e.removeEvent("turbolinks:before-render",e.handleUnmount)}}},21986:e=>{e.exports={setup:function(e){e.handleEvent(Turbolinks.EVENTS.CHANGE,e.handleMount),e.handleEvent(Turbolinks.EVENTS.BEFORE_UNLOAD,e.handleUnmount)},teardown:function(e){e.removeEvent(Turbolinks.EVENTS.CHANGE,e.handleMount),e.removeEvent(Turbolinks.EVENTS.BEFORE_UNLOAD,e.handleUnmount)}}},96295:e=>{e.exports={setup:function(e){Turbolinks.pagesCached(0),e.handleEvent("page:change",e.handleMount),e.handleEvent("page:receive",e.handleUnmount)},teardown:function(e){e.removeEvent("page:change",e.handleMount),e.removeEvent("page:receive",e.handleUnmount)}}},39545:function(module){var topLevel="undefined"==typeof window?this:window;module.exports=function(className){var constructor;return constructor=topLevel[className],constructor||(constructor=eval(className)),constructor&&constructor.default&&(constructor=constructor.default),constructor}},66148:e=>{e.exports=function(e){return function(t){var r=t.split("."),n=r.shift(),i=r,s=e("./"+n);return i.forEach((function(e){s=s[e]})),s.__esModule&&(s=s.default),s}}},333:(e,t,r)=>{var n=r(39545),i=r(66148);e.exports=function(e){var t=i(e);return function(e){var r;try{r=t(e)}catch(t){try{r=n(e)}catch(e){console.error(t),console.error(e)}}return r}}},5910:(e,t,r)=>{"use strict";var n=r(70630),i=r(52991),s=r(84306);e.exports=function(e){e.sort(i);for(var t=e.length,r=0,o=0;o<t;++o){var a=e[o],l=s(a);if(0!==l){if(r>0){var c=e[r-1];if(0===n(a,c)&&s(c)!==l){r-=1;continue}}e[r++]=a}}return e.length=r,e}},69414:e=>{var t=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},s="function"==typeof Symbol?Symbol:{},o=s.iterator||"@@iterator",a=s.asyncIterator||"@@asyncIterator",l=s.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function u(e,t,r,n){var s=t&&t.prototype instanceof Generator?t:Generator,o=Object.create(s.prototype),a=new Context(n||[]);return i(o,"_invoke",{value:w(e,r,a)}),o}function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var h="suspendedStart",p="suspendedYield",m="executing",f="completed",g={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var y={};c(y,o,(function(){return this}));var b=Object.getPrototypeOf,v=b&&b(b(z([])));v&&v!==r&&n.call(v,o)&&(y=v);var _=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(y);function x(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function AsyncIterator(e,t){function r(i,s,o,a){var l=d(e[i],e,s);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==typeof u&&n.call(u,"__await")?t.resolve(u.__await).then((function(e){r("next",e,o,a)}),(function(e){r("throw",e,o,a)})):t.resolve(u).then((function(e){c.value=e,o(c)}),(function(e){return r("throw",e,o,a)}))}a(l.arg)}var s;i(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,i){r(e,n,t,i)}))}return s=s?s.then(i,i):i()}})}function w(e,r,n){var i=h;return function(s,o){if(i===m)throw new Error("Generator is already running");if(i===f){if("throw"===s)throw o;return{value:t,done:!0}}for(n.method=s,n.arg=o;;){var a=n.delegate;if(a){var l=R(a,n);if(l){if(l===g)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=f,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=m;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?f:p,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=f,n.method="throw",n.arg=c.arg)}}}function R(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,R(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var s=d(i,e.iterator,r.arg);if("throw"===s.type)return r.method="throw",r.arg=s.arg,r.delegate=null,g;var o=s.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function j(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function Context(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function z(e){if(null!=e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return s.next=s}}throw new TypeError(typeof e+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,i(_,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),i(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=c(GeneratorFunctionPrototype,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===GeneratorFunction||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,c(e,l,"GeneratorFunction")),e.prototype=Object.create(_),e},e.awrap=function(e){return{__await:e}},x(AsyncIterator.prototype),c(AsyncIterator.prototype,a,(function(){return this})),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,i,s){void 0===s&&(s=Promise);var o=new AsyncIterator(u(t,r,n,i),s);return e.isGeneratorFunction(r)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},x(_),c(_,l,"Generator"),c(_,o,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=z,Context.prototype={constructor:Context,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return a.type="throw",a.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var s=this.tryEntries.length-1;s>=0;--s){var o=this.tryEntries[s],a=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var s=i;break}}s&&("break"===e||"continue"===e)&&s.tryLoc<=t&&t<=s.finallyLoc&&(s=null);var o=s?s.completion:{};return o.type=e,o.arg=t,s?(this.method="next",this.next=s.finallyLoc,g):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),j(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;j(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:z(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},81797:(e,t)=>{"use strict";var r,n,i,s;if("object"==typeof performance&&"function"==typeof performance.now){var o=performance;t.unstable_now=function(){return o.now()}}else{var a=Date,l=a.now();t.unstable_now=function(){return a.now()-l}}if("undefined"==typeof window||"function"!=typeof MessageChannel){var c=null,u=null,d=function(){if(null!==c)try{var e=t.unstable_now();c(!0,e),c=null}catch(e){throw setTimeout(d,0),e}};r=function(e){null!==c?setTimeout(r,0,e):(c=e,setTimeout(d,0))},n=function(e,t){u=setTimeout(e,t)},i=function(){clearTimeout(u)},t.unstable_shouldYield=function(){return!1},s=t.unstable_forceFrameRate=function(){}}else{var h=window.setTimeout,p=window.clearTimeout;if("undefined"!=typeof console){var m=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),"function"!=typeof m&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var f=!1,g=null,y=-1,b=5,v=0;t.unstable_shouldYield=function(){return t.unstable_now()>=v},s=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):b=0<e?Math.floor(1e3/e):5};var _=new MessageChannel,x=_.port2;_.port1.onmessage=function(){if(null!==g){var e=t.unstable_now();v=e+b;try{g(!0,e)?x.postMessage(null):(f=!1,g=null)}catch(e){throw x.postMessage(null),e}}else f=!1},r=function(e){g=e,f||(f=!0,x.postMessage(null))},n=function(e,r){y=h((function(){e(t.unstable_now())}),r)},i=function(){p(y),y=-1}}function H(e,t){var r=e.length;e.push(t);e:for(;;){var n=r-1>>>1,i=e[n];if(!(void 0!==i&&0<I(i,t)))break e;e[n]=t,e[r]=i,r=n}}function J(e){return void 0===(e=e[0])?null:e}function K(e){var t=e[0];if(void 0!==t){var r=e.pop();if(r!==t){e[0]=r;e:for(var n=0,i=e.length;n<i;){var s=2*(n+1)-1,o=e[s],a=s+1,l=e[a];if(void 0!==o&&0>I(o,r))void 0!==l&&0>I(l,o)?(e[n]=l,e[a]=r,n=a):(e[n]=o,e[s]=r,n=s);else{if(!(void 0!==l&&0>I(l,r)))break e;e[n]=l,e[a]=r,n=a}}}return t}return null}function I(e,t){var r=e.sortIndex-t.sortIndex;return 0!==r?r:e.id-t.id}var w=[],R=[],k=1,j=null,z=3,q=!1,$=!1,Z=!1;function T(e){for(var t=J(R);null!==t;){if(null===t.callback)K(R);else{if(!(t.startTime<=e))break;K(R),t.sortIndex=t.expirationTime,H(w,t)}t=J(R)}}function U(e){if(Z=!1,T(e),!$)if(null!==J(w))$=!0,r(V);else{var t=J(R);null!==t&&n(U,t.startTime-e)}}function V(e,r){$=!1,Z&&(Z=!1,i()),q=!0;var s=z;try{for(T(r),j=J(w);null!==j&&(!(j.expirationTime>r)||e&&!t.unstable_shouldYield());){var o=j.callback;if("function"==typeof o){j.callback=null,z=j.priorityLevel;var a=o(j.expirationTime<=r);r=t.unstable_now(),"function"==typeof a?j.callback=a:j===J(w)&&K(w),T(r)}else K(w);j=J(w)}if(null!==j)var l=!0;else{var c=J(R);null!==c&&n(U,c.startTime-r),l=!1}return l}finally{j=null,z=s,q=!1}}var X=s;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){$||q||($=!0,r(V))},t.unstable_getCurrentPriorityLevel=function(){return z},t.unstable_getFirstCallbackNode=function(){return J(w)},t.unstable_next=function(e){switch(z){case 1:case 2:case 3:var t=3;break;default:t=z}var r=z;z=t;try{return e()}finally{z=r}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=X,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=z;z=e;try{return t()}finally{z=r}},t.unstable_scheduleCallback=function(e,s,o){var a=t.unstable_now();switch("object"==typeof o&&null!==o?o="number"==typeof(o=o.delay)&&0<o?a+o:a:o=a,e){case 1:var l=-1;break;case 2:l=250;break;case 5:l=1073741823;break;case 4:l=1e4;break;default:l=5e3}return e={id:k++,callback:s,priorityLevel:e,startTime:o,expirationTime:l=o+l,sortIndex:-1},o>a?(e.sortIndex=o,H(R,e),null===J(w)&&e===J(R)&&(Z?i():Z=!0,n(U,o-a))):(e.sortIndex=l,H(w,e),$||q||($=!0,r(V))),e},t.unstable_wrapCallback=function(e){var t=z;return function(){var r=z;z=t;try{return e.apply(this,arguments)}finally{z=r}}}},15488:(e,t,r)=>{"use strict";e.exports=r(81797)},85817:(e,t,r)=>{var n=r(70574),i=r(50283),s=r(7549),o=r(95325),a=r(55283),l=r(31571),c=r(91147);c.alea=n,c.xor128=i,c.xorwow=s,c.xorshift7=o,c.xor4096=a,c.tychei=l,e.exports=c},70574:function(e,t,r){var n;!function(i,s,o){function Alea(e){var t=this,r=function(){var e=4022871197,t=function(t){t=String(t);for(var r=0;r<t.length;r++){var n=.02519603282416938*(e+=t.charCodeAt(r));n-=e=n>>>0,e=(n*=e)>>>0,e+=4294967296*(n-=e)}return 2.3283064365386963e-10*(e>>>0)};return t}();t.next=function(){var e=2091639*t.s0+2.3283064365386963e-10*t.c;return t.s0=t.s1,t.s1=t.s2,t.s2=e-(t.c=0|e)},t.c=1,t.s0=r(" "),t.s1=r(" "),t.s2=r(" "),t.s0-=r(e),t.s0<0&&(t.s0+=1),t.s1-=r(e),t.s1<0&&(t.s1+=1),t.s2-=r(e),t.s2<0&&(t.s2+=1),r=null}function a(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function l(e,t){var r=new Alea(e),n=t&&t.state,i=r.next;return i.int32=function(){return 4294967296*r.next()|0},i.double=function(){return i()+11102230246251565e-32*(2097152*i()|0)},i.quick=i,n&&("object"==typeof n&&a(n,r),i.state=function(){return a(r,{})}),i}s&&s.exports?s.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,e))||(e.exports=n):this.alea=l}(0,e=r.nmd(e),r.amdD)},31571:function(e,t,r){var n;!function(i,s,o){function XorGen(e){var t=this,r="";t.next=function(){var e=t.b,r=t.c,n=t.d,i=t.a;return e=e<<25^e>>>7^r,r=r-n|0,n=n<<24^n>>>8^i,i=i-e|0,t.b=e=e<<20^e>>>12^r,t.c=r=r-n|0,t.d=n<<16^r>>>16^i,t.a=i-e|0},t.a=0,t.b=0,t.c=-1640531527,t.d=1367130551,e===Math.floor(e)?(t.a=e/4294967296|0,t.b=0|e):r+=e;for(var n=0;n<r.length+20;n++)t.b^=0|r.charCodeAt(n),t.next()}function a(e,t){return t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t}function l(e,t){var r=new XorGen(e),n=t&&t.state,i=function(){return(r.next()>>>0)/4294967296};return i.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=r.next,i.quick=i,n&&("object"==typeof n&&a(n,r),i.state=function(){return a(r,{})}),i}s&&s.exports?s.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,e))||(e.exports=n):this.tychei=l}(0,e=r.nmd(e),r.amdD)},50283:function(e,t,r){var n;!function(i,s,o){function XorGen(e){var t=this,r="";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:r+=e;for(var n=0;n<r.length+64;n++)t.x^=0|r.charCodeAt(n),t.next()}function a(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t}function l(e,t){var r=new XorGen(e),n=t&&t.state,i=function(){return(r.next()>>>0)/4294967296};return i.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=r.next,i.quick=i,n&&("object"==typeof n&&a(n,r),i.state=function(){return a(r,{})}),i}s&&s.exports?s.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,e))||(e.exports=n):this.xor128=l}(0,e=r.nmd(e),r.amdD)},55283:function(e,t,r){var n;!function(i,s,o){function XorGen(e){var t=this;t.next=function(){var e,r,n=t.w,i=t.X,s=t.i;return t.w=n=n+1640531527|0,r=i[s+34&127],e=i[s=s+1&127],r^=r<<13,e^=e<<17,r^=r>>>15,e^=e>>>12,r=i[s]=r^e,t.i=s,r+(n^n>>>16)|0},function(e,t){var r,n,i,s,o,a=[],l=128;for(t===(0|t)?(n=t,t=null):(t+="\0",n=0,l=Math.max(l,t.length)),i=0,s=-32;s<l;++s)t&&(n^=t.charCodeAt((s+32)%t.length)),0===s&&(o=n),n^=n<<10,n^=n>>>15,n^=n<<4,n^=n>>>13,s>=0&&(o=o+1640531527|0,i=0==(r=a[127&s]^=n+o)?i+1:0);for(i>=128&&(a[127&(t&&t.length||0)]=-1),i=127,s=512;s>0;--s)n=a[i+34&127],r=a[i=i+1&127],n^=n<<13,r^=r<<17,n^=n>>>15,r^=r>>>12,a[i]=n^r;e.w=o,e.X=a,e.i=i}(t,e)}function a(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function l(e,t){null==e&&(e=+new Date);var r=new XorGen(e),n=t&&t.state,i=function(){return(r.next()>>>0)/4294967296};return i.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=r.next,i.quick=i,n&&(n.X&&a(n,r),i.state=function(){return a(r,{})}),i}s&&s.exports?s.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,e))||(e.exports=n):this.xor4096=l}(0,e=r.nmd(e),r.amdD)},95325:function(e,t,r){var n;!function(i,s,o){function XorGen(e){var t=this;t.next=function(){var e,r,n=t.x,i=t.i;return e=n[i],r=(e^=e>>>7)^e<<24,r^=(e=n[i+1&7])^e>>>10,r^=(e=n[i+3&7])^e>>>3,r^=(e=n[i+4&7])^e<<7,e=n[i+7&7],r^=(e^=e<<13)^e<<9,n[i]=r,t.i=i+1&7,r},function(e,t){var r,n=[];if(t===(0|t))n[0]=t;else for(t=""+t,r=0;r<t.length;++r)n[7&r]=n[7&r]<<15^t.charCodeAt(r)+n[r+1&7]<<13;for(;n.length<8;)n.push(0);for(r=0;r<8&&0===n[r];++r);for(8==r?n[7]=-1:n[r],e.x=n,e.i=0,r=256;r>0;--r)e.next()}(t,e)}function a(e,t){return t.x=e.x.slice(),t.i=e.i,t}function l(e,t){null==e&&(e=+new Date);var r=new XorGen(e),n=t&&t.state,i=function(){return(r.next()>>>0)/4294967296};return i.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=r.next,i.quick=i,n&&(n.x&&a(n,r),i.state=function(){return a(r,{})}),i}s&&s.exports?s.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,e))||(e.exports=n):this.xorshift7=l}(0,e=r.nmd(e),r.amdD)},7549:function(e,t,r){var n;!function(i,s,o){function XorGen(e){var t=this,r="";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,t.v=0,e===(0|e)?t.x=e:r+=e;for(var n=0;n<r.length+64;n++)t.x^=0|r.charCodeAt(n),n==r.length&&(t.d=t.x<<10^t.x>>>4),t.next()}function a(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function l(e,t){var r=new XorGen(e),n=t&&t.state,i=function(){return(r.next()>>>0)/4294967296};return i.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=r.next,i.quick=i,n&&("object"==typeof n&&a(n,r),i.state=function(){return a(r,{})}),i}s&&s.exports?s.exports=l:r.amdD&&r.amdO?void 0===(n=function(){return l}.call(t,r,t,e))||(e.exports=n):this.xorwow=l}(0,e=r.nmd(e),r.amdD)},91147:function(e,t,r){var n;!function(i,s,o){var a,l=256,c=o.pow(l,6),u=o.pow(2,52),d=2*u,h=l-1;function p(e,t,r){var n=[],h=g(f((t=1==t?{entropy:!0}:t||{}).entropy?[e,y(s)]:null==e?function(){try{var e;return a&&(e=a.randomBytes)?e=e(l):(e=new Uint8Array(l),(i.crypto||i.msCrypto).getRandomValues(e)),y(e)}catch(e){var t=i.navigator,r=t&&t.plugins;return[+new Date,i,r,i.screen,y(s)]}}():e,3),n),p=new ARC4(n),b=function(){for(var e=p.g(6),t=c,r=0;e<u;)e=(e+r)*l,t*=l,r=p.g(1);for(;e>=d;)e/=2,t/=2,r>>>=1;return(e+r)/t};return b.int32=function(){return 0|p.g(4)},b.quick=function(){return p.g(4)/4294967296},b.double=b,g(y(p.S),s),(t.pass||r||function(e,t,r,n){return n&&(n.S&&m(n,p),e.state=function(){return m(p,{})}),r?(o.random=e,t):e})(b,h,"global"in t?t.global:this==o,t.state)}function ARC4(e){var t,r=e.length,n=this,i=0,s=n.i=n.j=0,o=n.S=[];for(r||(e=[r++]);i<l;)o[i]=i++;for(i=0;i<l;i++)o[i]=o[s=h&s+e[i%r]+(t=o[i])],o[s]=t;(n.g=function(e){for(var t,r=0,i=n.i,s=n.j,o=n.S;e--;)t=o[i=h&i+1],r=r*l+o[h&(o[i]=o[s=h&s+t])+(o[s]=t)];return n.i=i,n.j=s,r})(l)}function m(e,t){return t.i=e.i,t.j=e.j,t.S=e.S.slice(),t}function f(e,t){var r,n=[],i=typeof e;if(t&&"object"==i)for(r in e)try{n.push(f(e[r],t-1))}catch(e){}return n.length?n:"string"==i?e:e+"\0"}function g(e,t){for(var r,n=e+"",i=0;i<n.length;)t[h&i]=h&(r^=19*t[h&i])+n.charCodeAt(i++);return y(t)}function y(e){return String.fromCharCode.apply(0,e)}if(g(o.random(),s),e.exports){e.exports=p;try{a=r(41234)}catch(e){}}else void 0===(n=function(){return p}.call(t,r,t,e))||(e.exports=n)}("undefined"!=typeof self?self:this,[],Math)},39271:(e,t,r)=>{"use strict";var n=r(77664),i=r(88839),s=r(16402)(),o=r(81909),a=r(58921),l=n("%Math.floor%");e.exports=function(e,t){if("function"!=typeof e)throw new a("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||l(t)!==t)throw new a("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,c=!0;if("length"in e&&o){var u=o(e,"length");u&&!u.configurable&&(n=!1),u&&!u.writable&&(c=!1)}return(n||c||!r)&&(s?i(e,"length",t,!0,!0):i(e,"length",t)),e}},99970:(e,t,r)=>{"use strict";e.exports=function(e){return i(n(e))};var n=r(54843),i=r(5910)},38129:(e,t,r)=>{var n;!function(){"use strict";function i(e,t,r){var n=t.x,i=t.y,s=r.x-n,o=r.y-i;if(0!==s||0!==o){var a=((e.x-n)*s+(e.y-i)*o)/(s*s+o*o);a>1?(n=r.x,i=r.y):a>0&&(n+=s*a,i+=o*a)}return(s=e.x-n)*s+(o=e.y-i)*o}function s(e,t,r,n,o){for(var a,l=n,c=t+1;c<r;c++){var u=i(e[c],e[t],e[r]);u>l&&(a=c,l=u)}l>n&&(a-t>1&&s(e,t,a,n,o),o.push(e[a]),r-a>1&&s(e,a,r,n,o))}function o(e,t){var r=e.length-1,n=[e[0]];return s(e,0,r,t,n),n.push(e[r]),n}function a(e,t,r){if(e.length<=2)return e;var n=void 0!==t?t*t:1;return e=r?e:function(e,t){for(var r,n,i,s,o,a=e[0],l=[a],c=1,u=e.length;c<u;c++)r=e[c],i=a,s=void 0,o=void 0,s=(n=r).x-i.x,o=n.y-i.y,s*s+o*o>t&&(l.push(r),a=r);return a!==r&&l.push(r),l}(e,n),e=o(e,n)}void 0===(n=function(){return a}.call(t,r,t,e))||(e.exports=n)}()},5994:e=>{function E(){}E.prototype={on:function(e,t,r){var n=this.e||(this.e={});return(n[e]||(n[e]=[])).push({fn:t,ctx:r}),this},once:function(e,t,r){var n=this;function i(){n.off(e,i),t.apply(r,arguments)}return i._=t,this.on(e,i,r)},emit:function(e){for(var t=[].slice.call(arguments,1),r=((this.e||(this.e={}))[e]||[]).slice(),n=0,i=r.length;n<i;n++)r[n].fn.apply(r[n].ctx,t);return this},off:function(e,t){var r=this.e||(this.e={}),n=r[e],i=[];if(n&&t)for(var s=0,o=n.length;s<o;s++)n[s].fn!==t&&n[s].fn._!==t&&i.push(n[s]);return i.length?r[e]=i:delete r[e],this}},e.exports=E,e.exports.TinyEmitter=E},64457:function(e){e.exports=function(){"use strict";function e(e,t){e.split(/\s+/).forEach((e=>{t(e)}))}class MicroEvent{constructor(){this._events=void 0,this._events={}}on(t,r){e(t,(e=>{this._events[e]=this._events[e]||[],this._events[e].push(r)}))}off(t,r){var n=arguments.length;0!==n?e(t,(e=>{if(1===n)return delete this._events[e];e in this._events!=0&&this._events[e].splice(this._events[e].indexOf(r),1)})):this._events={}}trigger(t,...r){var n=this;e(t,(e=>{if(e in n._events!=0)for(let t of n._events[e])t.apply(n,r)}))}}function MicroPlugin(e){return e.plugins={},class extends e{constructor(...e){super(...e),this.plugins={names:[],settings:{},requested:{},loaded:{}}}static define(t,r){e.plugins[t]={name:t,fn:r}}initializePlugins(e){var t,r;const n=this,i=[];if(Array.isArray(e))e.forEach((e=>{"string"==typeof e?i.push(e):(n.plugins.settings[e.name]=e.options,i.push(e.name))}));else if(e)for(t in e)e.hasOwnProperty(t)&&(n.plugins.settings[t]=e[t],i.push(t));for(;r=i.shift();)n.require(r)}loadPlugin(t){var r=this,n=r.plugins,i=e.plugins[t];if(!e.plugins.hasOwnProperty(t))throw new Error('Unable to find "'+t+'" plugin');n.requested[t]=!0,n.loaded[t]=i.fn.apply(r,[r.plugins.settings[t]||{}]),n.names.push(t)}require(e){var t=this,r=t.plugins;if(!t.plugins.loaded.hasOwnProperty(e)){if(r.requested[e])throw new Error('Plugin has circular dependency ("'+e+'")');t.loadPlugin(e)}return r.loaded[e]}}}var t;const r="[̀-ͯ·ʾ]",n=new RegExp(r,"gu");var i;const s={æ:"ae",ⱥ:"a",ø:"o"},o=new RegExp(Object.keys(s).join("|"),"gu"),a=[[0,65535]],l=e=>e.normalize("NFKD").replace(n,"").toLowerCase().replace(o,(function(e){return s[e]})),c=(e,t="|")=>{if(1==e.length)return e[0];var r=1;return e.forEach((e=>{r=Math.max(r,e.length)})),1==r?"["+e.join("")+"]":"(?:"+e.join(t)+")"},u=e=>{const t=e.map((e=>y(e)));return c(t)},d=e=>{if(1===e.length)return[[e]];var t=[];return d(e.substring(1)).forEach((function(r){var n=r.slice(0);n[0]=e.charAt(0)+n[0],t.push(n),(n=r.slice(0)).unshift(e.charAt(0)),t.push(n)})),t},h=e=>{var n={};e.forEach((e=>{for(let r=e[0];r<=e[1];r++){let e=String.fromCharCode(r),i=l(e);if(i!=e.toLowerCase()&&!(i.length>3)){i in n||(n[i]=[i]);var t=new RegExp(u(n[i]),"iu");e.match(t)||n[i].push(e)}}}));let i=Object.keys(n);for(let e=0;e<i.length;e++){const t=i[e];n[t].length<2&&delete n[t]}i=Object.keys(n).sort(((e,t)=>t.length-e.length)),t=new RegExp("("+u(i)+r+"*)","gu");var s={};return i.sort(((e,t)=>e.length-t.length)).forEach((e=>{var t=d(e).map((e=>(e=e.map((e=>n.hasOwnProperty(e)?u(n[e]):e)),c(e,""))));s[e]=c(t)})),s},p=e=>(void 0===i&&(i=h(a)),e.normalize("NFKD").toLowerCase().split(t).map((e=>{const t=l(e);return""==t?"":i.hasOwnProperty(t)?i[t]:e})).join("")),m=(e,t)=>{if(e)return e[t]},f=(e,t)=>{if(e){for(var r,n=t.split(".");(r=n.shift())&&(e=e[r]););return e}},g=(e,t,r)=>{var n,i;return e?-1===(i=(e+="").search(t.regex))?0:(n=t.string.length/e.length,0===i&&(n+=.5),n*r):0},y=e=>(e+"").replace(/([\$\(-\+\.\?\[-\^\{-\}])/g,"\\$1"),b=(e,t)=>{var r=e[t];if("function"==typeof r)return r;r&&!Array.isArray(r)&&(e[t]=[r])},v=(e,t)=>{if(Array.isArray(e))e.forEach(t);else for(var r in e)e.hasOwnProperty(r)&&t(e[r],r)},_=(e,t)=>"number"==typeof e&&"number"==typeof t?e>t?1:e<t?-1:0:(e=l(e+"").toLowerCase())>(t=l(t+"").toLowerCase())?1:t>e?-1:0;class Sifter{constructor(e,t){this.items=void 0,this.settings=void 0,this.items=e,this.settings=t||{diacritics:!0}}tokenize(e,t,r){if(!e||!e.length)return[];const n=[],i=e.split(/\s+/);var s;return r&&(s=new RegExp("^("+Object.keys(r).map(y).join("|")+"):(.*)$")),i.forEach((e=>{let r,i=null,o=null;s&&(r=e.match(s))&&(i=r[1],e=r[2]),e.length>0&&(o=this.settings.diacritics?p(e):y(e),t&&(o="\\b"+o)),n.push({string:e,regex:o?new RegExp(o,"iu"):null,field:i})})),n}getScoreFunction(e,t){var r=this.prepareSearch(e,t);return this._getScoreFunction(r)}_getScoreFunction(e){const t=e.tokens,r=t.length;if(!r)return function(){return 0};const n=e.options.fields,i=e.weights,s=n.length,o=e.getAttrFn;if(!s)return function(){return 1};const a=1===s?function(e,t){const r=n[0].field;return g(o(t,r),e,i[r])}:function(e,t){var r=0;if(e.field){const n=o(t,e.field);!e.regex&&n?r+=1/s:r+=g(n,e,1)}else v(i,((n,i)=>{r+=g(o(t,i),e,n)}));return r/s};return 1===r?function(e){return a(t[0],e)}:"and"===e.options.conjunction?function(e){for(var n,i=0,s=0;i<r;i++){if((n=a(t[i],e))<=0)return 0;s+=n}return s/r}:function(e){var n=0;return v(t,(t=>{n+=a(t,e)})),n/r}}getSortFunction(e,t){var r=this.prepareSearch(e,t);return this._getSortFunction(r)}_getSortFunction(e){var t,r,n;const i=this,s=e.options,o=!e.query&&s.sort_empty?s.sort_empty:s.sort,a=[],l=[];if("function"==typeof o)return o.bind(this);const c=function(t,r){return"$score"===t?r.score:e.getAttrFn(i.items[r.id],t)};if(o)for(t=0,r=o.length;t<r;t++)(e.query||"$score"!==o[t].field)&&a.push(o[t]);if(e.query){for(n=!0,t=0,r=a.length;t<r;t++)if("$score"===a[t].field){n=!1;break}n&&a.unshift({field:"$score",direction:"desc"})}else for(t=0,r=a.length;t<r;t++)if("$score"===a[t].field){a.splice(t,1);break}for(t=0,r=a.length;t<r;t++)l.push("desc"===a[t].direction?-1:1);const u=a.length;if(u){if(1===u){const e=a[0].field,t=l[0];return function(r,n){return t*_(c(e,r),c(e,n))}}return function(e,t){var r,n,i;for(r=0;r<u;r++)if(i=a[r].field,n=l[r]*_(c(i,e),c(i,t)))return n;return 0}}return null}prepareSearch(e,t){const r={};var n=Object.assign({},t);if(b(n,"sort"),b(n,"sort_empty"),n.fields){b(n,"fields");const e=[];n.fields.forEach((t=>{"string"==typeof t&&(t={field:t,weight:1}),e.push(t),r[t.field]="weight"in t?t.weight:1})),n.fields=e}return{options:n,query:e.toLowerCase().trim(),tokens:this.tokenize(e,n.respect_word_boundaries,r),total:0,items:[],weights:r,getAttrFn:n.nesting?f:m}}search(e,t){var r,n,i=this;n=this.prepareSearch(e,t),t=n.options,e=n.query;const s=t.score||i._getScoreFunction(n);e.length?v(i.items,((e,i)=>{r=s(e),(!1===t.filter||r>0)&&n.items.push({score:r,id:i})})):v(i.items,((e,t)=>{n.items.push({score:1,id:t})}));const o=i._getSortFunction(n);return o&&n.items.sort(o),n.total=n.items.length,"number"==typeof t.limit&&(n.items=n.items.slice(0,t.limit)),n}}const x=e=>{if(e.jquery)return e[0];if(e instanceof HTMLElement)return e;if(w(e)){let t=document.createElement("div");return t.innerHTML=e.trim(),t.firstChild}return document.querySelector(e)},w=e=>"string"==typeof e&&e.indexOf("<")>-1,R=e=>e.replace(/['"\\]/g,"\\$&"),k=(e,t)=>{var r=document.createEvent("HTMLEvents");r.initEvent(t,!0,!1),e.dispatchEvent(r)},j=(e,t)=>{Object.assign(e.style,t)},z=(e,...t)=>{var r=Z(t);(e=X(e)).map((e=>{r.map((t=>{e.classList.add(t)}))}))},q=(e,...t)=>{var r=Z(t);(e=X(e)).map((e=>{r.map((t=>{e.classList.remove(t)}))}))},Z=e=>{var t=[];return v(e,(e=>{"string"==typeof e&&(e=e.trim().split(/[\11\12\14\15\40]/)),Array.isArray(e)&&(t=t.concat(e))})),t.filter(Boolean)},X=e=>(Array.isArray(e)||(e=[e]),e),Y=(e,t,r)=>{if(!r||r.contains(e))for(;e&&e.matches;){if(e.matches(t))return e;e=e.parentNode}},ee=(e,t=0)=>t>0?e[e.length-1]:e[0],te=e=>0===Object.keys(e).length,re=(e,t)=>{if(!e)return-1;t=t||e.nodeName;for(var r=0;e=e.previousElementSibling;)e.matches(t)&&r++;return r},ne=(e,t)=>{v(t,((t,r)=>{null==t?e.removeAttribute(r):e.setAttribute(r,""+t)}))},ie=(e,t)=>{e.parentNode&&e.parentNode.replaceChild(t,e)},se=(e,t)=>{if(null===t)return;if("string"==typeof t){if(!t.length)return;t=new RegExp(t,"i")}const r=e=>{var r=e.data.match(t);if(r&&e.data.length>0){var n=document.createElement("span");n.className="highlight";var i=e.splitText(r.index);i.splitText(r[0].length);var s=i.cloneNode(!0);return n.appendChild(s),ie(i,n),1}return 0},n=e=>{if(1===e.nodeType&&e.childNodes&&!/(script|style)/i.test(e.tagName)&&("highlight"!==e.className||"SPAN"!==e.tagName))for(var t=0;t<e.childNodes.length;++t)t+=i(e.childNodes[t])},i=e=>3===e.nodeType?r(e):(n(e),0);i(e)},oe=e=>{var t=e.querySelectorAll("span.highlight");Array.prototype.forEach.call(t,(function(e){var t=e.parentNode;t.replaceChild(e.firstChild,e),t.normalize()}))},ae=65,le=13,ce=27,ue=37,de=38,he=39,pe=40,me=8,fe=46,ge=9,ye="undefined"!=typeof navigator&&/Mac/.test(navigator.userAgent)?"metaKey":"ctrlKey";var be={options:[],optgroups:[],plugins:[],delimiter:",",splitOn:null,persist:!0,diacritics:!0,create:null,createOnBlur:!1,createFilter:null,highlight:!0,openOnFocus:!0,shouldOpen:null,maxOptions:50,maxItems:null,hideSelected:null,duplicates:!1,addPrecedence:!1,selectOnTab:!1,preload:null,allowEmptyOption:!1,loadThrottle:300,loadingClass:"loading",dataAttr:null,optgroupField:"optgroup",valueField:"value",labelField:"text",disabledField:"disabled",optgroupLabelField:"label",optgroupValueField:"value",lockOptgroupOrder:!1,sortField:"$order",searchField:["text"],searchConjunction:"and",mode:null,wrapperClass:"ts-wrapper",controlClass:"ts-control",dropdownClass:"ts-dropdown",dropdownContentClass:"ts-dropdown-content",itemClass:"item",optionClass:"option",dropdownParent:null,controlInput:'<input type="text" autocomplete="off" size="1" />',copyClassesToDropdown:!1,placeholder:null,hidePlaceholder:null,shouldLoad:function(e){return e.length>0},render:{}};const ve=e=>null==e?null:_e(e),_e=e=>"boolean"==typeof e?e?"1":"0":e+"",xe=e=>(e+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),we=(e,t)=>{var r;return function(n,i){var s=this;r&&(s.loading=Math.max(s.loading-1,0),clearTimeout(r)),r=setTimeout((function(){r=null,s.loadedSearches[n]=!0,e.call(s,n,i)}),t)}},Se=(e,t,r)=>{var n,i=e.trigger,s={};for(n of(e.trigger=function(){var r=arguments[0];if(-1===t.indexOf(r))return i.apply(e,arguments);s[r]=arguments},r.apply(e,[]),e.trigger=i,t))n in s&&i.apply(e,s[n])},Pe=e=>({start:e.selectionStart||0,length:(e.selectionEnd||0)-(e.selectionStart||0)}),Te=(e,t=!1)=>{e&&(e.preventDefault(),t&&e.stopPropagation())},Re=(e,t,r,n)=>{e.addEventListener(t,r,n)},ke=(e,t)=>!!t&&!!t[e]&&1==(t.altKey?1:0)+(t.ctrlKey?1:0)+(t.shiftKey?1:0)+(t.metaKey?1:0),Ie=(e,t)=>{const r=e.getAttribute("id");return r||(e.setAttribute("id",t),t)},je=e=>e.replace(/[\\"']/g,"\\$&"),He=(e,t)=>{t&&e.append(t)};function ze(e,t){var r=Object.assign({},be,t),n=r.dataAttr,i=r.labelField,s=r.valueField,o=r.disabledField,a=r.optgroupField,l=r.optgroupLabelField,c=r.optgroupValueField,u=e.tagName.toLowerCase(),d=e.getAttribute("placeholder")||e.getAttribute("data-placeholder");if(!d&&!r.allowEmptyOption){let t=e.querySelector('option[value=""]');t&&(d=t.textContent)}var h,p,m,f,g,y,b,_={placeholder:d,options:[],optgroups:[],items:[],maxItems:null},x=()=>{const t=e.getAttribute(n);if(t)_.options=JSON.parse(t),v(_.options,(e=>{_.items.push(e[s])}));else{var o=e.value.trim()||"";if(!r.allowEmptyOption&&!o.length)return;const t=o.split(r.delimiter);v(t,(e=>{const t={};t[i]=e,t[s]=e,_.options.push(t)})),_.items=t}};return"select"===u?(p=_.options,m={},f=1,g=e=>{var t=Object.assign({},e.dataset),r=n&&t[n];return"string"==typeof r&&r.length&&(t=Object.assign(t,JSON.parse(r))),t},y=(e,t)=>{var n=ve(e.value);if(null!=n&&(n||r.allowEmptyOption)){if(m.hasOwnProperty(n)){if(t){var l=m[n][a];l?Array.isArray(l)?l.push(t):m[n][a]=[l,t]:m[n][a]=t}}else{var c=g(e);c[i]=c[i]||e.textContent,c[s]=c[s]||n,c[o]=c[o]||e.disabled,c[a]=c[a]||t,c.$option=e,m[n]=c,p.push(c)}e.selected&&_.items.push(n)}},b=e=>{var t,r;(r=g(e))[l]=r[l]||e.getAttribute("label")||"",r[c]=r[c]||f++,r[o]=r[o]||e.disabled,_.optgroups.push(r),t=r[c],v(e.children,(e=>{y(e,t)}))},_.maxItems=e.hasAttribute("multiple")?null:1,v(e.children,(e=>{"optgroup"===(h=e.tagName.toLowerCase())?b(e):"option"===h&&y(e)}))):x(),Object.assign({},be,_,t)}var Ge=0;class TomSelect2 extends(MicroPlugin(MicroEvent)){constructor(e,t){var r;super(),this.control_input=void 0,this.wrapper=void 0,this.dropdown=void 0,this.control=void 0,this.dropdown_content=void 0,this.focus_node=void 0,this.order=0,this.settings=void 0,this.input=void 0,this.tabIndex=void 0,this.is_select_tag=void 0,this.rtl=void 0,this.inputId=void 0,this._destroy=void 0,this.sifter=void 0,this.isOpen=!1,this.isDisabled=!1,this.isRequired=void 0,this.isInvalid=!1,this.isValid=!0,this.isLocked=!1,this.isFocused=!1,this.isInputHidden=!1,this.isSetup=!1,this.ignoreFocus=!1,this.ignoreHover=!1,this.hasOptions=!1,this.currentResults=void 0,this.lastValue="",this.caretPos=0,this.loading=0,this.loadedSearches={},this.activeOption=null,this.activeItems=[],this.optgroups={},this.options={},this.userOptions={},this.items=[],Ge++;var n=x(e);if(n.tomselect)throw new Error("Tom Select already initialized on this element");n.tomselect=this,r=(window.getComputedStyle&&window.getComputedStyle(n,null)).getPropertyValue("direction");const i=ze(n,t);this.settings=i,this.input=n,this.tabIndex=n.tabIndex||0,this.is_select_tag="select"===n.tagName.toLowerCase(),this.rtl=/rtl/i.test(r),this.inputId=Ie(n,"tomselect-"+Ge),this.isRequired=n.required,this.sifter=new Sifter(this.options,{diacritics:i.diacritics}),i.mode=i.mode||(1===i.maxItems?"single":"multi"),"boolean"!=typeof i.hideSelected&&(i.hideSelected="multi"===i.mode),"boolean"!=typeof i.hidePlaceholder&&(i.hidePlaceholder="multi"!==i.mode);var s=i.createFilter;"function"!=typeof s&&("string"==typeof s&&(s=new RegExp(s)),s instanceof RegExp?i.createFilter=e=>s.test(e):i.createFilter=e=>this.settings.duplicates||!this.options[e]),this.initializePlugins(i.plugins),this.setupCallbacks(),this.setupTemplates();const o=x("<div>"),a=x("<div>"),l=this._render("dropdown"),c=x('<div role="listbox" tabindex="-1">'),u=this.input.getAttribute("class")||"",d=i.mode;var h;z(o,i.wrapperClass,u,d),z(a,i.controlClass),He(o,a),z(l,i.dropdownClass,d),i.copyClassesToDropdown&&z(l,u),z(c,i.dropdownContentClass),He(l,c),x(i.dropdownParent||o).appendChild(l),w(i.controlInput)?(h=x(i.controlInput),v(["autocorrect","autocapitalize","autocomplete"],(e=>{n.getAttribute(e)&&ne(h,{[e]:n.getAttribute(e)})})),h.tabIndex=-1,a.appendChild(h),this.focus_node=h):i.controlInput?(h=x(i.controlInput),this.focus_node=h):(h=x("<input/>"),this.focus_node=a),this.wrapper=o,this.dropdown=l,this.dropdown_content=c,this.control=a,this.control_input=h,this.setup()}setup(){const e=this,t=e.settings,r=e.control_input,n=e.dropdown,i=e.dropdown_content,s=e.wrapper,o=e.control,a=e.input,l=e.focus_node,c={passive:!0},u=e.inputId+"-ts-dropdown";ne(i,{id:u}),ne(l,{role:"combobox","aria-haspopup":"listbox","aria-expanded":"false","aria-controls":u});const d=Ie(l,e.inputId+"-ts-control"),h="label[for='"+R(e.inputId)+"']",p=document.querySelector(h),m=e.focus.bind(e);if(p){Re(p,"click",m),ne(p,{for:d});const t=Ie(p,e.inputId+"-ts-label");ne(l,{"aria-labelledby":t}),ne(i,{"aria-labelledby":t})}if(s.style.width=a.style.width,e.plugins.names.length){const t="plugin-"+e.plugins.names.join(" plugin-");z([s,n],t)}(null===t.maxItems||t.maxItems>1)&&e.is_select_tag&&ne(a,{multiple:"multiple"}),t.placeholder&&ne(r,{placeholder:t.placeholder}),!t.splitOn&&t.delimiter&&(t.splitOn=new RegExp("\\s*"+y(t.delimiter)+"+\\s*")),t.load&&t.loadThrottle&&(t.load=we(t.load,t.loadThrottle)),e.control_input.type=a.type,Re(n,"mouseenter",(t=>{var r=Y(t.target,"[data-selectable]",n);r&&e.onOptionHover(t,r)}),{capture:!0}),Re(n,"click",(t=>{const r=Y(t.target,"[data-selectable]");r&&(e.onOptionSelect(t,r),Te(t,!0))})),Re(o,"click",(t=>{var n=Y(t.target,"[data-ts-item]",o);n&&e.onItemSelect(t,n)?Te(t,!0):""==r.value&&(e.onClick(),Te(t,!0))})),Re(l,"keydown",(t=>e.onKeyDown(t))),Re(r,"keypress",(t=>e.onKeyPress(t))),Re(r,"input",(t=>e.onInput(t))),Re(l,"resize",(()=>e.positionDropdown()),c),Re(l,"blur",(t=>e.onBlur(t))),Re(l,"focus",(t=>e.onFocus(t))),Re(r,"paste",(t=>e.onPaste(t)));const f=t=>{const i=t.composedPath()[0];if(!s.contains(i)&&!n.contains(i))return e.isFocused&&e.blur(),void e.inputState();i==r&&e.isOpen?t.stopPropagation():Te(t,!0)},g=()=>{e.isOpen&&e.positionDropdown()},b=()=>{e.ignoreHover=!1};Re(document,"mousedown",f),Re(window,"scroll",g,c),Re(window,"resize",g,c),Re(window,"mousemove",b,c),this._destroy=()=>{document.removeEventListener("mousedown",f),window.removeEventListener("mousemove",b),window.removeEventListener("scroll",g),window.removeEventListener("resize",g),p&&p.removeEventListener("click",m)},this.revertSettings={innerHTML:a.innerHTML,tabIndex:a.tabIndex},a.tabIndex=-1,a.insertAdjacentElement("afterend",e.wrapper),e.sync(!1),t.items=[],delete t.optgroups,delete t.options,Re(a,"invalid",(t=>{e.isValid&&(e.isValid=!1,e.isInvalid=!0,e.refreshState())})),e.updateOriginalInput(),e.refreshItems(),e.close(!1),e.inputState(),e.isSetup=!0,a.disabled?e.disable():e.enable(),e.on("change",this.onChange),z(a,"tomselected","ts-hidden-accessible"),e.trigger("initialize"),!0===t.preload&&e.preload()}setupOptions(e=[],t=[]){this.addOptions(e),v(t,(e=>{this.registerOptionGroup(e)}))}setupTemplates(){var e=this,t=e.settings.labelField,r=e.settings.optgroupLabelField,n={optgroup:e=>{let t=document.createElement("div");return t.className="optgroup",t.appendChild(e.options),t},optgroup_header:(e,t)=>'<div class="optgroup-header">'+t(e[r])+"</div>",option:(e,r)=>"<div>"+r(e[t])+"</div>",item:(e,r)=>"<div>"+r(e[t])+"</div>",option_create:(e,t)=>'<div class="create">Add <strong>'+t(e.input)+"</strong>&hellip;</div>",no_results:()=>'<div class="no-results">No results found</div>',loading:()=>'<div class="spinner"></div>',not_loading:()=>{},dropdown:()=>"<div></div>"};e.settings.render=Object.assign({},n,e.settings.render)}setupCallbacks(){var e,t,r={initialize:"onInitialize",change:"onChange",item_add:"onItemAdd",item_remove:"onItemRemove",item_select:"onItemSelect",clear:"onClear",option_add:"onOptionAdd",option_remove:"onOptionRemove",option_clear:"onOptionClear",optgroup_add:"onOptionGroupAdd",optgroup_remove:"onOptionGroupRemove",optgroup_clear:"onOptionGroupClear",dropdown_open:"onDropdownOpen",dropdown_close:"onDropdownClose",type:"onType",load:"onLoad",focus:"onFocus",blur:"onBlur"};for(e in r)(t=this.settings[r[e]])&&this.on(e,t)}sync(e=!0){const t=this,r=e?ze(t.input,{delimiter:t.settings.delimiter}):t.settings;t.setupOptions(r.options,r.optgroups),t.setValue(r.items||[],!0),t.lastQuery=null}onClick(){var e=this;if(e.activeItems.length>0)return e.clearActiveItems(),void e.focus();e.isFocused&&e.isOpen?e.blur():e.focus()}onMouseDown(){}onChange(){k(this.input,"input"),k(this.input,"change")}onPaste(e){var t=this;t.isInputHidden||t.isLocked?Te(e):t.settings.splitOn&&setTimeout((()=>{var e=t.inputValue();if(e.match(t.settings.splitOn)){var r=e.trim().split(t.settings.splitOn);v(r,(e=>{e=ve(e),this.options[e]?t.addItem(e):t.createItem(e)}))}}),0)}onKeyPress(e){var t=this;if(!t.isLocked){var r=String.fromCharCode(e.keyCode||e.which);return t.settings.create&&"multi"===t.settings.mode&&r===t.settings.delimiter?(t.createItem(),void Te(e)):void 0}Te(e)}onKeyDown(e){var t=this;if(t.ignoreHover=!0,t.isLocked)e.keyCode!==ge&&Te(e);else{switch(e.keyCode){case ae:if(ke(ye,e)&&""==t.control_input.value)return Te(e),void t.selectAll();break;case ce:return t.isOpen&&(Te(e,!0),t.close()),void t.clearActiveItems();case pe:if(!t.isOpen&&t.hasOptions)t.open();else if(t.activeOption){let e=t.getAdjacent(t.activeOption,1);e&&t.setActiveOption(e)}return void Te(e);case de:if(t.activeOption){let e=t.getAdjacent(t.activeOption,-1);e&&t.setActiveOption(e)}return void Te(e);case le:return void(t.canSelect(t.activeOption)?(t.onOptionSelect(e,t.activeOption),Te(e)):(t.settings.create&&t.createItem()||document.activeElement==t.control_input&&t.isOpen)&&Te(e));case ue:return void t.advanceSelection(-1,e);case he:return void t.advanceSelection(1,e);case ge:return void(t.settings.selectOnTab&&(t.canSelect(t.activeOption)&&(t.onOptionSelect(e,t.activeOption),Te(e)),t.settings.create&&t.createItem()&&Te(e)));case me:case fe:return void t.deleteSelection(e)}t.isInputHidden&&!ke(ye,e)&&Te(e)}}onInput(e){var t=this;if(!t.isLocked){var r=t.inputValue();t.lastValue!==r&&(t.lastValue=r,t.settings.shouldLoad.call(t,r)&&t.load(r),t.refreshOptions(),t.trigger("type",r))}}onOptionHover(e,t){this.ignoreHover||this.setActiveOption(t,!1)}onFocus(e){var t=this,r=t.isFocused;if(t.isDisabled)return t.blur(),void Te(e);t.ignoreFocus||(t.isFocused=!0,"focus"===t.settings.preload&&t.preload(),r||t.trigger("focus"),t.activeItems.length||(t.showInput(),t.refreshOptions(!!t.settings.openOnFocus)),t.refreshState())}onBlur(e){if(!1!==document.hasFocus()){var t=this;if(t.isFocused){t.isFocused=!1,t.ignoreFocus=!1;var r=()=>{t.close(),t.setActiveItem(),t.setCaret(t.items.length),t.trigger("blur")};t.settings.create&&t.settings.createOnBlur?t.createItem(null,!1,r):r()}}}onOptionSelect(e,t){var r,n=this;t.parentElement&&t.parentElement.matches("[data-disabled]")||(t.classList.contains("create")?n.createItem(null,!0,(()=>{n.settings.closeAfterSelect&&n.close()})):void 0!==(r=t.dataset.value)&&(n.lastQuery=null,n.addItem(r),n.settings.closeAfterSelect&&n.close(),!n.settings.hideSelected&&e.type&&/click/.test(e.type)&&n.setActiveOption(t)))}canSelect(e){return!!(this.isOpen&&e&&this.dropdown_content.contains(e))}onItemSelect(e,t){var r=this;return!r.isLocked&&"multi"===r.settings.mode&&(Te(e),r.setActiveItem(t,e),!0)}canLoad(e){return!!this.settings.load&&!this.loadedSearches.hasOwnProperty(e)}load(e){const t=this;if(!t.canLoad(e))return;z(t.wrapper,t.settings.loadingClass),t.loading++;const r=t.loadCallback.bind(t);t.settings.load.call(t,e,r)}loadCallback(e,t){const r=this;r.loading=Math.max(r.loading-1,0),r.lastQuery=null,r.clearActiveOption(),r.setupOptions(e,t),r.refreshOptions(r.isFocused&&!r.isInputHidden),r.loading||q(r.wrapper,r.settings.loadingClass),r.trigger("load",e,t)}preload(){var e=this.wrapper.classList;e.contains("preloaded")||(e.add("preloaded"),this.load(""))}setTextboxValue(e=""){var t=this.control_input;t.value!==e&&(t.value=e,k(t,"update"),this.lastValue=e)}getValue(){return this.is_select_tag&&this.input.hasAttribute("multiple")?this.items:this.items.join(this.settings.delimiter)}setValue(e,t){Se(this,t?[]:["change"],(()=>{this.clear(t),this.addItems(e,t)}))}setMaxItems(e){0===e&&(e=null),this.settings.maxItems=e,this.refreshState()}setActiveItem(e,t){var r,n,i,s,o,a,l=this;if("single"!==l.settings.mode){if(!e)return l.clearActiveItems(),void(l.isFocused&&l.showInput());if("click"===(r=t&&t.type.toLowerCase())&&ke("shiftKey",t)&&l.activeItems.length){for(a=l.getLastActive(),(i=Array.prototype.indexOf.call(l.control.children,a))>(s=Array.prototype.indexOf.call(l.control.children,e))&&(o=i,i=s,s=o),n=i;n<=s;n++)e=l.control.children[n],-1===l.activeItems.indexOf(e)&&l.setActiveItemClass(e);Te(t)}else"click"===r&&ke(ye,t)||"keydown"===r&&ke("shiftKey",t)?e.classList.contains("active")?l.removeActiveItem(e):l.setActiveItemClass(e):(l.clearActiveItems(),l.setActiveItemClass(e));l.hideInput(),l.isFocused||l.focus()}}setActiveItemClass(e){const t=this,r=t.control.querySelector(".last-active");r&&q(r,"last-active"),z(e,"active last-active"),t.trigger("item_select",e),-1==t.activeItems.indexOf(e)&&t.activeItems.push(e)}removeActiveItem(e){var t=this.activeItems.indexOf(e);this.activeItems.splice(t,1),q(e,"active")}clearActiveItems(){q(this.activeItems,"active"),this.activeItems=[]}setActiveOption(e,t=!0){e!==this.activeOption&&(this.clearActiveOption(),e&&(this.activeOption=e,ne(this.focus_node,{"aria-activedescendant":e.getAttribute("id")}),ne(e,{"aria-selected":"true"}),z(e,"active"),t&&this.scrollToOption(e)))}scrollToOption(e,t){if(!e)return;const r=this.dropdown_content,n=r.clientHeight,i=r.scrollTop||0,s=e.offsetHeight,o=e.getBoundingClientRect().top-r.getBoundingClientRect().top+i;o+s>n+i?this.scroll(o-n+s,t):o<i&&this.scroll(o,t)}scroll(e,t){const r=this.dropdown_content;t&&(r.style.scrollBehavior=t),r.scrollTop=e,r.style.scrollBehavior=""}clearActiveOption(){this.activeOption&&(q(this.activeOption,"active"),ne(this.activeOption,{"aria-selected":null})),this.activeOption=null,ne(this.focus_node,{"aria-activedescendant":null})}selectAll(){const e=this;if("single"===e.settings.mode)return;const t=e.controlChildren();t.length&&(e.hideInput(),e.close(),e.activeItems=t,v(t,(t=>{e.setActiveItemClass(t)})))}inputState(){var e=this;e.control.contains(e.control_input)&&(ne(e.control_input,{placeholder:e.settings.placeholder}),e.activeItems.length>0||!e.isFocused&&e.settings.hidePlaceholder&&e.items.length>0?(e.setTextboxValue(),e.isInputHidden=!0):(e.settings.hidePlaceholder&&e.items.length>0&&ne(e.control_input,{placeholder:""}),e.isInputHidden=!1),e.wrapper.classList.toggle("input-hidden",e.isInputHidden))}hideInput(){this.inputState()}showInput(){this.inputState()}inputValue(){return this.control_input.value.trim()}focus(){var e=this;e.isDisabled||(e.ignoreFocus=!0,e.control_input.offsetWidth?e.control_input.focus():e.focus_node.focus(),setTimeout((()=>{e.ignoreFocus=!1,e.onFocus()}),0))}blur(){this.focus_node.blur(),this.onBlur()}getScoreFunction(e){return this.sifter.getScoreFunction(e,this.getSearchOptions())}getSearchOptions(){var e=this.settings,t=e.sortField;return"string"==typeof e.sortField&&(t=[{field:e.sortField}]),{fields:e.searchField,conjunction:e.searchConjunction,sort:t,nesting:e.nesting}}search(e){var t,r,n,i=this,s=this.getSearchOptions();if(i.settings.score&&"function"!=typeof(n=i.settings.score.call(i,e)))throw new Error('Tom Select "score" setting must be a function that returns a function');if(e!==i.lastQuery?(i.lastQuery=e,r=i.sifter.search(e,Object.assign(s,{score:n})),i.currentResults=r):r=Object.assign({},i.currentResults),i.settings.hideSelected)for(t=r.items.length-1;t>=0;t--){let e=ve(r.items[t].id);e&&-1!==i.items.indexOf(e)&&r.items.splice(t,1)}return r}refreshOptions(e=!0){var t,r,n,i,s,o,a,l,c,u,d;const h={},p=[];var m=this,f=m.inputValue(),g=m.search(f),y=null,b=m.settings.shouldOpen||!1,_=m.dropdown_content;for(m.activeOption&&(c=m.activeOption.dataset.value,u=m.activeOption.closest("[data-group]")),i=g.items.length,"number"==typeof m.settings.maxOptions&&(i=Math.min(i,m.settings.maxOptions)),i>0&&(b=!0),t=0;t<i;t++){let e=g.items[t].id,i=m.options[e],a=m.getOption(e,!0);for(m.settings.hideSelected||a.classList.toggle("selected",m.items.includes(e)),s=i[m.settings.optgroupField]||"",r=0,n=(o=Array.isArray(s)?s:[s])&&o.length;r<n;r++)s=o[r],m.optgroups.hasOwnProperty(s)||(s=""),h.hasOwnProperty(s)||(h[s]=document.createDocumentFragment(),p.push(s)),r>0&&(a=a.cloneNode(!0),ne(a,{id:i.$id+"-clone-"+r,"aria-selected":null}),a.classList.add("ts-cloned"),q(a,"active")),y||c!=e||(u?u.dataset.group===s&&(y=a):y=a),h[s].appendChild(a)}this.settings.lockOptgroupOrder&&p.sort(((e,t)=>(m.optgroups[e]&&m.optgroups[e].$order||0)-(m.optgroups[t]&&m.optgroups[t].$order||0))),a=document.createDocumentFragment(),v(p,(e=>{if(m.optgroups.hasOwnProperty(e)&&h[e].children.length){let t=document.createDocumentFragment(),r=m.render("optgroup_header",m.optgroups[e]);He(t,r),He(t,h[e]);let n=m.render("optgroup",{group:m.optgroups[e],options:t});He(a,n)}else He(a,h[e])})),_.innerHTML="",He(_,a),m.settings.highlight&&(oe(_),g.query.length&&g.tokens.length&&v(g.tokens,(e=>{se(_,e.regex)})));var x=e=>{let t=m.render(e,{input:f});return t&&(b=!0,_.insertBefore(t,_.firstChild)),t};if(m.loading?x("loading"):m.settings.shouldLoad.call(m,f)?0===g.items.length&&x("no_results"):x("not_loading"),(l=m.canCreate(f))&&(d=x("option_create")),m.hasOptions=g.items.length>0||l,b){if(g.items.length>0){if(!y&&"single"===m.settings.mode&&m.items.length&&(y=m.getOption(m.items[0])),!_.contains(y)){let e=0;d&&!m.settings.addPrecedence&&(e=1),y=m.selectable()[e]}}else d&&(y=d);e&&!m.isOpen&&(m.open(),m.scrollToOption(y,"auto")),m.setActiveOption(y)}else m.clearActiveOption(),e&&m.isOpen&&m.close(!1)}selectable(){return this.dropdown_content.querySelectorAll("[data-selectable]")}addOption(e,t=!1){const r=this;if(Array.isArray(e))return r.addOptions(e,t),!1;const n=ve(e[r.settings.valueField]);return null!==n&&!r.options.hasOwnProperty(n)&&(e.$order=e.$order||++r.order,e.$id=r.inputId+"-opt-"+e.$order,r.options[n]=e,r.lastQuery=null,t&&(r.userOptions[n]=t,r.trigger("option_add",n,e)),n)}addOptions(e,t=!1){v(e,(e=>{this.addOption(e,t)}))}registerOption(e){return this.addOption(e)}registerOptionGroup(e){var t=ve(e[this.settings.optgroupValueField]);return null!==t&&(e.$order=e.$order||++this.order,this.optgroups[t]=e,t)}addOptionGroup(e,t){var r;t[this.settings.optgroupValueField]=e,(r=this.registerOptionGroup(t))&&this.trigger("optgroup_add",r,t)}removeOptionGroup(e){this.optgroups.hasOwnProperty(e)&&(delete this.optgroups[e],this.clearCache(),this.trigger("optgroup_remove",e))}clearOptionGroups(){this.optgroups={},this.clearCache(),this.trigger("optgroup_clear")}updateOption(e,t){const r=this;var n,i;const s=ve(e),o=ve(t[r.settings.valueField]);if(null===s)return;if(!r.options.hasOwnProperty(s))return;if("string"!=typeof o)throw new Error("Value must be set in option data");const a=r.getOption(s),l=r.getItem(s);if(t.$order=t.$order||r.options[s].$order,delete r.options[s],r.uncacheValue(o),r.options[o]=t,a){if(r.dropdown_content.contains(a)){const e=r._render("option",t);ie(a,e),r.activeOption===a&&r.setActiveOption(e)}a.remove()}l&&(-1!==(i=r.items.indexOf(s))&&r.items.splice(i,1,o),n=r._render("item",t),l.classList.contains("active")&&z(n,"active"),ie(l,n)),r.lastQuery=null}removeOption(e,t){const r=this;e=_e(e),r.uncacheValue(e),delete r.userOptions[e],delete r.options[e],r.lastQuery=null,r.trigger("option_remove",e),r.removeItem(e,t)}clearOptions(e){const t=(e||this.clearFilter).bind(this);this.loadedSearches={},this.userOptions={},this.clearCache();const r={};v(this.options,((e,n)=>{t(e,n)&&(r[n]=this.options[n])})),this.options=this.sifter.items=r,this.lastQuery=null,this.trigger("option_clear")}clearFilter(e,t){return this.items.indexOf(t)>=0}getOption(e,t=!1){const r=ve(e);if(null!==r&&this.options.hasOwnProperty(r)){const e=this.options[r];if(e.$div)return e.$div;if(t)return this._render("option",e)}return null}getAdjacent(e,t,r="option"){var n,i=this;if(!e)return null;n="item"==r?i.controlChildren():i.dropdown_content.querySelectorAll("[data-selectable]");for(let r=0;r<n.length;r++)if(n[r]==e)return t>0?n[r+1]:n[r-1];return null}getItem(e){if("object"==typeof e)return e;var t=ve(e);return null!==t?this.control.querySelector(`[data-value="${je(t)}"]`):null}addItems(e,t){var r=this,n=Array.isArray(e)?e:[e];for(let e=0,i=(n=n.filter((e=>-1===r.items.indexOf(e)))).length;e<i;e++)r.isPending=e<i-1,r.addItem(n[e],t)}addItem(e,t){Se(this,t?[]:["change","dropdown_close"],(()=>{var r,n;const i=this,s=i.settings.mode,o=ve(e);if((!o||-1===i.items.indexOf(o)||("single"===s&&i.close(),"single"!==s&&i.settings.duplicates))&&null!==o&&i.options.hasOwnProperty(o)&&("single"===s&&i.clear(t),"multi"!==s||!i.isFull())){if(r=i._render("item",i.options[o]),i.control.contains(r)&&(r=r.cloneNode(!0)),n=i.isFull(),i.items.splice(i.caretPos,0,o),i.insertAtCaret(r),i.isSetup){if(!i.isPending&&i.settings.hideSelected){let e=i.getOption(o),t=i.getAdjacent(e,1);t&&i.setActiveOption(t)}i.isPending||i.settings.closeAfterSelect||i.refreshOptions(i.isFocused&&"single"!==s),0!=i.settings.closeAfterSelect&&i.isFull()?i.close():i.isPending||i.positionDropdown(),i.trigger("item_add",o,r),i.isPending||i.updateOriginalInput({silent:t})}(!i.isPending||!n&&i.isFull())&&(i.inputState(),i.refreshState())}}))}removeItem(e=null,t){const r=this;if(!(e=r.getItem(e)))return;var n,i;const s=e.dataset.value;n=re(e),e.remove(),e.classList.contains("active")&&(i=r.activeItems.indexOf(e),r.activeItems.splice(i,1),q(e,"active")),r.items.splice(n,1),r.lastQuery=null,!r.settings.persist&&r.userOptions.hasOwnProperty(s)&&r.removeOption(s,t),n<r.caretPos&&r.setCaret(r.caretPos-1),r.updateOriginalInput({silent:t}),r.refreshState(),r.positionDropdown(),r.trigger("item_remove",s,e)}createItem(e=null,t=!0,r=(()=>{})){var n,i=this,s=i.caretPos;if(e=e||i.inputValue(),!i.canCreate(e))return r(),!1;i.lock();var o=!1,a=e=>{if(i.unlock(),!e||"object"!=typeof e)return r();var t=ve(e[i.settings.valueField]);if("string"!=typeof t)return r();i.setTextboxValue(),i.addOption(e,!0),i.setCaret(s),i.addItem(t),r(e),o=!0};return n="function"==typeof i.settings.create?i.settings.create.call(this,e,a):{[i.settings.labelField]:e,[i.settings.valueField]:e},o||a(n),!0}refreshItems(){var e=this;e.lastQuery=null,e.isSetup&&e.addItems(e.items),e.updateOriginalInput(),e.refreshState()}refreshState(){const e=this;e.refreshValidityState();const t=e.isFull(),r=e.isLocked;e.wrapper.classList.toggle("rtl",e.rtl);const n=e.wrapper.classList;n.toggle("focus",e.isFocused),n.toggle("disabled",e.isDisabled),n.toggle("required",e.isRequired),n.toggle("invalid",!e.isValid),n.toggle("locked",r),n.toggle("full",t),n.toggle("input-active",e.isFocused&&!e.isInputHidden),n.toggle("dropdown-active",e.isOpen),n.toggle("has-options",te(e.options)),n.toggle("has-items",e.items.length>0)}refreshValidityState(){var e=this;e.input.validity&&(e.isValid=e.input.validity.valid,e.isInvalid=!e.isValid)}isFull(){return null!==this.settings.maxItems&&this.items.length>=this.settings.maxItems}updateOriginalInput(e={}){const t=this;var r,n;const i=t.input.querySelector('option[value=""]');if(t.is_select_tag){let AddSelected=function(r,n,o){return r||(r=x('<option value="'+xe(n)+'">'+xe(o)+"</option>")),r!=i&&t.input.append(r),e.push(r),(r!=i||s>0)&&(r.selected=!0),r};const e=[],s=t.input.querySelectorAll("option:checked").length;t.input.querySelectorAll("option:checked").forEach((e=>{e.selected=!1})),0==t.items.length&&"single"==t.settings.mode?AddSelected(i,"",""):t.items.forEach((i=>{if(r=t.options[i],n=r[t.settings.labelField]||"",e.includes(r.$option)){const e=t.input.querySelector(`option[value="${je(i)}"]:not(:checked)`);AddSelected(e,i,n)}else r.$option=AddSelected(r.$option,i,n)}))}else t.input.value=t.getValue();t.isSetup&&(e.silent||t.trigger("change",t.getValue()))}open(){var e=this;e.isLocked||e.isOpen||"multi"===e.settings.mode&&e.isFull()||(e.isOpen=!0,ne(e.focus_node,{"aria-expanded":"true"}),e.refreshState(),j(e.dropdown,{visibility:"hidden",display:"block"}),e.positionDropdown(),j(e.dropdown,{visibility:"visible",display:"block"}),e.focus(),e.trigger("dropdown_open",e.dropdown))}close(e=!0){var t=this,r=t.isOpen;e&&(t.setTextboxValue(),"single"===t.settings.mode&&t.items.length&&t.hideInput()),t.isOpen=!1,ne(t.focus_node,{"aria-expanded":"false"}),j(t.dropdown,{display:"none"}),t.settings.hideSelected&&t.clearActiveOption(),t.refreshState(),r&&t.trigger("dropdown_close",t.dropdown)}positionDropdown(){if("body"===this.settings.dropdownParent){var e=this.control,t=e.getBoundingClientRect(),r=e.offsetHeight+t.top+window.scrollY,n=t.left+window.scrollX;j(this.dropdown,{width:t.width+"px",top:r+"px",left:n+"px"})}}clear(e){var t=this;if(t.items.length){var r=t.controlChildren();v(r,(e=>{t.removeItem(e,!0)})),t.showInput(),e||t.updateOriginalInput(),t.trigger("clear")}}insertAtCaret(e){const t=this,r=t.caretPos,n=t.control;n.insertBefore(e,n.children[r]),t.setCaret(r+1)}deleteSelection(e){var t,r,n,i,s=this;t=e&&e.keyCode===me?-1:1,r=Pe(s.control_input);const o=[];if(s.activeItems.length)i=ee(s.activeItems,t),n=re(i),t>0&&n++,v(s.activeItems,(e=>o.push(e)));else if((s.isFocused||"single"===s.settings.mode)&&s.items.length){const e=s.controlChildren();t<0&&0===r.start&&0===r.length?o.push(e[s.caretPos-1]):t>0&&r.start===s.inputValue().length&&o.push(e[s.caretPos])}if(!s.shouldDelete(o,e))return!1;for(Te(e,!0),void 0!==n&&s.setCaret(n);o.length;)s.removeItem(o.pop());return s.showInput(),s.positionDropdown(),s.refreshOptions(!1),!0}shouldDelete(e,t){const r=e.map((e=>e.dataset.value));return!(!r.length||"function"==typeof this.settings.onDelete&&!1===this.settings.onDelete(r,t))}advanceSelection(e,t){var r,n,i=this;i.rtl&&(e*=-1),i.inputValue().length||(ke(ye,t)||ke("shiftKey",t)?(n=(r=i.getLastActive(e))?r.classList.contains("active")?i.getAdjacent(r,e,"item"):r:e>0?i.control_input.nextElementSibling:i.control_input.previousElementSibling)&&(n.classList.contains("active")&&i.removeActiveItem(r),i.setActiveItemClass(n)):i.moveCaret(e))}moveCaret(e){}getLastActive(e){let t=this.control.querySelector(".last-active");if(t)return t;var r=this.control.querySelectorAll(".active");return r?ee(r,e):void 0}setCaret(e){this.caretPos=this.items.length}controlChildren(){return Array.from(this.control.querySelectorAll("[data-ts-item]"))}lock(){this.isLocked=!0,this.refreshState()}unlock(){this.isLocked=!1,this.refreshState()}disable(){var e=this;e.input.disabled=!0,e.control_input.disabled=!0,e.focus_node.tabIndex=-1,e.isDisabled=!0,this.close(),e.lock()}enable(){var e=this;e.input.disabled=!1,e.control_input.disabled=!1,e.focus_node.tabIndex=e.tabIndex,e.isDisabled=!1,e.unlock()}destroy(){var e=this,t=e.revertSettings;e.trigger("destroy"),e.off(),e.wrapper.remove(),e.dropdown.remove(),e.input.innerHTML=t.innerHTML,e.input.tabIndex=t.tabIndex,q(e.input,"tomselected","ts-hidden-accessible"),e._destroy(),delete e.input.tomselect}render(e,t){return"function"!=typeof this.settings.render[e]?null:this._render(e,t)}_render(e,t){var r,n,i="";const s=this;return"option"!==e&&"item"!=e||(i=_e(t[s.settings.valueField])),null==(n=s.settings.render[e].call(this,t,xe))||(n=x(n),"option"===e||"option_create"===e?t[s.settings.disabledField]?ne(n,{"aria-disabled":"true"}):ne(n,{"data-selectable":""}):"optgroup"===e&&(r=t.group[s.settings.optgroupValueField],ne(n,{"data-group":r}),t.group[s.settings.disabledField]&&ne(n,{"data-disabled":""})),"option"!==e&&"item"!==e||(ne(n,{"data-value":i}),"item"===e?(z(n,s.settings.itemClass),ne(n,{"data-ts-item":""})):(z(n,s.settings.optionClass),ne(n,{role:"option",id:t.$id}),s.options[i].$div=n))),n}clearCache(){v(this.options,((e,t)=>{e.$div&&(e.$div.remove(),delete e.$div)}))}uncacheValue(e){const t=this.getOption(e);t&&t.remove()}canCreate(e){return this.settings.create&&e.length>0&&this.settings.createFilter.call(this,e)}hook(e,t,r){var n=this,i=n[t];n[t]=function(){var t,s;return"after"===e&&(t=i.apply(n,arguments)),s=r.apply(n,arguments),"instead"===e?s:("before"===e&&(t=i.apply(n,arguments)),t)}}}function We(){Re(this.input,"change",(()=>{this.sync()}))}function Ve(){var e=this,t=e.onOptionSelect;e.settings.hideSelected=!1;var UpdateCheckbox=function(e){setTimeout((()=>{var t=e.querySelector("input");t instanceof HTMLInputElement&&(e.classList.contains("selected")?t.checked=!0:t.checked=!1)}),1)};e.hook("after","setupTemplates",(()=>{var t=e.settings.render.option;e.settings.render.option=(r,n)=>{var i=x(t.call(e,r,n)),s=document.createElement("input");s.addEventListener("click",(function(e){Te(e)})),s.type="checkbox";const o=ve(r[e.settings.valueField]);return o&&e.items.indexOf(o)>-1&&(s.checked=!0),i.prepend(s),i}})),e.on("item_remove",(t=>{var r=e.getOption(t);r&&(r.classList.remove("selected"),UpdateCheckbox(r))})),e.on("item_add",(t=>{var r=e.getOption(t);r&&UpdateCheckbox(r)})),e.hook("instead","onOptionSelect",((r,n)=>{if(n.classList.contains("selected"))return n.classList.remove("selected"),e.removeItem(n.dataset.value),e.refreshOptions(),void Te(r,!0);t.call(e,r,n),UpdateCheckbox(n)}))}function qe(e){const t=this,r=Object.assign({className:"clear-button",title:"Clear All",html:e=>`<div class="${e.className}" title="${e.title}">&times;</div>`},e);t.on("initialize",(()=>{var e=x(r.html(r));e.addEventListener("click",(e=>{t.isDisabled||(t.clear(),"single"===t.settings.mode&&t.settings.allowEmptyOption&&t.addItem(""),e.preventDefault(),e.stopPropagation())})),t.control.appendChild(e)}))}function $e(){var e=this;if(!$.fn.sortable)throw new Error('The "drag_drop" plugin requires jQuery UI "sortable".');if("multi"===e.settings.mode){var t=e.lock,r=e.unlock;e.hook("instead","lock",(()=>{var r=$(e.control).data("sortable");return r&&r.disable(),t.call(e)})),e.hook("instead","unlock",(()=>{var t=$(e.control).data("sortable");return t&&t.enable(),r.call(e)})),e.on("initialize",(()=>{var t=$(e.control).sortable({items:"[data-value]",forcePlaceholderSize:!0,disabled:e.isLocked,start:(e,r)=>{r.placeholder.css("width",r.helper.css("width")),t.css({overflow:"visible"})},stop:()=>{t.css({overflow:"hidden"});var r=[];t.children("[data-value]").each((function(){this.dataset.value&&r.push(this.dataset.value)})),e.setValue(r)}})}))}}function Xe(e){const t=this,r=Object.assign({title:"Untitled",headerClass:"dropdown-header",titleRowClass:"dropdown-header-title",labelClass:"dropdown-header-label",closeClass:"dropdown-header-close",html:e=>'<div class="'+e.headerClass+'"><div class="'+e.titleRowClass+'"><span class="'+e.labelClass+'">'+e.title+'</span><a class="'+e.closeClass+'">&times;</a></div></div>'},e);t.on("initialize",(()=>{var e=x(r.html(r)),n=e.querySelector("."+r.closeClass);n&&n.addEventListener("click",(e=>{Te(e,!0),t.close()})),t.dropdown.insertBefore(e,t.dropdown.firstChild)}))}function Ye(){var e=this;e.hook("instead","setCaret",(t=>{"single"!==e.settings.mode&&e.control.contains(e.control_input)?(t=Math.max(0,Math.min(e.items.length,t)))==e.caretPos||e.isPending||e.controlChildren().forEach(((r,n)=>{n<t?e.control_input.insertAdjacentElement("beforebegin",r):e.control.appendChild(r)})):t=e.items.length,e.caretPos=t})),e.hook("instead","moveCaret",(t=>{if(!e.isFocused)return;const r=e.getLastActive(t);if(r){const n=re(r);e.setCaret(t>0?n+1:n),e.setActiveItem(),q(r,"last-active")}else e.setCaret(e.caretPos+t)}))}function Qe(){const e=this;e.settings.shouldOpen=!0,e.hook("before","setup",(()=>{e.focus_node=e.control,z(e.control_input,"dropdown-input");const t=x('<div class="dropdown-input-wrap">');t.append(e.control_input),e.dropdown.insertBefore(t,e.dropdown.firstChild);const r=x('<input class="items-placeholder" tabindex="-1" />');r.placeholder=e.settings.placeholder||"",e.control.append(r)})),e.on("initialize",(()=>{e.control_input.addEventListener("keydown",(t=>{switch(t.keyCode){case ce:return e.isOpen&&(Te(t,!0),e.close()),void e.clearActiveItems();case ge:e.focus_node.tabIndex=-1}return e.onKeyDown.call(e,t)})),e.on("blur",(()=>{e.focus_node.tabIndex=e.isDisabled?-1:e.tabIndex})),e.on("dropdown_open",(()=>{e.control_input.focus()}));const t=e.onBlur;e.hook("instead","onBlur",(r=>{if(!r||r.relatedTarget!=e.control_input)return t.call(e)})),Re(e.control_input,"blur",(()=>e.onBlur())),e.hook("before","close",(()=>{e.isOpen&&e.focus_node.focus({preventScroll:!0})}))}))}function et(){var e=this;e.on("initialize",(()=>{var t=document.createElement("span"),r=e.control_input;t.style.cssText="position:absolute; top:-99999px; left:-99999px; width:auto; padding:0; white-space:pre; ",e.wrapper.appendChild(t);var n=["letterSpacing","fontSize","fontFamily","fontWeight","textTransform"];for(const e of n)t.style[e]=r.style[e];var i=()=>{t.textContent=r.value,r.style.width=t.clientWidth+"px"};i(),e.on("update item_add item_remove",i),Re(r,"input",i),Re(r,"keyup",i),Re(r,"blur",i),Re(r,"update",i)}))}function tt(){var e=this,t=e.deleteSelection;this.hook("instead","deleteSelection",(r=>!!e.activeItems.length&&t.call(e,r)))}function rt(){this.hook("instead","setActiveItem",(()=>{})),this.hook("instead","selectAll",(()=>{}))}function nt(){var e=this,t=e.onKeyDown;e.hook("instead","onKeyDown",(r=>{var n,i,s,o;if(!e.isOpen||r.keyCode!==ue&&r.keyCode!==he)return t.call(e,r);e.ignoreHover=!0,o=Y(e.activeOption,"[data-group]"),n=re(e.activeOption,"[data-selectable]"),o&&(o=r.keyCode===ue?o.previousSibling:o.nextSibling)&&(i=(s=o.querySelectorAll("[data-selectable]"))[Math.min(s.length-1,n)])&&e.setActiveOption(i)}))}function it(e){const t=Object.assign({label:"&times;",title:"Remove",className:"remove",append:!0},e);var r=this;if(t.append){var n='<a href="javascript:void(0)" class="'+t.className+'" tabindex="-1" title="'+xe(t.title)+'">'+t.label+"</a>";r.hook("after","setupTemplates",(()=>{var e=r.settings.render.item;r.settings.render.item=(t,i)=>{var s=x(e.call(r,t,i)),o=x(n);return s.appendChild(o),Re(o,"mousedown",(e=>{Te(e,!0)})),Re(o,"click",(e=>{Te(e,!0),r.isLocked||r.shouldDelete([s],e)&&(r.removeItem(s),r.refreshOptions(!1),r.inputState())})),s}}))}}function st(e){const t=this,r=Object.assign({text:e=>e[t.settings.labelField]},e);t.on("item_remove",(function(e){if(t.isFocused&&""===t.control_input.value.trim()){var n=t.options[e];n&&t.setTextboxValue(r.text.call(t,n))}}))}function ot(){const e=this,t=e.canLoad,r=e.clearActiveOption,n=e.loadCallback;var i,s,o={},a=!1,l=[];if(e.settings.shouldLoadMore||(e.settings.shouldLoadMore=()=>{if(i.clientHeight/(i.scrollHeight-i.scrollTop)>.9)return!0;if(e.activeOption){var t=e.selectable();if([...t].indexOf(e.activeOption)>=t.length-2)return!0}return!1}),!e.settings.firstUrl)throw"virtual_scroll plugin requires a firstUrl() method";e.settings.sortField=[{field:"$order"},{field:"$score"}];const c=t=>!("number"==typeof e.settings.maxOptions&&i.children.length>=e.settings.maxOptions||!(t in o)||!o[t]),u=(t,r)=>e.items.indexOf(r)>=0||l.indexOf(r)>=0;e.setNextUrl=(e,t)=>{o[e]=t},e.getUrl=t=>{if(t in o){const e=o[t];return o[t]=!1,e}return o={},e.settings.firstUrl.call(e,t)},e.hook("instead","clearActiveOption",(()=>{if(!a)return r.call(e)})),e.hook("instead","canLoad",(r=>r in o?c(r):t.call(e,r))),e.hook("instead","loadCallback",((t,r)=>{a?s&&t.length>0&&(s.dataset.value=t[0][e.settings.valueField]):e.clearOptions(u),n.call(e,t,r),a=!1})),e.hook("after","refreshOptions",(()=>{const t=e.lastValue;var r;c(t)?(r=e.render("loading_more",{query:t}))&&(r.setAttribute("data-selectable",""),s=r):t in o&&!i.querySelector(".no-results")&&(r=e.render("no_more_results",{query:t})),r&&(z(r,e.settings.optionClass),i.append(r))})),e.on("initialize",(()=>{l=Object.keys(e.options),i=e.dropdown_content,e.settings.render=Object.assign({},{loading_more:()=>'<div class="loading-more-results">Loading more results ... </div>',no_more_results:()=>'<div class="no-more-results">No more results</div>'},e.settings.render),i.addEventListener("scroll",(()=>{e.settings.shouldLoadMore.call(e)&&c(e.lastValue)&&(a||(a=!0,e.load.call(e,e.lastValue)))}))}))}return TomSelect2.define("change_listener",We),TomSelect2.define("checkbox_options",Ve),TomSelect2.define("clear_button",qe),TomSelect2.define("drag_drop",$e),TomSelect2.define("dropdown_header",Xe),TomSelect2.define("caret_position",Ye),TomSelect2.define("dropdown_input",Qe),TomSelect2.define("input_autogrow",et),TomSelect2.define("no_backspace_delete",tt),TomSelect2.define("no_active_items",rt),TomSelect2.define("optgroup_columns",nt),TomSelect2.define("remove_button",it),TomSelect2.define("restore_on_backspace",st),TomSelect2.define("virtual_scroll",ot),TomSelect2}()},92472:(e,t,r)=>{"use strict";!function(){var t,n,i,s=0,o=[];for(n=0;n<256;n++)o[n]=(n+256).toString(16).substr(1);function a(){var e,r=(e=16,(!t||s+e>l.BUFFER_SIZE)&&(s=0,t=l.randomBytes(l.BUFFER_SIZE)),t.slice(s,s+=e));return r[6]=15&r[6]|64,r[8]=63&r[8]|128,r}function l(){var e=a();return o[e[0]]+o[e[1]]+o[e[2]]+o[e[3]]+"-"+o[e[4]]+o[e[5]]+"-"+o[e[6]]+o[e[7]]+"-"+o[e[8]]+o[e[9]]+"-"+o[e[10]]+o[e[11]]+o[e[12]]+o[e[13]]+o[e[14]]+o[e[15]]}l.BUFFER_SIZE=4096,l.bin=a,l.clearBuffer=function(){t=null,s=0},l.test=function(e){return"string"==typeof e&&/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)},"undefined"!=typeof crypto?i=crypto:"undefined"!=typeof window&&void 0!==window.msCrypto&&(i=window.msCrypto),i=i||r(60575),e.exports=l,l.randomBytes=function(){if(i){if(i.randomBytes)return i.randomBytes;if(i.getRandomValues)return"function"!=typeof Uint8Array.prototype.slice?function(e){var t=new Uint8Array(e);return i.getRandomValues(t),Array.from(t)}:function(e){var t=new Uint8Array(e);return i.getRandomValues(t),t}}return function(e){var t,r=[];for(t=0;t<e;t++)r.push(Math.floor(256*Math.random()));return r}}()}()},20565:e=>{"use strict";var t=function(){};e.exports=t},48907:e=>{e.exports='<svg viewBox="0 0 200 150" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M7.5 51h200v149.818H7.5z" transform="matrix(.925 0 0 .9011 .563 -38.456)" stroke="currentColor" stroke-width="16.428"/><text style="white-space:pre" transform="matrix(.21978 0 0 .21926 40 115.307)" font-family="Arial,sans-serif" font-size="529.967" font-weight="700">2&quot;</text></svg>'},61786:e=>{e.exports='<svg viewBox="0 0 200 150" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M7.5 51h200v149.818H7.5z" transform="matrix(.925 0 0 .9011 .563 -38.456)" stroke="currentColor" stroke-width="16.428"/><text style="white-space:pre" transform="matrix(.21978 0 0 .21926 40 115.307)" font-family="Arial,sans-serif" font-size="529.967" font-weight="700">3&quot;</text></svg>'},93936:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M22 21.73 2.28 2 1 3.27l3.19 3.19-.77.43c-.32.17-.53.5-.53.88v9c0 .38.21.71.53.88l7.9 4.44c.16.12.36.18.57.18.21 0 .41-.06.57-.18l4.71-2.65L20.73 23 22 21.73ZM4.89 16.18v-6.7l5.29 2.97.71.71v6.4l-6-3.38Zm8 3.38v-4.4l2.82 2.81-2.82 1.59Zm-4-13.47L7.45 4.63l3.87-2.18c.16-.12.36-.18.57-.18.21 0 .41.06.57.18l7.9 4.44c.32.17.53.5.53.88v9c0 .35-.18.66-.47.83l-1.53-1.53V9.48l-4.22 2.37-1.47-1.47 4.65-2.61-5.96-3.35-3 1.67Z" fill="currentColor"/></svg>'},80714:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21 16.5c0 .38-.21.71-.53.88l-7.9 4.44c-.16.12-.36.18-.57.18-.21 0-.41-.06-.57-.18l-7.9-4.44A.991.991 0 0 1 3 16.5v-9c0-.38.21-.71.53-.88l7.9-4.44c.16-.12.36-.18.57-.18.21 0 .41.06.57.18l7.9 4.44c.32.17.53.5.53.88v9ZM12 4.15 6.04 7.5 12 10.85l5.96-3.35L12 4.15ZM5 15.91l6 3.38v-6.71L5 9.21v6.7Zm14 0v-6.7l-6 3.37v6.71l6-3.38Z" fill="currentColor"/></svg>'},58480:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path stroke="currentColor" d="M5 6v14M19 6v14"/><rect x="1" y="6" rx="1" ry="1" width="4" height="5" stroke="currentColor"/><rect x="19" y="6" rx="1" ry="1" width="4" height="5" stroke="currentColor"/><path stroke="currentColor" d="M4 6h16M5 17h14"/></svg>'},9902:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill-rule="evenodd" clip-rule="evenodd" d="M22.3 4H1.7v2.227h.926v7.417H.7v2.46h1.926V20.6h2.25v-4.625A11.495 11.495 0 0 0 7.6 15.2c.173.073.348.142.525.207V20.6h2.25v-4.633c1.076.152 2.175.152 3.25 0V20.6h2.25v-5.193c.177-.064.352-.133.526-.207.873.37 1.788.632 2.724.776V20.6h2.25v-4.496H23.3v-2.46h-1.925V6.227h.925V4ZM4.876 13.464V6.227h3.25v6.429a8.118 8.118 0 0 1-.373-.207l-.153-.091-.153.091a8.532 8.532 0 0 1-2.571 1.015Zm5.5-.021V6.227h3.25v7.216a8.503 8.503 0 0 1-3.25 0Zm5.5-.787V6.227h3.25v7.237a8.536 8.536 0 0 1-2.572-1.015l-.153-.091-.154.09a8.117 8.117 0 0 1-.372.208Z" fill="currentColor"/></svg>'},69710:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path stroke="currentColor" d="M0 3h25"/><path stroke="currentColor" stroke-width="2" d="M0 19h25"/><path stroke="currentColor" d="M2 3h20v16H2z"/></svg>'},76597:e=>{e.exports='<svg viewBox="0 0 24 20" xmlns="http://www.w3.org/2000/svg" stroke-width="1.5" stroke="#000" fill="#fff"><path fill="gray" d="M4 1h3v18H4zm13 0h3v18h-3z"/><path d="M2 1h20v3H2zm0 3h20v3H2zm0 3h20v3H2zm-1 6h22v3H1z"/></svg>'},89152:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M1 2c1 2 1 2 1 4m21-4c-1 2-1 2-1 4M2 6v14M22 6v14" stroke="currentColor" stroke-width="2"/><path stroke="currentColor" d="M0 2h24M2 6h21M2 17h21M6 6v11m4-11v11m4-11v11m4-11v11"/></svg>'},15927:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path stroke="currentColor" stroke-width="2" d="M2 2v18M22 2v18M1 2h22"/><path stroke="currentColor" d="m2 2 4 14.5M22 2l-4 14.5"/><path d="M6 16c2 3 10 3 12 0" stroke="currentColor" stroke-width="2"/></svg>'},87966:e=>{e.exports='<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" stroke="currentColor" fill="none"><defs><clipPath id="a"><path d="M30 10h40v60H30z"/></clipPath></defs><path opacity="50%" stroke-width="7" d="M10 10h20v60h40V10h20v80H10Z"/><path stroke-width="5" d="M30 10h40v60H30z"/><path stroke-width="5" clip-path="url(#a)" d="m10 70 80-30M10 50l80-30M10 30 90 0"/></svg>'},51201:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path stroke="currentColor" stroke-width="2" d="M2 5v14m20-9v14M2 6l20 5"/><path stroke="currentColor" d="m0 9.5 24 6m-24-3 24 6m-24-3 24 6"/></svg>'},5541:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path stroke="currentColor" stroke-width="2" d="M2 6v14M22 6v14M2 7h20"/><path stroke="currentColor" d="M0 11h24M0 14h24M0 17h24"/></svg>'},59566:e=>{e.exports='<svg viewBox="0 0 200 150" xmlns="http://www.w3.org/2000/svg"><path d="M16.404 142.327c-62.67-176.705 228.148-182.866 167.801.173l-167.801-.173Z" fill="none" stroke="currentColor" stroke-width="15"/></svg>'},39666:e=>{e.exports='<svg viewBox="0 0 500 500" xmlns="http://www.w3.org/2000/svg"><path d="m181.936 181.553 121.062 2.694 138.997-42.621c26.079-9.485 46.248 46.606 11.375 55.045l-108.149 37.315c-9.373 3.695-28.914 69.094-.084 93.934l19.848.088-.103 20.471-246.754-1.684.148-19.665 20.74-.039c29.902-24.486 13.262-94.552 4.05-97.067l-106.05-43.161c-24.153-9.024-4.797-62.155 15.284-54.384l129.636 49.074Z" fill="none" stroke="currentColor" paint-order="stroke" stroke-width="40"/><path d="m224.13 244.102 36.874 1.029c8.949-.049 10.57 54.56-1.694 54.345l-37.316-.672c-11.328-.284-10.137-54.263 2.136-54.702Z" fill="none" stroke="currentColor" stroke-width="30"/></svg>'},79171:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3.154 1.438H21.17v21.636H3.154z" stroke="currentColor"/><path d="M3.175 1.438h8.919v21.541H3.175z" stroke="currentColor"/></svg>'},7046:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path stroke="currentColor" d="M1.5 6v14M4 6v14M22.5 6v14M20 6v14"/><path stroke="currentColor" stroke-width=".5" d="M1 19.75h3m16 0h2.5"/><path stroke="currentColor" d="M1 6h22M4 9h16M4 12h16M4 15h16M4 18h16"/></svg>'},63906:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 49 46"><path d="M27 1.5V20M47 1.5V20" stroke="currentColor" stroke-width="3"/><path d="M47 2H27v15h20V2Z" stroke="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M15 32.002V46h2V32.002h-2ZM19 30h14v-2H19v2Zm-2-4V13h-2v13h2Zm-4 2H0v2h13v-2Z" fill="currentColor"/></svg>'},10657:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 49 47"><g clip-path="url(#a)" stroke="#000"><path d="M29 5.5v14m16-8v14" stroke-width="3"/><path d="m29 1.5 16 6v13l-16-6v-13Z" stroke-linejoin="round"/></g><path fill-rule="evenodd" clip-rule="evenodd" d="M16 34v13h2V34h-2Zm3.998-2H33v-2H19.998v2ZM18 28V14h-2v14h2Zm-4 2H0v2h14v-2Z" fill="#000"/><defs><clipPath id="a"><path fill="#fff" transform="translate(25 .5)" d="M0 0h24v24H0z"/></clipPath></defs></svg>'},2547:e=>{e.exports='<svg viewBox="0 0 200 150" xmlns="http://www.w3.org/2000/svg"><path d="M7.5 37.789C56.587-1.748 147.411-3.173 192.201 37.02l.299 105.48-184.918-.166L7.5 37.789Z" fill="none" stroke="currentColor" stroke-width="15"/></svg>'},17010:e=>{e.exports='<svg fill="currentColor" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path d="M58.957 72.5c-.625.207-1.457.207-2.082.418.625-.211 1.457-.418 2.082-.418zM76.25 56.25c-.207.832-.418 1.457-.625 2.082.207-.625.418-1.457.625-2.082zm-.832 2.293c-.418.832-.832 1.668-1.25 2.5.414-.625.832-1.46 1.25-2.5zm1.457-5c0 .625-.207 1.25-.418 1.875.211-.625.211-1.25.418-1.875zM77.082 50c0 .832 0 1.875-.207 2.707.207-.832.207-1.875.207-2.707zM56.668 72.707c-.836.21-1.668.21-2.5.21.832 0 1.664 0 2.5-.21zm19.789-17.289c0 .207-.207.418-.207.625 0-.21 0-.418.207-.625zm.418-2.711c0 .207 0 .418-.207.832.207-.414.207-.621.207-.832zM59.168 72.293c-.21 0-.21.207 0 0-.21.207-.21 0 0 0zm16.25-13.961c0 .207 0 .207-.207.418.207-.207.207-.418.207-.418zm-18.75 14.375h.207-.207z"/><path d="M71.668 64.793C65 56.875 55.625 48.125 48.961 42.086c-.418-.418-.625-.832-.625-1.457 0-1.25.832-2.082 2.082-2.082.418 0 1.043.207 1.457.418h.207c9.375 8.543 16.875 15.832 22.293 22.082.418-.832.832-1.668 1.25-2.5 0 0 0-.207.207-.418.207-.625.418-1.457.625-2.082 0-.207.207-.418.207-.625.207-.625.207-1.25.418-1.875 0-.207 0-.418.207-.832-.207-.84-.207-1.883-.207-2.715 0-16.25-17.082-24.793-33.332-25-14.793-.207-22.918-4.168-22.918-4.168s2.082 21.25 6.457 33.125C32.293 67.5 41.457 72.918 54.17 72.918c.831 0 1.667 0 2.5-.207h.206c.625 0 1.457-.207 2.082-.418h.207c1.457-.418 2.918-.832 4.375-1.457 1.25-.625 2.5-1.25 3.75-2.082 4.168 4.793 6.875 8.543 6.875 10.207h6.25c-.207-3.129-3.746-8.543-8.746-14.168z"/></svg>'},61676:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill-rule="evenodd" clip-rule="evenodd" d="M8 2h8v20H8V2Zm2 14v4h4v-4h-4Zm4-2v-4h-4v4h4Zm-4-6V4h4v4h-4Z" fill="currentColor"/></svg>'},47195:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path d="M9 2.967h5.952v5.524H9zm0 12.538h5.952v5.524H9z" stroke="currentColor" stroke-width="2"/></svg>'},27989:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path stroke-width="4" stroke="currentColor" fill="none" d="M0 99.742 99.485 0M0 98.454l98.711-.516M98.196 0v98.196m-85.309 9.794 99.484-99.743M24.485 117.268l99.484-99.742M37.113 126.289l99.485-99.743m-94.33 116.238 99.485-99.743"/></svg>'},96003:e=>{e.exports='<svg viewBox="50 50 450 450" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M82.108 264.57c66.201 17.113 105.354 13.443 166.047-14.423 54.646-19.736 144.174 24.497 168.229 21.18" stroke="currentColor" stroke-width="25"/><circle cx="83.575" cy="264.505" r="35" stroke="currentColor" fill="currentColor"/><circle cx="254.453" cy="247.044" r="35" stroke="currentColor" fill="currentColor"/><circle cx="414.163" cy="270.958" r="35" stroke="currentColor" fill="currentColor"/></svg>'},36746:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 48 48"><path d="M7 40q-1.15 0-2.075-.925Q4 38.15 4 37V11q0-1.15.925-2.075Q5.85 8 7 8h14.05l3 3H41q1.15 0 2.075.925Q44 12.85 44 14H22.75l-3-3H7v26l5.1-20H47l-5.35 20.7q-.3 1.2-1.1 1.75T38.5 40Zm3.15-3h28.6l4.2-17h-28.6Zm0 0 4.2-17-4.2 17ZM7 14v-3 3Z"/></svg>'},85733:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 48 48"><path d="M7.05 40q-1.2 0-2.1-.925-.9-.925-.9-2.075V11q0-1.15.9-2.075Q5.85 8 7.05 8h14l3 3h17q1.15 0 2.075.925.925.925.925 2.075v23q0 1.15-.925 2.075Q42.2 40 41.05 40Zm0-29v26h34V14H22.8l-3-3H7.05Zm0 0v26Z"/></svg>'},89499:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path stroke="currentColor" stroke-width="3" d="M2 2v18M22 2v18"/><path stroke="currentColor" stroke-width="2" d="M2 3h20v14H2z"/><path stroke="currentColor" d="M6 3h12v14H6z"/></svg>'},56113:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill-rule="evenodd" clip-rule="evenodd" d="M2.467 6.92 22.86 8.63l-.605 6.626 1.329.111-.168 1.993-23-1.929.168-1.993 1.278.107.605-6.625Zm1.388 6.792 4.14.348.424-4.633-4.141-.348-.423 4.633Zm6.417-2.587-.283 3.102 4.14.347.423-4.633-4.14-.347-.14 1.531Zm6.133.514-.283 3.102 4.14.348.423-4.634-4.14-.347-.14 1.531Z" fill="currentColor"/></svg>'},49181:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path stroke="currentColor" stroke-width="2" d="M2 5v14m20-9v14"/><path stroke="currentColor" d="m1 5 22 5M1 10l22 5M1 15l22 5"/></svg>'},39585:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path stroke="currentColor" stroke-width="2" d="M2 6v14M22 6v14"/><path stroke="currentColor" d="M1 6h22M1 11h22M1 16h22"/></svg>'},71825:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path stroke="currentColor" stroke-width="3" d="M2 10v10m20-10v10"/><path stroke="currentColor" d="M2 2h20v15H2z"/></svg>'},81301:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path stroke="currentColor" stroke-width="3" d="M2 2v18M22 2v18"/><path stroke="currentColor" d="M2 2h20v15H2z"/></svg>'},26600:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path stroke="currentColor" stroke-width="3" d="M4 5v14m16-8.5V24"/><path stroke="currentColor" stroke-linejoin="round" d="m4 1 16 6v13L4 14z"/></svg>'},67916:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path stroke="currentColor" stroke-width="3" d="M2 6v14M22 6v14"/><path stroke="currentColor" d="M2 2h20v15H2z"/></svg>'},94773:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><defs><mask id="a"><path fill="#fff" d="M0 0h24v24H0z"/><path fill="#000" d="M1 3h22v5H1zm0 9h22v5H1z"/></mask></defs><path stroke="#000" fill="#000" mask="url(#a)" d="M1 2h2v18H1zm20 0h2v18h-2z"/><path stroke="#000" d="M1 3h22v5H1zm0 9h22v5H1z"/></svg>'},31220:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path stroke="currentColor" d="m2 6 20 5"/><path stroke="currentColor" stroke-width="2" d="M4 9v3m13 .5v3"/><path stroke="currentColor" d="m4 10 2.5-3M17 13.5l2.5-3"/></svg>'},31902:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path stroke="currentColor" stroke-width="2" d="m2 6 20 5M4 9v3m13 .5v3"/><path stroke="currentColor" d="m4 10 2.5-3M17 13.5l2.5-3"/></svg>'},81815:e=>{e.exports='<svg viewBox="25 25 113 113" fill="none" xmlns="http://www.w3.org/2000/svg"><path stroke="currentColor" stroke-width="6" d="M31 62v60m20-60v60M28 59h26m-26 60h21m-21 0h21M28 79h21M28 99h21m23-37v60m20-60v60M69 59h26m-26 60h21M69 79h21M69 99h21m-41 20h21M49 99h21M31 42v20m20-20v20M28 39h26M28 59h21m23-17v20m20-20v20M69 39h26M69 59h21m3 43v20m20-20v20M90 99h26m-26 20h21M93 82v20m20-20v20M90 79h26M90 99h21m2 3v20m20-20v20m-23-23h26m-26 20h21m-18-37v20m20-20v20m-23-23h26m-26 20h21m-18-37v20m20-20v20m-23-23h26m-26 20h21m-18-37v20m20-20v20m-23-23h26M93 62v20m20-20v20M90 59h26M90 79h21M93 42v20m20-20v20M90 39h26M90 59h21m-1 0h21"/></svg>'},431:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill-rule="evenodd" clip-rule="evenodd" d="M2 2h8v12h12v8H2V2Zm6 12v-4H4v4h4Zm-4 2h4v4H4v-4Zm6 4v-4h4v4h-4Zm6 0h4v-4h-4v4ZM4 8h4V4H4v4Z" fill="currentColor"/></svg>'},72537:e=>{e.exports='<svg viewBox="5 5 65 65" stroke="currentColor" xmlns="http://www.w3.org/2000/svg" stroke-width="7"><path d="M21 10v53m28-53v53M21 30h28M21 43h28M21 56h28"/></svg>'},55989:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M23 9.666h-2V7.693h2v1.973Zm0 3.944h-2v-1.972h2v1.972Zm0-7.89h-2V3.749c1 0 2 .987 2 1.973ZM15 21.5h-2v-1.972h2V21.5Zm8-3.945h-2v-1.972h2v1.972ZM21 21.5v-1.972h2c0 .986-1 1.972-2 1.972ZM3 17.555H1v-1.972h2v1.972ZM15 5.721h-2V3.748h2v1.973ZM19 21.5h-2v-1.972h2V21.5Zm0-15.78h-2V3.749h2v1.973ZM3 21.5c-1 0-2-.986-2-1.972h2V21.5Zm0-7.89H1v-1.972h2v1.972Zm8 7.89H9v-1.972h2V21.5Zm-4 0H5v-1.972h2V21.5ZM1.83 3l5.02 12.504.706-.019 2.016-4.85 4.92-1.99.018-.696L1.83 3Z" fill="currentColor"/></svg>'},6489:e=>{e.exports='<svg viewBox="30 30 103 103" fill="none" xmlns="http://www.w3.org/2000/svg"><path stroke="currentColor" stroke-width="6" d="M53 61v60m20-60v60M50 58h26m-26 60h21m-21 0h21M50 78h21M50 98h21m23-37v60m20-60v60M91 58h26m-26 60h21M91 78h21M91 98h21m-41 20h21M71 98h21M53 41v20m20-20v20M50 38h26M50 58h21m23-17v20m20-20v20M91 38h26M91 58h21"/></svg>'},13014:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path stroke="currentColor" stroke-width="2" d="M2 6v14M22 6v14"/><path stroke="currentColor" d="M1 6h22M1 13h22"/></svg>'},18530:e=>{e.exports='<svg fill="currentColor" xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M400-240v-480h480v480H400Zm80-80h320v-320H480v320Zm-240 80v-80h80v80h-80Zm0-400v-80h80v80h-80ZM80-240v-80h80v80H80Zm0-200v-80h80v80H80Zm0-200v-80h80v80H80Zm560 160Z"/></svg>'},61746:e=>{e.exports='<svg viewBox="25 25 113 113" fill="none" xmlns="http://www.w3.org/2000/svg"><path stroke="currentColor" stroke-width="6" d="M31 61v60m20-60v60M28 58h26m-26 60h21m-21 0h21M28 78h21M28 98h21m23-37v60m20-60v60M69 58h26m-26 60h21M69 78h21M69 98h21m-41 20h21M49 98h21M31 41v20m20-20v20M28 38h26M28 58h21m23-17v20m20-20v20M69 38h26M69 58h21m3 43v20m20-20v20M90 98h26m-26 20h21M93 81v20m20-20v20M90 78h26M90 98h21m2 3v20m20-20v20m-23-23h26m-26 20h21m-18-37v20m20-20v20m-23-23h26m-26 20h21m-18-37v20m20-20v20m-23-23h26m-26 20h21m-18-37v20m20-20v20m-23-23h26m-26 20h21"/></svg>'},5284:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 2H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2Zm0 12H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2ZM6 6h.01M6 18h.01" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>'},75422:e=>{e.exports='<svg viewBox="0 0 200 150" xmlns="http://www.w3.org/2000/svg"><path d="M45.047 111.99c-165.651-139.096 280.972-139.894 106.082 1.048l-.101 29.461-105.858.001-.123-30.51Z" fill="none" stroke="currentColor" stroke-width="15"/></svg>'},76278:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path stroke="currentColor" stroke-width="3" d="M2 2v18M22 2v18"/><path stroke="currentColor" stroke-width="2" d="M2 3h20v14H2z"/><path stroke="currentColor" d="M6 4v14m4-14v14m4-14v14m4-14v14"/></svg>'},61878:e=>{e.exports='<svg viewBox="0 0 500 500" xmlns="http://www.w3.org/2000/svg"><path d="M136.283 124.918h.407v.407h-.407z" fill="#d8d8d8" stroke="#000"/><path d="M39.513 361.318h412.428v60.496H39.513z" paint-order="fill"/><path d="m121.101 367.975.601-161.266c-5.569-156.821 249.1-181.152 255.513-.667l-1.785 161.745" fill="none" stroke="#000" paint-order="fill" stroke-width="50"/></svg>'},89077:e=>{e.exports='<svg viewBox="0 0 500 500" xmlns="http://www.w3.org/2000/svg"><path d="M56.286 351.543h363.496v37.287H56.286z" stroke="currentColor"/><circle cx="241.771" cy="238.037" fill="none" r="105.334" stroke="currentColor" stroke-width="40"/></svg>'},53516:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path d="M3.126 3.054h18.072v17.784H3.126z" stroke="currentColor" stroke-width="2"/></svg>'},19960:e=>{e.exports='<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" stroke="currentColor" fill="none"><path stroke-width="7" opacity="50%" d="M5 20h90M5 50h90M5 80h90M10 10v80"/><path stroke-width="7" d="M45 10v80"/><path stroke-width="7" opacity="50%" d="M90 10v80"/></svg>'},33392:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 48 48"><path d="M11 44q-1.2 0-2.1-.9Q8 42.2 8 41V7q0-1.2.9-2.1Q9.8 4 11 4h18.05L40 14.95V41q0 1.2-.9 2.1-.9.9-2.1.9Zm16.55-27.7V7H11v34h26V16.3ZM11 7v9.3V7v34V7Z"/></svg>'},22520:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path stroke="currentColor" d="M2 6h20v12H2z" stroke-width="2"/></svg>'},46623:e=>{e.exports='<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" stroke="currentColor" fill="none"><path stroke-width="7" d="m10 70 40-40 40 40Zm40 0L30 50m20 20V30m0 40 20-20"/></svg>'},23682:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path stroke="currentColor" stroke-width="2" d="M2 6v14M22 6v14"/><path stroke="currentColor" d="M2 7c7 2 13 2 20 0M2 14c7 2 13 2 20 0"/></svg>'},70753:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m4.009 3.991 6.563 16.58.923-.024 2.637-6.433 6.432-2.637.025-.923L4.01 3.991Z" fill="currentColor"/></svg>'},2907:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill-rule="evenodd" clip-rule="evenodd" d="M2.467 6.92 22.86 8.63l-.605 6.626 1.329.111-.168 1.993-23-1.929.168-1.993 1.278.107.605-6.625Zm1.388 6.792 4.14.348.424-4.633-4.141-.348-.423 4.633Zm6.417-2.587-.283 3.102 4.14.347.423-4.633-4.14-.347-.14 1.531Zm6.133.514-.283 3.102 4.14.348.423-4.634-4.14-.347-.14 1.531Z" fill="currentColor"/></svg>'},96769:e=>{e.exports='<svg viewBox="0 0 500 500" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M174.126 79.446h153.909v55.579H174.126z" stroke="currentColor" stroke-width="13"/><path fill="none" d="M174.113 134.821h153.909V190.4H174.113z" stroke="currentColor" stroke-width="13"/><path fill="none" d="M174.13 190.224h153.909v55.579H174.13z" stroke="currentColor" stroke-width="13"/><path fill="none" d="M174.174 245.614h153.909v55.579H174.174z" stroke="currentColor" stroke-width="13"/><path fill="none" d="M174.148 300.882h153.909v55.579H174.148z" stroke="currentColor" stroke-width="13"/><path fill="none" d="M174.135 356.258h153.909v55.579H174.135z" stroke="currentColor" stroke-width="13"/><path fill="none" d="M162.729 71.665h176.459v346.44H162.729z" stroke="currentColor" stroke-width="40"/></svg>'},52762:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path stroke="currentColor" d="M1 3h22v16H1z"/><circle fill="currentColor" cx="4" cy="16" r="1"/><circle fill="currentColor" cx="20" cy="16" r="1"/></svg>'},30205:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path d="M.946 4.103h22.109v14.991H.946z" stroke="currentColor"/><path style="mix-blend-mode:normal" d="M1.249 7.163h10.337v3.162H1.249zm10.797 0h10.337v3.162H12.046zM1.433 13.157H11.77v3.162H1.433zm10.797 0h10.337v3.162H12.23z" stroke="currentColor" stroke-width=".831"/></svg>'},48200:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g transform="translate(-.071)" fill="currentColor" fill-rule="evenodd" stroke="currentColor" stroke-width=".8"><circle cx="6.357" cy="2.095" r="1.6"/><circle cx="16.214" cy="2.095" r="1.6"/></g><g transform="translate(-.071 19.69)" fill="currentColor" fill-rule="evenodd" stroke="currentColor" stroke-width=".8"><circle cx="6.357" cy="2.095" r="1.6"/><circle cx="16.214" cy="2.095" r="1.6"/></g><path d="M6.497 1.19h9.46v21.692h-9.46z" transform="matrix(1.00245 0 0 .91488 -.028 .911)" stroke="currentColor"/><path d="M9.799 1.199h2.856v21.675H9.799z" transform="matrix(1.00245 0 0 .91488 -.028 .911)" stroke="currentColor"/></svg>'},43050:e=>{e.exports='<svg viewBox="0 0 300 300"><circle cx="150" cy="150" r="125" fill="#5cb85c"/><circle cx="150" cy="150" r="100" fill="#fff"/><path d="m75 170 65 55 80-125" stroke="#5cb85c" fill="#00000000" stroke-width="20"/></svg>'},93617:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><path d="M14.723 21.081v-1.7a3.401 3.401 0 0 0-3.4-3.401H4.52a3.4 3.4 0 0 0-3.401 3.4v1.701m6.801-8.502a3.4 3.4 0 1 0 0-6.802 3.4 3.4 0 0 0 0 6.802Zm11.904 8.502v-1.7a3.402 3.402 0 0 0-2.55-3.29M13.873 5.888a3.4 3.4 0 0 1 0 6.589" stroke-width="1.7"/><path d="M21.021 1.251v9.064M23.08 2.9h-3.09a1.442 1.442 0 1 0 0 2.883h2.06a1.442 1.442 0 0 1 0 2.884h-3.5" stroke-width="1.133"/></g></svg>'},21639:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill-rule="evenodd" clip-rule="evenodd" d="M2 2h20v8h-6v12H8V10H2V2Zm8 8h4v4h-4v-4Zm0 6v4h4v-4h-4Zm4-8h-4V4h4v4Zm2-4v4h4V4h-4ZM8 4H4v4h4V4Z" fill="currentColor"/></svg>'},80356:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path stroke="currentColor" stroke-width="2" d="M2 6v14M22 6v14"/><path stroke="currentColor" d="M1 6h22M1 10h22M1 14h22"/></svg>'},36658:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path stroke="currentColor" stroke-width="2" d="M2 6v14M22 6v14"/><path stroke="currentColor" d="M1 6h22"/></svg>'},52828:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path stroke="currentColor" stroke-width="2" d="M2 6v14M22 6v14M2 7h20M2 10h20M2 17h20"/><path stroke="currentColor" d="M6 10v7m4-7v7m4-7v7m4-7v7"/></svg>'},80138:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill-rule="evenodd" clip-rule="evenodd" d="M2 2h8v12h4V2h8v20H2V2Zm12 14h-4v4h4v-4Zm2 4v-4h4v4h-4Zm4-6h-4v-4h4v4Zm0-6V4h-4v4h4ZM8 20v-4H4v4h4Zm-4-6h4v-4H4v4Zm0-6h4V4H4v4Z" fill="currentColor"/></svg>'},5388:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M16.917 21.081v-1.7a3.401 3.401 0 0 0-3.4-3.401H6.713a3.4 3.4 0 0 0-3.4 3.4v1.701m6.802-8.502a3.4 3.4 0 1 0 0-6.802 3.4 3.4 0 0 0 0 6.802Z" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"/><path d="M18.215 1.251v9.064M20.274 2.9h-3.09a1.442 1.442 0 1 0 0 2.883h2.06a1.442 1.442 0 1 1 0 2.884h-3.501" stroke="currentColor" stroke-width="1.133" stroke-linecap="round" stroke-linejoin="round"/></svg>'},80691:e=>{e.exports='<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><defs><clipPath id="a"><rect x="4" y="4" width="16" height="16" rx="1" ry="1"/></clipPath></defs><rect x="4" y="4" width="16" height="16" stroke="currentColor" stroke-width="1.5" rx="1" ry="1"/><path stroke="currentColor" opacity="25%" stroke-width="3" clip-path="url(#a)" d="M14 22 2 10m18 10L4 4m18 10L10 2"/></svg>'},23182:(e,t,r)=>{"use strict";e.exports=r.p+"american-muscle-docks-logo--info-c4d23fb55c633745d9b0.digested.jpg"},40724:(e,t,r)=>{"use strict";e.exports=r.p+"american-muscle-docks-logo-3b3add6c192dead608f6.digested.png"},58467:(e,t,r)=>{"use strict";e.exports=r.p+"american-muscle-docks-watermark-e772cb289ecee51ea8e4.digested.png"},45343:(e,t,r)=>{"use strict";e.exports=r.p+"bear-ridge-claw-4a8a1fd989f1f4da0f1d.digested.png"},77179:(e,t,r)=>{"use strict";e.exports=r.p+"bear-ridge-logo-c9ab4b646ae778f4a10e.digested.png"},86335:(e,t,r)=>{"use strict";e.exports=r.p+"city-post-logo-00c48eedaa5db8970fd4.digested.png"},31617:(e,t,r)=>{"use strict";e.exports=r.p+"coastal-pier-and-dock-logo-d6cc4f0be2b0af54fe4f.digested.png"},99310:(e,t,r)=>{"use strict";e.exports=r.p+"dock-designer-app-logo-white-7a097378a511061df1fb.digested.png"},43930:(e,t,r)=>{"use strict";e.exports=r.p+"dock-designer-app-logo-9f7b7767080d743addf3.digested.png"},97857:(e,t,r)=>{"use strict";e.exports=r.p+"dock-designer-app-watermark-5bb9eb957407d2b46e7e.digested.png"},37156:(e,t,r)=>{"use strict";e.exports=r.p+"dock-designer-logo-7b2d7ed5e88093e476ad.digested.png"},37538:(e,t,r)=>{"use strict";e.exports=r.p+"docklife-logo-3e0a33d9f63c9fa00c4c.digested.png"},51947:(e,t,r)=>{"use strict";e.exports=r.p+"environment-5b8f8dae6c908e0834c4.digested.hdr"},15110:(e,t,r)=>{"use strict";e.exports=r.p+"ez-dock-logo-25c834779e399ae7c4f4.digested.png"},7526:(e,t,r)=>{"use strict";e.exports=r.p+"falcon-railings-logo-fc6c8905ea61a26e2450.digested.png"},61686:(e,t,r)=>{"use strict";e.exports=r.p+"hollaender-quik-connect-logo-watermark-a79b1c8c1653f541b0ef.digested.png"},12560:(e,t,r)=>{"use strict";e.exports=r.p+"hollaender-quik-connect-logo-9c4bdc87690ff3d69604.digested.png"},16499:(e,t,r)=>{"use strict";e.exports=r.p+"2-inch-rectangle-rail-shape-32d7336724968383f908.digested.svg"},39714:(e,t,r)=>{"use strict";e.exports=r.p+"3-inch-rectangle-rail-shape-c146c523fe35c2dcec5d.digested.svg"},99035:(e,t,r)=>{"use strict";e.exports=r.p+"3d-off-0e3aa2a4e52beac5bcbd.digested.svg"},51938:(e,t,r)=>{"use strict";e.exports=r.p+"3d-on-0b93f313973f118253a3.digested.svg"},16024:(e,t,r)=>{"use strict";e.exports=r.p+"ada-rail-f7653711c714d2255622.digested.svg"},45254:(e,t,r)=>{"use strict";e.exports=r.p+"anchor-platform-49cd0b964ec33b4a2ef1.digested.svg"},68742:(e,t,r)=>{"use strict";e.exports=r.p+"base-shoe-glass-rail-e71b33a8c2ec53390546.digested.svg"},88061:(e,t,r)=>{"use strict";e.exports=r.p+"bench-2f2f1a707e7b30f48c9d.digested.svg"},13688:(e,t,r)=>{"use strict";e.exports=r.p+"bikeway-rail-002a8c0b2165d486631e.digested.svg"},67551:(e,t,r)=>{"use strict";e.exports=r.p+"boat-lift-sling-e0b3505cb49f2585db2e.digested.svg"},49190:(e,t,r)=>{"use strict";e.exports=r.p+"boat-slip-0691c85a2c19da993135.digested.svg"},99545:(e,t,r)=>{"use strict";e.exports=r.p+"cable-rail-stair-82e776110e86dec26403.digested.svg"},54109:(e,t,r)=>{"use strict";e.exports=r.p+"cable-rail-b5c2b70a3e563db90622.digested.svg"},75430:(e,t,r)=>{"use strict";e.exports=r.p+"circle-rail-shape-1390f38cc05dcc23ce5c.digested.svg"},2013:(e,t,r)=>{"use strict";e.exports=r.p+"cleat-5c1014a62646d72ccd5d.digested.svg"},47147:(e,t,r)=>{"use strict";e.exports=r.p+"coastal-boathouse-e87b7b91458c8d0306c5.digested.svg"},81806:(e,t,r)=>{"use strict";e.exports=r.p+"colosseum-rail-bb57362221cdc4c91701.digested.svg"},81562:(e,t,r)=>{"use strict";e.exports=r.p+"cursor-level-glass-rail-4f678cac67fad2071482.digested.svg"},57769:(e,t,r)=>{"use strict";e.exports=r.p+"cursor-stair-glass-rail-80ef31a72e1d51424838.digested.svg"},24203:(e,t,r)=>{"use strict";e.exports=r.p+"curved-rail-shape-631c43f057e4cef4a440.digested.svg"},78362:(e,t,r)=>{"use strict";e.exports=r.p+"custom-icon-0f80505fc12f09d7cc57.digested.svg"},58756:(e,t,r)=>{"use strict";e.exports=r.p+"default-dock-3d3398945d87bf95d4e6.digested.svg"},93731:(e,t,r)=>{"use strict";e.exports=r.p+"default-opening-1bdc706257ba571c97a9.digested.svg"},30365:(e,t,r)=>{"use strict";e.exports=r.p+"dock-triangle-f949179af3630bf6374d.digested.svg"},34843:(e,t,r)=>{"use strict";e.exports=r.p+"edit-curve-10df46e983a1b11821bd.digested.svg"},21634:(e,t,r)=>{"use strict";e.exports=r.p+"folder-open-1551fe14143f8e1437c8.digested.svg"},17853:(e,t,r)=>{"use strict";e.exports=r.p+"folder-283a2ebc524f9f3836d5.digested.svg"},76323:(e,t,r)=>{"use strict";e.exports=r.p+"framed-glass-c7f4e1368144e47d8273.digested.svg"},20633:(e,t,r)=>{"use strict";e.exports=r.p+"gangway-e2315aa9290e43838000.digested.svg"},581:(e,t,r)=>{"use strict";e.exports=r.p+"generic-rail-stair-1b198314ac9de3c33019.digested.svg"},61385:(e,t,r)=>{"use strict";e.exports=r.p+"generic-rail-c4215b1b6c72604ac3f6.digested.svg"},35785:(e,t,r)=>{"use strict";e.exports=r.p+"glass-rail-infinity-723a1420dbf7678c67a8.digested.svg"},88941:(e,t,r)=>{"use strict";e.exports=r.p+"glass-rail-post-to-top-f7ab58cb7389a21d0862.digested.svg"},90688:(e,t,r)=>{"use strict";e.exports=r.p+"glass-rail-stair-009b1f66c1a1b7086694.digested.svg"},85540:(e,t,r)=>{"use strict";e.exports=r.p+"glass-rail-c64b291a40924dec5ef5.digested.svg"},61437:(e,t,r)=>{"use strict";e.exports=r.p+"guardrail-rail-95c3454781b6e461d491.digested.svg"},19548:(e,t,r)=>{"use strict";e.exports=r.p+"hand-grab-flat-rail-8a64fc9616585cdca515.digested.svg"},23574:(e,t,r)=>{"use strict";e.exports=r.p+"hand-grab-rail-c1f466c85b8fe665cab2.digested.svg"},55151:(e,t,r)=>{"use strict";e.exports=r.p+"kalani-b95821451fec35202267.digested.svg"},61287:(e,t,r)=>{"use strict";e.exports=r.p+"l-shape-7aadb891f76bd70a24c2.digested.svg"},36417:(e,t,r)=>{"use strict";e.exports=r.p+"ladder-8d5f26b4d21b8ac011fc.digested.svg"},16925:(e,t,r)=>{"use strict";e.exports=r.p+"lasso-43162a6cd2d9db4a7082.digested.svg"},42033:(e,t,r)=>{"use strict";e.exports=r.p+"mahina-feeabe95047d0f2b2ed3.digested.svg"},34046:(e,t,r)=>{"use strict";e.exports=r.p+"mid-rail-b8f0069ff0f351723663.digested.svg"},92602:(e,t,r)=>{"use strict";e.exports=r.p+"move_selection_right-45b11b8132d858defe50.digested.svg"},28746:(e,t,r)=>{"use strict";e.exports=r.p+"ohana-11ae0a9ca13a1142248c.digested.svg"},53292:(e,t,r)=>{"use strict";e.exports=r.p+"organization-a29bb7fcb717b9fb7086.digested.svg"},11350:(e,t,r)=>{"use strict";e.exports=r.p+"oval-rail-shape-10222a11514dc94a78ac.digested.svg"},64526:(e,t,r)=>{"use strict";e.exports=r.p+"picket-rail-184a997b4ce54b66d503.digested.svg"},44174:(e,t,r)=>{"use strict";e.exports=r.p+"pile-guide-d69a7bf82b83ad7349be.digested.svg"},51789:(e,t,r)=>{"use strict";e.exports=r.p+"pipe-hold-51c66b836c89e6e5594c.digested.svg"},40788:(e,t,r)=>{"use strict";e.exports=r.p+"platform-0ff14ebcc291d53df576.digested.svg"},73075:(e,t,r)=>{"use strict";e.exports=r.p+"post-override-016a3a933cc9cca5c666.digested.svg"},45112:(e,t,r)=>{"use strict";e.exports=r.p+"project-347adeffe8680efcb283.digested.svg"},27520:(e,t,r)=>{"use strict";e.exports=r.p+"rectangle-7f0a3cc4f6937053b9a1.digested.svg"},57047:(e,t,r)=>{"use strict";e.exports=r.p+"roof-39c1f91defcd0aed5dfe.digested.svg"},16970:(e,t,r)=>{"use strict";e.exports=r.p+"rope-rail-c1c5853198ff73173390.digested.svg"},93513:(e,t,r)=>{"use strict";e.exports=r.p+"select-cd46f8f0ea66d52780bb.digested.svg"},40995:(e,t,r)=>{"use strict";e.exports=r.p+"stairs-e2315aa9290e43838000.digested.svg"},8118:(e,t,r)=>{"use strict";e.exports=r.p+"standard-dock-af89082cd8edea769c48.digested.svg"},35890:(e,t,r)=>{"use strict";e.exports=r.p+"standoff-glass-rail-a5de436d81c0277a731a.digested.svg"},69477:(e,t,r)=>{"use strict";e.exports=r.p+"stick-dock-dc298acee0155f5aa46e.digested.svg"},22560:(e,t,r)=>{"use strict";e.exports=r.p+"stick-pier-c8fc9331e31f11923a57.digested.svg"},36466:(e,t,r)=>{"use strict";e.exports=r.p+"success-957576ec25d28cd6a504.digested.svg"},58569:(e,t,r)=>{"use strict";e.exports=r.p+"system_pricing-b129957a788ecf5982f2.digested.svg"},40079:(e,t,r)=>{"use strict";e.exports=r.p+"t-shape-cc747310d8a4358c4f3e.digested.svg"},30908:(e,t,r)=>{"use strict";e.exports=r.p+"three-rail-306264b59e639909dd05.digested.svg"},98570:(e,t,r)=>{"use strict";e.exports=r.p+"top-rail-only-300fccd44b4c112c3153.digested.svg"},12068:(e,t,r)=>{"use strict";e.exports=r.p+"triton-rail-9d360e9ca83eaf10a200.digested.svg"},76050:(e,t,r)=>{"use strict";e.exports=r.p+"u-shape-730ef74e48f91a6087ae.digested.svg"},80151:(e,t,r)=>{"use strict";e.exports=r.p+"user_pricing-43b305d8bb151b375fb3.digested.svg"},38299:(e,t,r)=>{"use strict";e.exports=r.p+"zone-6d693cc3fce73eb5e90a.digested.svg"},15299:(e,t,r)=>{"use strict";e.exports=r.p+"innovative-aluminum-logo-47a464a845b1db460d8a.digested.png"},78126:(e,t,r)=>{"use strict";e.exports=r.p+"k-and-s-logo-cf83ca21f0de5c693066.digested.png"},3501:(e,t,r)=>{"use strict";e.exports=r.p+"k-and-s-watermark-8c4852e70b5c902edbb2.digested.png"},87254:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-logo-icon-7663d3343f34d1d32576.digested.png"},87842:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-logo-4f5a5193314dfb83ec07.digested.png"},84905:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-watermark-7f343f2252f74ed52dd8.digested.png"},41629:(e,t,r)=>{"use strict";e.exports=r.p+"lightningcad-logo-11e9cc405756a17f0ed8.digested.png"},27812:(e,t,r)=>{"use strict";e.exports=r.p+"oasis-boat-docks-logo-8ae9d81d9c3c859dda10.digested.png"},38707:(e,t,r)=>{"use strict";e.exports=r.p+"oasis-boat-docks-watermark-d6f7aac89c4a6554bb34.digested.png"},71766:(e,t,r)=>{"use strict";e.exports=r.p+"omega-is-gradient-logo-c10539e5e9f41ac530ec.digested.png"},61968:(e,t,r)=>{"use strict";e.exports=r.p+"omega-is-watermark-be0122e5f7696da39e20.digested.png"},26557:(e,t,r)=>{"use strict";e.exports=r.p+"railing-designer-logo-ff43e2af698b0ea4f229.digested.png"},4574:(e,t,r)=>{"use strict";e.exports=r.p+"rogue-fabricators-logo-f638e5ff6303989793d8.digested.png"},18377:(e,t,r)=>{"use strict";e.exports=r.p+"water-normals-68d6da635eb0e8d23d71.digested.png"},84873:(e,t,r)=>{"use strict";e.exports=r.p+"waterside-logo-icon-7afcbc45297d4bac8449.digested.png"},36123:(e,t,r)=>{"use strict";e.exports=r.p+"waterside-logo-9f561c53d9694e1bd68d.digested.png"},63787:(e,t,r)=>{"use strict";e.exports=r.p+"adjustable-corner-sleeve-placeholder-1406ee8250ad585f3e1d.digested.glb"},13471:(e,t,r)=>{"use strict";e.exports=r.p+"aluminum-post-cap-be0b47121a3aa3e0b6b0.digested.glb"},34356:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-12-floats-b0830bdd685e9db77502.digested.glb"},95680:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-16-floats-9926e3bc2bd588ae4b09.digested.glb"},36399:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-c10-cleat-stf-d4367e92009c0b955539.digested.glb"},7077:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-c10-cleat-ec19a880945e694a9400.digested.glb"},73193:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-c12-cleat-stf-490500d6239dfd2ba906.digested.glb"},33615:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-c12-cleat-8582985a62e96e363128.digested.glb"},62135:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-framing-brackets-dade5108b93fb36a22a3.digested.glb"},88869:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-gangway-hinge-3ft-b23bf85a7086d44bbf42.digested.glb"},73050:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-gangway-hinge-4ft-7c935987dc9a1c35ffaa.digested.glb"},2635:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-gangway-short-rail-9bc6916ef79755f89be8.digested.glb"},94160:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-gangway-tall-rail-08f1749cd84b173bb636.digested.glb"},81041:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-gangway-transitional-plate-bd98e250ca03ee1042f6.digested.glb"},31743:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-ph-c-40f4a594cf27931cf8b6.digested.glb"},77183:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-ph-h10-c60f51235218f206645e.digested.glb"},89317:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-ph-h10r-f71d6e0691d76724aa04.digested.glb"},38649:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-ph-h10rp-027f4f35c4adad284f55.digested.glb"},92381:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-ph-h12-c5f0e937e34be9c29bbe.digested.glb"},13859:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-ph-h12r-e51c118eb62395c25844.digested.glb"},64867:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-ph-h12rp-2fb2c046d5eed7ae1eef.digested.glb"},31776:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-ph-h14-21a6fe6158fc39e156a7.digested.glb"},92753:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-ph-h14r-4065270c35d6f0028e42.digested.glb"},31005:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-ph-h14rp-41fc28b60226c3ca8b35.digested.glb"},22513:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-ph-h16-d6c443896412f0c8a9ab.digested.glb"},87487:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-ph-h16r-d2faf771ce802a7ca23e.digested.glb"},15175:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-ph-h16rp-6c7b06c3f2c6a4c0e62a.digested.glb"},247:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-ph-h18-e489f9833fd1daa7d2fb.digested.glb"},84749:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-ph-h18r-d16ce49f570601154dc8.digested.glb"},86961:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-ph-h18rp-d1d57790b6e74a5f087f.digested.glb"},32312:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-ph-hsr14-d2634e8d7671c107ae09.digested.glb"},94754:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-ph-hsr16-93e05ee4b4290163828f.digested.glb"},97832:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-ph-hsrp14-59ed54dedfbd54b36f61.digested.glb"},71506:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-ph-hsrp16-ccf18eb377b22364d4d8.digested.glb"},25235:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-ph-l10-650cedaac1e98e2ffdf4.digested.glb"},38353:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-ph-l12-b7c628e06e1d16803da4.digested.glb"},63295:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-ph-l14-3b3bb108768e9ddbb587.digested.glb"},65693:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-ph-l16-108b17b1950448597080.digested.glb"},83467:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-ph-l18-e59a15fc1d716f82a835.digested.glb"},4544:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-ph-l6-a48b373f9d2eb4e9d201.digested.glb"},70150:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-ph-l8-34716d090cb0ecffa085.digested.glb"},24461:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-pipe-holders-steel-channel-800002775a6810255f3c.digested.glb"},57237:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-pipe-holders-c49fa73b5e70b7119f9e.digested.glb"},13406:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-roller-deck-plate-e76dc79b414af6820c58.digested.glb"},1053:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-rub-rail-corner-9698ae530caeb6cff339.digested.glb"},92713:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-steel-channel-frames-155f2c60a303cefed4a4.digested.glb"},69189:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-steel-hardware-1754b333f7a6a34c590f.digested.glb"},18969:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-steel-truss-frames-b9a89e54d788c33c8b6b.digested.glb"},48387:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-steel-truss-tapered-frames-38b0feba81b911863b38.digested.glb"},34373:(e,t,r)=>{"use strict";e.exports=r.p+"am-docks-transition-plate-c40520308bc85d7f9b64.digested.glb"},84724:(e,t,r)=>{"use strict";e.exports=r.p+"baseplate-placeholder-9b3c1a210c076872c485.digested.glb"},84926:(e,t,r)=>{"use strict";e.exports=r.p+"citypost-cable-crimp-1d6b38644435b9b766bc.digested.glb"},72082:(e,t,r)=>{"use strict";e.exports=r.p+"citypost-cable-nuts-770938eed214b991231c.digested.glb"},49962:(e,t,r)=>{"use strict";e.exports=r.p+"citypost-corner-sleeves-8e04b4701f259a57c4a7.digested.glb"},13411:(e,t,r)=>{"use strict";e.exports=r.p+"citypost-post-36-fascia-74f1fbffcfe35ee14e31.digested.glb"},76313:(e,t,r)=>{"use strict";e.exports=r.p+"citypost-post-36-c04e91925aede82f2211.digested.glb"},56632:(e,t,r)=>{"use strict";e.exports=r.p+"citypost-post-42-fascia-c64958991f87050fe033.digested.glb"},64412:(e,t,r)=>{"use strict";e.exports=r.p+"citypost-post-42-7ee46319e175e6189a2e.digested.glb"},26072:(e,t,r)=>{"use strict";e.exports=r.p+"citypost-single-corner-post-36-938c32b3d108b2b6c4af.digested.glb"},65061:(e,t,r)=>{"use strict";e.exports=r.p+"citypost-single-corner-post-42-f088be3dc02c71e9074e.digested.glb"},39522:(e,t,r)=>{"use strict";e.exports=r.p+"citypost-slope-transition-sleeves-ff32dfe138fee284273c.digested.glb"},92831:(e,t,r)=>{"use strict";e.exports=r.p+"citypost-stair-post-36-fascia-c5300dacb122d0d150c9.digested.glb"},5069:(e,t,r)=>{"use strict";e.exports=r.p+"citypost-stair-post-36-e502b2d6e347208df5eb.digested.glb"},79764:(e,t,r)=>{"use strict";e.exports=r.p+"citypost-stair-post-42-fascia-2924e03b3656abcd5d5c.digested.glb"},37520:(e,t,r)=>{"use strict";e.exports=r.p+"citypost-stair-post-42-65f7ce5354eaadf37ffe.digested.glb"},53871:(e,t,r)=>{"use strict";e.exports=r.p+"citypost-straight-sleeves-d72775cbbf3bac299033.digested.glb"},62381:(e,t,r)=>{"use strict";e.exports=r.p+"corner-90-sleeve-placeholder-da7b17aeae6a4b57dc49.digested.glb"},70148:(e,t,r)=>{"use strict";e.exports=r.p+"debug-axis-90d322c9386668303056.digested.glb"},99745:(e,t,r)=>{"use strict";e.exports=r.p+"ez-boat-port-side-extension-2495756e1e399f3d1302.digested.glb"},84469:(e,t,r)=>{"use strict";e.exports=r.p+"ez-boat-port-808ead6bce47bc0a5a96.digested.glb"},25057:(e,t,r)=>{"use strict";e.exports=r.p+"ez-dock-100in-8ba24194c3068d897eba.digested.glb"},25464:(e,t,r)=>{"use strict";e.exports=r.p+"ez-dock-40in-76b6614dfbc60ec0ad21.digested.glb"},72122:(e,t,r)=>{"use strict";e.exports=r.p+"ez-dock-60in-4620ba86e8f68ba6e8ba.digested.glb"},33149:(e,t,r)=>{"use strict";e.exports=r.p+"ez-dock-80in-low-profile-e829c8d5fa47acc6339f.digested.glb"},13628:(e,t,r)=>{"use strict";e.exports=r.p+"ez-dock-80in-3451b55a65ae495e882d.digested.glb"},47809:(e,t,r)=>{"use strict";e.exports=r.p+"ez-dock-air-assist-1e6d291cc1a33c86efbc.digested.glb"},41917:(e,t,r)=>{"use strict";e.exports=r.p+"ez-dock-baby-dock-9bc628a4d08c049a06fb.digested.glb"},9597:(e,t,r)=>{"use strict";e.exports=r.p+"ez-dock-bench-with-arm-rests-e9cf09a702023301b3ce.digested.glb"},68471:(e,t,r)=>{"use strict";e.exports=r.p+"ez-dock-bench-43db836b67eb63d120c7.digested.glb"},960:(e,t,r)=>{"use strict";e.exports=r.p+"ez-dock-dog-bone-coupler-low-profile-cc08341a262a2d205238.digested.glb"},34801:(e,t,r)=>{"use strict";e.exports=r.p+"ez-dock-dog-bone-coupler-bc16da788adfbe1c8282.digested.glb"},850:(e,t,r)=>{"use strict";e.exports=r.p+"ez-dock-float-tank-686bcfdda4d78374c3df.digested.glb"},98393:(e,t,r)=>{"use strict";e.exports=r.p+"ez-dock-gangway-grating-3x10-03ed536f7eb6dbb0c4e7.digested.glb"},30024:(e,t,r)=>{"use strict";e.exports=r.p+"ez-dock-gangway-grating-3x15-2eb79b409079486cea67.digested.glb"},98768:(e,t,r)=>{"use strict";e.exports=r.p+"ez-dock-gangway-grating-3x20-bf0fe139db9b0a0aed08.digested.glb"},19009:(e,t,r)=>{"use strict";e.exports=r.p+"ez-dock-gangway-grating-3x25-6a528571052207e501c6.digested.glb"},95455:(e,t,r)=>{"use strict";e.exports=r.p+"ez-dock-gangway-grating-3x30-fc7049260d763e7a3373.digested.glb"},45060:(e,t,r)=>{"use strict";e.exports=r.p+"ez-dock-gangway-grating-4x10-46da8ccd86245d85e59e.digested.glb"},87837:(e,t,r)=>{"use strict";e.exports=r.p+"ez-dock-gangway-grating-4x15-b9a25317982e8f2ecde5.digested.glb"},30285:(e,t,r)=>{"use strict";e.exports=r.p+"ez-dock-gangway-grating-4x20-6298642a08df08c54cb1.digested.glb"},88244:(e,t,r)=>{"use strict";e.exports=r.p+"ez-dock-gangway-grating-4x25-b25bb48e4107c943e772.digested.glb"},13334:(e,t,r)=>{"use strict";e.exports=r.p+"ez-dock-gangway-grating-4x30-678e1d3dc87deefb528a.digested.glb"},33782:(e,t,r)=>{"use strict";e.exports=r.p+"ez-dock-gangway-solid-3x10-70ca073ac2daa9b1218f.digested.glb"},77255:(e,t,r)=>{"use strict";e.exports=r.p+"ez-dock-gangway-solid-3x15-c07a308214ae1653940b.digested.glb"},89539:(e,t,r)=>{"use strict";e.exports=r.p+"ez-dock-gangway-solid-3x20-4bc3dda545d08cbdb05d.digested.glb"},72730:(e,t,r)=>{"use strict";e.exports=r.p+"ez-dock-gangway-solid-3x25-1e49cff7001a03f707ff.digested.glb"},65508:(e,t,r)=>{"use strict";e.exports=r.p+"ez-dock-gangway-solid-3x30-ecd82dc3c44e4642a95b.digested.glb"},56975:(e,t,r)=>{"use strict";e.exports=r.p+"ez-dock-gangway-solid-4x10-adcb54b56693ad28c91d.digested.glb"},56510:(e,t,r)=>{"use strict";e.exports=r.p+"ez-dock-gangway-solid-4x15-1f81b94383c24bf99eed.digested.glb"},80882:(e,t,r)=>{"use strict";e.exports=r.p+"ez-dock-gangway-solid-4x20-4d567a998f7db3a8e111.digested.glb"},75867:(e,t,r)=>{"use strict";e.exports=r.p+"ez-dock-gangway-solid-4x25-5da2b5c5856d4b1e547a.digested.glb"},20297:(e,t,r)=>{"use strict";e.exports=r.p+"ez-dock-gangway-solid-4x30-c6139e73f78c9de6afbe.digested.glb"},6686:(e,t,r)=>{"use strict";e.exports=r.p+"ez-dock-half-hex-294964c5832a4ec17b8d.digested.glb"},92874:(e,t,r)=>{"use strict";e.exports=r.p+"ez-dock-kayak-launch-73658bb8b2f8a8e44c5d.digested.glb"},84553:(e,t,r)=>{"use strict";e.exports=r.p+"ez-dock-ladder-49cd80000eb8469f1cd2.digested.glb"},55996:(e,t,r)=>{"use strict";e.exports=r.p+"ez-dock-long-bunk-cb46c6ba14b8d66d440c.digested.glb"},82096:(e,t,r)=>{"use strict";e.exports=r.p+"ez-dock-pocket-filler-0bb6b3bfff4eb72814b2.digested.glb"},23162:(e,t,r)=>{"use strict";e.exports=r.p+"ez-dock-tri-e6aa02fe66e2b9705d27.digested.glb"},14385:(e,t,r)=>{"use strict";e.exports=r.p+"ez-port-260-8333885ee0b24bc07616.digested.glb"},78827:(e,t,r)=>{"use strict";e.exports=r.p+"ez-port-280-9b761fc848658697247c.digested.glb"},95604:(e,t,r)=>{"use strict";e.exports=r.p+"ez-port-2i-bow-stop-9cb3f1548f4132770bb4.digested.glb"},37894:(e,t,r)=>{"use strict";e.exports=r.p+"ez-port-2i-80b6f38aa93a82cc5e9f.digested.glb"},58153:(e,t,r)=>{"use strict";e.exports=r.p+"ez-port-full-deck-bow-07cb499df2b7752588a2.digested.glb"},56684:(e,t,r)=>{"use strict";e.exports=r.p+"ez-port-max-easy-lift-entry-1225263651a094acb1b8.digested.glb"},55552:(e,t,r)=>{"use strict";e.exports=r.p+"ez-port-max-entry-86b513244900143afe40.digested.glb"},639:(e,t,r)=>{"use strict";e.exports=r.p+"ez-port-max-extension-7b3e3be8aabeccadb0c3.digested.glb"},60739:(e,t,r)=>{"use strict";e.exports=r.p+"ez-port-small-bow-ecf7781a93f0970ed7a7.digested.glb"},83751:(e,t,r)=>{"use strict";e.exports=r.p+"ez-port-vxp-ddcb4855db8380c7c7a7.digested.glb"},60159:(e,t,r)=>{"use strict";e.exports=r.p+"falcon-glass-gate-hinge-8443c7e5111530bfdf6a.digested.glb"},76963:(e,t,r)=>{"use strict";e.exports=r.p+"falcon-picket-rail-corner-sleeve-491fbe089ddd2841a294.digested.glb"},87534:(e,t,r)=>{"use strict";e.exports=r.p+"falcon-picket-rail-downward-slope-sleeve-7a6c87467c1013b8234b.digested.glb"},51099:(e,t,r)=>{"use strict";e.exports=r.p+"falcon-picket-rail-upward-slope-sleeve-defffb75633f68cf6cff.digested.glb"},36970:(e,t,r)=>{"use strict";e.exports=r.p+"generic-2-in-pipe-sleeve-lower-corner-90-25562e245d6a8cd81774.digested.glb"},7615:(e,t,r)=>{"use strict";e.exports=r.p+"generic-2-in-pipe-sleeve-lower-corner-adjustable-6f16b62a0d25e45b273b.digested.glb"},9670:(e,t,r)=>{"use strict";e.exports=r.p+"generic-2-in-pipe-sleeve-lower-line-4200e9a83608f7451d6d.digested.glb"},31132:(e,t,r)=>{"use strict";e.exports=r.p+"generic-2-in-pipe-sleeve-lower-slope-line-398d35f82ccdcf3c61cd.digested.glb"},1362:(e,t,r)=>{"use strict";e.exports=r.p+"generic-2-in-pipe-sleeve-lower-slope-terminal-722444d3feeb83d2f8ac.digested.glb"},41703:(e,t,r)=>{"use strict";e.exports=r.p+"generic-2-in-pipe-sleeve-lower-slope-transition-968e9178858f9e0f9087.digested.glb"},75008:(e,t,r)=>{"use strict";e.exports=r.p+"generic-2-in-pipe-sleeve-lower-terminal-4e5dd3dc996e94faa3d6.digested.glb"},94190:(e,t,r)=>{"use strict";e.exports=r.p+"generic-2-in-pipe-sleeve-upper-corner-90-94cd6256338311f9b82b.digested.glb"},99420:(e,t,r)=>{"use strict";e.exports=r.p+"generic-2-in-pipe-sleeve-upper-corner-adjustable-ab8ba7da66072cfd8459.digested.glb"},14603:(e,t,r)=>{"use strict";e.exports=r.p+"generic-2-in-pipe-sleeve-upper-line-e9afd2bc2f33950cf6b0.digested.glb"},18469:(e,t,r)=>{"use strict";e.exports=r.p+"generic-2-in-pipe-sleeve-upper-slope-line-6ff15ca52b09a2ce9ee5.digested.glb"},54411:(e,t,r)=>{"use strict";e.exports=r.p+"generic-2-in-pipe-sleeve-upper-slope-terminal-de7f9f727de6fbc3e348.digested.glb"},95886:(e,t,r)=>{"use strict";e.exports=r.p+"generic-2-in-pipe-sleeve-upper-slope-transition-24dc31576bc4d521f0c6.digested.glb"},80125:(e,t,r)=>{"use strict";e.exports=r.p+"generic-2-in-pipe-sleeve-upper-terminal-6aeac696e3bd782bd25e.digested.glb"},62312:(e,t,r)=>{"use strict";e.exports=r.p+"generic-cleat-7a1a824a1649a5b73c5a.digested.glb"},9919:(e,t,r)=>{"use strict";e.exports=r.p+"generic-dock-ladder-3ec55890bf17afa1fc2c.digested.glb"},59453:(e,t,r)=>{"use strict";e.exports=r.p+"generic-sling-boat-lift-73ae178d3f21364686dc.digested.glb"},64486:(e,t,r)=>{"use strict";e.exports=r.p+"hollaender-connector-11E-8-00863a6e292abc791900.digested.glb"},91370:(e,t,r)=>{"use strict";e.exports=r.p+"hollaender-connector-3-8-b0eea8c5929da95a6bab.digested.glb"},81015:(e,t,r)=>{"use strict";e.exports=r.p+"hollaender-connector-30C-8-half-02a667137e4d6480fc87.digested.glb"},85304:(e,t,r)=>{"use strict";e.exports=r.p+"hollaender-connector-5-8-6711dad2f5d59c75809d.digested.glb"},2949:(e,t,r)=>{"use strict";e.exports=r.p+"hollaender-connector-5E-8-8d2d13cf1551ad8e4065.digested.glb"},58303:(e,t,r)=>{"use strict";e.exports=r.p+"hollaender-connector-7E-8-9fea04a9f7182aa64081.digested.glb"},36404:(e,t,r)=>{"use strict";e.exports=r.p+"hollaender-connector-9-8-f398fb7b4874d7d38dd5.digested.glb"},78740:(e,t,r)=>{"use strict";e.exports=r.p+"hollaender-connector-cap-60-8-01eb60447c4b57e4d471.digested.glb"},74957:(e,t,r)=>{"use strict";e.exports=r.p+"hollaender-panel-13-0d02f5afc431e7c3b9bf.digested.glb"},64087:(e,t,r)=>{"use strict";e.exports=r.p+"hollaender-panel-20-6cb3bf15e06625967ff8.digested.glb"},82172:(e,t,r)=>{"use strict";e.exports=r.p+"hollaender-panel-27-fbd3425ba9fdc0333e8a.digested.glb"},34284:(e,t,r)=>{"use strict";e.exports=r.p+"hollaender-panel-34-cc8f0450167e68654b91.digested.glb"},11376:(e,t,r)=>{"use strict";e.exports=r.p+"hollaender-panel-41-84f4d1ead45958f34ed4.digested.glb"},48178:(e,t,r)=>{"use strict";e.exports=r.p+"hollaender-post-baseplate-d97b74b9d04d6153140c.digested.glb"},6814:(e,t,r)=>{"use strict";e.exports=r.p+"kee-klamp-single-socket-tee-31d3d721c6999229223a.digested.glb"},38552:(e,t,r)=>{"use strict";e.exports=r.p+"kona-cube-65c7b82bf3989685d73b.digested.glb"},3138:(e,t,r)=>{"use strict";e.exports=r.p+"kona-pin-06a82111f14cb45a3b83.digested.glb"},91303:(e,t,r)=>{"use strict";e.exports=r.p+"kona-spacer-fb92763d31cfdbfa9265.digested.glb"},51724:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-101_d48-3f932a1b8e4257f124ce.digested.glb"},85466:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-104-ETD-2a17a0e9d1c5428af6ed.digested.glb"},71500:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-104-ETJ-c55c923fd28c8c78c11f.digested.glb"},20869:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-104_d48-64f57c9d88bbc32801da.digested.glb"},13648:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-116_d48-1e3f9b7b38c711568958.digested.glb"},78239:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-119_d48-9ce75a8b6db6271f1b0d.digested.glb"},34835:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-124_d48-2d7babb9ebe17716c5cd.digested.glb"},40126:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-125_d48-2c7d46272a1dc7b54e62.digested.glb"},9704:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-127_d48-1935d800b0fd945678d3.digested.glb"},8135:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-128_d48-08248e270e40f945aaf1.digested.glb"},46274:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-129_d48-4532c8338874a499e038.digested.glb"},95888:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-130_d48-4d3fea0791344fa3edca.digested.glb"},43613:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-139_d48-1406ee8250ad585f3e1d.digested.glb"},83183:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-146_d48-04828718748710f5acf9.digested.glb"},15:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-148_d48-with-cap-3497b542ba46715572f0.digested.glb"},42885:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-148_d48-6249fb8106ed13b4556e.digested.glb"},17880:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-152_d48-ced6710ffe561ca95818.digested.glb"},91741:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-153_d48-89eddb05d58822108810.digested.glb"},63646:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-155-ETJ-1c601edfc0b4402b63f1.digested.glb"},4927:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-155_d48-7a14c8d5b5cb52870c57.digested.glb"},2724:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-156_d48-20b94ae775d42587e427.digested.glb"},6512:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-180-ETJ-4607d78d5685647c3099.digested.glb"},30953:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-180_d48-a1991fe20761d1456665.digested.glb"},1761:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-181-ETJ-ae579ed6f5ef219b5a64.digested.glb"},73764:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-181_d48-7961f5839f2be03cc2d4.digested.glb"},69471:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-182_d48-0626b4b8d01cd8990412.digested.glb"},16218:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-183_d48-90c2ddf255101842868e.digested.glb"},26237:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-184_d48-e7e94cf602ae6705bf62.digested.glb"},35e3:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-185_d48-a53587ed7c6bb8e58c48.digested.glb"},29603:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-186_d48-7cac1f100ab26773ab76.digested.glb"},17006:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-187_d48-20b94ae775d42587e427.digested.glb"},22684:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-189_d48-f108417c20697efb744f.digested.glb"},47074:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-198_d48-e57492ddbe9863c9c328.digested.glb"},76647:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-199_d48-d1f3df2ab8962a1405da.digested.glb"},88401:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-232_d48-2b15f9b00f29e8090226.digested.glb"},45356:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-233_d48-e7643a90c901f3e013c7.digested.glb"},89520:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-242_d48-a05f90723855905ac09b.digested.glb"},5931:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-252_d48-ced6710ffe561ca95818.digested.glb"},14102:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-253_d48-4c766d0f7918a7611e2e.digested.glb"},26348:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-255_d48-4d3fea0791344fa3edca.digested.glb"},77472:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-256-ETD-1935d800b0fd945678d3.digested.glb"},1767:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-256_d48-1935d800b0fd945678d3.digested.glb"},65844:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-725_d48-18171fa33988ae335ece.digested.glb"},73357:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-746_d48-d00752d2ec9ebcdaad58.digested.glb"},21237:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-751_d48-d288e346b254053f1dff.digested.glb"},95142:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-752_d48-18ba771bef9813af1e39.digested.glb"},26241:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-755_d48-210c468f52bb3ad403ec.digested.glb"},75026:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-756_d48-fe5284ea202ef381158d.digested.glb"},82903:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-757_d48-8a56fd9617ceca594b3d.digested.glb"},52888:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-758_d48-6c1f523ab082211bcddf.digested.glb"},11301:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-764_d48-a8e25a3e366d8e517795.digested.glb"},32452:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-ASSY_753M_173F_3D-98d1a059c9a0ad0f08f4.digested.glb"},33844:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-ASSY_754D48_173F_3D-873afd841d57e2032775.digested.glb"},57760:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-ETD-0b86ffcafb42df380968.digested.glb"},67462:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-ETJ-d8675f1fb868c88de63b.digested.glb"},18628:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-mezzanine-gate-ca3c9e116f5f8649798a.digested.glb"},65413:(e,t,r)=>{"use strict";e.exports=r.p+"kwikclamp-temp-fitting-956a0ccd2fab9f7d57b2.digested.glb"},23538:(e,t,r)=>{"use strict";e.exports=r.p+"oasis-lift-motor-6e77ae63bacd1af9f4ca.digested.glb"},96098:(e,t,r)=>{"use strict";e.exports=r.p+"oasis-shaft-bracket-857c59e2fcd6b93db336.digested.glb"},25701:(e,t,r)=>{"use strict";e.exports=r.p+"omega-angle-bracket-30-b154f790e6596656bd2c.digested.glb"},62225:(e,t,r)=>{"use strict";e.exports=r.p+"omega-angle-bracket-45-f16a9636148e4251709a.digested.glb"},37330:(e,t,r)=>{"use strict";e.exports=r.p+"omega-angle-bracket-60-1edc1e3d0b4651abe1f2.digested.glb"},97575:(e,t,r)=>{"use strict";e.exports=r.p+"omega-corner-cap-c1b8c36d9f0fcd8932cf.digested.glb"},99520:(e,t,r)=>{"use strict";e.exports=r.p+"omega-double-inline-bracket-flipped-f4fdc65cb64334adb925.digested.glb"},25851:(e,t,r)=>{"use strict";e.exports=r.p+"omega-double-inline-bracket-ea00364a92369fcddda1.digested.glb"},7384:(e,t,r)=>{"use strict";e.exports=r.p+"omega-inline-bracket-flipped-83521116ae1276c50f75.digested.glb"},54595:(e,t,r)=>{"use strict";e.exports=r.p+"omega-inline-bracket-310a6f43d7c84be8073a.digested.glb"},25922:(e,t,r)=>{"use strict";e.exports=r.p+"omega-inside-corner-bracket-e63ee35938ae64800480.digested.glb"},83168:(e,t,r)=>{"use strict";e.exports=r.p+"omega-lift-out-double-rail-assembly-flipped-7e92b1abf98407c52fca.digested.glb"},86651:(e,t,r)=>{"use strict";e.exports=r.p+"omega-lift-out-double-rail-assembly-d56458b91f491605a395.digested.glb"},86570:(e,t,r)=>{"use strict";e.exports=r.p+"omega-lift-out-rail-assembly-flipped-17621e8f197970d825b6.digested.glb"},93081:(e,t,r)=>{"use strict";e.exports=r.p+"omega-lift-out-rail-assembly-3589f7a4281a2f1fcf67.digested.glb"},16347:(e,t,r)=>{"use strict";e.exports=r.p+"omega-post-18-4a562a6e62c3d8f13250.digested.glb"},39468:(e,t,r)=>{"use strict";e.exports=r.p+"omega-post-44-7311e90af0c0ee1fe8f9.digested.glb"},45769:(e,t,r)=>{"use strict";e.exports=r.p+"omega-removable-double-rail-hinge-bcee857a442a5562cf25.digested.glb"},67585:(e,t,r)=>{"use strict";e.exports=r.p+"omega-removable-rail-hinge-7e1e42612eda29875380.digested.glb"},40519:(e,t,r)=>{"use strict";e.exports=r.p+"omega-self-closing-gate-end-f613c7e985cacd6f1d74.digested.glb"},32467:(e,t,r)=>{"use strict";e.exports=r.p+"omega-self-closing-gate-mount-73a10837488aaa8f630c.digested.glb"},49743:(e,t,r)=>{"use strict";e.exports=r.p+"omega-swing-gate-36-6789d365fcda34177610.digested.glb"},73388:(e,t,r)=>{"use strict";e.exports=r.p+"omega-swing-gate-48-79955c215d88ca1a9f6c.digested.glb"},64038:(e,t,r)=>{"use strict";e.exports=r.p+"omega-swing-gate-60-26f492902c4915751b55.digested.glb"},9185:(e,t,r)=>{"use strict";e.exports=r.p+"omega-wrap-around-flare-flipped-9d935a37a2770357c8bb.digested.glb"},60306:(e,t,r)=>{"use strict";e.exports=r.p+"omega-wrap-around-flare-c9cdc704404217a4c9b5.digested.glb"},70257:(e,t,r)=>{"use strict";e.exports=r.p+"rogue-fabricators-hand-grab-stem-ad691f952cd2720ccfd9.digested.glb"},9590:(e,t,r)=>{"use strict";e.exports=r.p+"safesmart-platform-rail-end-c6b8279d30dda2eb9653.digested.glb"},64646:(e,t,r)=>{"use strict";e.exports=r.p+"safesmart-platform-rail-middle-050a515b2b30165df40a.digested.glb"},85961:(e,t,r)=>{"use strict";e.exports=r.p+"safesmart-platform-rail-start-13bc8d9c28cc8a0cfa03.digested.glb"},7592:(e,t,r)=>{"use strict";e.exports=r.p+"safesmart-stair-rail-2-step-7149bb465089d82deb96.digested.glb"},52644:(e,t,r)=>{"use strict";e.exports=r.p+"safesmart-stair-rail-bottom-785d7de1920b145781e1.digested.glb"},28154:(e,t,r)=>{"use strict";e.exports=r.p+"safesmart-stair-rail-middle-49830f269fe6ed785191.digested.glb"},23576:(e,t,r)=>{"use strict";e.exports=r.p+"safesmart-stair-rail-top-b61ca2d6b15e29b37c08.digested.glb"},61120:(e,t,r)=>{"use strict";e.exports=r.p+"color-b9854561fb8d8f187c90.digested.jpg"},4836:(e,t,r)=>{"use strict";e.exports=r.p+"normal-f251b29ce62ff5363b7b.digested.jpg"},94665:(e,t,r)=>{"use strict";e.exports=r.p+"opacity-1393849baddd7637ca72.digested.jpg"},20123:(e,t,r)=>{"use strict";e.exports=r.p+"roughness-fe533e59c54f4d1c2d66.digested.jpg"},22642:(e,t,r)=>{"use strict";e.exports=r.p+"color-717075a16614e26ec60c.digested.jpg"},90822:(e,t,r)=>{"use strict";e.exports=r.p+"normal-f855d0d6774cab32d072.digested.jpg"},93765:(e,t,r)=>{"use strict";e.exports=r.p+"roughness-cedc265663ed6a3e2d87.digested.jpg"},61449:(e,t,r)=>{"use strict";e.exports=r.p+"ambient_occlusion-9b152d4b0c125b5e7841.digested.jpg"},89134:(e,t,r)=>{"use strict";e.exports=r.p+"color-d14f1f5441968dd60e9f.digested.jpg"},63730:(e,t,r)=>{"use strict";e.exports=r.p+"normal-a4e3bb45b9ab56d9fd06.digested.jpg"},54209:(e,t,r)=>{"use strict";e.exports=r.p+"roughness-094b1b2a64afe15c1778.digested.jpg"},80192:(e,t,r)=>{"use strict";e.exports=r.p+"normal-805e4a6e219474d6b209.digested.jpg"},6161:(e,t,r)=>{"use strict";e.exports=r.p+"color-1c6883c3fbdcf1d4dbfe.digested.jpg"},27699:(e,t,r)=>{"use strict";e.exports=r.p+"normal-c978bf4c6579c0a5353b.digested.jpg"},90430:(e,t,r)=>{"use strict";e.exports=r.p+"roughness-9b8869fffc84431d09dd.digested.jpg"},10298:(e,t,r)=>{"use strict";e.exports=r.p+"color-db6266b89689d887d2a2.digested.jpg"},78574:(e,t,r)=>{"use strict";e.exports=r.p+"normal-b10811c246a1a9658d7d.digested.jpg"},65645:(e,t,r)=>{"use strict";e.exports=r.p+"roughness-7202b0cf45401d99e78e.digested.jpg"},41719:(e,t,r)=>{"use strict";e.exports=r.p+"color-2e28d85dae0fd56f67f3.digested.jpg"},12961:(e,t,r)=>{"use strict";e.exports=r.p+"normal-be2fea21bc6c865642fc.digested.jpg"},83796:(e,t,r)=>{"use strict";e.exports=r.p+"roughness-3ecf3ecfbd1018dc3f6e.digested.jpg"},79820:(e,t,r)=>{"use strict";e.exports=r.p+"normal-1ea60c3a258d1a13013a.digested.jpg"},86149:(e,t,r)=>{"use strict";e.exports=r.p+"color-91f362ba34e2b6f2ee16.digested.jpg"},6264:(e,t,r)=>{"use strict";e.exports=r.p+"metalness-d6432c275f4971b7b026.digested.jpg"},69527:(e,t,r)=>{"use strict";e.exports=r.p+"normal-c0bdd971fbbf6b735da3.digested.jpg"},74482:(e,t,r)=>{"use strict";e.exports=r.p+"roughness-d038ebe222417cab7f64.digested.jpg"},47398:(e,t,r)=>{"use strict";e.exports=r.p+"color-283dafdc5d607f64cec8.digested.jpg"},55786:(e,t,r)=>{"use strict";e.exports=r.p+"normal-f385af9f0d9e33e055e4.digested.jpg"},83385:(e,t,r)=>{"use strict";e.exports=r.p+"roughness-0a6af8b5439c1f7b82b0.digested.jpg"},46774:(e,t,r)=>{"use strict";e.exports=r.p+"ambient_occlusion-8faf4ade933a78d46fe2.digested.jpg"},75917:(e,t,r)=>{"use strict";e.exports=r.p+"color-8b93d67325192514bbbe.digested.jpg"},7071:(e,t,r)=>{"use strict";e.exports=r.p+"normal-50e92313427041228bf4.digested.jpg"},76762:(e,t,r)=>{"use strict";e.exports=r.p+"roughness-6e1b3d1422c8fda1dbd5.digested.jpg"},53573:(e,t,r)=>{"use strict";e.exports=r.p+"color-c832d9c2ce8b32b25821.digested.jpg"},33083:(e,t,r)=>{"use strict";e.exports=r.p+"displacement-490516df51ba0df9ffd1.digested.jpg"},96695:(e,t,r)=>{"use strict";e.exports=r.p+"normal-1368f1ce35fca794bf1d.digested.jpg"},21490:(e,t,r)=>{"use strict";e.exports=r.p+"roughness-3e179a536457e64e77ad.digested.jpg"},63639:(e,t,r)=>{"use strict";e.exports=r.p+"color-cfe65a74391d982269b0.digested.jpg"},68449:(e,t,r)=>{"use strict";e.exports=r.p+"normal-f855d0d6774cab32d072.digested.jpg"},11476:(e,t,r)=>{"use strict";e.exports=r.p+"roughness-cedc265663ed6a3e2d87.digested.jpg"},16101:(e,t,r)=>{"use strict";e.exports=r.p+"3DView-bc84900f5a33c88d6854.digested.svg"},47130:(e,t,r)=>{"use strict";e.exports=r.p+"BottomView-2575dfd6efc67db0762d.digested.svg"},2225:(e,t,r)=>{"use strict";e.exports=r.p+"DotMenu-21f72ccb7ef8b660cc38.digested.svg"},57135:(e,t,r)=>{"use strict";e.exports=r.p+"FrontView-14663601ba9cd1648541.digested.svg"},63803:(e,t,r)=>{"use strict";e.exports=r.p+"KeyboardArrowDown-19fa930238cb074a0169.digested.svg"},83676:(e,t,r)=>{"use strict";e.exports=r.p+"KeyboardArrowLeft-b9086b25f1c0567fd22f.digested.svg"},14403:(e,t,r)=>{"use strict";e.exports=r.p+"KeyboardArrowRight-fb3c1de20da384aca92b.digested.svg"},59412:(e,t,r)=>{"use strict";e.exports=r.p+"KeyboardArrowUp-c23226152ff169f0ae1d.digested.svg"},65375:(e,t,r)=>{"use strict";e.exports=r.p+"LeftView-e1217c88a3604e7ab5bb.digested.svg"},52012:(e,t,r)=>{"use strict";e.exports=r.p+"QuestionMark-16c0838b9f2e351eeeb5.digested.svg"},8254:(e,t,r)=>{"use strict";e.exports=r.p+"RearView-c3dcb9ffb96246d25367.digested.svg"},86836:(e,t,r)=>{"use strict";e.exports=r.p+"RightView-9e33435ec7b76ce62b05.digested.svg"},11595:(e,t,r)=>{"use strict";e.exports=r.p+"TopView-de29d5427be4fadcdb0b.digested.svg"},90725:(e,t,r)=>{"use strict";e.exports=r.p+"ZoomDropdown-162650c0063d73736420.digested.svg"},56387:()=>{},26696:()=>{},41543:()=>{},41234:()=>{},60575:()=>{},48087:(e,t,r)=>{const n=r(26748);n.keys().forEach(n)},63622:(e,t,r)=>{const n=r(61951),i=r(10793),s=r(25418),o=[n,i,s];e.exports={all:o,findByName:function(e){return o.find((t=>t.name===e))},RailingCollectionToolPanel:n,ToolContextMessagePanel:i,ToolPropertyPanel:s}},31700:(e,t,r)=>{const{ApiClient:n}=r(7340);n.configure((e=>{e.baseUrl="/api",e.compress=!0}))},29916:(e,t,r)=>{const{RailingComponent:n}=r(8423),{extend:i}=r(50988),s=r(19744);Object.defineProperty(n.prototype,"materials",{get:function(){return this.componentOf?.().materials??{}},configurable:!0}),Object.defineProperty(n.prototype,"colors",{get:function(){return this.componentOf?.().colors??{}},configurable:!0}),i(n,s)},57699:(e,t,r)=>{const n=r(85530);let i;if(!i){const e=r(29665);i=e.keys().map(e)}const s={};i.forEach((e=>{Object.keys(e).forEach((t=>{t in s||(s[t]={}),s[t]={...s[t],...e[t]}}))})),n.translations=s},44158:(e,t,r)=>{const{MigrationRegistry:n}=r(57075);r(24570);let i=[];const s=r(41178);i=s.keys().map(s),n.instance().add(...i)},61280:(e,t,r)=>{let n;try{n="function"!=typeof r(56387).readFile}catch{n=!0}if(n){const e=r(2766);e.keys().map(e)}},82372:(e,t,r)=>{const{SmartObjectBuilder:n,SmartJsonBuilder:i}=r(57075),{ImperialDecimalLengthFormatter:s,ImperialFractionLengthFormatter:o}=r(7340),a=r(8423),l=r(9649),c=r(13002),u=r(94073),d=r(70666),h=r(7524),p=r(98573),m=r(10711),f=r(27915),g=r(89941),y=r(34459),b=r(47159),v=r(90907),_=r(55421),x=r(79574),w=r(8389),R=r(7734),k=r(6916),j=r(71283),z=r(45615),q=r(43530),$=r(97108),Z=r(46353),X=r(83550),Y=r(90218),ee=r(54558),te=r(83465),re=r(84255),ne=r(52494),ie=r(56768),se=r(49053),oe=r(30915),ae=r(97477),le=r(33496);r(24570);let ce=[],ue=[];const de=r(16948);ce=de.keys().map(de);const he=r(21269);ue=he.keys().map(he);class LegacyComponent{}class KalaniDockStrategy{dockClass(){return w}}class LShapedDockStrategy{dockClass(){return R}}class MahinaDockStrategy{dockClass(){return j}}class OhanaDockStrategy{dockClass(){return q}}class TShapedDockStrategy{dockClass(){return ee}}class UShapedDockStrategy{dockClass(){return se}}const pe=new re;n.configure((e=>{e.classes.addClasses(...ce),e.classes.addClasses(...Object.values(a)),e.classes.addClasses(...ue),e.classes.addClass(l,"AMDock"),e.classes.addClass(c,"AMDockSection"),e.classes.addClass(u),e.classes.addClass(d),e.classes.addClass(h,"DIYDocksProject"),e.classes.addClass(h,"KonaDocksProject"),e.classes.addClass(p),e.classes.addClass(m),e.classes.addClass(f),e.classes.addClass(g),e.classes.addClass(y),e.classes.addClass(b),e.classes.addClass(v),e.classes.addClass(_,"FixedDock"),e.classes.addClass(s),e.classes.addClass(s),e.classes.addClass(s,"ImperialDecimalFormatter"),e.classes.addClass(o),e.classes.addClass(o),e.classes.addClass(o,"ImperialFractionFormatter"),e.classes.addClass(x,"KAndSZone"),e.classes.addClass(KalaniDockStrategy,"KalaniDockStrategy"),e.classes.addClass(LShapedDockStrategy,"LShapedDockStrategy"),e.classes.addClass(LegacyComponent,"AluminumStrategy"),e.classes.addClass(LegacyComponent,"FalconColorOption"),e.classes.addClass(LegacyComponent,"FixedHeightStrategy"),e.classes.addClass(LegacyComponent,"FullHeightStrategy"),e.classes.addClass(LegacyComponent,"OffsetHeightStrategy"),e.classes.addClass(LegacyComponent,"WoodenStrategy"),e.classes.addClass(k,"Gangway"),e.classes.addClass(MahinaDockStrategy,"MahinaDockStrategy"),e.classes.addClass(z),e.classes.addClass(OhanaDockStrategy,"OhanaDockStrategy"),e.classes.addClass($,"OmegaWrapAroundFlair"),e.classes.addClass(Z,"RogueFabricatorsHorizontalBarRailingStyle"),e.classes.addClass(X,"RogueFabricatorsCableRailingStyle"),e.classes.addClass(Y),e.classes.addClass(TShapedDockStrategy,"TShapedDockStrategy"),e.classes.addClass(te,"DockBoard"),e.classes.addClass(ne,"RailingDepotPlacementStrategy"),e.classes.addClass(ie,"AMMeasurementAnnotation"),e.classes.addClass(UShapedDockStrategy,"UShapedDockStrategy"),e.classes.addClass(oe,"WatersideBerthDock"),e.classes.addClass(Y),e.classes.addClass(le,"HollaenderRailingRun"),e.classes.addClass(ae,"HollaenderRailingCollection"),e.externalObjectCache=pe})),i.configure((e=>{e.externalObjectCache=pe}))},7732:(e,t,r)=>{const n=r(63768),{Unit:i}=r(62048);n.createUnit("konacube",{definition:"50 cm",aliases:["konacubes","kc","kcs"]}),n.createUnit("adaptastepplank",{definition:"9.5 in",aliases:["plank","planks"]}),n.createUnit("fullsheet",{definition:n.unit(32,"sqft"),aliases:["sheet","sheets","fullsheets","sheet4x8"]}),n.createUnit("halfsheet",{definition:n.unit(.5,"fullsheet"),aliases:["halfsheets","sheet4x4"]}),n.createUnit("quartersheet",{definition:n.unit(.25,"fullsheet"),aliases:["quartersheets","sheet2x4"]}),n.createUnit("wallboardx8",{definition:n.unit(5.5/12*8,"sqft"),aliases:["wallboard"]}),n.createUnit("wallboardx12",{definition:n.unit(1.5,"wallboardx8")}),n.createUnit("wallboardx16",{definition:n.unit(2,"wallboardx8")}),n.createUnit("pdfpoint",{definition:n.unit(1/72,"in"),aliases:["pdf","pdfpoints"]}),n.createUnit("percent",{baseName:"Number"}),i.prototype._coreToString=i.prototype.toString,i.prototype.toString=function(){return"percent"===this.formatUnits()?`${this.toNumeric("percent")}%`:this._coreToString()},i._coreParse=i.parse,i.parse=function(e){return e.includes("%")?i._coreParse(e.replaceAll("%","percent")):i._coreParse(e)},i.prototype.roundedToIncrement=function(e){return void 0===e?this:n.multiply(n.round(n.divide(this,e)),e)}},26830:(e,t,r)=>{const{default:n}=r(30135);e.exports={default:class DashboardIndexController extends n{_expectedSearchParameters(){return[...super._expectedSearchParameters(),"dates"]}}}},10875:(e,t,r)=>{const{Controller:n}=r(37849),{default:i}=r(70380);e.exports={default:class DateRangeController extends n{static targets=["presetDateRangeSelection","dateRangeInput","dateRangeWrapper","startDateInput","endDateInput"];connect(){"custom"===this.presetDateRangeSelectionTarget.value?this.dateRangeWrapperTarget.classList.remove("hidden"):this.dateRangeWrapperTarget.classList.add("hidden"),i(this.dateRangeInputTarget,{mode:"range",maxDate:"today",onChange:e=>{if(1===e.length)return;const[t,r]=e;this.startDateInputTarget.value=t??"",this.endDateInputTarget.value=r??""}})}selectPreset(e){const t=e.target.value;"custom"===t?this.dateRangeWrapperTarget.classList.remove("hidden"):this.dateRangeWrapperTarget.classList.add("hidden");const[r,n]=t.split("..").map((e=>new Date(e)));if(!r||!n)return this._clearInputs();this.startDateInputTarget.value=r,this.endDateInputTarget.value=n}_clearInputs(){this.startDateInputTarget.value="",this.endDateInputTarget.value=""}}}},74469:(e,t,r)=>{const{Controller:n}=r(37849),i={};class FolderController extends n{static targets=["contents","icon","openIcon"];static values={isOpen:Boolean};connect(){this.restoreFolderOpenState()}disconnect(){this.saveFolderOpenState()}restoreFolderOpenState(){const e=i[this.element.dataset.id];e?.isOpen&&(this.toggleVisibility(),this.isOpenValue=!0)}saveFolderOpenState(){i[this.element.dataset.id]={isOpen:this.isOpenValue}}toggleVisibility(){this.iconTarget.classList.toggle("hidden"),this.openIconTarget.classList.toggle("hidden"),this.contentsTarget.classList.toggle("hidden"),this.isOpenValue=!this.isOpenValue}}e.exports={default:FolderController}},30135:(e,t,r)=>{const{Controller:n}=r(37849),i=r(64457);e.exports={default:class IndexController extends n{static targets=["searchForm","searchFormDownArrow","searchFormRightArrow","searchFormWrapper","userIDSelect"];submitForm(){this.searchFormTarget.submit()}_toggleableElements(){return[this.searchFormDownArrowTarget,this.searchFormRightArrowTarget,this.searchFormWrapperTarget]}toggleSearchForm(){this._toggleableElements().forEach((e=>{e.classList.toggle("hidden")}))}connect(){const e=window.location.search;this._expectedSearchParameters().some((t=>e.includes(t)))&&this.toggleSearchForm()}initialize(){super.initialize(),this._configureUserSelector()}_configureUserSelector(){this.hasUserIDSelectTarget&&(this.userSelect=new i(this.userIDSelectTarget,this.userSelectOptions))}static userSelect=null;get userSelectOptions(){return{create:!1,maxItems:1,maxOptions:null,openOnFocus:!0,plugins:["clear_button","dropdown_input"],selectOnTab:!0}}clear(){this.userSelect.clear()}_expectedSearchParameters(){const e=["button"];return this.hasUserIDSelectTarget&&e.push("user_id"),e}}}},35196:(e,t,r)=>{const{Controller:n}=r(37849);e.exports={default:class MenuController extends n{static targets=["menu"];connect(){this.adjustMenuPosition()}toggleMenu(){this.adjustMenuPosition(),this.menuTarget.classList.toggle("hidden")}adjustMenuPosition(){const e=this.element.parentNode.clientHeight,t=this.element.clientHeight,r=(e-t)/2;this.menuTarget.style.top=`${t+r+6}px`}}}},55165:(e,t,r)=>{const{Controller:n}=r(37849);e.exports={default:class NestedFormController extends n{static targets=["template"];static values={wrapperSelector:String};connect(){}add_row(e){e.preventDefault();const t=this.templateTarget.innerHTML.replace(/NEW_RECORD/g,(new Date).getTime());this.templateTarget.insertAdjacentHTML("beforebegin",t)}remove_row(e){e.preventDefault();const t=e.target.closest(this.wrapperSelectorValue);if("true"===t.dataset.newRecord)t.remove();else{t.style.display="none";t.querySelector("input[name*='_destroy']").value="1"}}}}},65777:(e,t,r)=>{const{Controller:n}=r(37849),i="password-criteria__input",s="password-criteria__input--success";e.exports={default:class PasswordComplexityController extends n{static targets=["password","confirmation","submit","characterCount","lowercase","uppercase","symbols","digits","progressBar1","progressBar2","progressBar3","progressText1","progressText2","progressText3","progressText4"];connect(){this.passwordValid=!1,this.wrapInput(this.passwordTarget),this.hasConfirmationTarget&&this.wrapInput(this.confirmationTarget),this.updateButtonClickability()}validatePassword(e){const t=e.target.value;this.passwordValid=!0,this.validateField("characterCount",t),this.validateField("lowercase",t),this.validateField("uppercase",t),this.validateField("symbols",t),this.validateField("digits",t),this.validateField("repeat",t),this.showValidation(this.passwordTarget.querySelector(`.${i}`),this.passwordValid,s),this.hasConfirmationTarget?this.validateConfirmation():this.updateButtonClickability(),this.strengthCheck(t)}validateConfirmation(){this.showValidation(this.confirmationTarget.querySelector(`.${i}`),this.isConfirmationValid()&&this.currentPassword.length>0,s),this.updateButtonClickability()}updateButtonClickability(){this.hasSubmitTarget&&(this.canSubmit()?this.submitTarget.removeAttribute("disabled"):this.submitTarget.setAttribute("disabled","disabled"))}validateField(e,t){const r=e.charAt(0).toUpperCase()+e.slice(1);if(this[`has${r}Target`]){const n=this[`valid${r}`](t);this.showValidation(this[`${e}Target`],n,"password-criteria--success"),n||(this.passwordValid=!1)}}showValidation(e,t,r){t?e.classList.add(r):e.classList.remove(r)}validCharacterCount(e){return e.length>=this.data.get("min-length")}validLowercase(e){return(e.match(/[a-z]/g)||[]).length>=this.data.get("min-lowercase")}validUppercase(e){return(e.match(/[A-Z]/g)||[]).length>=this.data.get("min-uppercase")}validSymbols(e){return(e.match(/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_‘{|}~]/g)||[]).length>=this.data.get("min-symbols")}validDigits(e){return(e.match(/[0-9]/g)||[]).length>=this.data.get("min-digits")}validRepeat(e){const t=parseInt(this.data.get("max-repeat"));let r=e.length>0;for(const n of e)e.includes(n.repeat(t+1))&&(r=!1);return r}isConfirmationValid(){return!this.hasConfirmationTarget||this.currentConfirmation===this.currentPassword}canSubmit(){return this.isConfirmationValid()&&this.passwordValid}wrapInput(e){const t=document.createElement("div");t.classList.add(i);const r=e.querySelector("input");r.parentNode.insertBefore(t,r),t.appendChild(r)}get currentPassword(){return this.passwordTarget.querySelector("input").value}get currentConfirmation(){return this.confirmationTarget.querySelector("input").value}get progressTextTargets(){return[this.progressText1Target,this.progressText2Target,this.progressText3Target,this.progressText4Target]}get progressBarTargets(){return[this.progressBar1Target,this.progressBar2Target,this.progressBar3Target]}activateTextTarget(e){if(!this.progressTextTargets.includes(e))return;e.classList.add("active");this.progressTextTargets.filter((t=>t!=e)).forEach((e=>e.classList.remove("active")))}activateProgressBarTargets(...e){e.forEach((e=>e.classList.add("active")));this.progressBarTargets.filter((t=>!e.includes(t))).forEach((e=>e.classList.remove("active")))}strengthCheck(e){const t=e.length;0===t?(this.activateTextTarget(this.progressText1Target),this.activateProgressBarTargets()):t>=1&&t<8?(this.activateTextTarget(this.progressText2Target),this.activateProgressBarTargets(this.progressBar1Target)):t>7&&t<14?(this.activateTextTarget(this.progressText3Target),this.activateProgressBarTargets(this.progressBar1Target,this.progressBar2Target)):t>=14&&this.passwordValid?(this.activateTextTarget(this.progressText4Target),this.activateProgressBarTargets(this.progressBar1Target,this.progressBar2Target,this.progressBar3Target)):t>=14&&!this.passwordValid&&(this.activateTextTarget(this.progressText3Target),this.activateProgressBarTargets(this.progressBar1Target,this.progressBar2Target))}}}},98209:(e,t,r)=>{const{default:n}=r(30135);class ProjectIndexController extends n{static targets=[...super.targets,"userRoleSelect"];userSelected(){this.userRoleSelectTarget.value="",this.submitForm()}userRoleSelected(){this.userIDSelectTarget.value="",this.submitForm()}_expectedSearchParameters(){return[...super._expectedSearchParameters(),"user_role"]}}e.exports={default:ProjectIndexController}},28002:(e,t,r)=>{const{Controller:n}=r(37849),{Rectangle:i}=r(62048),s=r(84188);e.exports={default:class ProjectFoldersController extends n{static targets=["project","folder","rootProjects"];connect(){this.element.addEventListener("dragover",this.dragOver.bind(this)),this.projectTargets.forEach((e=>{e.addEventListener("dragstart",this.dragStart.bind(this)),e.addEventListener("dragend",this.dragEnd.bind(this))})),this.folderTargets.forEach((e=>{e.addEventListener("dragenter",this.dragEnter.bind(this)),e.addEventListener("dragleave",this.dragLeave.bind(this)),e.addEventListener("drop",this.drop.bind(this))}))}dragStart(e){this.projectTargets.forEach((e=>e.classList.remove("folder-drop--finished"))),this.movingProject=this.getProjectFrom(e),e.dataTransfer.effectAllowed="move"}dragOver(e){return e.preventDefault(),!0}dragEnter(e){this.lastFolder?.classList?.toggle("folder--outline",!1);const t=this.getFolderFrom(e);t.classList.toggle("folder--outline",!0),this.lastFolder=t,e.preventDefault()}dragLeave(e){const t=this.lastFolder.getBoundingClientRect(),r=new i(t.x,t.y,t.width,t.height);this.lastFolder.classList.toggle("folder--outline",r.contains(e.x,e.y)),e.preventDefault()}async drop(e){const t=this.getFolderFrom(e),r=t.dataset.id,n=this.movingProject.dataset.id,i=t.querySelector(`#project-list-${r}`);this.addProjectToList(this.movingProject,i,parseInt(t.dataset.folderDepth)),e.preventDefault(),e.stopPropagation(),this.dropped=!0,await this.postToServer(n,r)}async dragEnd(e){this.dropped||(this.addProjectToList(this.movingProject,this.rootProjectsTarget,0),await this.postToServer(this.movingProject.dataset.id,null)),this.lastFolder?.classList?.toggle("folder--outline",!1),this.dropped=void 0,this.movingProject=void 0,this.lastFolder=void 0}addProjectToList(e,t,r){e.parentElement.removeChild(e);const n=e.querySelector("#project-folder-group");n.querySelectorAll("#folder-line").forEach((e=>n.removeChild(e)));const i=e.querySelector("#folder-line-template");for(let e=0;e<r;e++){const e=i.content.cloneNode(!0);n.insertBefore(e,n.firstChild)}t.appendChild(e)}getFolderFrom(e){let t=e.target;for(;!this._isFolder(t);)t=t.parentElement;return t}getProjectFrom(e){let t=e.target;for(;!this._isProject(t);)t=t.parentElement;return t}_isFolder(e){return"folder"===e.getAttribute("id")}_isProject(e){return"project"===e.getAttribute("id")}async postToServer(e,t){const r=this.movingProject,n=new FormData;n.set("folder_id",t);const i=window.location.pathname.includes("admin")?"/admin":"",o=await fetch(`${i}/projects/${e}/update_folder`,{method:"POST",body:n,headers:{"X-CSRF-Token":s.csrfToken()},credentials:"same-origin"}),a=await o.json();a.success||console.error(a.message),r.classList.add("folder-drop--finished")}}}},60778:(e,t,r)=>{const{Controller:n}=r(37849),i=r(64457);e.exports={default:class TomSelectController extends n{static values={maxItems:{type:Number,default:1}};static control=null;connect(){this.shouldConnect&&(this.control=new i(this.element,this.options),this.control.positionDropdown())}clear(){this.control.clear()}get options(){const e=1===this.maxItemsValue?[]:["remove_button"];return{selectOnTab:!0,create:!1,maxItems:this.maxItemsValue,plugins:e,dropdownParent:"body"}}get shouldConnect(){return!(this.element.hasAttribute("disabled")||this.element.hasAttribute("readonly"))}}}},53973:(e,t,r)=>{const{default:n}=r(30135);class UserIndexController extends n{static targets=[...super.targets,"roleSelect"];roleSelected(){this.submitForm()}_expectedSearchParameters(){return[...super._expectedSearchParameters(),"role_eq"]}}e.exports={default:UserIndexController}},84188:e=>{e.exports=class CSRFHelper{static csrfToken(){if("undefined"==typeof document)return"csrf-token-not-found";const e=document.querySelector('meta[name="csrf-token"]');return e&&e.content}}},87843:(e,t,r)=>{{const e=r(44292);globalThis.clientLog=function(t,r={}){t instanceof Error?e.notify(t,r):(r=t,e.notify(r))},e.configure({apiKey:"496e745d",environment:void 0,revision:"f2c7c126c806eec86c0c412cebdede9742d5a677",breadcrumbsEnabled:!0}),window.onunhandledrejection=function(t){console.log(t),e.notify(t.reason,{context:{promise:t.promise}})}}},24570:(e,t,r)=>{e.exports=()=>{try{return"function"!=typeof r(26696).readdirSync}catch{return!0}}},85758:(e,t,r)=>{e.exports={"2-inch-rectangle-rail-shape":r(48907),"3-inch-rectangle-rail-shape":r(61786),"3d-off":r(93936),"3d-on":r(80714),"ada-rail":r(58480),"anchor-platform":r(9902),"base-shoe-glass-rail":r(69710),bench:r(76597),"bikeway-rail":r(89152),"boat-lift-sling":r(15927),"boat-slip":r(87966),"cable-rail-stair":r(51201),"cable-rail":r(5541),"circle-rail-shape":r(59566),cleat:r(39666),"coastal-boathouse":r(79171),"colosseum-rail":r(7046),"cursor-level-glass-rail":r(63906),"cursor-stair-glass-rail":r(10657),"curved-rail-shape":r(2547),"custom-icon":r(17010),"default-dock":r(61676),"default-opening":r(47195),"dock-triangle":r(27989),"edit-curve":r(96003),"folder-open":r(36746),folder:r(85733),"framed-glass":r(89499),gangway:r(56113),"generic-rail-stair":r(49181),"generic-rail":r(39585),"glass-rail-infinity":r(71825),"glass-rail-post-to-top":r(81301),"glass-rail-stair":r(26600),"glass-rail":r(67916),"guardrail-rail":r(94773),"hand-grab-flat-rail":r(31220),"hand-grab-rail":r(31902),kalani:r(81815),"l-shape":r(431),ladder:r(72537),lasso:r(55989),mahina:r(6489),"mid-rail":r(13014),move_selection_right:r(18530),ohana:r(61746),organization:r(5284),"oval-rail-shape":r(75422),"picket-rail":r(76278),"pile-guide":r(61878),"pipe-hold":r(89077),platform:r(53516),"post-override":r(19960),project:r(33392),rectangle:r(22520),roof:r(46623),"rope-rail":r(23682),select:r(70753),stairs:r(2907),"standard-dock":r(96769),"standoff-glass-rail":r(52762),"stick-dock":r(30205),"stick-pier":r(48200),success:r(43050),system_pricing:r(93617),"t-shape":r(21639),"three-rail":r(80356),"top-rail-only":r(36658),"triton-rail":r(52828),"u-shape":r(80138),user_pricing:r(5388),zone:r(80691)}},97614:(e,t,r)=>{const{ChromeCADEventEmitter:n}=r(7340);window.__LCAD_CHROME_CAD_EVENT_EMITTER=new n},28052:(e,t,r)=>{const n=r(21710);n.keys().forEach(n)},30283:()=>{document.addEventListener("turbo:frame-missing",(e=>{"modal"===e.target.id&&(e.preventDefault(),e.detail.visit(e.detail.response.url))}))},99429:(e,t,r)=>{e.exports=r(60661)},94527:(e,t,r)=>{const n=r(86900),i=r(42282);i.useContext(n),i.handleEvent("turbo:load",i.handleMount),i.handleEvent("turbo:before-render",i.handleUnmount),i.handleEvent("turbo:frame-load",i.handleMount),i.handleEvent("turbo:frame-render",i.handleUnmount)},37041:(e,t,r)=>{const{$P:n}=r(62048);e.exports=class PDFTransformationMatrix{static PIXELS_PER_INCH=72;constructor(e,t,r,n,i){this._boundingBox=e,this._pageWidth=t,this._pageHeight=r,this._actualWidth=n,this._actualHeight=i}printedScale(){return this._printedScale||(this._printedScale=this.defaultPrintedScale()),this._printedScale}setPrintedScale(e){this._printedScale=e}realWorldDistanceFor1ModelDistance(){return 1/this.printedScale()}defaultPrintedScale(){return this.calculateScaleToFit()}calculateScaleToFit(){const e=this._convertPixelsToInches(this._pageWidth)/this._boundingBox.width(),t=this._convertPixelsToInches(this._pageHeight)/this._boundingBox.height();return Math.min(e,t)}documentScale(){return this.printedScale()*this.constructor.PIXELS_PER_INCH}translation(){const e=this._boundingBox.center().multipliedBy(this.documentScale());return n(this._actualWidth/2,this._actualHeight/2).subtract(e).dividedBy(this.documentScale())}translateX(){return this.translation().x()}translateY(){return this.translation().y()}_convertPixelsToInches(e){return e/this.constructor.PIXELS_PER_INCH}}},4671:(e,t,r)=>{const n=r(37041),i=r(36217),s=r(40353),{createCanvas:o,loadImage:a}=r(52695),{VersionedProject:l}=r(7340),c=r(41543),{Rectangle:u,$P:d}=r(62048),h=r(59884),p=r(48204),m=r(88088),f=r(42947),g="center",y="right",b="top",v="center",_="bottom";e.exports=class ProjectPDFDocument{constructor(e,t="lightningcad-logo.png",r=t,{watermarkAlpha:n=.03,qrUrl:i,materialDefinitions:s,externalMetadata:o}={}){this._project=e,this._logoFileName=t,this._watermarkFileName=r,this._watermarkAlpha=n,this._qrUrl=i,this._materialDefinitions=s,this._externalMetadata=o}project(){return this._project}logoFileName(){return this._logoFileName}watermarkFileName(){return this._watermarkFileName}watermarkAlpha(){return this._watermarkAlpha}_systemStrategy(){return this.project().systemStrategy()}drawingController(){return this._drawingController??=this.createDrawingController()}setDrawingController(e){this._drawingController=e}createDrawingController(e=this.project(),t=this._systemStrategy().drawingControllerClass()){const r=e.pdfMetadata(),n=new l(e,r),i=new t(e.drawing(),n);return i.layerManager().setLayers(this.initialDrawingLayers()),i}drawingControllerFor(...e){const t=this.projectFor(...e);return this.createDrawingController(t)}projectFor(...e){const t=new(0,this.project().constructor);return t.setSystemStrategy(this._systemStrategy()),e.forEach((e=>{const r=e.componentOf();t.add(e),e.setComponentOf(r)})),t}drawingProjectedControllerFor(e,t,...r){const n=this.drawingControllerFor(...r);return this.setProjectedDrawing(e,t,n),n}setProjectedDrawing(e,t,r=this.drawingController()){const n=r.project().drawingProjected(e,t);r.setDrawing(n)}async generatePDFStream(){const e=this._createCanvas();return await this.loadLogoAndWatermark(),await this.addPages(e),await this.addQR(e,this._drawingOptions()),e.createPDFStream()}async loadLogoAndWatermark(){this._watermarkImage=await this.loadImage(this.watermarkFileName()),this._logoImage=await this.loadImage(this.logoFileName())}watermarkImage(){return this._watermarkImage}logoImage(){return this._logoImage}qrURL(){return this._qrUrl}materialDefinitions(){return this._materialDefinitions}externalMetadata(){return this._externalMetadata}addPages(e){this._addConfigurationPages(e),this._addPartsBreakdownPages(e)}_addConfigurationPages(e){this.pageConfigurations().forEach(((t,r)=>{r>0&&this._addPage(e);const n=this.drawingController(),i=this._drawingControllerForConfiguration(t);this.setDrawingController(i),this._resetLayersToBase(),this.setLayers(t.layers),this._beforeDrawProjectPage(t,e,r),this.setBoundingBox(t.bounds,e);const s=this._drawingOptions(t.drawingOptions);this._draw(e,s,t.title),this._afterDrawProjectPage(t,e,r),this.setDrawingController(n)}))}_drawingControllerForConfiguration(e){const{drawingController:t,parts:r}=e;return t||(r?this.drawingControllerFor(...r):this.drawingController())}_beforeDrawProjectPage(e,t,r){e.beforeDrawing?.()}_afterDrawProjectPage(e,t,r){e.afterDrawing?.()}pageConfigurations(){return[{layers:this.baseLayerStates()}]}_drawingOptions(e={}){return{...e,scale:this._matrix().documentScale(),bounds:this._pdfDrawingBounds(),drawWatermark:this._showWatermark(),drawLogo:this._showLogo()}}_showWatermark(){return!0}_showLogo(){return!0}_layerManager(){return this.drawingController().layerManager()}baseLayerStates(){return this._baseLayerStates??=this._defaultBaseLayerStates()}_defaultBaseLayerStates(){const e=this._layerManager(),t=e.layerNames(),r={};return t.forEach((t=>{r[t]=e.isVisible(t)})),r}initialDrawingLayers(){return this._systemStrategy().drawingLayers()}layerStatesMatchBase(e){const t=this.baseLayerStates();return 0===Object.keys(e).filter((r=>e[r]!==t[r])).length}_showLayer(e){this._layerManager().show(e)}_hideLayer(e){this._layerManager().hide(e)}setLayers(e){Object.keys(e).forEach((t=>{e[t]?this._showLayer(t):this._hideLayer(t)}))}_resetLayersToBase(){this._layerManager().setLayers(this.baseLayerStates())}_pdfSizing(){return this.__pdfSizing||(this.__pdfSizing=new i(this._pageWidthInches(),this._pageHeightInches()),this.__pdfSizing.setBackgroundMargin(this._pdfSizingMargin())),this.__pdfSizing}_setPDFSizing(e){this.__pdfSizing=e}_pageWidthInches(){return 8.5}_pageHeightInches(){return 11}_pdfSizingMargin(){return i.defaultBackgroundMargin()}_matrix(){if(!this.__matrix){const e=this._boundingBox(),t=this._pdfSizing();this.__matrix=new n(e,t.printableWidthInPixels(),t.printableHeightInPixels(),t.pageWidthInPixels(),t.pageHeightInPixels())}return this.__matrix}_createCanvas(){const e=this._pdfSizing(),t=o(e.pageWidthInPixels(),e.pageHeightInPixels(),"pdf");return this._transformCanvas(t),t}_transformCanvas(e){const t=this._boundingBox(),r=this._pdfSizing().getBestPrintedScaleFor(t),n=this._matrix();n.setPrintedScale(r);const i=e.getContext("2d");i.scale(n.documentScale(),n.documentScale()),i.translate(n.translateX(),n.translateY())}_resetCanvasTransform(e){const t=e.getContext("2d"),r=this._matrix();t.translate(-r.translateX(),-r.translateY()),t.scale(1/r.documentScale(),1/r.documentScale())}_resetAndRestoreCanvasTransformAfter(e,t){this._resetCanvasTransform(e),t(),this._transformCanvas(e)}_restrictDrawingArea(e,t,r,n=this._pdfSizingMargin()){this._resetAndRestoreCanvasTransformAfter(e,(()=>{this._clearCachedSizing();const e=new i(t/72,r/72);e.setBackgroundMargin(n),this._setPDFSizing(e)}))}_restoreDrawingArea(e){this._resetAndRestoreCanvasTransformAfter(e,(()=>this._clearCachedSizing()))}_clearCachedSizing(){this.__pdfSizing=void 0,this.__matrix=void 0}_draw(e,{clipBounds:t=!0,drawWatermark:r,drawLogo:n,...i},s){const o=e.getContext("2d");o._alterAndRestoreAfter((()=>{if(t&&(o.beginPath(),o._addPolygonToCurrentPath(i.bounds.toPolygon()),o.closePath(),o.clip()),this.drawingController().drawBoundsToCanvas(i.bounds,e,{...i,shapeOnly:!1,hideGrid:!0,showAnnotations:!0}),r&&this._drawWatermark(e,i),n&&this._drawLogo(e,i),s){const t=i.titleTextProperties??{},r={...this._defaultTextProperties(),...t};this._drawText(s,e,r)}}))}_logoWidth(){return 175}_logoHeight(){return this.logoImage().height}_drawLogo(e,{bounds:t,scale:r}){const n=5/r,i=this._logoWidth()/r,s=d(t.left()+n,t.bottom()-n);this.drawLoadedImage(this.logoImage(),s,i,e,{verticalAlign:b})}_drawWatermark(e,{bounds:t,scale:r}){const n=175/r,i=this.watermarkImage(),s=e.getContext("2d"),o=s.createPattern(i,"repeat");s._alterAndRestoreAfter((()=>{s.fillStyle=o,s.strokeStyle="transparent",s.globalAlpha=this.watermarkAlpha();const e=n/i.width;s.scale(e,e),s.fillRect(t.x()/e,t.y()/e,t.width()/e,t.height()/e)}))}_drawText(e,t,r=this._defaultTextProperties()){this._resetAndRestoreCanvasTransformAfter(t,(()=>{const n=t.getContext("2d");n._alterAndRestoreAfter((()=>{n.textBaseline=r.textBaseline,n.textAlign=r.textAlign,n.font=`${r.fontSize}px ${r.fontFamily}`,n.fillText(e,r.x,r.y)}))}))}_defaultTextProperties(){const e=2*this._pdfSizing().drawingPageMargin();return{x:e,y:e,fontSize:16,fontFamily:"monospace",textBaseline:"top",textAlign:"left"}}async loadAndDrawImage(e,...t){const r=await this.loadImage(e);await this.drawLoadedImage(r,...t)}drawLoadedImage(e,t,r,n,{horizontalAlign:i=y,verticalAlign:s=_}={}){const o=n.getContext("2d"),a=this._xOffsetForImage(e,i),l=this._yOffsetForImage(e,s);o._alterAndRestoreAfter((()=>{const n=r/e.width;o.scale(n,n),o.drawImage(e,t.x()/n+a,t.y()/n+l)}))}async loadImage(e){const t=c.resolve(c.join("/",`../images/${e}`));return a(t)}_xOffsetForImage(e,t){return t===y?0:t===g?.5*-e.width:-e.width}_yOffsetForImage(e,t){return t===_?0:t===v?.5*-e.height:-e.height}_addPage(e){const t=e.getContext("2d"),r=this._pdfSizing();t.addPage(r.pageWidthInPixels(),r.pageHeightInPixels())}_pdfDrawingBounds(){const e=this._boundingBox(),t=this._pdfSizing(),r=this._matrix(),n=t.printableWidthInPixels()/r.documentScale(),i=t.printableHeightInPixels()/r.documentScale(),s=e.center().subtract(n/2,i/2);return new u(s,void 0,n,i)}_boundingBox(){return this.__boundingBox??=this._defaultBoundingBox()}_defaultBoundingBox(){const e=this.drawingController().drawing(),t=this._pdfSizing(),r=e.boundingBox(),i=new n(r,t.printableWidthInPixels(),t.printableHeightInPixels(),t.pageWidthInPixels(),t.pageHeightInPixels()).documentScale();return e.boundingBoxWithAnnotations(i)}setBoundingBox(e,t){this._resetAndRestoreCanvasTransformAfter(t,(()=>{this.__boundingBox=e,this.__matrix=void 0,this.__pdfSizing=void 0}))}resetBoundingBox(e){this.setBoundingBox(void 0,e)}defaultShowsPartsBreakdownPages(){return!1}showsPartsBreakdownPages(){return this._showsPartsBreakdownPages??=this.defaultShowsPartsBreakdownPages()}setShowsPartsBreakdownPages(e){this._showsPartsBreakdownPages=e}_lineItemColumns(){return[f.quantity,f.unit,f.item]}_partsBreakdownTableData(e){const t=this.project().breakdownLineItems({columns:this._lineItemColumns()});return new p(t.columnLabels(),t.mappedData(),e)}_addPartsBreakdownPages(e,{title:t,appendPageNumberToTitle:r=!1}={}){if(!this.showsPartsBreakdownPages())return;const n=e.getContext("2d"),i=this._partsBreakdownTableData(t),s=new h(n,this._pdfSizing(),i,this._partsBreakdownTableOptions());this.addTable(s,e,r)}_partsBreakdownTableOptions(){return new m}addTable(e,t,r){this._resetAndRestoreCanvasTransformAfter(t,(()=>{const n=e.title(),i=e.pageCount();for(let s=0;s<i;s++){if(r){const t=[n,`${s+1} of ${i}`].filter(Boolean);e.setTitle(t.join(" "))}this._addPage(t),e.drawPage(s)}}))}async addQR(e){if(!this._systemStrategy().showsPDFPublicQR()||!this.qrURL())return;this._addPage(e);const t=d(this._pdfSizing().pageWidthInPixels()/2,this._pdfSizing().pageHeightInPixels()/2);this._drawQRTitle(t,e);const r=o(this.qrCodeSize(),this.qrCodeSize()),n=await new Promise(((e,t)=>{s.toCanvas(r,this.qrURL(),{},((r,n)=>{r&&t(r),e(n)}))}));this._resetAndRestoreCanvasTransformAfter(e,(()=>{this.drawLoadedImage(n,t,this.qrCodeSize(),e,{horizontalAlign:g,verticalAlign:v})})),this._drawQRDescription(t,e)}qrCodeSize(){return 200}_drawQRTitle(e,t){const r={...this._defaultTextProperties(),fontSize:24,x:e.x(),y:e.y()-this.qrCodeSize()/2,textBaseline:"bottom",textAlign:"center"};this._drawText(this._systemStrategy().t("pdf.qr_title"),t,r)}_drawQRDescription(e,t){const r={...this._defaultTextProperties(),x:e.x(),y:e.y()+this.qrCodeSize()/2,textAlign:"center"};this._drawText(this._systemStrategy().t("pdf.qr_description"),t,r)}_debugDrawingBounds(e){const t=e.getContext("2d");t._alterAndRestoreAfter((()=>{t.fillStyle="#00000000",t.lineWidth=t._pixelsToDrawingUnits(1),t.strokeStyle="#ff0000",t._drawRectangle(this._pdfDrawingBounds()),t.strokeStyle="#00ff00",t._drawRectangle(this._boundingBox())}))}}},7770:(e,t,r)=>{const n=r(64637);e.exports=class BearRidgePDFDocument extends n{_pageWidthInches(){return 11}_pageHeightInches(){return 8.5}}},37208:(e,t,r)=>{const n=r(59884),i=r(64637),s=r(48204),o=r(31224),a=r(5895);e.exports=class CityPostPDFDocument extends i{defaultShowsPartsBreakdownPages(){return!0}addPages(e){super.addPages(e),this.addPostKey(e),this.addSleeveKey(e)}pageConfigurations(){return[...super.pageConfigurations(),{layers:{[o.POST_LABELS]:!0,[o.POST_ANNOTATIONS]:!1,[o.LENGTH_ANNOTATIONS]:!1,[o.STAIR_ANNOTATIONS]:!1,[a.PLATFORMS]:!1},title:"Posts"},{layers:{[o.SLEEVE_LABELS]:!0,[o.POST_ANNOTATIONS]:!1,[o.LENGTH_ANNOTATIONS]:!1,[o.STAIR_ANNOTATIONS]:!1,[a.PLATFORMS]:!1},title:"Sleeves"}]}addPostKey(e){const t=e.getContext("2d"),r=new s(["key","quantity","description"],this.project().postCounts(),"Posts"),i=new n(t,this._pdfSizing(),r);this.addTable(i,e)}addSleeveKey(e){const t=e.getContext("2d"),r=new s(["key","quantity","description"],this.project().sleeveCounts(),"Sleeves"),i=new n(t,this._pdfSizing(),r);this.addTable(i,e)}}},62989:(e,t,r)=>{const n=r(4671);e.exports=class DockDesignerAppPDFDocument extends n{defaultShowsPartsBreakdownPages(){return!0}}},61750:(e,t,r)=>{const n=r(64637),{$P:i}=r(62048);e.exports=class FalconRailingsPDFDocument extends n{addPages(e){super.addPages(e),this.addGlassPanelPages(e)}addGlassPanelPages(e){const t=this.project().glassPanelsMap();t.keys().forEach((r=>{const n=r.edge().xy().direction(),s=i(0,0,1),o=this.drawingProjectedControllerFor(n,s,r);this.setDrawingController(o),this.resetBoundingBox(e),this._addPage(e);const a=this._drawingOptions();a.drawWatermark=!1,a.drawLogo=!1;const l=this._pdfSizing().pageWidthInPixels(),c=this._pdfSizing().pageHeightInPixels()-this._logoHeight();this._restrictDrawingArea(e,l,c),this._draw(e,a),this._restoreDrawingArea(e),this._drawWatermark(e,a),this._drawLogo(e,a),this._drawGlassPanelCount(e,t,r)}))}_drawGlassPanelCount(e,t,r){const n=t.get(r),i=`${r.thicknessLabel()} Glass x${n}`,s=2*this._pdfSizing().drawingPageMargin(),o={...this._defaultTextProperties(),x:this._pdfSizing().pageWidthInPixels()-s,y:this._pdfSizing().pageHeightInPixels()-s,textBaseline:"bottom",textAlign:"right"};this._drawText(i,e,o)}}},36217:(e,t,r)=>{const n=r(37041),{Rectangle:i}=r(62048);e.exports=class PDFSizing{static defaultBackgroundMargin(){return 200}constructor(e=8.5,t=11){this._pageWidthInches=e,this._pageHeightInches=t}pageWidthInches(){return this._pageWidthInches}pageHeightInches(){return this._pageHeightInches}drawingPageMargin(){return 15}backgroundMargin(){return this._backgroundMargin??=this.constructor.defaultBackgroundMargin()}setBackgroundMargin(e){this._backgroundMargin=e}getBestPrintedScaleFor(...e){const t=this._largestBoundingBox(e);return new n(t,this.printableWidthInPixels()-this.backgroundMargin(),this.printableHeightInPixels()-this.backgroundMargin(),this.pageWidthInPixels(),this.pageHeightInPixels()).printedScale()}printableWidthInPixels(){return this.pageWidthInPixels()-2*this.drawingPageMargin()}printableHeightInPixels(){return this.pageHeightInPixels()-2*this.drawingPageMargin()}pageWidthInPixels(){return 72*this.pageWidthInches()}pageHeightInPixels(){return 72*this.pageHeightInches()}_largestBoundingBox(e){const t=e.map((e=>e.width())),r=e.map((e=>e.height()));return new i(0,0,Math.max(...t),Math.max(...r))}}},77871:(e,t,r)=>{const n=r(59884),i=r(64637),s=r(48204),o=r(83383),a=r(93491);e.exports=class HollaenderPDFDocument extends i{addPages(e){super.addPages(e),this.addPanelKey(e)}_defaultBaseLayerStates(){const e=super._defaultBaseLayerStates();return e[a.PANEL_LABELS]=!0,e}addPanelKey(e){this._resetAndRestoreCanvasTransformAfter(e,(()=>{const t=e.getContext("2d"),r=new s(["key","quantity","panel"],this._panelKeyTableRows()),i=new n(t,this._pdfSizing(),r);for(let t=0;t<i.pageCount();t++)this._addPage(e),i.drawPage(t)}))}_panelKeyTableRows(){const e=o.PANEL_SIZES,t=this.project().panelCounts(),r=t.first().referencePanel;return e.map((e=>{const n=Math.round(e.min.toNumeric("in")),i=Math.round(e.max.toNumeric("in")),s=r.panelDescription(n,i),o=r.panelSKU(n),a=t.find((e=>e.referencePanel.panelSKU()===o)),l=a?a.count:0;return{key:e.assemblyKey,quantity:l,panel:s}}))}}},14675:(e,t,r)=>{const n=r(64637),i=r(22999),s=r(15189),o=r(5895);e.exports=class KAndSPDFDocument extends n{addPages(e){super.addPages(e),this._addGlassDimensionPages(e)}_addGlassDimensionPages(e){this.project().glassPanelCounts().map((e=>new i(e.referencePanel,e.count))).forEach(((t,r)=>{const n=this.drawingControllerFor(t);this.setDrawingController(n),this.resetBoundingBox(e),this._addPage(e),this._draw(e,this._drawingOptions()),this._drawGlassPanelPageLabel(r+1,t.count(),e)}))}baseLayerStates(){const e=super.baseLayerStates();return e[o.PLATFORMS]=!1,e[s.TOP_RAIL_LENGTH_ANNOTATIONS]=!1,e[s.POST_SPACING_ANNOTATIONS]=!1,e[s.GLASS_PANEL_NUMBER_ANNOTATIONS]=!1,e}baseCollectionPagesLayerStates(){return{[o.PLATFORMS]:!1,[s.PLATFORM_LENGTH_ANNOTATIONS]:!1,[s.TOP_RAIL_LENGTH_ANNOTATIONS]:!0,[s.POST_SPACING_ANNOTATIONS]:!0,[s.ANGLE_ANNOTATIONS]:!0,[s.CUT_ANGLE_ANNOTATIONS]:!0,[s.GLASS_PANEL_NUMBER_ANNOTATIONS]:!0}}_drawGlassPanelPageLabel(e,t,r){const n=this._defaultTextProperties(),i={...n};i.y+=n.fontSize,this._drawText(`Panel #${e}`,r,n),this._drawText(`Quantity: ${t}`,r,i)}}},43489:(e,t,r)=>{const n=r(64637),i=r(59884),s=r(48204),o=r(36761),a=r(64840);e.exports=class KwikclampPDFDocument extends n{addPages(e){super.addPages(e),this.addFittingCombinationKey(e)}_pageWidthInches(){return 11.69}_pageHeightInches(){return 8.27}_defaultBaseLayerStates(){const e=super._defaultBaseLayerStates();return e[o.FITTING_ANNOTATIONS]=!0,e}addFittingCombinationKey(e){this._resetAndRestoreCanvasTransformAfter(e,(()=>{const t=e.getContext("2d"),r=new s(["key","fittings"],this._fittingCombinationKeyTableRows()),n=new i(t,this._pdfSizing(),r);for(let t=0;t<n.pageCount();t++)this._addPage(e),n.drawPage(t)}))}_fittingCombinationKeyTableRows(){return this.project().uniquePostFittingCombinations().map(((e,t)=>({key:t+1,fittings:e.split(",").map((e=>a[e].name())).join(", ")})))}}},84425:(e,t,r)=>{const n=r(64637),i=r(28021);e.exports=class OmegaPDFDocument extends n{_defaultBaseLayerStates(){const e=super._defaultBaseLayerStates();return Object.keys(e).forEach((t=>e[t]=!1)),e[i.SECTION_LENGTH_ANNOTATIONS]=!0,e}baseCollectionPagesLayerStates(){return{[i.ANGLE_ANNOTATIONS]:!0,[i.OPENING_WIDTH_ANNOTATIONS]:!0,[i.RAIL_LENGTH_ANNOTATIONS]:!0,[i.SECTION_LENGTH_ANNOTATIONS]:!0}}_beforeDrawProjectPage(e){this.project().setSectionLengthAnnotationDistance(30),this.project().resetAnnotations()}_afterDrawProjectPage(e){this.project().resetSectionLengthAnnotationDistance(),this.project().resetAnnotations()}}},64637:(e,t,r)=>{const n=r(4671);e.exports=class RailingsPDFDocument extends n{defaultShowsPartsBreakdownPages(){return!0}baseCollectionPagesLayerStates(){return this.baseLayerStates()}pageConfigurations(){return[...super.pageConfigurations(),...this.collectionPageConfigurations()]}collectionPageConfigurations(){const e=this.project().railingCollections(),t=this.layerStatesMatchBase(this.baseCollectionPagesLayerStates());return 1===e.length&&t?[]:e.map((e=>this._collectionPageConfiguration(e)))}_collectionPageConfiguration(e){return{layers:this.baseCollectionPagesLayerStates(),parts:[e],beforeDrawing:()=>this._beforeDrawCollectionPage(),afterDrawing:()=>this._afterDrawCollectionPage()}}_beforeDrawCollectionPage(){}_afterDrawCollectionPage(){}_pdfSizingMargin(){return 50}}},41030:(e,t,r)=>{const n=r(59884),i=r(64637),s=r(48204),o=r(88088),{$P:a}=r(62048),l=r(35668),c=r(5895),u=r(37766),d=r(93387);e.exports=class RogueFabricatorsPDFDocument extends i{async addPages(e){super.addPages(e);const t=this.pageConfigurations().length;this._addElevationViewPages(e,t),this._addAssemblyDrawingPages(e);const r=this.project().materialParts(),n=this.partLineItemMap();await Promise.all(Object.keys(n).map((async t=>{const i=r.filter((e=>e.materialSpecifier?.().identifier()===t)),s=i.length;0!==s?this._addPartPage(e,i.first(),n[t],s):this._addPartNotFoundPage(e,t)})))}_beforeDrawProjectPage(e,t,r){super._beforeDrawProjectPage(e,t,r),this._beforeDrawTopViewPage(t,r)}_afterDrawProjectPage(e,t,r){super._afterDrawProjectPage(e,t,r),this._afterDrawTopViewPage(t)}_beforeDrawTopViewPage(e,t){const r=`${this._mainDrawingNumberPrefix()}${t+1}`,n=this._drawingInfoTable(e,r),i=this._projectInfoTable(e,n),s=n.height()+i.height();this._drawTable(e,n),this._drawTable(e,i);const o=this._pdfSizing().pageWidthInPixels(),a=this._pdfSizing().pageHeightInPixels()-s;this._restrictDrawingArea(e,o,a,this._projectedViewMargin())}_afterDrawTopViewPage(e){this._restoreDrawingArea(e),this._drawLogo(e,this._drawingOptions())}_mainDrawingNumberPrefix(){return"E"}_addPartsBreakdownPages(e){const t=`${this.dateDrawn()} – ${this.project().name()} –`;super._addPartsBreakdownPages(e,{title:t,appendPageNumberToTitle:!0})}_partsBreakdownTableOptions(){return new o({titleAlign:o.HORIZONTAL_ALIGN.right,titleFontSize:10})}_defaultBaseLayerStates(){const e=super._defaultBaseLayerStates();return e[u.RUN_LABELS]=!0,e}_addElevationViewPages(e,t){const r=this.baseCollectionPagesLayerStates();this._elevationViewCollections().forEach((({parts:n,xAxis:i,yAxis:s,layers:o={}},a)=>{const l=this.drawingProjectedControllerFor(i,s,...n);this.setDrawingController(l),this.setLayers({...r,...o}),this.resetBoundingBox(e),this._addPage(e);const c=`${this._mainDrawingNumberPrefix()}${a+1+t}`,u=this.project().railingRunMap().get(n.first()),d=this._drawingPartsListTable(e,l.project()),h=this._drawingInfoTable(e,c),p=this._projectInfoTable(e,h,u),m=this._buildDetailsTable(e,n.first(),h),f=Math.max(d.height(),m.height(),h.height()+p.height()),g=this._pdfSizing().printableWidthInPixels(),y=this._pdfSizing().printableHeightInPixels()-f;this._restrictDrawingArea(e,g,y,this._projectedViewMargin()),this._draw(e,this._drawingOptions());const b=i.cross(s);this._drawPartLabels(e,i,s,b),this._restoreDrawingArea(e),this._drawTable(e,d),this._drawTable(e,h),this._drawTable(e,p),this._drawTable(e,m)}))}_addAssemblyDrawingPages(e){const t=this.baseCollectionPagesLayerStates(),r=this.project().assemblyUsageMap();this._assemblyDrawingCollections().forEach((({parts:n,xAxis:i,yAxis:s,layers:o={}},a)=>{const l=this.drawingProjectedControllerFor(i,s,...n);this.setDrawingController(l),this.setLayers({...t,...o}),this.resetBoundingBox(e),this._addPage(e);const c=n.first(),u=r.get(c),d=`Assembly ${a+1}`,h=this.project().railingRunMap().get(n.first()),p=this._drawingPartsListTable(e,l.project()),m=this._assemblyDrawingUsageTable(e,u),f=this._drawingInfoTable(e,d,u.count),g=this._projectInfoTable(e,f,h),y=this._buildDetailsTable(e,n.first(),f),b=Math.max(p.height(),y.height(),f.height()+g.height()),v=m.width(),_=this._pdfSizing().printableWidthInPixels()-v,x=this._pdfSizing().printableHeightInPixels()-b;this._restrictDrawingArea(e,_,x,this._projectedViewMargin()),this._draw(e,this._drawingOptions());const w=i.cross(s);this._drawPartLabels(e,i,s,w),this._restoreDrawingArea(e),this._drawTable(e,p),this._drawTable(e,m),this._drawTable(e,f),this._drawTable(e,g),this._drawTable(e,y)}))}_elevationViewCollections(){return this.project().railingCollections().flatMap((e=>e.railingRuns())).map((e=>({parts:[e],xAxis:e.edge().xy().direction().negated(),yAxis:a(0,0,1)})))}_assemblyDrawingCollections(){return this.project().uniquePosts().map((e=>({parts:[e],xAxis:e.componentOf().edge().xy().direction().negated(),yAxis:a(0,0,1),layers:{[u.POST_ANNOTATIONS]:!0}})))}_addPartPage(e,t,r,n){const i=this.drawingProjectedControllerFor(t.localXAxis(),t.localYAxis(),t);this.setDrawingController(i),this.resetBoundingBox(e),this._addPage(e);const s=i.project(),o=this._drawingInfoTable(e,r,n),a=this._projectInfoTable(e,o),l=this._buildDetailsTable(e,s.parts().first(),o),c=Math.max(l.height(),o.height()+a.height()),u=this._pdfSizingMargin()/2,d=this._pdfSizing().pageWidthInPixels(),h=this._pdfSizing().pageHeightInPixels()-c-u,p=[{xAxis:t.localXAxis(),yAxis:t.localYAxis(),label:"Top"},{xAxis:t.localXAxis(),yAxis:t.localZAxis().negated(),label:"Side"}],m=this._shouldTilePartDrawingsOnY(t,p),[f,g]=m?[1,2]:[2,1];this._drawPartProjections(e,t,p,{drawableWidthPixels:d,drawableHeightPixels:h,columns:f,rows:g}),this._drawLogo(e,this._drawingOptions()),this._drawTable(e,o),this._drawTable(e,a),this._drawTable(e,l)}_drawPartProjections(e,t,r,{drawableWidthPixels:n,drawableHeightPixels:i,columns:s,rows:o}){const a=i/o,l=n/s,u=e.getContext("2d"),d=this._pdfSizing().drawingPageMargin();let h=0,p=0;r.forEach((({xAxis:r,yAxis:n,label:i=""})=>{const o=this.drawingProjectedControllerFor(r,n,t);this.setDrawingController(o),this.setLayers({[c.PROJECTED_EXTRUSION_ANNOTATION]:!0}),this.resetBoundingBox(e);const m=this._drawingOptions();m.clearRect=!1,m.clipBounds=!1,m.titleTextProperties={x:l/2,y:d,textAlign:"center"};const f=u._pixelsToDrawingUnits(l)*h,g=u._pixelsToDrawingUnits(a)*p;u.translate(f,g),this._restrictDrawingArea(e,l,a,this._projectedViewMargin()),this._draw(e,m,i),this._restoreDrawingArea(e),u.translate(-f,-g),h<s-1?h+=1:(h=0,p+=1)}))}_shouldTilePartDrawingsOnY(e,t){let r=0,n=0;return t.forEach((({xAxis:t,yAxis:i})=>{const s=this.drawingProjectedControllerFor(t,i,e).drawing().boundingBox(),o=s.width().roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES),a=s.height().roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES);r<o&&(r=o),n<a&&(n=a)})),r>n}_addPartNotFoundPage(e,t){console.warn(`RogueFabricatorsPDFDocument: unable to find part matching: ${t}`),this._addPage(e);const r=this._defaultTextProperties(),n=r.fontSize,i=r.y,s=1.25*n;["Unable to draw part:",t,"","Please report this error."].forEach(((t,n)=>{const o=s*n;this._drawText(t,e,{...r,y:i+o})}))}initialDrawingLayers(){return{...super.initialDrawingLayers(),[c.PROJECTED_EXTRUSION_ANNOTATION]:!1,[u.POST_ANNOTATIONS]:!1,[u.PLATFORM_LENGTH_ANNOTATIONS]:!1}}_drawTable(e,t){this._resetAndRestoreCanvasTransformAfter(e,(()=>t.drawPage(0)))}_drawPartLabels(e,t,r,n){const i=this.drawingController().project().materialParts(),s=this.partLineItemMap(),o={fontSize:8,textBaseline:"bottom",textAlign:"center"};i.forEach((i=>{const a=i.materialSpecifier?.().identifier(),c=s[a]??"Part # Not Found",u=i.edge?.().center?.()??i.locator(),d=new l(u,t,r,n);this.drawTextAtLocator(e,d,c,o)}))}drawTextAtLocator(e,t,r,n={}){const i={...this._defaultTextProperties(),...n},s=e.getContext("2d");s._alterAndRestoreAfter((()=>{s.textBaseline=i.textBaseline,s.textAlign=i.textAlign,s.translate(t.x(),t.y());const e=1/this._matrix().documentScale();s.scale(e,e),s.font=`${i.fontSize}px ${i.fontFamily}`,s.fillText(r,0,0)}))}partLineItemMap(){return this._partLineItemMap??=this.project().partLineItemIdentifierMap()}_drawingPartsListTable(e,t){const r=e.getContext("2d"),i=this.lineItemsForProject(t),a=new s(this._lineItemColumns(),i.map((e=>this._getLineItemDetail(e))),"Bill of Material"),l=new o({fitContentWidth:!0,rowColors:["#ffffff"],borderColor:"#000000",align:o.HORIZONTAL_ALIGN.left,verticalAlign:o.VERTICAL_ALIGN.bottom,titleAlign:o.HORIZONTAL_ALIGN.center});return new n(r,this._pdfSizing(),a,l)}_drawingInfoTable(e,t,r){const i=e.getContext("2d"),a=this.dateDrawn(),l=new s(["1","2","3","4"],[{1:"Drawn By",2:"Rogue Fabricators",3:"Checked By"},{1:"Date Drawn",2:a,3:"Date"},{1:"Quantity",2:r,3:"Drawing No.",4:t}]),c=new o({fitContentWidth:!0,rowColors:["#ffffff"],borderColor:"#000000",align:o.HORIZONTAL_ALIGN.right,verticalAlign:o.VERTICAL_ALIGN.bottom,drawHeaderRow:!1,minimumCellWidth:80});return new n(i,this._pdfSizing(),l,c)}dateDrawn(){return this._dateDrawn??=(new Date).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit"})}_projectInfoTable(e,t,r){const i=e.getContext("2d"),a=[{1:"Description",2:r},{1:"Project",2:this.project().name()},{1:"Customer",2:this.externalMetadata().ContactName}],l=new s(["1","2"],a),c=new o({width:t.width(),rowColors:["#ffffff"],borderColor:"#000000",align:o.HORIZONTAL_ALIGN.right,verticalAlign:o.VERTICAL_ALIGN.bottom,drawHeaderRow:!1,minimumCellWidth:80,yOffset:t.height()+2*this._pdfSizing().drawingPageMargin()});return new n(i,this._pdfSizing(),l,c)}_buildDetailsTable(e,t,r){const i=e.getContext("2d"),a=this.materialGradeForPart(t),l=t.railingColor?.()??t.color?.()??t.componentOf().railingColor?.()??t.componentOf().color?.()??{},c=t.buildDetails?.()??{},u=[{1:"Material",2:a},{1:"Hole Size",2:c.holeSize},{1:"Bolts",2:c.bolts},{1:"Color",2:l.label},{1:"Surface Prep",2:c.surfacePrep},{1:"Job Number",2:this.externalMetadata().JobNumber}],d=new s(["1","2"],u),h=new o({fitContentWidth:!0,rowColors:["#ffffff"],borderColor:"#000000",align:o.HORIZONTAL_ALIGN.right,verticalAlign:o.VERTICAL_ALIGN.bottom,drawHeaderRow:!1,minimumCellWidth:100,xOffset:r.width()+2*this._pdfSizing().drawingPageMargin()});return new n(i,this._pdfSizing(),d,h)}lineItemsForProject(e){return e.materialList().lineItems().filter((e=>!e.specifier().details().hideInPDF)).sort(((e,t)=>e.item().localeCompare(t.item())))}materialGradeForPart(e){const t=e.materialSpecifier?.();if(!t)return;const r=this.lineItemsForProject(this.project()).find((e=>e.specifier().equals(t)));if(!r)return;return r.breakdownLineItem([d.materialGrade],{},this.materialDefinitions()).elements().first().value()}_assemblyDrawingUsageTable(e,t){const r=e.getContext("2d"),i=[{"Used By":t.usedBy.join(", ")}],a=new s(["Used By"],i),l=new o({rowColors:["#ffffff"],borderColor:"#000000",align:o.HORIZONTAL_ALIGN.right,verticalAlign:o.VERTICAL_ALIGN.top,maximumCellWidth:360});return new n(r,this._pdfSizing(),a,l)}_lineItemColumns(){return[d.quantity,d.partNumber,d.description,d.length,d.materialGrade]}_partsBreakdownTableData(e){const t=this.lineItemsForProject(this.project());return new s(this._lineItemColumns(),t.map((e=>this._getLineItemDetail(e))),e)}_getLineItemDetail(e){const t=this._lineItemColumns().filter((e=>e!==d.quantity)),r=e.breakdownLineItem(t,{},this.materialDefinitions()),n={};r.elements().forEach((e=>n[e.label()]=e.value()));const i=e.specifier(),s=this.project().partLineItemIdentifierMap();return{...n,[d.quantity]:e.quantity(),[d.partNumber]:s[i.identifier()]}}_pageWidthInches(){return 17}_pageHeightInches(){return 11}_projectedViewMargin(){return 100}_showWatermark(){return!1}_showLogo(){return!1}}},59884:(e,t,r)=>{const n=r(88088),i=r(14614);e.exports=class PDFTable{constructor(e,t,r,i=new n){this._context=e,this._pdfSizing=t,this._tableData=r,this._optionsHolder=i,i.setTable(this),this._buildRows()}context(){return this._context}pdfSizing(){return this._pdfSizing}tableData(){return this._tableData}optionsHolder(){return this._optionsHolder}options(){return this.optionsHolder().options()}rows(){return this._rows}columnKeys(){return this.tableData().columnKeys()}title(){return this.tableData().title()}setTitle(e){this.tableData().setTitle(e)}printableWidthInPixels(){return this.pdfSizing().printableWidthInPixels()}printableHeightInPixels(){return this.pdfSizing().printableHeightInPixels()}drawHeaderRow(){return this.options().drawHeaderRow}_rowColors(){return this.options().rowColors}_buildRows(){const e=this.optionsHolder(),t=this.tableData().rowData().map(((t,r)=>this._makeTableRow(t,e.rowOptions(r))));this.drawHeaderRow()&&t.unshift(this._headerRow()),this._rows=t}_headerRow(){const e=this.tableData().headerRowData(),t=this.optionsHolder();return this._makeTableRow(e,t.headerRowOptions())}_makeTableRow(e,t){const r=this.columnKeys().map((t=>e[t]??""));return new i(this,r,t)}width(){return this._width??=this._defaultWidth()}_defaultWidth(){const e=this.options();if(e.fitContentWidth)return this.columnWidths().reduce(((e,t)=>e+t));const t=e.maximumCellWidth*this.columnKeys().length,r=e.width;return Math.min(r,t)}height(){return this._height??=this._defaultHeight()}_defaultHeight(){const e=this.rows().map((e=>e.cellHeight())).sum();return this.titleHeight()+e}left(){return this._left??=this._defaultTableLeft()}right(){return this._right??=this.left()+this.width()}top(){return this._top??=this._defaultTableTop()}bottom(){return this._bottom??=this.top()+this.height()}_defaultTableLeft(){const e=this.pdfSizing().pageWidthInPixels(),t=this.width(),r=this.options().xOffset,i=this.options().align;return i===n.HORIZONTAL_ALIGN.right?e-t-r:i===n.HORIZONTAL_ALIGN.center?(e-t)/2+r:r}_defaultTableTop(){const e=this.options().verticalAlign,t=this.options().yOffset,r=this.height(),i=this.pdfSizing().pageHeightInPixels();return e===n.VERTICAL_ALIGN.bottom?i-r-t:e===n.VERTICAL_ALIGN.center?(i-r)/2+t:t}titleTextColor(){return this.options().titleTextColor}titleAlign(){return this.options().titleAlign}titleHeight(){return this.optionsHolder().titleLineHeight()}titleFontSize(){return this.options().titleFontSize}titleFontStyle(){return this.options().titleFontStyle}titleFontWeight(){return this.options().titleFontWeight}titleFontFamily(){return this.options().titleFontFamily}titleFont(){return`${this.titleFontStyle()} ${this.titleFontWeight()} ${this.titleFontSize()}px ${this.titleFontFamily()}`}titleX(){const e=this.titleAlign(),t=this.width()/2;return e===n.HORIZONTAL_ALIGN.right?this.right():e===n.HORIZONTAL_ALIGN.center?this.left()+t:this.left()}titleY(){return this.top()}pageMargin(){return this._pageMargin??=2*this.pdfSizing().drawingPageMargin()}pageCount(){return Math.ceil(this.rows().length/this._maxRowsPerPage())}rowHeight(){return this.rows().first().cellHeight()}_maxRowsPerPage(){const e=this.pageMargin(),t=this.rowHeight();let r=this.printableHeightInPixels()-e;return this.title()&&(r-=this.titleHeight()),Math.floor(r/t)}drawPage(e){const t=e*this._maxRowsPerPage(),r=t+this._maxRowsPerPage(),n=this.context(),i=this.rowHeight(),s=this.rows().slice(t,r);let o=0;this.title()&&(this._drawTitle(),o+=this.titleHeight()),s.forEach((e=>{e.draw(n,this.left(),this.top()+o),o+=i}))}_drawTitle(){const e=this.context();e._alterAndRestoreAfter((()=>{e.font=this.titleFont(),e.textAlign=this.titleAlign(),e.fillStyle=this.titleTextColor(),e.textBaseline="top",e.fillText(this.title(),this.titleX(),this.titleY())}))}columnWidths(){return this._columnWidths??=this._defaultColumnWidths()}_defaultColumnWidths(){const e=this._fittedColumnWidths(),t=this.options().maximumCellWidth,r=t?e.map((e=>Math.min(e,t))):e;if(this.options().fitContentWidth)return r;const n=r.slice(0,-1),i=n.reduce(((e,t)=>e+t),0),s=this.width()-i,o=t?Math.min(s,t):s,a=Math.max(o,0);return n.push(a),n}_fittedColumnWidths(){const e=this.rows(),t=this.columnKeys().length,r=Array(t).fill(0);for(let n=0;n<t;n++)r[n]=e.reduce(((e,t)=>{const r=t.requiredColumnWidth(this.context(),n);return Math.max(r,e)}),0);return r}}},88088:e=>{const t={left:"left",center:"center",right:"right"},r={top:"top",center:"center",bottom:"bottom"},n={align:t.left,verticalAlign:r.top,fitContentWidth:!1,maximumCellWidth:1/0,borderColor:void 0,rowColors:["#ffffff","#f0f0f0"],textAlign:t.left,fontSize:10,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",textColor:"#000000",drawHeaderRow:!0,headerFontWeight:"bold",titleAlign:t.left,titleFontSize:14,titleFontFamily:"sans-serif",titleFontStyle:"normal",titleFontWeight:"bold",titleTextColor:"#000000"};e.exports=class PDFTableOptions{static HORIZONTAL_ALIGN=t;static VERTICAL_ALIGN=r;constructor(e={}){this._baseOptions={...n,...e}}baseOptions(){return this._baseOptions}options(){return{...this.calculatedOptions(),...this.baseOptions()}}table(){return this._table}setTable(e){this._table=e}pageMargin(){return this.table().pageMargin()}calculatedOptions(){const e=this.baseOptions();return{xOffset:e.align===t.center?0:this.pageMargin(),yOffset:e.verticalAlign===r.center?0:this.pageMargin(),width:this.table().printableWidthInPixels()-this.pageMargin(),headerTextAlign:e.textAlign,headerFontSize:e.fontSize,headerFontFamily:e.fontFamily,headerFontStyle:e.fontStyle,headerTextColor:e.textColor,headerBackgroundColor:e.rowColors.last()}}titleLineHeight(){return this.table().title()?this._lineHeightForFontSize(this.options().titleFontSize):0}rowOptions(e=0){const t=this.options().rowColors,r=t[e%t.length],n=this.options().fontSize,i=`${this.options().fontStyle} ${this.options().fontWeight} ${n}px ${this.options().fontFamily}`,s=this._lineHeightForFontSize(n),o=this._cellMargin(s,n),a=this.options().minimumCellWidth??o;return{textAlign:this.options().textAlign,fontSize:n,font:i,textColor:this.options().textColor,backgroundColor:r,borderColor:this.options().borderColor,minimumCellWidth:a,maximumCellWidth:this.options().maximumCellWidth,lineHeight:s,cellMargin:o}}headerRowOptions(){const e=this.options().headerFontSize,t=`${this.options().headerFontStyle} ${this.options().headerFontWeight} ${e}px ${this.options().headerFontFamily}`,r=this._lineHeightForFontSize(e),n=this._cellMargin(r,e),i=this.options().minimumCellWidth??n;return{textAlign:this.options().headerTextAlign,fontSize:e,font:t,textColor:this.options().headerTextColor,backgroundColor:this.options().headerBackgroundColor,borderColor:this.options().borderColor,minimumCellWidth:i,maximumCellWidth:this.options().maximumCellWidth,lineHeight:r,cellMargin:n}}_lineHeightForFontSize(e){return 1.75*e}_cellMargin(e,t){return(e-t)/2}}},14614:e=>{e.exports=class PDFTableRow{constructor(e,t,r={}){this._table=e,this._cells=t,this._options=r}table(){return this._table}cells(){return this._cells}options(){return this._options}draw(e,t,r){const n=this.columnWidths();let i=t;n.forEach(((t,n)=>{this.drawCell(e,t,i,r),this.drawText(e,n,i,r),i+=t}))}drawCell(e,t,r,n){const i=this.cellHeight();e._alterAndRestoreAfter((()=>{e.fillStyle=this.backgroundColor(),e.fillRect(r,n,t,i),this.borderColor()&&(e.strokeStyle=this.borderColor(),e.strokeRect(r,n,t,i))}))}drawText(e,t,r,n){const i=this.cellMargin(),s=this.lineHeight(),o=this.cells()[t],a=this.columnWidths()[t],l=this.wrappedTextLines(e,o,a,i);e._alterAndRestoreAfter((()=>{this._applyFontStyles(e),l.forEach(((t,o)=>{const a=n+i+o*s;e.fillText(t,r+i,a)}))}))}textColor(){return this.options().textColor}textAlign(){return this.options().textAlign}fontSize(){return this.options().fontSize}font(){return this.options().font}backgroundColor(){return this.options().backgroundColor}borderColor(){return this.options().borderColor}lineHeight(){return this.options().lineHeight}cellMargin(){return this.options().cellMargin}maximumCellWidth(){return this.options().maximumCellWidth}cellHeight(){const e=this.lineHeight(),t=this.columnWidths(),r=this.table().context();return this.cells().reduce(((n,i,s)=>{const o=this.wrappedTextLines(r,i,t[s],this.cellMargin()).length*e;return o>n?o:n}),e)}columnWidths(){return this.table().columnWidths()}width(){return this.columnWidths().reduce(((e,t)=>e+t))}requiredColumnWidth(e,t){const r=this.cells()[t],n=this.cellMargin(),i=this.options().minimumCellWidth;if(!r)return i;let s=0;return e._alterAndRestoreAfter((()=>{this._applyFontStyles(e),s=e.measureText(r).width+2*n})),Math.max(s,i)}_applyFontStyles(e){e.font=this.font(),e.fillStyle=this.textColor(),e.textAlign=this.textAlign(),e.textBaseline="top"}wrappedTextLines(e,t,r,n=0){if(void 0===t)return[];const i=t.toString().split(" "),s=[],o=i.length-1;return i.reduce(((t,i,a)=>{const l=`${t} ${i}`;return e.measureText(l).width+n>r?(s.push(t),a===o&&s.push(i),i):(a===o&&s.push(l),l)})),0===s.length&&s.push(t),s}}},48204:e=>{e.exports=class TableData{constructor(e,t,r){this._columnKeys=e,this._rowData=t,this._title=r}columnKeys(){return this._columnKeys}rowData(){return this._rowData}title(){return this._title}setTitle(e){this._title=e}headerRowData(){const e={};return this.columnKeys().forEach((t=>{e[t]=t.replace(/\b\w/g,(e=>e.toUpperCase()))})),e}}},95944:(e,t,r)=>{const{lumber:n}=r(93613),i=r(21373),s={wearDeckSand:["#c1b2a4"],wearDeckGrey:["#b5b5b3"],wearDeckSaddle:["#a3806f"],ipe:["#a37781","#473b4a","#634c66","#734f52","#9f6264"]};e.exports=Object.freeze({preassureTreated:new i("Pressure Treated",{description:"Description",materialSpecifier:n.PT2x6,material:"pressure-treated"}),tan:new i("WearDeck Sand",{description:"Description",materialSpecifier:n.PT2x6,material:"weardeck",colors:s.wearDeckSand}),grey:new i("WearDeck Cool Grey",{description:"Description",materialSpecifier:n.PT2x6,material:"weardeck",colors:s.wearDeckGrey}),brown:new i("WearDeck Saddle",{description:"Description",materialSpecifier:n.PT2x6,material:"weardeck",colors:s.wearDeckSaddle}),ipe:new i("Ipe",{description:"Description",materialSpecifier:n.PT2x6,material:"ipe",colors:s.ipe})})},60195:(e,t,r)=>{const{EditableProperty:n,DisplayProperties:i}=r(7340),{extend:s}=r(50988),o=r(11718),a=r(94531),l=r(84514),c=r(67603),u=[a,o];class LightningBolt{defaultDisplayProperties(){return new l(this,[new c(this,[new n(this,"Designer Type Identifier",{type:"select",label:"Designer Type",choices:this.designerTypeChoices()}),new n(this,"Page Title",{type:"text"}),new n(this,"Class Prefix",{type:"text"}),new n(this,"Public Feature Flags",{type:"booleanmap"}),new n(this,"Pricing Flags",{type:"booleanmap"}),new n(this,"Editor Flags",{type:"booleanmap"})]),this.designerType().displayProperties()])}classPrefix(){return this._classPrefix??="DPQBolt"}setClassPrefix(e){this._classPrefix=e}designerType(){return this._designerType||(this._designerType=this._defaultDesignerType(),this._designerType.setComponentOf(this)),this._designerType}_defaultDesignerType(){const e=this.designerTypeIdentifier();return new(u.find((t=>t.identifier()===e)))}designerTypeChoices(){return u.map((e=>({label:e.identifier(),value:e.identifier()})))}pageTitle(){return this._pageTitle||(this._pageTitle="Designer"),this._pageTitle}setPageTitle(e){this._pageTitle=e}publicFeatureFlags(){return this._publicFeatureFlags||(this._publicFeatureFlags={showsPublicDesignYourOwnButton:!0,showsPublicPrice:!0,showPublicPricingDisclaimer:!1,showsPublicLayerToggle:!0}),this._publicFeatureFlags}setPublicFeatureFlags(e){this._publicFeatureFlags=e}pricingFlags(){return this._pricingFlags||(this._pricingFlags={showsPriceBreakdownDownloadButton:!0,allowAddingAdditionalLineItems:!1}),this._pricingFlags}setPricingFlags(e){this._pricingFlags=e}editorFlags(){return this._editorFlags||(this._editorFlags={allowAddingPlanBackground:!0,allowAngleSnapToggle:!1,showsStructures:!0}),this._editorFlags}setEditorFlags(e){this._editorFlags=e}actionBarFlags(){return this._actionBarFlags||(this._actionBarFlags={showsActionBarIconLabels:!0,showsRequestQuoteButton:!0}),this._actionBarFlags}designerTypeIdentifier(){return this._designerTypeIdentifier||(this._designerTypeIdentifier=this.designerTypeChoices().first().value),this._designerTypeIdentifier}setDesignerTypeIdentifier(e){this._designerTypeIdentifier=e,this._designerType=void 0,this.resetDisplayProperties()}designerSettings(){return{designer_type:this.designerTypeIdentifier().toLowerCase(),page_title:this.pageTitle(),class_prefix:this.classPrefix(),feature_toggles:{...this.publicFeatureFlags(),...this.pricingFlags(),...this.editorFlags()},designer_type_properties:this.designerType().designerSettings()}}}s(LightningBolt,i),e.exports=LightningBolt},32829:e=>{e.exports=class LightningBoltEventRecorder{recordChange(){}recordIntermediateChange(){}}},99720:(e,t,r)=>{const{ApiClient:n}=r(7340);e.exports=class ThunderCloudAPIClient extends n{setDefaultHeaders(e){this._defaultHeaders=e}defaultHeaders(){return this._defaultHeaders?this._defaultHeaders:super.defaultHeaders()}}},31921:(e,t,r)=>{const n=r(22093);e.exports=class AMDockSectionBuilder extends n{constructor(e,t,r){super(e,t,r),this._specification=r}build(){const e=super.build();return e.setSpecification(this._specification),e}}},68500:(e,t,r)=>{const n=r(63768),i=r(74352),s=r(6556),o=r(80317),a=r(32877),l=r(47347);e.exports=class AMCleat extends i{static displayName(){return"Cleat"}static iconName(){return"cleat"}static role(){return o.CLEAT}dockTypes(){return[a.wood,a.steelTruss,a.steelChannel]}setComponentOf(e){super.setComponentOf(e),e&&this.resetModel()}modelIdentifier(){return`am-docks-c${this._cleatLengthInches()}-cleat${this._extension()}`}_modelIdentifier(){return this.modelIdentifier()}materialIdentifiers(){return["aluminum"]}_extension(){return[a.steelTruss,a.steelChannel].includes(this.frame()?.type())?"-stf":""}onLengthChanged(){this.resetModel()}_cleatLengthInches(){return Math.round(this.componentOf().cleatLength().toNumeric("in"))??10}zLevel(){const e=-n.unit(2,"in").toNumeric(this.unit());return this.referencePoint().z()+e}width(){return n.unit(5,"in")}materialLineItems(){return[new s(1,l.cleat[this._partCode()]),new s(2,l.hardware[this._cleatBoltPartCode()]),...this.frame().type()===a.wood?this.woodMountingHardwareMaterials():[]]}_cleatBoltPartCode(){return this.frame().type()===a.steelTruss?"F-HB386":"F-HB3845"}woodMountingHardwareMaterials(){return[new s(1,l.cleat["WD-CA"]),new s(1,l.hardware["WD-W"]),new s(2,l.hardware["F-CB53"])]}_partCode(){return`C-${this._cleatLengthInches()}-M`}}},18112:(e,t,r)=>{const n=r(63768),{simpleObserver:i,extend:s,MissingOverride:o}=r(50988),{RelativeLocator:a,FixedEdgeLocator:l}=r(62048),{CompositeEditableProperty:c,EditableProperty:u}=r(7340),d=r(68500),h=r(88933),p=r(82168),m=r(3260),f=r(38014),g=r(43775),y=r(87991),b=r(26716),v=r(6364),_=r(76905),x=r(5090),w=r(80317),R=r(15411);class AMDock extends b{static defaultWidth(){return n.unit(3,"ft")}static defaultLength(){throw new o(this,"defaultLength")}static iconName(){return"standard-dock"}static sectionLengths(){if(!this.SECTION_LENGTHS_FT)throw new Error(`${this.name} failed to provide section lengths`);return this.SECTION_LENGTHS_FT.map((e=>n.unit(e,"ft")))}type(){return this.constructor.type()}defaultDisplayProperties(){return[...super.defaultDisplayProperties(),new c("Rub Rail Enabled","boolean",this.framingSections().map((e=>e.rubRailProperty()))),new u(this,"Generate Default Cleats",{type:"action",perform:()=>this.generateDefaultCleats()}),new u(this,"Remove All Cleats",{type:"action",perform:()=>this.removeAllCleats()}),...this.framingSections().some((e=>e.rubRailEnabled()))?[new u(this,"Rub Rail Edge Map",{type:"edge-boolean-map",label:"Rub Rail Override"}),new u(this,"Rub Rail Corner Map",{type:"locator-boolean-map",label:"Rub Rail Corner Override"})]:[]]}clone(){const e=this._baseClone();return e.setComponentOf(this.componentOf()),this.accumulatedClone(e),this.framingSections().forEach(((t,r)=>{e.framingSections()[r].setRubRailEnabled(t.rubRailEnabled())})),e.edges().forEach(((t,r)=>{e.rubRailEdgeMap().set(t,this.rubRailEdgeMap().get(this.edges()[r]))})),e.vertices().forEach(((t,r)=>{e.rubRailCornerMap().set(t,this.rubRailCornerMap().get(this.vertices()[r]))})),e}accessoryAttachmentHeight(){return this.framingSections().first().accessoryAttachmentHeight()}minLength(){throw new o(this,"minLength")}minWidth(){return n.unit(3,"ft")}maxWidth(){return n.unit(8,"ft")}maxLength(){}lengthSnappingIncrement(){throw new o(this,"lengthSnappingIncrement")}hasWearDeckFrame(){return this.componentOf().hasWearDeckFrame()}isPressureTreated(){return this.componentOf().isPressureTreated()}surfaceOverhang(){return n.unit(0,"in")}cleatOffsetFromEnd(){return n.unit(1,"ft")}cornerSnappingTolerance(){return h.outsideBracketLength()}snapToIncrement(e){if(this.alongCrossAxis(e.vector()))return this.lengthSnappingIncrement()}snappableSizes(e){if(this.alongMainAxis(e.vector()))return[n.unit(3,"ft"),n.unit(4,"ft"),n.unit(5,"ft"),n.unit(6,"ft"),n.unit(8,"ft")]}snappedLength(){const e=this.length(),t=this.lengthSnappingIncrement(),r=e.roundedToIncrement(t);return n.max(r,this.minLength())}minimumSpan(e){return this.alongMainAxis(e.vector())?this.minWidth().toNumeric(this.unit()):this.minLength().toNumeric(this.unit())}maximumSpan(e){return this.alongMainAxis(e.vector())?this.maxWidth().toNumeric(this.unit()):this.maxLength()?.toNumeric(this.unit())??1/0}area(){return n.multiply(this.length(),this.width())}floatHeight(){return this.project().isCommercial()?n.unit(16,"in"):n.unit(12,"in")}_defaultHeight(){return n.unit(1,"ft")}rubRailEdgeMap(){return this._rubRailEdgeMap||(this._rubRailEdgeMap=new x(this.geometry().edges().map((e=>[e,!0])))),this._rubRailEdgeMap}setRubRailEdgeMap(e,t){this.rubRailEdgeMap().set(e,t),this.rubRailOptionsChanged()}rubRailEnabledForEdge(e){const t=this.edges().find((t=>t.direction().dot(e.direction()).isNearTo(1)));return this.rubRailEdgeMap().get(t)}rubRailCornerMap(){return this._rubRailCornerMap||(this._rubRailCornerMap=new x(this.geometry().vertices().map((e=>[e,!0])))),this._rubRailCornerMap}setRubRailCornerMap(e,t){this.rubRailCornerMap().set(e,t),this.rubRailOptionsChanged()}rubRailEnabledForCorner(e){const t=this.closestCorner(e);return this.rubRailCornerMap().get(t)}rubRailColor(){return this.componentOf().rubRailColor()}rubRailStyle(){return this.componentOf().rubRailStyle()}rubRailFastenerType(){return this.componentOf().rubRailFastenerType()}rubRailEnabled(){return this._rubRailEnabled}framingSections(){return this._framingSections||(this._framingSections=this._defaultFramingSections()),this._framingSections}_defaultFramingSections(){let e=0;const t=this.mainAxis(),r=this.endEdges().last().center(),n=this.referencePoint(),i=this._sectionLengthsFt(),s=this.frameSectionClass();return i.map((i=>{const o=Math.round(this.width().toNumeric("ft")),l=new m(`${i}x${o}`),c=l.defaultLength().toNumeric(this.unit()),u=c/2,d=a.makeRelativeTo(r.add(t.multipliedBy(e+u)),n),h=s.builder(this,l).referencePoint(d).angle(this.angle()).build();return e+=c,h.setComponentOf(this),h.setRubRailEnabled(this.rubRailEnabled()),h}))}frameSectionClass(){throw new o(this,"frameSectionClass")}_sectionLengthsFt(){return R(this.snappedLength(),this.constructor.sectionLengths(),this.unit()).map((e=>e.toNumeric("ft").roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES)))}isBeginSection(e){return this.framingSections().first()===e}isEndSection(e){return this.framingSections().last()===e}isConnectedOnEnd(e,t){const r=this.endEdges().first();return!e.geometry().containsPoint(r.begin())||this.isConnectedOn(r,t)}isConnectedOnBegin(e,t){const r=this.endEdges().last();return!e.geometry().containsPoint(r.begin())||this.isConnectedOn(r,t)}hasPipeHoldInCorner(e){return this.pipeHolds().some((t=>t.locator().xy().equals(e.xy())))}isAccessoryInCorner(e){const t=e.locator();return this.framingSections().some((e=>e.framingEdges().flatMap((e=>[e.begin(),e.end()])).some((e=>e.xy().equals(t.xy())))))}overlappingFrameEdgesForEdge(e){return this.otherFrameEdges().filter((({edge:t})=>e.overlapsBySignificantDistance(t)))}otherFrameEdgesContainsEdge(e){return this.otherFrameSideEdgesContainsEdge(e)||this.otherFrameEndEdgesContainsEdge(e)}otherFrameSideEdgesContainsEdge(e){return this.otherFrameSideEdges().some((({edge:t})=>t.containsEdge(e)))}otherFrameSideEdgesContainsPoint(e){return this.otherFrameSideEdges().some((({edge:t})=>t.containsPoint(e.xy())))}otherFrameEndEdgesContainsEdge(e){return this.otherFrameEndEdges().some((({edge:t})=>t.containsEdge(e)))}otherFrameEndEdgesContainsPoint(e){return this.otherFrameEndEdges().some((({edge:t})=>t.containsPoint(e.xy())))}edgeContainsOtherFrameEdge(e){return this.edgeContainsOtherFrameEndEdge(e)||this.edgeContainsOtherFrameSideEdge(e)}edgeContainsOtherFrameSideEdge(e){return this.otherFrameSideEdges().some((({edge:t})=>e.containsEdge(t)))}edgeContainsOtherFrameEndEdge(e){return this.otherFrameEndEdges().some((({edge:t})=>e.containsEdge(t)))}otherFrameEdges(){return[...this.otherFrameSideEdges(),...this.otherFrameEndEdges()]}otherFrameSideEdges(){return this.otherFrames().flatMap((e=>e.sideEdges().map((t=>({edge:t.xy(),frame:e})))))}otherFrameEndEdges(){return this.otherFrames().flatMap((e=>e.endEdges().map((t=>({edge:t.xy(),frame:e})))))}otherFrames(){return this.project().docks().filter((e=>e.type()===this.type())).filter((e=>e!==this))}dockAccessorySnappingEdges(){return this.framingSections().flatMap((e=>e.exposedOutsideFrameEdges()))}closestCorner(e){const t=this.vertices().map((e=>({locator:()=>e}))),{locatable:r}=_.findClosest(e,t);return r.locator()}isContainedByFrameEndOnCorner(e){const t=this.closestCorner(e);return this.otherFrameEndEdgesContainsPoint(t)}isContainedByFrameSideOnCorner(e){const t=this.closestCorner(e);return this.otherFrameSideEdgesContainsPoint(t)}isContainedOn(e,t){return this.isContainedByFrameEndOnCorner(t)||this.isContainedByFrameSideOnCorner(t)}isConnectedOn(e,t){return(t?this.isConnectedToFrameEndAtLocator(t):this.isConnectedToFrameEndOn(e))||this.isConnectedToFrameSideOn(e)}isConnectedToFrameEndOn(e){const t=e.xy();return this.otherFrameEndEdgesContainsEdge(t)||this.edgeContainsOtherFrameEndEdge(t)}isConnectedToFrameSideOn(e){const t=e.xy();return this.otherFrameSideEdgesContainsEdge(t)||this.edgeContainsOtherFrameSideEdge(t)}isConnectedToFrameEndAtLocator(e){const t=this.closestCorner(e);return this.otherFrameEndEdges().some((({edge:e,frame:r})=>this.alongMainAxis(r.mainAxis())&&e.xy().containsPoint(t.xy())))}setComponentOf(e){super.setComponentOf(e),this.accessories().forEach((t=>{e.add(t)}))}setLength(e){super.setLength(e),this.resizingFinished()}setAngle(e){const t=e-this.angle();super.setAngle(e),this.components().forEach((e=>e.rotateBy(this.locator(),t)))}angleChanged(e){super.angleChanged(e),this.accessories().forEach((e=>e.locatorSourceChanged())),this.updateConnections(),this.project().notifyDockMoved(),this.resetDisplayProperties()}deckingOptionChanged(){this.framingSections().forEach((e=>{e.surface().frameChanged()})),this.resetFramingBoards()}projectTypeChanged(){this.framingSections().forEach((e=>e.resetFloats()))}rubRailOptionsChanged(){this.framingSections().forEach((e=>e.rubRailOptionsChanged()))}rubRailEnabledChanged(){this.resetDisplayProperties()}resetFramingSections(){this.framingSections().forEach((e=>e.resetComponents()))}resetFramingBoards(){this.framingSections().forEach((e=>e.resetFramingBoards()))}resizingFinished(){this.resetDisplayProperties(),this.updateConnections(),this.project().notifyDockMoved()}connectionsChanged(){}resetComponents(){this.resetAccumulatedComponents(),this.framingSections().length>1&&(this._rubRailEnabled=!!this.framingSections().every((e=>e.rubRailEnabled()))||void 0),this._framingSections=void 0}includeAccessoriesInComponents(){return!1}accessoryAdded(e){e.role?.()===w.PIPE_HOLD&&this.resetAllSectionCornerBrackets()}cleats(){return this._filteredAccessories(w.CLEAT)}pipeHolds(){return this._filteredAccessories(w.PIPE_HOLD)}pileGuides(){return this._filteredAccessories(w.PILE_GUIDE)}pileGuideOffset(e){}delete(){this.removeAllAccessories(),this.updateConnections?.(),this.project().notifyDockMoved(),super.delete(),this.connections().forEach((e=>e.delete()))}generateDefaultCleats(){const e=this._defaultCleats();return e.forEach((e=>{this.componentOf().add(e),this.addAccessory(e)})),e}_defaultCleats(){const e=this.cleatOffsetFromEnd().toNumeric(this.unit());return this.sideEdges().flatMap((t=>[new l(t,e),new l(t,-e)])).map((e=>d.builder(this).referencePoint(new a(e)).build()))}resetAllSectionCornerBrackets(){this.framingSections().forEach((e=>e.resetCornerBrackets()))}removeAllCleats(){this.cleats().slice().forEach((e=>e.delete()))}snapToConnectorsFilter(){return e=>!e.bracketOnHighEnd()}snapToFramesFilter(){return e=>this.isPerpendicularTo(e)}isPerpendicularTo(e){return Math.abs(e.mainAxis().dot(this.crossAxis())).isNearTo(1)}_sectionSnappingEdgesFor(e){return this.framingSections().map((t=>t.framingSideEdges().find((t=>t.direction().equals(e.direction())))))}snappingEdgesFor(e){return this.alongMainAxis(e.vector())?this._sectionSnappingEdgesFor(e):[e]}components(){return[...super.components(),...this.framingSections()]}_afterConnectionAdded(e){this.componentOf().add(e)}moveConnectedDocksBy(e,t,r){const n=this.moveBy(e,t);return this.connections().filter((e=>e!==r)).map((e=>({connection:e,dock:e.docks().find((e=>e!==this))}))).forEach((({connection:r,dock:n})=>n.moveConnectedDocksBy(e,t,r))),n}isNonArticulatingBracketAt(e){return this.isConnectionNonArticulating(this.connectionFor(e))}isConnectionNonArticulating(e){return e?.typeIdentifier()===f.NON_ARTICULATING_IDENTIFIER}defaultFigure(){return new p(this)}defaultAnnotations(){return this.geometryStrategy().buildAnnotations(this.geometry(),this.unit(),60)}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_heightChangedObservers","_rubRailEnabled"]}}s(AMDock,y),s(AMDock,g),s(AMDock,v),i(AMDock,"heightChanged"),e.exports=AMDock},74352:(e,t,r)=>{const n=r(63348);e.exports=class AMDockAccessory extends n{static disabledToolMessage(){return`Place a compatible dock before placing ${this.displayName()}`}cloneToDock(e){const t=super.cloneToDock(e);return this._copyTypeTo(t,e),t}_copyTypeTo(e,t){if(e.setType)if(this.dockTypes().includes(t.type()))e.setType(this.type());else{const r=Object.values(this.constructor.TYPES).find((e=>this._dockTypesFor(e).includes(t.type())));e.setType(r)}}isInCorner(){return this.project().docks().some((e=>e.isAccessoryInCorner(this)))}delete(){super.delete(),this.project().remove(this)}frameFilter(){return e=>this.dockTypes().includes(e.type())}}},58101:(e,t,r)=>{const{$P:n}=r(62048),i=r(28174),s=r(6556),o=r(47347);e.exports=class AMDockAngleBracket extends i{constructor(e,t,r){super(e,t),this._isConnectedOnEnd=r}partCode(){return"WD-A"}isConnectedOnEnd(){return this._isConnectedOnEnd}scale(){return this.isConnectedOnEnd()?n(-1,1,1):super.scale()}selfMaterialLineItems(){return[...super.selfMaterialLineItems(),new s(2,o.hardware["WD-W"]),new s(4,o.hardware["F-CB53"])]}}},28174:(e,t,r)=>{const n=r(6556),i=r(57473),s=r(18734),o=r(34249),a=r(47347);e.exports=class AMDockBracket extends i{constructor(e,t,r,n){super(e,void 0,t,r,["steel"]),this._partCode=n}_modelIdentifier(){return`${this.modelFile()}->${this.partCode()}`}modelFile(){return"am-docks-framing-brackets"}partCode(){return this._partCode}selfMaterialLineItems(){const e=a.hardware[this.partCode()];if(!e)throw new Error(`Could not find specifier for part code ${this.partCode()}`);return[new n(1,e),...this.pinMaterials()]}pinMaterials(){if(!this.partCode().includes("WD-TF"))return[];const e=this.partCode().endsWith("D")?2:1;return[new n(e,a.hardware["F-PIN34"])]}defaultFigure(){const e=new s(this);return e.updateProperties({fillStyle:"#bbb",strokeStyle:"#000",lineWidth:.1}),new o(e)}}},88933:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),s=r(6556),o=r(49283),a=r(47347);e.exports=class AMDockCornerBracket extends o{static SLIP_DOCK_BRACKET_TYPES={none:"None",female:"Female",male:"Male"};static outsideBracketLength(){return n.unit(10,"in")}constructor(e,t,r){super(e),this.__slipDockConnectorType=r,this._isNonArticulating=t}_slipDockConnectorType(){return this.__slipDockConnectorType}isNonArticulating(){return this._isNonArticulating}innerBracket(){return!1}zAngle(){if(this.shouldFlipSideEdgeForEndEdge()){const e=-this.vectorDotCrossAxis()*this.vectorDotMainAxis();return this.dockAngle()+Math.PI_2*e}return super.zAngle()}shouldFlipSideEdgeForEndEdge(){return!this.isNonArticulating()&&(this._isSlipDockConnector()&&(this._isEndConnector()||this._isFemaleSlipDockConnector()&&this._isMaleConnector()))}partCode(){return this.isNonArticulating()?this._nonArticulatingPartCode():this._isFemaleConnector()&&this._isFemaleSlipDockConnector()?"WD-SF":this._isMaleConnector()&&this._isMaleSlipDockConnector()?"WD-SM":this._isMaleConnector()&&this._isFemaleSlipDockConnector()||this._isFemaleConnector()&&this._isMaleSlipDockConnector()?"WD-SMF":this._isMaleConnector()||this._isEndConnector()&&this._isMaleSlipDockConnector()?"WD-M":this._isFemaleConnector()||this._isEndConnector()&&this._isFemaleSlipDockConnector()?"WD-F":"WD-E"}_nonArticulatingPartCode(){return this._isFemaleConnector()?"WD-NAFD":this._isMaleConnector()?"WD-NAMD":"WD-E"}scale(){const e=super.scale();return this.shouldFlipSideEdgeForEndEdge()?i(-1*e.x(),e.y(),e.z()):e}_isFemaleConnector(){return this.section().isConnectedOnBegin(this.locator())&&this._isOnBegin()}_isMaleConnector(){return this.section().isConnectedOnEnd(this.locator())&&this._isOnEnd()}_isEndConnector(){return!this._isMaleConnector()&&!this._isFemaleConnector()}_isSlipDockConnector(){return this._slipDockConnectorType()!==this.constructor.SLIP_DOCK_BRACKET_TYPES.none}_isFemaleSlipDockConnector(){return this._slipDockConnectorType()===this.constructor.SLIP_DOCK_BRACKET_TYPES.female}_isMaleSlipDockConnector(){return this._slipDockConnectorType()===this.constructor.SLIP_DOCK_BRACKET_TYPES.male}_isOnBegin(){return this.vectorDotMainAxis()<0}_isOnEnd(){return this.vectorDotMainAxis()>0}selfMaterialLineItems(){return[...super.selfMaterialLineItems(),new s(8,a.hardware["F-CB53"]),...this._pinMaterials()]}_pinMaterials(){const e=this._pinCount();return 0===e?[]:[new s(e,a.hardware["F-PIN34"])]}_pinCount(){if(this._isFemaleConnector()&&this.isNonArticulating())return 2;let e=0;return this._isFemaleConnector()&&e++,this._isFemaleSlipDockConnector()&&e++,e}}},92853:(e,t,r)=>{const n=r(63768),{lumber:i}=r(93613),{$P:s}=r(62048),o=r(95369),a=r(47347);e.exports=class AMDockFramingDescriptor extends o{headerSpecifier(){return this.dock().hasWearDeckFrame()?a.c2x8:i.PT2x8}joistSpecifier(){return this.dock().hasWearDeckFrame()?a.c2x8:i.PT2x8}maxJoistSpacing(){return n.unit(2,"ft")}shouldDoubleEndJoists(){return!1}joistOffset(){return s(0,0,this._joistZOffset())}headerOffset(){return s(0,-this.materialWidth(this.joistSpecifier()),this._headerZOffset())}crossStringerOffset(){return s(0,0,this.joistOffset().z())}}},49283:(e,t,r)=>{const{three:n}=r(37732),{$P:i}=r(62048),s=r(28174);e.exports=class AMDockInnerCornerBracket extends s{section(){return this.componentOf()}dockAngle(){return this.section().angle()}innerBracket(){return!0}rotation(){return(new n.Quaternion).setFromAxisAngle(new n.Vector3(0,0,1),this.zAngle())}zAngle(){return this.dockAngle()}partCode(){return"WD-IN"}scale(){return i(this.vectorDotMainAxis(),-this.vectorDotCrossAxis(),1)}vectorToSectionCenter(){return this.locator().subtract(this.section().locator())}vectorDotMainAxis(){return Math.sign(this.vectorToSectionCenter().dot(this.section().mainAxis()))}vectorDotCrossAxis(){return Math.sign(this.vectorToSectionCenter().dot(this.section().crossAxis()))}}},5345:(e,t,r)=>{const n=r(63768),{simpleObserver:i}=r(50988),{three:s}=r(37732),{ProportionalEdgeLocator:o,FixedEdgeLocator:a,$P:l}=r(62048),{EditableProperty:c}=r(7340),{MissingOverride:u}=r(50988),d=r(31921),h=r(88933),p=r(80716),m=r(24409),f=r(35613),g=r(58101),y=r(30691),b=r(28174),v=r(49283),_=r(6556),x=r(26716),w=r(46748),R=r(47347),k="Rub Rail Enabled";class AMDockSection extends x{static builder(e,t){return new d(e,this,t)}isRelative(){return!0}accessoryAttachmentHeight(){return n.subtract(this._defaultHeight(),n.unit(1.25,"in"))}rubRailInset(){return n.unit(8.6,"in")}_defaultHeight(){return n.unit(12,"in")}defaultDisplayProperties(){return[...super.defaultDisplayProperties(),new c(this,k,{type:"boolean",label:"Rub Rail"})]}rubRailProperty(){return this.displayProperties().find((e=>e.name()===k))}rubRailEnabled(){return this._rubRailEnabled??this.length().equals(this.componentOf().length())}toggleRubRailEnabled(){this._rubRailEnabled=!this.rubRailEnabled(),this.componentOf().rubRailEnabledChanged()}setRubRailEnabled(e){this._rubRailEnabled=e}rubRailColor(){return this.componentOf().rubRailColor()}rubRailStyle(){return this.componentOf().rubRailStyle()}rubRailFastenerType(){return this.componentOf().rubRailFastenerType()}rubRailOptionsChanged(){this._resetRubRailComponents()}isPressureTreated(){return this.componentOf().isPressureTreated()}setSpecification(e){this._specification=e,this.resetComponents()}specification(){return this._specification}includeSkirtBoards(){return!1}deckingBoardGap(){const e=this.deckingBoardCount(),t=e-1,r=n.unit(this.deckingEdges().first().length(),this.unit()),i=this.deckingOption().materialSpecifier().details().depth;return w`(${r} - (${i} * ${e})) / ${t}`}deckingBoardCount(){return this.specification().deckingBoardCount()}deckingEndEdges(){return[this.endEdges().first().shiftedAlongNormalBy(-this.deckingInsetForEnd().toNumeric(this.unit())),this.endEdges().last().shiftedAlongNormalBy(-this.deckingInsetForBegin().toNumeric(this.unit()))]}deckingEdges(){return this._sideEdgesFor(this.deckingEndEdges())}deckingInsetForEnd(){return this.componentOf().deckingInsetForEnd(this)}deckingInsetForBegin(){return this.componentOf().deckingInsetForBegin(this)}exposedOutsideFrameEdges(){const e=this.endEdges(),t=this.framingSideEdges().slice();this.isConnectedOnBegin()||t.push(e.last()),this.isConnectedOnEnd()||t.push(e.first());const r=this._cornerBracketInset().toNumeric(this.unit()),n=t.map((e=>e.xy().stretchedBy(2*-r)));return this._subtractFrameEdges(n)}_cornerBracketInset(){return h.outsideBracketLength()}_subtractFrameEdges(e){return e.flatMap((e=>y.subtractSegmentsFromEdge(e,this._edgesToSubtractFor(e))))}_edgesToSubtractFor(e){const t=this._overlappingFrameEdgesForEdges([e]);return t[0]?.map((({edge:e})=>e))??[]}_overlappingFrameEdgesForEdges(e){return e.reduce(((e,t,r)=>{const n=this.componentOf().overlappingFrameEdgesForEdge(t);return n.length>0&&(e[r]=n),e}),{})}framingEndEdges(){return[this.endEdges().first().shiftedAlongNormalBy(-this.framingInsetForEnd().toNumeric(this.unit())),this.endEdges().last().shiftedAlongNormalBy(-this.framingInsetForBegin().toNumeric(this.unit()))]}framingEdges(){const e=this.framingEndEdges(),t=this._sideEdgesFor(e);return[e.first(),t.first(),e.last(),t.last()]}isConnectedOnEnd(e){return this.componentOf().isConnectedOnEnd(this,e)}isConnectedOnBegin(e){return this.componentOf().isConnectedOnBegin(this,e)}isConnectedOn(e,t){return this.componentOf().isConnectedOn(e,t)}isContainedOn(e,t){return this.componentOf().isContainedOn(e,t)}isBeginSection(){return this.componentOf().isBeginSection(this)}isEndSection(){return this.componentOf().isEndSection(this)}isMiddleSection(){return!this.isBeginSection()&&!this.isEndSection()}framingInsetForEnd(){return this.componentOf().framingInsetForEnd(this)}framingInsetForBegin(){return this.componentOf().framingInsetForBegin(this)}_sideEdgesFor(e){return[e.first().end().to(e.last().begin()),e.last().end().to(e.first().begin())]}framingSideEdges(){return this._sideEdgesFor(this.framingEndEdges())}middleJoists(){return this.joists().slice(1,-1)}joists(){return this._joists||(this._joists=this.dockFramer().makeJoists()),this._joists}endStringers(){return this._endStringers||(this._endStringers=this.dockFramer().makeEndStringers()),this._endStringers}crossStringers(){return this._crossStringers||(this._crossStringers=this.dockFramer().makeCrossStringers()),this._crossStringers}floats(){return this._floats||(this._floats=this._defaultFloats()),this._floats}_defaultFloats(){return this.specification().defaultFloats(this)}floatHeight(){return this.componentOf().floatHeight()}cornerBrackets(){return this._cornerBrackets||(this._cornerBrackets=this._defaultCornerBrackets(),this._cornerBrackets.forEach((e=>e.setComponentOf(this)))),this._cornerBrackets}crossStringerBrackets(){return this._crossStringerBrackets||(this._crossStringerBrackets=this._defaultCrossStringerBrackets()),this._crossStringerBrackets}endStringerBrackets(){return this._endStringerBrackets||(this._endStringerBrackets=this._defaultEndStringerBrackets()),this._endStringerBrackets}outerCornerBrackets(){return this.cornerBrackets().filter((e=>!e.innerBracket()))}innerCornerBrackets(){return this.cornerBrackets().filter((e=>e.innerBracket()))}_defaultCornerBrackets(){const e=this.framingEndEdges().flatMap((e=>[e.begin(),e.end()])),t=this._slipDockBracketLocations().flatMap((({locations:e})=>e)).filter((({locator:e})=>this._isSlipDockLocationAtCorner(e)));return[...e.map((e=>{const r=t.find((({locator:t})=>t.xy().equals(e.xy()))),{female:n,male:i,none:s}=h.SLIP_DOCK_BRACKET_TYPES;let o=s;return r&&(o=r.isFemale?n:i),new h(e,o)})),...e.map((e=>{if(!this.componentOf().hasPipeHoldInCorner(e))return new v(e)})).filter((e=>e))]}_defaultCrossStringerBrackets(){const e=[];return this.crossStringers().forEach((t=>{const r=t.edge(),n=this.joists();n.forEach(((t,i)=>{const s=t.edge(),o=r.closestRelativePointTo(s.begin());let a=r.angle();i!==n.length-1&&(a+=Math.PI),e.push(new g(o,this._rotationFromAngle(a)))}))})),e}_defaultEndStringerBrackets(){const e=[];return this.middleJoists().map((t=>{let r=t.depth().toNumeric(this.unit());const n=t.edge().stretchedBy(2*r),i=n.relativeTo(this.referencePoint());[i.begin(),i.end()].forEach(((t,i)=>{const o=n.vector().normalized(),a=(new s.Quaternion).setFromAxisAngle(o.toThreeJS(),Math.PI_2);0===i&&(r*=-1),e.push(new g(t,this._rotationFromAngle(n.angle()).premultiply(a),1===i))}))})),e}slipDockBrackets(){return this._slipDockBrackets||(this._slipDockBrackets=this._defaultSlipDockBrackets()),this._slipDockBrackets}_defaultSlipDockBrackets(){return this._slipDockBracketLocations().flatMap((({edge:e,locations:t})=>t.flatMap((({locator:t,isFemale:r,scale:n})=>{if(this._isSlipDockLocationAtCorner(t))return;const i=t.subtract(e.begin()).dot(e.direction()),s=new a(e,i),o=r?"WD-TF":"WD-TM";return[new b(s,this._rotationFromAngle(e.normalAngle()),n,o),new b(s,this._rotationFromAngle(e.normalAngle()),n,"WD-B")]})).filter((e=>e))))}_isSlipDockLocationAtCorner(e){return this.framingSideEdges().flatMap((e=>[e.begin(),e.end()])).some((t=>t.xy().equals(e.xy())))}_slipDockBracketLocations(){const e=this.framingSideEdges(),t=this._overlappingFrameEdgesForEdges(e.map((e=>e.xy())));return e.map(((e,r)=>{const n=t[r];return n?{edge:e,locations:n.flatMap((({edge:e,frame:t})=>{const r=t.crossAxis().dot(e.direction()).isNearTo(1);return[{locator:e.begin(),isFemale:r,scale:l(1,-1,1)},{locator:e.end(),isFemale:r,scale:l(1,1,1)}]}))}:{edge:e,locations:[]}}))}_rotationFromAngle(e){return(new s.Quaternion).setFromAxisAngle(new s.Vector3(0,0,1),e)}rubRails(){return this.rubRailEnabled()?(this._rubRails||(this._rubRails=this._defaultRubRails(),this._rubRails.forEach((e=>e.setComponentOf(this)))),this._rubRails):[]}_shiftedEdgeForRubRail(e){return e.direction().equals(this.endEdges().first().direction())?e.shiftedAlongNormalBy(-this.deckingInsetForEnd().toNumeric(this.unit())):e.direction().equals(this.endEdges().last().direction())?e.shiftedAlongNormalBy(-this.deckingInsetForBegin().toNumeric(this.unit())):e}_defaultRubRails(){return this._rubRailEdges().filter((e=>this._rubRailEnabledForEdge(e))).map((e=>new p(e)))}_rubRailEdges(e=!0){const t=[...this.deckingEdges()];this.isBeginSection()&&t.push(this.endEdges().last()),this.isEndSection()&&t.push(this.endEdges().first());const r=t.map((e=>e.snapshot()));r.forEach((t=>{e&&(this._moveEndInIfCorner(t.begin(),t),this._moveEndInIfCorner(t.end(),t))}));const i=r.first().begin().z();return this._subtractFrameEdges(r.map((e=>e.xy()))).filter((e=>e.length()>n.unit(1,"in").toNumeric(this.unit()))).map((e=>this._shiftedEdgeForRubRail(e).addZ(i).relativeTo(this.referencePoint())))}_rubRailEnabledForEdge(e){return this.componentOf().rubRailEnabledForEdge(e)}_rubRailEnabledForCorner(e){return this.componentOf().rubRailEnabledForCorner(e)}_rubRailTolerance(){return Math.DEFAULT_TOLERANCE}_moveEndInIfCorner(e,t){const r=this._rubRailTolerance()+n.unit(1,"in").toNumeric(this.unit()),i=this.rubRailCorners().find((t=>e.equals(t.locator(),r)));if(i){const n=this.rubRailInset().toNumeric(this.unit()),s=i.locator().equals(t.begin(),r)?1:-1,o=t.direction().multipliedBy(n*s),a=t.direction().multipliedBy(t.direction().dot(i.locator().add(o).subtract(e)));e.moveBy(a.x(),a.y())}}rubRailCorners(){return this.rubRailEnabled()?(this._rubRailCorners||(this._rubRailCorners=this._defaultRubRailCorners(),this._rubRailCorners.forEach((e=>e.setComponentOf(this)))),this._rubRailCorners):[]}_defaultRubRailCorners(){return this._rubrailCornerLocations().map((e=>new m(e)))}_rubrailCornerLocations(){const e=this.deckingEndEdges(),t=this.deckingEdges(),r=[],[n,i]=this.endEdges();return this.isEndSection()&&(this.isContainedOn(n,n.begin())||r.push(new o(e.first(),0)),this.isContainedOn(n,n.end())||r.push(new o(t.first(),0))),this.isBeginSection()&&(this.isContainedOn(i,i.begin())||r.push(new o(e.last(),0)),this.isContainedOn(i,i.end())||r.push(new o(t.last(),0))),r.filter((e=>this._rubRailEnabledForCorner(e)))}resetComponents(){super.resetComponents(),this._resetRubRailComponents(),this.resetFloats()}_resetRubRailComponents(){this._rubRailCorners=void 0,this._rubRails=void 0}resetFloats(){this._floats=void 0}resetCornerBrackets(){this._cornerBrackets=void 0}angleChanged(e){super.angleChanged(e),this.resetComponents()}components(){return[...super.components(),this.surface(),...this.floats(),...this.rubRailCorners(),...this.rubRails()]}_deckScrewMaterial(){const e=this.isPressureTreated()?"F-DSWW":"F-DSCW";return new _(this._deckScrewCount(),R.hardware[e])}_deckScrewCount(){throw new u(this,"_deckScrewCount")}isNonArticulatingBracketAt(e){return this.componentOf().isNonArticulatingBracketAt(e)}isConnectionNonArticulating(e){return this.componentOf().isConnectionNonArticulating(e)}connectionFor(e){return this.componentOf().connectionFor(e)}delete(){}isDeleteable(){return!1}defaultAnnotations(){if(1===this.componentOf().framingSections().length)return[];return[new(this.systemStrategy().annotationType())(this.sideEdges().first(),30,this.unit())]}defaultFigure(){return new f(this)}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_floats","_heightChangedObservers","_rubRailCorners","_rubRails"]}}i(AMDockSection,"heightChanged"),e.exports=AMDockSection},3260:(e,t,r)=>{const n=r(63768),{RelativeLocator:i}=r(62048),s=r(60657),o=r(42433);e.exports=class AMDockSectionSpecification{constructor(e){this._size=e}size(){return this._size}defaultLength(){return n.unit(this.size().split("x").first(),"ft")}defaultWidth(){return n.unit(this.size().split("x").last(),"ft")}defaultFloats(e){const t=e.joists().first().materialSpecifier().details().depth.toNumeric(e.unit())+e.surface().materialSpecifier().details().width.toNumeric(e.unit()),r=e.locator().addZ(t),n=e.mainAxis(),a=e.crossAxis(),l=e.floatHeight();return o(this.size(),l,e.unit()).map((t=>{const o=this._insetForFloat(t,e),c=-1*Math.sign(t.positionOffset.y)*o.toNumeric(e.unit()),u=t.positionOffset.y+c,d=r.add(n.multipliedBy(u)).add(a.multipliedBy(t.positionOffset.x)),h=i.makeRelativeTo(d,e.referencePoint()),p=e.angle()+t.angleOffset;return new s(h,t.width,t.length,l,p)}))}_insetForFloat(e,t){return e.onBegin?t.framingInsetForBegin():e.onEnd?t.framingInsetForEnd():n.unit(0,"in")}deckingBoardCount(){return this.defaultLength().equals(n.unit(12,"ft"))?24:this.defaultLength().equals(n.unit(16,"ft"))?33:this.defaultLength().equals(n.unit(20,"ft"))?41:void 0}crossStringerDistanceFromCenter(){switch(this.size()){case"12x5":case"12x6":return n.unit(21.625,"in");case"20x4":case"20x5":case"20x6":return n.unit(51.625,"in");case"12x8":return n.unit(30,"in")}}}},97946:(e,t,r)=>{const n=r(63768),{lumber:i}=r(93613),s=r(42525),o=r(7568),{lumber:a}=r(47347);e.exports=class AMDocksLumberProcessor extends s{constructor(e){super(),this._includeLumberInMaterialList=e}includeLumberInMaterialList(){return this._includeLumberInMaterialList}process(e){return this.includeLumberInMaterialList()?super.process(e):e.filter((e=>!this.isMaterialToProcess(e)))}materialsToProcess(){return[...Object.keys(i),"C54x6","C2x8"]}processLineItem(e){const t=e.quantity(),r=e.specifier();return this._cutLengthLineItem(t,r)||this._cutLumberLineItems(t,r)}_cutLengthLineItem(e,t){const r=this._findLumberCutAlias(e,t);if(!r)return;const i=n.unit(r.details().nominalLength,"ft");return new o(1,r,i)}_findLumberCutAlias(e,t){const r=e.toNumeric("ft"),i=n.unit(2,"in").toNumeric("ft");return this._candidateSpecifiers(t).find((e=>e.details().nominalLength>=r-i||e.details().nominalLength.isNearTo(r)))}_cutLumberLineItems(e,t){const r=e.toNumeric("ft"),i=this._candidateSpecifiers(t).last(),s=Math.floor(r/i.details().nominalLength),a=r%i.details().nominalLength;return[new o(s,i,n.unit(i.details().nominalLength,"ft")),this._cutLengthLineItem(n.unit(a,"ft"),t)]}_candidateSpecifiers(e){return Object.values(a).filter((t=>t.details().sourceSpecifier.equals(e))).sort(((e,t)=>e.details().nominalLength-t.details().nominalLength))}}},87046:(e,t,r)=>{const n=r(63768),{EditableProperty:i}=r(7340),{MaterialSpecifier:s}=r(93613),o=r(56714),a=r(97946),l=r(98609),c=r(46618),u=r(73282),d=r(9649),h=r(87960),p=r(7524),m=r(94263),f=r(69515),g=r(80716),y=r(42947),b=r(80317),v=r(47347),_="Dock Type",x="Multiple";e.exports=class AMDocksProject extends p{static DOCK_CLASSES=[d,l,c];get materials(){return v}afterBuildFromTemplate(){this.resetFactoryAssemblyPrice()}defaultDisplayProperties(){return[...super.defaultDisplayProperties(),...this.isPressureTreated()?[]:[new i(this,"Has Wear Deck Frame",{type:"boolean",label:"WearDeck Frame/Skirt"})],new i(this,"Rub Rail Color",{type:"select",choices:this.rubRailColorChoices()}),new i(this,"Rub Rail Style",{type:"select",choices:this.rubRailStyleChoices()}),new i(this,"Rub Rail Fastener Type",{type:"select",choices:this.rubRailFastenerChoices(),label:"Rub Rail Fastener"}),new i(this,"Cleat Length",{type:"select",choices:this.cleatLengthChoices(),label:"Cleat Type"}),...this.defaultAdminProperties()]}defaultAdminProperties(){return this.systemStrategy().isAdmin()?[new i(this,"Factory Assembly Enabled",{type:"boolean",label:"Factory Assembly"}),...this.factoryAssemblyEnabled()?[]:[new i(this,"Include Lumber In Material List",{type:"boolean",label:"Include Lumber Materials"})],new i(this,"Is Commercial",{type:"boolean",label:"Commercial"}),new i(this,"Industry Pricing",{type:"boolean"}),new i(this,_,{type:"select",choices:this.dockTypeChoices()})]:[]}dockTypeChoices(){const e=this.constructor.DOCK_CLASSES.map((e=>({label:e.type(),value:e})));return this._hasSameTypeDocks()||e.unshift({label:x,value:x,disabled:!0}),e}dockType(){return 0===this.docks().length?d:this._hasSameTypeDocks()?this.constructor.DOCK_CLASSES.find((e=>e.type()===this.docks().first().type())):x}_hasSameTypeDocks(){if(0===this.docks().length)return!0;const e=this.docks().first().type();return this.docks().every((t=>t.type()===e))}add(e){if(super.add(e),e.role?.()===b.DOCK){const e=this.displayProperties().find((e=>e.name()===_));if(!e)return;e.options().choices=this.dockTypeChoices(),e.update()}}remove(e){if(super.remove(e),e.role?.()===b.DOCK){const e=this.displayProperties().find((e=>e.name()===_));if(!e)return;e.options().choices=this.dockTypeChoices(),e.update()}}setDockType(e){const t=new o(e),r=this.docks(),n=r.flatMap((e=>t.convert(e,this)));r.map((e=>e.delete())),n.map((e=>this.add(e))),n.map((e=>e.updateConnections()))}industryPricing(){return void 0===this._industryPricing&&(this._industryPricing=!1),this._industryPricing}toggleIndustryPricing(){this._industryPricing=!this.industryPricing(),this.resetFactoryAssemblyPrice()}includeLumberInMaterialList(){return!!this.factoryAssemblyEnabled()||(void 0===this._includeLumberInMaterialList&&(this._includeLumberInMaterialList=!0),this._includeLumberInMaterialList)}toggleIncludeLumberInMaterialList(){this.factoryAssemblyEnabled()||(this._includeLumberInMaterialList=!this.includeLumberInMaterialList())}factoryAssemblyEnabled(){return void 0===this._factoryAssemblyEnabled&&(this._factoryAssemblyEnabled=!0),this._factoryAssemblyEnabled}toggleFactoryAssemblyEnabled(){this._factoryAssemblyEnabled=!this.factoryAssemblyEnabled(),this.resetDisplayProperties()}isCommercial(){return void 0===this._isCommercial&&(this._isCommercial=!1),this._isCommercial}toggleIsCommercial(){this._isCommercial=!this.isCommercial(),this.docks().forEach((e=>e.projectTypeChanged()))}setDeckingOption(e){super.setDeckingOption(e),this.resetDisplayProperties()}isPressureTreated(){return"Pressure Treated"===this.deckingOption().name()}hasWearDeckFrame(){return!this.isPressureTreated()&&(this._hasWearDeckFrame||(this._hasWearDeckFrame=!1),this._hasWearDeckFrame)}toggleHasWearDeckFrame(){this._hasWearDeckFrame=!this._hasWearDeckFrame,this.docks().forEach((e=>e.resetFramingBoards()))}rubRailColorChoices(){return[{label:"Black",value:"black-plastic"},{label:"White",value:"white-plastic"}]}rubRailColor(){return this._rubRailColor||(this._rubRailColor=this.rubRailColorChoices().first().value),this._rubRailColor}setRubRailColor(e){this._rubRailColor=e,this.notifyRubRailChanged()}notifyRubRailChanged(){this.docks().forEach((e=>e.rubRailOptionsChanged?.()))}notifyDockMoved(){this.docks().forEach((e=>e.resetFramingSections?.())),this.gangways().forEach((e=>e.updateLandingHeight?.()))}rubRailStyleChoices(){return Object.values(g.STYLES).map((e=>({value:e,label:e})))}rubRailStyle(){return this._rubRailStyle||(this._rubRailStyle=this.rubRailStyleChoices().first().value),this._rubRailStyle}setRubRailStyle(e){this._rubRailStyle=e,this.notifyRubRailChanged()}rubRailFastenerType(){return this._rubRailFastenerType||(this._rubRailFastenerType=this.rubRailFastenerChoices().first().value),this._rubRailFastenerType}setRubRailFastenerType(e){this._rubRailFastenerType=e}rubRailFastenerChoices(){return[{label:'1.5" Ring Nail / Bag - 0.25 LBS each',value:"F-RNB"},{label:' 1" Screw / Bag - 0.21 LBS each',value:"F-SSB"}]}cleatLength(){return this._cleatLength||(this._cleatLength=this.cleatLengthChoices().first().value),this._cleatLength}setCleatLength(e){this._cleatLength=e,this.cleats().forEach((e=>e.onLengthChanged()))}cleatLengthChoices(){return[{label:'10" Steel Cleat - 2.25 LBS',value:n.unit(10,"in")},{label:'12" Steel Cleat - 3.50 LBS',value:n.unit(12,"in")}]}totalDockArea(){return this.docks().reduce(((e,t)=>n.add(t.area(),e)),n.unit(0,"sqft"))}totalDockSQFT(){return this.totalDockArea().toNumeric("sqft")}_materialLineItemProcessors(){return[new u(this.includeLumberInMaterialList()),new a(this.includeLumberInMaterialList()),new h,new f(Object.keys(this.materials.rubRail))]}shippingCostProperty(){return this._shippingCostProperty||(this._shippingCostProperty=new i(this,"Shipping Cost",{type:"number"})),this._shippingCostProperty}shippingCost(){return this._shippingCost||(this._shippingCost=0),this._shippingCost}setShippingCost(e){this._shippingCost=e}factoryAssemblyPriceProperty(){return this._factoryAssemblyPriceProperty??=new i(this,"Factory Assembly Price",{type:"number"})}factoryAssemblyPrice(){return this._factoryAssemblyPrice??this.priceForMaterial(this.materials.factoryAssembly)}resetFactoryAssemblyPrice(){this._factoryAssemblyPrice=void 0}setFactoryAssemblyPrice(e){this._factoryAssemblyPrice=e}editableMaterialLineItems(){return[this._factoryAssemblyLineItem(),m.builder(new s("AMD-SC","AMD-SC",{description:"Shipping Cost"})).propertiesCollection({[y.amount]:this.shippingCostProperty()}).build(),...super.editableMaterialLineItems()].filter((e=>e))}_factoryAssemblyLineItem(){if(this.factoryAssemblyEnabled())return m.builder(new s("AMD-FA","AMD-FA",{description:"Factory Assembly"})).propertiesCollection({[y.unitPrice]:this.factoryAssemblyPriceProperty()}).quantity(this.totalDockSQFT()).unit("sqft").build()}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_shippingCostProperty","_factoryAssemblyPriceProperty"]}logo(){return"american-muscle-docks-logo--info.jpg"}watermarkLogo(){return"american-muscle-docks-watermark.png"}watermarkAlpha(){return.03}pdfDocumentClass(){return AMDocksPDFDocument}}},56199:(e,t,r)=>{const n=r(6556),i=r(18734),s=r(28174),o=r(47347);e.exports=class AMDocksSteelFrameBracket extends s{modelFile(){return"am-docks-steel-hardware"}defaultFigure(){const e=new i(this);return e.updateProperties({fillStyle:"#bbb",strokeStyle:"#000",lineWidth:.1}),e}selfMaterialLineItems(){return[...super.selfMaterialLineItems(),...this._pinMaterial()]}_pinMaterial(){if(!this.partCode().endsWith("TF")&&!this.partCode().endsWith("TFD"))return[];const e=this.partCode().includes("D")?2:1;return[new n(e,o.hardware["F-PIN34"])]}}},60657:(e,t,r)=>{const n=r(63768),{three:i}=r(37732),s=r(57473),o=r(6556),a=r(34249),l=r(18734),c=r(47347);e.exports=class AMFloat extends s{constructor(e,t,r,n,i){super(e),this._angle=i,this._width=t,this._length=r,this._height=n}width(){return this._width}length(){return this._length}height(){return this._height}_identifierWidth(){return n.divide(this.width(),n.unit(12,"in")).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES)%1!=0?Math.round(this.width().toNumeric("in")):Math.round(this.width().toNumeric("ft"))}_identifierLength(){return n.divide(this.width(),n.unit(12,"in")).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES)%1!=0?Math.round(this.length().toNumeric("in")):Math.round(this.length().toNumeric("ft"))}_identiferHeight(){return Math.round(this.height().toNumeric("in"))}_modelIdentifier(){const e=`${this._identifierWidth()}x${this._identifierLength()}`;return`am-docks-${this._identiferHeight()}-floats->${e}`}partCode(){const e=n.larger(this.width(),n.unit(2,"ft"))&&n.larger(this.length(),n.unit(3,"ft"))?"T":"";return`E-${this._identifierWidth()}${this._identifierLength()}${this._identiferHeight()}${e}`}angle(){return this._angle}rotation(){const e=this.angle()+Math.PI_2;return(new i.Quaternion).setFromAxisAngle(new i.Vector3(0,0,1),e)}materialIdentifiers(){return["black-plastic"]}selfMaterialLineItems(){return[new o(1,c.floats[this.partCode()])]}defaultFigure(){const e=new l(this);return e.updateProperties({fillStyle:"#555",strokeStyle:"#000",lineWidth:.1}),new a(e)}}},38014:(e,t,r)=>{const n=r(63768),{EditableProperty:i,CompositeFigure:s}=r(7340),{Composite3DFigure:o}=r(37732),{MissingOverride:a}=r(50988),l=r(57100);e.exports=class AMFrameConnection extends l{static NON_ARTICULATING_IDENTIFIER="Non Articulating - Fixed";static gap(){return n.unit(3,"in")}async load(){return Promise.all(this.components().map((e=>e.load?.())))}defaultDisplayProperties(){return[new i(this,"Type Identifier",{type:"select",choices:this.typeChoices(),label:"Type"})]}typeChoices(){throw new a(this,"typeChoices")}typeIdentifier(){return this._typeIdentifier||this.setTypeIdentifier(this._defaultTypeIdentifier()),this._typeIdentifier}_defaultTypeIdentifier(){throw new a(this,"_defaultTypeIdentifier")}setTypeIdentifier(e){this._typeIdentifier=e,this._type=void 0,this.update(),this.docks().forEach((e=>e.resetFramingSections()))}type(){return this._type??=this.generateType()}generateType(){throw new a(this,"generateType")}gap(){return this.constructor.gap()}connectionWidth(){return this.gap()}staleTolerance(){return this.gap()}update(){this._ensureCorrectGap(),super.update(),this._components=void 0}_ensureCorrectGap(){if(this._ensuringCorrectGapInprogress)return;this._ensuringCorrectGapInprogress=!0;const e=this.edges().first().shortestLineFrom(this.edges().last().begin(),!0).length()-this.type().connectionGap().toNumeric(this.unit()),t=this.docks().first(),r=this.edges().first().normal().multipliedBy(e);t.moveConnectedDocksBy(r.x(),r.y(),this),this._ensuringCorrectGapInprogress=!1}components(){return this._components??=this.type().componentsFor(this)}isConnectingDockType(e){return this.docks().first().type()===e}delete(){super.delete(),this.componentOf()?.remove(this)}defaultFigure(){return s.withModel(this)}threeFigure(){return o.withModel(this)}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_components","_type"]}}},79009:(e,t,r)=>{const n=r(63768),{three:i}=r(37732),{PlanarNormalToEdgeLocator:s,$P:o,ProportionalEdgeLocator:a}=r(62048),{EditableProperty:l,ReadableProperty:c}=r(7340),u=r(79851),d=r(21065),h=r(46748),p=r(34909),m=r(92916),f=r(29005),g=r(6556),y=r(90559),b=r(14933),v=r(47347);e.exports=class AMGangway extends u{static defaultWidth(){return n.unit(3,"ft")}static defaultLength(){return n.unit("116 in")}static TYPES={threeFeet:"3 ft",fourFeet:"4 ft",fourFeetADA:"4 ft ADA"};resetLength(){}setComponentOf(e){e||this.detachFrames(),this._componentOf=e}isADA(){return this._type===this.constructor.TYPES.fourFeetADA}defaultFigure(){return new f(this)}widthForType(e){switch(e){case this.constructor.TYPES.threeFeet:return n.unit("3 ft");case this.constructor.TYPES.fourFeet:case this.constructor.TYPES.fourFeetADA:return n.unit("4 ft")}}modelType(){return this.isADA()?"am-docks-gangway-tall-rail":"am-docks-gangway-short-rail"}bracketOnHighEnd(){return void 0===this._bracketOnHighEnd&&(this._bracketOnHighEnd=!0),this._bracketOnHighEnd}toggleBracketOnHighEnd(){this._bracketOnHighEnd=!this._bracketOnHighEnd,this.resetComponents()}type(){return this._type||(this._type=this.constructor.TYPES.threeFeet),this._type}setType(e){this._type=e,this.setWidth(this.widthForType(e))}gradeLabel(){return this._gradeHintHelper().hintFor(this.slopeAngle())}_gradeHintHelper(){return this.__gradeHintHelper??=new b}defaultDisplayProperties(){return[new l(this,"Type",{type:"select",label:"Width",choices:Object.values(this.constructor.TYPES).map((e=>({value:e,label:e})))}),new l(this,"Transition Plate Enabled",{type:"boolean",label:"Transition Plate"}),new l(this,"Roller Deck Plate Enabled",{type:"boolean",label:"Roller Deck Plate"}),new l(this,"Bracket On High End",{type:"boolean",label:"Bracket on High End"}),new c(this,"Grade Label",{type:"text",label:"Grade"})]}transitionPlateEnabled(){return void 0===this._transitionPlateEnabled&&(this._transitionPlateEnabled=!1),this._transitionPlateEnabled}toggleTransitionPlateEnabled(){this._transitionPlateEnabled=!this.transitionPlateEnabled(),this._transitionPlatePieces=void 0}rollerDeckPlateEnabled(){return void 0===this._rollerDeckPlateEnabled&&(this._rollerDeckPlateEnabled=!1),this._rollerDeckPlateEnabled}toggleRollerDeckPlateEnabled(){this._rollerDeckPlateEnabled=!this.rollerDeckPlateEnabled(),this._rollerDeckPlate=void 0}rollerDeckPlate(){if(this.rollerDeckPlateEnabled()){if(!this._rollerDeckPlate){const e=Math.round(this.width().toNumeric("ft"));this._rollerDeckPlate=new y(this.centerEdge().end(),`am-docks-roller-deck-plate->${e}`,this.rotation())}return this._rollerDeckPlate}}transitionPlatePieces(){if(!this.transitionPlateEnabled())return[];if(!this._transitionPlatePieces){const e=Math.round(this.width().toNumeric("ft")),t=this.centerEdge().direction().cross(this.centerEdge().normal()),r=new s(this.lowerEdge().center(),t,1.57);this._transitionPlatePieces=[new y(r,`am-docks-transition-plate->${e}-plate`,this.rotation()),new y(r,`am-docks-transition-plate->${e}-hinge`,this.rotation().premultiply(this.slopeRotation()))]}return this._transitionPlatePieces}surfaceType(){return d.Aluminum}snapsToCenter(){return!1}moveBy(...e){const t=super.moveBy(...e);return this.updateLandingHeight(),t}updateLandingHeight(){if(this.lowerFrame())return;const e=this._findFrameUnderLowerEnd();e&&this._rotateLowerEdgeTo(e.gangwayLandingHeight())}_findFrameUnderLowerEnd(){const e=this.lowerEdge().xy();return this.componentOf()?.docks().find((t=>e.segmentsInsidePolygon(t.geometry().xy()).length>0))}_rotateLowerEdgeTo(e){const t=n.subtract(e,this.dockSideHeight()).toNumeric(this.unit()),r=this._slopeAngleFromDimensions(this.length(),n.subtract(this.bankSideHeight(),e))-this.slopeAngle();this._tiltGeometry(r,this.lowerEdge(),this.upperEdge()),this.vertices().forEach((e=>e.moveBy(0,0,-t))),this.resetComponents()}frameResized(){super.frameResized(),this.resetComponents()}angleChanged(e){super.angleChanged(e),this.resetComponents()}bankHeightChanged(e){super.bankHeightChanged(e),this.resetComponents()}setBankSideHeight(e){const t=this._slopeAngleFromDimensions(this.length(),n.subtract(e,this.dockHeight()))-this.slopeAngle();this._tiltGeometry(t,this.lowerEdge(),this.upperEdge())}snappableSizes(e){const t=n.unit(5,"ft");if(this.alongCrossAxis(e.vector())){const e=[];for(let r=this.minimumLength();n.smaller(r,this.maximumLength())||r.equals(this.maximumLength());r=n.add(r,t))e.push(r);return e}}_defaultWidth(){return n.unit(3,"ft")}_defaultLength(){return this.minimumLength()}_midSectionLength(){return Math.round(this.length().toNumeric(this.unit()))>n.unit(30,"ft").toNumeric(this.unit())?n.unit(37,"in"):n.unit(34,"in")}async load(){return Promise.all(this.components().map((e=>e.load?.())))}minimumLength(){return n.unit(116,"in")}maximumLength(){return n.unit(476,"in")}minimumSpan(){return this.minimumLength().toNumeric(this.unit())}maximumSpan(){return this.maximumLength().toNumeric(this.unit())}centerEdge(){return this.upperEdge().center().to(this.lowerEdge().center())}slopeRotation(){return(new i.Quaternion).setFromAxisAngle(this.crossAxis().negated().toThreeJS(),this.slopeAngle())}rotation(){return(new i.Quaternion).setFromAxisAngle(new i.Vector3(0,0,1),this.angle()+Math.PI_2)}bracketLocator(){return this.bracketOnHighEnd()?new a(this.centerEdge(),0):new a(this.centerEdge(),1)}rollerLocator(){return this.bracketOnHighEnd()?new a(this.centerEdge(),1):new a(this.centerEdge(),0)}_flippedScale(){return o(1,-1,1)}scaleForBracketComponent(){return this.bracketOnHighEnd()?this._flippedScale():void 0}bracketEnd(){return this._bracketEnd||(this._bracketEnd=new p(this.bracketLocator(),`${this.modelType()}->bracket-end`,this.rotation().premultiply(this.slopeRotation()),this.width(),this.scaleForBracketComponent()),this._bracketEnd.setComponentOf(this)),this._bracketEnd}rollerEnd(){return this._rollerEnd||(this._rollerEnd=new p(this.rollerLocator(),`${this.modelType()}->roller-end`,this.rotation().premultiply(this.slopeRotation()),this.width(),this.scaleForBracketComponent()),this._rollerEnd.setComponentOf(this)),this._rollerEnd}_defaultEndFills(){const e=n.multiply(this._midSectionLength(),this.midSections().length/2).toNumeric(this.unit()),t=new s(this.centerEdge().center(),this.mainAxis().cross(this.crossAxis()),0,-e),r=new s(this.centerEdge().center(),this.mainAxis().cross(this.crossAxis()),0,e);return[new p(t,`${this.modelType()}->end-fill`,this.rotation().premultiply(this.slopeRotation()),this.width(),this._flippedScale()),new p(r,`${this.modelType()}->end-fill`,this.rotation().premultiply(this.slopeRotation()),this.width())]}endFills(){return this._endFills||(this._endFills=this._defaultEndFills(),this._endFills.forEach((e=>e.setComponentOf(this)))),this._endFills}_defaultMidSections(){const e=h`floor(${this.length()} / (${this._midSectionLength()} * 2))`,t=[],r=this.centerEdge().center();for(let i=0;i<e;i++){const e=n.multiply(i+.5,this._midSectionLength()).toNumeric(this.unit());t.push(new p(new s(r,this.mainAxis().cross(this.crossAxis()),0,e),this._midSectionModelName(),this.rotation().premultiply(this.slopeRotation()),this.width(),this._flippedScale())),t.push(new p(new s(r,this.mainAxis().cross(this.crossAxis()),0,-e),this._midSectionModelName(),this.rotation().premultiply(this.slopeRotation()),this.width()))}return t}_midSectionModelName(){return`${this.modelType()}->${this._midSectionLength().toNumeric("in")}-mid`}midSections(){return this._midSections||(this._midSections=this._defaultMidSections(),this._midSections.forEach((e=>e.setComponentOf(this)))),this._midSections}hingeBracket(){return this._hingeBracket||(this._hingeBracket=new m,this._hingeBracket.setComponentOf(this)),this._hingeBracket}components(){return[this.bracketEnd(),this.rollerEnd(),this.hingeBracket(),...this.midSections(),...this.endFills(),this.rollerDeckPlate(),...this.transitionPlatePieces()].filter((e=>e))}resetComponents(){this._bracketEnd=void 0,this._hingeBracket=void 0,this._rollerEnd=void 0,this._midSections=void 0,this._endFills=void 0,this._rollerDeckPlate=void 0,this._transitionPlatePieces=void 0}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_bracketEnd","_hingeBracket","_rollerEnd","_midSections","_endFills","_rollerDeckPlate","_transitionPlatePieces","__gradeHintHelper"]}offsetWithOverhang(e){return n.add(e,n.unit(1.7,"in"))}dockHeight(){const e=this.lowerFrame()?.gangwayAttachmentHeight?.();if(e)return e;if(this._geometry){const e=this._findFrameUnderLowerEnd()?.gangwayLandingHeight?.();if(e)return e}return n.unit(18.5,"in")}_updateDockSideHeight(){super._updateDockSideHeight(),this.resetComponents()}selfMaterialLineItems(){return[new g(1,v.gangways[this._partCode()]),this._transitionPlateMaterial(),this._rollerDeckPlateMaterial()].filter((e=>e))}_partCode(){return`AMD-AR${Math.round(this.width().toNumeric("ft"))}${Math.round(this.length().toNumeric("ft"))}${this.isADA()?"ADA":"T"}`}_transitionPlateMaterial(){if(!this.transitionPlateEnabled())return;const e=`AMD-ARTP${Math.round(this.width().toNumeric("ft"))}`;return new g(1,v.gangways[e])}_rollerDeckPlateMaterial(){if(!this.rollerDeckPlateEnabled())return;const e=`AMD-ARDP${Math.round(this.width().toNumeric("ft"))}`;return new g(1,v.gangways[e])}}},92916:(e,t,r)=>{const{Composite3DFigure:n}=r(37732),{CompositeFigure:i}=r(7340),s=r(83102),o=r(90559),a=r(34909);e.exports=class AMGangwayHingeBracket extends s{gangway(){return this.componentOf()}components(){return[this.transitionalPlate(),...this.hingePieces()]}transitionalPlate(){return this._transitionalPlate||(this._transitionalPlate=new a(this.gangway().bracketLocator(),"am-docks-gangway-transitional-plate",this.gangway().rotation(),this.gangway().width(),this.gangway().scaleForBracketComponent()),this._transitionalPlate.setComponentOf(this)),this._transitionalPlate}_defaultHingePieces(){return[new o(this.gangway().bracketLocator(),`am-docks-gangway-hinge-${Math.round(this.gangway().width().toNumeric("ft"))}ft->plate-end`,this.gangway().rotation(),this.gangway().scaleForBracketComponent()),new o(this.gangway().bracketLocator(),`am-docks-gangway-hinge-${Math.round(this.gangway().width().toNumeric("ft"))}ft->bracket-end`,this.gangway().rotation().premultiply(this.gangway().slopeRotation()),this.gangway().scaleForBracketComponent())]}hingePieces(){return this._hingePieces||(this._hingePieces=this._defaultHingePieces()),this._hingePieces}async load(){return Promise.all(this.components().map((e=>e.load?.())))}defaultFigure(){return i.withModel(this)}threeFigure(){return n.withModel(this)}}},68475:(e,t,r)=>{const n=r(63768),{EditableProperty:i}=r(7340),{NormalToEdgeLocator:s}=r(62048),o=r(74352),a=r(6556),l=r(80317),c=r(47347),u=r(32877);e.exports=class AMPileGuide extends o{static displayName(){return"Pile Guide"}static iconName(){return"pile-guide"}static role(){return l.PILE_GUIDE}static TYPES={'6" Light Duty Hoop':"am-docks-ph-l6",'8" Light Duty Hoop':"am-docks-ph-l8",'10" Light Duty Hoop':"am-docks-ph-l10",'12" Light Duty Hoop':"am-docks-ph-l12",'14" Light Duty Hoop':"am-docks-ph-l14",'16" Light Duty Hoop':"am-docks-ph-l16",'18" Light Duty Hoop':"am-docks-ph-l18",'10" Hoop Pile Guide - No Roller':"am-docks-ph-h10",'12" Hoop Pile Guide - No Roller':"am-docks-ph-h12",'14" Hoop Pile Guide - No Roller':"am-docks-ph-h14",'16" Hoop Pile Guide - No Roller':"am-docks-ph-h16",'18" Hoop Pile Guide - No Roller':"am-docks-ph-h18",'10" Hoop Pile Guide - Rubber Roller':"am-docks-ph-h10r",'12" Hoop Pile Guide - Rubber Roller':"am-docks-ph-h12r",'14" Hoop Pile Guide - Rubber Roller':"am-docks-ph-h14r",'16" Hoop Pile Guide - Rubber Roller':"am-docks-ph-h16r",'18" Hoop Pile Guide - Rubber Roller':"am-docks-ph-h18r",'10" Hoop Pile Guide - Poly Roller':"am-docks-ph-h10rp",'12" Hoop Pile Guide - Poly Roller':"am-docks-ph-h12rp",'14" Hoop Pile Guide - Poly Roller':"am-docks-ph-h14rp",'16" Hoop Pile Guide - Poly Roller':"am-docks-ph-h16rp",'18" Hoop Pile Guide - Poly Roller':"am-docks-ph-h18rp",'14" Square Hoop Pile Guide - Rubber':"am-docks-ph-hsr14",'16" Square Hoop Pile Guide - Rubber':"am-docks-ph-hsr16",'14" Square Hoop Pile Guide - Poly':"am-docks-ph-hsrp14",'16" Square Hoop Pile Guide - Poly':"am-docks-ph-hsrp16","Chain Pile Holder":"am-docks-ph-c"};static defaultType(){return Object.values(this.TYPES).first()}static typeChoices(){return Object.keys(this.TYPES).map((e=>({value:this.TYPES[e],label:e})))}setFrame(e){super.setFrame(e),this.locatorSourceChanged()}locator(){const e=this.referencePoint(),t=this.frame()?.pileGuideOffset(e);return t?new s(e,t.toNumeric(this.unit())):e}dockTypes(){return this._dockTypesFor(this.partCode())}_dockTypesFor(e){return e.toLowerCase().includes("ph-l")?[u.wood,u.steelChannel]:[u.wood,u.steelTruss,u.steelChannel]}_modelIdentifier(){return this.type()}materialIdentifiers(){return["aluminum"]}zLevel(){const e=-n.unit(2,"in").toNumeric(this.unit());return this.referencePoint().z()+e}type(){return this._type||(this._type=this._defaultType()),this._type}_defaultType(){return this.constructor.defaultType()}setType(e){this._type=e,this.resetModel()}defaultDisplayProperties(){return[new i(this,"Type",{type:"select",choices:this.typeChoices()})]}typeChoices(){return this.constructor.typeChoices().map((e=>({...e,disabled:!this._dockTypesFor(e.value).includes(this.frame().type())})))}partCode(){return this.type().replace("am-docks-","").toUpperCase()}selfMaterialLineItems(){return[new a(1,c.pileGuide[this.partCode()]),...this.boltMaterials()]}boltMaterials(){return this.frame().type()===u.steelTruss?[new a(4,c.hardware["F-CB53"]),new a(4,c.hardware["F-CB545"])]:[new a(8,c.hardware["F-CB53"])]}}},55038:(e,t,r)=>{const{EditableProperty:n}=r(7340),i=r(74352),s=r(6556),o=r(77682),a=r(80317),l=r(47347),c=r(32877);e.exports=class AMPipeHold extends i{static displayName(){return"Pipe Holder"}static iconName(){return"pipe-hold"}static role(){return a.PIPE_HOLD}static TYPES={'Wood Frame 3" Pipe Holder - Split':"WD-PH3S",'Wood Frame 3" Pipe Holder - Home Owners':"WD-HOPH3",'Wood Frame 3" Elongated Pipe Holder End':"WD-PHE3E",'Wood Frame 3" Elongated Pipe Holder Side':"WD-PHE3S",'Wood Frame 5" Pipe Holder':"WD-PH5",'Wood Frame 5" Pipe Holder - Split':"WD-PH5S",'Wood Frame 2" Pipe Holder - Short':"WD-PH27",'Wood Frame 4" x 4" Bracket':"WD-44B","Wood Frame Inside Corner Pipe Holder":"WD-INPH3",'Steel Truss 3" Pipe Holder - Split':"STF-PH3S",'Steel Truss 5" Pipe Holder - Split':"STF-PH5S",'Steel Truss 3" Pipe Holder - Solid':"STF-PH31",'Steel Truss 2" Pipe Holder - Set Screws':"STF-PH29"};static defaultType(){return this.TYPES['Wood Frame 3" Pipe Holder - Split']}static typeChoices(){return Object.keys(this.TYPES).map((e=>({value:this.TYPES[e],label:e})))}setComponentOf(e){super.setComponentOf(e),e&&this.resetModel()}_dockTypesFor(e){return e.includes("WD")?[c.wood,c.steelChannel]:e.includes("STF")?[c.steelTruss]:void 0}dockTypes(){return this._dockTypesFor(this.partCode())}_modelIdentifier(){return`${this._modelFilename()}->${this.partCode()}`}_modelFilename(){const e="am-docks-pipe-holders";return this.frame()?.type()===c.steelChannel?`${e}-steel-channel`:e}materialIdentifiers(){return["aluminum"]}zLevel(){return this.boundingCube().high()}type(){return this._type||(this._type=this._defaultType()),this._type}_defaultType(){return this.constructor.defaultType()}setType(e){this._type=e,this.resetModel()}defaultDisplayProperties(){const e=this.constructor.typeChoices().map((e=>({...e,disabled:!this._dockTypesFor(e.value).includes(this.frame().type())})));return[new n(this,"Type",{type:"select",choices:e})]}partCode(){return this.type()}snapsToCorners(){return this.type()===this.constructor.TYPES["Wood Frame Inside Corner Pipe Holder"]}detachFromFrame(){const e=this.frame();super.detachFromFrame(),e?.resetAllSectionCornerBrackets()}selfMaterialLineItems(){return[new s(1,l.pipeHold[this.partCode()]),this._backupPlateLineItem(),this._boltLineItem()].filter((e=>e))}_backupPlateLineItem(){if(this.frame().type()===c.steelChannel)return;const e=this.partCode();switch(e){case"WD-INPH3":return;case"WD-PH5S":return new s(1,l.pipeHold["WD-PH5B"]);case"WD-PH27":return new s(1,l.hardware["WD-B"]);case"WD-44B":return new s(2,l.hardware["WD-W"]);default:if(l.pipeHold[`${e}B`])return new s(1,l.pipeHold[`${e}B`])}}_boltLineItem(){if(0!==this._boltCount())return new s(this._boltCount(),l.hardware[this._boltPartCode()])}_boltPartCode(){return this.frame().type()===c.steelTruss?"F-HB515":this.frame().type()===c.steelChannel?"F-CB515":"F-CB53"}_boltCount(){switch(this.partCode()){case"WD-INPH3":return 0;case"WD-PH5":case"WD-PH5S":return 6;case"STF-PH31":return 2;default:return 4}}defaultFigure(){return new o(this)}}},98609:(e,t,r)=>{const n=r(63768),i=r(46618),s=r(17779),o=r(32877);e.exports=class AMSteelChannelDock extends i{static SECTION_LENGTHS_FT=[10,5];static displayName(){return"Steel Channel Dock"}static type(){return o.steelChannel}maxLength(){return n.unit(20,"ft")}lengthSnappingIncrement(){return n.unit(5,"ft")}snappableSizes(e){if(this.alongMainAxis(e.vector()))return[n.unit(3,"ft"),n.unit(4,"ft"),n.unit(6,"ft"),n.unit(8,"ft")]}gangwayLandingHeight(){return n.unit(18.5,"in")}gangwayAttachmentHeight(){return n.unit(12,"in")}_defaultHeight(){return n.unit(12.25,"in")}frameSectionClass(){return s}}},17779:(e,t,r)=>{const n=r(63768),{lumber:i}=r(93613),{ProportionalEdgeLocator:s,NormalToEdgeLocator:o,FixedEdgeLocator:a}=r(62048),l=r(44518),c=r(33735),u=r(60657),d=r(6556),h=r(47347),p=n.unit(10,"ft"),m=n.unit(5,"ft"),f=n.unit(8,"ft"),g=n.unit(6,"ft"),y=(n.unit(4,"ft"),n.unit(3,"ft"));e.exports=class AMSteelChannelDockSection extends c{frameThickness(){return n.unit(6,"in")}stringerThickness(){return n.unit(0,"in")}rubRailNailerSpecifier(){return this.hasWearDeckFrame()?h.c54x6:i.PT2x6}_frameClass(){return l}stringers(){return[]}selfMaterialLineItems(){return[this._rubRailNailerBoltMaterial(),new d(1,h.steelChannel[this.frameKitPartCode()])].filter((e=>e))}frameKitPartCode(){const e=this.width().toNumeric("ft").rounded(),t=this.length().toNumeric("ft").rounded();return`S3-F${e}${this.lengthEquals(m)?t:""}${this._partCodeLumberIdentifier(e)}`}_partCodeLumberIdentifier(e){const t=Object.keys(i).includes(this.deckingOption().materialSpecifier().identifier()),r=this.componentOf().project().includeLumberInMaterialList();return t&&!r&&3===e?"W":t||r||3!==e?t&&r?"WK":!t&&r?"CK":"":"C"}_rubRailNailerBoltPartCode(){return"F-CB3825"}_rubRailNailerBoltQuantity(){return 5*this.rubRailNailers().length}_defaultFloats(){const e=this._floatZLevel();return this._floatLocations().map((({locator:t,angle:r})=>new u(t.addZ(e),this._floatWidth(),this._floatLength(),this.floatHeight(),this.angle()+r)))}_frameWidth(){return this.widthEquals(f)?n.unit(4,"ft"):super._frameWidth()}_frameEdges({addZ:e=!0}={}){if(this.widthEquals(f)){const t=e?this._deckingThickness()+this.stringerThickness().toNumeric(this.unit()):0,r=this.endEdges();return[new s(r.first(),1/4).to(new s(r.last(),3/4)),new s(r.first(),3/4).to(new s(r.last(),1/4))].map((e=>e.addZ(t)))}return super._frameEdges()}_floatLocations(){const e=this.endEdges(),t=this._floatWidth().toNumeric(this.unit())/2,r=new o(e.first().center(),-t).to(new o(e.last().center(),-t));return this.widthEquals(g)?this._floatLocationsFor6Wide(e,t,r):this.widthEquals(f)?this._floatLocationsFor8Wide(e,t):this._generateFloatsForEdge(r)}_floatLocationsFor6Wide(e,t,r){const n=this._floatLength().toNumeric(this.unit())/2,i=[{locator:new o(new a(e.last(),t),-n),angle:Math.PI_2},{locator:new o(new a(e.last(),-t),-n),angle:Math.PI_2}];return this.lengthEquals(p)&&i.unshift({locator:new o(new a(e.first(),t),-n),angle:Math.PI_2},{locator:new o(new a(e.first(),-t),-n),angle:Math.PI_2},{locator:r.center(),angle:0}),i}_floatLocationsFor8Wide(e,t){return this.lengthEquals(m)?[{locator:new o(e.last().center(),-t),angle:0}]:this._frameEdges({addZ:!1}).flatMap((e=>this._generateFloatsForEdge(new a(e,t).to(new a(e,-t)))))}_generateFloatsForEdge(e){const t=this.lengthEquals(m)?2:4,r=[];for(let n=0;n<t;n++)r.push({locator:new s(e,n/(t-1)),angle:0});return r}_floatWidth(){return this.widthEquals(f)&&this.lengthEquals(m)?n.unit(4,"ft"):n.unit(2,"ft")}_floatLength(){return this.widthEquals(f)&&this.lengthEquals(m)?n.unit(8,"ft"):n.larger(this.width(),y)?n.unit(4,"ft"):n.unit(3,"ft")}lengthEquals(e){return this.length().equals(e)}widthEquals(e){return this.width().equals(e)}}},46618:(e,t,r)=>{const n=r(63768),{EditableProperty:i}=r(7340),s=r(5090),o=r(18112),a=r(33735),l=r(69009),c=r(32877);e.exports=class AMSteelTrussDock extends o{static SECTION_LENGTHS_FT=[30,25,20,15,10];static defaultLength(){return n.unit(10,"ft")}static displayName(){return"Steel Truss Dock"}static type(){return c.steelTruss}gangwayLandingHeight(){return n.unit(24.5,"in")}gangwayAttachmentHeight(){return n.unit(19.5,"in")}defaultDisplayProperties(){return[...super.defaultDisplayProperties(),...this.framingSections().some((e=>e.rubRailEnabled()))?[new i(this,"Rub Rail Nailer Edge Map",{type:"edge-boolean-map",label:"Bump Board Override"})]:[]]}rubRailNailerEnabledForEdge(e){const t=this.edges().find((t=>t.direction().dot(e.direction()).isNearTo(1)));return this.rubRailNailerEdgeMap().get(t)}clone(...e){const t=super.clone(...e);return t.edges().forEach(((e,r)=>{t.rubRailNailerEdgeMap().set(e,this.rubRailNailerEdgeMap().get(this.edges()[r]))})),t}rubRailNailerEdgeMap(){return this._rubRailNailerEdgeMap||(this._rubRailNailerEdgeMap=new s(this.geometry().edges().map((e=>[e,!0])))),this._rubRailNailerEdgeMap}setRubRailNailerEdgeMap(e,t){const r=this.pileGuides().filter((t=>e.xy().containsPoint(t.referencePoint().xy())));this.rubRailNailerEdgeMap().set(e,t),this.rubRailOptionsChanged(),r.forEach((e=>e.locatorSourceChanged()))}pileGuideOffset(e){const t=this._findNailerForLocation(e);return t?.materialSpecifier().details().width}_findNailerForLocation(e){const t=this.framingSections();for(let r=0;r<t.length;r++){const n=t[r].rubRailNailers().find((t=>t.edge().xy().containsPoint(e.xy())));if(n)return n}}_defaultHeight(){return n.unit(19.75,"in")}minLength(){return n.unit(10,"ft")}maxLength(){return n.unit(30,"ft")}lengthSnappingIncrement(){return n.unit(5,"ft")}framingInsetForEnd(e){return n.unit(0,"in")}framingInsetForBegin(e){return n.unit(0,"in")}deckingInsetForEnd(e){const t=e.endEdges().first().center(),r=this.connections().find((e=>e.geometry().containsPoint(t)));return r?.type().deckingOffset()??n.unit(0,"in")}deckingInsetForBegin(e){const t=e.endEdges().last().center(),r=this.connections().find((e=>e.geometry().containsPoint(t)));return r?.type().deckingOffset()??n.unit(0,"in")}frameSectionClass(){return a}snapToFramesFilter(){return e=>!0}snappingEdgesFor(e){return this.alongMainAxis(e.vector())?super.snappingEdgesFor(e):[e]}connectionClass(){return l}connectionZLevel(){return this.framingSections().first().zLevel()+this.deckingOption().materialSpecifier().details().width.toNumeric(this.unit())+this.framingSections().first().stringerThickness().toNumeric(this.unit())}deckingOptionChanged(){super.deckingOptionChanged(),this.framingSections().forEach((e=>{e.resetSupportComponents()}))}}},33735:(e,t,r)=>{const n=r(63768),{three:i}=r(37732),{lumber:s}=r(93613),{FixedEdgeLocator:o,$P:a,NormalToEdgeLocator:l}=r(62048),c=r(83465),u=r(5345),d=r(25706),h=r(60657),p=r(6556),m=r(80716),f=r(46748),g=r(47347);e.exports=class AMSteelTrussDockSection extends u{cutBoardsToFit(){return!1}hasWearDeckFrame(){return this.componentOf().hasWearDeckFrame()}stringerSpecifier(){return this.hasWearDeckFrame()?g.c2x3:s.PT2x4}rubRailNailerSpecifier(){return this.hasWearDeckFrame()?g.c2x8:s.PT2x8}_deckingThickness(){return this.deckingOption().materialSpecifier().details().width.toNumeric(this.unit())}stringerSpan(){return n.unit(2,"ft")}_cornerBracketInset(){return n.unit(0,"in")}deckingBoardCount(){return Math.floor(10.5*n.divide(this.length(),n.unit(5,"ft")).rounded())}frameThickness(){return n.unit(12,"in")}stringerThickness(){return n.unit(1.5,"in")}_defaultHeight(){return f`${this.frameThickness()} + ${n.unit(6,"in")} + ${this.deckingOption().materialSpecifier().details().width} + ${this.stringerThickness()}`}resetSupportComponents(){this._steelFrames=void 0,this._floats=void 0}steelFrames(){return this._steelFrames||(this._steelFrames=this._defaultSteelFrames()),this._steelFrames}_defaultSteelFrames(){const e=n.unit(10,"ft"),t=this.length(),r=this._frameEdges(),i=this._frameClass(),s=[];let a=n.unit(0,"in");for(;!a.equals(t);){const l=n.min(n.subtract(t,a),e),c=f`${a} + ${l} / 2`.toNumeric(this.unit());r.forEach((e=>{const t=new o(e,c);s.push(new i(t,this._frameRotation(),this._frameWidth(),l))})),a=n.add(a,l)}return s}_frameWidth(){return this.width()}_frameEdges(){const e=this._deckingThickness()+this.stringerThickness().toNumeric(this.unit()),t=this.endEdges();return[t.last().center().to(t.first().center()).addZ(e)]}_frameClass(){return d}_frameRotation(){return(new i.Quaternion).setFromAxisAngle(new i.Vector3(0,0,1),this.angle())}stringers(){return this._stringers||(this._stringers=this._defaultStringers(),this._stringers.forEach((e=>e.setComponentOf(this)))),this._stringers}_defaultStringers(){const e=this.stringerSpecifier(),t=e.details().depth.toNumeric(this.unit())/2,r=this.framingEndEdges().map((e=>e.addZ(this._deckingThickness()))).map((e=>new o(e,t).to(new o(e,-t)))),n=r.first(),i=r.last().reversed(),s=this.stringerSpan().toNumeric(this.unit()),l=Math.ceil(Math.round(n.length())/s)+1,u=n.length()/(l-1),d=[],h=this.hasWearDeckFrame()?null:"pressure-treated";for(let t=0;t<l;t++){const r=new c(new o(n,t*u),new o(i,t*u),e,void 0,a(0,0,1),h);d.push(r)}return d}_defaultFloats(){const e=this._floatZLevel(),t=this.endEdges(),r=t.first().center().to(t.last().center()).addZ(e),i=[],s=this.length().toNumeric("ft").rounded(),a=n.unit(10,"ft"),l=s%a.toNumeric("ft").rounded(),c=Math.floor(s/a.toNumeric("ft").rounded());if(5===l){const e=n.unit(3,"ft"),t=new o(r,e.toNumeric(this.unit())/2);i.push(this._generateFloat(t,e))}let u=n.unit(l,"ft").toNumeric(this.unit());if(c%2==1){const e=n.unit(3,"ft"),t=new o(r,e.toNumeric(this.unit())/2+u);i.push(this._generateFloat(t,e));const s=new o(r,a.toNumeric(this.unit())+u-e.toNumeric(this.unit())/2);i.push(this._generateFloat(s,e)),u+=a.toNumeric(this.unit())}if(c>1){const e=n.unit(4,"ft"),t=[new o(r,u+e.toNumeric(this.unit())/2),new o(r,u+a.toNumeric(this.unit())),new o(r,-e.toNumeric(this.unit())/2)];i.push(...t.map((t=>this._generateFloat(t,e))))}return i}_floatZLevel(){return this._deckingThickness()+this.stringerThickness().toNumeric(this.unit())+this.frameThickness().toNumeric(this.unit())}_generateFloat(e,t){const r=this.width(),i=n.min(t,r),s=n.max(t,r),o=n.larger(t,r)?this.angle()+Math.PI_2:this.angle();return new h(e,i,s,this.floatHeight(),o)}_edgesToSubtractFor(e){return this.componentOf().connectionEdgesOn(e)}angleChanged(){super.angleChanged(),this._steelFrames=void 0}resetComponents(){super.resetComponents(),this._steelFrames=void 0,this.resetFramingBoards()}resetFramingBoards(){this._stringers=void 0,this._rubRailNailers=void 0}rubRailOptionsChanged(){super.rubRailOptionsChanged(),this._rubRailNailers=void 0}rubRailNailers(){return this.rubRailEnabled()?(this._rubRailNailers||(this._rubRailNailers=this._defaultRubRailNailers(),this._rubRailNailers.forEach((e=>e.setComponentOf(this)))),this._rubRailNailers):[]}_defaultRubRailNailers(){const e=this.rubRailNailerSpecifier(),t=this._rubRailEdges(!1).filter((e=>this._rubRailNailerEnabledForEdge(e))),r=this.hasWearDeckFrame()?null:"pressure-treated";return t.map((t=>new c(t.begin(),t.end(),e,a(e.details().depth.toNumeric(this.unit())/2,e.details().width.toNumeric(this.unit())/2),t.normal(),r)))}_rubRailNailerEnabledForEdge(e){return this.componentOf().rubRailNailerEnabledForEdge(e)}_defaultRubRails(){const e=this._rubRailEdges().filter((e=>this._rubRailEnabledForEdge(e))),t=this.rubRailNailerSpecifier().details().width.toNumeric(this.unit());return e.map((e=>this._rubRailNailerEnabledForEdge(e)?e.shiftedAlongNormalBy(t):e)).map((e=>new m(e)))}_rubrailCornerLocations(){const e=super._rubrailCornerLocations().filter((e=>this.componentOf().connections().every((t=>!t.geometry().containsPoint(e))))),t=this.rubRailNailerSpecifier().details().width.toNumeric(this.unit());return e.map((e=>{const r=this.edges().filter((t=>t.shortestLineFrom(e).length()<3)),n=r.find((t=>Math.abs(t.direction().dot(e.edge().direction())).isNearTo(1))),i=r.find((t=>Math.abs(t.direction().dot(e.edge().normal())).isNearTo(1))),s=this._rubRailNailerEnabledForEdge(n)?t:0,o=this._rubRailNailerEnabledForEdge(i)?-t:0;return new l(e,s,o)}))}_rubRailTolerance(){return this.rubRailNailerSpecifier().details().width.toNumeric(this.unit())+Math.DEFAULT_TOLERANCE}components(){return[...super.components(),...this.steelFrames(),...this.stringers(),...this.rubRailNailers()]}selfMaterialLineItems(){return[this._stringerBoltMaterial(),this._connectionBoltMaterials(),this._rubRailNailerBoltMaterial(),this._deckScrewMaterial(),this._floatBoltMaterial()].filter((e=>e))}_deckScrewCount(){return this.deckingBoardCount()*this.stringers().length*2}_rubRailNailerBoltMaterial(){const e=this._rubRailNailerBoltQuantity();if(0!==e)return new p(e,g.hardware[this._rubRailNailerBoltPartCode()])}_rubRailNailerBoltPartCode(){return"F-CB3825"}_rubRailNailerBoltQuantity(){return this.rubRailNailers().reduce(((e,t)=>{const r=t.materialLength().toNumeric("ft").rounded();return this.alongMainAxis(t.edge().vector())?e+this._sideEdgeNailerBoltQuantity(r):e+this._endEdgeNailerBoltQuantity(r)}),0)}_endEdgeNailerBoltQuantity(e){return e<=4?2:e<=6?3:4}_sideEdgeNailerBoltQuantity(e){return 3*Math.floor(e/10)+((e%10).rounded()>0?2:0)}_connectionBoltMaterials(){const e=this.width().toNumeric("ft").rounded();return new p(2*(e+2)*(this.steelFrames().length-1),g.hardware["F-HB515"])}_stringerBoltMaterial(){const e=Math.ceil(this.stringers().first().length().toNumeric(this.unit()).rounded()/n.unit(10,"ft").toNumeric(this.unit()));return new p(3*e*this.stringers().length,g.hardware["F-CB25225"])}_floatBoltMaterial(){return new p(this._floatBoltCount(),g.hardware["F-CB383FB"])}_floatBoltCount(){return this.floats().sum((e=>{const t=e.width(),r=e.length();return t.equals(n.unit(2,"ft"))||t.equals(n.unit(3,"ft"))&&r.equals(n.unit(3,"ft"))?4:r.equals(n.unit(4,"ft"))||r.equals(n.unit(5,"ft"))||r.equals(n.unit(6,"ft"))?6:8}))}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_steelFrames","_stringers","_rubRailNailers"]}}},73282:(e,t,r)=>{const n=r(63768),{lumber:i}=r(93613),s=r(97946),o=r(6556);e.exports=class AMSteelTrussLumberProcessor extends s{materialsToProcess(){return[i.PT2x4.identifier(),"C2x3"]}processLineItem(e){const t=Math.floor(e.quantity().toNumeric("ft").rounded()/10),r=e.quantity().toNumeric("ft").rounded()%10;return[new o(t,this._findLumberCutAlias(n.unit(10,"ft"),e.specifier())),...0!==r?[new o(r,this._findLumberCutAlias(n.unit(r,"ft"),e.specifier()))]:[]]}}},85309:(e,t,r)=>{const n=r(63768),i=r(46618),s=r(16270);e.exports=class AMSteelTrussTaperedDock extends i{static SECTION_LENGTHS_FT=[10];static displayName(){return"Tapered Steel Truss"}movableEdges(){return this.sideEdges()}slipHandleLocators(){return[]}maxLength(){return n.unit(10,"ft")}maxWidth(){return n.unit(6,"ft")}snappableSizes(e){if(this.alongMainAxis(e.vector()))return[n.unit(3,"ft"),n.unit(4,"ft"),n.unit(5,"ft"),n.unit(6,"ft")]}frameSectionClass(){return s}snapToFramesFilter(){return e=>Math.abs(e.mainAxis().dot(this.mainAxis())).isNearTo(1)}}},16270:(e,t,r)=>{const n=r(63768),{FixedEdgeLocator:i,RelativeLocator:s}=r(62048),o=r(25706),a=r(33735);e.exports=class AMSteelTrussTaperedDockSection extends a{rubRailEnabled(){return this._rubRailEnabled??!1}_defaultSteelFrames(){const e=this._deckingThickness()+this.stringerSpecifier().details().width.toNumeric(this.unit());return[new o(s.makeRelativeTo(this.locator().addZ(e),this.referencePoint()),this._frameRotation(),this.width(),this.length(),!0)]}_defaultFloats(){const e=this._deckingThickness()+this.stringerSpecifier().details().width.toNumeric(this.unit())+n.unit(12,"in").toNumeric(this.unit()),t=this.endEdges(),r=t.first().center().to(t.last().center()).addZ(e),s=n.unit(3,"ft"),o=new i(r,s.toNumeric(this.unit())/2);return[this._generateFloat(o,s)]}selfMaterialLineItems(){return[this._stringerBoltMaterial(),this._rubRailNailerBoltMaterial()].filter((e=>e))}}},9649:(e,t,r)=>{const n=r(63768),{ProportionalEdgeLocator:i,NormalToEdgeLocator:s}=r(62048),o=r(13002),a=r(18112),l=r(74231),c=r(32877);e.exports=class AMWoodDock extends a{static SECTION_LENGTHS_FT=[20,16,12];static defaultLength(){return n.unit(12,"ft")}static displayName(){return"Wood Dock"}static type(){return c.wood}gangwayLandingHeight(){return n.unit(18.5,"in")}gangwayAttachmentHeight(){return n.unit(12.5,"in")}minLength(){return n.unit(12,"ft")}lengthSnappingIncrement(){return n.unit(4,"ft")}framingInsetForEnd(e){const t=this.endEdges().first();return!e.geometry().containsPoint(t.begin())||this.isConnectedToFrameEndOn(t)?n.unit(1.5,"in"):this.otherFrameSideEdgesContainsEdge(t.xy())?n.unit(3,"in"):n.unit(0,"in")}framingInsetForBegin(e){const t=this.endEdges().last();return!e.geometry().containsPoint(t.begin())||this.isConnectedToFrameEndOn(t)?n.unit(1.5,"in"):this.otherFrameSideEdgesContainsEdge(t.xy())?n.unit(3,"in"):n.unit(0,"in")}deckingInsetForEnd(e){const t=this.endEdges().first();return!e.geometry().containsPoint(t.begin())||this.isConnectedToFrameEndOn(t)?n.unit(3/8,"in"):this.otherFrameSideEdgesContainsEdge(t.xy())?n.unit(1,"in"):n.unit(0,"in")}deckingInsetForBegin(e){const t=this.endEdges().last();return!e.geometry().containsPoint(t.begin())||this.isConnectedToFrameEndOn(t)?n.unit(3/8,"in"):this.otherFrameSideEdgesContainsEdge(t.xy())?n.unit(1,"in"):n.unit(0,"in")}resizingFinished(){super.resizingFinished(),this._removeStaleInnerCornerPipeHolds()}_removeStaleInnerCornerPipeHolds(){this.pipeHolds().slice().filter((e=>e.snapsToCorners()&&!e.isInCorner())).forEach((e=>e.delete()))}hasPipeHoldInCorner(e){return this.pipeHolds().some((t=>t.locator().xy().equals(e.xy())))}frameSectionClass(){return o}snappingEdgesFor(e){return this.alongMainAxis(e.vector())?this._sectionSnappingEdgesFor(e):[e]}snappableEdgesForFrame(e){return this._isSameDirectionAs(e)?this.endEdges():this.isPerpendicularTo(e)?this.edges():[]}snapToFramesFilter(){return e=>this.isPerpendicularTo(e)||this._isSameDirectionAs(e)}_isSameDirectionAs(e){return e.mainAxis().dot(this.mainAxis()).isNearTo(1)}cornerSnappingTolerance(e,t,r,o){const a=this.findEdgeInDirection(e.direction()),c=new s(new i(a,r?0:1),-l.gap().toNumeric(this.unit())),u=this.isNonArticulatingBracketAt(c),d=o.findEdgeInDirection(t.direction());return(o.isNonArticulatingBracketAt(d.center())||u)&&this.alongMainAxis(a.direction())?n.unit(0,"in"):super.cornerSnappingTolerance(e,t,r,o)}connectionClass(){return l}connectionZLevel(){return this.framingSections().first().zLevel()+this.deckingOption().materialSpecifier().details().width.toNumeric(this.unit())}}},65940:(e,t,r)=>{const{ProportionalEdgeLocator:n,NormalToEdgeLocator:i,$P:s}=r(62048),o=r(37528);e.exports=class AMWoodDockFramer extends o{framingEndEdges(){return this.dock().framingEndEdges()}framingSideEdges(){return this.dock().framingSideEdges()}_makeJoists(e,t,r,n){const i=n?e:e.stretchedBy(2*-this.materialWidth(this.headerSpecifier()));return super._makeJoists(i,t,r,n)}makeEndStringers(){return this.makeHeaders()}makeCrossStringers(){const e=this.headerSpecifier(),t=this.framingSideEdges(),r=this.dock().geometry().normal(),n=this.materialWidth(e),i=this.framingDescriptor().crossStringerOffset(),o=[t.first(),t.last().reversed()],[a,l]=this.offsetHelper().applyOffsetToEdges(o,i),[c,u]=this._customCrossStringerEdges(a,l)??this._defaultCrossStringerEdges(a,l);return[this._makeBoard(c,e,s(0,n/2),r),this._makeBoard(u,e,s(0,n/2),r)]}_customCrossStringerEdges(e,t){const r=this.dock().specification().crossStringerDistanceFromCenter()?.toNumeric(this.dock().unit());if(r){const n=e.center(),s=t.center();return[new i(n,0,-r).to(new i(s,0,-r)),new i(n,0,r).to(new i(s,0,r))]}}_defaultCrossStringerEdges(e,t){return[new n(e,.3).to(new n(t,.3)),new n(e,.7).to(new n(t,.7))]}boardMaterialName(){return this.dock().hasWearDeckFrame()?null:"pressure-treated"}}},13002:(e,t,r)=>{const n=r(63768),{three:i}=r(37732),{FixedEdgeLocator:s,$P:o}=r(62048),a=r(88933),l=r(65940),c=r(6556),u=r(58101),d=r(28174),h=r(49283),p=r(5345),m=r(30691),f=r(92853),g=r(47347),y=r(32877);e.exports=class AMWoodDockSection extends p{type(){return y.wood}hasWearDeckFrame(){return this.componentOf().hasWearDeckFrame()}_defaultFramingDescriptor(){return new f(this)}_defaultHeight(){return n.add(n.unit(6,"in"),this.dockFramer().joistSpecifier().details().depth)}_defaultFramer(){return new l(this)}middleJoists(){return this.joists().slice(1,-1)}joists(){return this._joists||(this._joists=this.dockFramer().makeJoists()),this._joists}endStringers(){return this._endStringers||(this._endStringers=this.dockFramer().makeEndStringers()),this._endStringers}crossStringers(){return this._crossStringers||(this._crossStringers=this.dockFramer().makeCrossStringers()),this._crossStringers}cornerBrackets(){return this._cornerBrackets||(this._cornerBrackets=this._defaultCornerBrackets(),this._cornerBrackets.forEach((e=>e.setComponentOf(this)))),this._cornerBrackets}crossStringerBrackets(){return this._crossStringerBrackets||(this._crossStringerBrackets=this._defaultCrossStringerBrackets()),this._crossStringerBrackets}endStringerBrackets(){return this._endStringerBrackets||(this._endStringerBrackets=this._defaultEndStringerBrackets()),this._endStringerBrackets}outerCornerBrackets(){return this.cornerBrackets().filter((e=>!e.innerBracket()))}innerCornerBrackets(){return this.cornerBrackets().filter((e=>e.innerBracket()))}_defaultCornerBrackets(){const e=this.endEdges(),t=this.framingEndEdges().flatMap(((t,r)=>[{locator:t.begin(),isNonArticulating:this.isNonArticulatingBracketAt(new s(e[r],1))},{locator:t.end(),isNonArticulating:this.isNonArticulatingBracketAt(new s(e[r],-1))}])),r=this._slipDockBracketLocations().flatMap((({locations:e})=>e)).filter((({locator:e,connection:t})=>this._isSlipDockLocationAtCorner(e,t)));return[...t.map((({locator:e,isNonArticulating:t})=>{const n=r.find((({locator:t})=>t.xy().equals(e.xy()))),{female:i,male:s,none:o}=a.SLIP_DOCK_BRACKET_TYPES;let l=o;return n&&(l=n.isFemale?i:s),new a(e,t,l)})),...t.map((({locator:e})=>{if(!this.componentOf().hasPipeHoldInCorner(e))return new h(e)})).filter((e=>e))]}_defaultCrossStringerBrackets(){const e=[];return this.crossStringers().forEach((t=>{const r=t.edge(),n=this.joists();n.forEach(((t,i)=>{const s=t.edge(),o=r.closestRelativePointTo(s.begin());let a=r.angle();i!==n.length-1&&(a+=Math.PI),e.push(new u(o,this._rotationFromAngle(a)))}))})),e}_defaultEndStringerBrackets(){const e=[];return this.middleJoists().map((t=>{const r=t.width().toNumeric(this.unit()),n=t.edge().addZ(-r/2).relativeTo(this.referencePoint());[n.begin(),n.end()].forEach(((t,r)=>{const s=t.subtract(n.center()).normalized(),o=this.crossAxis().negated(),a=(new i.Matrix4).makeBasis(o.toThreeJS(),s.cross(o).toThreeJS(),s.toThreeJS()),l=(new i.Quaternion).setFromRotationMatrix(a);e.push(new u(t,l,1===r))}))})),e}slipDockBrackets(){return this._slipDockBrackets||(this._slipDockBrackets=this._defaultSlipDockBrackets()),this._slipDockBrackets}_makeSingleTeeBracketHardware(e,{locator:t,isFemale:r,scale:n,connection:i}){const o=t.subtract(e.begin()).dot(e.direction()),a=new s(e,o);let l=r?"WD-TF":"WD-TM";return this.isConnectionNonArticulating(i)&&(l=`${l}D`),[new d(a,this._rotationFromAngle(e.normalAngle()),n,l),new d(a,this._rotationFromAngle(e.normalAngle()),n,"WD-B")]}_defaultSlipDockBrackets(){return this._slipDockBracketLocations().flatMap((({edge:e,locations:t})=>t.flatMap((t=>{if(!this._isSlipDockLocationAtCorner(t.locator,t.connection))return this._makeSingleTeeBracketHardware(e,t)})).filter((e=>e))))}_isSlipDockLocationAtCorner(e,t){return this.framingSideEdges().flatMap((e=>[e.begin(),e.end()])).some((r=>r.xy().equals(e.xy())&&!this.isConnectionNonArticulating(t)))}_slipDockBracketLocations(){const e=this.framingSideEdges(),t=this._overlappingFrameEdgesForEdges(e.map((e=>e.xy())));return e.map(((e,r)=>{const n=t[r];return n?{edge:e,locations:n.flatMap((({edge:e,frame:t})=>{const r=t.crossAxis().dot(e.direction()).isNearTo(1),n=this.connectionFor(e.center());return[{locator:e.begin(),isFemale:r,scale:o(1,-1,1),connection:n},{locator:e.end(),isFemale:r,scale:o(1,1,1),connection:n}]}))}:{edge:e,locations:[]}}))}singleTeeEndBrackets(){return this._singleTeeEndBrackets||(this._singleTeeEndBrackets=this._defaultSingleTeeEndBrackets()),this._singleTeeEndBrackets}_singleTeeEndBracketLocations(){const e=this.endEdges(),t=this.framingEndEdges(),r=new Map([[e.first(),t.first()],[e.last(),t.last()]]),n=this._overlappingFrameEdgesForEdges(e.map((e=>e.xy())));return e.map(((t,i)=>{let s=n[i];if(!s)return{edge:t,locations:[]};const a=e.last()===t;return s=s.filter((({edge:e})=>t.xy().containsEdge(e.xy()))),{edge:r.get(t),locations:s.flatMap((({edge:e})=>{let r,n;if(!m.pointIsAtEdgeTerminus(t.xy(),e.begin().xy())){const n=t.closestPointTo(e.begin()),i=this.connectionFor(m.overlappingEdgeSegments([e,t]).last().center());r={locator:n,isFemale:a,scale:o(1,-1,1),connection:i}}if(!m.pointIsAtEdgeTerminus(t.xy(),e.end().xy())){const r=t.closestPointTo(e.end()),i=this.connectionFor(m.overlappingEdgeSegments([e,t]).last().center());n={locator:r,isFemale:a,scale:o(1,1,1),connection:i}}return[r,n].filter((e=>e))}))}}))}_defaultSingleTeeEndBrackets(){return this._singleTeeEndBracketLocations().flatMap((({edge:e,locations:t})=>t.flatMap((t=>this._makeSingleTeeBracketHardware(e,t)))))}_rotationFromAngle(e){return(new i.Quaternion).setFromAxisAngle(new i.Vector3(0,0,1),e)}resetComponents(){super.resetComponents(),this._joists=void 0,this._endStringers=void 0,this._crossStringers=void 0,this._cornerBrackets=void 0,this._crossStringerBrackets=void 0,this._endStringerBrackets=void 0,this._slipDockBrackets=void 0,this._singleTeeEndBrackets=void 0}resetCornerBrackets(){this._cornerBrackets=void 0}resetFramingBoards(){this._joists=void 0,this._endStringers=void 0,this._crossStringers=void 0}angleChanged(e){super.angleChanged(e),this.resetComponents()}components(){return[...super.components(),...this.joists(),...this.endStringers(),...this.crossStringers(),...this.cornerBrackets(),...this.crossStringerBrackets(),...this.endStringerBrackets(),...this.slipDockBrackets(),...this.singleTeeEndBrackets()]}selfMaterialLineItems(){return[...super.selfMaterialLineItems(),this._deckScrewMaterial(),new c(this._floatFastenerCount(),g.hardware["F-LB4H"]),new c(this._slipDockBracketBoltCount(),g.hardware["F-CB53"])]}_floatFastenerCount(){return 6*this.floats().length}_deckScrewCount(){return this.deckingBoardCount()*this.joists().length*2}_slipDockBracketBoltCount(){return this.slipDockBrackets().length/2*4}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_joists","_endStringers","_crossStringers","_cornerBrackets","_crossStringerBrackets","_endStringerBrackets","_slipDockBrackets","_singleTeeEndBrackets"]}}},74698:(e,t,r)=>{const n=r(59585),i=r(32877);e.exports=class ArticulatingSteelFrameConnectionType extends n{static identifier(){return"Articulating - Hinged"}partCodeForBracketType(e,t){return t.docks().first().type()===i.steelTruss?`STF-${e}`:`WD-${e}`}}},72654:(e,t,r)=>{const n=r(39359);e.exports=class ArticulatingWoodFrameConnectionType extends n{static identifier(){return"Articulating - Hinged"}}},63431:(e,t,r)=>{const n=r(63768),i=r(59585);e.exports=class BoltedSteelFrameConnectionType extends i{static identifier(){return"Bolted"}componentsFor(e){return[]}deckingOffset(){return n.unit(0,"in")}connectionGap(){return n.unit(0,"in")}boltCount(e){return 2*(n.unit(e.sideEdges().first().length(),e.unit()).toNumeric("ft")+2)}}},90559:(e,t,r)=>{const{$P:n}=r(62048),i=r(57473),s=r(29931);e.exports=class Gangway3DModelFrameSection extends i{constructor(e,t,r,i=n(1,1,1),s=["aluminum"]){super(e,t,r,i,s)}defaultFigure(){return new s(this)}}},34909:(e,t,r)=>{const{Composite3DFigure:n}=r(37732),{CompositeFigure:i}=r(7340),{NormalToEdgeLocator:s,$P:o}=r(62048),a=r(83102),l=r(90559);e.exports=class MirroredGangway3DModelFrameSection extends a{constructor(e,t,r,n,i=o(1,1,1)){super(),this._edgeLocator=e,this._modelIdentifier=t,this._rotation=r,this._scale=i,this._width=n}edgeLocator(){return this._edgeLocator}modelIdentifier(){return this._modelIdentifier}rotation(){return this._rotation}width(){return this._width}scale(){return this._scale}components(){return this._components||(this._components=this._defaultComponents()),this._components}_defaultComponents(){const e=this.width().toNumeric(this.unit())/2,t=o(-this.scale().x(),this.scale().y(),this.scale().z());return[new l(new s(this.edgeLocator(),-e),this.modelIdentifier(),this.rotation(),this.scale()),new l(new s(this.edgeLocator(),e),this.modelIdentifier(),this.rotation(),t)]}async load(){return Promise.all(this.components().map((e=>e.load?.())))}defaultFigure(){return i.withModel(this)}threeFigure(){return n.withModel(this)}}},56493:(e,t,r)=>{const n=r(59585),i=r(32877);let s;e.exports=class NonArticulatingSteelFrameConnectionType extends n{static identifier(){return s||(s=r(38014)),s.NON_ARTICULATING_IDENTIFIER}partCodeForBracketType(e,t){return t.docks().first().type()===i.steelTruss?`STF-D${e}`:`WD-${e}D`}}},98099:(e,t,r)=>{const n=r(39359);let i;e.exports=class NonArticulatingWoodFrameConnectionType extends n{static identifier(){return i||(i=r(38014)),i.NON_ARTICULATING_IDENTIFIER}}},80716:(e,t,r)=>{const n=r(63768),{MaterialSpecifier:i}=r(93613),{$P:s}=r(62048),o=r(88646),a=r(1487),l=r(23202),c=r(30202),u=r(6556),d=r(47347);e.exports=class RubRail extends c{static STYLES={style1:"Style 1",style2:"Style 2",style8:"Style 8"};constructor(e){super(e.begin(),e.end())}materialSpecifier(){return new i("RubRail","Rub Rail",{width:n.unit(4,"in"),depth:n.unit(4,"in"),materialName:this.materialName(),fillStyle:this._canvasColor(),strokeStyle:"transparent"})}_canvasColor(){return"black-plastic"===this.materialName()?"#000000":"#ffffff"}_fastenerType(){return this.componentOf().rubRailFastenerType()}materialName(){return this.componentOf().rubRailColor()}crossSection(){return this._crossSection||(this._crossSection=this._defaultCrossSection()),this._crossSection}_defaultCrossSection(){return this.style()===this.constructor.STYLES.style8?this._defaultFlatShapeCrossSection():this._defaultPShapeCrossSection()}style(){return this.componentOf().rubRailStyle()}_defaultPShapeCrossSection(){return new o([new a(s(0,0),s(1,0)),new a(s(1,0),s(1,-.15)),new a(s(1,-.15),s(0,-.15)),new l(s(0,-.15),s(-.5,-.15),s(-1,.35),s(-1,.85)),new l(s(-1,.85),s(-1,1.2),s(-.15,1.7),s(-.15,2.3)),new a(s(-.15,2.3),s(-.15,2.6)),new a(s(-.15,2.6),s(0,2.6))])}_defaultFlatShapeCrossSection(){return new o([new a(s(0,0),s(-.27,0)),new a(s(-.27,0),s(-.27,1)),new l(s(-.27,1),s(-1.52,2),s(-1.52,2.7),s(-.27,3.9)),new a(s(-.27,3.9),s(-.27,4.7)),new a(s(-.27,4.7),s(0,4.7))])}selfMaterialLineItems(){return[new u(this._tenFootSections(),d.rubRail[this._partCode()]),new u(this._tenFootSections(),d.rubRail[this._fastenerType()])]}_partCode(){return`VRR-${this.materialName()[0].toUpperCase()}${this.style().split(" ").last().padStart(2,"0")}`}_tenFootSections(){return Math.round(this.edge().length()/n.unit(1,"ft").toNumeric(this.unit()))/10}}},24409:(e,t,r)=>{const{three:n}=r(37732),i=r(57473),s=r(18734),o=r(6556),a=r(47347);e.exports=class RubRailCorner extends i{constructor(e){super(e,"am-docks-rub-rail-corner")}materialIdentifiers(){return[this._color()]}_color(){return this.componentOf().rubRailColor()}_fastenerType(){return this.componentOf().rubRailFastenerType()}rotation(){const e=this.locator().edge().normal().theta();return(new n.Quaternion).setFromAxisAngle(new n.Vector3(0,0,1),e)}defaultFigure(){const e=new s(this);return e.properties().fillStyle=this._canvasColor(),e.properties().strokeStyle=this._canvasColor(),e}_canvasColor(){return"black-plastic"===this._color()?"#000000":"#ffffff"}selfMaterialLineItems(){return[new o(1,a.rubRail[this._partCode()]),new o(.5,a.rubRail[this._fastenerType()])]}_partCode(){return`VRR-C${this._color()[0].toUpperCase()}`}}},44518:(e,t,r)=>{const n=r(57473),i=r(18734),s=r(34249);e.exports=class SteelChannelFrame extends n{constructor(e,t,r,n){super(e,void 0,t,void 0,["steel"]),this._width=r,this._length=n}width(){return this._width}length(){return this._length}_modelIdentifier(){const e=Math.round(this.width().toNumeric("ft")),t=Math.round(this.length().toNumeric("ft"));return`${this._modelFilename()}->CHANNEL-${e}x${t}`}_modelFilename(){return"am-docks-steel-channel-frames"}partCode(){return`${Math.round(this.width().toNumeric("ft"))}${Math.round(this.length().toNumeric("ft"))}`}selfMaterialLineItems(){return[]}defaultFigure(){return new s(new i(this))}}},69009:(e,t,r)=>{const n=r(57917),i=r(59585),s=r(6556),o=r(56493),a=r(38014),l=r(47347),c=r(32877);e.exports=class SteelFrameConnection extends a{typeChoices(){return i.choices()}_defaultTypeIdentifier(){return i.defaultTypeFor(this).identifier()}generateType(){return i.typeForIdentifier(this.typeIdentifier())}selfMaterialLineItems(){return this.isConnectingDockType(c.steelChannel)&&this.typeIdentifier()===o.identifier()?[]:[new s(this.type().boltCount(this),l.hardware["F-HB515"])]}materialLineItems(){return this.isConnectingDockType(c.steelTruss)||this.typeIdentifier()===o.identifier()?super.materialLineItems():[]}defaultFigure(){return new n(this)}}},59585:(e,t,r)=>{const n=r(63768),{FixedEdgeLocator:i}=r(62048),{three:s}=r(37732),o=r(56199);let a,l,c,u;e.exports=class SteelFrameConnectionType{static ensureTypesAreLoaded(){l||(l=r(63431)),a||(a=r(74698)),c||(c=r(56493))}static choices(){return this.ensureTypesAreLoaded(),[l,a,c].map((e=>({label:e.identifier(),value:e.identifier()})))}static defaultTypeFor(e){this.ensureTypesAreLoaded();const t=e.docks().first().alongMainAxis(e.edges().first().vector()),r=e.docks().last().alongMainAxis(e.edges().last().vector());return t&&r?new l:new a}static typeForIdentifier(e){this.ensureTypesAreLoaded();return new([l,a,c].find((t=>t.identifier()===e)))}identifier(){return this.constructor.identifier()}componentsFor(e){const t=n.unit(2.5,"in").toNumeric(e.unit());return e.sideEdges().map((e=>new i(e,t).to(new i(e,-t)))).flatMap(((e,t)=>{const r=0===t?"TM":"TF";return[{location:e.begin(),partIdentifier:r},{location:e.end(),partIdentifier:r}]})).map((({location:t,partIdentifier:r})=>{const n=this.partCodeForBracketType(r,e),i=(new s.Quaternion).setFromAxisAngle(new s.Vector3(0,0,1),t.edge().angle()+Math.PI);return new o(t,i,void 0,n)}))}deckingOffset(){return n.unit(-.9375,"in")}connectionGap(){return u||(u=r(69009)),u.gap()}boltCount(e){return 16}}},25706:(e,t,r)=>{const n=r(6556),i=r(57473),s=r(18734),o=r(34249),a=r(47347);e.exports=class SteelTrussFrame extends i{constructor(e,t,r,n,i){super(e,void 0,t,void 0,["steel"]),this._width=r,this._length=n,this._tapered=i}width(){return this._width}length(){return this._length}tapered(){return this._tapered}_modelIdentifier(){return`${this._modelFilename()}->${this.partCode()}`}_modelFilename(){return this.tapered()?"am-docks-steel-truss-tapered-frames":"am-docks-steel-truss-frames"}partCode(){const e=this.tapered()?"F":"";return`STF-${Math.round(this.width().toNumeric("ft"))}${Math.round(this.length().toNumeric("ft"))}${e}T`}selfMaterialLineItems(){return[new n(1,a.steelTruss[this.partCode()])]}defaultFigure(){return new o(new s(this))}}},74231:(e,t,r)=>{const n=r(42367),i=r(39359),s=r(38014);e.exports=class WoodFrameConnection extends s{typeChoices(){return i.choices()}_defaultTypeIdentifier(){return i.defaultTypeFor(this).identifier()}generateType(){return i.typeForIdentifier(this.typeIdentifier())}_ensureCorrectGap(){}materialLineItems(){return[]}defaultFigure(){return new n(this)}}},39359:(e,t,r)=>{let n,i,s;e.exports=class WoodFrameConnectionType{static ensureTypesAreLoaded(){n||(n=r(72654)),i||(i=r(98099))}static choices(){return this.ensureTypesAreLoaded(),[n,i].map((e=>({label:e.identifier(),value:e.identifier()})))}static defaultTypeFor(e){return this.ensureTypesAreLoaded(),new n}static typeForIdentifier(e){this.ensureTypesAreLoaded();return new([n,i].find((t=>t.identifier()===e)))}identifier(){return this.constructor.identifier()}componentsFor(e){return[]}connectionGap(){return s||(s=r(74231)),s.gap()}}},32877:e=>{e.exports={steelTruss:"Steel Truss",steelChannel:"Steel Channel",wood:"Wood"}},13463:(e,t,r)=>{const n=r(63768);class FloatPlacementHelper{constructor(e,t,r=0){this._length=t,this._width=e,this._angleOffset=r}length(){return this._length}width(){return this._width}angleOffset(){return this._angleOffset}rotatedBy(e){return new this.constructor(this.width(),this.length(),e)}positionOnEnd(e){return{width:this.width(),length:this.length(),angleOffset:this.angleOffset(),positionOffset:{x:0,y:this.offsetForSectionEnd(e)},onEnd:!0}}positionOnBegin(e){return{width:this.width(),length:this.length(),angleOffset:this.angleOffset(),positionOffset:{x:0,y:-this.offsetForSectionEnd(e)},onBegin:!0}}offsetForSectionEnd(e){return e/2-(this.angleOffset().isNearTo(Math.PI_2)?this.length().toNumeric("in"):this.width().toNumeric("in"))/2}positionOnMiddle(){return{width:this.width(),length:this.length(),angleOffset:this.angleOffset(),positionOffset:{x:0,y:0}}}positionAt(e){return{width:this.width(),length:this.length(),angleOffset:this.angleOffset(),positionOffset:e}}}e.exports={float2x3:new FloatPlacementHelper(n.unit(24,"in"),n.unit(36,"in")),float3x3:new FloatPlacementHelper(n.unit(36,"in"),n.unit(36,"in")),float3x4:new FloatPlacementHelper(n.unit(36,"in"),n.unit(48,"in")),float30x48:new FloatPlacementHelper(n.unit(30,"in"),n.unit(48,"in")),float2x4:new FloatPlacementHelper(n.unit(24,"in"),n.unit(48,"in")),float3x5:new FloatPlacementHelper(n.unit(36,"in"),n.unit(60,"in")),float4x5:new FloatPlacementHelper(n.unit(48,"in"),n.unit(60,"in")),float3x6:new FloatPlacementHelper(n.unit(36,"in"),n.unit(72,"in")),float4x6:new FloatPlacementHelper(n.unit(48,"in"),n.unit(72,"in")),float3x8:new FloatPlacementHelper(n.unit(36,"in"),n.unit(96,"in")),float4x8:new FloatPlacementHelper(n.unit(48,"in"),n.unit(96,"in"))}},42433:(e,t,r)=>{const n=r(63768),{float2x3:i,float3x3:s,float3x4:o,float30x48:a,float2x4:l,float3x5:c,float4x5:u,float3x6:d,float4x6:h,float3x8:p,float4x8:m}=r(13463),f={"12x3":{endFloat:i,middleFloat:s},"16x3":{endFloat:s,middleFloat:s},"20x3":{endFloat:o.rotatedBy(Math.PI_2),middleFloat:o.rotatedBy(Math.PI_2)},"12x4":{endFloat:a,middleFloat:l},"16x4":{endFloat:o,middleFloat:o},"20x4":{endFloat:o,middleFloats:[o.positionAt({x:0,y:-30}),o.positionAt({x:0,y:30})]},"12x5":{endFloat:c,middleFloat:i.rotatedBy(Math.PI_2)},"16x5":{endFloat:u,middleFloat:i.rotatedBy(Math.PI_2)},"20x5":{endFloat:c,middleFloats:[c.positionAt({x:0,y:-30}),c.positionAt({x:0,y:30})]},"12x6":{endFloat:d,middleFloat:i.rotatedBy(Math.PI_2)},"16x6":{endFloat:h,middleFloat:l.rotatedBy(Math.PI_2)},"20x6":{endFloat:d,middleFloats:[d.positionAt({x:0,y:-30}),d.positionAt({x:0,y:30})]},"12x8":{endFloat:p,middleFloats:[l.rotatedBy(Math.PI_2).positionAt({x:-36,y:0}),l.rotatedBy(Math.PI_2).positionAt({x:36,y:0})]},"16x8":{endFloat:p,middleFloat:m},"20x8":{endFloat:m,middleFloat:m}};e.exports=(e,t,r)=>{const i=n.unit(e.split("x").first(),"ft").toNumeric(r),s=f[e];let a=s.endFloat;t.equals(n.unit(16,"in"))&&a.width().equals(n.unit(30,"in"))&&(a=o);const l=s.middleFloats??[s.middleFloat.positionOnMiddle()];return[a.positionOnBegin(i),...l,a.positionOnEnd(i)]}},47347:(e,t,r)=>{const n=r(63768),{MaterialSpecifier:i,lumber:s}=r(93613),o=r(42947),a=e=>{const t={};return e.forEach((e=>t[e.identifier()]=e)),t},l=(e,t,r,n)=>{const s=t.details().width,o=t.details().depth,a=Math.ceil(s.toNumeric("in")),l=Math.ceil(o.toNumeric("in")),c={};return r.forEach((r=>{const u=Math.round(r.toNumeric("ft")),d=`${e}-${a}${l}${u}`,h=`${a} x ${l} x ${u}'`;c[d]=new i(d,d,{width:s,depth:o,description:h,nominalLength:u,sourceSpecifier:t,pricingIdentifier:n})})),c},c=(e,t,r,n="")=>{const s=`E-${e.replace(/[^\d]/,"")}${t.replace(/[^\d]/,"")}${r}${n}`;return new i(s,s,{description:`Float ${e} x ${t} x ${r}"`})},u=[n.unit(3,"ft"),n.unit(4,"ft"),n.unit(5,"ft"),n.unit(6,"ft"),n.unit(8,"ft")],d=[n.unit(12,"ft"),n.unit(16,"ft"),n.unit(20,"ft")],h=[n.unit(10,"ft")],p=new i("C54x6","Composite 5/4 x 6",{width:n.unit(1,"in"),depth:n.unit(5.5,"in")}),m=new i("C2x8","Composite 2 x 8",{width:n.unit(1.5,"in"),depth:n.unit(7.5,"in")}),f=new i("C2x3","Composite 2 x 3",{width:n.unit(1.5,"in"),depth:n.unit(2.75,"in")}),g=new i("Factory_Assembly","Factory Assembly"),y=e=>[c("2'","3'",e),c("2'","4'",e),c('30"','48"',e,"T"),c("3'","3'",e),c("3'","4'",e,"T"),c("3'","5'",e,"T"),c("3'","6'",e,"T"),c("3'","8'",e,"T"),c("4'","4'",e,"T"),c("4'","5'",e,"T"),c("4'","6'",e,"T"),c("4'","8'",e,"T")],b={lumber:{...l("L",s.PT2x6,u,"L-26"),...l("L",s.PT2x6,h,"L-26"),...l("L",s.PT2x8,u,"L-28"),...l("L",s.PT2x8,d,"L-28"),...l("L",s.PT2x8,h,"L-28"),...l("LC",p,u,"LC-546"),...l("LC",p,h,"LC-546"),...l("LC",m,u,"LC-28"),...l("LC",m,d,"LC-28"),...l("LC",m,h,"LC-28"),...l("LC",f,[n.unit(10,"ft"),n.unit(5,"ft")]),...l("L",s.PT2x4,[n.unit(10,"ft"),n.unit(5,"ft")])},c54x6:p,c2x8:m,c2x3:f,floats:a([...y("12"),...y("16")]),hardware:a([new i("WD-A","WD-A",{description:"Angle"}),new i("WD-E","WD-E",{description:"Outside Corner End"}),new i("WD-F","WD-F",{description:"Outside Corner Female"}),new i("WD-NAFD","WD-NAFD",{description:"Double Outside Corner Female"}),new i("WD-SF","WD-SF",{description:"Outside Corner Female - Special"}),new i("WD-SM","WD-SM",{description:"Outside Corner Male - Special"}),new i("WD-SMF","WD-SMF",{description:"Outside Corner Male/Female - Special"}),new i("WD-IN","WD-IN",{description:"Inside Corner"}),new i("WD-M","WD-M",{description:"Outside Corner Male"}),new i("WD-NAMD","WD-NAMD",{description:"Double Outside Corner Male"}),new i("WD-W","WD-W",{description:"Washer Plate"}),new i("WD-B","WD-B",{description:"Backup Plate"}),new i("WD-TM","WD-TM",{description:"Single T Male"}),new i("WD-TF","WD-TF",{description:"Single T Female"}),new i("WD-TMD","WD-TMD",{description:"Double T Male"}),new i("WD-TFD","WD-TFD",{description:"Double T Female"}),new i("F-DSWW","F-DSWW",{description:"Wood Deck Screw"}),new i("F-DSCW","F-DSCW",{description:"Composite Deck Screw"}),new i("F-LB4H","F-LB4H",{description:'HDG Lag Bolt & Flat Washer, 3/8" x 4"'}),new i("F-CB53","F-CB53",{description:'HDG Carriage Bolt Set, 1/2" x 3"'}),new i("F-CB545","F-CB545",{description:'HDG Carriage Bolt Set, 1/2" x 4.5"'}),new i("F-CB383","F-CB383",{description:'HDG Carriage Bolt Set, 3/8" x 3"'}),new i("F-CB3825","F-CB3825",{description:'HDG Carriage Bolt Set, 3/8" x 2.5"'}),new i("F-CB383FB","F-CB383FB",{description:'HDG Carriage Bolt Set, 3/8" x 3"'}),new i("F-CB515","F-CB515",{description:'HDG Carriage Bolt Set, 1/2" x 1.5"'}),new i("F-CB25225","F-CB25225",{description:'HDG Carriage Bolt Set, 1/4" x 2.5"'}),new i("F-HB3845","F-HB3845",{description:'HDG Hex Head Bolt Set, 3/8" x 4.5"'}),new i("F-HB386","F-HB386",{description:'HDG Hex Head Bolt Set, 3/8" x 6"'}),new i("F-HB515","F-HB515",{description:'HDG Hex Head Bolt Set, 1/2" x 1.5"'}),new i("F-PIN34","F-PIN34",{description:"HDG Connector Pin & Hitch Clip"}),new i("STF-TM","STF-TM",{description:"Truss Hinge Male Connector Plate"}),new i("STF-TF","STF-TF",{description:"Truss Hinge Female Connector Plates"}),new i("STF-DTM","STF-DTM",{description:"Hinge Male Connector Plate - Double"}),new i("STF-DTF","STF-DTF",{description:"Hinge Female Connector Plate - Double"})]),rubRail:a([new i("VRR-CB","VRR-CB",{description:'10" x 10" Corner bumper black'}),new i("VRR-CW","VRR-CW",{description:'10" x 10" Corner bumper white'}),new i("VRR-W01","VRR-W01",{description:"10' long rubrail in Style 01 white"}),new i("VRR-B01","VRR-B01",{description:"10' long rubrail in Style 01 black"}),new i("VRR-W02","VRR-W02",{description:"10' long rubrail in Style 02 white"}),new i("VRR-B02","VRR-B02",{description:"10' long rubrail in Style 02 black"}),new i("VRR-W08","VRR-W08",{description:"10' long rubrail in Style 08 white"}),new i("VRR-B08","VRR-B08",{description:"10' long rubrail in Style 08 black"}),new i("F-RNB","F-RNB",{description:'1.5" Ring Nail / Bag - 0.25 LBS each'}),new i("F-SSB","F-SSB",{description:'1" Screw / Bag - 0.21 LBS each'})]),cleat:a([new i("C-10-M","C-10-M",{description:'10" Steel Cleat - 2.25 LBS'}),new i("C-12-M","C-12-M",{description:'12" Steel Cleat - 3.50 LBS'}),new i("WD-CA","WD-CA",{description:"Cleat Angle"})]),pipeHold:a([new i("WD-INPH3","WD-INPH3",{description:"Wood Frame Inside Corner Pipe Holder"}),new i("WD-PH3S","WD-PH3S",{description:'Wood Frame 3" Pipe Holder - Split'}),new i("WD-PH3SB","WD-PH3SB",{description:"Wood Frame Backup Plate"}),new i("WD-HOPH3","WD-HOPH3",{description:'Wood Frame 3" Pipe Holder - Home Owners'}),new i("WD-HOPH3B","WD-HOPH3B",{description:"Wood Frame Backup Plate"}),new i("WD-PHE3E","WD-PHE3E",{description:'Wood Frame 3" Elongated Pipe Holder End'}),new i("WD-PHE3EB","WD-PHE3EB",{description:"Wood Frame Backup Plate"}),new i("WD-PHE3S","WD-PHE3S",{description:'Wood Frame 3" Elongated Pipe Holder Side'}),new i("WD-PHE3SB","WD-PHE3SB",{description:"Wood Frame Backup Plate"}),new i("WD-PH5","WD-PH5",{description:'Wood Frame 5" Pipe Holder'}),new i("WD-PH5B","WD-PH5B",{description:"Wood Frame Backup Plate"}),new i("WD-PH5S","WD-PH5S",{description:'Wood Frame 5" Pipe Holder - Split'}),new i("WD-PH27","WD-PH27",{description:'Wood Frame 2" Pipe Holder - Short'}),new i("WD-44B","WD-44B",{description:'Wood Frame 4" x 4" Bracket'}),new i("STF-PH3S","STF-PH3S",{description:'Steel Truss 3" Pipe Holder - Split'}),new i("STF-PH5S","STF-PH5S",{description:'Steel Truss 5" Pipe Holder - Split'}),new i("STF-PH31","STF-PH31",{description:'Steel Truss 3" Pipe Holder - Solid'}),new i("STF-PH29","STF-PH29",{description:'Steel Truss 2" Pipe Holder - Set Screws'})]),pileGuide:a([new i("PH-L6","PH-L6",{description:'6" Light Duty Hoop'}),new i("PH-L8","PH-L8",{description:'8" Light Duty Hoop'}),new i("PH-L10","PH-L10",{description:'10" Light Duty Hoop'}),new i("PH-L12","PH-L12",{description:'12" Light Duty Hoop'}),new i("PH-L14","PH-L14",{description:'14" Light Duty Hoop'}),new i("PH-L16","PH-L16",{description:'16" Light Duty Hoop'}),new i("PH-L18","PH-L18",{description:'18" Light Duty Hoop'}),new i("PH-H10","PH-H10",{description:'10" Hoop Pile Guide - No Roller'}),new i("PH-H12","PH-H12",{description:'12" Hoop Pile Guide - No Roller'}),new i("PH-H14","PH-H14",{description:'14" Hoop Pile Guide - No Roller'}),new i("PH-H16","PH-H16",{description:'16" Hoop Pile Guide - No Roller'}),new i("PH-H18","PH-H18",{description:'18" Hoop Pile Guide - No Roller'}),new i("PH-H10R","PH-H10R",{description:'10" Hoop Pile Guide - Rubber Roller'}),new i("PH-H12R","PH-H12R",{description:'12" Hoop Pile Guide - Rubber Roller'}),new i("PH-H14R","PH-H14R",{description:'14" Hoop Pile Guide - Rubber Roller'}),new i("PH-H16R","PH-H16R",{description:'16" Hoop Pile Guide - Rubber Roller'}),new i("PH-H18R","PH-H18R",{description:'18" Hoop Pile Guide - Rubber Roller'}),new i("PH-H10RP","PH-H10RP",{description:'10" Hoop Pile Guide - Poly Roller'}),new i("PH-H12RP","PH-H12RP",{description:'12" Hoop Pile Guide - Poly Roller'}),new i("PH-H14RP","PH-H14RP",{description:'14" Hoop Pile Guide - Poly Roller'}),new i("PH-H16RP","PH-H16RP",{description:'16" Hoop Pile Guide - Poly Roller'}),new i("PH-H18RP","PH-H18RP",{description:'18" Hoop Pile Guide - Poly Roller'}),new i("PH-HSR14","PH-HSR14",{description:'14" Square Hoop Pile Guide - Rubber'}),new i("PH-HSR16","PH-HSR16",{description:'16" Square Hoop Pile Guide - Rubber'}),new i("PH-HSRP14","PH-HSRP14",{description:'14" Square Hoop Pile Guide - Poly'}),new i("PH-HSRP16","PH-HSRP16",{description:'16" Square Hoop Pile Guide - Poly'}),new i("PH-C","PH-C",{description:"Chain Pile Holder"})]),gangways:a([new i("AMD-AR310T","AMD-AR310T",{description:"Aluminum Gangway - 3'W x 10'L"}),new i("AMD-AR315T","AMD-AR315T",{description:"Aluminum Gangway - 3'W x 15'L"}),new i("AMD-AR320T","AMD-AR320T",{description:"Aluminum Gangway - 3'W x 20'L"}),new i("AMD-AR325T","AMD-AR325T",{description:"Aluminum Gangway - 3'W x 25'L"}),new i("AMD-AR330T","AMD-AR330T",{description:"Aluminum Gangway - 3'W x 30'L"}),new i("AMD-AR335T","AMD-AR335T",{description:"Aluminum Gangway - 3'W x 35'L"}),new i("AMD-AR340T","AMD-AR340T",{description:"Aluminum Gangway - 3'W x 40'L"}),new i("AMD-ARTP3","AMD-ARTP3",{description:'Transition Plate - 3\' x 38" x 1/4"'}),new i("AMD-ARDP3","AMD-ARDP3",{description:'Roller Deck Plate - 4\'W x 24"L 1/4"'}),new i("AMD-AR410T","AMD-AR410T",{description:"Aluminum Gangway - 4'W x 10'L"}),new i("AMD-AR415T","AMD-AR415T",{description:"Aluminum Gangway - 4'W x 15'L"}),new i("AMD-AR420T","AMD-AR420T",{description:"Aluminum Gangway - 4'W x 20'L"}),new i("AMD-AR425T","AMD-AR425T",{description:"Aluminum Gangway - 4'W x 25'L"}),new i("AMD-AR430T","AMD-AR430T",{description:"Aluminum Gangway - 4'W x 30'L"}),new i("AMD-AR435T","AMD-AR435T",{description:"Aluminum Gangway - 4'W x 35'L"}),new i("AMD-AR440T","AMD-AR440T",{description:"Aluminum Gangway - 4'W x 40'L"}),new i("AMD-ARTP4","AMD-ARTP4",{description:'Transition Plate - 4\' x 38" x 1/4"'}),new i("AMD-ARDP4","AMD-ARDP4",{description:'Roller Deck Plate - 5\'W x 24"L 1/4"'}),new i("AMD-AR410ADA","AMD-AR410T",{description:"Aluminum Gangway (ADA) - 4'W x 10'L"}),new i("AMD-AR415ADA","AMD-AR415T",{description:"Aluminum Gangway (ADA) - 4'W x 15'L"}),new i("AMD-AR420ADA","AMD-AR420T",{description:"Aluminum Gangway (ADA) - 4'W x 20'L"}),new i("AMD-AR425ADA","AMD-AR425T",{description:"Aluminum Gangway (ADA) - 4'W x 25'L"}),new i("AMD-AR430ADA","AMD-AR430T",{description:"Aluminum Gangway (ADA) - 4'W x 30'L"}),new i("AMD-AR435ADA","AMD-AR435T",{description:"Aluminum Gangway (ADA) - 4'W x 35'L"}),new i("AMD-AR440ADA","AMD-AR440T",{description:"Aluminum Gangway (ADA) - 4'W x 40'L"})]),steelTruss:a([new i("STF-35T","STF-35T",{description:"Truss Frame - 3'W x 5'L x 12\"H"}),new i("STF-45T","STF-45T",{description:"Truss Frame - 4'W x 5'L x 12\"H"}),new i("STF-55T","STF-55T",{description:"Truss Frame - 5'W x 5'L x 12\"H"}),new i("STF-65T","STF-65T",{description:"Truss Frame - 6'W x 5'L x 12\"H"}),new i("STF-85T","STF-85T",{description:"Truss Frame - 8'W x 5'L x 12\"H"}),new i("STF-310T","STF-310T",{description:"Truss Frame - 3'W x 10'L x 12\"H"}),new i("STF-410T","STF-410T",{description:"Truss Frame - 4'W x 10'L x 12\"H"}),new i("STF-510T","STF-510T",{description:"Truss Frame - 5'W x 10'L x 12\"H"}),new i("STF-610T","STF-610T",{description:"Truss Frame - 6'W x 10'L x 12\"H"}),new i("STF-810T","STF-810T",{description:"Truss Frame - 8'W x 10'L x 12\"H"}),new i("STF-310FT","STF-310FT",{description:"Truss Frame - 3'W x 10'L x 12\"H Full Taper"}),new i("STF-410FT","STF-410FT",{description:"Truss Frame - 4'W x 10'L x 12\"H Full Taper"}),new i("STF-510FT","STF-510FT",{description:"Truss Frame - 5'W x 10'L x 12\"H Full Taper"}),new i("STF-610FT","STF-610FT",{description:"Truss Frame - 6'W x 10'L x 12\"H Full Taper"})]),steelChannel:a([new i("S3-F3C","S3-F3C",{description:"Simple Dock - 3' x 10' Floating Kit - No Composite"}),new i("S3-F3CK","S3-F3CK",{description:"Simple Dock - 3' x 10' Floating Kit - With Composite"}),new i("S3-F3W","S3-F3W",{description:"Simple Dock - 3' x 10' Floating Kit - No Lumber"}),new i("S3-F3WK","S3-F3WK",{description:"Simple Dock - 3' x 10' Floating Kit - With Lumber"}),new i("S3-F4","S3-F4",{description:"Simple Dock - 4' x 10' Floating Kit - No Decking"}),new i("S3-F4CK","S3-F4CK",{description:"Simple Dock - 4' x 10' Floating Kit - With Composite"}),new i("S3-F4WK","S3-F4WK",{description:"Simple Dock - 4' x 10' Floating Kit - With Lumber"}),new i("S3-F6","S3-F6",{description:"Simple Dock - 6' x 10' Floating Kit - No Decking"}),new i("S3-F6CK","S3-F6CK",{description:"Simple Dock - 6' x 10' Floating Kit - With Composite"}),new i("S3-F6WK","S3-F6WK",{description:"Simple Dock - 6' x 10' Floating Kit - With Lumber"}),new i("S3-F8","S3-F8",{description:"Simple Dock - 3' x 10' Floating Kit - No Decking"}),new i("S3-F8CK","S3-F8CK",{description:"Simple Dock - 3' x 10' Floating Kit - With Composite"}),new i("S3-F8WK","S3-F8WK",{description:"Simple Dock - 3' x 10' Floating Kit - With Lumber"}),new i("S3-F35C","S3-F35C",{description:"Simple Dock - 3' x 5' Floating Kit - No Composite"}),new i("S3-F35CK","S3-F35CK",{description:"Simple Dock - 3' x 5' Floating Kit - With Composite"}),new i("S3-F35W","S3-F35W",{description:"Simple Dock - 3' x 5' Floating Kit - No Lumber"}),new i("S3-F35WK","S3-F35WK",{description:"Simple Dock - 3' x 5' Floating Kit - With Lumber"}),new i("S3-F45","S3-F45",{description:"Simple Dock - 4' x 5' Floating Kit - No Decking"}),new i("S3-F45CK","S3-F45CK",{description:"Simple Dock - 4' x 5' Floating Kit - With Composite"}),new i("S3-F45WK","S3-F45WK",{description:"Simple Dock - 4' x 5' Floating Kit - With Lumber"}),new i("S3-F65","S3-F65",{description:"Simple Dock - 6' x 5' Floating Kit - No Decking"}),new i("S3-F65CK","S3-F65CK",{description:"Simple Dock - 6' x 5' Floating Kit - With Composite"}),new i("S3-F65WK","S3-F65WK",{description:"Simple Dock - 6' x 5' Floating Kit - With Lumber"}),new i("S3-F85","S3-F85",{description:"Simple Dock - 8' x 5' Floating Kit - No Decking"}),new i("S3-F85CK","S3-F85CK",{description:"Simple Dock - 8' x 5' Floating Kit - With Composite"}),new i("S3-F85WK","S3-F85WK",{description:"Simple Dock - 8' x 5' Floating Kit - With Lumber"})]),factoryAssembly:g},v=Object.keys(b);b.lookupName=(e,t)=>{const r=v.find((t=>b[t][e]));if(!r)return e;const n=b[r][e];return`${t?.[e]?.[o.item]??n.name()} (${t?.[e]?.[o.description]??n.description()})`};b.defaultMaterialDefinitions=()=>Object.values(b).flatMap((e=>"function"==typeof e.name?[]:Object.values(e).map((e=>(e=>({identifier:e.identifier(),displayValue:`${e.name()} (${e.description()})`,[o.item]:e.name(),[o.description]:e.description()}))(e))))),e.exports=b},82168:(e,t,r)=>{const n=r(39792),i=r(54978);e.exports=class AMDockFigure extends n{_drawFigures(e,t){this.figures().forEach((r=>r.draw(e,t)))}annotationHandles(){const e=[],t=this.figures();for(let r=0;r<t.length;r++)e.fastMerge(t[r].annotationHandles());return e.fastMerge(this.selfAnnotationHandles()),e}annotationHandlesAt(e,t,r={}){const{scale:n,layerManager:i}=r;let s=[];return this.annotationsVisible(i)&&(s=this.selfAnnotationHandles().fastFilter((r=>r.contains(e,t,n)))),[...this.figures().flatMap((n=>n.annotationHandlesAt(e,t,r))),...s]}_drawAnnotations(e,t){t.shapeOnly||this.figures().forEach((r=>r.drawAnnotations(e,t))),this.annotationFigures().forEach((r=>r.draw(e,t)))}handlesAt(e,t,r={}){const{scale:n,layerManager:i,validWhen:s}=r,o=this.layerVisible(i),a=[],l=this.figures();for(let n=l.length-1;n>=0;n--)a.fastMerge(l[n].handlesAt(e,t,r));return o&&a.push(...this.handles().fastFilter((r=>s.includes(r.validWhen())&&r.contains(e,t,n)))),a}selfHandle(){return new i(this)}}},35613:(e,t,r)=>{const n=r(39792),i=r(95067);e.exports=class AMDockSectionFigure extends n{defaultHandles(){return[this.selfHandle()]}selfHandle(){return new i(this.model())}_drawFigures(e,t){const r=this.figures();for(let n=0;n<r.length;n++)r[n].draw(e,t)}}},29005:(e,t,r)=>{const{Polygon:n}=r(62048),i=r(84757);e.exports=class AMGangwayFigure extends i{_draw(e,t){super._draw(e,t),this._showAlert()&&this._drawAlert(e)}_showAlert(){return this.model().isADA()&&this.model().slopeAngle()>Math.atan(1/12)}_drawAlert(e){e.fillStyle="rgba(247, 64, 0, 30%)",e.strokeStyle="transparent",e._drawPolygon(this.model().geometry());const t=this.model().upperEdge().center(),r=n.regularTriangle(t,10);e.fillStyle="rgba(247, 64, 0, 70%)",e.strokeStyle="black",e._drawPolygon(r),e.fillStyle="black",e.lineWidth=2,e._drawLine(t.add(0,-6),t.add(0,0)),e.strokeStyle="transparent",e._drawCircle(t.add(0,2.5).expandedByRadius(1.3));const i=t.add(0,10);e.textAlign="center",e.textBaseline="top",e.font="6px helvetica",e.fillText("Not ADA Grade",i.x(),i.y())}}},77682:(e,t,r)=>{const{Polygon:n,Rectangle:i}=r(62048),s=r(74804),o=r(24448);e.exports=class AMPipeHoldFigure extends o{selfHandle(){return new s(this)}_draw(e,t){super._draw(e,t),this._showAlert()&&this._drawAlert(e)}_showAlert(){return this.model().snapsToCorners()&&!this.model().isInCorner()}_drawAlert(e){this._drawWarningColor(e);const t=this.model().boundingBox().bottomCenter();this._drawWarningTriangle(e,t),this._drawWarningText(t,e)}_drawWarningText(e,t){const r=e.add(0,3),n="Move to a corner";t.textAlign="center",t.textBaseline="top",t.font="2px helvetica";const s=t.measureText(n),o=new i(-s.width/2,s.actualBoundingBoxAscent,s.width,s.actualBoundingBoxDescent-s.actualBoundingBoxAscent).insettedBy(-.5).movedBy(r.x(),r.y());t.fillStyle="rgba(247, 64, 0)",t._drawRectangle(o),t.fillStyle="black",t.fillText(n,r.x(),r.y())}_drawWarningTriangle(e,t){const r=n.regularTriangle(t,3);return e.fillStyle="rgba(247, 64, 0, 70%)",e.strokeStyle="black",e._drawPolygon(r),e.fillStyle="black",e.lineWidth=.5,e._drawLine(t.add(0,-2),t.add(0,0)),e.strokeStyle="transparent",e._drawCircle(t.add(0,.8).expandedByRadius(.4)),t}_drawWarningColor(e){e.fillStyle="rgba(247, 64, 0, 30%)",e.strokeStyle="transparent",e._drawPolygon(this.model().geometry())}}},29931:(e,t,r)=>{const n=r(18734);e.exports=class GangwayFrameSectionFigure extends n{defaultProperties(){return{strokeStyle:"#5c5c5c",fillStyle:"#aaaaaa",lineWidth:.3}}}},34249:(e,t,r)=>{const{Drawable:n}=r(7340);e.exports=class HiddenByDeckingFigure extends n{constructor(e){super(),this._wrappedFigure=e}wrappedFigure(){return this._wrappedFigure}model(){return this.wrappedFigure().model()}zLevel(){return this.wrappedFigure().zLevel()}_skipDrawing(e,t){const{layerManager:r}=t;return r?.isVisible("Decking")||super._skipDrawing()}draw(e,t){this._skipDrawing(e,t)||this.wrappedFigure().draw(e,t)}}},57917:(e,t,r)=>{const n=r(48909),i=r(47910),s=r(63431),o=r(32877);e.exports=class SteelFrameConnectionFigure extends n{constructor(e){super(),this.setModel(e)}_draw(e,t){t.shapeOnly||super._draw(e,t)}zLevel(){return this.model().typeIdentifier()===s.identifier()?-3e3:super.zLevel()}handles(){return this.model().isConnectingDockType(o.steelChannel)&&this.model().isConnectionSideToSide()?[]:[this.selfHandle()]}moveBy(e,t){return!1}selfHandle(){return new i(this)}boundingBox(){return this.model().boundingBox()}}},42367:(e,t,r)=>{const n=r(48909),i=r(47910);e.exports=class WoodFrameConnectionFigure extends n{constructor(e){super(),this.setModel(e)}_draw(e,t){t.shapeOnly||super._draw(e,t)}handles(){return[this.selfHandle()]}zLevel(){return-3e3}moveBy(e,t){return!1}selfHandle(){return new i(this)}boundingBox(){return this.model().boundingBox()}}},54978:(e,t,r)=>{const n=r(72029);e.exports=class AMDockHandle extends n{activate(){this._didMove=void 0}deactivate(){super.deactivate(),this._didMove&&(this.selectableComponent().updateConnections?.(),this.selectableComponent().project().notifyDockMoved())}moveFromTo(e,t,r,n){const i=super.moveFromTo(e,t,r,n);return this._didMove=this._didMove||i,i}}},95067:(e,t,r)=>{const{ConstructionComponentHandle:n}=r(93613);e.exports=class AMDockSectionHandle extends n{selectableComponent(){return this.object()}drawSelected(e,t){this._drawHandle(e,this._selectedProperties(),t)}_drawHandle(e,t,r){e._alterAndRestoreAfter((()=>{e.updateProperties(t),e._drawPolygon(this.object().geometry())}))}moveFromTo(e,t,r,n){}validWhen(){return this.constructor.VALID_FOR_SELECTED}_selectedProperties(){return{fillStyle:"rgba(31, 160, 246, 0.3)",strokeStyle:"#1FA0F6",_pixelLineWidth:3}}}},74804:(e,t,r)=>{const n=r(14558);e.exports=class AMPipeHoldHandle extends n{_findSnappingLocation(e){return this.model().snapsToCorners()?this._snapToCorners(e):this._snapAroundConnectionBrackets(e)}_snapToCorners(e){e=e.add(this._offset);let t=this._snappableFrames().filter((t=>t.geometry().containsPoint(e)));0===t.length&&(t=this._snappableFrames());const r=t.flatMap((t=>{let r=t.framingSections().filter((t=>t.geometry().containsPoint(e)));return 0===r.length&&(r=t.framingSections()),r.flatMap((e=>e.framingEdges().map((e=>this._frameRelativeLocatorFor(e.begin(),e,t)))))}));return this._closestPoint(r,e)}}},37751:(e,t,r)=>{const{DisplayProperties:n,EditableProperty:i}=r(7340),{extend:s}=r(50988),o=r(86402);class PileGuideTool extends o{static toolPanelClassName(){return"ToolPropertyPanel"}addToProject(){return!0}hideToolPanelDivider(){return!1}defaultDisplayProperties(){return[new i(this,"Pile Guide Type",{type:"select",choices:this.componentClass().typeChoices(),label:"Type"})]}_createComponent(){const e=super._createComponent();return e.setType(this.pileGuideType()),e}pileGuideType(){return this._pileGuideType||(this._pileGuideType=this._defaultPileGuideType()),this._pileGuideType}_defaultPileGuideType(){return this.componentClass().defaultType()}setPileGuideType(e){this._pileGuideType=e,this.unplacedComponent().setType(e),this.updateAllowedToPlace()}}s(PileGuideTool,n),e.exports=PileGuideTool},38670:(e,t,r)=>{const{DisplayProperties:n,EditableProperty:i}=r(7340),{extend:s}=r(50988),o=r(86402);class PipeHoldTool extends o{static toolPanelClassName(){return"ToolPropertyPanel"}addToProject(){return!0}hideToolPanelDivider(){return!1}defaultDisplayProperties(){return[new i(this,"Pipe Hold Type",{type:"select",choices:this.componentClass().typeChoices(),label:"Type"})]}_createComponent(){const e=super._createComponent();return e.setType(this.pipeHoldType()),e}pipeHoldType(){return this._pipeHoldType||(this._pipeHoldType=this._defaultPipeHoldType()),this._pipeHoldType}_defaultPipeHoldType(){return this.componentClass().defaultType()}setPipeHoldType(e){this._pipeHoldType=e,this.unplacedComponent().setType(e),this.updateAllowedToPlace()}}s(PipeHoldTool,n),e.exports=PipeHoldTool},56714:(e,t,r)=>{const n=r(63768),i=r(24575);e.exports=class AMDockConverter{constructor(e){this._dockClass=e}dockClass(){return this._dockClass}convert(e,t){if(this.dockClass().type()===e.type())return[e.clone()];const r=this._buildNewDocks(e,t);return this._copyAccessories(e,r),r.forEach((t=>{this._copyRubRailSettings(e,t)})),r}_buildNewDocks(e,t){const r=this.dockClass(),i=r.builder(t).build(),s=this._sectionLengths(e,i),o=s.reduce(((e,t)=>n.add(e,t)),n.unit(0,"in")),a=e.locator().subtract(e.mainAxis().multipliedBy(o.toNumeric(t.unit())/2));let l=0;return s.map((n=>{const s=n.toNumeric(t.unit()),o=a.add(e.mainAxis().multipliedBy(l+s/2)),c=this._buildNewDock(e,o,n,i,r,t);return l+=s,c}))}_sectionLengths(e,t){const r=n.multiply(n.ceil(n.divide(e.length(),t.lengthSnappingIncrement()))+1,t.lengthSnappingIncrement()),s=t.minLength(),o=t.maxLength()??r,a=t.lengthSnappingIncrement(),l=new i(s.toNumeric("in"),o.toNumeric("in"),"in",a.toNumeric("in")).toOptionList().map((e=>e.value)).slice().reverse().map((e=>Math.round(e.toNumeric("ft")))),c=Math.round(this._findNearestLengthIncrement(e,t).toNumeric("ft")),u=l.last();let d=c;return l.flatMap((e=>{let t=Math.floor(d/e);return d-=t*e,d>0&&d<u&&(d+=e,t-=1),Array(t).fill(e)})).reverse().map((e=>n.unit(e,"ft")))}_buildNewDock(e,t,r,n,i,s){const o=this._findNearestValidWidth(e,n),a=i.builder(s).width(o).length(r).angle(e.angle()).referencePoint(t.snapshot()).build();return a.setComponentOf(e.componentOf()),a}_copyAccessories(e,t){e.accessories().forEach((e=>{const r=this._findClosestDockTo(e,t);e.cloneToDock(r)}))}_findClosestDockTo(e,t){return t.reduce(((t,r)=>this._shortestDistanceBetween(r,e)<this._shortestDistanceBetween(t,e)?r:t))}_shortestDistanceBetween(e,t){return Math.min(...e.edges().map((e=>e.shortestLineFrom(t.locator()).length())))}_copyRubRailSettings(e,t){t.edges().forEach(((r,n)=>{t.rubRailEdgeMap().set(r,e.rubRailEdgeMap().get(e.edges()[n]))})),t.vertices().forEach(((r,n)=>{t.rubRailCornerMap().set(r,e.rubRailCornerMap().get(e.vertices()[n]))})),this._copyRubRailNailerSettings(t,e);const r=e.framingSections().every((e=>e.rubRailEnabled()));t.framingSections().forEach((e=>e.setRubRailEnabled(r)))}_copyRubRailNailerSettings(e,t){e.rubRailNailerEdgeMap&&t.rubRailNailerEdgeMap&&e.edges().forEach(((r,n)=>{e.rubRailNailerEdgeMap().set(r,t.rubRailNailerEdgeMap().get(t.edges()[n]))}))}_findNearestValidWidth(e,t){const r=e.width(),n=t.snappableSizes(t.sideEdges().first());return this._findNearestUnit(r,n)}_findNearestLengthIncrement(e,t){const r=n.multiply(n.ceil(n.divide(e.length(),t.lengthSnappingIncrement())),t.lengthSnappingIncrement()),s=t.minLength(),o=r,a=t.lengthSnappingIncrement();return new i(s.toNumeric("in"),o.toNumeric("in"),"in",a.toNumeric("in")).getNearest(e.length())}_findNearestUnit(e,t){const r=t.map((e=>e.toNumeric("in"))),i=e.toNumeric("in"),s=r.reduce(((e,t)=>Math.abs(t-i)<Math.abs(e-i)?t:e));return n.unit(s,"in")}}},33577:e=>{e.exports=class Analytics{constructor(e=[]){this._strategies=e}strategies(){return this._strategies}postEvent(e){this.strategies().forEach((t=>t.postEvent(e)))}}},16961:e=>{e.exports=Object.freeze({login:"login",signUp:"sign_up",shareLinkVisited:"share_link_visited",quoteSubmitted:"quote_submitted"})},37662:(e,t,r)=>{const{MissingOverride:n}=r(50988),i=r(91262);e.exports=class AnalyticsStrategy{constructor(e={}){this._eventMap=e}get eventMap(){return this._eventMap}eventKeys(){return Object.keys(this.eventMap)}_supportsEvent(e){return this.eventKeys().includes(e)}_eventName(e){return this.eventMap[e]}_postEvent(e){throw new n(this,"postEvent")}postEvent(e){if(!this._supportsEvent(e))return;const t=this._eventName(e);t&&(i.devLog(`${this.constructor.name}: Posting analytics event "${t}"`),this._postEvent(t))}}},27678:(e,t,r)=>{const n=r(37662),i=r(91262);e.exports=class GA4AnalyticsStrategy extends n{_gtagIsUndefined(){return"undefined"==typeof gtag}_postEvent(e){this._gtagIsUndefined()?i.devLog("gtag is not defined. Doing nothing."):gtag("event",e)}}},57026:(e,t,r)=>{const n=r(63768),i=r(86109),s=r(36941),o=r(75462),a=r(72562);e.exports=class BearRidgeFramedGlassRailingStyle extends s{sectionClass(){return i}glassPanelClass(){return o}_defaultSupportedGateTypes(){return[a.DEFAULT,a.PICKET,a.PICKET_30_INCH,a.GLASS,a.GLASS_30_INCH,a.FRAMED,a.FRAMED_30_INCH]}defaultSupportedRailingHeights(){return[n.unit(36,"in"),n.unit(42,"in"),n.unit(48,"in")]}defaultSupportedPostWidths(){return[n.unit(1.75,"in")]}defaultSupportedGlassThicknesses(){return["1_4","3_16"]}}},72562:(e,t,r)=>{const{GateType:n}=r(8423),i=r(87648),s=r(64108),o=r(99290),a=r(18610),l=r(10079),c=r(79083);e.exports={DEFAULT:new n("None",void 0),GLASS:new n('Glass 36"',s),GLASS_30_INCH:new n('Glass 30"',l),PICKET:new n('Picket 36"',i),PICKET_30_INCH:new n('Picket 30"',c),FRAMED:new n('Framed Glass 36"',o),FRAMED_30_INCH:new n('Framed Glass 30"',a)}},75462:(e,t,r)=>{const n=r(68773),i=[{label:"5 mm",value:"3_16"},{label:"6 mm",value:"1_4"},{label:"10 mm",value:"3_8"},{label:"12 mm",value:"1_2"}];class BearRidgeGlassPanel extends n{static GLASS_THICKNESS_OPTIONS=i;glassPanelClass(){return BearRidgeGlassPanel}}e.exports=BearRidgeGlassPanel},76247:(e,t,r)=>{const n=r(63768),{EditableProperty:i}=r(7340),s=r(75462),o=r(72562),a=r(1308),l=r(78924);e.exports=class BearRidgeGlassRailingStyle extends l{sectionClass(){return a}glassPanelClass(){return s}_defaultSupportedGateTypes(){return[o.DEFAULT,o.PICKET,o.PICKET_30_INCH,o.GLASS,o.GLASS_30_INCH,o.FRAMED,o.FRAMED_30_INCH]}_supplementalDisplayProperties(){return[new i(this,"Has Cap Rail",{type:"boolean",label:"Cap Rail"})]}canSetPostHeight(){return!1}hasCapRail(){return void 0===this._hasCapRail&&(this._hasCapRail=!0),this._hasCapRail}toggleHasCapRail(){this.setHasCapRail(!this._hasCapRail)}setHasCapRail(e){this._hasCapRail=!!e}defaultSupportedRailingHeights(){return[n.unit(36,"in"),n.unit(42,"in"),n.unit(48,"in")]}defaultSupportedGlassThicknesses(){return["3_8","1_2"]}}},79858:(e,t,r)=>{const n=r(63768),i=r(75462),s=r(9297),o=r(72562);e.exports=class BearRidgeInfinityRailingStyle extends s{glassPanelClass(){return i}_defaultSupportedGateTypes(){return[o.DEFAULT]}defaultSupportedRailingHeights(){return[n.unit(36,"in"),n.unit(42,"in"),n.unit(48,"in")]}defaultSupportedGlassThicknesses(){return["1_2"]}defaultSupportedPostHeights(){return[n.unit(24,"in")]}}},19185:(e,t,r)=>{const n=r(89600),i=r(72512),s=r(72562);e.exports=class BearRidgePicketRailingStyle extends n{sectionClass(){return i}_defaultSupportedGateTypes(){return[s.DEFAULT,s.PICKET,s.PICKET_30_INCH]}}},63283:(e,t,r)=>{const n=r(7770),i=r(88367),s=r(15327);e.exports=class BearRidgeProject extends i{get materials(){return s}logo(){return"bear-ridge-logo.png"}watermarkLogo(){return"bear-ridge-claw.png"}pdfDocumentClass(){return n}}},87166:(e,t,r)=>{const n=r(63768),{RailLengthHelper:i}=r(8423),s=r(60261),o=r(4065),a=r(20807);e.exports=class BearRidgeRailingCollection extends s{railingStyles(){return a()}railingStyleChoices(){const e=this.railingStyles();return[e.standardGlass,e.infinity,e.picket,e.framed].filter((e=>e.canApplyToRailingCollection(this)))}_defaultRailingHeight(){return n.unit(42,"in")}_defaultIndependentPostHeight(){return n.unit(30,"in")}_supplementalHandrailProperties(){return[]}railLengthMode(){return i.mode.SYMMETRIC}runClass(){return o}_postWidthProperties(){return[]}handrailColorChoices(){return this.postColorChoices()}}},92856:(e,t,r)=>{const n=r(13353),i=r(72562);e.exports=class BearRidgeRailingOpening extends n{gateTypes(){return i}}},4065:(e,t,r)=>{const n=r(28184),i=r(30691),s=r(72512);e.exports=class BearRidgeRailingRun extends n{createSection(e){let t;t=i.isLevel(e)?this.sectionClass():s;const r=new t(e,this.postProvider());return r.setComponentOf(this),r}}},22685:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),s=r(72226);class CapRail extends s{static capRailForSection(e){const t=e.glassPanels().first(),r=t?.panelThickness()??n.unit(0,"in"),i=e.postProvider().postColor();return new CapRail(e.topGlassEdge(),r,i)}constructor(e,t,r){super(e,r),this._glassThickness=t}glassThickness(){return this._glassThickness}width(){return n.unit(.9375,"in")}_height(){return n.unit(1.0625,"in")}_wallThicknessNumeric(){return n.unit(.21875,"in").toNumeric(this.unit())}crossSection(){const e=this.width().toNumeric(this.unit()),t=this._height().toNumeric(this.unit()),r=n.unit(.5,"in").toNumeric(this.unit()),s=this._wallThicknessNumeric();return i(0,(r+s)/2-s).expandedBy(e/2,t/2).toPolygon()}materialSpecifierName(){return"Cap Rail"}lineItemMaterial(){return this.materials.CapRail}}e.exports=CapRail},99290:(e,t,r)=>{const n=r(63768),{MaterialSpecifier:i}=r(93613),{RelativeLocator:s}=r(62048),o=r(87648),a=r(14294),l=r(6556),c=r(75462),u=r(98190),d=r(30202);e.exports=class BearRidgeFramedGlassGate extends o{requiredOpeningWidth(e){return n.unit(3,"ft")}_defaultRailBlock(){const e=this.blockEdge(),t=new a(e);return t.setComponentOf(this),t}glassPanelClass(){return c}glassThickness(){return this.railingStyle().glassThickness()}railingStyle(){return this.postProvider().railingStyle()}panel(){return this.railBlock().glassPanel()}panelHeight(){return n.subtract(this.postProvider().railingHeight(),this.glassPanelHeightAboveGround())}glassPanelHeightAboveGround(){return this.postProvider().glassPanelHeightAboveGround()}panelInset(){return n.unit(2,"in")}panelEdge(){const e=this.panelInset().toNumeric(this.unit()),t=this.opening().edge().stretchedBy(-2*e),r=-this.glassPanelHeightAboveGround().toNumeric(this.unit()),n=t.addZ(r),i=s.makeRelativeTo(n.begin(),this.edge().begin()),o=s.makeRelativeTo(n.end(),this.edge().end());return i.to(o)}postProvider(){return this.opening().postProvider()}postWidth(){return this.postProvider().postWidth()}materialSpecifier(){return new i("FramedGlassGate","Framed Glass Gate")}materialLineItems(){return[new l(1,this.materialSpecifier()),new l(1,this.latchMaterial())]}latchMaterial(){return this.materials[this.doorLatchType()]}hinges(){return this._hinges||(this._hinges=this.defaultHinges()),this._hinges}defaultHinges(){const e=this.flipped(),t=e?this.opening().postAfter():this.opening().postBefore(),r=this.hingeZOffset().toNumeric(this.unit()),n=t.postWidth().toNumeric(this.unit())/2,i=this.edge().direction(),o=e?i.negated():i,a=o.multipliedBy(n),l=t.surfaceLocator().add(a),c=t.topLocator().add(a),d=l.movedBy(0,0,-r),h=c.movedBy(0,0,r),p=s.makeRelativeTo(d,this.edge().end()),m=s.makeRelativeTo(h,this.edge().end()),f=new u(p,o);f.setComponentOf(this);const g=new u(m,o);return g.setComponentOf(this),[g,f]}hingeZOffset(){return n.unit(8,"in")}_defaultLatchMountPanel(){if("PinLatch"===this.doorLatchType())return;const e=this.panelHeight().toNumeric(this.unit()),t=this.latchMountPanelHeight().toNumeric(this.unit()),r=this.latchMountPanelLength().toNumeric(this.unit())/2,n=this.panelEdge(),i=(this.flipped()?n.direction():n.direction().negated()).multipliedBy(r),o=this.flipped()?n.begin():n.end(),a=o.add(i).addZ(-e),l=s.makeRelativeTo(a,o),c=l.addZ(t);return this.latchMaterial().details().materialName=this.materialName(),new d(l,c,this._latchMountPanelCrossSection(),this.latchMaterial())}components(){return[...super.components(),...this.hinges()].filter((e=>e))}resetComponents(){super.resetComponents(),this._hinges=void 0}}},18610:(e,t,r)=>{const n=r(63768),i=r(99290);e.exports=class BearRidgeFramedGlassGate30Inch extends i{requiredOpeningWidth(e){return n.unit(30,"in")}}},64108:(e,t,r)=>{const n=r(63768),{EditableProperty:i}=r(7340),{$P:s}=r(62048),{RelativeLocator:o}=r(62048),a=r(4125),l=r(6556),c=r(30202),u=r(88646),d=r(56214),h=r(18192);e.exports=class BearRidgeGlassGate extends a{displayProperties(){return[...super.displayProperties(),new i(this,"Door Latch Type",{type:"select",choices:this.doorLatchTypeChoices()})]}doorLatchTypeChoices(){return h.filter((e=>"GlassMountDoorKnob"===e.value))}doorLatchType(){return void 0===this._doorLatchType&&(this._doorLatchType=this.doorLatchTypeChoices().first().value),this._doorLatchType}setDoorLatchType(e){this._doorLatchType=e,this.resetLatchMountPanel()}materialLineItems(){return[new l(1,this.materialSpecifier()),new l(1,this.latchMaterial())]}latchMaterial(){return this.materials.GlassMountDoorKnob}latchMountPanel(){return this._latchMountPanel??=this._defaultLatchMountPanel()}_defaultLatchMountPanel(){const e=this.panelHeight().toNumeric(this.unit()),t=this.latchMountPanelHeight().toNumeric(this.unit()),r=this.latchMountPanelLength().toNumeric(this.unit())/2,n=this.panelEdge(),i=(this.flipped()?n.direction():n.direction().negated()).multipliedBy(r),s=this.flipped()?n.begin():n.end(),a=s.add(i).addZ(-e),l=o.makeRelativeTo(a,s),u=l.addZ(t);return this.latchMaterial().details().materialName=this.materialName(),new c(l,u,this._latchMountPanelCrossSection(),this.latchMaterial())}latchMountPanelLength(){return n.unit(6,"in")}latchMountPanelHeight(){return this.latchMountPanelLength()}latchMountPanelDepth(){return n.unit(1,"in")}_latchMountPanelCrossSection(){const e=this.latchMountPanelDepth().toNumeric(this.unit())/2,t=this.latchMountPanelLength().toNumeric(this.unit())/2,r=s(0,0).expandedBy(e,t);return new u([new d(r)])}components(){return[...super.components(),this.latchMountPanel()].filter((e=>e))}resetComponents(){super.resetComponents(),this.resetLatchMountPanel()}resetLatchMountPanel(){this._latchMountPanel=void 0}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_latchMountPanel"]}}},10079:(e,t,r)=>{const n=r(63768),i=r(64108);e.exports=class BearRidgeGlassGate30Inch extends i{requiredOpeningWidth(e){return n.unit(30,"in")}}},87648:(e,t,r)=>{const n=r(63768),{EditableProperty:i}=r(7340),{RelativeLocator:s}=r(62048),{$P:o}=r(62048),a=r(16819),l=r(6556),c=r(30202),u=r(88646),d=r(56214),h=r(18192);e.exports=class BearRidgePicketGate extends a{displayProperties(){return[...super.displayProperties(),new i(this,"Door Latch Type",{type:"select",choices:this.doorLatchTypeChoices()})]}doorLatchTypeChoices(){return h.filter((e=>"DoorKnob"===e.value||"PinLatch"===e.value))}doorLatchType(){return void 0===this._doorLatchType&&(this._doorLatchType=this.doorLatchTypeChoices().first().value),this._doorLatchType}setDoorLatchType(e){this._doorLatchType=e,this.resetLatchMountPanel()}latchMountPanel(){return this._latchMountPanel??=this._defaultLatchMountPanel()}_defaultLatchMountPanel(){if("PinLatch"===this.doorLatchType())return;const e=this.railingHeight().toNumeric(this.unit()),t=this.latchMountPanelHeight().toNumeric(this.unit()),r=this.latchMountPanelLength().toNumeric(this.unit())/2,n=this.blockEdge(),i=(this.flipped()?n.direction():n.direction().negated()).multipliedBy(r),o=this.flipped()?n.begin():n.end(),a=o.add(i).addZ(-e),l=s.makeRelativeTo(a,o),u=l.addZ(t);return this.latchMaterial().details().materialName=this.materialName(),new c(l,u,this._latchMountPanelCrossSection(),this.latchMaterial())}latchMountPanelLength(){return n.unit(6,"in")}latchMountPanelHeight(){return this.latchMountPanelLength()}latchMountPanelDepth(){return n.unit(1,"in")}_latchMountPanelCrossSection(){const e=this.latchMountPanelDepth().toNumeric(this.unit())/2,t=this.latchMountPanelLength().toNumeric(this.unit())/2,r=o(0,0).expandedBy(e,t);return new u([new d(r)])}components(){return[...super.components(),this.latchMountPanel()].filter((e=>e))}resetComponents(){super.resetComponents(),this.resetLatchMountPanel()}resetLatchMountPanel(){this._latchMountPanel=void 0}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_latchMountPanel"]}materialLineItems(){return[new l(1,this.materialSpecifier()),new l(1,this.latchMaterial())]}latchMaterial(){return this.materials[this.doorLatchType()]}}},79083:(e,t,r)=>{const n=r(63768),i=r(87648);e.exports=class BearRidgePicketGate30Inch extends i{requiredOpeningWidth(e){return n.unit(30,"in")}}},18192:e=>{e.exports=[{label:"Door Knob",value:"DoorKnob"},{label:"Glass Mount Door Knob",value:"GlassMountDoorKnob"},{label:"Pin Latch",value:"PinLatch"}]},15327:(e,t,r)=>{const n=r(63768),{MaterialSpecifier:i}=r(93613),s=[new i("InlinePost","Inline Posts"),new i("CornerPost","Corner Posts"),new i("TerminalPost","Terminal Posts"),new i("StairInlinePost","Stair Inline Posts"),new i("StairCornerPost","Stair Corner Posts"),new i("StairTerminalPost","Stair Terminal Posts"),new i("StairTransitionPost","Transition Posts"),new i("StairTransitionCornerPost","Transition Corner Posts"),new i("FasciaMount","Fascia Mount"),new i("Glass3_16","5 mm Glass Panels",{thickness:n.unit(3/16,"in")}),new i("Glass1_4","6 mm Glass Panels",{thickness:n.unit(1/4,"in")}),new i("Glass3_8","10 mm Glass Panels",{thickness:n.unit(3/8,"in")}),new i("Glass1_2","12 mm Glass Panels",{thickness:n.unit(.5,"in")}),new i("Glass_Stair3_8","10 mm Stair Glass Panels",{thickness:n.unit(3/8,"in"),pricingIdentifier:"Glass3_8"}),new i("Glass_Stair1_2","12 mm Stair Glass Panels",{thickness:n.unit(.5,"in"),pricingIdentifier:"Glass1_2"}),new i("Glass_Stair3_16","5 mm Stair Glass Panels",{thickness:n.unit(3/16,"in"),pricingIdentifier:"Glass3_16"}),new i("Glass_Stair1_4","6 mm Stair Glass Panels",{thickness:n.unit(1/4,"in"),pricingIdentifier:"Glass1_4"}),new i("Handrail","Handrails"),new i("CapRail","Cap Rails"),new i("NonRectangularGlass","Non-rectangular glass panels"),new i("GlassHole","Glass Hole"),new i("GlassHandrailBracket","Glass-Mount Handrail Bracket"),new i("PicketRail","Picket Rail"),new i("PicketRail48",'48" Picket Rail'),new i("Rail","Top/Bottom Rail"),new i("Labor","Labor"),new i("PinLatch","Pin Latch"),new i("DoorKnob","Door Knob"),new i("GlassMountDoorKnob","Glass Mount Door Knob")],o={};s.forEach((e=>{o[e.identifier()]=e})),e.exports=o},79429:(e,t,r)=>{const n=r(63768),i=r(88394);e.exports=class BearRidgeRailingCornerPost extends i{height(){const e=this.componentOf().railingHeight(),t=this.heightBelowSurface(),r=this.heightReduction(),i=n.add(e,t);return n.subtract(i,r)}heightReduction(){return n.unit(12,"in")}}},36198:(e,t,r)=>{const n=r(63768),i=r(72175);e.exports=class BearRidgeRailingPicketStairsPost extends i{height(){const e=this.componentOf().railingHeight(),t=this.heightBelowSurface();return n.add(e,t)}}},54836:(e,t,r)=>{const n=r(63768),i=r(72175);e.exports=class BearRidgeRailingPost extends i{height(){const e=this.componentOf().railingHeight(),t=this.heightBelowSurface(),r=this.heightReduction(),i=n.add(e,t);return n.subtract(i,r)}heightReduction(){return n.unit(12,"in")}}},83253:(e,t,r)=>{const n=r(63768),i=r(91784);e.exports=class BearRidgeRailingStairTransitionCornerPost extends i{height(){const e=this.previousSection()?.railingHeight()??this.componentOf().railingHeight(),t=this.nextSection()?.railingHeight()??this.componentOf().railingHeight(),r=n.max(e,t),i=this.heightBelowSurface();return n.add(r,i)}postWidth(){return n.unit(2.5,"in")}}},88100:(e,t,r)=>{const n=r(63768),i=r(4697);e.exports=class BearRidgeRailingStairTransitionPost extends i{height(){const e=this.previousSection()?.railingHeight()??this.componentOf().railingHeight(),t=this.nextSection()?.railingHeight()??this.componentOf().railingHeight(),r=n.max(e,t),i=this.heightBelowSurface();return n.add(r,i)}postWidth(){return n.unit(2.5,"in")}}},90464:(e,t,r)=>{const n=r(63768),i=r(22295);e.exports=class BearRidgeRailingTerminalPost extends i{height(){const e=this.componentOf().railingHeight(),t=this.heightBelowSurface();return n.add(e,t)}}},20807:(e,t,r)=>{const n=r(76247),i=r(19185),s=r(79858),o=r(57026),a="standard-glass",l="infinity",c="picket",u="framed";e.exports=function(){return{standardGlass:new n(a,"10 mil Glass","glass-rail-post-to-top"),infinity:new s(l,"Topless Glass","glass-rail-infinity"),picket:new i(c,"Picket","picket-rail"),framed:new o(u,"Standard Framed Glass","framed-glass")}}},86109:(e,t,r)=>{const n=r(86794),i=r(83253),s=r(88100);e.exports=class BearRidgeFramedGlassRailingSection extends n{pricingReferenceMaterialSpecifier(){return this.materials.Glass1_4}cornerTransitionPostClass(){return i}lineTransitionPostClass(){return s}}},1308:(e,t,r)=>{const n=r(90464),i=r(79429),s=r(54836),o=r(88100),a=r(83253),l=r(97807),c=r(22685);e.exports=class BearRidgeGlassRailingSection extends l{terminalPostClass(){return n}lineTransitionPostClass(){return o}cornerTransitionPostClass(){return a}cornerPostClass(){return i}linePostClass(){return s}hasCapRail(){return this.railingStyle().hasCapRail()}capRail(){if(this.hasCapRail())return this._capRail||(this._capRail=this._defaultCapRail()),this._capRail}_defaultCapRail(){const e=c.capRailForSection(this);return e.setComponentOf(this),e}_supplementalComponents(){return[this.capRail()]}}},72512:(e,t,r)=>{const n=r(63768),i=r(61453),s=r(18479),o=r(7127),a=r(36198),l=r(88100),c=r(90464),u=r(83253),d=r(30691);e.exports=class BearRidgePicketRailingSection extends i{usePricingMultiplier(){return!0}railingHeight(){return d.isLevel(this.edge())?this.postProvider().railingHeight():n.unit(36,"in")}linePostClass(){return d.isLevel(this.edge())?s:a}cornerTransitionPostClass(){return u}lineTransitionPostClass(){return l}cornerPostClass(){return o}terminalPostClass(){return c}postWidth(){return n.unit(1.75,"in")}railLayoutEdge(){const e=super.railLayoutEdge();if(!this.sloped())return e;const t=this.railBottomExtensionDistance().toNumeric(this.unit()),r=this.isBeginAtSlopeBottom()&&!this.sectionConnectedToBegin()?t:0,n=this.isEndAtSlopeBottom()&&!this.sectionConnectedToEnd()?t:0;return d.stretchedEdgeBy(e,r,n).relativeToEdge(this.edge())}railBottomExtensionDistance(){const e=this.componentOf().placementStrategy().slope().toNumeric("rad"),t=this.postLayoutEdge(),r=this.isBeginAtSlopeBottom()?t.begin():t.end(),i=this.componentOf().structure().nosingEdges().last().shortestLineFrom(r).length(),s=n.unit(i,this.unit());return n.divide(s,Math.cos(e))}}},97563:(e,t,r)=>{const n=r(91154),i=r(13303);class CubicBezierExtrusionMaterialBuilder extends n{build(){return new(this.getComponentClass())(this._beginLocator,this._controlPoint1,this._controlPoint2,this._endLocator,this._crossSection,this._materialSpecifier,this._planarNormal,this._beginMiterDirection,this._endMiterDirection,this._color)}}i(CubicBezierExtrusionMaterialBuilder,["controlPoint1","controlPoint2"],!1),e.exports=CubicBezierExtrusionMaterialBuilder},73233:(e,t,r)=>{const n=r(13303);class EditablePricingLineItemBuilder{constructor(e,t,r){this._specifier=e,this._options=t,this._lineItemClass=r}build(){return new(0,this._lineItemClass)(this._quantity,this._specifier,this._propertiesCollection,{...this._options,unit:this._unit})}}n(EditablePricingLineItemBuilder,["unit","quantity","propertiesCollection"]),e.exports=EditablePricingLineItemBuilder},91154:(e,t,r)=>{const n=r(13303);class ExtrusionMaterialBuilder{constructor(e,t){this._unitProvider=t,this._componentClass=e}getComponentClass(){return this._componentClass}build(){return new(this.getComponentClass())(this._beginLocator,this._endLocator,this._crossSection,this._materialSpecifier,this._planarNormal,this._beginMiterDirection,this._endMiterDirection,this._color)}}n(ExtrusionMaterialBuilder,["beginLocator","endLocator","materialSpecifier","planarNormal","crossSection","beginMiterDirection","endMiterDirection","color"]),e.exports=ExtrusionMaterialBuilder},84296:(e,t,r)=>{const n=r(13303);class LinearMaterialBuilder{constructor(e,t){this._unitProvider=t,this._materialClass=e}getMaterialClass(){return this._materialClass}build(){return new(this.getMaterialClass())(this._beginLocator,this._endLocator,this._materialSpecifier,this._offsetFromCenter,this._planarNormal,this._materialName)}}n(LinearMaterialBuilder,["beginLocator","endLocator","materialSpecifier","offsetFromCenter","planarNormal","materialName"]),e.exports=LinearMaterialBuilder},13534:(e,t,r)=>{const n=r(13303);class LocationComponentBuilder{constructor(e,t){this._unitProvider=e,this._componentClass=t}getComponentClass(){return this._componentClass}build(){return new(this.getComponentClass())(this._referencePoint)}}n(LocationComponentBuilder,["referencePoint"]),e.exports=LocationComponentBuilder},44103:(e,t,r)=>{const n=r(11216),i=r(13303);class PolygonComponentBuilder{static defaultMethodNames(){return{polygon:"polygon",referencePoint:"referencePoint",angle:"angle"}}constructor(e,t,r=t){this._polygon=r.defaultPolygon(e),this._componentClass=t}newGeometryStrategy(){const e=this._polygon;return new n(e)}getComponentClass(){return this._componentClass}build(){return new(this.getComponentClass())(this.newGeometryStrategy(),this._referencePoint,this._angle)}}const{polygon:s,referencePoint:o,angle:a}=PolygonComponentBuilder.defaultMethodNames();i(PolygonComponentBuilder,[s,o,a]),e.exports=PolygonComponentBuilder},22093:(e,t,r)=>{const n=r(16810),i=r(13303);class RectangularComponentBuilder{static defaultMethodNames(){return{width:"width",length:"length",referencePoint:"referencePoint",angle:"angle"}}constructor(e,t,r=t){this._unitProvider=e,this._width=r.defaultWidth(),this._length=r.defaultLength(),this._componentClass=t}newGeometryStrategy(){const e=this._unitProvider.unit(),t=this._width.toNumeric(e),r=this._length.toNumeric(e);return new n(t,r)}getComponentClass(){return this._componentClass}build(){return new(this.getComponentClass())(this.newGeometryStrategy(),this._referencePoint,this._angle)}}const{width:s,length:o,referencePoint:a,angle:l}=RectangularComponentBuilder.defaultMethodNames();i(RectangularComponentBuilder,[s,o,a,l]),e.exports=RectangularComponentBuilder},65684:(e,t,r)=>{const n=r(25574),i=r(13303);class RectangularCutoutBuilder{constructor(e,t){this._unitProvider=e,this._width=t.defaultWidth(),this._length=t.defaultLength(),this._componentClass=t}geometryStrategy(){if(!this._geometryStrategy){const e=this._unitProvider.unit(),t=this._width.toNumeric(e),r=this._length.toNumeric(e);this._geometryStrategy=new n(t,r)}return this._geometryStrategy}cutout(e){return this.geometryStrategy().setCutout(e),this}getComponentClass(){return this._componentClass}build(){return new(this.getComponentClass())(this.geometryStrategy(),this._referencePoint,this._angle,this._unitProvider)}}i(RectangularCutoutBuilder,["width","length","referencePoint","angle"]),e.exports=RectangularCutoutBuilder},43023:(e,t,r)=>{const n=r(84296),i=r(13303);class ThunderCloudBoardBuilder extends n{build(){return new(this.getMaterialClass())(this._beginLocator,this._endLocator,this._materialSpecifier,this._offsetFromCenter,this._planarNormal,this._materialName,this._deckingOption)}}i(ThunderCloudBoardBuilder,["deckingOption"],!1),e.exports=ThunderCloudBoardBuilder},13303:e=>{e.exports=function(e,t,r=!0){const n=e.prototype.__builderMethods||[];r&&n.forEach((t=>{e.prototype[t]=void 0})),e.prototype.__builderMethods=[...new Set([...t,...n])],t.forEach((t=>{const r=`_${t}`;e.prototype[t]=function(e){return this[r]=e,this}}))}},6691:(e,t,r)=>{const n=r(63768),i=r(98683),s=r(96100),{material:o}=r(71181),{lumber:a}=r(71181);e.exports=class CoastalMaterialHelper{pileNutsAndBolts(e){const t=e.length;return[new i(t,o.BOLT_HD_34_16),new i(t,o.NUT_HD_34)]}pileLabor(e){const t=e.first().materialSpecifier().details().laborSpecifier;return new i(e.length,t)}areaBasedLabor(e,t){const r=t.details().unit,s=Math.ceil(n.divide(e,r));return new i(s,t)}joistFramingSupports(e){const t=e.splitPileCaps().length/2*e.joists().length,r=n.add(e.dockFramer().joistSpecifier().details().depth,e.dockFramer().splitPileCapSpecifier().details().depth);return Array(t).fill(new s(r,a.PT2x4))}}},94073:(e,t,r)=>{const{DimensionAnnotation:n}=r(62048);e.exports=class CoastalPierDimensionAnnotation extends n{}},12178:(e,t,r)=>{const n=r(63768),{lumber:i}=r(93613),{CompositeFigure:s}=r(7340),{Composite3DFigure:o}=r(37732),{Polygon:a,$P:l,FixedEdgeLocator:c}=r(62048),u=r(6691),d=r(34143),h=r(83465),p=r(83102);e.exports=class CoastalBoathouseDeckingSupport extends p{constructor(e){super(),this._edge=e}edge(){return this._edge}boathouse(){return this.componentOf()}slipWidth(){return this.boathouse().slipWidth()}stringerSpecifier(){return i.PT2x10}pileSpecifier(){return i.PILE8}deckingOption(){return this.componentOf().deckingOption()}geometry(){return new a([this.stringers().first().edge().begin(),this.stringers().first().edge().end(),this.stringers().last().edge().end(),this.stringers().last().edge().begin()])}stringers(){return this._stringers||(this._stringers=this._defaultStringers(),this._stringers.forEach((e=>e.setComponentOf(this)))),this._stringers}_defaultStringers(){const e=this.stringerSpecifier(),t=e.details().depth.toNumeric(this.unit())/2;return this._stringerEdges().map((r=>new h(r.begin(),r.end(),e,l(t,0),r.normal())))}_stringerEdges(){const e=this.stringerSpecifier().details().width.toNumeric(this.unit()),t=this.boathouse().pileSpecifier().details().width.toNumeric(this.unit())/2;return[this.edge().shiftedAlongNormalBy(t+e),this.edge().shiftedAlongNormalBy(t),this.edge().shiftedAlongNormalBy(-t),this.edge().shiftedAlongNormalBy(-(t+e))]}piles(){return this._piles||(this._piles=this._defaultPiles()),this._piles}_defaultPiles(){return this._pileLocations().map((e=>new d(e,this.pileLength(),this.pileSpecifier())))}_pileLocations(){return this._spansEntireBoathouse()?this._defaultPileLocationsForEntireWidth():this._standardPiles()}_spansEntireBoathouse(){return this.edge().length().isNearTo(this.boathouse().width().toNumeric(this.unit()))}_defaultPileLocationsForEntireWidth(){const e=this.pileSpecifier(),t=this.slipWidth().toNumeric(this.unit())-e.details().width.toNumeric(this.unit())/2;return[new c(this.edge(),t),new c(this.edge(),-t)]}_standardPiles(){const e=this.pileSpecifier().details().width.toNumeric(this.unit())/2;return[new c(this.edge(),-e)]}pileLength(){return n.unit(16,"ft")}components(){return[...this.stringers(),...this.piles()]}allLocatedMaterials(){return[...this.components().flatMap((e=>e.allLocatedMaterials())),(new u).pileLabor(this.piles())]}defaultFigure(){return s.withModel(this)}threeFigure(){return o.withModel(this)}}},66451:(e,t,r)=>{const n=r(63768),{Polygon:i,FixedEdgeLocator:s}=r(62048),o=r(94848),a=r(55426),l=r(82660);e.exports=class CoastalBoathouseDock extends o{boathouse(){return this.componentOf()}_defaultFramingDescriptor(){return new l(this)}_defaultFramer(){return new a(this)}defaultGeometry(){return this.geometryStrategy().setCutout(this.defaultCutout()),super.defaultGeometry()}defaultUncutGeometry(){return this.geometryStrategy().setCutout(this.defaultCutout()),super.defaultUncutGeometry()}defaultCutout(){const e=this.referencePoint(),t=this.angle(),r=this.geometryStrategy().defaultWidth(),n=this.geometryStrategy().defaultLength(),s=e.expandedBy(n/2,r/2).toPolygon();this.geometryStrategy().rotateGeometry(s,t);const o=this.boathouse().slipWidth().toNumeric(this.unit()),a=this.boathouse().bowWidth().toNumeric(this.unit()),l=this.angledBeamWidth().toNumeric(this.unit()),c=s.edges().filter((e=>this.alongCrossAxis(e.vector()))).map((e=>e.stretchedBy(2*-o))),u=c.first().shiftedAlongNormalBy(-a),d=u.stretchedBy(2*-l),h=u.shiftedAlongNormalBy(-l);return new i([h.begin(),d.begin(),d.end(),h.end(),c.last().begin(),c.last().end()])}angledBeamWidth(){return n.unit(2,"ft")}framingEndEdgePairs(){const e=this.boathouse().slipWidth().toNumeric(this.unit()),t=this.endEdges().first(),r=this.endEdges().last();return[{edges:[t.begin().to(new s(t,e)),new s(r,-e).to(r.end())],includeEnds:!0,doubleOnEnds:!1,doubleOnMiddle:!0},{edges:[new s(t,-e).to(t.end()),r.begin().to(new s(r,e))],includeEnds:!0,doubleOnEnds:!1,doubleOnMiddle:!0},{edges:[new s(t,e).to(new s(t,-e)),this.bowEdge().reversed()],includeEnds:!1,doubleOnMiddle:!1}]}bowEdge(){const e=this.boathouse().slipWidth().toNumeric(this.unit()),t=this.boathouse().bowWidth().toNumeric(this.unit()),r=this.endEdges().first();return new s(r,e).to(new s(r,-e)).shiftedAlongNormalBy(-t)}angledBoards(){return this._angledBoards||(this._angledBoards=this.dockFramer().makeAngledBoards()),this._angledBoards}components(){return[...super.components(),...this.joists(),...this.angledBoards(),...this.headers()]}resetComponents(){super.resetComponents(),this._angledBoards=void 0}nonEssentialProperties(){return[...this.nonEssentialProperties(),"_angledBoards"]}}},55426:(e,t,r)=>{const{FixedEdgeLocator:n,$P:i}=r(62048),s=r(37528);e.exports=class CoastalBoathouseDockFramer extends s{endJoistSpecifier(){return this.framingDescriptor().endJoistSpecifier()}_joistSpanInset(e){return this.materialWidth(this.endJoistSpecifier())}_makeJoists(e,t,r,n){const i=n?this.endJoistSpecifier():t;return super._makeJoists(e,i,r,n)}makeAngledBoards(){const e=this.dock().angledBeamWidth().toNumeric(this._unit()),t=this.dock().bowEdge(),r=new n(t,e).to(new n(t,-e)),s=t.shiftedAlongNormalBy(-e),o=this.joistSpecifier(),a=this.materialDepth(o)/2,l=this.materialWidth(o)/2;return[s.begin().to(r.begin()),r.end().to(s.end())].map((e=>this._makeBoard(e,o,i(a+this.deckThickness(),l))))}makeJoists(){return[...super.makeJoists(),...this.makeStrengthenerJoists()]}makeStrengthenerJoists(){const e=this.dock().boathouse().slipWidth().toNumeric(this._unit()),t=this.materialWidth(this.dock().boathouse().pileSpecifier()),r=this.dock().boathouse().actualPileSpacing().toNumeric(this._unit())+t,s=this.endJoistSpecifier(),o=this.materialWidth(s),a=this.materialDepth(s)/2,l=this.materialWidth(this.headerSpecifier()),c=this.dock().endEdges().first().shiftedAlongNormalBy(-l),u=e-1.5*o,d=new n(c,u).to(new n(c,-u)).addZ(a+this.deckThickness()),h=d.shiftedAlongNormalBy(-r);return[this._makeBoard(d.begin().to(h.begin()),s,i(0,0)),this._makeBoard(d.end().to(h.end()),s,i(0,0))]}}},82660:(e,t,r)=>{const{lumber:n}=r(93613),i=r(95369);e.exports=class CoastalBoathouseDockFramingDescriptor extends i{endJoistSpecifier(){return n.PT3x8}headerSpecifier(){return n.PT3x8}}},13191:(e,t,r)=>{const n=r(63768),{extend:i}=r(50988),s=r(5163),o=r(5726),a=r(16400),l=r(89088),c=r(6691),u=r(701),d=r(47553),{labor:h}=r(71181),p=n.unit;class CoastalDock extends s{static defaultWidth(){return p(10,"ft")}static defaultLength(){return p(30,"ft")}static displayName(){return"Dock"}static iconName(){return"stick-dock"}clone(...e){const t=super.clone(...e);return t.setFramingStyle(this.framingStyle()),t}allLocatedMaterials(){const e=new c;return[...super.allLocatedMaterials(),...e.pileNutsAndBolts(this.posts()),...e.joistFramingSupports(this),e.pileLabor(this.posts()),e.areaBasedLabor(this.surface().deckedArea(),h.AA_LABOR_DOCK)]}_defaultAngle(){return Math.PI}_defaultDeckingStrategy(){return new a}deckingEdges(){const e=this._insetForSnappedFrames(),t=this._insetEdgesForSnappedFrames(this.sideEdges(),e);return this.dockFramer().deckingEdges(t)}_defaultFramer(){return new o(this)}_defaultFramingDescriptor(){return new d(this)}setLength(e){const t=this.dockFramer().getNearestAllowableLength(e);super.setLength(t)}setWidth(e){const t=this.dockFramer().getNearestAllowableWidth(e);super.setWidth(t)}constrainWidthAdjustment(e){return this.dockFramer().constrainWidthAdjustment(e)}prepareForMove(){this._unsnapFromPier(),this.detachBoathouses()}angleChanged(e){super.angleChanged(e),this._unsnapFromPier(),this.adjustPileHeights()}didSnapToFrame(e){e instanceof l&&(e.addSnappedFrame(this),this._snappedPier=e,this.resetComponents())}_unsnapFromPier(){this.snappedPier()&&(this.snappedPier().removeSnappedFrame(this),this._snappedPier=void 0,this.resetComponents())}snappedPier(){return this._snappedPier}snappedFrames(){return[this.snappedPier()].filter((e=>e))}disconnectFromFrame(e){e===this.snappedPier()&&this._unsnapFromPier()}orthogonallySnappedToPierEnd(){return!!this.snappedPier()&&(!!this.snappedPier().mainAxis().dot(this.mainAxis()).isNearTo(0)&&this._snappedToPierEnd())}endSnappedToPierEnd(){return!!this.snappedPier()&&(!this.snappedPier().mainAxis().dot(this.mainAxis()).isNearTo(0)&&this._snappedToPierEnd())}_snappedToPierEnd(){if(!this.snappedPier())return!1;const e=this.snappedPier().endEdges();return Boolean(e.find((e=>this.geometry().containsPoint(e.begin())&&this.geometry().containsPoint(e.end()))))}_projectedPostPositions(e){return this.snappedPier().sideEdges().map((t=>{const r=e.intersectionsWithLineIn2D(t);if(0===r.length)return;const n=r.first();return e.begin().distanceTo(n)/e.length()})).filter((e=>void 0!==e))}uniquePosts(){if(!this.snappedPier())return super.uniquePosts();const e=this.posts(),t=this.snappedPier().posts();return e.filter((e=>!t.includes(e)))}_minimumPostSpacingNumeric(){return this.dockFramer().minPostSpacing().toNumeric(this.unit())}constrainedPostPositions(e){if(!this.snappedPier())return;if(this.orthogonallySnappedToPierEnd())return this._projectedPostPositions(e);return this.snappedPier().posts().filter((t=>{const r=e.closestPointTo(t.locator()),n=t.locator().expandedByRadius(this._minimumPostSpacingNumeric());return e.xy().containsPoint(t.locator())&&n.contains(r.x(),r.y())})).map((t=>e.begin().distanceTo(t.locator())/e.length()))}defaultDisplayProperties(){return[...super.defaultDisplayProperties(),this._lengthProperty(),this._widthProperty(),this._framingStyleProperty()]}}i(CoastalDock,u),CoastalDock.FRAMING_STYLES=u.FRAMING_STYLES,e.exports=CoastalDock},85157:(e,t,r)=>{const n=r(63768),{lumber:i}=r(93613),{FixedEdgeLocator:s,RelativeLocator:o}=r(62048),a=r(21373),l=r(16727),c=r(83465),u=n.unit;e.exports=class CoastalDockDeckingSurface extends l{constructor(e,t){super(e),this._deckingStrategy=t}deckingStrategy(){return this._deckingStrategy}deckBoardGap(){return this.deckingStrategy().deckBoardGap()}deckBoardGapNumeric(){return this.deckBoardGap().toNumeric(this.unit())}deckingOption(){if(!this._deckingOption){const e=this.deckingStrategy().deckingLumber();this._deckingOption=new a("Pressure Treated",{description:"",unitPrice:u(3.25,"1/ft^2"),materialSpecifier:e,material:"pressure-treated"})}return this._deckingOption}crossSupportMaterialSpecifier(){return i.PT2x4}materialSpecifier(){return this.deckingOption().materialSpecifier()}price(){const e=this.deckingOption().unitPrice();return(n.multiply(this.deckedArea(),e)*(this.frame().systemStrategy().deckingPriceMargin?.()||1)).roundedTo(2)}_surfaceZ(){return this.frame().zLevel()}_deckBoardWidthNumeric(){return this.materialSpecifier().details().width.toNumeric(this.unit())}_deckBoardDepthNumeric(){return this.materialSpecifier().details().depth.toNumeric(this.unit())}zLevel(){return this._surfaceZ()}components(){return[...this.deckBoards(),...this.crossSupports()]}resetComponents(){this._deckBoards=void 0,this._crossSupports=void 0}deckBoards(){return this._deckBoards||(this._deckBoards=this._defaultDeckBoards()),this._deckBoards}boards(){return this.deckBoards()}crossSupports(){return this._crossSupports||(this._crossSupports=this._defaultCrossSupports()),this._crossSupports}_jointLines(){const e=this.frame().postRows();return e.shift(),e.pop(),e.map((e=>this._postLine(e)))}_makeDeckBoard(e,t,r=e.length()){const n=this.frame().geometry().normal(),i=new s(e,t),a=new s(e,r),l=o.makeRelativeTo(i,this.frame().referencePoint()),u=o.makeRelativeTo(a,this.frame().referencePoint()),d=new c(l,u,this.materialSpecifier(),void 0,n);return d.setComponentOf(this),d}_makeDeckBoardRun(e,t){const r=this._jointLines(),n=[];let i=0;for(let s=t?1:0;s<r.length;s+=2){const t=r[s].shortestLineFrom(e.begin()).length(),o=this._makeDeckBoard(e,i,t);n.push(o),i=t}return n.push(this._makeDeckBoard(e,i)),n}_postLine(e,t=0){const r=this.deckingStrategy().postLine(e),n=e.first(),i=this._surfaceZ()-n.locator().z()+t;return r.addZ(i)}numberOfDeckBoardRuns(){const e=this.deckBoardGapNumeric(),t=((this.deckingStrategy().availableSpanForRuns(this.frame())+e)/(this._deckBoardDepthNumeric()+e)).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES);return this.deckingStrategy().roundUpFractionalBoardRuns()?Math.ceil(t):Math.floor(t)}_deckSurfaceWidthNumeric(){const e=this.numberOfDeckBoardRuns();return this._deckBoardDepthNumeric()*e+this.deckBoardGapNumeric()*(e-1)}_deckSurfaceEndEdges(){const e=this.frame().postRows(),t=e.first(),r=e.last(),n=this.deckingStrategy().longitudinalBoardRunExpansion(this.frame());return[this._postLine(t).shiftedAlongNormalBy(n),this._postLine(r).shiftedAlongNormalBy(-n)]}_deckSurfaceLengthNumeric(){const e=this._deckSurfaceEndEdges().map((e=>e.center()));return e.first().distanceTo(e.last())}deckedArea(){return u(this._deckSurfaceWidthNumeric()*this._deckSurfaceLengthNumeric(),`${this.unit()}^2`)}_defaultDeckBoards(){const[e,t]=this._deckSurfaceEndEdges(),r=this.numberOfDeckBoardRuns(),n=this._deckSurfaceWidthNumeric(),i=(e.length()-n+this._deckBoardDepthNumeric())/2,o=[];for(let n=0;n<r;++n){const r=i+n*(this._deckBoardDepthNumeric()+this.deckBoardGapNumeric()),a=new s(e,r),l=new s(t,r),c=a.to(l),u=Boolean(n%2);o.push(...this._makeDeckBoardRun(c,u))}return o}crossSupportsPerSpan(){return this.deckingStrategy().crossSupportsPerSpan()}_makeCrossSupport(e,t){const r=e.shiftedAlongNormalBy(t),n=o.makeRelativeTo(r.begin(),this.frame().referencePoint()),i=o.makeRelativeTo(r.end(),this.frame().referencePoint()),s=new c(n,i,this.crossSupportMaterialSpecifier());return s.setComponentOf(this),s}_defaultCrossSupports(){const e=this.frame().postRows(),t=[];for(let r=0;r<e.length-1;++r){const n=e[r],i=e[r+1],s=n.first().locator().distanceTo(i.first().locator()),o=this._postLine(i,this._deckBoardWidthNumeric()),a=this.crossSupportsPerSpan(),l=s/(a+1);for(let e=1;e<=a;++e)t.push(this._makeCrossSupport(o,l*e))}return t}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_deckingOption"]}xLevel(){return this.frame().xLevel()}}},5726:(e,t,r)=>{const n=r(63768),{RelativeLocator:i}=r(62048),s=r(37528),o=r(24575),a=r(34143),l=r(76905),c=r(80317);e.exports=class CoastalDockFramer extends s{pileHeights(){return this._pileHeights||(this._pileHeights=new o(16,20,"ft",2)),this._pileHeights}postHeight(){return this.pileHeights().minimum()}allowableLengths(){return this._allowableLengths||(this._allowableLengths=new o(10,1/0,"ft",1)),this._allowableLengths}getNearestAllowableLength(e){return this.allowableLengths().getNearest(e)}constrainLengthAdjustment(e){const t=this.dock();return this.allowableLengths().getNearestDelta(t.length(),t.unit(),e)}allowableWidths(){return this._allowableWidths||(this._allowableWidths=new o(5,1/0,"ft",1)),this._allowableWidths}getNearestAllowableWidth(e){return this.allowableWidths().getNearest(e)}constrainWidthAdjustment(e){const t=this.dock();return this.allowableWidths().getNearestDelta(t.width(),t.unit(),e)}_shareablePosts(){return this.dock().snappedPier?.()?.posts()}_existingPost(e){if(!this._shareablePosts())return;const{locatable:t,distance:r}=l.findClosest(e,this._shareablePosts());if(this.dock().endSnappedToPierEnd?.()){if(r<this.minPostSpacing().toNumeric(this.dock().unit()))return t}else if(r.isNearTo(0))return t}_makePost(e,t){const r=this._existingPost(e);if(r)return r;const s=this.dock().project().componentsForRoles(c.BOATHOUSE).flatMap((e=>e.edges().map((e=>e.xy())))),o=this.dock().geometry().edges().map((e=>e.xy())),l=s.filter((e=>o.some((t=>t.overlaps(e))))).some((t=>{const r=t.closestPointTo(e);return e.xy().expandedByRadius(12).contains(r.x(),r.y())}));let u;this.dock().isJoistFraming()||l||(u=n.multiply(this._postHeightAboveDecking(),-1));const d=i.makeRelativeTo(e,this.dock().referencePoint()),h=this.pileHeights().getNearest(t);return new a(d,h,this.postSpecifier(),u)}_postHeightAboveDecking(){return n.unit(6,"in")}deckingEdges(e=this.framingSideEdges()){const t=this.framingDescriptor().deckingOffset();return this.offsetHelper().applyOffsetToEdges(e,t).map((e=>e.relativeTo(this.dock().referencePoint())))}makeJoists(){return this.dock().isJoistFraming()?super.makeJoists():[]}makeHeaders(){return[]}makeCrossBracing(){return[]}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_pileHeights","_allowableLengths","_allowableWidths"]}}},47553:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),s=r(95369),{lumber:o}=r(71181);e.exports=class CoastalFramingDescriptor extends s{maxPostSpacing(){return n.unit(6,"ft")}splitPileCapSpecifier(){return o.PT3x8}postSpecifier(){return o.PILE6}shouldDoubleEndJoists(){return!1}joistOffset(){return i(0,-this.materialWidth(this.joistSpecifier()),this._joistZOffset())}splitPileCapOffset(){return this.dock().isJoistFraming()?super.splitPileCapOffset():i(0,this._splitPileCapLateralOffset(),this.baseZOffset()+this.materialDepth(this.splitPileCapSpecifier()))}_splitPileCapLateralOffset(){return 0}deckingOffset(){const e=this.materialWidth(this.joistSpecifier());return this.joistOffset().xy().add(0,e)}interiorPostVerticalOffset(){return 0}}},16831:(e,t,r)=>{const{EditableProperty:n}=r(7340),{extend:i}=r(50988),s=r(7524),o=r(67603),a=r(6706);class CoastalPierAndDockProject extends s{multiplierProperty(){return this._multiplierProperty||(this._multiplierProperty=new n(this,"Multiplier",{type:"number",label:"Quantity"})),this._multiplierProperty}multiplier(){return void 0===this._multiplier&&(this._multiplier=1),this._multiplier}setMultiplier(e){this._multiplier=e}defaultDisplayProperties(){return new o(this,[...super.defaultDisplayProperties(),this.multiplierProperty()])}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_multiplierProperty"]}}i(CoastalPierAndDockProject,a),e.exports=CoastalPierAndDockProject},19820:(e,t,r)=>{const n=r(63768),{$P:i,RelativeLocator:s,NormalToEdgeLocator:o}=r(62048),{EditableProperty:a,PropertiesCollection:l}=r(7340),c=r(12178),u=r(66451),d=r(6691),h=r(3117),p=r(91801),m=r(80866),f=r(34143),{lumber:g,labor:y}=r(71181),b=r(80317),v=n.unit;e.exports=class CoastalPierBoathouse extends m{static defaultWidth(){return n.unit(12,"ft")}static defaultLength(){return n.unit(18,"ft")}static iconName(){return"coastal-boathouse"}static displayName(){return"Boathouse"}role(){return b.BOATHOUSE}deckingOptionProvider(){return this.componentOf()?.deckingOptionProvider()}deckingOption(){return this.deckingOptionProvider().deckingOption()}defaultDisplayProperties(){return new l(this,[...super.defaultDisplayProperties(),new a(this,"Slip Width",{type:"unit",defaultUnit:"ft"}),new a(this,"Bow Width",{type:"unit",defaultUnit:"ft"})])}_defaultRoofTypeOptions(){return[new h,new p]}angleChanged(){super.angleChanged(),this.snappedDocks().forEach((e=>e.adjustPileHeights()))}frameResized(e){super.frameResized(e),this.snappedDocks().forEach((e=>e.adjustPileHeights()))}delete(){this.snappedDocks().forEach((e=>e.detachFromBoathouse(this))),super.delete()}prepareForMove(){this.snappedDocks().forEach((e=>e.detachFromBoathouse(this)))}_resetComponents(){this._decking=void 0,this._deckingSupports=void 0,super._resetComponents()}actualPileSpacing(){const e=this.pileSpacingNumeric(),t=(this.sideEdges().first().length()-this.pileSpecifier().details().width.toNumeric(this.unit())).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES),r=Math.ceil(t/e);return n.unit(t/r,this.unit())}deckingSupports(){return this._deckingSupports||(this._deckingSupports=this._defaultDeckingSupports(),this._deckingSupports.forEach((e=>{e.setComponentOf(this)}))),this._deckingSupports}_defaultDeckingSupports(){const e=this.slipWidth().toNumeric(this.unit()),t=this._supportHeight().toNumeric(this.unit()),r=this.pileSpecifier().details().width.toNumeric(this.unit())/2,n=this.endEdges().first().xy(),i=this._pileLocations().map((e=>e.addZ(-t))),s=i.filter((e=>n.containsPoint(e.xy(),r+Math.DEFAULT_TOLERANCE)));s.forEach((e=>i.remove(e)));return[...i.map((t=>new c(t.to(new o(t,-e))))),new c(s.first().to(s.last()))]}_supportHeight(){return n.unit(15.25,"in")}slipWidth(){return this._slipWidth||(this._slipWidth=n.unit(4,"ft")),this._slipWidth}setSlipWidth(e){this._slipWidth=e,this._deckingSupports=void 0,this._decking=void 0}validateSlipWidth(e,t){if(!e)return;const r=n.unit(4,"ft"),i=n.unit(2,"ft");return n.larger(t,r)?`must be smaller than ${r.toString()}`:n.smaller(t,i)?`must be larger than ${i.toString()}`:void 0}bowWidth(){return this._bowWidth||(this._bowWidth=n.unit(64,"in")),this._bowWidth}setBowWidth(e){this._bowWidth=e,this._deckingSupports=void 0,this._decking=void 0}validateBowWidth(e,t){if(!e)return;const r=n.unit(12,"ft"),i=n.unit(2,"ft");return n.larger(t,r)?`must be smaller than ${r.toString()}`:n.smaller(t,i)?`must be larger than ${i.toString()}`:void 0}decking(){return this._decking||(this._decking=u.builder(this).length(n.add(this.length(),n.unit(6,"in"))).width(this.width()).angle(this.angle()).referencePoint(s.makeRelativeTo(this.locator(),this.referencePoint())).build(),this._decking.setComponentOf(this)),this._decking}maximumSpan(e){let t;return t=this.alongMainAxis(e.vector())?v(40,"ft"):v(60,"ft"),Math.min(this.roof().maximumSpan(e),t.toNumeric(this.unit()))}_roundToNearestInchNumeric(e){return n.round(e.toNumeric("in"))}pileSpecifier(){return g.PILE12}_defaultPiles(){const e=this.pileSpecifier(),t=this.pileHeightAboveWater().toNumeric(this.unit()),r=e.details().width.toNumeric(this.unit())/2;return this._pileLocations().map((n=>new f(new o(n,-r).addZ(-t),this.pileLength(),e)))}_pileLayoutEdges(){const e=this.pileSpecifier().details().width.toNumeric(this.unit());return this.sideEdges().map((t=>t.stretchedBy(-e).relativeToEdge(t)))}components(){return[...super.components(),this.decking(),...this.deckingSupports()]}allLocatedMaterials(){const e=this.components().flatMap((e=>e.allLocatedMaterials())),t=new d;return[...e,t.pileLabor(this.piles()),t.areaBasedLabor(this.area(),y.AA_LABOR_BOATHOUSE)]}snapToFramesFilter(){return e=>b.DOCK===e.role()}xLevel(){return this.boundingCube().left()}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_deckingSupports","_decking"]}defaultAnnotationsYZ(){const e=this.systemStrategy().annotationType();return this.yzAnnotationEdges().map((t=>new e(t,30,this.unit())))}yzAnnotationEdges(){const e=this.boundingCube().high(),t=this.endEdges().first();return[i(t.begin().y(),0).to(i(t.begin().y(),e)),i(this.boundingCube().top(),e).to(i(this.boundingCube().bottom(),e))]}snapToConnectorsFilter(){return()=>!1}attachedConnectors(){return[]}didSnapToFrame(e){e.snapToBoathouse(this)}addSnappedDock(e){this.snappedDocks().push(e)}removeSnappedDock(e){this.snappedDocks().remove(e)}snappedDocks(){return this._snappedDocks??=[]}}},76677:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),s=r(47553);e.exports=class CoastalPierFramingDescriptor extends s{maxPostSpacing(){return n.unit(8,"ft")}postOffset(){const e=this.materialWidth(this.postSpecifier())/2;return i(e,e,this.baseZOffset())}joistOffset(){const e=this.materialWidth(this.postSpecifier())/2,t=this.materialWidth(this.joistSpecifier());return i(e+2*t,e+t,this._joistZOffset())}_splitPileCapLateralOffset(){return this.joistOffset().y()+this.materialWidth(this.joistSpecifier())}}},30046:(e,t,r)=>{const n=r(18126);e.exports=class CoastalPierGableEndFraming extends n{xLevel(){return this.boundingCube().left()}allLocatedMaterials(){return this.components()}}},3117:(e,t,r)=>{const n=r(63768),i=r(28564),s=r(48119),o=r(41963);e.exports=class CoastalPierGableRoof extends s{minimumSpanAlongMainAxis(){return n.unit(10,"ft").toNumeric(this.unit())}minimumSpanAlongCrossAxis(){return n.unit(13,"ft").toNumeric(this.unit())}xLevel(){return this.boundingCube().left()}framingClass(){return o}roofMaterialClass(){return i}allLocatedMaterials(){return[this.framing(),...this.roofing()].flatMap((e=>e.allLocatedMaterials()))}}},41963:(e,t,r)=>{const n=r(63768),{lumber:i}=r(93613),{$P:s,FixedEdgeLocator:o}=r(62048),a=r(87558),l=r(30046),c=r(50549),u=r(83465),d=r(46748);e.exports=class CoastalPierGableRoofFraming extends c{gableEndFramingClass(){return l}reset(){super.reset(),this._outriggers=void 0}_defaultCollarTies(){const e=this.ridgeSpecifier().details().width.toNumeric(this.unit()),t=d`(${this.width()} / 2) / 3`.toNumeric(this.unit()),r=this.rakeOverhangDistance().toNumeric(this.unit()),n=this.ridge().edge().addZ(-e/2*this.pitch()),i=[this.shiftEdgeAlongPitch(n.reversed(),t),this.shiftEdgeAlongPitch(n,t)].map((e=>new o(e,r).to(new o(e,-r)))),s=[];for(let e=0;e<this._numberOfCollarTies();e++){const t=this._findCollarTieOffset(e),r=this._createCollarTie(...i,t);r.setComponentOf(this),s.push(r)}return s}_createCollarTie(e,t,r){return new a(new o(e,-r).to(new o(t,r)),this.pitch(),this.collarTieSpecifier())}_findCollarTieOffset(e){return this._findRafterOffset(e+1)-this.collarTieSpecifier().details().width.toNumeric(this.unit())}_numberOfCollarTies(){return this.rafters().length/2-2}outriggers(){return this._outriggers??=this._defaultOutriggers()}_defaultOutriggers(){const e=[];let t=this.flyRafters();for(let r=0;r<4;r++){const r=[];t.forEach((t=>{const n=this._findNextRafter(t);r.push(n),e.push([t,n].sort(((e,t)=>this.mainAxis().dot(e.locator())-this.mainAxis().dot(t.locator()))))})),t=r}return e.flatMap((e=>{const t=e.some((e=>this.flyRafters().includes(e)))?e.first().length():this.extendedOutriggersMaxOffset();return this._generateOutriggersBetweenRafters(...e,t)}))}_findNextRafter(e){const t=e.edge().direction(),r=this.mainAxis().dot(e.locator()),n=r-this.mainAxis().dot(this.ridge().edge().begin())<this.mainAxis().dot(this.ridge().edge().end())-r;return this.rafters().filter((t=>t!==e)).filter((e=>e.edge().direction().dot(t).isNearTo(1))).filter((e=>{const t=this.mainAxis().dot(e.locator());return n?r<t:r>t})).sort(((t,r)=>e.edge().begin().distanceTo3D(r.edge().begin())-e.edge().begin().distanceTo3D(t.edge().begin()))).last()}_generateOutriggersBetweenRafters(e,t,r){const n=this.outriggerSpacing().toNumeric(this.unit()),i=this.outriggerSpecifier(),a=i.details().depth.toNumeric(this.unit()),l=this.rafterSpecifier().details().width.toNumeric(this.unit()),c=this.crossAxis().dot(e.edge().direction())>0?1:-1,d=e.edge().shiftedAlongNormalBy(l/2*c),h=t.edge().shiftedAlongNormalBy(-l/2*c),p=d.direction(),m=Math.floor(r.toNumeric(this.unit())/n),f=[];for(let e=0;e<m;e++){const t=(e+1)*n,r=new o(d,t),l=new o(h,t),m=new u(r,l,i,s(-a/2*c,0),p);m.setComponentOf(this),f.push(m)}return f}outriggerSpacing(){return n.unit(16,"in")}extendedOutriggersMaxOffset(){return n.unit(4,"ft")}outriggerSpecifier(){return i.PT2x6}components(){return[...super.components(),...this.outriggers()]}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_outriggers"]}allLocatedMaterials(){return this.components().flatMap((e=>e.allLocatedMaterials()))}}},91801:(e,t,r)=>{const n=r(63768),{Polygon:i,FixedEdgeLocator:s}=r(62048),o=r(60495),a=r(34076),l=r(28564);e.exports=class CoastalPierHipRoof extends a{static type(){return"Hip Roof"}minimumSpanAlongMainAxis(){return n.unit(10,"ft").toNumeric(this.unit())}minimumSpanAlongCrossAxis(){return this.width().toNumeric(this.unit())}maximumSpanAlongMainAxis(){return this.length().toNumeric(this.unit())}framingClass(){return o}_sheathingHeightOffset(){return 0}_roofingHeightOffset(){return this.sheathing().first().thickness()}roofMaterialClass(){return l}roofPolygons(){const e=this.framing().ridge().edge(),t=this.framing().ridgeSpecifier().details().width.toNumeric(this.unit()),r=this._heightAboveRidge().toNumeric(this.unit()),n=new s(e,t/2).to(new s(e,-t/2)).addZ(-r),o=this._roofFasciaEdges(),a=this.crossAxis(),l=this.mainAxis();return o.map((e=>{let t=[n.begin(),n.end()];const r=e.direction();return Math.abs(r.dot(a)).isNearTo(1)&&(r.dot(a).isNearTo(1)&&(t=[n.begin()]),r.dot(a).isNearTo(-1)&&(t=[n.end()])),r.dot(l).isNearTo(1)&&t.reverse(),new i([...t,e.end(),e.begin()])}))}_roofFasciaEdges(){const e=this.framing().fasciaSpecifier().details().width;return this.framing().fascia().map((t=>this.shiftEdgeAlongPitch(t.edge(),e.toNumeric(this.unit())/2)))}_axisForRoofPolygon(e){const t=e.edges();return this._roofFasciaEdges().map((e=>e.reversed())).find((e=>t.find((t=>t.equals(e))))).direction()}allLocatedMaterials(){return[this.framing(),...this.roofing()].flatMap((e=>e.allLocatedMaterials()))}shiftEdgeAlongPitch(e,t){return e.shiftedAlongNormalBy(t).addZ(t*this.pitch())}}},60495:(e,t,r)=>{const n=r(63768),i=n.unit,{lumber:s}=r(93613),{$P:o,FixedEdgeLocator:a,RelativeLocator:l,NormalToEdgeLocator:c}=r(62048),u=r(87558),d=r(73835),h=r(7157),p=r(83465),m=r(46748);e.exports=class CoastalPierHipRoofFraming extends h{ridgeSpecifier(){return s.PT2x12}hipRafterSpecifier(){return s.PT2x12}joistSpecifier(){return s.PT2x6}height(){const e=this.structureHeight(),t=this.pitch(),r=this.width(),n=this.ridgeSpecifier().details().width;return m`((${r} - ${n}) / 2) * ${t} + ${this.rafterDepth()} + ${e}`}rafterOverhang(){return i(12,"in")}rafterSpacing(){return i(16,"in")}reset(){super.reset(),this._joists=void 0,this._hipRafters=void 0,this._jackRafters=void 0,this._commonRafters=void 0}_defaultRidge(){const e=this.ridgeSpecifier(),t=e.details().width,r=this.roof().structure().endEdges(),i=r.first().center().to(r.last().center()).addZ(-this.height().toNumeric(this.unit())),s=m`(${this.width()} - ${t}) / 2`.toNumeric(this.unit()),l=new a(i,s),c=new a(i,-s),u=new p(l,c,e,o(n.divide(e.details().depth,2).toNumeric(this.unit()),0),i.normal());return u.setComponentOf(this),u}hipRafters(){return this._hipRafters||(this._hipRafters=this._defaultHipRafters()),this._hipRafters}_defaultHipRafters(){const e=this.hipRafterSpecifier(),t=this.ridgeSpecifier().details().width,r=this.roof().structure().endEdges(),n=m`${this.rafterOverhang()} + (${this.width()} - ${t}) / 2`.toNumeric(this.unit()),i=n*this.pitch(),s=n*Math.SQRT2,o=this._ridgeSideEdges();return[o.last().begin().to(r.first().begin()),o.first().begin().to(r.first().end()),o.first().end().to(r.last().begin()),o.last().end().to(r.last().end())].map((t=>{const r=t.begin().add(t.xy().direction().multipliedBy(s)).addZ(i),n=new d(t.begin(),l.makeRelativeTo(r,t.begin()),e);return n.setComponentOf(this),n}))}commonRafters(){return this._commonRafters||(this._commonRafters=this._defaultCommonRafters()),this._commonRafters}_defaultCommonRafters(){const e=this._ridgeSideEdges(),t=this.rafterSpacing().toNumeric(this.unit()),r=this.rafterSpecifier().details().width.toNumeric(this.unit()),n=e.first().length()-r/2,i=[];let s=r/2;for(;s<n+t;){const r=Math.min(s,n);i.push(...this._createRafterPair(e,r)),s+=t}return i.push(...this._defaultEndCommonRafters()),i.forEach((e=>e.setComponentOf(this))),i}_defaultEndCommonRafters(){const e=this.ridge().edge(),t=m`${this.rafterOverhang()} + (${this.width()} / 2) - (${this.ridgeSpecifier().details().width} / 2)`.toNumeric(this.unit());return[new d(e.begin(),l.makeRelativeTo(e.begin().add(e.direction().multipliedBy(-t).addZ(t*this.pitch())),e.begin()),this.rafterSpecifier()),new d(e.end(),l.makeRelativeTo(e.end().add(e.direction().multipliedBy(t).addZ(t*this.pitch())),e.end()),this.rafterSpecifier())]}_createRafterPair(e,t){const r=m`${this.rafterOverhang()} + (${this.width()} / 2) - (${this.ridgeSpecifier().details().width} / 2)`.toNumeric(this.unit());return e.map(((e,n)=>{const i=n%2==0?r:-r,s=new a(e,0),o=new c(s,0,t),l=new c(s,i,t).addZ(r*this.pitch());return new d(o,l,this.rafterSpecifier())}))}_ridgeSideEdges(){const e=this.ridge().edge(),t=this.ridgeSpecifier().details().width.toNumeric(this.unit());return[e.shiftedAlongNormalBy(t/2),e.shiftedAlongNormalBy(-t/2)]}jackRafters(){return this._jackRafters||(this._jackRafters=this._defaultJackRafters()),this._jackRafters}_defaultJackRafters(){const e=this.rafterSpecifier().details().width,t=this.rafterSpacing().toNumeric(this.unit()),r=m`floor(((${this.width()} - ${e}) / 2 + ${this.rafterOverhang()}) / ${this.rafterSpacing()}) - 1`,n=this.hipRafters().flatMap((n=>this.commonRafters().filter((e=>e.geometry().containsPoint(n.locator()))).flatMap((i=>{const s=Math.sign(n.edge().direction().dot(i.edge().normal())),o=[];for(let a=0;a<r;a++){const r=t*(a+1)+e.toNumeric(this.unit())/2,c=i.edge().shiftedAlongNormalBy(r*s),u=n.edge().intersectionsWithEdge(c),h=l.makeRelativeTo(u.first(),c.begin());o.push(new d(h,c.end(),this.rafterSpecifier()))}return o}))));return n.forEach((e=>e.setComponentOf(this))),n}_defaultCollarTies(){const e=this.ridgeSpecifier().details().width.toNumeric(this.unit()),t=this.collarTieSpecifier().details().width.toNumeric(this.unit())/2,r=m`(${this.width()} / 2) / 3`.toNumeric(this.unit()),n=this.ridge().edge().addZ(-e/2*this.pitch()),i=this.rafterSpacing().toNumeric(this.unit()),s=[this.shiftEdgeAlongPitch(n.reversed(),r),this.shiftEdgeAlongPitch(n,r)],o=this.commonRafters().length/2-1-2,a=[];for(let e=0;e<o;e++){const r=i*(e+1)-t,n=this._createCollarTie(...s,r);n.setComponentOf(this),a.push(n)}return a}_createCollarTie(e,t,r){return new u(new a(e,-r).to(new a(t,r)),this.pitch(),this.collarTieSpecifier())}joists(){return this._joists||(this._joists=this._defaultJoists()),this._joists}_defaultJoists(){const e=this.joistSpecifier(),t=e.details().width.toNumeric(this.unit()),r=e.details().depth,n=m`${this.height()} - ${this.structureHeight()} - ${r}`.toNumeric(this.unit()),i=this.ridge().edge().addZ(n),s=[];s.push(...this._defaultJoistsUnderRidge(i));const o=this._defaultJoistsUnderJackAreas(i);s.push(...o);const a=o[o.length-2].edge().shiftedAlongNormalBy(-t/2),l=o.last().edge().shiftedAlongNormalBy(t/2);return s.push(...this._defaultShortendEndJoists(a,l)),s.forEach((e=>e.setComponentOf(this))),s}_defaultShortendEndJoists(e,t){const r=this.joistSpecifier(),n=this.rafterSpacing().toNumeric(this.unit()),i=r.details().depth,s=r.details().width.toNumeric(this.unit()),o=this.rafterSpecifier().details().width.toNumeric(this.unit()),a=m`${this.structureHeight()} + ${i}`.toNumeric(this.unit()),l=this.roof().structure().endEdges().map((e=>e.addZ(-a))),c=m`floor(${this.width()} / 2 / ${this.rafterSpacing()})`-1,u=l.map((t=>t.direction().equals(e.direction())?t:t.reversed())),d=u.first(),h=u.last(),f=this.crossAxis(),g=[e.center().to(d.center()),t.center().to(h.center())].map((e=>{const t=e.normal().dot(f);return e.shiftedAlongNormalBy(t*(s/2+o/2))})),y=g.map((e=>new p(e.begin(),e.end(),r,this._joistOffsetFromCenter(),e.normal().negated())));for(let e=0;e<c;e++)y.push(...g.flatMap((t=>{const i=t.normal().dot(f)*(n*(e+1)+s/2);return[t.shiftedAlongNormalBy(i),t.shiftedAlongNormalBy(-i)].map((e=>new p(e.begin(),e.end(),r,this._joistOffsetFromCenter(),t.normal().negated())))})));return y}_defaultJoistsUnderJackAreas(e){const t=this.rafterSpecifier().details().width.toNumeric(this.unit()),r=this.rafterSpacing().toNumeric(this.unit()),n=m`floor(${this.width()} / 2 / ${this.rafterSpacing()})`-2,i=[];for(let s=0;s<n;s++){const n=e.length()+t+r*(s+1),o=t-e.length()-r*(s+1);i.push(this._createJoist(e,o),this._createJoist(e,n))}return i}_defaultJoistsUnderRidge(e){const t=this.joistSpecifier().details().width.toNumeric(this.unit()),r=this.rafterSpecifier().details().width.toNumeric(this.unit()),n=this.rafterSpacing().toNumeric(this.unit()),i=this.commonRafters().length-2,s=[];for(let o=0;o<i;o++){const i=Math.min(o*n+t/2+r,e.length()-t/2+r);s.push(this._createJoist(e,i))}return s}_createJoist(e,t){const r=this.width().toNumeric(this.unit())/2,n=new a(e,t);return new p(new c(n,r),new c(n,-r),this.joistSpecifier(),this._joistOffsetFromCenter(),this.mainAxis())}_joistOffsetFromCenter(){const e=this.joistSpecifier().details().depth.toNumeric(this.unit());return o(-e/2,0)}_defaultFascia(){const e=this.fasciaSpecifier(),t=e.details().depth.toNumeric(this.unit()),r=e.details().width.toNumeric(this.unit()),n=m`${this.rafterOverhang()} + ${e.details().width} / 2`.toNumeric(this.unit()),i=m`${this.structureHeight()} + ${this.rafterDepth()} - (${this.rafterOverhang()} + ${e.details().width} / 2) * ${this.pitch()}`.toNumeric(this.unit()),s=this.roof().structure().endEdges().map((e=>e.shiftedAlongNormalBy(n).stretchedBy(2*n).addZ(-i))),a=this.ridge().locator();return[...s,s.first().end().to(s.last().begin()),s.last().end().to(s.first().begin())].map((e=>{const t=e.stretchedBy(r);return l.makeRelativeTo(t.begin(),a).to(l.makeRelativeTo(t.end(),a))})).map((r=>{const n=new p(r.begin(),r.end(),e,o(t/2,0),r.normal());return n.setComponentOf(this),n}))}components(){return[...super.components(),...this.hipRafters(),...this.commonRafters(),...this.jackRafters(),...this.joists()]}}},84517:(e,t,r)=>{const n=r(36539),i=r(67287),s=r(17130),o=r(54400),a=r(42947);e.exports=class CoastalPierPricingStrategy extends o{profitAndOverheadRatio(){return.2}_profitAndOverhead(e){return e*this.profitAndOverheadRatio()}breakdownLineItems(e,t){const r=super.breakdownLineItems(e,t),o=this._profitAndOverhead(this.subtotal(e)),l=new s;l.addElement(i.forValue(a.item,"P & O")),l.addElement(i.forValue(a.quantity,"")),l.addElement(i.forValue(a.unitPrice,"")),l.addElement(i.forDollarValue(a.amount,o)),r.push(l);const c=new s;c.addElement(i.forValue(a.item,"Multiplier"));const u=new n(e.multiplierProperty(),a.quantity);return c.addElement(u),c.addElement(i.forValue(a.quantity,"")),c.addElement(i.forValue(a.unitPrice,"")),r.push(c),r}totalPrice(e){const t=super.totalPrice(e);return(t+this._profitAndOverhead(t))*e.multiplier()}}},7157:(e,t,r)=>{const n=r(9664);e.exports=class CoastalPierRoofFraming extends n{allLocatedMaterials(){return this.components().flatMap((e=>e.allLocatedMaterials()))}}},16400:(e,t,r)=>{const n=r(63768),{lumber:i}=r(93613),s=n.unit;e.exports=class DockDeckingStrategy{deckBoardGap(){return s(.25,"in")}crossSupportsPerSpan(){return 1}deckingLumber(){return i.PT2x6}postLine(e){const t=e.first(),r=e.last(),n=t.locator().to(r.locator()),i=t.width().toNumeric(t.unit());return n.stretchedBy(i)}availableSpanForRuns(e){const t=e.postRows().first();return this.postLine(t).length()}roundUpFractionalBoardRuns(){return!0}_pileCapDepthNumeric(){return this.frame().splitPileCaps().first().depth().toNumeric(this.unit())}longitudinalBoardRunExpansion(e){return e.splitPileCaps().first().depth().toNumeric(e.unit())+e.posts().first().width().toNumeric(e.unit())/2}}},89088:(e,t,r)=>{const n=r(63768),{extend:i}=r(50988),{EditableProperty:s}=r(7340),o=r(5163),a=r(42626),l=r(90753),c=r(76905),u=n.unit,{$P:d}=r(62048),h=r(6691),p=r(701),m=r(76677),{labor:f}=r(71181);let g;class Pier extends o{static defaultWidth(){return u(58,"in")}static defaultLength(){return u(48,"ft")}static displayName(){return"Pier"}static iconName(){return"stick-pier"}clone(...e){const t=super.clone(...e);return t.setFramingStyle(this.framingStyle()),t}allLocatedMaterials(){const e=new h;return[...super.allLocatedMaterials(),...e.pileNutsAndBolts(this.posts()),...e.joistFramingSupports(this),e.pileLabor(this.posts()),e.areaBasedLabor(this.surface().deckedArea(),f.AA_LABOR_PIER)]}angleChanged(e){super.angleChanged(e),this._clearSnappedFrames(),this.adjustPileHeights()}snapToFramesFilter(){return e=>!1}prepareForMove(){this._clearSnappedFrames(),this.detachBoathouses()}_clearSnappedFrames(){this.snappedFrames().forEach((e=>e.disconnectFromFrame?.(this))),this._snappedFrames=void 0}snappedFrames(){return this._snappedFrames||(this._snappedFrames=[]),this._snappedFrames}addSnappedFrame(e){this.snappedFrames().includes(e)||(this.snappedFrames().push(e),this.surface().resetComponents())}removeSnappedFrame(e){this._snappedFrames=this.snappedFrames().filter((t=>t!==e)),this.surface().resetComponents()}_defaultDeckingStrategy(){return new l}deckingEdges(){const e=this._insetForSnappedFrames(),t=this._insetEdgesForSnappedFrames(this.sideEdges(),e);return this.dockFramer().deckingEdges(t)}_defaultFramer(){return new a(this)}_defaultFramingDescriptor(){return new m(this)}setLength(e){const t=this.dockFramer().getNearestAllowableLength(e);super.setLength(t)}boundingCube(){return this.components().map((e=>e.boundingCube())).reduce(((e,t)=>e.merge(t)))}_framePostProxies(e){return e.posts().map((e=>({post:e,locator:()=>e.locator()})))}_frameIsOrthoganallyPositionedWithinPierExtent(e){const t=this.sideEdges().first();return e.endEdges().every((e=>{const r=t.closestPointTo(e.begin(),!0);return t.containsPoint(r)}))}_cornerSnappingPosts(e){if(this.alongMainAxis(e.mainAxis()))return;if(this._frameIsOrthoganallyPositionedWithinPierExtent(e))return;const t=this._framePostProxies(e),r=e.cornerPosts(),n=this.cornerPosts().map((e=>c.findClosest(e.locator(),t)));n.sort(((e,t)=>e.distance-t.distance));let i=n.find((e=>r.includes(e.locatable.post)));if(!i){const e=n.map((e=>e.locatable)),s=t.filter((t=>!e.includes(t))),o=this.cornerPosts().map((e=>c.findClosest(e.locator(),s)));o.sort(((e,t)=>e.distance-t.distance)),i=o.find((e=>r.includes(e.locatable.post)))}if(i){const e=i.locatable,t=e.post;return[c.findClosest(e.locator(),this.cornerPosts()).locatable,t]}}snappingVectorForFrame(e){if(g||(g=r(13191)),!(e instanceof g))return;const t=this._framePostProxies(e),n=this.posts().map((e=>c.findClosest(e.locator(),t)));n.sort(((e,t)=>e.distance-t.distance));const i=n.first().locatable;let s=i.post,o=c.findClosest(i.locator(),this.posts()).locatable;const[a,l]=this._cornerSnappingPosts(e)||[void 0,void 0];return a&&(o=a,s=l),o.locator().xy().subtract(s.locator().xy())}_widthProperty(){return new s(this,"Width",{type:"select",choices:this._widthOptions()})}_widthOptions(){return[{label:"4 ft",value:n.unit(3,"ft")},{label:"5 ft",value:n.unit(4,"ft")},{label:"6 ft",value:n.unit(5,"ft")}]}setFramingStyle(e){this._framingStyle=e,this.setWidth(this.defaultWidth()),this._surface=void 0,this.resetComponents(),this.resetDisplayProperties()}defaultWidth(){return this.isJoistFraming()?this._widthOptions().first().value:this.constructor.defaultWidth()}defaultDisplayProperties(){return[...super.defaultDisplayProperties(),this._framingStyleProperty(),this._lengthProperty(),...this.isJoistFraming()?[this._widthProperty()]:[]]}xLevel(){return this.boundingCube().left()}defaultAnnotationsYZ(){const e=this.systemStrategy().annotationType();return this.yzAnnotationEdges().map((t=>new e(t,15,this.unit())))}yzAnnotationEdges(){const e=this.surface().boundingCube().low(),t=this.surface().boundingCube().high(),r=this.endEdges().first();return[d(r.begin().y(),0).to(d(r.begin().y(),e)),d(this.boundingCube().top(),t).to(d(this.boundingCube().bottom(),t))]}}i(Pier,p),Pier.FRAMING_STYLES=p.FRAMING_STYLES,e.exports=Pier},90753:(e,t,r)=>{const n=r(63768),{lumber:i}=r(93613),s=n.unit;e.exports=class PierDeckingStrategy{deckBoardGap(){return s(1,"in")}_sideGap(){return s(1.5,"in")}crossSupportsPerSpan(){return 2}deckingLumber(){return i.PT2x8}postLine(e){const t=e.first(),r=e.last();return t.locator().to(r.locator())}availableSpanForRuns(e){const t=e.postRows().first(),r=this.postLine(t),n=t.first().width().toNumeric(e.unit());return r.length()-n-2*this._sideGap().toNumeric(e.unit())}roundUpFractionalBoardRuns(){return!1}longitudinalBoardRunExpansion(e){return 0}}},42626:(e,t,r)=>{const n=r(24575),i=r(5726);e.exports=class PierFramer extends i{allowableLengths(){return this._allowableLengths||(this._allowableLengths=new n(8,1/0,"ft",8)),this._allowableLengths}}},28564:(e,t,r)=>{const n=r(63768),i=r(98683),s=r(75086);e.exports=class RoofMaterial extends s{allLocatedMaterials(){const e=this.area(),t=this.materialSpecifier(),r=this.materialSpecifier().details().coverage,s=Math.ceil(n.divide(e,r));return[new i(s,t)]}}},701:(e,t,r)=>{const n=r(63768),{EditableProperty:i}=r(7340),{MissingOverride:s}=r(50988),o=r(64363),a=r(96797),l=r(85157),c=r(21373),{lumber:u}=r(71181),d=r(46748);class CoastalSharedDockBehavior{deckingOption(){let e=u.PT2x8;return this.isJoistFraming()&&(e=u.PT2x6),new c("Pressure Treated",{unitPrice:n.unit(0,"1/ft^2"),materialSpecifier:e,material:"pressure-treated"})}_framingStyleProperty(){return new i(this,"Framing Style",{type:"select",choices:this.framingChoices()})}_lengthProperty(){return new i(this,"Length",{type:"unit",defaultUnit:"ft"})}_widthProperty(){return new i(this,"Width",{type:"unit",defaultUnit:"ft"})}framingStyle(){return this._framingStyle??=this.framingChoices().first().value}setFramingStyle(e){this._framingStyle=e,this._surface=void 0,this.resetComponents()}framingChoices(){return Object.values(this.constructor.FRAMING_STYLES).map((e=>({label:e,value:e})))}isJoistFraming(){return this.framingStyle()===this.constructor.FRAMING_STYLES.joist}constrainLengthAdjustment(e){return this.dockFramer().constrainLengthAdjustment(e)}adjustPileHeights(){this._posts=void 0}snapToBoathouse(e){this.boathouses().push(e),e.addSnappedDock(this),this.adjustPileHeights()}detachFromBoathouse(e){this.boathouses().remove(e),e.removeSnappedDock(this),this.adjustPileHeights()}detachBoathouses(){this.boathouses().slice().forEach((e=>this.detachFromBoathouse(e)))}boathouses(){return this._boathouses||(this._boathouses=[]),this._boathouses}snappableEdgesForFrame(e){const t=e.zLevel()-this.zLevel();return this.edges().map((e=>e.addZ(t)))}_defaultSurface(){return this.isJoistFraming()?new a(this):new l(this,this._defaultDeckingStrategy())}_defaultDeckingStrategy(){throw new s(this,"_defaultDeckingStrategy")}includeSkirtBoards(){return!1}cutBoardsToFit(){return!1}deckingBoardGap(){const e=this.deckingEdges().first().length(),t=this.surface().materialSpecifier().details().depth.toNumeric(this.unit()),r=Math.floor(e/t)-1,i=e-r*t;return n.unit(i/(r-1),this.unit())}_insetEdgesForSnappedFrames(e,t){const r=this.snappedFrames().map((e=>e.geometry())),n=this.endEdges();return e.map((e=>{let i=e.begin(),s=e.end();const o=n.find((e=>e.containsPoint(i)));r.some((e=>e.containsEdge(o)))&&(i=i.add(e.direction().multipliedBy(t.toNumeric(this.unit()))));const a=n.find((e=>e.containsPoint(s)));return r.some((e=>e.containsEdge(a)))&&(s=s.subtract(e.direction().multipliedBy(t.toNumeric(this.unit())))),i.to(s).relativeTo(this.referencePoint())}))}_insetForSnappedFrames(){return d`${this.deckingOption().materialSpecifier().details().depth} * 2 + ${n.unit(1,"in")}`}defaultFigure(){return new o(this)}}CoastalSharedDockBehavior.FRAMING_STYLES={longDecking:"Long Decking",joist:"Joist"},e.exports=CoastalSharedDockBehavior},64363:(e,t,r)=>{const n=r(85438),i=r(55033),s=r(39792);e.exports=class CoastalDockFigure extends s{dock(){return this.model()}_drawFigures(e,t){this.figures().forEach((r=>r.draw(e,t)))}constrainLengthAdjustment(e){return this.dock().constrainLengthAdjustment(e)}_endEdgeHandles(){return this.model().constrainLengthAdjustment?this.model().endEdges().map((e=>new i(e,this,this.constrainLengthAdjustment.bind(this)))):[]}constrainWidthAdjustment(e){return this.dock().constrainWidthAdjustment(e)}_sideEdgeHandles(){return this.model().constrainWidthAdjustment?this.model().sideEdges().map((e=>new i(e,this,this.constrainWidthAdjustment.bind(this)))):[]}defaultHandles(){return[...this.model().vertices().map((e=>new n(this.model(),e))),...this._endEdgeHandles(),...this._sideEdgeHandles(),this.selfHandle()]}}},11725:(e,t,r)=>{const{DisplayProperties:n}=r(7340),{extend:i,MissingOverride:s}=r(50988);class DesignerType{static identifier(){throw new s(this,"identifier")}componentOf(){return this._componentOf}setComponentOf(e){this._componentOf=e}classPrefix(){return this.componentOf().classPrefix()}unitToSettings(e){return`math.unit(${e.toNumeric("in").roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES)}, 'in')`}makeEditableProperty(e,t,r){return`new EditableProperty(this, '${e}', { type: '${t}', ${Object.keys(r).map((e=>`${e}: ${r[e]}`)).join(", ")}})`}unitFunction(e,t,r=!0){return{includeIf:r,dependencies:[this.mathjsDependency()],name:e,type:"get",value:this.unitToSettings(t)}}booleanFunction(e,t,r){return{includeIf:r,dependencies:[],type:"get",name:e,value:t}}classGetterFunction(e,t,r){return{includeIf:r,dependencies:[this.classDependency(t)],type:"get",name:e,value:t}}fileGetterFunction(e,t,r){return{includeIf:r,dependencies:[this.fileDependency(t)],type:"get",name:e,value:t}}designerSettings(){const e=this.modelDefinitions().filter((e=>e));return e.forEach((e=>{e.functions=e.functions.filter((e=>void 0===e.includeIf||e.includeIf))})),{model_classes:e,strategy_config:this.strategySettings()}}modelDefinitions(){return[]}strategySettings(){return{}}modelClassName(e){return`${this.classPrefix()}${e}`}editablePropertyDependencies(){return[{type:"lcad",name:"EditableProperty",packageName:"drawing-editor"},{type:"class",name:"PropertiesCollection"}]}classDependency(e){return{type:"class",name:e}}fileDependency(e){return{type:"file",name:e}}geometryDependency(e){return{type:"lcad",name:e,packageName:"geometry"}}mathjsDependency(){return{type:"package",name:"math",packageName:"mathjs"}}resetAllDisplayProperties(){this.resetDisplayProperties(),this.componentOf().resetDisplayProperties()}}i(DesignerType,n),e.exports=DesignerType},11718:(e,t,r)=>{const n=r(63768),{EditableProperty:i}=r(7340),s=r(95944),o=r(67603),a=r(11725);e.exports=class DockDesignerType extends a{static identifier(){return"Docks"}defaultDisplayProperties(){return new o(this,[new i(this,"Decking Options",{type:"booleanmap"}),new i(this,"Allow Max Length",{type:"boolean"}),new i(this,"Max Length",{type:"unit",defaultUnit:"in"}),new i(this,"Allow Max Width",{type:"boolean"}),new i(this,"Max Width",{type:"unit",defaultUnit:"in"}),new i(this,"Min Length",{type:"unit",defaultUnit:"in"}),new i(this,"Min Width",{type:"unit",defaultUnit:"in"}),new i(this,"Default Length",{type:"unit",defaultUnit:"in"}),new i(this,"Default Width",{type:"unit",defaultUnit:"in"}),new i(this,"Default Height",{type:"unit",defaultUnit:"in"}),new i(this,"Decking Board Gap",{type:"unit",defaultUnit:"in"}),new i(this,"Include Skirt Boards",{type:"boolean"})])}showMaxLengthProperty(){return this.allowMaxLength()}showMaxWidthProperty(){return this.allowMaxWidth()}deckingOptions(){return this._deckingOptions??=this.defaultDeckingOptions()}setDeckingOptions(e){this._deckingOptions=e}defaultDeckingOptions(){const e={};return Object.keys(s).forEach((t=>e[t]=!1)),e}allowMaxLength(){return this._allowMaxLength??=!1}toggleAllowMaxLength(){this._allowMaxLength=!this.allowMaxLength(),this.componentOf().resetDisplayProperties()}maxLength(){return this._maxLength??=n.unit(20,"ft")}setMaxLength(e){this._maxLength=e}validateMaxLength(e,t){const r=n.max(this.minLength(),this.defaultLength());return this.validateUnit(e,t,r)}allowMaxWidth(){return this._allowMaxWidth??=!1}toggleAllowMaxWidth(){this._allowMaxWidth=!this.allowMaxWidth(),this.componentOf().resetDisplayProperties()}maxWidth(){return this._maxWidth??=n.unit(20,"ft")}setMaxWidth(e){this._maxWidth=e}validateMaxWidth(e,t){const r=n.max(this.minWidth(),this.defaultWidth());return this.validateUnit(e,t,r)}minLength(){return this._minLength??=n.unit(4,"ft")}setMinLength(e){this._minLength=e}validateMinLength(e,t){const r=[this.maxLength(),this.defaultLength()].filter((e=>e)),i=n.min(...r);return this.validateUnit(e,t,n.unit(1,"in"),i)}minWidth(){return this._minWidth??=n.unit(2,"ft")}setMinWidth(e){this._minWidth=e}validateMinWidth(e,t){return this.validateUnit(e,t,n.unit(1,"in"),this.maxWidth())}defaultLength(){return this._defaultLength??=n.unit(8,"ft")}setDefaultLength(e){this._defaultLength=e}validateDefaultLength(e,t){return this.validateUnit(e,t,this.minLength(),this.maxLength())}defaultWidth(){return this._defaultWidth??=n.unit(3,"ft")}setDefaultWidth(e){this._defaultWidth=e}validateDefaultWidth(e,t){return this.validateUnit(e,t,this.minWidth(),this.maxWidth())}defaultHeight(){return this._defaultHeight??=n.unit(18,"in")}setDefaultHeight(e){this._defaultHeight=e}deckingBoardGap(){return this._deckingBoardGap??=n.unit(3/16,"in")}setDeckingBoardGap(e){this._deckingBoardGap=e}includeSkirtBoards(){return this._includeSkirtBoards??=!1}toggleIncludeSkirtBoards(){this._includeSkirtBoards=!this.includeSkirtBoards()}validateUnit(e,t,r,i){if(e)return i&&n.larger(t,i)?`must be smaller than ${i.toString()}`:r&&n.smaller(t,r)?`must be larger than ${r.toString()}`:void 0}deckingOptionSettings(){const e=Object.keys(this.deckingOptions()).filter((e=>this.deckingOptions()[e]));return e.length>0?e:[Object.keys(this.deckingOptions()).first()]}modelDefinitions(){return[this.dockModelDefinition()]}strategySettings(){return{decking_options:this.deckingOptionSettings()}}dockModelDefinition(){return{class_name:this.dockClassName(),parent_class:"BetterDock",functions:[this.unitFunction("static defaultLength",this.defaultLength()),this.unitFunction("static defaultWidth",this.defaultWidth()),this.unitFunction("_defaultHeight",this.defaultHeight()),this.unitFunction("minLength",this.minLength()),this.unitFunction("minWidth",this.minWidth()),this.unitFunction("maxLength",this.maxLength(),this.allowMaxLength()),this.unitFunction("maxWidth",this.maxWidth(),this.allowMaxWidth()),this.unitFunction("deckingBoardGap",this.deckingBoardGap()),this.booleanFunction("includeSkirtBoards",this.includeSkirtBoards())]}}dockClassName(){return this.modelClassName("Dock")}}},94531:(e,t,r)=>{const n=r(63768),{EditableProperty:i}=r(7340),s=r(67603),o=r(85257),a=r(84514),l=r(11725),c=r(21455),u=r(90218),d={none:"None",panel:"Panel",picket:"Picket",railing:"Railing"},h={none:"None",mitered:"Mitered",model3D:"3D Models"},p={default:new u("Default",{fileName:"defaultSleeveDescriptorDefinitions"}),pipe2In:new u('2" Diameter Pipe',{fileName:"generic2inPipeSleeveDescriptorDefinitions"})};class RailingDesignerType extends l{static identifier(){return"Railings"}defaultDisplayProperties(){return new a(this,[this.sectionProperties(),this.blockProperties(),this.hasTopRail()?this.topRailCrossSection().displayProperties():[],this.hasBottomRail()?this.bottomRailCrossSection().displayProperties():[],this.postCrossSection().displayProperties(),this.infillProperties(),this.postProperties(),this.postMountStyleProperties()])}sectionProperties(){return[new i(this,"Maximum Post Spacing",{type:"unit",defaultUnit:"in"}),new i(this,"Minimum Post Spacing",{type:"unit",defaultUnit:"in"}),new i(this,"Include Slopes",{type:"boolean"})]}postProperties(){return new s(this,[new i(this,"Inset Corner Posts",{type:"boolean"}),new i(this,"Corner Post Inset",{type:"unit",defaultUnit:"in"}),new i(this,"Sleeve Type",{type:"select",choices:this.sleeveTypeChoices()}),new i(this,"Sleeve Model Descriptor Definitions Preset",{label:"Sleeve Model Preset",type:"select",choices:this.sleeveModelDescriptorDefinitionsPresetChoices()}),new i(this,"Bottom Rail Sleeves",{type:"boolean"}),new i(this,"Include Baseplate",{type:"boolean"})])}postMountStyleProperties(){return new a(this,[new s(this,[new i(this,"Post Mount Styles",{type:"booleanmap"})]),this.hasPostFasciaMountStyle()?this.postFasciaMountStyle().displayProperties():[],this.hasPostSurfaceMountStyle()?this.postSurfaceMountStyle().displayProperties():[]])}sleeveType(){return this._sleeveType??=h.mitered}setSleeveType(e){this._sleeveType=e,this.notifyDisplayPropertiesChangedObservers()}sleeveTypeChoices(){return Object.values(h).map((e=>({value:e,label:e})))}showSleeveTypeProperty(){return this.hasTopRail()}sleeveModelDescriptorDefinitionsPreset(){return this._sleeveModelDescriptorDefinitionsPreset??=p.default}setSleeveModelDescriptorDefinitionsPreset(e){this._sleeveModelDescriptorDefinitionsPreset=e}sleeveModelDescriptorDefinitionsPresetChoices(){return Object.values(p)}showSleeveModelDescriptorDefinitionsPresetProperty(){return this.showSleeveTypeProperty()&&this.sleeveType()===h.model3D}includeSleeveModelDescriptionDefinitionsGetter(){return this.showSleeveModelDescriptorDefinitionsPresetProperty()&&this.sleeveModelDescriptorDefinitionsPreset()!==p.default}bottomRailSleeves(){return this._bottomRailSleeves??=!1}toggleBottomRailSleeves(){this.setBottomRailSleeves(!this.bottomRailSleeves())}setBottomRailSleeves(e){this._bottomRailSleeves=e}showBottomRailSleevesProperty(){return this.showSleeveTypeProperty()&&this.hasBottomRail()&&this.sleeveType()!==h.none}includeBaseplate(){return this._includeBaseplate??=!0}toggleIncludeBaseplate(){this.setIncludeBaseplate(!this.includeBaseplate())}setIncludeBaseplate(e){this._includeBaseplate=e}insetCornerPosts(){return this._insetCornerPosts??=!1}toggleInsetCornerPosts(){this._insetCornerPosts=!this.insetCornerPosts(),this.resetAllDisplayProperties()}cornerPostInset(){return this._cornerPostInset??=n.unit(3,"in")}setCornerPostInset(e){this._cornerPostInset=e}showCornerPostInsetProperty(){return this.insetCornerPosts()}infillProperties(){const e=[new i(this,"Infill Type",{type:"select",choices:this.infillChoices()})];return this.hasRailingInfill()&&e.push(new i(this,"Infill Spacing",{type:"unit",defaultUnit:"in"})),new a(this,[new s(this,e),this.hasRailingInfill()?this.infillCrossSection().displayProperties():[]])}blockProperties(){return[new i(this,"Has Top Rail",{type:"boolean",label:"Top Rail"}),new i(this,"Has Bottom Rail",{type:"boolean",label:"Bottom Rail"}),new i(this,"Bottom Rail Height",{type:"unit",defaultUnit:"in"})]}infillChoices(){return Object.values(d).map((e=>({value:e,label:e})))}infillType(){return this._infillType??=this.infillChoices().first().value}setInfillType(e){this._infillType=e,this.resetAllDisplayProperties()}hasRailingInfill(){return[d.picket,d.railing].includes(this.infillType())}infillCrossSection(){return this._infillCrossSection??=new o("Infill",!0,1,1)}infillSpacing(){return this._infillSpacing??=n.unit(6,"in")}setInfillSpacing(e){this._infillSpacing=e}bottomRailHeight(){return this._bottomRailHeight??=n.unit(3,"in")}setBottomRailHeight(e){this._bottomRailHeight=e}showBottomRailHeightProperty(){return this.hasBottomRail()}maximumPostSpacing(){return this._maximumPostSpacing??=n.unit(6,"ft")}setMaximumPostSpacing(e){const t=n.largerEq(e,this.minimumPostSpacing())?e:this.minimumPostSpacing();this._maximumPostSpacing=t}minimumPostSpacing(){return this._minimumPostSpacing??=n.unit(1,"ft")}setMinimumPostSpacing(e){const t=n.smallerEq(e,this.maximumPostSpacing())?e:this.maximumPostSpacing();this._minimumPostSpacing=t}includeSlopes(){return this._includeSlopes??=!1}toggleIncludeSlopes(){this._includeSlopes=!this.includeSlopes()}hasTopRail(){return this._hasTopRail??=!0}toggleHasTopRail(){this._hasTopRail=!this.hasTopRail(),this.resetAllDisplayProperties()}hasBottomRail(){return this._hasBottomRail??=!0}toggleHasBottomRail(){this._hasBottomRail=!this.hasBottomRail(),this.resetAllDisplayProperties()}postCrossSection(){return this._postCrossSection??=new o("Post",!0,3,3)}topRailCrossSection(){return this._topRailCrossSection??=new o("Top Rail",!0,3,2)}bottomRailCrossSection(){return this._bottomRailCrossSection??=new o("Bottom Rail",!0,3,2)}postMountStyles(){return this._postMountStyles??=this.defaultPostMountStyleChoices()}setPostMountStyles(e){this._postMountStyles=e,this.resetAllDisplayProperties(),[this.postFasciaMountStyle(),this.postSurfaceMountStyle()].map((e=>e.resetDisplayProperties()))}defaultPostMountStyleChoices(){const e={};return Object.values(c.STYLES).map((t=>e[t.label]=!1)),e[c.STYLES.surface.label]=!0,e}hasPostFasciaMountStyle(){return this.postMountStyles()[c.STYLES.fascia.label]}hasPostSurfaceMountStyle(){return this.postMountStyles()[c.STYLES.surface.label]}postFasciaMountStyle(){return this._fasciaPostMountStyle??=new c(c.STYLES.fascia)}postSurfaceMountStyle(){return this._surfacePostMountStyle??=new c(c.STYLES.surface)}_postMountStyleConfigurator(e){return e.label===c.STYLES.fascia.label?this.postFasciaMountStyle():this.postSurfaceMountStyle()}modelDefinitions(){return[this.topRailModelDefinition(),this.bottomRailModelDefinition(),this.postModelDefinition(),this.postSurfaceMountStyleModelDefinition(),this.postFasciaMountStyleModelDefinition(),this.blockModelDefinition(),this.postLayoutInsetHelperModelDefinitions(),this.sectionModelDefinition(),this.railingStyleModelDefinition(),this.placementStrategyModelDefinition(),this.runModelDefinition(),this.collectionModelDefinition()]}topRailModelDefinition(){if(this.hasTopRail())return{class_name:this.topRailClassName(),parent_class:"ExtrusionRail",functions:[...this.topRailCrossSection().designerSettingFunctions("crossSection")]}}bottomRailModelDefinition(){if(this.hasBottomRail())return{class_name:this.bottomRailClassName(),parent_class:"ExtrusionRail",functions:[...this.bottomRailCrossSection().designerSettingFunctions("crossSection")]}}postModelDefinition(){return{class_name:this.postClassName(),parent_class:"ExtrusionPost",mixins:this.postMixinClasses(),functions:[...this.postCrossSection().designerSettingFunctions("crossSection","Length"),this.booleanFunction("includeBottomRailSleeves",!0,this.bottomRailSleeves()),this.fileGetterFunction("sleeveDescriptorDefinitions",this.sleeveModelDescriptorDefinitionsPreset().details().fileName)]}}postMixinClasses(){if(!this.hasTopRail())return[];const e=[];return this.sleeveType()===h.mitered&&e.push("RailingPostWithExtrusionSleeveMixin"),this.sleeveType()===h.model3D&&e.push("RailingPostWith3DModelSleeveMixin"),this.includeBaseplate()&&e.push("RailingPostWith3DModelBaseplateMixin"),e}postFasciaMountStyleModelDefinition(){const e=this.hasPostSurfaceMountStyle()?this.postMountStyleClassName(c.STYLES.surface):"ThunderCloudPostMountStyle";if(this.hasPostFasciaMountStyle())return this._postMountStyleModelDefinition(c.STYLES.fascia,e)}postSurfaceMountStyleModelDefinition(){if(this.hasPostSurfaceMountStyle())return this._postMountStyleModelDefinition(c.STYLES.surface)}_postMountStyleModelDefinition(e,t="ThunderCloudPostMountStyle"){const r=this._postMountStyleConfigurator(e);return{class_name:this.postMountStyleClassName(e),parent_class:t,mixins:e===c.STYLES.fascia?["PostFasciaMountStyleMixin"]:[],functions:[this.unitFunction("postZOffset",r.postBaseOffsetBelowPlatformSurface()),this.unitFunction("offsetFromEdgeOfPlatform",r.offsetFromEdgeOfPlatform())]}}blockModelDefinition(){return{class_name:this.blockClassName(),parent_class:this.blockParentClass(),mixins:this.hasBottomRail()?["RailingBlockBottomRailMixin"]:[],functions:[this.unitFunction("static bottomRailHeight",this.bottomRailHeight(),this.hasBottomRail()),this.classGetterFunction("bottomRailClass",this.bottomRailClassName(),this.hasBottomRail()),{includeIf:this.hasBottomRail(),dependencies:[],name:"bottomRailHeight",type:"get",value:"this.constructor.bottomRailHeight()"},...this.infillCrossSection().designerSettingFunctions("infillCrossSection","Length",this.hasRailingInfill()),this.unitFunction("infillSpacing",this.infillSpacing(),this.hasRailingInfill())]}}blockParentClass(){return`${{None:"ThunderCloudRailing",Panel:"Panel",Picket:"Picket",Railing:"HorizontalBar"}[this.infillType()]}Block`}postLayoutInsetHelperModelDefinitions(){return{class_name:this.postLayoutInsetHelperClassName(),parent_class:"RailingLayoutInsetHelper",functions:[{dependencies:[this.mathjsDependency(),this.classDependency(this.postClassName())],name:"terminalInset",type:"get",value:`math.divide(${this.postClassName()}.defaultLength(), -2)`},this.unitFunction("rightAngleInset",n.multiply(this.cornerPostInset(),-1),this.insetCornerPosts())]}}sectionModelDefinition(){const e=[];return this.hasPostSurfaceMountStyle()&&e.push(this.postMountStyleClassName(c.STYLES.surface)),this.hasPostFasciaMountStyle()&&e.push(this.postMountStyleClassName(c.STYLES.fascia)),{class_name:this.sectionClassName(),parent_class:"ThunderCloudRailingSection",functions:[{includeIf:this.numberOfPostMountOptions()>0,dependencies:e.map((e=>this.classDependency(e))),name:"static postMountStyleClasses",type:"get",value:`[\n${e.join(",\n")}\n]`},{dependencies:[{type:"lcad",name:"EditableProperty",packageName:"drawing-editor"}],name:"_selfDisplayProperties",type:"get",value:this.sectionEditableProperties()},this.classGetterFunction("blockClass",this.blockClassName()),this.classGetterFunction("_classForPost",this.postClassName()),this.unitFunction("maxRailLength",this.maximumPostSpacing()),this.unitFunction("minLength",this.minimumPostSpacing()),{dependencies:[this.classDependency(this.postClassName())],name:"postWidth",type:"get",value:`${this.postClassName()}.defaultWidth()`},{includeIf:this.hasTopRail(),dependencies:[this.classDependency(this.topRailClassName())],name:"_defaultRails",type:"generic",value:[`const rail = new ${this.topRailClassName()}(this.railLayoutEdge())`,"rail.setComponentOf(this)","return [rail]"]},{includeIf:this.hasBottomRail(),dependencies:[],name:"bottomRailHeight",type:"get",value:"this.blockClass().bottomRailHeight()"},{includeIf:this.hasBottomRail(),dependencies:[],name:"lowerRailHeights",type:"get",value:"[this.bottomRailHeight()]"},this.classGetterFunction("postLayoutEdgeInsetHelperClass",this.postLayoutInsetHelperClassName())]}}sectionEditableProperties(){const e=[];return this.includeSlopes()&&e.push(this.makeEditableProperty("Flip Slope","action",{perform:"() => this.flipSlope()"})),`[\n${e.join(",\n")}\n]`}railingStyleModelDefinition(){return{class_name:this.railingStyleClassName(),parent_class:"ThunderCloudRailingStyle",functions:[]}}placementStrategyModelDefinition(){const e=this.includeSlopes()?"ThunderCloudHybridSurfaceRailingPlacementStrategy":"LevelSurfaceRailingPlacementStrategy";return{class_name:this.placementStrategyClassName(),parent_class:e,functions:[]}}runModelDefinition(){return{class_name:this.runClassName(),parent_class:"ThunderCloudRailingRun",functions:[{dependencies:[this.classDependency(this.placementStrategyClassName())],name:"_defaultPlacementStrategy",type:"get",value:`new ${this.placementStrategyClassName()}(this)`}]}}collectionModelDefinition(){const e=this.editablePropertyDependencies().slice();return this.showPostMountStyleProperties()&&e.push({type:"lcad",name:"CompositeEditableProperty",packageName:"drawing-editor"}),{class_name:this.collectionClassName(),parent_class:"ThunderCloudRailingCollection",functions:[{dependencies:e,name:"defaultDisplayProperties",type:"get",value:this.collectionEditableProperties()},this.classGetterFunction("runClass",this.runClassName()),this.classGetterFunction("sectionClass",this.sectionClassName())]}}collectionEditableProperties(){const e=[];return this.includeStructures()&&e.push(this.makeEditableProperty("Flip Platform","action",{perform:"() => this.toggleStructureSide()"})),this.includeSlopes()&&e.push("this.baselineHeightProperty()"),this.showPostMountStyleProperties()&&e.push("new CompositeEditableProperty('Post Mount Style', 'select', this.sections().map(section => section.postMountStyleProperty()))"),`new PropertiesCollection(this, [\n${e.join(",\n")}\n])`}includeStructures(){return this.componentOf().editorFlags().showsStructures}showPostMountStyleProperties(){return this.numberOfPostMountOptions()>1}numberOfPostMountOptions(){return Object.values(this.postMountStyles()).filter(Boolean).length}railingStyleClassName(){return this.modelClassName("RailingStyle")}collectionClassName(){return this.modelClassName("Collection")}runClassName(){return this.modelClassName("Run")}sectionClassName(){return this.modelClassName("RailingSection")}blockClassName(){return this.modelClassName("Block")}postClassName(){return this.modelClassName("Post")}bottomRailClassName(){return this.modelClassName("BottomRail")}topRailClassName(){return this.modelClassName("TopRail")}placementStrategyClassName(){return this.modelClassName("PlacementStrategy")}postLayoutInsetHelperClassName(){return this.modelClassName("PostLayoutInsetHelper")}postMountStyleClassName(e){return this.modelClassName(`Post${e.label}MountStyle`)}}RailingDesignerType.INFILL_TYPES=d,RailingDesignerType.SLEEVE_TYPES=h,e.exports=RailingDesignerType},11393:(e,t,r)=>{const{PropertiesCollection:n,ReadableProperty:i}=r(7340),s=r(63768),o=r(79851),a=r(14098),l=r(21065),c=r(14933),u=r(29264);e.exports=class DockDesignerAppGangway extends o{static defaultWidth(){return s.unit(3,"ft")}static defaultLength(){return s.unit(14,"ft")}_defaultLength(){return this.constructor.defaultLength()}_defaultWidth(){return this.constructor.defaultWidth()}resetLength(){}resetWidth(){}minLength(){return s.unit(4,"ft")}maxLength(){return s.unit(1/0,"ft")}fallbackSideDockHeight(){return s.unit(2,"ft")}surfaceType(){return l.Aluminum}surface(){return this._surface??=new a(this)}railingEdges(){return this.sideEdges()}railingCollections(){return this._railingCollections??=this._defaultRailingCollections()}_defaultRailingCollections(){const e=this.railingCollectionClass();return this.railingEdges().map((t=>{const r=new e;return r.setComponentOf(this),r.addRun(r.createRunOn(this,t)),r}))}railingCollectionClass(){return this.project().railingCollectionClass()}railingStyleFor(e){return new u}resetRailings(){this._railingCollections=void 0}components(){return[this.surface(),...this.railingCollections()]}defaultDisplayProperties(){return new n(this,[new i(this,"Grade Label",{type:"text",label:"Grade"})])}gradeLabel(){return this._gradeHintHelper().hintFor(this.slopeAngle())}_gradeHintHelper(){return this.__gradeHintHelper??=new c}frameResized(){super.frameResized(),this.resetRailings()}attachUpperFrame(e){super.attachUpperFrame(e),this.resetRailings()}attachLowerFrame(e){super.attachLowerFrame(e),this.resetRailings()}detachUpperFrame(){super.detachUpperFrame(),this.resetRailings()}detachLowerFrame(){super.detachLowerFrame(),this.resetRailings()}nonEssentialProperties(){return[...super.nonEssentialProperties(),"__gradeHintHelper","_railingCollections"]}}},34330:(e,t,r)=>{const n=r(62989),{PropertiesCollection:i,EditableProperty:s}=r(7340),{extend:o}=r(50988),{simpleObserver:a}=r(50988),l=r(7524),c=r(25830),u=r(67251),d=r(26861),h=r(39927),p=r(88677),m=r(88880),f=r(80317),g=r(1120),y="#dda978";class DockDesignerAppProject extends l{get materials(){return g}frames(){return this.componentsForRoles(f.DOCK,f.FLOATING_DOCK)}platforms(){return[...this.frames(),...this.componentsForRoles(f.OBSTACLE)]}_railingEdgeSources(){return this.gangways()}logo(){return"dock-designer-app-logo.png"}watermarkLogo(){return"dock-designer-app-watermark.png"}watermarkAlpha(){return.03}pdfDocumentClass(){return n}railingCollectionClass(){return u}defaultDisplayProperties(){return new i(this,[...super.defaultDisplayProperties(),new s(this,"Post Type",{type:"select",choices:this.postTypeChoices()}),new s(this,"Post Position",{label:"Post Lateral Position",type:"select",choices:this.postPositionChoices()}),new s(this,"Post Vertical Position",{type:"select",choices:this.postVerticalPositionChoices()}),new s(this,"Split Pile Caps Enabled",{type:"boolean",label:"Use Cross Supports"}),...this._namespacedProperties(this.postColorSource(),"Post"),...this._namespacedProperties(this.framingColorSource(),"Framing"),...this._namespacedProperties(this.deckingColorSource(),"Decking"),new s(this,"Reset Colors",{type:"action",perform:()=>this.resetColors()})])}_namespacedProperties(e,t){return e.displayProperties().map((e=>e.namespace(t)))}color(){return this.deckingColorSource().color()}_createColorSource(){return new p(y)}postColorSource(){return this._postColorSource??=this._createColorSource()}framingColorSource(){return this._framingColorSource??=this._createColorSource()}deckingColorSource(){return this._deckingColorSource??=this._createColorSource()}resetColors(){this.postColorSource().setColor(y),this.framingColorSource().setColor(y),this.deckingColorSource().setColor(y),this.displayProperties().forEach((e=>e.update()))}postType(){return this._postType??=this.postTypeChoices().first()}setPostType(e){this._postType=e,this.notifyProjectDockPropertyChangedObservers()}postTypeChoices(){return this._postTypeChoices??=this._defaultPostTypeChoices()}_defaultPostTypeChoices(){return m.availablePostTypes()}postPosition(){return this._postPosition??=h.inboard}setPostPosition(e){this._postPosition=e,this.notifyProjectDockPropertyChangedObservers()}postPositionChoices(){return this._postPositionChoices??=this._defaultPostPositionChoices()}_defaultPostPositionChoices(){return Object.values(h)}postVerticalPosition(){return this._postVerticalPosition??=d.belowDecking}setPostVerticalPosition(e){this._postVerticalPosition=e,this.notifyProjectDockPropertyChangedObservers()}postVerticalPositionChoices(){return this._postVerticalPositionChoices??=this._defaultpostVerticalPositionChoices()}_defaultpostVerticalPositionChoices(){return Object.values(d)}splitPileCapsEnabled(){return this._splitPileCapsEnabled??=!0}setSplitPileCapsEnabled(e){this._splitPileCapsEnabled=e}toggleSplitPileCapsEnabled(){this._splitPileCapsEnabled=!this.splitPileCapsEnabled()}setDeckingOption(e){super.setDeckingOption(e),this.notifyProjectDockPropertyChangedObservers()}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_postPositionChoices","_postTypeChoices","_projectDockPropertyChangedObservers"]}}o(DockDesignerAppProject,c),a(DockDesignerAppProject,"projectDockPropertyChanged"),e.exports=DockDesignerAppProject},42318:(e,t,r)=>{const n=r(63348);e.exports=class DockDesignerAppAccessory extends n{materialIdentifiers(){return["aluminum"]}zLevel(){return this.referencePoint().z()-1}}},46317:(e,t,r)=>{const n=r(6556),i=r(66886);e.exports=class DockDesignerAppBoatLift extends i{static displayName(){return"Lift"}static iconName(){return"boat-lift-sling"}_modelIdentifier(){return"generic-sling-boat-lift"}materialIdentifiers(){return["aluminum","white-plastic","steel"]}selfMaterialLineItems(){return[new n(1,this.materials.Lift)]}}},87675:(e,t,r)=>{const n=r(6556),i=r(42318),s=r(80317);e.exports=class DockDesignerAppCleat extends i{static displayName(){return"Cleat"}static iconName(){return"cleat"}static role(){return s.CLEAT}modelIdentifier(){return"generic-cleat"}selfMaterialLineItems(){return[new n(1,this.materials.Cleat)]}}},24625:(e,t,r)=>{const n=r(6556),i=r(42318);e.exports=class DockDesignerAppLadder extends i{static displayName(){return"Ladder"}static iconName(){return"ladder"}modelIdentifier(){return"generic-dock-ladder"}selfMaterialLineItems(){return[new n(1,this.materials.Ladder)]}}},44872:(e,t,r)=>{const n=r(96797),i=r(39759);e.exports=Object.freeze({Boards:n,Grate:i})},39759:(e,t,r)=>{const{Polygon:n,FixedEdgeLocator:i}=r(62048),s=r(96797),o=r(83465);e.exports=class DockDesignerAppGrateDeckingSurface extends s{defaultBoards(){const e=this.deckingEdges(),t=new i(e.first(),1),r=new i(e.last(),-1),s=this.frame().geometry().normal(),a=new o(t,r,this.materialSpecifier(),void 0,s),l=e.flatMap((e=>e.endpoints())),c=new n(l.reverse());return a.setShape(c),a.setComponentOf(this),this._setColorSource(a),[a]}}},32097:(e,t,r)=>{const{extend:n}=r(50988),i=r(91296),s=r(6364),o=r(25642);class DockDesignerAppFloatingDock extends i{materialSpecifier(){return this.materials.FloatingDockSurfaceArea}_accessoryEdgeInset(){return this.framingDescriptor().bandingSpecifier().details().width.toNumeric(this.unit())}dockAccessorySnappingEdges(){return this.edges().map((e=>{const t=this._accessoryEdgeInset();return e.shiftedAlongNormalBy(-t).relativeToEdge(e)}))}angleChanged(e,t,r){super.angleChanged(e,t,r),this.accessories().forEach((e=>e.locatorSourceChanged()))}includeSkirtBoards(){return this.deckingOption().details().includeSkirtBoards??!1}setComponentOf(e){super.setComponentOf(e),e&&this._registerAsProjectDockPropertyChangedObserver()}updateConnections(){}}n(DockDesignerAppFloatingDock,s),n(DockDesignerAppFloatingDock,o),e.exports=DockDesignerAppFloatingDock},83565:(e,t,r)=>{const{$P:n}=r(62048),i=r(95369),s=r(39927);e.exports=class DockDesignerAppFramingDescriptor extends i{_postWidth(){return this.materialWidth(this.postSpecifier())}useInboardPostPosition(){return this.dock().postPosition().equals(s.inboard)}_postZOffset(){return-this.dock().postHeightAboveDeck()}interiorPostVerticalOffset(){return super.interiorPostVerticalOffset()+this.dock().postHeightAboveDeck()+this.deckThickness()}postOffset(){return this.useInboardPostPosition()?super.postOffset():this.outboardPostOffset()}outboardPostOffset(){const e=this._postWidth();return n(-e/2,e,this._postZOffset())}splitPileCapOffset(){return this.useInboardPostPosition()?super.splitPileCapOffset():this.outboardSplitPileCapOffset()}outboardSplitPileCapOffset(){const e=this.materialDepth(this.splitPileCapSpecifier()),t=this.materialDepth(this.joistSpecifier()),r=this._postWidth();return n(0,r,this.baseZOffset()+t+e)}}},4748:(e,t,r)=>{const n=r(63768),{extend:i}=r(50988),{PropertiesCollection:s,EditableProperty:o}=r(7340),a=r(5163),l=r(6364),c=r(87991),u=r(25642),d=r(83565);class DockDesignerAppTimberDock extends a{defaultDisplayProperties(){return new s(this,[new o(this,"Width",{type:"unit",defaultUnit:"ft",ignoreIntermediateEdits:!0}),new o(this,"Length",{type:"unit",defaultUnit:"ft",ignoreIntermediateEdits:!0}),new o(this,"Height",{type:"unit",defaultUnit:"ft",ignoreIntermediateEdits:!0})])}_defaultFramingDescriptor(){return new d(this)}includeSkirtBoards(){return this.postPosition().details().compatibleWithSkirtBoards}_defaultPosts(){const e=super._defaultPosts(),t=this.project().docks().filter((e=>e!=this)),r=e.filter((e=>(e=>t.some((t=>t.geometry().xy().containsPoint(e.locator().xy()))))(e)));return this._adjustVerticalPositionOfPosts(r),e}_adjustVerticalPositionOfPosts(e){const t=this.framingDescriptor().interiorPostVerticalOffset(),r=n.unit(t,this.unit());e.forEach((e=>e.setVerticalOffset(r)))}postPosition(){return this.project().postPosition()}postHeightAboveDeck(){return this.project().postVerticalPosition().details().postHeightAboveDeck.toNumeric(this.unit())}formatWidth(){return this.project().lengthFormatter().format(this.width())}formatLength(){return this.project().lengthFormatter().format(this.length())}angleChanged(e,t,r){super.angleChanged(e,t,r),this.accessories().forEach((e=>e.locatorSourceChanged()))}crossBracing(){return[]}_hasSplitPileCaps(){return this.project().splitPileCapsEnabled()}splitPileCaps(){return this._hasSplitPileCaps()?super.splitPileCaps():[]}materialSpecifier(){return this.materials.DockSurfaceArea}annotationDistance(){return 50}postType(){return this.project().postType()}postClass(){return this.postType().postClass()}postSpecifier(){return this.postType().material()}setComponentOf(e){super.setComponentOf(e),e&&this._registerAsProjectDockPropertyChangedObserver()}resetPosts(){this._posts=void 0}resetConnectedFrames(){this._connectedFrames=void 0}connectedFrames(){return this._connectedFrames??=[]}didSnapToFrame(e){this.connectedFrames().push(e),this.resetPosts()}prepareForMove(){this.connectedFrames().forEach((e=>e.resetPosts())),this.resetConnectedFrames(),this.resetPosts()}}i(DockDesignerAppTimberDock,c),i(DockDesignerAppTimberDock,l),i(DockDesignerAppTimberDock,u),e.exports=DockDesignerAppTimberDock},98870:(e,t,r)=>{const n=r(63768),{$P:i,Polygon:s}=r(62048),o=r(4748),a=r(44103),l=r(76133),c=r(80317);e.exports=class DockDesignerAppTriangularDock extends o{static builder(e){return new a(e,this)}static defaultWidth(){return n.unit(4,"ft")}static defaultLength(){return n.unit(4,"ft")}static iconName(){return"dock-triangle"}static displayName(){return"Dock Triangle"}materialSpecifier(){return this.materials.DockTriangleSurfaceArea}validateDimension(e,t){if(!e)return;const r=this.minimumSpan().rounded();return Math.round(t.toNumeric(this.unit()))<r?`Cannot be less than ${r} ${this.unit()}`:void 0}validateWidth(e,t){return this.validateDimension(e,t)}validateLength(e,t){return this.validateDimension(e,t)}static defaultPolygon(e){const t=this.defaultWidth().toNumeric(e.unit()),r=this.defaultLength().toNumeric(e.unit());return new s([i(0,0),i(t,0),i(0,r)])}_vertexA(){return this.vertices().first()}_vertexB(){return this.vertices()[1]}_vertexC(){return this.vertices().last()}_edgeBA(){return this._vertexB().to(this._vertexA())}_edgeBC(){return this._vertexB().to(this._vertexC())}hypoteneuse(){return this._edgeBC()}altitudeEdge(){const e=this._edgeBA().vector().dot(this.hypoteneuse().direction()),t=this.hypoteneuse().direction().multipliedBy(e);return this._vertexB().movedBy(t.x(),t.y()).to(this._vertexA())}_edgeOppositeHypoteneuse(){const e=this.hypoteneuse(),t=this.altitudeEdge().vector();return e.movedBy(t.x(),t.y()).reversed()}framingBeginEdge(){const e=this._vertexC(),t=this.altitudeEdge().vector(),r=e.movedBy(t.x(),t.y());return e.to(r).relativeToEdge(this.hypoteneuse())}framingEndEdge(){const e=this.framingBeginEdge(),t=this.hypoteneuse(),r=e.normal().negated().multipliedBy(t.length());return this.framingBeginEdge().movedBy(r.x(),r.y()).reversed().relativeToEdge(e)}framingEndEdgePairs(){return[{edges:[this.hypoteneuse(),this._edgeOppositeHypoteneuse()]}]}cutBoardsToFit(){return!0}includeSkirtBoards(){return!0}skirtBoardEdges(){const e=2*this._joistWidthNumeric();return this.insetGeometry(e).edges().map((e=>e.movedBy(0,0,this._joistWidthNumeric()))).map((e=>e.relativeTo(this.referencePoint())))}joistSpecifier(){return this.dockFramer().descriptor.joistSpecifier()}_joistWidthNumeric(){return this.joistSpecifier().details().width.toNumeric(this.unit())}skirtBoardSpecifier(){return this.joistSpecifier()}insetGeometry(e=this._joistWidthNumeric()){return l.stretchedBy(this.geometry(),-e).relatedTo(this.referencePoint())}joistCrosscuttingGeometry(){return this.insetGeometry()}components(){return[this.surface(),...this.joists()]}deckingEdges(){return this.geometry().edges()}dockAccessorySnappingEdges(){return[]}movableEdges(){const e=this.geometry().edges();return[e.first(),e.last()]}slipHandleLocators(){return[]}snapToFramesFilter(){return e=>[c.FLOATING_DOCK,c.DOCK].includes(e.role())}didSnapToFrame(e){this.setHeight(e.height())}}},88880:(e,t,r)=>{const n=r(90218),i=r(10765),s=r(34143),{lumber:o}=r(71181),a=r(1120),l={post:i,"post-small":i,pile:s,"pile-small":s};class DockPostType extends n{static availablePostTypes(){return[new DockPostType("Square","post",o.PT6x6),new DockPostType("Square (small)","post-small",o.PT4x4),new DockPostType("Round","pile",a.Pile),new DockPostType("Round (small)","pile-small",a.SmallPile)]}constructor(e,t,r){super(e),this._material=r,this._postClassKey=t}get postClassKey(){return this._postClassKey}postClass(){return l[this.postClassKey]}material(){return this._material}}e.exports=DockPostType},39927:(e,t,r)=>{const n=r(90218);e.exports=Object.freeze({inboard:new n("Inboard",{compatibleWithSkirtBoards:!0}),outboard:new n("Outboard",{compatibleWithSkirtBoards:!1})})},26861:(e,t,r)=>{const n=r(63768),{lumber:i}=r(93613),s=r(90218);e.exports=Object.freeze({aboveDecking:new s("Above Decking",{postHeightAboveDeck:n.unit(42,"in")}),belowDecking:new s("Below Decking",{postHeightAboveDeck:n.multiply(-1,i.PT2x6.details().width)})})},10594:(e,t,r)=>{const{EditableProperty:n}=r(7340),i=r(76983),s=r(92910),o=r(47910),a=r(63768);e.exports=class CircularObjectStrategy extends s{constructor(e=6){super(),this._geometryStrategy=new i(e)}buildGeometry(e){this.geometryStrategy().buildGeometry(e.referencePoint(),e.zLevel())}minimumSpan(){return a.unit(0,"angstroms")}vertices(e){return this._polygonGeometry(e).vertices()}_polygonGeometry(e){return e.geometry().toPolygon(300)}setFigureHandles(e,t){e.setSelfHandle(new o(e));const r=t.geometry();e.setOtherHandles([this._handleForLocator(r.radialLocator(),e)])}displayProperties(e){return[new n(e,"Width",{label:"Diameter",type:"unit",defaultUnit:"ft"})]}}},4103:(e,t,r)=>{const n=r(63768),{extend:i}=r(50988),{EditableProperty:s,StableID:o}=r(7340),{MaterialSpecifier:a}=r(93613),{$P:l}=r(62048),c=r(88677),u=r(10594),d=r(94263),h=r(42638),p=r(80299),m=r(90218),f=r(55848),g=r(59663),y=r(15162),b=r(42947),v=r(80317);class GenericObject extends f{static builder(){return{build:e=>new GenericObject}}static iconName(){return"rectangle"}role(){return v.OBSTACLE}allowsArbitraryRotationAngles(){return!0}objectStrategy(){return this._objectStrategy??=this.objectStrategyChoices().first()}setObjectStrategy(e){this._objectStrategy=e,this.reset(),this.resetDisplayProperties()}objectStrategyChoices(){return[new p,new y,new u]}stackingBehavior(){return this._stackingBehavior??=this.stackingChoices().first()}setStackingBehavior(e){this._stackingBehavior=e,this.resetBottomLocator()}shouldStack(){return this.stackingBehavior().details().shouldStack}stackingChoices(){return[new m("Stack",{shouldStack:!0}),new m("Pass through",{shouldStack:!1})]}colorSource(){return this._colorSource??=this._defaultColorSource()}_colorFromProject(){if(this.project())return this.project().color?.()}_defaultColorSource(){const e=this._colorFromProject()||"#dddddd";return new c(e)}geometryStrategy(){return this.objectStrategy().geometryStrategy()}reset(){this.resetGeometry(),this._annotations=void 0}resetBottomLocator(){this._bottomLocator=void 0}referencePoint(){return this._referencePoint??=l(0,0,this.zLevel())}moveBy(e,t,r){const n=super.moveBy(e,t,r);return n&&this.resetBottomLocator(),n}topLocator(){return this.referencePoint()}bottomLocator(){return this._bottomLocator??=this._defaultBottomLocator()}_obstructingPlatform(){if(this.shouldStack())return this.project().platforms().filter((e=>e!==this)).filter((e=>e.zLevel()>this.zLevel())).filter((e=>e.geometry().xy().containsPoint(this.topLocator().xy()))).reduce(((e,t)=>void 0===e||n.larger(t.height(),e.height())?t:e),void 0)}_heightAbovePlatform(e){return-(this.zLevel()-e.zLevel())}_unobstructedTotalHeight(){return this.height().toNumeric(this.unit())+this._defaultDepthNumeric()}_defaultDepthNumeric(){return n.unit(5,"ft").toNumeric(this.unit())}_defaultBottomLocator(){const e=this._obstructingPlatform(),t=e?this._heightAbovePlatform(e):this._unobstructedTotalHeight();return this.topLocator().addZ(t)}components(){return[]}zLevel(){return-this.height().toNumeric(this.unit())}vertices(){return this.objectStrategy().vertices(this)}boundingCube(){return this.shape3D().boundingCube()}height(){return this._height??=n.unit(12,"in")}setHeight(e){const t=this._height.toNumeric(this.unit()),r=e.toNumeric(this.unit())-t;this.moveBy(0,0,-r),this._height=e}totalHeightNumeric(){return this.bottomLocator().z()-this.topLocator().z()}formatWidth(){return this.project().lengthFormatter().format(this.width())}formatLength(){return this.project().lengthFormatter().format(this.length())}formatHeight(){return this.project().lengthFormatter().format(this.height())}validateDimension(e,t,r=this.objectStrategy().minimumSpan()){if(e)return n.smaller(t,r)?`must be larger than ${r.toString()}`:void 0}validateWidth(e,t){return this.validateDimension(e,t)}validateLength(e,t){return this.validateDimension(e,t)}validateHeight(e,t){return this.validateDimension(e,t,n.unit(0,"ft"))}minimumSpan(e){return this.objectStrategy().minimumSpan().toNumeric(this.unit())}shape3D(){return this.objectStrategy().shape3D(this)}defaultFigure(){const e=new g(this);return this.updateFigureHandles(e),e}fillStyle(){return this.colorSource().color()}strokeStyle(){return this.fillStyle()}color3D(){return this.fillStyle()}updateFigureHandles(e){e.resetHandles(),this.objectStrategy().setFigureHandles(e,this)}threeFigure(){return this.objectStrategy().threeFigure(this)}displayProperties(){return[new s(this,"Description",{type:"text"}),new s(this,"Object Strategy",{label:"Shape",type:"select",choices:this.objectStrategyChoices()}),new s(this,"Stacking Behavior",{type:"select",choices:this.stackingChoices()}),...this.colorSource().displayProperties(),new s(this,"Height",{type:"unit",defaultUnit:"ft"}),...this.objectStrategy().displayProperties(this)]}description(){return this._description??="Object"}setDescription(e){this._description=e}materialSpecifier(){return new a(`GenericObject-${this.stableID()}`,this.description())}price(){return this._price??=0}setPrice(e){this._price=e}priceProperty(){return this._priceProperty??=new s(this,"Price",{type:"number"})}selfMaterialLineItems(){return[d.builder(this.materialSpecifier()).propertiesCollection({[b.amount]:this.priceProperty()}).quantity(1).build()]}async clone(){const e=await super.clone();return e._stableID=void 0,e}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_priceProperty"]}}e.exports=GenericObject,i(GenericObject,h),i(GenericObject,o)},92910:(e,t,r)=>{const n=r(63768),{ExtrudedPolygon:i}=r(62048),s=r(19178),o=r(15004);e.exports=class GenericObjectStrategy{geometryStrategy(){return this._geometryStrategy}buildGeometry(e){return this.geometryStrategy().buildGeometry(e.referencePoint(),e.angle(),e.zLevel())}minimumSpan(){return n.unit(1,"ft")}vertices(e){return e.geometry().vertices()}threeFigure(e){return new o(e)}_polygonGeometry(e){return e.geometry()}shape3D(e){const t=this._polygonGeometry(e);return new i(t,e.totalHeightNumeric())}displayProperties(e){return[]}equals(e){return e instanceof this.constructor}get label(){return this.constructor.name.replace("ObjectStrategy","")}get value(){return this}_handleForLocator(e,t,r){const n=new s(e);return n.setSelectableComponent(t.model()),n.setValidWhen(s.VALID_FOR_SELECTED),n}}},80299:(e,t,r)=>{const{EditableProperty:n}=r(7340),i=r(47910),s=r(85438),o=r(16810),a=r(92910),l=r(11288);e.exports=class RectangularObjectStrategy extends a{constructor({width:e=36,length:t=36}={}){super(),this._geometryStrategy=new o(e,t)}setFigureHandles(e,t){e.setSelfHandle(new i(e));const r=t.geometry().vertices();e.setOtherHandles([...r.map((e=>new s(t,e))),...t.edges().map((t=>new l(t,e)))])}displayProperties(e){return[new n(e,"Width",{type:"unit",defaultUnit:"ft"}),new n(e,"Length",{type:"unit",defaultUnit:"ft"})]}}},15162:(e,t,r)=>{const{$P:n}=r(62048),{Polygon:i}=r(62048),s=r(85438),o=r(92910),a=r(11216),l=r(47910);e.exports=class TriangularObjectStrategy extends o{constructor(){super(),this._geometryStrategy=new a(i.regularTriangle(n(0,0),24))}setFigureHandles(e,t){e.setSelfHandle(new l(e));const r=t.geometry().vertices();e.setOtherHandles([...r.map((t=>this._handleForLocator(t,e))),...r.map((e=>new s(t,e)))])}}},1120:(e,t,r)=>{const{MaterialSpecifier:n}=r(93613),i=r(63768),s=[new n("DockSurfaceArea","Dock Surface Area",{lineItemDecimals:2}),new n("DockTriangleSurfaceArea","Dock Triangle Surface Area",{lineItemDecimals:2}),new n("FloatingDockSurfaceArea","Floating Dock Surface Area",{lineItemDecimals:2}),new n("Cleat","Cleat"),new n("Ladder","Ladder"),new n("Lift","Lift"),new n("MetalRoofing","Metal Roofing",{depth:i.unit(.15,"in"),materialName:"metal-roof",color:"#aaaaaa",lineItemDecimals:2}),new n("Shingles","Shingles",{depth:i.unit(.15,"in"),materialName:"shingle",color:"#888888",lineItemDecimals:2}),new n("Pile",'6" PILE',{diameter:i.unit(6,"in"),width:i.unit(6,"in")}),new n("SmallPile",'3" PILE',{diameter:i.unit(3,"in"),width:i.unit(3,"in")})],o={};s.forEach((e=>{o[e.identifier()]=e})),e.exports=o},25642:(e,t,r)=>{const n=r(32398),i=r(44872),s=r(6556),{MissingOverride:o}=r(50988);e.exports=class DockDesignerAppDockMixin{allowsArbitraryRotationAngles(){return!0}componentsMaterialLineItems(){return this.accessories().flatMap((e=>e.materialLineItems?.()??[]))}selfMaterialLineItems(){return[new s(this.area(),this.materialSpecifier())]}materialSpecifier(){throw new o(this,"materialSpecifier")}_defaultSurface(){const e=this.deckingOption().label;return new(0,i[e])(this)}resetSurface(){this._surface=void 0}_woodMaterialName(){return"painted-pressure-treated"}postMaterialNames(){return[this._woodMaterialName()]}framingMaterialName(){return this._woodMaterialName()}postColorSource(){return this.project().postColorSource()}framingColorSource(){return this.project().framingColorSource()}deckingColorSource(){return this.project().deckingColorSource()}postColor(){return this.postColorSource().color()}defaultFigure(){return new n(this)}figureSubModels(){return this.accessories()}annotationDistance(){return 50}_registerAsProjectDockPropertyChangedObserver(){this.project()&&this.project().addProjectDockPropertyChangedObserver(this,this.projectDockPropertyChanged)}postRestorationAction(){this._registerAsProjectDockPropertyChangedObserver()}projectDockPropertyChanged(){this.resetComponents(),this.resetSurface()}}},5229:(e,t,r)=>{const{$P:n}=r(62048),i=r(30202),s=r(20901),o=r(88646);e.exports=class DockDesignerAppCircleExtrusionMaterial extends i{radius(){return this.componentOf().radius()}crossSection(){const e=this.radius().toNumeric(this.unit());return new o([new s(n(0,0).expandedByRadius(e))])}}},67251:(e,t,r)=>{const n=r(86580),i=r(99126),s=r(70164);e.exports=class DockDesignerAppRailingCollection extends n{runClass(){return i}sectionClass(){return s}}},99126:(e,t,r)=>{const n=r(59503);e.exports=class DockDesignerAppRailingRun extends n{}},70164:(e,t,r)=>{const n=r(23525);e.exports=class DockDesignerAppRailingSection extends n{_defaultRails(){const e=this.railLayoutEdge(),t=new(this.topRailClass())(e);return t.setComponentOf(this),[t]}topRailClass(){return this.railingStyle().topRailClass()}postLayoutEdgeInsetHelperClass(){return this.railingStyle().postLayoutEdgeInsetHelperClass()}}},48809:(e,t,r)=>{const n=r(63768),i=r(84155),s=r(80447);e.exports=class DockDesignerAppGangwayRailingBlock extends i{_defaultInfill(){const e=this.railHeight().toNumeric(this.unit()),t=this.infillBaseEdge().addZ(-e),r=new s(t);return r.setComponentOf(this),[r]}railHeight(){return n.divide(this.infillTopHeight(),2)}}},62277:(e,t,r)=>{const{RailingLayoutInsetHelper:n}=r(8423),i=r(63768);e.exports=class DockDesignerAppGangwayPostLayoutEdgeInsetHelper extends n{terminalInset(e){return i.unit(-4,"in")}}},10287:(e,t,r)=>{const n=r(18475),i=r(5229);e.exports=class DockDesignerAppGangwayRailingPost extends n{radius(){return this.railingStyle().railRadius()}extrusionClass(){return i}}},29264:(e,t,r)=>{const n=r(63768),i=r(8514),s=r(48809),o=r(80447),a=r(10287),l=r(62277);e.exports=class DockDesignerAppGangwayRailingStyle extends i{blockClass(){return s}postClass(){return a}topRailClass(){return o}postLayoutEdgeInsetHelperClass(){return l}railRadius(){return n.unit(1,"in")}}},8514:(e,t,r)=>{const{MissingOverride:n}=r(50988),i=r(64463);e.exports=class DockDesignerAppRailingStyle extends i{topRailClass(){return new n(this,"topRailClass")}postLayoutEdgeInsetHelperClass(){return new n(this,"postLayoutEdgeInsetHelperClass")}}},80447:(e,t,r)=>{const n=r(74215),i=r(5229);e.exports=class DockDesignerAppGangwayRail extends n{radius(){return this.componentOf().railingStyle().railRadius()}extrusionClass(){return i}materialLineItems(){return[]}}},76018:(e,t,r)=>{const{extend:n}=r(50988),i=r(17087),s=r(13332);class DockDesignerAppFlatRoof extends i{}n(DockDesignerAppFlatRoof,s),e.exports=DockDesignerAppFlatRoof},90227:(e,t,r)=>{const n=r(63768),i=r(80866),s=r(40292),o=r(76018),a=r(31989),l=r(80317);e.exports=class DockDesignerAppFreeStandingRoof extends i{static defaultWidth(){return n.unit(5,"ft")}static defaultLength(){return n.unit(10,"ft")}allowsArbitraryRotationAngles(){return!0}_defaultRoofTypeOptions(){return[new s,new o]}componentsMaterialLineItems(){return this.roof().materialLineItems()}snapToFramesFilter(){return e=>l.DOCK===e.role()||l.FLOATING_DOCK===e.role()}defaultFigure(){return new a(this)}annotationDistance(){return 20}structureMaterialName(){return"painted-pressure-treated"}_makePile(e,t){const r=e.distanceTo3D(t),i=n.unit(r,this.unit()),s=new(this.pileClass())(e,i,this.pileSpecifier());return s.setComponentOf(this),s}_pileLayoutEdges(){const e=this.pileSpecifier().details().width,t=this.topFrameSpecifier().details().width,r=-(e.toNumeric(this.unit())/2+2*t.toNumeric(this.unit()));return this.sideEdges().map((e=>e.shiftedAlongNormalBy(r).stretchedBy(2*r).relativeToEdge(e)))}pileType(){return this.project().postType()}pileClass(){return this.pileType().postClass()}pileSpecifier(){return this.pileType().material()}postMaterialNames(){return[this.structureMaterialName()]}postColor(){return this.pileColors().first()}setComponentOf(e){super.setComponentOf(e),this._registerAsProjectDockPropertyChangedObserver()}_registerAsProjectDockPropertyChangedObserver(){this.project()&&this.project().addProjectDockPropertyChangedObserver(this,this.projectDockPropertyChanged)}postRestorationAction(){this._registerAsProjectDockPropertyChangedObserver()}projectDockPropertyChanged(){this._resetComponents()}}},40292:(e,t,r)=>{const{extend:n}=r(50988),i=r(48119),s=r(13332);class DockDesignerAppGableRoof extends i{}n(DockDesignerAppGableRoof,s),e.exports=DockDesignerAppGableRoof},13332:e=>{e.exports=class DockDesignerAppRoofMixin{roofMaterialOptions(){const e=this.materials.MetalRoofing,t=this.materials.Shingles;return[{label:this._labelForMaterialSpecifier(e),value:e},{label:this._labelForMaterialSpecifier(t),value:t}]}componentsMaterialLineItems(){return this.roofing().flatMap((e=>e.materialLineItems()))}_labelForMaterialSpecifier(e){const t=this.project().materialDefinitions()[e.identifier()];return t?.Item??e.name()}}},31989:(e,t,r)=>{const n=r(32896),i=r(13541),s=r(89852);e.exports=class DockDesignerAppFreeStandingRoofFigure extends n{_draw(e,t){e._alterAndRestoreAfter((()=>{e.fillStyle=this.fillStyle(),e.strokeStyle=this.strokeStyle(),this._roofIsVisible(t.layerManager)?this._drawRoof(e,t):this._drawStructure(e)}))}_roofIsVisible(e){const t=this._roof();return e.isVisible(t.drawingLayer())}_roof(){return this.model().roof()}_piles(){return this.model().piles()}_framing(){return this.model().topFraming()}_drawRoofShapes(e){this.model().roof().roofPolygons().forEach((t=>e._drawPolygon(t)))}_drawFrameOutline(e){const t=this.model().geometry();e.setLineDash([3,2]),e.fillStyle="transparent",e.strokeStyle=`${this.strokeStyle()}66`,e._drawPolygon(t)}_drawRoof(e,t){this._drawRoofShapes(e,t),this._drawFrameOutline(e)}_drawStructure(e){[...this._piles(),...this._framing()].forEach((t=>{t.defaultFigure().draw(e)}))}fillStyle(){return this.model().roofColor()}strokeStyle(){return this._contrastHexColor(this.fillStyle())}defaultProperties(){return{lineWidth:.3}}handlesAt(e,t,r){return this._roofIsVisible(r.layerManager)?super.handlesAt(e,t,r):[]}resizingHandles(){return this.model().geometry().edges().map((e=>new s(e,this)))}selfHandle(){return new i(this)}}},15963:(e,t,r)=>{const n=r(7524);e.exports=class DocksPreviewProject extends n{configuration(){return this.systemStrategy().configuration()}}},81063:(e,t,r)=>{const n=r(22093),i=r(81625),s=r(13303);class AnchorPlatformBuilder extends n{constructor(e){super(e,i)}build(){const e=this.newGeometryStrategy();return new i(e,this._referencePoint,this._angle,this._heightAboveBank)}}const{width:o,referencePoint:a,angle:l}=n.defaultMethodNames();s(AnchorPlatformBuilder,[o,a,l,"heightAboveBank"]),e.exports=AnchorPlatformBuilder},17455:(e,t,r)=>{const n=r(22093),i=r(13303);class CompositeDockBuilder{constructor(e,t){this._dockClass=t,this._unitProvider=e}build(){return new(0,this._dockClass)(this._referencePoint,this._unitProvider)}}const{referencePoint:s}=n.defaultMethodNames();i(CompositeDockBuilder,[s]),e.exports=CompositeDockBuilder},44241:(e,t,r)=>{const n=r(22093),i=r(13303);class GangwayBuilder extends n{}const{referencePoint:s,angle:o}=n.defaultMethodNames();i(GangwayBuilder,[s,o]),e.exports=GangwayBuilder},79851:(e,t,r)=>{const n=r(63768),{EditableProperty:i}=r(7340),{Composite3DFigure:s}=r(37732),{General:{locatorX:o,locatorY:a},$P:l,PolarCoordinate:c,RelativeLocator:u}=r(62048),{MissingOverride:d,simpleObserver:h}=r(50988),p=r(44241),m=r(84757),f=r(55848),g=r(80317);class AbstractGangway extends f{static role(){return g.GANGWAY}static iconName(){return"gangway"}static builder(e){return new p(e,this)}static displayName(){return"Gangway"}snapToFramesFilter(){return e=>[g.EXISTING_DOCK,g.ANCHOR_PLATFORM].includes(e.role())}snapsToCenter(){return!0}frameResized(){super.frameResized(),this.components().forEach((e=>e.frameChanged?.()))}priceBreakdown(){throw new d(this,"priceBreakdown")}setComponentOf(e){e||this.detachFrames(),super.setComponentOf(e),this._geometry=void 0,e&&this.resetLength()}defaultDisplayProperties(){return[new i(this,"Minimum Grade",{type:"select",choices:this.minimumGradeOptions()})]}_updateDisplayProperties(){this._displayProperties=void 0,this.notifyDisplayPropertiesChangedObservers()}attachUpperFrame(e){this.upperFrame()&&(this._stopObservingUpperFrame(),this.upperFrame().detachGangway(this)),this._upperFrame=e,e.attachGangway(this),this._updateBankSideHeight(),this._updateDisplayProperties(),this._startObservingUpperFrame(),this.notifyFrameAttachmentChangedObservers()}_startObservingUpperFrame(){this.upperFrame().addHeightChangedObserver?.(this,this.upperFrameHeightChanged)}_stopObservingUpperFrame(){this.upperFrame().removeHeightChangedObserver?.(this,this.upperFrameHeightChanged)}upperFrame(){return this._upperFrame}attachLowerFrame(e){this.lowerFrame()&&(this._stopObservingLowerFrame(),this.lowerFrame().detachGangway(this)),this._lowerFrame=e,e.attachGangway(this);const t=this.lowerEdge().begin().snapshot();this._updateDockSideHeight(),this._updateBankSideHeight();const r=this.lowerEdge().begin().subtract(t);e.moveBy(r.x(),r.y()),this._updateDisplayProperties(),this._startObservingLowerFrame(),this.notifyFrameAttachmentChangedObservers()}_startObservingLowerFrame(){this.lowerFrame().addHeightChangedObserver?.(this,this.lowerFrameHeightChanged)}_stopObservingLowerFrame(){this.lowerFrame().removeHeightChangedObserver?.(this,this.lowerFrameHeightChanged)}lowerFrame(){return this._lowerFrame}detachFrame(e){e&&(e===this.upperFrame()&&this.detachUpperFrame(),e===this.lowerFrame()&&this.detachLowerFrame())}detachLowerFrame(){this._lowerFrame&&(this._stopObservingLowerFrame(),this.lowerFrame().detachGangway(this),this._lowerFrame=void 0,this._updateDockSideHeight(),this._updateBankSideHeight(),this._updateDisplayProperties(),this.notifyFrameAttachmentChangedObservers())}detachUpperFrame(){if(!this._upperFrame)return;this._stopObservingUpperFrame(),this.upperFrame().detachGangway(this),this._upperFrame=void 0;const e=this.lowerEdge().begin().snapshot();this._updateBankSideHeight();const t=this.lowerEdge().begin().subtract(e);this.lowerFrame()?.moveBy(t.x(),t.y()),this._updateDisplayProperties(),this.notifyFrameAttachmentChangedObservers()}detachFrames(){this.detachUpperFrame(),this.detachLowerFrame()}locator(){return this.geometry().boundingBox().center()}defaultGeometry(){const e=super.defaultGeometry(),t=this.lowerEdge(e),r=-this.dockHeight().toNumeric(this.unit())-t.center().z();e.moveBy(0,0,r);const n=this._slopeAngleFromDimensions(this._defaultLength(),this.defaultVerticalSpan()),i=this.upperEdge(e);return this.geometryStrategy().tiltGeometry(e,n,t,i),e}angleChanged(e){this.detachFrames(),this.components().forEach((t=>t.setAngle?.(e)))}mainAxis(){return new c(1,this.angle()).rotatedBy(l(0,0),0,-this.slopeAngle())}deckingEdges(){return this.sideEdges()}upperEdge(e){return this.endEdges(e).find((e=>e.direction().dot(this.crossAxis()).isNearTo(-1)))}lowerEdge(e){return this.endEdges(e).find((e=>e.direction().dot(this.crossAxis()).isNearTo(1)))}minimumSpan(){return this.minLength().toNumeric(this.unit())}maximumSpan(){return this.maxLength().toNumeric(this.unit())}setLength(e){const t=n.asin(n.divide(this.verticalSpan(),e)),r=o(e.toNumeric(this.unit()),this.angle(),Math.PI_2-t),i=a(e.toNumeric(this.unit()),this.angle(),Math.PI_2-t),s=new u(this.upperEdge().center(),r,i).subtract(this.lowerEdge().center());return this.lowerEdge().moveBy(s.x(),s.y())}resetLength(){this.setLength(this._defaultLength())}_defaultLength(){throw new d(this,"_defaultLength")}resetWidth(){this.setWidth(this._defaultWidth())}_defaultWidth(){throw new d(this,"_defaultWidth")}bankHeightChanged(e){this._updateDockSideHeight(),this.upperFrame()||this.setBankSideHeight(e)}_updateDockSideHeight(){const e=this.dockHeight().toNumeric(this.unit())-this.dockSideHeight().toNumeric(this.unit());this.vertices().forEach((t=>t.moveBy(0,0,-e)))}_tiltGeometry(e,t,r){return this.geometryStrategy().tiltGeometry(this.geometry(),e,t,r)}setBankSideHeight(e){const t=this._slopeAngleFromDimensions(this.length(),n.subtract(e,this.dockHeight()))-this.slopeAngle();this._tiltGeometry(t,this.lowerEdge(),this.upperEdge()),this.resetLength()}_updateBankSideHeight(){this.setBankSideHeight(this.upperFrame()?.height()??this.bankHeight())}upperFrameHeightChanged(){this.detachLowerFrame(),this._updateDockSideHeight(),this._updateBankSideHeight()}lowerFrameHeightChanged(){this.detachLowerFrame()}dockSideHeight(){return n.unit(-this.lowerEdge().begin().z(),this.unit())}bankSideHeight(){return n.unit(-this.upperEdge().begin().z(),this.unit())}bankHeight(){return this.project()?.bank().height()||n.unit(0,"in")}dockHeight(){const e=this.lowerFrame();return e?e.height():this.fallbackSideDockHeight()}fallbackSideDockHeight(){throw new d(this,"fallbackSideDockHeight")}verticalSpan(){return this._geometry?n.subtract(this.bankSideHeight(),this.dockSideHeight()):this.defaultVerticalSpan()}defaultVerticalSpan(){const e=this.upperFrame()?.height()||this.bankHeight();return n.subtract(e,this.dockHeight())}zLevel(){return-(this.dockHeight().toNumeric(this.unit())+.5*this.verticalSpan().toNumeric(this.unit()))}offsetFromFrameWhenAttached(e){return n.add(e.surface().overhang(),this.surface().overhang())}slopeAngle(){if(!this._geometry)return this._slopeAngleFromDimensions(this._defaultLength());const e=this.geometry().normal().phi();return Math.abs(this.geometry().zLevel())<this.dockHeight().toNumeric(this.unit())?-e:e}_slopeAngleFromDimensions(e,t=this.verticalSpan()){const r=n.asin(n.divide(t,e));return r.isComplex?89.9.degreesToRadians():r}minimumGradeOptions(){return[{label:"Wheelchair Friendly - 1:12",value:1/12},{label:"Moderate - 1:6",value:1/6}]}minimumGrade(){return this._minimumGrade||(this._minimumGrade=this.minimumGradeOptions().last().value),this._minimumGrade}setMinimumGrade(e){this._minimumGrade=e,this.resetLength()}offsetWithOverhang(e){return e}cleanUp(){this.detachFrames()}async clone(){const e=await super.clone();return this.upperFrame()&&e.attachUpperFrame(this.upperFrame()),this.lowerFrame()&&e.attachLowerFrame(this.lowerFrame()),e.setMinimumGrade(this.minimumGrade()),e}surfaceType(){throw new d(this,"surfaceType")}components(){return[]}threeFigure(){return s.withModel(this)}defaultFigure(){return new m(this)}postRestorationAction(){this.upperFrame()&&this._startObservingUpperFrame(),this.lowerFrame()&&this._startObservingLowerFrame()}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_frameAttachmentChangedObservers","_surface"]}}h(AbstractGangway,"frameAttachmentChanged"),e.exports=AbstractGangway},61820:(e,t,r)=>{const n=r(63768),{PlanarNormalToEdgeLocator:i,ProportionalEdgeLocator:s}=r(62048),o=r(14098),a=r(79851),l=r(21065),c=r(18974);e.exports=class AluminumGangway extends a{static displayName(){return"Aluminum Gangway"}static defaultWidth(){return n.unit(3,"ft")}static defaultLength(){return n.unit(14,"ft")}snapsToCenter(){return!1}surfaceType(){return l.Aluminum}priceBreakdown(){return this.systemStrategy().aluminumGangwayPriceBreakdown(this)}_defaultWidth(){return n.unit(3,"ft")}_defaultLength(){return this.minimumLength()}minimumLength(){return n.max(this.constructor.defaultLength(),this._minLengthByGrade())}_minLengthByGrade(){return n.divide(this.verticalSpan(),this.minimumGrade())}maximumLength(){return n.unit(30,"ft")}minimumSpan(){return this.minimumLength().toNumeric(this.unit())}maximumSpan(){return this.maximumLength().toNumeric(this.unit())}surface(){return this._surface||(this._surface=new o(this)),this._surface}railingSections(){const e=this.geometry().normal(),t=this.surface().frameSpecifier().details().width.toNumeric(this.unit())/2;return this.sideEdges().map((r=>{const n=new i(new s(r,0),e,0,-t),o=new i(new s(r,1),e,0,t),a=new c(n.to(o));return a.setComponentOf(this),a}))}components(){return[this.surface(),...this.railingSections()]}offsetWithOverhang(e){return n.add(this.surface().overhang(),e)}fallbackSideDockHeight(){return n.unit(15,"in")}}},14098:(e,t,r)=>{const n=r(63768),{MaterialSpecifier:i}=r(93613),{ProportionalEdgeLocator:s,PlanarNormalToEdgeLocator:o,Polygon:a}=r(62048),l=r(26852),c=r(16727),u=r(19382);e.exports=class AluminumSurface extends c{depthOfWalkwayFrame(){return this.frame().surfaceFrameDepth?.()||n.unit(2,"in")}depthOfWalkwayMesh(){return this.frame().surfaceMeshThickness?.()||n.unit(.5,"in")}frameThickness(){return this.frame().surfaceFrameThickness?.()||n.unit(3,"in")}frameEdges(){return this.frame().surfaceFrameEdges?.()||this.frame().edges()}frameSpecifier(){return new i("AluminumFrame","Aluminum Frame Section",{width:this.frameThickness(),depth:this.depthOfWalkwayFrame(),materialName:"aluminum"})}walkwayMesh(){return this._walkwayMesh||(this._walkwayMesh=this.defaultWalkwayMesh()),this._walkwayMesh}defaultWalkwayMesh(){const e=new a(this.geometry().edges().map((e=>{const t=new s(e,0),r=this.frameSpecifier().details().width.toNumeric(this.unit())/2;return new o(t,this.geometry().normal(),r,r)})));return new u(e,this.depthOfWalkwayMesh())}walkwayFrame(){return this._walkwayFrame||(this._walkwayFrame=this.defaultWalkwayFrame()),this._walkwayFrame}defaultWalkwayFrame(){const e=this.frameSpecifier(),t=this.geometry().normal(),r=e.details().width.toNumeric(this.unit())/2;return this.frameEdges().map((n=>{const i=this.frame().endEdges().some((e=>e.equals(n)))?-r:r,a=new s(n,0),c=new s(n,1),u=new o(a,t,0,-i),d=new o(c,t,0,i);return new l(u,d,e,0,t)}))}overhang(){return n.multiply(n.divide(this.frameSpecifier().details().width,2),n.cos(this.frame().mainAxis().phi()-Math.PI_2))}resetComponents(){this._walkwayFrame=void 0}components(){return[...this.walkwayFrame(),this.walkwayMesh()]}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_walkwayMesh","_walkwayFrame"]}zLevel(){return this.walkwayMesh().zLevel()}boundingCube(){return this.components().map((e=>e.boundingCube())).reduce(((e,t)=>e.merge(t)))}boundingBox(){return this.components().map((e=>e.boundingBox())).reduce(((e,t)=>e.merge(t)))}}},81625:(e,t,r)=>{const n=r(63768),{$P:i,RelativeZLocator:s}=r(62048),{EditableProperty:o}=r(7340),{lumber:a}=r(93613),{Composite3DFigure:l}=r(37732),{simpleObserver:c}=r(50988),u=r(26716),d=r(21065),h=r(83465),p=r(30217),m=r(80317);let f;class AnchorPlatform extends u{static displayName(){return"Anchor Platform"}static iconName(){return"anchor-platform"}static defaultWidth(){return n.unit(6.5,"ft")}static defaultLength(){return n.unit(8,"ft")}static builder(e){return f||(f=r(81063)),new f(e)}static role(){return m.ANCHOR_PLATFORM}constructor(e,t,r,n){super(e,t,r),this._heightAboveBank=n}defaultDisplayProperties(){const e=[...super.defaultDisplayProperties(),new o(this,"Height Above Bank",{type:"unit",defaultUnit:"in"}),new o(this,"Width",{type:"select",choices:this.sizeOptions(),label:"Size"})];return this.deckingOptionProvider().deckingOption().materialSpecifier()||e.push(new o(this,"Decking Option",{type:"select",choices:this.deckingOptions()})),e}deckingOptionChanged(e){e.materialSpecifier()&&this.setDeckingOption(e),this._displayProperties=void 0,this.notifyDisplayPropertiesChangedObservers()}deckingOptions(){return this.deckingOptionProvider().availableOptions().filter((e=>e.materialSpecifier()))}deckingOption(){if(!this._deckingOption){const e=this.deckingOptionProvider().deckingOption();this._deckingOption=e.materialSpecifier()?e:this.deckingOptions().first()}return this._deckingOption}setDeckingOption(e){this._deckingOption=e}clone(){const e=this.geometryStrategy().clone(),t=this.referencePoint().snapshot(),r=this.geometry().relatedTo(t),n=new this.constructor(e,t,this.angle(),this.heightAboveBank());return n.setGeometry(r),n}sizeOptions(){return[{label:"8' x 6.5'",value:n.unit(6.5,"ft")},{label:"8' x 5'",value:n.unit(5,"ft")}]}setWidth(e){this.attachedGangways().filter((e=>e.surfaceType()===d.Wooden)).forEach((t=>t.setWidth(e))),super.setWidth(e)}setLength(){}bankHeightChanged(e){this._updateHeight()}_updateHeight(){const e=this.height().toNumeric(this.unit());this.vertices().forEach((t=>t.moveBy(0,0,-(e+t.z())))),this._resetPosts(),this.notifyHeightChangedObservers()}bankHeight(){return this.project()?this.project().bank().height():n.unit(0,"ft")}heightAboveBank(){return this._heightAboveBank||(this._heightAboveBank=n.unit(2,"ft")),this._heightAboveBank}setHeightAboveBank(e){this._heightAboveBank=e,this._updateHeight()}height(){return n.add(this.bankHeight(),this.heightAboveBank())}validateHeightAboveBank(e,t){if(e)return n.smaller(t,n.unit(0,"ft"))?"Height can not be less than 0 feet.":void 0}priceBreakdown(){return this.systemStrategy().anchorPlatformPriceBreakdown(this)}angleChanged(e){super.angleChanged(e),this._resetPosts()}posts(){return this._posts||(this._posts=this._defaultPosts()),this._posts}_defaultPosts(){return this.vertices().map(((e,t)=>{const r=this.vertices(),n=r[(t+1)%r.length],o=e.to(n).vector().normalized(),l=this.deckingOption().materialSpecifier().details().width.toNumeric(this.unit()),c=new s(e,l),u=this.bankHeight().toNumeric(this.unit())-e.z(),d=new s(e,u),p=a.PT6x6,m=p.details().width.toNumeric(this.unit())/2,f=new h(c,d,p,i(-m,m),o);return f.setComponentOf(this),f}))}_resetPosts(){this._posts=void 0}resetComponents(){super.resetComponents(),this._resetPosts()}components(){return[...super.components(),this.surface(),...this.posts()]}defaultFigure(){return new p(this)}threeFigure(){return l.withModel(this)}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_posts","_heightChangedObservers"]}}c(AnchorPlatform,"heightChanged"),e.exports=AnchorPlatform},88677:(e,t,r)=>{const{DisplayProperties:n,PropertiesCollection:i,EditableProperty:s}=r(7340),{extend:o}=r(50988);class BoardColorSource{constructor(e){this._color=e}color(){return this._color??="#000000"}setColor(e){this._color=e}defaultDisplayProperties(){return new i(this,[new s(this,"Color",{type:"color"})])}colors(){return[this.color()]}colors2D(){return this.colors()}overrideMaterialColor(){return!0}nonEssentialProperties(){return[...super.nonEssentialProperties(),...n.nonEssentialProperties()]}}o(BoardColorSource,n),e.exports=BoardColorSource},87558:(e,t,r)=>{const n=r(63768).unit,{PlanarNormalToEdgeLocator:i,$P:s}=r(62048),o=r(83465);e.exports=class CollarTie extends o{constructor(e,t,r){super(e.begin(),e.end(),r,void 0,s(0,0,1)),this._pitch=t,this._materialSpecifier=r}pitch(){return this._pitch}length(){const e=this.materialSpecifier().details().depth.toNumeric(this.unit());return n(this.edge().length()+e/this.pitch()*2,this.unit())}width(){return this.materialSpecifier().details().width}depth(){return this.materialSpecifier().details().depth}_extrudeVertices(e,t){const r=s(0,0,1),n=t/this.pitch();return e.map((e=>{const s=e.atEnd()?n:-n;return new i(e,r,0,s,t)}))}}},91211:(e,t,r)=>{const{Composite3DFigure:n}=r(37732),{Polygon:i}=r(62048),{EditableProperty:s}=r(7340),{MissingOverride:o}=r(50988),a=r(26716),l=r(34031),c=r(17455),u=r(80317);e.exports=class CompositeDock extends a{static builder(e){return new c(e,this)}static role(){return u.DOCK}unitProvider(){return this._unitProvider}constructor(e,t){super(void 0,e,void 0),this._unitProvider=t}defaultDisplayProperties(){return[...super.defaultDisplayProperties(),...this.mirroringAllowed()?[new s(this,"Mirror",{type:"action",perform:()=>this.mirror()})]:[]]}mirroringAllowed(){return!0}height(){return this.components().first().height()}setWidth(){}setLength(){}angle(){return Math.THREE_PI_2}setAngle(){}components(){return[...super.components(),...this.baseDocks(),...this.slipDocks()]}priceBreakdown(){throw new o(this,"priceBreakdown")}clone(){return new this.constructor(this.referencePoint().snapshot())}defaultGeometry(){const e=this.components();if(0===e.length)return new i([]);const[t,...r]=e.map((e=>e.geometry()));return t.union(...r).first().relatedTo(this.referencePoint())}bankHeightChanged(e){this.components().forEach((t=>t.bankHeightChanged?.(e)))}deckingOptionChanged(e){this.components().forEach((t=>t.deckingOptionChanged?.(e)))}surfaceOverhang(){return this.components().first().surface().overhang()}mirror(){const e=this.boundingBox().center();this.components().forEach((t=>{const r=e.subtract(t.locator());t.moveBy(2*r.x(),0)})),this._geometry=void 0}slipDocks(){return this._slipDocks||(this._slipDocks=this._buildSlipDocks(),this._setupChildren(this._slipDocks)),this._slipDocks}_buildSlipDocks(){throw new o(this,"_buildSlipDocks")}baseDocks(){return this._baseDocks||(this._baseDocks=this._buildBaseDocks(),this._setupChildren(this._baseDocks)),this._baseDocks}_buildBaseDocks(){throw new o(this,"_buildBaseDocks")}_setupChildren(e){e.forEach((e=>{e.setComponentOf(this)}))}async load(){return Promise.all(this.components().map((e=>e.load?.())))}addHeightChangedObserver(){}removeHeightChangedObserver(){}notifyHeightChangedObservers(){}defaultAnnotations(){return[]}defaultFigure(){return l.withModel(this)}threeFigure(){return n.withModel(this)}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_unitProvider"]}}},94848:(e,t,r)=>{const n=r(5163),i=r(10493),s=r(65684);e.exports=class CutoutDock extends n{static builder(e){return new s(e,this)}_defaultSurface(){return new i(this)}components(){return[this.surface()]}sideEdges(){return super.sideEdges(this.uncutShape())}endEdges(){return super.endEdges(this.uncutShape())}locator(){return this.uncutShape().centroid()}uncutShape(){return this._uncutShape||(this._uncutShape=this.defaultUncutGeometry()),this._uncutShape}defaultUncutGeometry(){const e=this.referencePoint(),t=this.angle(),r=this.zLevel();return this.geometryStrategy().uncutShape(e,t,r)}resetGeometry(){super.resetGeometry(),this._uncutShape=void 0}deckingShape(){return this.geometry()}includeSkirtBoards(){return!1}}},21373:(e,t,r)=>{const n=r(90218);e.exports=class DeckingOption extends n{constructor(e,{description:t,unitPrice:r,materialSpecifier:n,material:i,colors:s,colors2D:o,...a}={}){super(e,a),this._name=e,this._description=t,this._unitPrice=r,this._materialSpecifier=n,this._material=i,this._colors=s,this._colors2D=o}get label(){return this.name()}name(){return this._name}description(){return this._description}unitPrice(){return this._unitPrice}materialSpecifier(){return this._materialSpecifier}material(){return this._material}colors(){return this._colors}colors2D(){return this._colors2D??this.colors()}equals(e){return this.name()===e.name?.()&&this.description()===e.description?.()&&(this.unitPrice()===e.unitPrice?.()||this.unitPrice().equals(e.unitPrice()))&&(t=this.colors()||[],r=e.colors?.()||[],t.length===r.length&&t.every((e=>r.includes(e))));var t,r}}},68772:(e,t,r)=>{const n=r(24421);e.exports=class DeckingOptionProvider extends n{deckingOption(){}availableOptions(){}}},96797:(e,t,r)=>{const n=r(63768),{$P:i,FixedEdgeLocator:s,PlanarNormalToEdgeLocator:o,Polygon:a,ProportionalEdgeLocator:l,ShapeFromVertices:c}=r(62048),{supply:u}=r(50988),d=r(17053),h=r(8994),p=r(83465),m=r(16727);class DeckingSurface extends m{boardGap(){return this.frame().deckingBoardGap?.()??n.unit(3/16,"in")}deckingOption(){return this.frame().deckingOption()}includeSkirtBoards(){return this.frame().includeSkirtBoards?.()??!0}price(){const e=this.deckingOption().unitPrice();return(n.multiply(this.area(),e)*(this.frame().systemStrategy().deckingPriceMargin?.()||1)).roundedTo(2)}area(){return this.frame().area()}deckedArea(){const e=this.deckingEdges().flatMap((e=>[e.begin(),e.end()])),t=new a(e);return n.unit(t.area(),`${this.unit()}^2`)}materialSpecifier(){return this.deckingOption().materialSpecifier()}skirtBoardMaterialSpecifier(){return this.frame().skirtBoardSpecifier?.()||this.materialSpecifier()}vertices(){return this.geometry().vertices()}geometry(){return this.frame().deckingShape()}setAngle(e){this.resetComponents(),this.notifyFrameChangedObservers()}deckingEdges(){return this.frame().deckingEdges?.()||this.frame().sideEdges()}boardSpacing(){const e=this.materialSpecifier(),t=this.boardGap();return n.add(e.details().depth,t)}components(){return[...this.boards(),...this.skirtBoards()]}resetComponents(){this._boards=void 0,this._skirtBoards=void 0}boards(){return this._boards??=this.defaultBoards()}_maxLengthEdge(){const e=this.deckingEdges();return e.reduce(((e,t)=>t.length()>e.length()?t:e),e.first())}_framingBeginEdge(){return this.frame().framingBeginEdge?.()||this.deckingEdges().first()}_framingEndEdge(){return this.frame().framingEndEdge?.()||this.deckingEdges().last()}_frameLength(){return(this.frame().framingBeginEdge?.()||this._maxLengthEdge()).length()}defaultBoards(){const e=this.materialSpecifier(),t=this._frameLength(),r=this.boardSpacing().toNumeric(this.unit()),n=Math.ceil(t/r),i=this.frame().geometry().normal();let o=e.details().depth.toNumeric(this.unit())/2;const a=[];for(let t=0;t<n;t++){const t=new s(this._framingBeginEdge(),o),n=new s(this._framingEndEdge(),-o),l=new p(t,n,e,void 0,i);l.setComponentOf(this),this._setColorSource(l),a.push(l),o+=r}return this._cutBoardsToFitGeometry(a)}_cutBoardsToFitGeometry(e){if(!(this.frame().cutBoardsToFit?.()||!1))return e;const t=e.flatMap((e=>e.cutIntoBoardsFor(this.geometry())));return this.link(t)}_skirtBoardEdges(){return this.frame().skirtBoardEdges?.()||this.frame().edges()}skirtBoards(){return this._skirtBoards??=this.defaultSkirtBoards()}defaultSkirtBoards(){if(!this.includeSkirtBoards())return[];const e=[];return this._skirtBoardEdges().forEach((t=>{const r=this.skirtBoardMaterialSpecifier().details().width.toNumeric(this.unit()),n=this.skirtBoardMaterialSpecifier().details().depth.toNumeric(this.unit()),s=this.frame().geometry().normal(),c=new o(new l(t,0),s,-r,-r),u=new o(new l(t,1),s,-r,r),d=this.deckingOption().details().skirtBoardMaterial,p=new h(c,u,this.skirtBoardMaterialSpecifier(),i(r/2,n/2),s,d);p.setComponentOf(this),this._setColorSource(p);const m=new a([t.begin(),c,u,t.end()]);p.cutTo(m)&&e.push(p)})),e}_setColorSource(e){const t=this.frame().deckingColorSource?.();t&&e.setColorSource(t)}overhang(){return this.includeSkirtBoards()?n.multiply(this.skirtBoardMaterialSpecifier().details().width,n.cos(this.frame().mainAxis().phi()-Math.PI_2)):n.unit(0,"in")}defaultFigure(){return new d(this)}threeFigure(){const e=super.threeFigure();return e.setLayer("Decking"),e}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_boards","_skirtBoards"]}xLevel(){return this.boundingCube().left()}}u(DeckingSurface,c),e.exports=DeckingSurface},10493:(e,t,r)=>{const n=r(96797);e.exports=class DeckingSurfaceWithCutout extends n{deckingShape(){return this.frame().deckingShape()}_cutBoardsToFitGeometry(e){const t=e.flatMap((e=>e.cutIntoBoardsFor(this.deckingShape())));return t.forEach((e=>{e.setComponentOf(this)})),t}}},37528:(e,t,r)=>{const n=r(63768),{ProportionalEdgeLocator:i,$P:s,FixedEdgeLocator:o}=r(62048),{supply:a}=r(50988),l=r(10765),c=r(6437),u=r(73399),d=r(27817);class DefaultDockFramer extends u{dock(){return this.frame()}deckingOptionProvider(){return this.dock().deckingOptionProvider()}framingEdgePairs(){return this.dock().framingEndEdgePairs?.()??this._defaultFramingEdgePairs()}framingEndEdges(){return this.dock().endEdges()}framingSideEdges(){return this.dock().sideEdges()}_defaultFramingEdgePairs(){return[{edges:this.framingEndEdges(),includeEnds:this.shouldIncludeEndJoists(),doubleOnEnd:this.shouldDoubleEndJoists(),doubleOnMiddle:this.shouldDoubleMiddleJoists()}]}_makeJoist(e,t,r,n){return this._makeBoard(e,t,r,n)}postEdges(){const e=this.materialWidth(this.postSpecifier())/2,t=this.postOffset().add(-e,-e);return this.offsetHelper().applyOffsetToGeometry(this.dock().geometry(),t).edges().map((e=>e.relativeTo(this.dock().referencePoint())))}_makePost(e,t){const r=this.postSpecifier();return new(this.postClass())(e,t,r)}postClass(){return this.dock().postClass?.()||l}_makeEdgePosts(){const e=this.dock(),t=this._unit();return this.postEdges().flatMap((r=>{const n=Math.ceil(r.length().roundedTo(0)/this.maxPostSpacing().toNumeric(t)),s=e.constrainedPostPositions?.(r)||[],o=this.minPostSpacing().toNumeric(t)/r.length(),a=[];for(let t=0;t<n;t++){const l=t/n,c=s.find((e=>Math.abs(e-l)<o)),u=new i(r,c??l),d=this.postHeight(),h=this._makePost(u,d);h.setComponentOf(e),a.push(h)}return a}))}_makeInteriorPostsForRow(e,t){const r=n.unit(this.interiorPostVerticalOffset(),this._unit()),i=e.first().locator(),s=e.last().locator(),a=i.to(s),l=e.first().length();return t.map((e=>{const t=new o(a,e),n=this._makePost(t,l);return n.setVerticalOffset(r),n.setComponentOf(this.dock()),n}))}_makeInteriorPosts(e){const t=e.first();if(2===t.length)return[];const r=t.first().locator(),n=t.slice(1,-1).map((e=>r.distanceTo(e.locator())));return e.slice(1,-1).flatMap((e=>this._makeInteriorPostsForRow(e,n)))}makePosts(){const e=this._makeEdgePosts(),t=this.dock().postRows(e),r=this._makeInteriorPosts(t);return[...e,...r]}makeHeaders(){return this.headerEdgePairs().flatMap((e=>this.makeHeadersForEdgePair(e)))}headerEdgePairs(){return this.framingEdgePairs().map((({edges:e})=>e))}makeHeadersForEdgePair(e){const t=this.materialDepth(this.headerSpecifier())/2,r=this.materialWidth(this.headerSpecifier())/2;return this.offsetHelper().applyOffsetToEdges(e,this.headerOffset()).map((e=>this._makeHeader(e,this.headerSpecifier(),s(-t,-r))))}_makeHeader(e,t,r,n){return this._makeBoard(e,t,r,n)}makeSplitPileCaps(){const e=this.dock().postRows(),t=this.splitPileCapSpecifier();return e.flatMap((e=>{const r=e.first().locator().to(e.last().locator());return this._makeEdgesForPostSupports(r,t,this.splitPileCapOffset(),e.first().materialSpecifier()).map((e=>this._makeSplitPileCap(e,t)))}))}_makeSplitPileCap(e,t,r){const n=this.materialDepth(t),i=s(-n/2,0);return this._makeBoard(e,t,i,r)}makeCrossBracing(){const e=this.dock(),t=e.crossAxis(),r=this.crossBracingSpecifier();return e.postRows().flatMap((e=>{e.sort(((e,r)=>r.locator().dot(t)-e.locator().dot(t)));const n=e.first().locator().to(e.last().locator());return e.flatMap(((t,i)=>{const o=e[i+1];if(!o)return;const a=n.closestPointTo(t.locator()).to(n.closestPointTo(o.locator())),l=this._makeEdgesForPostSupports(a,r,this.crossBracingOffset(),o.materialSpecifier()),c=this._crossBraceDropAngle(l,a);if(!c)return;return this._addSlopeToBraceEdges(l,c).map((e=>this._makeCrossBrace(e,r,s(0,0))))}))})).filter((e=>e))}_makeCrossBrace(e,t,r,n){return this._makeBoard(e,t,r,n)}_crossBraceDropAngle(e,t){const r=e.first().begin().z()-this.dock().zLevel(),n=this.dock().project().bank().height().toNumeric(this._unit())+this.dock().height().toNumeric(this._unit())-r,i=t.length();if(!(n/i<Math.tan(Math.PI/6)))return n<i?Math.PI/6:Math.PI_4}_addSlopeToBraceEdges(e,t){const r=this.materialDepth(this.crossBracingSpecifier()),n=Math.sin(t)*r,i=Math.cos(t)*r/2;return e.map((e=>{const r=e.stretchedBy(-n).addZ(i),s=r.length()*Math.tan(t);return r.begin().to(r.end().addZ(s))}))}_makeEdgesForPostSupports(e,t,r,n){const i=this.materialWidth(n)/2+this.materialWidth(t)/2,s=[e.xy().shiftedAlongNormalBy(i),e.xy().shiftedAlongNormalBy(-i).reversed()],o=this.offsetForPostRowEdge().add(r);return this.offsetHelper().applyOffsetToEdges(s,o)}}d(DefaultDockFramer,"framingDescriptor",["postSpecifier","joistSpecifier","headerSpecifier","splitPileCapSpecifier","crossBracingSpecifier","postHeight","maxPostSpacing","minPostSpacing","maxJoistSpacing","deckThickness","materialWidth","materialDepth","postOffset","offsetForPostRowEdge","joistOffset","headerOffset","splitPileCapOffset","crossBracingOffset","shouldIncludeEndJoists","shouldDoubleEndJoists","shouldDoubleMiddleJoists","interiorPostVerticalOffset"]),a(DefaultDockFramer,c),e.exports=DefaultDockFramer},26716:(e,t,r)=>{const n=r(63768),{Composite3DFigure:i}=r(37732),{extend:s,simpleObserver:o,MissingOverride:a}=r(50988),{FixedEdgeLocator:l}=r(62048),c=r(26933),u=r(20632),d=r(96797),h=r(39792),p=r(36887),m=r(61061),f=r(22093),g=r(55848),y=r(80317);class Dock extends g{static defaultWidth(){throw new a(this,"defaultWidth")}static defaultLength(){throw new a(this,"defaultLength")}static builder(e){return new f(e,this)}static iconName(){return"default-dock"}static role(){return y.DOCK}static displayName(){return"Dock"}defaultDisplayProperties(){return[...super.defaultDisplayProperties(),...this.accumulatedDisplayProperties()]}movableEdges(){return this.edges()}cutBoardsToFit(){return!0}priceBreakdown(){throw new a(this,"priceBreakdown")}deckingOptionProvider(){return this.componentOf()?.deckingOptionProvider()}deckingOption(){return this.deckingOptionProvider()?.deckingOption()}snapToFramesFilter(){return e=>[y.DOCK,y.EXISTING_DOCK].includes(e.role())}snapToConnectorsFilter(){return e=>Boolean(this.deckingOption().materialSpecifier())}connectorsShouldSnapToCenter(){return!0}slipHandleLocators(){const e=this.constructor.defaultWidth().toNumeric(this.unit())/2;return this.length().toNumeric(this.unit())<4*e?[]:this.sideEdges().flatMap((t=>[new l(t,e),new l(t,-e),...this._extraSlipHandleLocators(t,e)]))}_extraSlipHandleLocators(e,t){const r=n.floor(n.divide(this.length(),this._maxSlipHandleSegmentLength())),i=this.length().toNumeric(this.unit())/(r+1),s=[];let o=t+i;for(let t=0;t<r;t++)s.push(new l(e,o/2)),s.push(new l(e,-o/2)),o+=i;return s}_maxSlipHandleSegmentLength(){return n.unit(50,"ft")}delete(){this.detachAllGangways(),super.delete()}angleChanged(e){this.detachAllGangways()}deckingEdges(){return this.sideEdges()}height(){return this._height||(this._height=this._defaultHeight()),this._height}_defaultHeight(){throw new a(this,"_defaultHeight")}zLevel(){return-this.height().toNumeric(this.unit())}frameResized(e){super.frameResized(e),this.resetComponents(),this.surface().frameChanged(),this.notifyFrameChangedObservers()}components(){return this.accumulatedComponents()}resetComponents(){this.surface().resetComponents(),this.resetAccumulatedComponents()}minimumLength(){return this.minimumSpan(this.endEdges().first())}minimumWidth(){return this.minimumSpan(this.sideEdges().first())}minimumSpan(){throw new a(this,"minimumSpan")}surface(){return this._surface||(this._surface=this._defaultSurface()),this._surface}_defaultSurface(){return new d(this)}deckingShape(){return this.geometry()}dockFramer(){return this.componentFramer()}clone(){const e=this._baseClone();return this.accumulatedClone(e),e}_baseClone(){const e=this.geometryStrategy().clone(),t=this.referencePoint().snapshot(),r=this.geometry().relatedTo(t),n=new this.constructor(e,t,this.angle());return n.setGeometry(r),n}defaultFigure(){return new h(this)}shouldShowSubstructure(){return!this.deckingOption()?.materialSpecifier()}async load(){return Promise.all(this.components().map((e=>e.load?.())))}threeFigure(){return i.withModel(this)}projectedViewFigure(e,t,r){return c.withModel(this,e,t,r)}snapToUnit(){return this.unit()}surfaceOverhang(){return this.surface().overhang()}includeSkirtBoards(){return!0}nonEssentialProperties(){return[...super.nonEssentialProperties(),...this.accumulatedNonEssentialProperties(),"_frameChangedObservers","_surface","_shape3D"]}}s(Dock,m),s(Dock,p),s(Dock,u),o(Dock,"frameChanged"),e.exports=Dock},63348:(e,t,r)=>{const n=r(63768),{DisplayProperties:i}=r(7340),{extend:s,MissingOverride:o}=r(50988),{RelativeLocator:a,$P:l}=r(62048),{three:c}=r(37732),u=r(57473),d=r(24448),h=r(13534),p=r(80317);class DockAccessory extends u{static disabledToolMessage(){return`Place a dock before placing ${this.displayName()}`}static role(){return p.ACCESSORY}static builder(e){return new h(e,this)}constructor(e=new a(l(0,0))){super(e)}modelIdentifier(){throw new o(this,"modelIdentifier")}_modelIdentifier(){return this.modelIdentifier()}isSelectable(){return!1}role(){return this.constructor.role()}resetModel(){this.resetShape3D(),this._geometryTop=void 0}geometry(){return this.boundingBox()}vertices(){return this.geometry().vertices()}width(){if(!this.shape3D())return n.unit(1,"in");const e=this.referencePoint().edge?.()?.direction()??l(1,0,0),t=this.topProjections().flatMap((t=>t.vertices().map((t=>t.dot(e))))),r=Math.max(...t)-Math.min(...t);return n.unit(r,this.unit())}rotation(){const e=this.referencePoint().edge?.()?.angle()??0,t=new c.Vector3(0,0,1);return(new c.Quaternion).setFromAxisAngle(t,e)}locatorSourceChanged(){this._geometryTop=void 0}detachFromFrame(){this.frame()&&this.frame().detachAccessory(this)}frame(){return this._frame}setFrame(e){this._frame=e}frameFilter(){return e=>!0}delete(){this.detachFromFrame()}cloneToDock(e){const t=e.edges().map((e=>e.closestRelativePointTo(this.locator(),!1))).sort(((e,t)=>e.distanceTo(this.locator())-t.distanceTo(this.locator()))).first(),r=new this.constructor(new a(t));return e.addAccessory(r),r}defaultFigure(){return new d(this)}nonEssentialProperties(){return[...super.nonEssentialProperties(),...i.nonEssentialProperties()]}}s(DockAccessory,i),e.exports=DockAccessory},19702:(e,t,r)=>{const n=r(63768),{DisplayProperties:i,EditableProperty:s}=r(7340),{three:o}=r(37732),{$P:a,Rectangle:l,Polygon:c,FixedEdgeLocator:u}=r(62048),{simpleObserver:d,extend:h,supply:p}=r(50988),m=r(74225),f=r(58190),g=r(22431),y=r(82110),b=r(80365),v=r(76133),_=r(11307),x=r(45641),w=r(83102);let R;const k=1500,j={beachEntry:"Beach Entry",seaWall:"Sea Wall",steepEntry:"Steep Entry"};class DockBank extends w{defaultDisplayProperties(){return[new s(this,"Type",{type:"select",choices:this.typeOptions(),label:"Bank Type"}),new s(this,"Height",{type:"unit",defaultUnit:"in",label:"Bank Height Above Water"})]}type(){return this._type||(this._type=this.typeOptions().first().value),this._type}setType(e){this._type=e}entryAngle(){return this.isBeachEntry()?25..degreesToRadians():this.isSteepEntry()?50..degreesToRadians():this.isSeaWall()?0:void 0}isSeaWall(){return this.type()===j.seaWall}isBeachEntry(){return this.type()===j.beachEntry}isSteepEntry(){return this.type()===j.steepEntry}height(){return this._height||(this._height=n.unit(3,"ft")),this._height}setHeight(e){this._height=e,this.notifyHeightChangedObservers(e)}validateHeight(e,t){if(!e)return;const r=n.unit(30,"ft");return n.smaller(t,n.unit(0,"in"))?"Must be greater than 0":n.larger(t,r)?`Must be less than ${r.toString()}`:void 0}typeOptions(){return Object.values(j).map((e=>({label:e,value:e})))}shoreLine(){R||(R=r(32083));const e=this.systemStrategy().bankOffsetY?.()??R.defaultBankOffsetY();return a(0,e)}geometry(){return new l(this.shoreLine(),void 0,0,0)}boundingBox(){return new x(1/0,this.shoreLine().y(),-1/0,this.shoreLine().y())}bankWidth(){const e=this.componentOf().drawing().boundingBox(),t=Math.max(e.width(),e.height());return n.unit(t+k,"in")}defaultFigure(){return new y(this)}threeFigure(){return new f(this)}seaWall(){if(this.isSeaWall())return this._seaWall||(this._seaWall=new _,this._seaWall.setComponentOf(this)),this._seaWall;this._seaWall=void 0}components(){return[this.seaWall()].filter((e=>e))}shape3D(){return this.shoreGeometry()}baseBounds(){const e=this.componentOf().drawing().boundingBox(),t=Math.max(e.width(),e.height());return e.center().expandedBy(t+k)}bounds(){const e=this.baseBounds();return this.controlPoints().length>0?e.merge(new c(this.controlPoints().map((e=>e.locator()))).boundingBox()):e}shoreGeometry(){const e=this.bounds(),t=this.height().toNumeric(this.unit()),r=this.isBeachEntry()?1.5:this.isSteepEntry()?4:void 0,n=-(this.seaWall()?.width().toNumeric(this.unit())??0);let i;i=this.seaWall()?new o.Vector2(t,this.seaWall().width().toNumeric(this.unit())+n):new o.Vector2(.8*t,100/r+n);const s=new o.Shape;s.moveTo(1.05*t,this.bankWidth().toNumeric(this.unit())+n),s.lineTo(1.05*t,200+n),s.splineThru([new o.Vector2(1.05*t,100+n),i,new o.Vector2(0,0+n),new o.Vector2(.8*-t,-(r?100/r:50)+n),new o.Vector2(-t,-100+n)]),s.lineTo(-t,e.topLeft().y()+n),s.lineTo(-(t+10),e.topLeft().y()+n),s.lineTo(-(t+10),this.bankWidth().toNumeric(this.unit())+n);return new o.ExtrudeGeometry(s,{curveSegments:5,steps:this.pathSteps(),extrudePath:this.extrusionPath(e)})}pathSteps(){return(this.bounds().width()/3).rounded()}extrusionPath(e,t){return new m(this.controlPointsFor(e,t),this.extrusionDirection().toThreeJS(),new o.Vector3(0,1,0),.2)}controlPoints(){return this._controlPoints??=this._defaultControlPoints()}_defaultControlPoints(){const e=this.shoreLine().y(),t=a(this.baseBounds().left(),e),r=a(this.baseBounds().right(),e),i=t.to(r),s=this.equallySpacedDistances(i.length().rounded(),n.unit(20,"ft")).map((e=>new g(new u(i,e).snapshot())));return s.forEach((e=>e.setComponentOf(this))),s}removeControlPoint(e){this.controlPoints().remove(e)}addControlPoint(e){e.setComponentOf(this),this.controlPoints().push(e);const t=this.extrusionDirection();this.controlPoints().sort(((e,r)=>e.locator().dot(t)-r.locator().dot(t)))}resetControlPoints(){this._controlPoints=void 0}extrusionDirection(){return a(1,0)}controlPointsFor(e,t=!0){const r=this.bounds().merge(e),n=this.controlPoints().map((e=>e.locator())),i=this.extrusionDirection(),s=this.shoreLine().y();let o=[a(r.left(),s),...n,a(r.right(),s)].uniqueValues().sort(((e,t)=>(t.dot(i)-e.dot(i)).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES))).reverse();if(t&&this.seaWall()){const e=this.seaWall().width().toNumeric(this.unit()),t=o.map((e=>e.snapshot())),r=new c([...t,t.last().add(0,e),t.first().add(0,e)]);o=v.stretchedBy(r,2*-e).vertices().slice(0,-2)}return o.map((e=>e.toThreeJS()))}primaryDirection(){return a(-1,0,0)}nonEssentialProperties(){return[...super.nonEssentialProperties(),...i.nonEssentialProperties(),"_heightChangedObservers","_mesh"]}xLevel(){return this.componentOf().boundingCube().right()+10}}d(DockBank,"heightChanged"),h(DockBank,i),p(DockBank,b),DockBank.BANK_SIZE=k,DockBank.TYPES=j,e.exports=DockBank},22431:(e,t,r)=>{const n=r(83102);e.exports=class DockBankControlPoint extends n{constructor(e){super(),this._locator=e}locator(){return this._locator}includedInControlPoints(){return this.componentOf().controlPoints()?.includes(this)}delete(){this.componentOf()?.removeControlPoint(this)}}},57100:(e,t,r)=>{const n=r(63768),{Polygon:i}=r(62048),s=r(54798),o=r(30691);e.exports=class DockConnection extends s{constructor(e,t){super(),this._docks=e,this._edges=t}docks(){return this._docks}edges(){return this._edges}geometry(){return this._geometry??=this._defaultGeometry()}connectionWidth(){return n.unit(3,"in")}_defaultGeometry(){let e=o.overlappingEdgeSegments(this.edges());if(e.first().overlaps(e.last())){const t=this.connectionWidth().toNumeric(this.unit())/2;e=[e.first().shiftedAlongNormalBy(-t),e.first().shiftedAlongNormalBy(t)]}return new i([e.last().begin(),e.last().end(),e.first().end(),e.first().begin()]).relatedTo(this.edges().first().begin())}vertices(){return this.geometry().vertices()}isDeleteable(){return!1}isSelectable(){return!1}clone(){}delete(){this.docks().forEach((e=>e.removeConnection(this)))}isStale(){const e=o.overlappingEdgeSegments(this.edges()),t=this.staleTolerance().toNumeric(this.unit());return 0===e.length||e.first().center().distanceTo(e.last().center()).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES)>t}staleTolerance(){return n.unit(0,"ft")}update(){this._geometry=void 0,this.docks().forEach((e=>e.connectionsChanged()))}sideEdges(){return this.geometry().edges().filter((e=>Math.abs(e.direction().dot(this.mainAxis())).isNearTo(1)))}endEdges(){return this.geometry().edges().filter((e=>Math.abs(e.direction().dot(this.crossAxis())).isNearTo(1)))}mainAxis(){return this.edges().first().direction()}crossAxis(){return this.edges().first().normal()}isConnectionSideToSide(){return this.edges().every(((e,t)=>this.docks()[t].alongMainAxis(e.vector())))}isConnectionEndToEnd(){return this.edges().every(((e,t)=>this.docks()[t].alongCrossAxis(e.vector())))}isConnectionEndToSide(){return this.docks().first().mainAxis().dot(this.docks().last().mainAxis()).isNearTo(0)}isMajorDock(e){const t=this.docks().indexOf(e),r=this.edges()[t],n=this.edges().find((e=>e!==r)),i=r.length().isNearTo(n.length());return!i&&r.length()>n.length()||i&&0===t}isMinorDock(e){return!this.isMajorDock(e)}otherDock(e){return this.docks().find((t=>t!==e))}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_geometry"]}}},7524:(e,t,r)=>{const{EditableProperty:n}=r(7340),{Rectangle:i,$P:s}=r(62048),{extend:o}=r(50988),a=r(20632),l=r(19702),c=r(73164),u=r(6706),d=r(80317);class DockDesignerProject extends c{static type(){return"dock"}defaultDisplayProperties(){return[...super.defaultDisplayProperties(),...this.deckingOptions().length>1?[new n(this,"Decking Option",{type:"select",choices:this.deckingOptions()})]:[],...this.bank().displayProperties()]}components(){return[...super.components(),this.bank(),...this.accumulatedComponents()]}docks(){return this.componentsForRoles(d.DOCK,d.EXISTING_DOCK,d.FLOATING_DOCK)}frames(){return this.componentsForRoles(d.DOCK,d.EXISTING_DOCK,d.ANCHOR_PLATFORM)}framingLevelFoundations(){return this.frames()}existingDocks(){return this.componentsForRoles(d.EXISTING_DOCK)}gangways(){return this.componentsForRoles(d.GANGWAY)}connectors(){return this.gangways()}anchorPlatforms(){return this.componentsForRoles(d.ANCHOR_PLATFORM)}cleats(){return this.componentsForRoles(d.CLEAT)}bankHeightChanged(e){this.parts().forEach((t=>t.bankHeightChanged?.(e)))}bank(){return this._bank||(this._bank=new l,this._bank.setComponentOf(this),this._bank.addHeightChangedObserver(this,this.bankHeightChanged)),this._bank}deckingOptionProvider(){return this}deckingOptions(){return this.systemStrategy().deckingOptions()}availableOptions(){return this.deckingOptions()}deckingOption(){return this._deckingOption||(this._deckingOption=this.deckingOptions().first()),this._deckingOption}setDeckingOption(e){this._deckingOption=e,this.parts().forEach((t=>t.deckingOptionChanged?.(e)))}slipDockAdded(e){e.updateConnections?.()}measurementSnapEdges(){return this.parts().flatMap((e=>e.edges?.()??[]))}postRestorationAction(){this._bank&&this._bank.addHeightChangedObserver(this,this.bankHeightChanged),super.postRestorationAction()}_boundingBoxAdditions(){const e=this._boundingBoxComponents();return 1===e.length&&e.includes(this.bank())?[new i(0,0,0,0)]:[]}boundingBoxYZ(){const e=this.components().filter((e=>e!==this.bank())),t=e.map((e=>e.boundingCube().leftSide()));t.push(this.bank().shoreLine().yz().expandedBy(1,1));const r=e.reduce(((e,t)=>[...e,...t.annotationsYZ()]),[]).map((e=>e.boundingBox())),n=t.pop()||new i(0,0,0,0);return t.concat(r).reduce(((e,t)=>e.merge(t)),n)}boundingCube(){return this.drawing3D().boundingCube()}annotationsYZ(){return this._annotationsYZ||(this._annotationsYZ=this.defaultAnnotationsYZ()),this._annotationsYZ}defaultAnnotationsYZ(){const e=this.systemStrategy().annotationType();return this.yzAnnotationEdges().map((t=>new e(t,40,this.unit())))}yzAnnotationEdges(){const e=this.boundingCube(),t=e.high();return[s(e.top(),t).to(s(e.bottom(),t))]}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_annotationsYZ"]}}o(DockDesignerProject,a),o(DockDesignerProject,u),e.exports=DockDesignerProject},70291:(e,t,r)=>{const{MissingOverride:n}=r(50988),i=r(2932),s=r(21260);e.exports=class DockEdgeRailingMultiState{static defaultToggleStateDrawingStyles(){return{none:new s("#EBEBEB","#1A202C"),rails:new s("#b8daff","#5485d2")}}constructor(e,t){this._dock=e,this._edge=t}edge(){return this._edge}dock(){return this._dock}railingStyle(){return this._currentRailingStyle()}hasRailings(){return Boolean(this._currentRailingStyle())}_currentRailingStyle(){throw new n("_currentRailingStyle",this)}current(){return this._toggleModel().current()}toggle(){const e=this._toggleModel().toggle();return this.#e(e.name),e}_toggleModel(){return this.#t??this._defaultToggleModel()}_defaultToggleModel(){const e=new i;this._defaultStates().forEach((t=>e.addState(t.name,t.details)));const t=e.namesOfStates().indexOf(this.#r());for(let r=0;r<t;r++)e.toggle();return this.#e(e.current().name),e}_defaultStates(){return Object.entries(this.constructor.defaultToggleStateDrawingStyles()).map((([e,t])=>({name:e,details:t})))}#r(){return this._nameOfCurrentState}#e(e){this._nameOfCurrentState=e}#t}},95369:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),{lumber:s}=r(93613),o=r(61447),a=n.unit;e.exports=class DockFramingDescriptor extends o{dock(){return this.frame()}deckingOptionProvider(){return this.dock().deckingOptionProvider()}baseZOffset(){return this.deckThickness()}deckThickness(){return this.materialWidth(this.deckingOptionProvider().deckingOption().materialSpecifier())}postSpecifier(){return this.dock().postSpecifier?.()||s.PT6x6}joistSpecifier(){return s.PT2x8}headerSpecifier(){return s.PT2x8}splitPileCapSpecifier(){return s.PT2x8}crossBracingSpecifier(){return s.PT2x6}postHeight(){return a(16,"ft")}maxPostSpacing(){return n.unit(8,"ft")}minPostSpacing(){return n.multiply(this.postSpecifier().details().width,3)}maxJoistSpacing(){return n.unit(16,"in")}interiorPostVerticalOffset(){return this.materialDepth(this.joistSpecifier())}shouldIncludeEndJoists(){return!0}shouldDoubleEndJoists(){return!0}shouldDoubleMiddleJoists(){return!1}postOffset(){const e=this._postCornerInsetFromEdge();return i(-e,-e,this._postZOffset())}_postZOffset(){return this.baseZOffset()}_postCornerInsetFromEdge(){return 2*this.materialWidth(this.joistSpecifier())}offsetForPostRowEdge(){return i(0,-this.postOffset().y()+this.materialWidth(this.postSpecifier())/2,this.dock().zLevel())}joistOffset(){return i(this._joistEndOffset(),0,this._joistZOffset())}_joistEndOffset(){return-this.materialWidth(this.headerSpecifier())}_joistZOffset(){return this.baseZOffset()+this.materialDepth(this.joistSpecifier())}headerOffset(){return i(this.joistOffset().x()+this.materialWidth(this.headerSpecifier()),this.joistOffset().y(),this._headerZOffset())}_headerZOffset(){return this.baseZOffset()+this.materialDepth(this.headerSpecifier())}splitPileCapOffset(){return i(0,this._splitPileCapLateralOffset(),this._splitPileCapZOffset())}_splitPileCapZOffset(){return this.joistOffset().z()+this.materialDepth(this.splitPileCapSpecifier())}_splitPileCapLateralOffset(){return this.joistOffset().y()}crossBracingOffset(){return i(0,this._bracingLateralOffset(),this._bracingZOffset())}_bracingLateralOffset(){return this.postOffset().y()+this._insetForCrossBracing()}_bracingZOffset(){return this._splitPileCapZOffset()+this._gapBetweenPileCapsAndBracing()}_gapBetweenPileCapsAndBracing(){return n.unit(2,"in").toNumeric(this.dock().unit())}_insetForCrossBracing(){return-n.unit(1,"in").toNumeric(this.dock().unit())}}},65773:(e,t,r)=>{const{EditableProperty:n}=r(7340),{Composite3DFigure:i}=r(37732),{extend:s}=r(50988),o=r(26933),a=r(20632),l=r(56562),c=r(36887),u=r(83102),d=r(27817);class DockRoof extends u{get descriptor(){return this.framingDescriptor()}get framer(){return this.componentFramer()}overhang(){return this.descriptor.overhang()}area(){return this.geometry().area()}surfaceArea(){return this.framer.roofingShapes().sum((e=>e.area()))}baseGeometry(){return this.framingLevel().geometry()}geometry(){return this.framer.offsetHelper().applyOffsetToGeometry(this.baseGeometry(),this.descriptor.overhangOffset().xy())}overhangEdgeGeometry(){return this.framer.offsetHelper().applyOffsetToGeometry(this.baseGeometry(),this.descriptor.overhangOffset())}zLevel(){return Math.min(...this.framer.roofingShapes().flatMap((e=>e.vertices().map((e=>e.z())))))}setMemento(e){e?.roofingMaterial&&this.setRoofingMaterial(e.roofingMaterial)}memento(){return{roofingMaterial:this.roofingMaterial()}}defaultDisplayProperties(){return[new n(this,"Roofing Material",{type:"select",choices:this.roofingMaterialChoices()}),...this.accumulatedDisplayProperties()]}roofingMaterialChoices(){return this.descriptor.roofingMaterialChoices()}roofingMaterial(){return this._roofingMaterial??=this.roofingMaterialChoices().at(0).value}setRoofingMaterial(e){this._roofingMaterial=e,this.resetComponents()}flashingColor(){return this.project().roofFlashingColor()}surfaceColor(){return this.project().roofSurfaceColor()}framingLevel(){return this.componentOf()}foundation(){return this.framingLevel().foundation()}baseElevation(){return this.framingLevel().height()}mainAxis(){const e=this.framingLevel();return this.flipped()?e.crossAxis().negated():e.mainAxis()}crossAxis(){return this.flipped()?this.framingLevel().mainAxis():this.framingLevel().crossAxis()}flipped(){return this._flipped??=!1}flip(){this.setFlipped(!this.flipped())}setFlipped(e,{shouldReset:t=!0}={}){this._flipped=e,t&&this.framingLevel().resetDock()}joists(){return this._joists??=this.framer.makeJoists()}flashing(){return this._flashing??=this.framer.makeFlashing()}sheathing(){return this._sheathing??=this.framer.makeSheathing()}roofing(){return this._roofing??=this.framer.makeRoofingPanels()}components(){return[...this.accumulatedComponents(),...this.joists(),...this.flashing(),...this.sheathing(),...this.roofing()].filter(Boolean)}resetComponents(){this.resetAccumulatedComponents(),this._joists=void 0,this._flashing=void 0,this._sheathing=void 0,this._roofing=void 0}nonEssentialProperties(){return[...super.nonEssentialProperties(),...this.accumulatedNonEssentialProperties(),"_joists","_flashing","_sheathing","_roofing"]}defaultFigure(){return l.withModel(this)}threeFigure(){return i.withModel(this)}projectedViewFigure(e,t,r){return o.withModel(this,e,t,r)}}d(DockRoof,"framingLevel",["referencePoint"]),s(DockRoof,c),s(DockRoof,a),e.exports=DockRoof},31038:(e,t,r)=>{const n=r(75086),i=r(15004),s=r(10066);e.exports=class DockRoofCoveringMaterial extends n{roof(){return this.componentOf()}color(){return this.roof().surfaceColor()}threeFigure(){const e=new i(this);return e.setLayer(s.ROOFING_MATERIAL),e}defaultFigure(){const e=super.defaultFigure();return e.setLayer(s.ROOFING_MATERIAL),e}projectedViewFigure(e,t,r){const n=super.projectedViewFigure(e,t,r);return n.setLayer(s.ROOFING_MATERIAL),n}}},69639:(e,t,r)=>{const{$P:n,Polygon:i}=r(62048),{MissingOverride:s,supply:o}=r(50988),a=r(73399),l=r(6437),c=r(27817);class DockRoofFramer extends a{framingEdgePairs(){throw new s(this,"framingEdgePairs")}roofingShapes(){throw new s(this,"roofingShapes")}sheathingShapes(){return this.roofingShapes()}makeFlashing(){return this.framingDescriptor().hasFlashing()?this._flashingSegmentDescriptors().map((e=>this._makeFlashingSegment(e))):[]}makeSheathing(){return this.framingDescriptor().hasSheathing()?this.sheathingShapes().map((e=>this._makeSheathingPanel(e))):[]}makeRoofingPanels(){return this.roofingShapes().map((e=>this._makeRoofingPanel(e)))}roof(){return this.frame()}_flashingSegmentDescriptors(){return this._flashingEdges().map((e=>this._createFlashingSegmentDescriptor(e)))}_createFlashingSegmentDescriptor(e,t=n(0,0),r=e.normal()){return{edge:e,offset:t,normal:r}}_flashingEdges(){return this.offsetHelper().applyOffsetToEdges(this.roof().overhangEdgeGeometry().edges(),this.framingDescriptor().flashingOffset())}_makeFlashingSegment(e){const t=this.framingDescriptor().flashingMaterialClass(),r=this.framingDescriptor().flashingSpecifier();return this._createMaterial(t,e.edge,r,e.offset,e.normal)}_makeSheathingPanel(e){const t=this.framingDescriptor();return this._makeCoveringPanel(t.sheathingMaterialClass(),e,t.sheathingSpecifier())}_makeRoofingPanel(e){const t=this.framingDescriptor(),r=t.normalOffsetToRoofingSurface();return this._makeCoveringPanel(t.roofingMaterialClass(),e,t.roofingSpecifier(),r)}_makeCoveringPanel(e,t,r,n=this.framingDescriptor().materialDepth(r)){const i=new e(this._adjustedSurfaceForSpecifier(t,n),r,this.roof().crossAxis());return i.setComponentOf(this.roof()),i}_adjustedSurfaceForSpecifier(e,t){const r=-t/Math.cos(e.normal().phi());return new i(e.vertices().map((e=>e.addZ(r))))}joistOffset(){return this.framingDescriptor().overhangOffset()}_makeJoist(e,t,r,n){const i=this.framingDescriptor(),s=i.joistMaterialClass(),o=i.joistSpecifier();return this._createMaterial(s,e,o,r,n)}}c(DockRoofFramer,"framingDescriptor",["joistSpecifier","maxJoistSpacing"]),o(DockRoofFramer,l),e.exports=DockRoofFramer},48151:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),{MissingOverride:s}=r(50988),o=r(87558),a=r(31038),l=r(61447),c=r(73835),u=r(83465);e.exports=class DockRoofFramingDescriptor extends l{defaultMaterialSpecifier(){throw new s(this,"defaultMaterialSpecifier")}flashingSpecifier(){throw new s(this,"flashingSpecifier")}roofingSpecifier(){throw new s(this,"roofingSpecifier")}sheathingSpecifier(){throw new s(this,"sheathingSpecifier")}windBracingSpecifier(){throw new s(this,"windBracingSpecifier")}roofingMaterialChoices(){throw new s(this,"roofingMaterialChoices")}_makeRoofingMaterialChoice(e,t){return{label:e,value:t}}pitchChoices(){return this._pitchRises().map((e=>this._makePitchChoice(e,this._pitchRun())))}_makePitchChoice(e,t){return{label:`${e}/${t}`,value:(e/t).roundedTo(this._pitchDecimalPlaces())}}_pitchRises(){return[1,2,3,4,5,6,7,8,9,10,11,12]}_pitchRun(){return 12}_pitchDecimalPlaces(){return Math.SIGNIFICANT_DECIMAL_PLACES}defaultPitchChoiceIndex(){return 3}roof(){return this.frame()}maxJoistSpacing(){return n.unit(16,"in")}strippingSpacing(){return n.unit(2,"ft")}minBracingSpan(){return n.unit(8,"ft")}bracingLength(){return n.unit(4,"ft")}overhang(){n.unit(1,"ft")}overhangHeightAboveFramingLevel(){return this.joistSpecifier().details().depth}overhangOffset(){const e=this.overhang().toNumeric(this.unit()).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES),t=this.overhangHeightAboveFramingLevel().toNumeric(this.unit()).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES);return i(e,e,-t)}normalOffsetToRoofingSurface(){return(this.hasSheathing()?this.materialDepth(this.sheathingSpecifier()):0)+this.materialDepth(this.roofingSpecifier())}hasFlashing(){return!1}hasSheathing(){return!1}hasStripping(){return!1}hasWindBracing(){return!1}hasJoists(){return!0}hasBanding(){return!1}hasPostTopPlates(){return!1}bandingCount(){return 2}collarTieMaterialClass(){return o}collarTieSpecifier(){return this.defaultMaterialSpecifier()}joistMaterialClass(){return this.defaultMaterialClass()}joistSpecifier(){return this.defaultMaterialSpecifier()}rafterMaterialClass(){return c}rafterSpecifier(e){return this.defaultMaterialSpecifier()}ridgeMaterialClass(){return this.defaultMaterialClass()}ridgeSpecifier(){return this.defaultMaterialSpecifier()}bandingMaterialClass(){return this.defaultMaterialClass()}bandingSpecifier(){return this.defaultMaterialSpecifier()}strippingMaterialClass(){return this.defaultMaterialClass()}strippingSpecifier(){return this.defaultMaterialSpecifier()}postTopPlateMaterialClass(){return this.defaultMaterialClass()}postTopPlateSpecifier(){return this.defaultMaterialSpecifier()}windBracingMaterialClass(){return this.defaultMaterialClass()}flashingMaterialClass(){return this.defaultMaterialClass()}roofingMaterialClass(){return a}sheathingMaterialClass(){return a}defaultMaterialClass(){return u}flashingOffset(){return i(0,0)}bandingOffset(){return i(0,0)}postTopPlateOffset(){return i(0,0)}strippingOffset(){const e=this.roof().pitchAngle();return i(-Math.cos(e),-Math.cos(e),-Math.sin(e))}roofingOverhangPastRafters(){return n.unit(0,"ft")}sheathingOverhangPastRafters(){return this.roofingOverhangPastRafters()}shouldHaveCollarTieAt(e,t){return!(0===e||e===t)}}},88548:(e,t,r)=>{const n=r(21158),i=r(32387),s=r(10066);e.exports=class DockRoofingLevel extends i{static displayName(){return"Roofing"}static iconName(){return"roof"}static for(e){const t=new this(this._defaultFramingLevelGeometry(e));return t.setComponentOf(e),t}static _defaultFramingLevelGeometry(e){const t=e.dockFramer();return t.offsetHelper().applyOffsetToGeometry(this._baseGeometryFrom(e),t.postOffset().xy())}static _baseGeometryFrom(e){return e.geometry()}dock(){return this.componentOf()}roof(){return this.framing()}resetDock(){this.dock().resetComponents(),this.substructure().resetComponents()}area(){return this.framing().area()}defaultFigure(){return new n(this)}threeFigure(){const e=super.threeFigure();return e.setLayer(s.ROOFING),e}setHeight(e){super.setHeight(e),this.resetDock()}setFramingType(e){const t=this.framing().memento();super.setFramingType(e),this.framing().setMemento(t),this.resetDock()}}},42482:(e,t,r)=>{const n=r(63768),{Rectangle:i}=r(62048),{EditableProperty:s}=r(7340),o=r(41730),a=r(34732),l=r(47256);e.exports=class DredgeZone extends l{static displayName(){return"Dredge Zone"}static defaultWidth(){return n.unit(12,"ft")}static defaultLength(){return n.unit(12,"ft")}static defaultDepth(){return n.unit(10,"ft")}defaultDisplayProperties(){return[...super.defaultDisplayProperties(),new s(this,"Depth",{type:"unit",defaultUnit:"ft",ignoreIntermediateEdits:!0})]}depth(){return this._depth??=this.constructor.defaultDepth()}setDepth(e){this._depth=e,this._zoneChanged(),this.resetAnnotations()}formatDepth(){return this.formatDimension(this.depth())}validateDepth(e,t){return this._validateDimension(e,t)}zLevel(){return this.depth().toNumeric(this.unit())}defaultAnnotations(){return[...super.defaultAnnotations(),this._depthAnnotation()]}_depthAnnotation(){const e=this.locator().relatedTo(this.referencePoint()),t=new i(-20,-10,40,20);return new a(this.formatDepth(),e,{badgeShape:t,...this._depthBadgeOptions()})}_depthBadgeOptions(){return{badgeStrokeStyle:"#694a1d",badgeFillStyle:"#FFFFFF77"}}resetAnnotations(){this._annotations=void 0}resizingFinished(){super.resizingFinished(),this.resetAnnotations()}defaultFigure(){return new o(this)}}},55421:(e,t,r)=>{const n=r(63768),{lumber:i}=r(93613),{EditableProperty:s}=r(7340),o=r(21373),a=r(5163),l=r(80317);e.exports=class ExistingDock extends a{static role(){return l.EXISTING_DOCK}static displayName(){return"Existing Dock"}connectorsShouldSnapToCenter(){return!1}defaultDisplayProperties(){return[...super.defaultDisplayProperties(),new s(this,"Height",{type:"unit",defaultUnit:"in"})]}setHeight(e){super.setHeight(e),this.gangwaysGoingUp().forEach((e=>e.detachLowerFrame()))}gangwaysGoingUp(){return this.attachedGangways().filter((e=>e.lowerFrame()===this))}gangwaysGoingDown(){return this.attachedGangways().filter((e=>e.upperFrame()===this))}priceBreakdown(){return{}}deckingOptionProvider(){return this}deckingOption(){return new o("Fixed Dock",{description:"",unitPrice:n.unit(0,"1/ft^2"),materialSpecifier:i.PT2x6,material:"fixed-dock",colors:["#ffffff"]})}availableOptions(){return[this.deckingOption()]}_defaultHeight(){return n.unit(2,"ft")}}},6559:(e,t,r)=>{const n=r(63768),{FixedEdgeLocator:i,$P:s}=r(62048),{MaterialSpecifier:o}=r(93613),a=r(30691),l=r(37528),c=r(25737);e.exports=class FloatingDockFramer extends l{framingEndEdges(){return this._shiftEndEdgesForFraming()}headerEdgePairs(){const e=this._bandingWidth();return[this._shiftEndEdgesForFraming((t=>{const r=this.dock().alongMainAxis(t.vector())?1:2;return e*r}))]}_shiftEndEdgesForFraming(e){return this._framingGeometry(e).edges().filter((e=>this.dock().alongCrossAxis(e.vector())))}_framingGeometry(e=(()=>2*this._bandingWidth())){const t=this.dock().geometry().snapshot(),r=this.dock().connections().filter((e=>e.isMinorDock(this.dock())));return t.edges().forEach((t=>{if(this.dock().connectedDocksAlong(t,r).length>0){const r=t.normal().multipliedBy(e(t));t.moveBy(r.x(),r.y(),r.z())}})),t}makeBanding(){const e=this.descriptor.bandingSpecifier(),t=this.descriptor.materialWidth(e),r=this.descriptor.materialDepth(e),n=[...this.dock().sideEdges().flatMap((e=>this._subtractConnectionEdgesFromBanding(e,{sideEdge:!0}))),...this.dock().endEdges().flatMap((e=>this._subtractConnectionEdgesFromBanding(e,{sideEdge:!1})))];return this.offsetHelper().applyOffsetToEdges(n,this.descriptor.bandingOffset()).map((n=>this._makeBoard(n,e,s(r/2,-t/2))))}_subtractConnectionEdgesFromBanding(e,{sideEdge:t}){const r=t?this._shrinkBandingSideEdge(e):e,n=this.dock().connectionEdgesOn(e).map((t=>this._shrinkConnectionEdgesForBanding(e,t)));return a.subtractSegmentsFromEdge(r,n)}_shrinkBandingSideEdge(e){const t=this._bandingWidth();return a.stretchedEdgeBy(e,this._containedByConnection(e.begin())?0:-t,this._containedByConnection(e.end())?0:-t)}_containedByConnection(e){return this.dock().connections().some((t=>t.geometry().containsPoint(e)))}_shrinkConnectionEdgesForBanding(e,t){const r=this._bandingWidth();return a.stretchedEdgeBy(t,e.begin().equals(t.begin())?0:-r,e.end().equals(t.end())?0:-r)}minimumDockLengthForCrossAxisFloats(){return n.unit(8,"ft")}makeFloats(){if(n.smallerEq(this.dock().length(),this.minimumDockLengthForCrossAxisFloats())){const e=this.dock().endEdges().first().reversed();return this._makeFloats(e,this.dock().length())}const e=this.dock().sideEdges().first().reversed();return this._makeFloats(e,this.dock().width())}_floatMaterialForWidth(e){const t="RectangularFloat";return new o(t,t,{description:"RectangularFloat",width:e,length:n.unit(3,"ft"),depth:n.unit(18,"in")})}_makeFloats(e,t){let r=0;return this._floatWidths(t).flatMap((t=>{const n=t.toNumeric(this._unit()),i=e.shiftedAlongNormalBy(n/2+r);r+=n;const s=this._floatMaterialForWidth(t);return this._floatsAlong(i,s,e.angle())}))}_floatWidths(e){return[e]}_floatsAlong(e,t,r){const n=(e.length()-this._standardFloatDimension()).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES),s=this.descriptor.maxFloatGap().toNumeric(this._unit()),o=this._standardFloatDimension()+s,a=Math.ceil(n/o)+1,l=n/(a-1)||0,c=[];for(let n=0;n<a;n++){const s=l*n+this._standardFloatDimension()/2,o=new i(e,s).addZ(this.floatZOffset()).relatedTo(this.dock().referencePoint());c.push(this._makeFloat(o,t,r))}return c}_floatClass(){return c}_makeFloat(e,t,r){const n=new(this._floatClass())(e,t,r);return n.setComponentOf(this.frame()),n}floatZOffset(){return this.descriptor.materialDepth(this.descriptor.joistSpecifier())+this.descriptor.deckThickness()}_standardFloatDimension(){return this.descriptor.standardFloatDimension().toNumeric(this._unit())}_bandingWidth(){return this.descriptor.materialWidth(this.descriptor.bandingSpecifier())}}},83007:(e,t,r)=>{const n=r(63768),{lumber:i}=r(93613),{$P:s}=r(62048),o=r(95369);e.exports=class FloatingDockFramingDescriptor extends o{joistSpecifier(){return i.PT2x8}headerSpecifier(){return i.PT2x8}bandingSpecifier(){return i.PT2x8}shouldDoubleEndJoists(){return!1}standardFloatDimension(){return n.unit(4,"ft")}maxFloatGap(){return n.unit(5,"ft")}joistOffset(){const e=this.materialWidth(this.bandingSpecifier());return super.joistOffset().add(-e,-e)}_joistEndOffset(){return 0}headerOffset(){return s(this.joistOffset().x(),this.joistOffset().y(),this._headerZOffset())}bandingOffset(){return s(0,0,this.baseZOffset())}}},32387:(e,t,r)=>{const n=r(63768),{EditableProperty:i}=r(7340),s=r(48909),o=r(91229),a=r(83924),l=r(48661),c=r(35668),u=r(54798),d=r(27817);class FramingLevel extends u{static defaultHeight(){return n.unit(10,"ft")}static displayName(){return"Covering"}constructor(e){super(),this._height=this.constructor.defaultHeight(),e?.moveBy(0,0,-this.height().toNumeric(this.unit())),this._geometry=e}foundation(){return this.componentOf()}clone(){}defaultDisplayProperties(){return[new i(this,"Height",{type:"unit",defaultUnit:"ft"}),new i(this,"Framing Type",{type:"select",choices:this.framingTypeChoices()}),...this.framing().defaultDisplayProperties()]}displayName(){return this.framingType()}geometry(){return this._geometry}edges(){return this.geometry().edges()}vertices(){return this.geometry().vertices()}moveBy(e,t){return!1}zLevel(){return this.framing().zLevel()}overhang(){return this.framing().overhang()}height(){return this._height}setHeight(e){const t=n.subtract(e,this.height()).toNumeric(this.unit());this.geometry().moveBy(0,0,-t),this._height=e}framingType(){return this._framingType??=this._defaultFramingType()}_defaultFramingType(){return Object.keys(this.framingTypes()).first()}setFramingType(e){this._framingType=e,this._framing=void 0,this.resetDisplayProperties()}framingTypeChoices(){return Object.keys(this.framingTypes()).map((e=>({label:e,value:e})))}framingTypes(){const e={};return this._framingClasses().forEach((t=>{e[t.framingType()]=t})),e}_framingClasses(){return[]}framing(){return this._framing??=this._defaultFraming()}_defaultFraming(){const e=new(0,this.framingTypes()[this.framingType()]);return e.setComponentOf(this),e}substructure(){return this._substructure??=this._defaultSubstructure()}_defaultSubstructure(){const e=new(this._substructureClass());return e.setComponentOf(this),e}_substructureClass(){return a}angleChanged(e,t){this.vertices().forEach((e=>{e.rotateBy(e.source(),t)}))}sideEdges(){return this.edges().fastFilter((e=>Math.abs(this.mainAxis().dot(e.direction())).isNearTo(1)))}endEdges(){return this.edges().fastFilter((e=>Math.abs(this.crossAxis().dot(e.direction())).isNearTo(1)))}components(){return[this.framing(),this.substructure()]}resetComponents(){this.framing().resetComponents(),this.substructure().resetComponents()}delete(){this.componentOf()?.removeFramingLevel(this)}defaultFigure(){return new s(this)}threeFigure(){return new l(this)}projectedViewFigure(e,t,r){return o.withModel(this,e,t,r)}projectedAnnotations(e,t,r){const n=this.geometry().vertices().first(),i=n.addZ(this.height().toNumeric(this.unit())),s=new c(n,e,t,r).to(new c(i,e,t,r));return[new(this.systemStrategy().annotationType())(s,30,this.unit(),{formatter:this.lengthFormatter()})]}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_substructure"]}}d(FramingLevel,"foundation",["mainAxis","crossAxis","referencePoint"]),e.exports=FramingLevel},83924:(e,t,r)=>{const{CompositeFigure:n}=r(7340),{Composite3DFigure:i}=r(37732),{extend:s}=r(50988),o=r(36887),a=r(83102),l=r(26933);class FramingLevelSubstructure extends a{framingLevel(){return this.componentOf()}framing(){return this.framingLevel().framing()}foundation(){return this.framingLevel().foundation()}mainAxis(){return this.framingLevel().mainAxis()}crossAxis(){return this.framingLevel().crossAxis()}referencePoint(){return this.framingLevel().referencePoint()}resetComponents(){}components(){return[]}defaultFigure(){return n.withModel(this)}threeFigure(){return i.withModel(this)}projectedViewFigure(e,t,r){return l.withModel(this,e,t,r)}}s(FramingLevelSubstructure,o),e.exports=FramingLevelSubstructure},24659:(e,t,r)=>{const n=r(63768),i=r(80371),s=r(36310);e.exports=class GangwayRailingPost extends i{static defaultWidth(){return n.unit(1,"in")}static defaultLength(){return n.unit(1.5,"in")}defaultGeometry(){return this.geometryStrategy().generateGeometry(this)}geometryStrategy(){return new s}}},18974:(e,t,r)=>{const n=r(63768),{PlanarNormalToEdgeLocator:i,ProportionalEdgeLocator:s,FixedEdgeLocator:o}=r(62048),a=r(10590),l=r(69435),c=r(24659);e.exports=class GangwayRailingSection extends a{componentLayoutEdge(){return this.edge()}componentLayoutLine(){return this.edge()}boundingBox(){return this.rails().first().boundingBox()}railingHeight(){return this.handRailHeight()}handRailHeight(){return n.unit(3,"ft")}kneeRailHeight(){return n.unit(1.5,"ft")}kneeRailRadius(){return n.unit(.5,"in")}isPending(){return!1}postSpacing(){return n.unit(5,"ft")}postInset(){return n.unit(4,"in")}_railingPostEdge(){const e=this.postInset().toNumeric(this.unit()),t=this.edge();return e.isNearTo(0)?t:new o(t,e).to(new o(t,-e))}_defaultRails(){return[this.generateHandRail(),this.generateKneeRail()]}generateHandRail(){const e=this.handRailHeight().toNumeric(this.unit()),t=this.edge().normal().cross(this.edge().vector().normalized()),r=t.phi(),o=Math.sign(this.edge().vector().z()),a=n.multiply(e,n.tan(r))*o,c=n.divide(e,n.cos(r)),u=new i(new s(this.edge(),0),t,0,a).addZ(-c),d=new i(new s(this.edge(),1),t,0,a).addZ(-c);return new l(u.to(d))}generateKneeRail(){const e=this.kneeRailHeight().toNumeric(this.unit()),t=this.edge().normal().cross(this.edge().vector().normalized()),r=this._railingPostEdge(),o=t.phi(),a=Math.sign(r.vector().z()),c=n.multiply(e,n.tan(o))*a,u=n.divide(e,n.cos(o)),d=new i(new s(r,0),t,0,c).addZ(-u),h=new i(new s(r,1),t,0,c).addZ(-u);return new l(d.to(h),this.kneeRailRadius())}makePost(e){return new c(e)}postLocations(){const e=this._railingPostEdge(),t=Math.floor(e.length()/this.postSpacing().toNumeric(this.unit()))+1,r=[];for(let n=0;n<=t;n++)r.push(new s(e,n/t));return r}}},41756:(e,t,r)=>{const n=r(63768),{MaterialSpecifier:i}=r(93613),{CompositeFigure:s}=r(7340),{Composite3DFigure:o}=r(37732),{RelativeLocator:a}=r(62048),l=r(26852),c=r(83102);e.exports=class Hinge extends c{static materialSpecifier(){return new i("Hinge","Hinge Section",{width:n.unit(.5,"in"),depth:n.unit(1.75,"in"),materialName:"steel"})}constructor(e,t,r){super(),this._locator=t,this._beginLocator=e,this._endLocator=r}overlap(){return n.unit(.5,"in")}locator(){return this._locator}beginLocator(){return this._beginLocator}endLocator(){return this._endLocator}materialSpecifier(){return this.constructor.materialSpecifier()}components(){return this.hingeSections()}hingeSections(){if(!this._hingeSections){const e=this.beginLocator().to(this.locator()),t=e.vector().normalized().multipliedBy(this.overlap().toNumeric(this.unit())),r=this.locator().to(this.endLocator()),n=r.vector().normalized().multipliedBy(-this.overlap().toNumeric(this.unit())),i=this.materialSpecifier().details().width.toNumeric(this.unit())/2;this._hingeSections=[new l(e.begin(),new a(e.end(),t.x(),t.y(),t.z()),this.materialSpecifier(),i,e.normal().cross(e.vector().normalized())),new l(new a(r.begin(),n.x(),n.y(),n.z()),r.end(),this.materialSpecifier(),-i,r.normal().cross(r.vector().normalized()))]}return this._hingeSections}defaultFigure(){return s.withModel(this)}threeFigure(){return o.withModel(this)}}},6916:(e,t,r)=>{const n=r(61820),i=r(33225);e.exports=class LegacyGangway{role(){return"legacy_gangway"}postRestorationAction(){const e=this.componentOf(),t=this._isAluminum?n.builder(e).build():i.builder(e).build(),{_className:r,_isAluminum:s,_strategy:o,...a}=this;Object.assign(t,a),this.isAttachedToAnchorPlatform()&&(t.attachUpperFrame(this.anchorPlatform()),this.anchorPlatform().detachGangway(this)),this.componentOf().add(t),this.componentOf().remove(this)}isAttachedToAnchorPlatform(){return Boolean(this.anchorPlatform())}anchorPlatform(){return this._anchorPlatform}componentOf(){return this._componentOf}setComponentOf(e){this._componentOf=e}}},26852:(e,t,r)=>{const{Material:n}=r(93613),{PlanarNormalToEdgeLocator:i,$P:s,Polygon:o,ProportionalEdgeLocator:a,RelativeLocator:l,ExtrudedPolygon:c}=r(62048),u=r(98776),d=r(15004);e.exports=class MetalFrameSection extends n{constructor(e,t,r,n,i=s(0,0,1)){super(e,r,n),this._endLocator=t,this._planeNormal=i}endLocator(){return this._endLocator}planeNormal(){return this._planeNormal}edge(){return this.locator().to(this.endLocator())}width(){return this.materialSpecifier().details().width}depth(){return this.materialSpecifier().details().depth}thickness(){return this.depth().toNumeric(this.unit())}referencePoint(){return this.geometry().centroid()}geometry(){return this._geometry||(this._geometry=this.defaultGeometry()),this._geometry}defaultGeometry(){const e=this.edge(),t=new a(e,0),r=new a(e,1),n=this.width().toNumeric(this.unit()),s=this.planeNormal().negated(),l=this.offset()-n/2,c=this.offset()+n/2;return new o([new i(t,s,l),new i(t,s,c),new i(r,s,c),new i(r,s,l)])}shape3D(){return this._shape3D||(this._shape3D=new c(this.shape(),this.thickness(),this._extrudeVertices.bind(this))),this._shape3D}_extrudeVertices(e,t){const r=this.planeNormal().normalized().multipliedBy(t);return e.map((e=>new l(e,r.x(),r.y(),r.z())))}materialNames(){return[this.materialSpecifier().details().materialName]}defaultFigure(){return new u(this)}threeFigure(){return new d(this)}}},34143:(e,t,r)=>{const n=r(63768),{ConstructionComponent:i}=r(93613),{Circle:s,$P:o}=r(62048),{extend:a}=r(50988),l=r(41776),c=r(11987),u=r(16279),d=r(42638);class Pile extends i{constructor(e,t,r,i=n.unit(0,"in")){super(),this._locator=e,this._height=t,this._materialSpecifier=r,this._verticalOffset=i}locator(){return this._locator}height(){return this._height}verticalOffset(){return this._verticalOffset}setVerticalOffset(e){this._verticalOffset=e,this.reset()}materialSpecifier(){return this._materialSpecifier}primaryDirection(){return o(0,0,1)}radius(){return n.divide(this.diameter(),2)}diameter(){return this.materialSpecifier().details().diameter}topLocator(){return this.locator().addZ(this.verticalOffset().toNumeric(this.unit()))}bottomLocator(){return this.topLocator().addZ(this.height().toNumeric(this.unit()))}width(){return this.diameter()}length(){return this.height()}_parentPostMaterialNames(){if(this.componentOf())return this.componentOf().postMaterialNames?.()}materialNames(){return this._parentPostMaterialNames()??["pressure-treated"]}boundingBox(){return this.geometry().boundingBox()}boundingCube(){return this.shape3D().boundingCube()}edge(){return this._edge??=this.topLocator().to(this.bottomLocator())}geometry(){return this._geometry||(this._geometry=new s(this.topLocator(),this.radius().toNumeric(this.unit()))),this._geometry}color(){if(this.componentOf())return this.componentOf().postColor?.()}shape3D(){return new l(this.edge(),this.radius().toNumeric(this.unit()))}threeFigure(){return new u(this)}defaultFigure(){return new c(this)}reset(){this._edge=void 0,this._geometry=void 0}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_geometry","_edge"]}xLevel(){return this.boundingCube().left()}}a(Pile,d),e.exports=Pile},10765:(e,t,r)=>{const n=r(63768),{NormalToEdgeLocator:i,Polygon:s,ExtrudedPolygon:o,$P:a}=r(62048),l=r(27287),c=r(83745),u=r(83102),d=r(66379);e.exports=class Post extends u{constructor(e,t,r,i=n.unit(0,"in")){super(),this._edgeLocator=e,this._height=t,this._materialSpecifier=r,this._verticalOffset=i}materialNames(){return this.componentOf().postMaterialNames?.()??["pressure-treated"]}color(){return this.componentOf().postColor?.()}color2D(){return this.color()}edgeLocator(){return this._edgeLocator}height(){return this._height}materialSpecifier(){return this._materialSpecifier}verticalOffset(){return this._verticalOffset}setVerticalOffset(e){this._verticalOffset=e,this.reset()}locator(){return this.edgeLocator()}topLocator(){return this.locator().addZ(this.verticalOffset().toNumeric(this.unit()))}length(){return this.height()}edge(){return this.topLocator().to(this.topLocator().addZ(this.height().toNumeric(this.unit())))}width(){return this.materialSpecifier().details().width}depth(){return this.materialSpecifier().details().depth}primaryDirection(){return a(0,0,-1)}geometry(){if(!this._geometry){const e=this.width().toNumeric(this.unit())/2,t=this.depth().toNumeric(this.unit())/2;this._geometry=new s([new i(this.topLocator(),-e,-t),new i(this.topLocator(),e,-t),new i(this.topLocator(),e,t),new i(this.topLocator(),-e,t)])}return this._geometry}vertices(){return this.geometry().vertices()}shape3D(){return this._shape3D||(this._shape3D=new o(this.shape(),this.thickness())),this._shape3D}zLevel(){return this.topLocator().z()}xLevel(){return this.boundingCube().left()}boundingCube(){return this.shape3D().boundingCube()}thickness(){return this.height().toNumeric(this.unit())}defaultFigure(){return new l(this)}threeFigure(){return new c(this)}reset(){this._geometry=void 0,this._shape3D=void 0}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_shape3D"]}projectedViewFigure(e,t,r){return new d(this,e,t,r)}}},56825:(e,t,r)=>{const{extend:n}=r(50988),{Polygon:i}=r(62048),{CompositeFigure:s}=r(7340),o=r(81620),a=r(83102),l=r(30691);class PostGridAnnotationComponent extends a{constructor(e){super(),this._posts=e}mainAxis(){return this.componentOf().mainAxis()}crossAxis(){return this.componentOf().crossAxis()}posts(){return this._posts}shape(){return this._shape??=this._defaultShape()}_defaultShape(){const e=this.posts().map((e=>e.locator()));return new i(e).boundingBox()}locator(){return this.shape().center()}defaultAnnotations(){const e=this.mainAxis(),t=this.crossAxis();return[...this._pileAnnotationsForAxis(e,t),...this._pileAnnotationsForAxis(t,e)].filter(Boolean)}_pileAnnotationsForAxis(e,t){const r=this.postRows(this.posts(),e),n=[];for(let i=1;i<r.length;i++){const s=r[i-1],o=r[i],a=this._axisAlignedAnnotation(s.last().locator(),o.last().locator(),e,t);a&&n.push(a)}return n}_axisAlignedAnnotation(e,t,r,n){const i=l.axisAlign(e.to(t),r,n);if(!i.length().isNearTo(0))return this._annotation(i)}_annotation(e){return new(this.systemStrategy().annotationType())(e,30,this.unit(),{formatter:this.lengthFormatter(),crampedTextAngle:e.normalAngle()})}components(){return[]}defaultFigure(){return s.withModel(this)}boundingBox(){return this.shape().boundingBox()}}n(PostGridAnnotationComponent,o),e.exports=PostGridAnnotationComponent},41274:(e,t,r)=>{const{$P:n,Rectangle:i}=r(62048),{CompositeFigure:s}=r(7340),o=r(83102),a=r(30691),l=r(76905);e.exports=class ProjectPostGridAnnotationComponent extends o{constructor(e=[]){super(),this._postGroups=e,e.map((e=>e.setComponentOf(this)))}mainAxis(){return n(1,0,0)}crossAxis(){return n(0,1,0)}postGroups(){return this._postGroups}components(){return this.postGroups()}boundingBox(){return 0===this.postGroups().length?new i(0,0,0,0):this.postGroups().map((e=>e.boundingBox())).reduce(((e,t)=>e.merge(t)))}defaultFigure(){return s.withModel(this)}defaultAnnotations(){return 0===this.postGroups().length?[]:this.betweenGroupAnnotations()}betweenGroupAnnotations(){const e=this.mainAxis(),t=this.crossAxis(),r=e.negated(),n=t.negated(),i=this.postGroups().slice();return i.sort(((e,t)=>e.boundingBox().left()-t.boundingBox().left())),i.flatMap((s=>{const o=i.find((e=>s.boundingBox().right()<e.boundingBox().right()));if(!o)return[];const a=s.posts().findLargest((r=>r.locator().dot(e)+r.locator().dot(t))),c=l.findClosest(a.locator(),o.posts()).locatable;return[this._axisAlignedAnnotation(a.locator(),c.locator(),r,n),this._axisAlignedAnnotation(a.locator(),c.locator(),n,r)].filter(Boolean)}))}_nearestPostFromTo(e,t){return e.posts().findSmallest((e=>e.locator().distanceTo(t.locator())))}_axisAlignedAnnotation(e,t,r,n){const i=a.axisAlign(e.to(t),r,n);if(!i.length().isNearTo(0))return this._annotation(i)}_annotation(e){return new(this.systemStrategy().annotationType())(e,30,this.unit(),{formatter:this.lengthFormatter(),crampedTextAngle:e.normalAngle()})}}},73835:(e,t,r)=>{const{$P:n}=r(62048),i=r(83465);class Rafter extends i{static roles=Object.freeze({COMMON:"COMMON",END:"END",HIP:"HIP",JACK:"JACK"});constructor(e,t,r,i,s=r.details().materialName){super(e,t,r,void 0,n(0,0,1),s),this._role=i}role(){return this._role}depth(){return this.materialSpecifier().details().depth}width(){return this.materialSpecifier().details().width}thickness(){return this.depth().toNumeric(this.unit())/Math.sin(this.edge().phi())}_extrudeVertices(e,t){return e.map((e=>e.addZ(t)))}}e.exports=Rafter},25737:(e,t,r)=>{const{ExtrudedPolygon:n}=r(62048),i=r(39902),s=r(23675),o=r(59663),a=r(16810),l=r(83102);e.exports=class RectangularFloat extends l{constructor(e,t,r){super(),this._locator=e,this._materialSpecifier=t,this._angle=r}locator(){return this._locator}materialSpecifier(){return this._materialSpecifier}angle(){return this._angle}setAngle(e){this._angle=e,this.reset()}width(){return this.materialSpecifier().details().width}length(){return this.materialSpecifier().details().length}depth(){return this.materialSpecifier().details().depth}moveBy(e,t,r){return this.locator().moveBy(e,t,r)}geometry(){return this._geometry??=this._defaultGeometry()}_defaultGeometry(){return this._geometryStrategy().buildGeometry(this.locator(),this.angle(),this.locator().z())}vertices(){return this.geometry().vertices()}_geometryStrategy(){const e=this._geometryWidth(),t=this._geometryLength();return new a(e,t)}_geometryWidth(){return this.width().toNumeric(this.unit())}_geometryLength(){return this.length().toNumeric(this.unit())}shape3D(){return this._shape3D??=this._defaultShape3D()}_defaultShape3D(){const e=this.depth().toNumeric(this.unit());return new n(this.geometry(),e)}reset(){this._geometry=void 0,this._shape3D=void 0}defaultFigure(){return new o(this)}threeFigure(){return new s(this)}projectedViewFigure(e,t,r){return new i(this,e,t,r)}color2D(){return this.materialSpecifier().details().color2D??"#000000"}color3D(){return this.materialSpecifier().details().color3D??this.color2D()}fillStyle(){return this.color2D()}strokeStyle(){return"transparent"}projectedAnnotations(){return[]}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_geometry","_shape3D"]}}},11307:(e,t,r)=>{const n=r(63768),{$P:i,Rectangle:s,Polygon:o}=r(62048),a=r(88646),l=r(56214),c=r(390),u=r(83102),d=r(72496);e.exports=class SeaWall extends u{static defaultWidth(){return n.unit(2,"ft")}dockBank(){return this.componentOf()}width(){return this.constructor.defaultWidth()}extrusionPath(e=this.dockBank().bounds()){const t=this.dockBank().controlPointsFor(e);return new c(t,.2,this.dockBank().extrusionDirection().toThreeJS())}pathSteps(){return this.dockBank().pathSteps()}crossSection(){const e=this.width().toNumeric(this.unit()),t=this.dockBank().height().toNumeric(this.unit());return new a([new l(new s(0,-e,t,e))])}geometry(e){const t=this.extrusionPath(e),r=t.getPoints(this.pathSteps()).map((e=>e.toPoint())),n=t.computeFrenetFrames(this.pathSteps(),!1),i=this.width().toNumeric(this.unit()),s=[];return r.forEach(((e,t)=>{const r=n.binormals[t].toPoint().multipliedBy(i);s.push(e),s.unshift(e.subtract(r))})),new o(s)}threeFigure(){return new d(this)}materialNames(){return["concrete"]}primaryDirection(){return i(1,0,0)}}},8994:(e,t,r)=>{const n=r(83465);e.exports=class SkirtBoard extends n{width(){return super.depth()}depth(){return super.width()}}},30580:(e,t,r)=>{const n=r(34143);e.exports=class SteelPile extends n{materialNames(){return["steel"]}}},5163:(e,t,r)=>{const n=r(63768),{extend:i,simpleObserver:s}=r(50988),o=r(26716),a=r(37528),l=r(95369),c=r(81620);class TimberDock extends o{static defaultWidth(){return n.unit(3,"ft")}static defaultLength(){return n.unit(10,"ft")}static displayName(){return"Dock"}static iconName(){return"standard-dock"}clone(){const e=super.clone();return e._height=this.height(),e}minimumSpan(){return n.unit(2,"ft").toNumeric(this.unit())}_componentsPrice(e){if(0===e.length)return 0;const t=e.reduce(((e,t)=>n.add(e,t.length())),n.unit(0,"ft")),r=this.project().systemStrategy().lumberPricing()[e.first().materialSpecifier().identifier()];return n.multiply(t,r)}priceBreakdown(){const e=n.sum(this._componentsPrice(this.posts()),this._componentsPrice(this.joists()),this._componentsPrice(this.headers()),this._componentsPrice(this.crossBracing()),this._componentsPrice(this.splitPileCaps()));return{Decking:this.surface().price(),Structure:e.roundedTo(2)}}angleChanged(e){super.angleChanged(e),this.resetComponents()}bankHeightChanged(e){this.resetComponents()}_defaultHeight(){return n.unit(2,"ft")}setHeight(e){this._height=e;const t=e.toNumeric(this.unit());this.vertices().forEach((e=>e.moveBy(0,0,-(t+e.z())))),this.resetComponents(),this.notifyHeightChangedObservers()}validateHeight(e,t){if(e)return n.smaller(t,n.unit(0,"ft"))?"Height can not be less than 0 feet.":void 0}_defaultFramer(){return new a(this)}_defaultFramingDescriptor(){return new l(this)}postHeight(){return this.dockFramer().postHeight()}posts(){return this._posts??=this._defaultPosts()}_defaultPosts(){return this.dockFramer().makePosts()}cornerPosts(){const e=this.postRows();return[e.first().first(),e.first().last(),e.last().first(),e.last().last()]}uniquePosts(){return this.posts()}joists(){return this._joists||(this._joists=this.dockFramer().makeJoists()),this._joists}headers(){return this._headers||(this._headers=this.dockFramer().makeHeaders()),this._headers}crossBracing(){return this._crossBracing||(this._crossBracing=this.dockFramer().makeCrossBracing()),this._crossBracing}splitPileCaps(){return this._splitPileCaps||(this._splitPileCaps=this.dockFramer().makeSplitPileCaps()),this._splitPileCaps}components(){return[...super.components(),this.surface(),...this.uniquePosts(),...this.joists(),...this.headers(),...this.crossBracing(),...this.splitPileCaps()]}allLocatedMaterials(){return this.components().flatMap((e=>e.allLocatedMaterials()))}resetComponents(){super.resetComponents(),this._posts=void 0,this._joists=void 0,this._headers=void 0,this._crossBracing=void 0,this._splitPileCaps=void 0}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_posts","_joists","_headers","_crossBracing","_splitPileCaps","_heightChangedObservers"]}prepareForMove(){}moveBy(e,t,r){return this.prepareForMove(),super.moveBy(e,t,r)}xLevel(){return this.boundingCube().left()}}s(TimberDock,"heightChanged"),i(TimberDock,c),e.exports=TimberDock},19382:(e,t,r)=>{const n=r(63768),{ExtrudedPolygon:i,RelativeLocator:s}=r(62048),o=r(15004),a=r(22454),l=r(83102);e.exports=class WalkwayMesh extends l{constructor(e,t){super(),this._geometry=e,this._depth=t||n.unit(1,"in")}geometry(){return this._geometry}depth(){return this._depth}zLevel(){return this.geometry().zLevel()}thickness(){return this.depth().toNumeric(this.unit())}shape3D(){return this._shape3D||(this._shape3D=new i(this.geometry(),this.thickness(),this._extrudeVertices.bind(this))),this._shape3D}_extrudeVertices(e,t){const r=this.geometry().normal().multipliedBy(t);return e.map((e=>new s(e,r.x(),r.y(),r.z())))}materialNames(){return["aluminum-walkway-mesh","aluminum"]}defaultFigure(){return new a(this)}threeFigure(){return new o(this)}}},68768:(e,t,r)=>{const n=r(63768),{UnitFromParent:i}=r(93613),{$P:s,Component:o}=r(62048),{extend:a}=r(50988);class WaterDepthService{constructor(e){this.setComponentOf(e)}project(){return this.componentOf()}waterGradient(){return this.project().waterGradient()}dredgeZones(){return this.project().dredgeZones()}waterDepthAt(e){const t=this.dredgeZones().find((t=>t.geometry().containsPoint(e)));return t?t.depth():this.waterGradient().waterDepthAt(e)}distanceFromShoreTo(e){return n.unit(this._shoreYOffset()-e.y(),this.unit())}locatorAtDistanceFromShore(e){return s(0,this._shoreYOffset()-e.toNumeric(this.unit()))}_shoreYOffset(){return this.project().bank().shoreLine().y()}}a(WaterDepthService,o),a(WaterDepthService,i),e.exports=WaterDepthService},16576:(e,t,r)=>{const n=r(63768),{NullDrawable3D:i}=r(37732),{$P:s,Rectangle:o}=r(62048),a=r(83102),l=r(90019),c=r(76972),u=r(20149),d=r(81882),h=r(46748),p=n.unit(0,"ft");e.exports=class WaterGradient extends a{constructor(e=[]){super(),e.forEach((e=>this.addBreakline(e)))}breaklines(){return this._breakLines??=[this._defaultBreaklineAtShore()]}_defaultBreaklineAtShore(){const e=new l(p,p);return e.setComponentOf(this),e}addBreakline(e){e.setComponentOf(this);const t=this.breaklines(),r=this._matchingBreaklineIndex(e.distanceFromShore()),n=this._firstLargerBreaklineIndex(e.distanceFromShore());r>=0?t[r]=e:n<0?t.push(e):t.splice(n,0,e),this._resetAnnotations()}_matchingBreaklineIndex(e){return this.breaklines().findIndex((t=>n.equal(t.distanceFromShore(),e)))}_firstLargerBreaklineIndex(e){return this.breaklines().findIndex((t=>n.larger(t.distanceFromShore(),e)))}removeBreakline(e){e.distanceFromShore().equals(p)||(this.breaklines().remove(e),e.setComponentOf(void 0),this._resetAnnotations())}distanceFromShoreChangeOn(e){this.breaklines().sort(((e,t)=>n.sign(n.subtract(e.distanceFromShore(),t.distanceFromShore())))),this._resetAnnotations()}waterDepthAt(e){const t=this.breaklines(),r=this.waterDepthService().distanceFromShoreTo(e);if(n.smallerEq(r,p))return p;const i=this._firstLargerBreaklineIndex(r);if(i<0)return t.at(-1).depth();const s=t.at(i),o=i>0?t.at(i-1):t.at(0),a=this._downSlopeBetweenBreaklines(o,s);return this._depthAtDistanceFromBreakline(o,r,a)}_downSlopeBetweenBreaklines(e,t){return h`(${t.depth()} - ${e.depth()}) / (${t.distanceFromShore()} - ${e.distanceFromShore()})`}_depthAtDistanceFromBreakline(e,t,r){const i=n.subtract(t,e.distanceFromShore()),s=n.multiply(i,r);return n.add(e.depth(),s)}waterDepthService(){return this.project().waterDepthService()}components(){return[...this.breaklines()]}defaultFigure(){return new c(this)}threeFigure(){return new i(this)}projectedViewFigure(e,t,r){return new d(this,e,t,r)}defaultAnnotations(){const e=this.breaklines(),t=[],r=this._defaultLocatorX(1)/3,i=this.locator().subtract(s(r,0)).relatedTo(this.locator());for(let s=1;s<e.length;s++){const o=e.at(s-1),a=e.at(s),l=o.locator().add(i).to(a.locator().add(i)).relativeTo(i),c=n.subtract(a.distanceFromShore(),o.distanceFromShore()).toString(),d=new u(l,c,r);d.setLayer(this.defaultFigure().layer()),t.push(d)}return t}_resetAnnotations(){this._annotations=void 0}locator(){return this._locator??=s(this._defaultLocatorX(1),0)}_defaultLocatorX(){return c.paddingLeft(1)}boundingBox(){return new o(0,0,1,1)}updateLocatorX(e){const t=this.locator(),r=e-t.x();r.isNearTo(0)||t.moveBy(r,0,0)}}},90019:(e,t,r)=>{const n=r(63768),{NullDrawable3D:i}=r(37732),{EditableProperty:s}=r(7340),o=r(67603),a=r(54798),l=r(73895),c=n.unit(0,"ft");e.exports=class WaterGradientBreakline extends a{constructor(e,t){super(),this._distanceFromShore=e,this._depth=t}gradient(){return this.componentOf()}isDeleteable(){return this.isMoveable()}isMoveable(){return!this.distanceFromShore().equals(c)}isSelectable(){return!1}delete(){this.gradient().removeBreakline(this)}defaultDisplayProperties(){return new o(this,[new s(this,"Distance From Shore",{type:"unit",defaultUnit:"ft",ignoreIntermediateEdits:!0,disabled:!this.isMoveable()}),new s(this,"Depth",{type:"unit",defaultUnit:"ft",ignoreIntermediateEdits:!0})])}distanceFromShore(){return this._distanceFromShore}setDistanceFromShore(e){this.isMoveable()&&!n.smallerEq(e,c)&&(this._distanceFromShore=e,this.gradient().distanceFromShoreChangeOn(this))}formatDistanceFromShore(){return this.project().lengthFormatter().format(this.distanceFromShore())}depth(){return this._depth}setDepth(e){this._depth=e}formatDepth(){const e=this.depth(),t=this.project().lengthFormatter();return n.equal(e,c)&&"in"===t.baseUnit()?"0'":this.project().lengthFormatter().format(this.depth())}defaultFigure(){return new l(this)}threeFigure(){return new i(this)}waterDepthService(){return this.project().waterDepthService()}locator(){return this.waterDepthService().locatorAtDistanceFromShore(this.distanceFromShore()).addZ(this.depth().toNumeric(this.unit()))}}},91296:(e,t,r)=>{const n=r(63768),{extend:i}=r(50988),{EditableProperty:s}=r(7340),o=r(43775),a=r(87991),l=r(26716),c=r(57100),u=r(30691),d=r(6559),h=r(83007),p=r(67603),m=r(80317);class WoodFramedFloatingDock extends l{static iconName(){return"stick-dock"}static displayName(){return"Floating Dock"}static defaultLength(){return n.unit(10,"ft")}static defaultWidth(){return n.unit(5,"ft")}static role(){return m.FLOATING_DOCK}setWidth(e){return super.setWidth(e.roundedToIncrement(this.snapToIncrement()))}setLength(e){return super.setLength(e.roundedToIncrement(this.snapToIncrement()))}formatWidth(){return this.project().lengthFormatter().format(this.width())}formatLength(){return this.project().lengthFormatter().format(this.length())}defaultDisplayProperties(){return new p(this,[new s(this,"Width",{type:"unit",defaultUnit:"ft",ignoreIntermediateEdits:!0}),new s(this,"Length",{type:"unit",defaultUnit:"ft",ignoreIntermediateEdits:!0})])}snapToIncrement(){return n.unit(1,"in")}minimumSpan(){return n.unit(3,"ft").toNumeric(this.unit())}slipHandleLocators(){return[]}_defaultHeight(){return n.unit(22,"in")}deckingBoardGap(){return n.unit(.125,"in")}_defaultFramer(){return new d(this)}_defaultFramingDescriptor(){return new h(this)}includeSkirtBoards(){return!1}shouldShowSubstructure(){return!0}joists(){return this._joists??=this.dockFramer().makeJoists()}headers(){return this._headers??=this.dockFramer().makeHeaders()}banding(){return this._banding??=this.dockFramer().makeBanding()}floats(){return this._floats??=this.dockFramer().makeFloats()}floatZLevel(){return this.zLevel()+this.dockFramer().floatZOffset()}removeFloat(e){this.floats().remove(e),this.floatsChanged()}addFloat(e){this.floats().push(e),e.setComponentOf(this),this.floatsChanged()}components(){return[...this.accumulatedComponents(),...this.headers(),...this.joists(),...this.banding(),...this.floats(),this.surface()]}resetComponents(){super.resetComponents(),this._joists=void 0,this._headers=void 0,this._banding=void 0}angleChanged(e,t,r){super.angleChanged(e,t,r),this.resetComponents(),this.floats().forEach((e=>{e.locator().rotateBy(r,t),e.setAngle(e.angle()+t)})),this.updateConnections()}existingPosts(){return[]}uniquePosts(){return[]}posts(){return[]}componentsMaterialLineItems(){return this.components().flatMap((e=>e.materialLineItems?.()??[]))}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_joists","_headers","_banding"]}resizingFinished(){this.frameResized({fromSetter:!0})}frameResized(e={fromSetter:!1}){super.frameResized(e),e.fromSetter&&(this._floats=void 0,this.updateConnections(),this.floatsChanged())}floatsChanged(){}deckingOptionChanged(e){this.resetComponents()}selfMaterialLineItems(){return[]}postRows(){return[]}addHeightChangedObserver(){}removeHeightChangedObserver(){}notifyHeightChangedObservers(){}cornerSnappingTolerance(){return n.unit(1,"ft")}snapToFramesFilter(){return e=>e.role()===m.FLOATING_DOCK}railingEdges(){return[]}connectionClass(){return c}connectionZLevel(){return this.zLevel()}delete(){this.connections().forEach((e=>e.delete())),super.delete()}snappableEdgesForFrame(e){return this.edges().flatMap((t=>this.subtractConnectionEdgesFrom(t,e)))}subtractConnectionEdgesFrom(e,t){const r=this.connections().filter((e=>e.otherDock(this)!==t)),n=this.connectionEdgesOn(e,r);return u.subtractSegmentsFromEdge(e,n)}}i(WoodFramedFloatingDock,a),i(WoodFramedFloatingDock,o),e.exports=WoodFramedFloatingDock},33225:(e,t,r)=>{const n=r(63768),{PlanarNormalToEdgeLocator:i,ProportionalEdgeLocator:s,$P:o}=r(62048),{EditableProperty:a}=r(7340),l=r(96797),c=r(41756),u=r(79851),d=r(21065),h=r(80317);e.exports=class WoodenRamp extends u{static displayName(){return"Wooden Ramp"}static defaultWidth(){return n.unit(5,"ft")}static defaultLength(){return n.unit(10,"ft")}surfaceType(){return d.Wooden}deckingOptionProvider(){return this.componentOf()?.deckingOptionProvider()}defaultDisplayProperties(){const e=[];return this.isAttachedToAnchorPlatform()||e.push(new a(this,"Width",{type:"select",choices:this.widthOptions()})),this.deckingOptionProvider().deckingOption().materialSpecifier()||e.push(new a(this,"Decking Option",{type:"select",choices:this.deckingOptions()})),e}isAttachedToAnchorPlatform(){return this.upperFrame()?.role()===h.ANCHOR_PLATFORM}priceBreakdown(){return this.systemStrategy().woodenRampPriceBreakdown(this)}_defaultWidth(){return this.isAttachedToAnchorPlatform()?this.upperFrame().width():this.constructor.defaultWidth()}_defaultLength(){return this.constructor.defaultLength()}surface(){return this._surface||(this._surface=new l(this)),this._surface}deckingShape(){return this.geometry()}hinges(){if(!this.componentOf())return[];const e=this.surface().materialSpecifier().details().depth.toNumeric(this.unit())/2,t=this.surface().materialSpecifier().details().width.toNumeric(this.unit()),r=c.materialSpecifier().details().depth.toNumeric(this.unit())/2,n=(this.hingeDistance().toNumeric(this.unit())-e*Math.sin(this.slopeAngle()))/(Math.cos(this.slopeAngle())+1);return[{locator:new s(this.upperEdge(),0),direction:1},{locator:new s(this.upperEdge(),1),direction:1},{locator:new s(this.lowerEdge(),0),direction:-1},{locator:new s(this.lowerEdge(),1),direction:-1}].map((({locator:s,direction:a})=>{const l=new i(s,this.mainAxis().negated(),a*(e-r)),u=new i(l,this.geometry().normal().negated(),t),d=new i(u,this.geometry().normal().negated(),n),h=new i(d,o(0,0,-1),n);return new c(u,d,h)}))}offsetFromFrameWhenAttached(e){const t=super.offsetFromFrameWhenAttached(e);return n.add(t,this.hingeDistance())}hingeDistance(){return n.unit(3.5,"in")}components(){return[this.surface(),...this.hinges()]}offsetWithOverhang(e){const t=n.subtract(this.hingeDistance(),n.multiply(this.surface().materialSpecifier().details().depth,n.sin(this.slopeAngle())));return n.add(t,this.surface().overhang(),e)}deckingOptionChanged(e){e.materialSpecifier()&&this.setDeckingOption(e),this._displayProperties=void 0,this.notifyDisplayPropertiesChangedObservers()}deckingOptions(){return this.deckingOptionProvider().availableOptions().filter((e=>e.materialSpecifier()))}widthOptions(){return[{label:"6.5'",value:n.unit(6.5,"ft")},{label:"5'",value:n.unit(5,"ft")}]}deckingOption(){if(!this._deckingOption){const e=this.deckingOptionProvider().deckingOption();this._deckingOption=e.materialSpecifier()?e:this.deckingOptions().first()}return this._deckingOption}setDeckingOption(e){this._deckingOption=e}setBankSideHeight(e){super.setBankSideHeight(e),this.surface().resetComponents()}attachUpperFrame(e){super.attachUpperFrame(e),this.resetWidth()}detachFrame(e){if(!e)return;const t=this.upperFrame();super.detachFrame(e),e===t&&this.resetWidth()}fallbackSideDockHeight(){return n.unit(15,"in")}}},76954:(e,t,r)=>{const n=r(91211);e.exports=class DIYCompositeDock extends n{priceBreakdown(){const e={Decking:0,Structure:0};return this.components().forEach((t=>{const r=t.priceBreakdown();Object.keys(r).forEach((t=>e[t]+=r[t]))})),Object.keys(e).forEach((t=>e[t]=e[t].roundedTo(2))),e}}},7734:(e,t,r)=>{const n=r(63768),{RelativeLocator:i}=r(62048),s=r(5163),o=r(76954);e.exports=class LShapedDock extends o{static displayName(){return"L Shaped Dock"}static iconName(){return"l-shape"}slipLength(){return n.multiply(this.baseDockWidth(),3)}slipWidth(){return s.defaultWidth()}baseDockWidth(){return s.defaultWidth()}baseDockLength(){return s.defaultLength()}_buildSlipDocks(){const e=-n.chain(this.baseDockLength()).add(this.slipWidth()).divide(2).done().toNumeric(this.unit()),t=n.chain(this.slipLength()).subtract(this.baseDockWidth()).divide(2).done().toNumeric(this.unit());return[s.builder(this.unitProvider()).referencePoint(new i(this.referencePoint(),t,e)).angle(0).width(this.slipWidth()).length(this.slipLength()).build()]}_buildBaseDocks(){return[s.builder(this.unitProvider()).referencePoint(new i(this.referencePoint())).angle(Math.PI_2).width(this.baseDockWidth()).length(this.baseDockLength()).build()]}}},54558:(e,t,r)=>{const n=r(63768),{RelativeLocator:i}=r(62048),s=r(5163),o=r(76954);e.exports=class TShapedDock extends o{static displayName(){return"T Shaped Dock"}static iconName(){return"t-shape"}mirroringAllowed(){return!1}slipLength(){return n.multiply(this.baseDockWidth(),3)}slipWidth(){return s.defaultWidth()}baseDockWidth(){return s.defaultWidth()}baseDockLength(){return s.defaultLength()}_buildSlipDocks(){const e=-n.chain(this.baseDockLength()).add(this.slipWidth()).divide(2).done().toNumeric(this.unit());return[s.builder(this.unitProvider()).referencePoint(new i(this.referencePoint(),0,e)).angle(0).width(this.slipWidth()).length(this.slipLength()).build()]}_buildBaseDocks(){return[s.builder(this.unitProvider()).referencePoint(new i(this.referencePoint())).angle(Math.PI_2).width(this.baseDockWidth()).length(this.baseDockLength()).build()]}}},49053:(e,t,r)=>{const n=r(63768),{RelativeLocator:i}=r(62048),s=r(5163),o=r(76954);e.exports=class UShapedDock extends o{static displayName(){return"U Shaped Dock"}static iconName(){return"u-shape"}mirroringAllowed(){return!1}slipLength(){return s.defaultLength()}slipWidth(){return s.defaultWidth()}baseDockWidth(){return s.defaultWidth()}baseDockLength(){return n.multiply(this.slipWidth(),3)}_buildSlipDocks(){const e=this.unitProvider(),t=this.referencePoint(),r=this.slipWidth().toNumeric(this.unit()),o=-n.chain(this.slipLength()).add(this.baseDockWidth()).divide(2).done().toNumeric(this.unit());return[new i(t,r,o),new i(t,-r,o)].map((t=>s.builder(e).referencePoint(t).angle(Math.PI_2).width(this.slipWidth()).length(this.slipLength()).build()))}_buildBaseDocks(){return[s.builder(this.unitProvider()).referencePoint(new i(this.referencePoint())).angle(0).width(this.baseDockWidth()).length(this.baseDockLength()).build()]}}},10066:e=>{e.exports={DECKING:"Decking",ROOFING_MATERIAL:"Roofing Material",ROOFING:"Roofing",WATER_DEPTH:"Water Depth",RAILINGS:"Railings"}},36882:(e,t,r)=>{const n=r(63768),{$P:i,FixedEdgeLocator:s,NormalToEdgeLocator:o,ProportionalEdgeLocator:a}=r(62048),l=r(87558),c=r(69639),u=r(76133),d=r(73835);e.exports=class HipRoofWoodenFramer extends c{roofingShapes(){return this._roofingShapes(this.descriptor.roofingOverhangPastRafters())}sheathingShapes(){return this._roofingShapes(this.descriptor.sheathingOverhangPastRafters())}_roofingShapes(e){const t=this._extendHipRafterEdgesBy(e).map(((e,t,r)=>{const n=r.at(t-1);return u.clockwisePolygonFromEdgePair(n,e)}));return t.push(this.ridgeGeometry()),t}_extendHipRafterEdgesBy(e){const t=e.toNumeric(this.unit())/Math.cos(this.roof().pitchAngle())/Math.SQRT1_2;return this._hipRafterEdges().map((e=>e.begin().to(new a(e,1+t/e.length()))))}ridgeGeometry(){return u.clockwisePolygonFromEdgePair(...this._ridgeSideEdges())}makeRafters(){const e=[...this._defaultHipRafters(),...this._defaultEndRafters(),...this._defaultCommonRafters(),...this._defaultJackRafters()];return e.forEach((e=>e.setComponentOf(this.roof()))),e}makeRidge(){if(!this._shouldHaveRidge())return;const e=this.descriptor,t=e.ridgeSpecifier(),r=e.materialDepth(t)/2,n=this._ridgeEdge().addZ(r);return this._createMaterial(e.ridgeMaterialClass(),n,t,i(0,0),n.normal())}makeJoists(){if(!this.descriptor.hasJoists())return[];const e=this._ridgeEdge().addZ(this.roof().geometryHeight()),t=[...this._defaultJoistsUnderRidge(e),...this._defaultJoistsUnderJackAreas(e)],[r,n]=t.slice(-2).map((e=>e.edge()));return t.push(...this._defaultJoistsAtShortenedEnd(r,n)),t.forEach((e=>e.setComponentOf(this.roof()))),t}makeCollarTies(){const e=this._defaultCollarTies();return e.forEach((e=>e.setComponentOf(this.roof()))),e}makeBanding(){if(!this.descriptor.hasBanding())return[];const e=this._defaultBanding();return e.forEach((e=>e.setComponentOf(this.roof()))),e}makeStripping(){if(!this.descriptor.hasStripping())return[];const e=this._defaultStripping();return e.forEach((e=>e.setComponentOf(this.roof()))),e}makeWindBracing(){if(!this.descriptor.hasWindBracing())return[];const e=this._defaultWindBracing();return e.forEach((e=>e.setComponentOf(this.roof()))),e}makePostTopPlates(){if(!this.descriptor.hasPostTopPlates())return[];const e=this._defaultPostTopPlates();return e.forEach((e=>e.setComponentOf(this.roof()))),e}_defaultHipRafters(){const e=d.roles.HIP,t=this.descriptor.rafterSpecifier(e);return this._hipRafterEdges().map((r=>new d(r.begin(),r.end(),t,e)))}_defaultEndRafters(){const e=d.roles.END,t=this.descriptor.rafterSpecifier(e);return this._endRafterEdges().map((r=>new d(r.begin(),r.end(),t,e)))}_defaultCommonRafters(){const e=d.roles.COMMON,t=this.descriptor.rafterSpecifier(e);return this._commonRafterOffsets(this._ridgeEdge()).flatMap((r=>this._commonRafterPairEdges(r).map((r=>new d(r.begin(),r.end(),t,e)))))}_defaultJackRafters(){const e=this._rafterWidthNumeric()/2,t=this._endRafterEdges().flatMap((t=>[t.shiftedAlongNormalBy(e),t.shiftedAlongNormalBy(-e)])),r=[...this._commonRafterPairEdges(0),...this._commonRafterPairEdges(this._ridgeEdge().length())],n=d.roles.JACK,i=this.descriptor.rafterSpecifier(n),s=this._jackRafterCount(),o=this._rafterSpacingNumeric();return this._hipRafterEdges().flatMap((e=>[t.find((t=>t.sharesEndpointWith(e))),r.find((t=>t.sharesEndpointWith(e)))].flatMap((t=>{const r=e.direction().dot(t.normal()),n=Math.sign(r),l=r*e.length(),c=[];for(let r=0;r<s;r++){const s=n*(o*(r+1)),u=t.shiftedAlongNormalBy(s).end(),h=new a(e,s/l);c.push(new d(h,u,i,d.roles.JACK))}return c}))))}_defaultJoistsUnderRidge(e){const t=(this._joistWidthNumeric()+this._rafterWidthNumeric())/2;return this._commonRafterOffsets(e).map((r=>this._makeRidgeEdgeJoist(e,r+t)))}_defaultJoistsUnderJackAreas(e){const t=this._rafterWidthNumeric(),r=this._rafterSpacingNumeric(),n=this._jackRafterCount(),i=[];for(let s=0;s<n;s++){const n=e.length()+t+r*(s+1),o=t-e.length()-r*(s+1);i.push(this._makeRidgeEdgeJoist(e,o),this._makeRidgeEdgeJoist(e,n))}return i}_defaultJoistsAtShortenedEnd(e,t){const r=this._joistWidthNumeric(),[n,i]=[e,t].map((e=>{const t=e.normal().dot(this._centerLine().center().to(e.center()).direction());return e.shiftedAlongNormalBy(t*r/2)})),[s,o]=this.roof().endEdges().map((t=>t.direction().equals(e.direction())?t:t.reversed())),a=this._rafterWidthNumeric(),l=this.roof().crossAxis(),c=[n.center().to(s.center()).relativeToEdge(e),i.center().to(o.center()).relativeToEdge(t)].map((e=>{const t=l.dot(e.normal());return e.shiftedAlongNormalBy(t*(r+a)/2)})),u=c.map((e=>this._makeEndEdgeJoist(e))),d=this._rafterSpacingNumeric(),h=this._jackRafterCount();for(let e=0;e<h;e++)u.push(...c.flatMap((t=>{const n=t.normal().dot(l)*(d*(e+1)+r/2);return[t.shiftedAlongNormalBy(n),t.shiftedAlongNormalBy(-n)].map((e=>this._makeEndEdgeJoist(e,t)))})));return u}_defaultCollarTies(){const e=this.roof(),t=this._sidePitch(),r=this._ridgeEdge().addZ(-.5*this._ridgeWidthNumeric()*t),n=(e,r)=>e.shiftedAlongNormalBy(r).addZ(r*t),i=e.geometryWidth()/2/3,s=[n(r.reversed(),i),n(r,i)],o=(this._rafterWidthNumeric()+this._collarTieWidthNumeric())/2,a=[];return this._commonRafterOffsets(this._ridgeEdge()).forEach(((e,t,r)=>{if(!this.descriptor.shouldHaveCollarTieAt(t,r.length-1))return;const n=e-o;a.push(this._makeCollarTie(...s,n))})),a}_defaultBanding(){const e=this.descriptor,t=e.bandingMaterialClass(),r=e.bandingSpecifier(),n=e.materialWidth(r),s=e.materialDepth(r),o=this.roof().crossAxis(),a=this.roof().baseGeometry().snapshot().edges(),l=[];for(let c=0;c<e.bandingCount();c++){this.offsetHelper().applyOffsetToEdges(a,e.bandingOffset().add(n*(c+1),n*(c+1))).map((e=>(Math.abs(e.direction().dot(o)).isNearTo(1)&&e.stretchBy(2*-n),e.relativeTo(this.roof().referencePoint())))).forEach((e=>l.push(new t(e.begin(),e.end(),r,i(s/2,-n/2),e.normal()))))}return l}_defaultStripping(){const e=this.descriptor,t=this.roof().overhangEdgeGeometry(),r=e.strippingMaterialClass(),n=e.strippingSpecifier(),s=e.materialWidth(n),o=e.materialDepth(n),a=[],l=e.strippingSpacing().toNumeric(this.unit()),c=this.roof().geometryWidth()/2/Math.cos(this.roof().pitchAngle())-o,u=Math.ceil(c/l)+1,d=c/(u-1);for(let l=0;l<u;l++){const c=this.offsetHelper().applyOffsetToGeometry(t,e.strippingOffset().multipliedBy(l*d+o/2)).edges();a.push(...c.map((e=>new r(e.begin(),e.end(),n,i(0,s/2),e.normal().rotatedBy(i(0,0),0,Math.PI_2-this.roof().pitchAngle())))))}return a}_defaultWindBracing(){const e=this._roofPiles().filter((e=>this.roof().overhangEdgeGeometry().containsPoint(e.locator()))),t=this.substructure().postRows(e,this.frame().mainAxis()),r=this.substructure().postRows(e,this.frame().crossAxis()),n=[...t.first().slice(0,-1),...r.first().slice(0,-1),...t.last().reverse().slice(0,-1),...r.last().reverse().slice(0,-1)],i=n.length;return n.flatMap(((e,t)=>[this._makeBracingBetween(e,n[(t+1+i)%i]),this._makeBracingBetween(e,n[(t-1+i)%i])])).filter(Boolean)}_defaultPostTopPlates(){const e=this.descriptor,t=e.postTopPlateMaterialClass(),r=e.postTopPlateSpecifier(),n=e.materialWidth(r),s=e.materialDepth(r),o=this.roof().mainAxis(),a=this.roof().baseGeometry().snapshot().edges();return this.offsetHelper().applyOffsetToEdges(a,e.postTopPlateOffset()).map((e=>(Math.abs(e.direction().dot(o)).isNearTo(1)&&e.stretchBy(2*-s),e.relativeTo(this.roof().referencePoint())))).map((e=>new t(e.begin(),e.end(),r,i(-s/2,n/2),i(0,0,-1))))}_roofPiles(){return this.substructure().posts()}substructure(){return this.frame().foundation()}_makeBracingBetween(e,t){const r=this.descriptor.minBracingSpan().toNumeric(this.unit()),n=e.locator().xy().to(t.locator().xy());if(!n.length().isNearTo(r)&&n.length()<r)return;const s=this._bracingEdge(e,n.direction()),o=this.descriptor.windBracingSpecifier(),a=this.descriptor.materialDepth(o);return new(this.descriptor.windBracingMaterialClass())(s.begin(),s.end(),o,i(0,a/2),s.direction().cross(s.normal()))}_bracingEdge(e,t){const r=this.roof().baseGeometry().zLevel(),n=e.width().toNumeric(this.unit()),i=e.locator().xy().addZ(r).add(t.multipliedBy(n/2)),s=this.descriptor.bracingLength().toNumeric(this.unit())*Math.SQRT1_2,o=i.addZ(s),a=i.add(t.multipliedBy(s));return o.to(a).relativeTo(this.frame().referencePoint())}_ridgeEdge(){const e=this.roof(),t=this._centerLine().addZ(-e.geometryHeight()),r=(Math.min(e.geometryWidth(),t.length())-this._ridgeWidthNumeric())/2;return new s(t,r).to(new s(t,-r))}_centerLine(){const e=this.roof().endEdges();return e.at(0).center().to(e.at(-1).center())}_sidePitch(){const e=this.roof();return this._shouldHaveRidge()?2*e.geometryHeight()/(e.geometryWidth()-this._ridgeWidthNumeric()):e.pitch()}_ridgeSideEdges(){const e=this._ridgeEdge(),t=this._ridgeWidthNumeric();return[e.shiftedAlongNormalBy(t/2),e.shiftedAlongNormalBy(-t/2)]}_commonRafterPairEdges(e){const t=this.roof(),r=(t.geometryWidth()-this._ridgeWidthNumeric())/2,n=t.geometryHeight();return this._ridgeSideEdges().map(((t,i)=>{const a=i%2==0?r:-r,l=new s(t,0),c=new o(l,0,e),u=new o(l,a,e).addZ(n);return c.to(u)}))}_endRafterEdges(){const e=this._ridgeEdge();return this.roof().endEdges().map((t=>{const r=t.center();return e.closestRelativePointTo(r).to(r)}))}_hipRafterEdges(){const e=this._ridgeSideEdges(),t=this.roof().endEdges();return[e.last().begin().to(t.first().begin()),e.first().begin().to(t.first().end()),e.first().end().to(t.last().begin()),e.last().end().to(t.last().end())]}_shouldHaveRidge(){return this._ridgeEdge().length()>this.descriptor.minimumRidgeLength().toNumeric(this.unit())}_commonRafterOffsets(e){if(!this._shouldHaveRidge())return[e.length()/2];const t=this._rafterWidthNumeric(),r=this._rafterSpacingNumeric(),i=n.max(e.length()-t,t),s=n.ceil(i/r),o=(i/s).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES),a=[];for(let e=0;e<=s;e++)a.push(t/2+e*o);return a}_jackRafterCount(){return n.floor(this.roof().geometryWidth()/2/this._rafterSpacingNumeric())-1}_rafterSpacingNumeric(){return this.descriptor.rafterSpacing().toNumeric(this.unit())}_collarTieWidthNumeric(){return this.descriptor.materialWidth(this.descriptor.collarTieSpecifier())}_joistWidthNumeric(){return this.descriptor.materialWidth(this.descriptor.joistSpecifier())}_rafterWidthNumeric(e=d.roles.COMMON){return this.descriptor.materialWidth(this.descriptor.rafterSpecifier(e))}_ridgeWidthNumeric(){return this.descriptor.materialWidth(this.descriptor.ridgeSpecifier())}_makeRidgeEdgeJoist(e,t){const r=new s(e,t),n=this.roof().geometryWidth()/2,i=new o(r,n).to(new o(r,-n));return this._makeJoist(i,null,null,this.roof().mainAxis())}_makeEndEdgeJoist(e,t=e){return this._makeJoist(e,null,null,t.normal().negated())}_makeJoist(e,t,r,n){const s=this.descriptor,o=s.joistMaterialClass(),a=s.joistSpecifier(),l=i(-.5*s.materialDepth(a),0);return new o(e.begin(),e.end(),a,l,n)}_makeCollarTie(e,t,r){const n=1-r/e.length(),i=new a(e,n).to(new a(t,-n));return new l(i,this._sidePitch(),this.descriptor.collarTieSpecifier())}}},95039:(e,t,r)=>{const n=r(63768),i=r(26716);e.exports=class BetterDock extends i{static defaultWidth(){return n.unit(3,"ft")}static defaultLength(){return n.unit(6,"ft")}_defaultHeight(){return n.unit(18,"in")}minWidth(){return n.unit(1,"in")}maxWidth(){}minLength(){return n.unit(1,"in")}maxLength(){}lengthSnappingIncrement(){}widthSnappingIncrement(){}lengthSnappingSizes(){}widthSnappingSizes(){}snapToIncrement(e){return this.alongCrossAxis(e.vector())?this.lengthSnappingIncrement():this.widthSnappingIncrement()}snappableSizes(e){return this.alongCrossAxis(e.vector())?this.lengthSnappingSizes():this.widthSnappingSizes()}minimumSpan(e){return this.alongMainAxis(e.vector())?this.minWidth()?.toNumeric(this.unit()):this.minLength()?.toNumeric(this.unit())}maximumSpan(e){return this.alongMainAxis(e.vector())?this.maxWidth()?.toNumeric(this.unit())??1/0:this.maxLength()?.toNumeric(this.unit())??1/0}components(){return[...super.components(),this.surface()]}}},8389:(e,t,r)=>{const n=r(63768),{RelativeLocator:i}=r(62048),s=r(22619),o=r(31756);e.exports=class KalaniDock extends s{static displayName(){return'Kalani "The Heaven"'}static iconName(){return"kalani"}slipLength(){return n.unit(18,"kc")}firstSlipWidth(){return n.unit(3,"kc")}lastSlipWidth(){return n.unit(10,"kc")}baseDockWidth(){return n.unit(4,"kc")}baseDockLength(){return n.unit(7,"kc")}_buildSlipDocks(){const e=-n.chain(this.baseDockLength()).add(this.firstSlipWidth()).divide(2).done().toNumeric(this.unit()),t=-n.chain(this.baseDockLength()).add(this.lastSlipWidth()).divide(2).done().toNumeric(this.unit()),r=-n.chain(this.slipLength()).subtract(this.baseDockWidth()).divide(2).done().toNumeric(this.unit()),s=this.unitProvider(),a=new i(this.referencePoint(),e,r),l=o.builder(s).referencePoint(a).angle(Math.PI_2).width(this.firstSlipWidth()).length(this.slipLength()).build(),c=new i(this.referencePoint(),-t,r);return[l,o.builder(s).referencePoint(c).angle(Math.PI_2).width(this.lastSlipWidth()).length(this.slipLength()).build()]}_buildBaseDocks(){return[o.builder(this.unitProvider()).referencePoint(new i(this.referencePoint())).angle(0).width(this.baseDockWidth()).length(this.baseDockLength()).build()]}basePrice(){return 22999}}},22619:(e,t,r)=>{const{MissingOverride:n}=r(50988),i=r(91211);e.exports=class KonaCompositeDock extends i{basePrice(){throw new n(this,"basePrice")}priceBreakdown(){const e=this.systemStrategy(),t=this.numberOfAnchors();return{"Premium Dock":this.basePrice(),Anchoring:e.priceForAnchors(t),Decking:this.components().sum((e=>e.priceBreakdown().Decking))}}numberOfAnchors(){return 8}}},94230:(e,t,r)=>{const n=r(63768),{Polygon:i}=r(62048),s=r(2309),o=r(41908);e.exports=class KonaCube extends o{displayProperties(){return[]}setAngle(e){const t=e-this.angle();this.geometry().rotateBy(this.referencePoint(),t),super.setAngle(e)}boundingBox(){return this.geometry().boundingBox()}geometry(){if(!this._geometry){const e=n.unit(.5,"kc").toNumeric(this.unit());this._geometry=new i([this.referencePoint().add(-e,-e,-e),this.referencePoint().add(e,-e,-e),this.referencePoint().add(e,e,-e),this.referencePoint().add(-e,e,-e)]).rotatedBy(this.referencePoint(),this.angle()).relatedTo(this.referencePoint())}return this._geometry}_modelIdentifier(){return"kona-cube"}defaultFigure(){return new s(this)}}},31756:(e,t,r)=>{const n=r(63768),{FixedEdgeLocator:i,NormalToEdgeLocator:s}=r(62048),{lumber:o}=r(93613),a=r(26716),l=r(94230),c=r(79116);e.exports=class KonaDock extends a{static displayName(){return"Floating Dock"}static defaultWidth(){return n.unit(3,"kc")}static defaultLength(){return n.unit(6,"kc")}priceBreakdown(){const e=this.systemStrategy(),t=n.multiply(this.length(),this.width()),r=this.numberOfAnchors();return{"Std Floating Dock":e.priceForCubes(t),Anchoring:e.priceForAnchors(r),Decking:this.surface().price()}}snapToUnit(){return"kc"}height(){const e=n.unit(12,"in"),t=this._deckingHeightAboveCube();return n.add(e,t)}deckFramingSpecifier(){return o.PT2x6}_deckingHeightAboveCube(){const e=this.deckingOption().materialSpecifier();if(!e)return n.unit(0,"in");const t=this.deckFramingSpecifier().details().width;return n.add(t,e.details().width)}deckingOptionChanged(){const e=this.geometry().zLevel(),t=-this.height().toNumeric()-e;this.geometry().moveBy(0,0,t),this.resetComponents()}angleChanged(e){super.angleChanged(e),this.components().forEach((t=>t.setAngle?.(e)))}minimumSpan(){return n.unit(1,"kc").toNumeric(this.unit())}numberOfAnchors(){return this._baseNumberOfAnchors()+2*n.chain(this.length()).divide(n.unit(25,"ft")).floor()}_baseNumberOfAnchors(){return 2}deckingEdges(){const e=this.project().bank().primaryDirection();return this.alongMainAxis(e)?this.endEdges():this.sideEdges()}konaCubes(){return this._konaCubes||(this._konaCubes=this._defaultKonaCubes()),this._konaCubes}konaPins(){return this._konaPins||(this._konaPins=this._defaultKonaPins()),this._konaPins}_defaultKonaCubes(){const e=this.sideEdges().first(),t=n.unit(1,"kc").toNumeric(this.unit()),r=Math.round(this.width().toNumeric("kc")),o=Math.round(this.length().toNumeric("kc")),a=n.unit(.5,"kc").toNumeric(this.unit()),c=this._deckingHeightAboveCube().toNumeric(this.unit()),u=[];for(let n=0;n<o;n++){const o=new i(e,-(a+n*t));for(let e=0;e<r;e++){const r=new s(o,-(a+e*t)).addZ(a+c);u.push(new l(r,this.angle()))}}return u}_defaultKonaPins(){const e=this.sideEdges().first(),t=n.unit(1,"kc").toNumeric(this.unit()),r=Math.round(this.width().toNumeric("kc"))-1,o=Math.round(this.length().toNumeric("kc"))-1,a=n.unit(.5,"kc").toNumeric(this.unit()),l=this._deckingHeightAboveCube().toNumeric(this.unit()),u=[];for(let n=0;n<o;n++){const o=new i(e,-(n+1)*t);for(let e=0;e<r;e++){const r=new s(o,-(e+1)*t).addZ(a+l);u.push(new c(r,this.angle()))}}return u}addHeightChangedObserver(){}removeHeightChangedObserver(){}notifyHeightChangedObservers(){}components(){const e=[...super.components(),...this.konaCubes(),...this.konaPins()];return this.deckingOption().materialSpecifier()&&e.push(this.surface()),e}resetComponents(){super.resetComponents(),this._konaCubes=void 0,this._konaPins=void 0}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_konaCubes","_konaPins"]}}},86230:(e,t,r)=>{const{DimensionAnnotation:n}=r(62048);e.exports=class KonaDocksDimensionAnnotation extends n{text(){return`${super.text()} (${this.measurement().toNumeric("m").roundedTo(1)} m)`}}},79116:(e,t,r)=>{const n=r(41908);e.exports=class KonaPin extends n{displayProperties(){return[]}_modelIdentifier(){return"kona-pin"}}},71283:(e,t,r)=>{const n=r(63768),{RelativeLocator:i}=r(62048),s=r(22619),o=r(31756);e.exports=class MahinaDock extends s{static displayName(){return'Mahina "The Moon"'}static iconName(){return"mahina"}mirroringAllowed(){return!1}slipLength(){return n.unit(18,"kc")}slipWidth(){return n.unit(3,"kc")}baseDockWidth(){return n.unit(4,"kc")}baseDockLength(){return n.unit(7,"kc")}_buildSlipDocks(){const e=this.unitProvider(),t=this.referencePoint(),r=-n.chain(this.baseDockLength()).add(this.slipWidth()).divide(2).done().toNumeric(this.unit()),s=-n.chain(this.slipLength()).subtract(this.baseDockWidth()).divide(2).done().toNumeric(this.unit());return[new i(t,r,s),new i(t,-r,s)].map((t=>o.builder(e).referencePoint(t).angle(Math.PI_2).width(this.slipWidth()).length(this.slipLength()).build()))}_buildBaseDocks(){return[o.builder(this.unitProvider()).referencePoint(new i(this.referencePoint())).angle(0).width(this.baseDockWidth()).length(this.baseDockLength()).build()]}basePrice(){return 10699}}},43530:(e,t,r)=>{const n=r(63768),{RelativeLocator:i}=r(62048),s=r(22619),o=r(31756);e.exports=class OhanaDock extends s{static displayName(){return'Ohana "The Family"'}static iconName(){return"ohana"}slipLength(){return n.unit(18,"kc")}slipWidth(){return n.unit(3,"kc")}firstBaseDockWidth(){return n.unit(4,"kc")}lastBaseDockWidth(){return n.unit(9,"kc")}baseDockLength(){return n.unit(7,"kc")}_buildSlipDocks(){const e=-n.chain(this.baseDockLength()).add(this.slipWidth()).done().toNumeric(this.unit()),t=this.unitProvider();return[o.builder(t).referencePoint(new i(this.referencePoint(),e,0)).angle(Math.PI_2).width(this.slipWidth()).length(this.slipLength()).build(),o.builder(t).referencePoint(new i(this.referencePoint())).angle(Math.PI_2).width(this.slipWidth()).length(this.slipLength()).build(),o.builder(t).referencePoint(new i(this.referencePoint(),-e,0)).angle(Math.PI_2).width(this.slipWidth()).length(this.slipLength()).build()]}_buildBaseDocks(){const e=this.referencePoint(),t=this.unitProvider(),r=this.baseDockLength(),s=this.firstBaseDockWidth(),a=this.lastBaseDockWidth(),l=-n.chain(r).add(this.slipWidth()).divide(2).done().toNumeric(this.unit()),c=n.chain(this.slipLength()).subtract(s).divide(2).done().toNumeric(this.unit()),u=n.chain(this.slipLength()).subtract(a).divide(2).done().toNumeric(this.unit());return[o.builder(t).referencePoint(new i(e,l,c)).angle(0).width(s).length(r).build(),o.builder(t).referencePoint(new i(e,-l,u)).angle(0).width(a).length(r).build()]}basePrice(){return 21399}}},43775:(e,t,r)=>{const{MissingOverride:n}=r(50988),i=r(30691);e.exports=class ConnectionMixin{connections(){return this._connections||(this._connections=[]),this._connections}removeConnection(e){this.connections().remove(e),this.connectionsChanged(),this._afterConnectionRemoved(e)}updateConnections(){const e=[this._removeStaleConnections(),this._updateExistingConnections(),this._addMissingConnections()].some(Boolean);this._afterConnectionsUpdated(e)}_removeStaleConnections(){const e=this.connections().filter((e=>e.isStale()));return e.forEach((e=>e.delete())),e.length>0}_afterConnectionRemoved(e){}_updateExistingConnections(){const e=this.connections();return e.forEach((e=>e.update())),e.length>0}_addMissingConnections(){let e=!1;const t=this.connectionZLevel();return this._connectionEdgePairs().forEach((([{edge:r,frame:n},{edge:i,frame:s}])=>{if(this._hasConnectionFor(r,i))return;e||=!0;const o=[n,s],a=[r,i].map((e=>e.addZ(t))),l=new(this.connectionClass())(o,a);o.forEach((e=>e._addConnection(l))),this._afterConnectionAdded(l)})),e}_addConnection(e){this.connections().push(e),this.connectionsChanged()}_afterConnectionsUpdated(e){}connectionsChanged(){this.resetComponents()}_afterConnectionAdded(e){}connectionZLevel(){throw new n(this,"connectionZLevel")}connectionClass(){throw new n(this,"connectionClass")}_hasConnectionFor(e,t){return Boolean(this.connections().find((r=>r.edges().every((r=>r.xy().equals(e)||r.xy().equals(t)||r.xy().equals(e.reversed())||r.xy().equals(t.reversed()))))))}_connectionEdgePairs(){return this.edges().map((e=>e.xy())).flatMap((e=>this.overlappingFrameEdgesForEdge(e).map((t=>[{frame:this,edge:e},t]))))}overlappingFrameEdgesForEdge(e){return this.otherFrameEdges().filter((({edge:t})=>e.overlapsBySignificantDistance(t)))}otherFrameEdges(){return this.otherFrames().flatMap((e=>e.edges().map((t=>({edge:t.xy(),frame:e})))))}otherFrames(){return this.project().docks().filter((e=>e!==this))}connectionEdgesOn(e,t=this.connections()){return t.map((t=>{const r=i.overlappingEdgeSegments([e,t.sideEdges().first()]).first();if(r&&t.geometry().xy().containsPoint(r.center()))return r})).filter((e=>e))}connectedDocksAlong(e,t=this.connections()){const r=[];return t.forEach((t=>{const n=i.overlappingEdgeSegments([e,t.sideEdges().first()]).first();if(n&&t.geometry().xy().containsPoint(n.center()))return r.push(t)})),r.map((e=>e.otherDock(this)))}connectionFor(e,t){return this.connections().find((r=>r.geometry().containsPoint(e,t)))}connectionWith(e){return this.connections().find((t=>t.docks().includes(e)))}movingFinished(){this.updateConnections()}connectedDocks(){return this.connections().map((e=>e.docks().find((e=>e!==this))))}connectedMajorDocks(){return this.connections().filter((e=>e.isMinorDock(this))).map((e=>e.docks().find((e=>e!==this))))}connectedMinorDocks(){return this.connections().filter((e=>e.isMajorDock(this))).map((e=>e.docks().find((e=>e!==this))))}}},25830:(e,t,r)=>{const{extend:n}=r(50988),i=r(86580),s=r(33046),o=r(80317),a=(e,t)=>({structure:e,edge:t});class DockProjectWithRailingsMixin{railingCollectionClass(){return i}railingCollections(){return this.componentsForRoles(o.RAILING_COLLECTION)}recalculateRailings(){this.railingCollections().forEach((e=>this.remove(e)));const e=this.railingCollectionClass();this._railingTargetChains().forEach((t=>{const r=new e;this.add(r),t.forEach((e=>{r.addRun(this._createRunFor(r,e))}))}))}_railingTargetChains(){const e=this._railingEdgeSources().flatMap((e=>e.railingEdges().map((t=>a(e,t))))),t=[];for(;e.length>0;)t.push(this._railingTargetChainFor(e.first(),e));return t}_createRunFor(e,t){return e.createRun(t.edge)}_railingTargetChainFor(e,t){t.remove(e);const r=[e];return this._addConnectedTargetsOnEnd(r,t),this._addConnectedTargetsOnBegin(r,t),r}_railingEdgeSources(){return this.docks()}_addConnectedTargetsOnBegin(e,t){let r=!0;for(;r;){const n=e.first().edge,i=t.find((e=>e.edge.end().equals(n.begin())||e.edge.begin().equals(n.begin())));if(r=Boolean(i),r){const r=i.edge,s=r.begin().equals(n.begin())?r.reversed():r;e.unshift(a(i.structure,s)),t.remove(i)}}}_addConnectedTargetsOnEnd(e,t){let r=!0;for(;r;){const n=e.last().edge,i=t.find((e=>e.edge.begin().equals(n.end())||e.edge.end().equals(n.end())));if(r=Boolean(i),r){const r=i.edge,s=r.end().equals(n.end())?r.reversed():r;e.push(a(i.structure,s)),t.remove(i)}}}}n(DockProjectWithRailingsMixin,s);const l=DockProjectWithRailingsMixin;e.exports=l},60998:(e,t,r)=>{const{EditableProperty:n}=r(7340),{MissingOverride:i}=r(50988);e.exports=class DockProjectWithRoofsMixin{roofFlashingColor(){return this._roofFlashingColor??=this._defaultRoofFlashingColor()}_defaultRoofFlashingColor(){throw new i(this,"_defaultRoofFlashingColor")}setRoofFlashingColor(e){this._roofFlashingColor=e}roofFlashingColorProperty(){return new n(this,"Roof Flashing Color",{type:"color"})}roofSurfaceColor(){return this._roofSurfaceColor??=this._defaultRoofSurfaceColor()}_defaultRoofSurfaceColor(){throw new i(this,"_defaultRoofSurfaceColor")}setRoofSurfaceColor(e){this._roofSurfaceColor=e}roofSurfaceColorProperty(){return new n(this,"Roof Surface Color",{type:"color"})}roofColorProperties(){return[this.roofSurfaceColorProperty(),this.roofFlashingColorProperty()]}}},6364:(e,t,r)=>{const n=r(63768);e.exports=class DockWithAccessoriesMixin{static componentsFor(e){return e.includeAccessoriesInComponents()?e.accessories():[]}static cloneFor(e,t){return e.accessories().forEach((e=>e.cloneToDock(t)))}dockAccessorySnappingEdges(){return this.edges()}accessories(){return this._accessories??=[]}addAccessory(e){this.accessories().push(e),e.setFrame(this),this.includeAccessoriesInComponents()&&e.setComponentOf(this),this.accessoryAdded(e)}includeAccessoriesInComponents(){return!0}accessoryAdded(e){}accessoryRemoved(e){}detachAccessory(e){this.accessories().remove(e),e.setFrame(void 0),this.accessoryRemoved(e)}_filteredAccessories(e){return this.accessories().filter((t=>t.role?.()===e))}removeAllAccessories(){this.accessories().slice().forEach((e=>e.delete()))}accessoryAttachmentHeight(){return n.unit(-this.zLevel(),this.unit())}}},18313:(e,t,r)=>{const{extend:n}=r(50988),i=r(43775);class DockWithGroupingMixin{dockGroup(){return this.project()?.dockGroups().find((e=>e.docks().includes(this)))}addConnectedDockToGroup(e){const t=this.dockGroup()??e.dockGroup();t?(t.docks().includes(e)||t.add(e),t.docks().includes(this)||t.add(this)):this.project().createGroup(this,e)}removeConnectedDockFromGroup(e){const t=this.dockGroup()??e.dockGroup();t&&(0===this.connectedDocks().length&&t.remove(this),0===e.connectedDocks().length&&t.remove(e),t.docks().length<=1&&t.delete())}updateDockGroup(){this.dockGroup()?.docksChanged()}_afterConnectionAdded(e){this.addConnectedDockToGroup(e.otherDock(this))}_afterConnectionRemoved(e){this.removeConnectedDockFromGroup(e.otherDock(this))}_afterConnectionsUpdated(){this.updateDockGroup()}}n(DockWithGroupingMixin,i),e.exports=DockWithGroupingMixin},16461:(e,t,r)=>{const{EditableProperty:n}=r(7340),{MissingOverride:i}=r(50988),s=r(30691),o=r(5090);e.exports=class DockWithRailingsMixin{static railingEdgeMapPropertyName(){return"Railing Edge Map"}railingEdgeShape(){throw new i(this,"railingEdgeShape")}railingSubtractionEdgesFor(e){return[]}baseRailingEdges(){return this.edges().flatMap((e=>s.subtractSegmentsFromEdge(e,this.railingSubtractionEdgesFor(e))))}railingEdges(){return this.updateRailingEdgeMap(),this.baseRailingEdges().filter((e=>this.railingEdgeMap().get(e)))}railingEdgeMap(){return this._railingEdgeMap??=this._defaultRailingEdgeMap()}_defaultRailingEdgeMap(){return new o(this.baseRailingEdges().map((e=>[e,this.defaultRailingToggleValue(e)])))}defaultRailingToggleValue(e){return!1}setRailingEdgeMap(e,t){this.railingEdgeMap().set(e,t),this.recalculateRailings()}updateRailingEdgeMap(){const e=this.baseRailingEdges(),t=this.railingEdgeMap();this.edges().forEach((r=>{const n=t.keys().filter((e=>e.overlapsBySignificantDistance(r))),i=n.map((e=>t.get(e)));n.forEach((e=>t.delete(e)));e.filter((e=>e.overlapsBySignificantDistance(r))).forEach(((e,r)=>{const n=i[r]??this.defaultRailingToggleValue(e);t.set(e,n)}))}))}railingEdgeMapProperty(){return new n(this,this.constructor.railingEdgeMapPropertyName(),{type:this.railingEdgeMapPropertyType(),geometry:this.railingEdgeShape(),renderableItemForKey:e=>e})}railingEdgeMapPropertyType(){return"edge-boolean-map"}updateRailingMapProperty(){const e=this.displayProperties().find((e=>e.name()===this.constructor.railingEdgeMapPropertyName()));e.options().geometry=this.railingEdgeShape(),e.update()}recalculateRailings(){this.project().recalculateRailings()}railingCollections(){return this.railingRuns().map((e=>e.collection())).uniqueValues()}railingRuns(){return this.project().railingCollections().flatMap((e=>e.railingRuns())).filter((e=>this.railingEdges().find((t=>t.containsEdge(e.edge())))))}}},36887:(e,t,r)=>{const{MissingOverride:n}=r(50988);class FramedComponentMixin{static nonEssentialProperties(){return["_framer","_framingDescriptor"]}componentFramer(){return this._framer??=this._defaultFramer()}_defaultFramer(){throw new n(this,"_defaultFramer")}framingDescriptor(){return this._framingDescriptor??=this._defaultFramingDescriptor()}_defaultFramingDescriptor(){throw new n(this,"_defaultFramingDescriptor")}nonEssentialFramedComponentProperties(){return FramedComponentMixin.nonEssentialProperties()}}e.exports=FramedComponentMixin},61061:e=>{e.exports=class GangwayAttachableDockMixin{attachedGangways(){return this._attachedGangways||(this._attachedGangways=[]),this._attachedGangways}attachedConnectors(){return this.attachedGangways()}attachGangway(e){this.attachedGangways().push(e),this._gangwayAttachmentsChanged()}detachGangway(e){this.attachedGangways().remove(e),this._gangwayAttachmentsChanged()}detachAllGangways(){this.attachedGangways().slice().forEach((e=>e.detachFrame(this)))}_gangwayAttachmentsChanged(){}downwardGangways(){return this.attachedGangways().filter((e=>e.upperFrame()===this))}upwardGangways(){return this.attachedGangways().filter((e=>e.lowerFrame()===this))}gangwayAttachmentEdges(){return[...this.downwardGangways().map((e=>e.upperEdge())),...this.upwardGangways().map((e=>e.lowerEdge()))].filter(Boolean)}gangwayOverlappingEdgesFor(e){return this.attachedGangways().flatMap((t=>e.segmentsInsidePolygon(t.geometry())))}hasAttachedGangways(){return this.attachedGangways().length>0}}},6437:(e,t,r)=>{const{ProportionalEdgeLocator:n,$P:i}=r(62048),{MissingOverride:s}=r(50988);e.exports=class JoistGeneratorMixin{framingEdgePairs(){throw new s(this,"framingEdgePairs")}joistSpecifier(){throw new s(this,"joistSpecifier")}frame(){throw new s(this,"frame")}materialWidth(){throw new s(this,"materialWidth")}materialDepth(){throw new s(this,"materialDepth")}maxJoistSpacing(){throw new s(this,"maxJoistSpacing")}offsetHelper(){throw new s(this,"offsetHelper")}_makeJoist(e,t,r,n){throw new s(this,"_makeJoist")}joistOffset(){return i(0,0)}makeJoists(){return this.framingEdgePairs().flatMap((({edges:e,includeEnds:t,doubleOnEnd:r,doubleOnMiddle:n})=>this.makeJoistsForEdgePair(e,t,r,n)))}makeJoistsForEdgePair(e,t,r,i){const s=this.joistSpecifier(),[o,a]=this._applyOffsetToJoistEdges(e,r),l=o.length(),c=this.maxJoistSpacing().toNumeric(this._unit()),u=Math.ceil(l.roundedTo(0)/c)+1,d=[];for(let e=0;e<u;e++){let l=i;const c=0===e||e===u-1;if(c){if(!t)continue;l=r}const h=e/(u-1),p=o.direction().dot(a.direction()).isNearTo(-1)?a.reversed():a,m=new n(o,h).to(new n(p,h));d.push(...this._makeJoists(m,s,l,c))}return this._crossCutJoists(d)}_crossCutJoists(e){if(!this.frame().joistCrosscuttingGeometry)return e;const t=this.frame().joistCrosscuttingGeometry();return e.flatMap((e=>e.crosscutBoardFor(t)))}_applyOffsetToJoistEdges(e,t){return this.offsetHelper().applyOffsetToEdges(e,this.joistOffset()).map((e=>e.stretchedBy(-this._joistSpanInset(t))))}_joistSpanInset(e){const t=this.materialWidth(this.joistSpecifier());return e?2*t:t}_makeJoists(e,t,r,n){return this._makeJoistsWithMaker(this._makeJoist.bind(this),...arguments)}_makeJoistsWithMaker(e,t,r,n,s){const o=this.materialDepth(r)/2;if(n){const n=this.materialWidth(r)/2;return[e(t,r,i(-o,n)),e(t,r,i(-o,-n))]}return[e(t,r,i(-o,0))]}}},18934:(e,t,r)=>{const{EditableProperty:n}=r(7340),{MissingOverride:i}=r(50988);class PitchedRoofMixin{geometryHeight(){throw i(this,"geometryHeight")}pitchBaseGeometry(){throw i(this,"pitchBaseGeometry")}static defaultDisplayPropertiesFor(e){return e.defaultPitchedRoofGeometryDisplayProperties()}static nonEssentialProperties(){return["_pitchChoices"]}pitch(){return this._pitch??=this._defaultPitch()}setPitch(e){this._pitch=e,this.resetComponents()}pitchChoices(){return this._pitchChoices??=this.framingDescriptor().pitchChoices()}_defaultPitch(){return this.pitchChoices().at(this.framingDescriptor().defaultPitchChoiceIndex()).value}pitchAngle(){return Math.atan(this.pitch())}edges(){return this.pitchBaseGeometry().edges()}endEdges(){return this.edges().fastFilter((e=>Math.abs(this.crossAxis().dot(e.direction())).isNearTo(1)))}sideEdges(){return this.edges().fastFilter((e=>Math.abs(this.mainAxis().dot(e.direction())).isNearTo(1)))}geometryLength(){return this.sideEdges().at(0).length()}geometryWidth(){return this.endEdges().at(0).length()}defaultPitchedRoofGeometryDisplayProperties(){return[new n(this,"Pitch",{type:"select",choices:this.pitchChoices()})]}nonEssentialWoodFrameHipRoofProperties(){return PitchedRoofMixin.nonEssentialProperties()}}e.exports=PitchedRoofMixin},10962:(e,t,r)=>{const n=r(68768),i=r(16576),s=r(80317);e.exports=class ProjectWaterDepthMixin{static componentsFor(e){return[e.waterGradient()]}waterDepthService(){return this._waterDepthService??=this._defaultWaterDepthService()}_defaultWaterDepthService(){return new n(this)}waterGradient(){return this._waterGradient??=this._defaultWaterGradient()}_defaultWaterGradient(){const e=new i(this._defaultWaterGradientBreaklines());return e.setComponentOf(this),e}setWaterGradient(e){this._waterGradient=e}_defaultWaterGradientBreaklines(){return[]}dredgeZones(){return this.componentsForRoles(s.ZONE)}}},32723:(e,t,r)=>{const{MissingOverride:n}=r(50988),i=r(80317);e.exports=class ProjectWithDockGroupMixin{dockGroups(){return this.componentsForRoles(i.DOCK_GROUP)}createGroup(...e){const t=new(this._dockGroupClass());return e.forEach((e=>t.add(e))),this.add(t),t}_dockGroupClass(){throw new n(this,"_dockGroupClass")}}},76360:e=>{e.exports=class SelfOrientingRoofMixin{static resetComponentsFor(e){e.enforceCorrectOrientation()}enforceCorrectOrientation(){const e=this.framingLevel();if(!e)return;const t=e.endEdges().first().length().rounded()>e.sideEdges().first().length().rounded();this.setFlipped(t,{shouldReset:!1})}_afterSetComponentOf(e){this.enforceCorrectOrientation()}}},57129:(e,t,r)=>{const{MissingOverride:n}=r(50988);e.exports=class StructuralFoundationWithFramingLevelMixin{static componentsFor(e){return e.additionalFramingLevelComponents()}static resetComponentsFor(e){e.resetFramingLevelComponents()}additionalFramingLevelComponents(){return this.framingLevels()}resetFramingLevelComponents(){this.framingLevels().forEach((e=>e.resetComponents()))}framingLevels(){return this._framingLevels??=[]}addFramingLevel(e){this.framingLevels().push(e),this.resetComponents(),this._afterFramingLevelAdded(e)}removeFramingLevel(e){this.framingLevels().remove(e),this.resetComponents(),this._afterFramingLevelRemoved(e)}updateFramingLevelAngles(e,t){this.framingLevels().forEach((r=>r.angleChanged(e,t)))}hasFlippedFramingLevels(){return this.framingLevels().length>0&&this.framingLevels().every((e=>e.framing().flipped?.()))}_afterFramingLevelAdded(e){}_afterFramingLevelRemoved(e){}snappingLines(){if(!this.postRows)throw new n(this,"postRows");return[...this.postRows(this.posts(),this.mainAxis()),...this.postRows(this.posts(),this.crossAxis())].map((e=>e.first().locator().to(e.last().locator()).xy()))}}},42903:(e,t,r)=>{const{$P:n}=r(62048),{MissingOverride:i}=r(50988),s=r(72596),{equallySpacedEdges:o}=r(68606);e.exports=class TrussGeneratorMixin{_trussBaseEdges(){throw new i(this,"_trussBaseEdges")}roof(){throw new i(this,"roof")}endEdges(){throw new i(this,"endEdges")}roofPitch(){throw new i(this,"roofPitch")}joistSpecifier(){throw new i(this,"joistSpecifier")}materialDepth(){throw new i(this,"materialDepth")}materialWidth(){throw new i(this,"materialWidth")}ridgeHeight(){throw new i(this,"ridgeHeight")}_ridgeLocatorFor(){throw new i(this,"_ridgeLocatorFor")}_createMaterial(){throw new i(this,"_createMaterial")}maxTrussSpacing(){throw new i(this,"maxTrussSpacing")}trussBraceAngle(){throw new i(this,"trussBraceAngle")}_includeEndTrusses(){throw new i(this,"_includeEndTrusses")}_hasAngledTrussBraces(){throw new i(this,"_hasAngledTrussBraces")}beamSpecifier(){return this.joistSpecifier()}beamDepth(){return this.materialDepth(this.beamSpecifier())}beamWidth(){return this.materialWidth(this.beamSpecifier())}ridgeInset(){return 0}_spacedTrussEdges(e,t=!0){const r=this.maxTrussSpacing().toNumeric(this._unit());return o(e,r,t).map((e=>e.relativeTo(this.roof().referencePoint())))}makeTrusses(){return this._trussBaseEdges().flatMap((({edge:e,baseOfRidgeLocator:t,normalOffset:r,includeRidgeBrace:n})=>this._makeTruss(e,t,r,n)))}_makeTruss(e,t=e.center(),r=0,n=!0){const i=t.addZ(-this.ridgeHeight());return[this._makeTrussBase(e,r),...this._makePitchedBeams(e,i,r),...this._makeBraces(e,i,r,n)]}_makeTrussBase(e,t){return this._createBeamMaterial(e,n(this.beamDepth()/2,t))}_makePitchedBeams(e,t,r){const i=this.roofPitch()*this.beamDepth();return this._pitchedEdgesFromBaseEdge(e,t).flatMap((t=>{if(t.begin().xy().equals(t.end().xy()))return;const s=t.direction().negated(),o=t.begin().add(s.multipliedBy(i)).to(t.end()),a=t.xy().direction().dot(e.direction());return this._createBeamMaterial(o,n(-this.beamDepth()/2,a*r))})).filter((e=>e))}_makeBraces(e,t,r,n){return[...n?[this._makeRidgeBrace(e,t)]:[],...this._makeSupplementalBraces(e,t,r)]}_makeRidgeBrace(e,t){return this._createBeamMaterial(this._verticalBraceEdge(t),n(0,0),e.normal())}_makeSupplementalBraces(e,t,r){return this._braceEdges(e,t).map((t=>this._createBeamMaterial(t.stretchedBy(this.beamDepth()),n(0,r),e.normal())))}_braceEdges(e,t){return e.endpoints().flatMap((e=>{if(t.xy().distanceTo(e.xy()).isNearTo(0))return;const r=e.xy().subtract(t.xy()),n=this._hasAngledTrussBraces()?this._angledBraceEdge(t,r.theta()):this._verticalBraceEdge(t),i=n.movedByDelta(r).relativeTo(this.frame().referencePoint()),s=o([n,i],this.maxTrussSpacing().toNumeric(this._unit()),this._hasAngledTrussBraces()),a=t.to(e);return s.map((e=>{const t=e.intersectionsWithLine(a).first().to(e.end());if(!(t.length()<1))return t}))})).filter((e=>e))}_verticalBraceEdge(e){return e.to(e.addZ(this.ridgeHeight()))}_angledBraceEdge(e,t){const r=e.addZ(this.ridgeHeight());return e.rotatedBy(r,t,-this.trussBraceAngle()).to(r)}_pitchedEdgesFromBaseEdge(e,t){return e.endpoints().map((e=>t.to(e)))}_createBeamMaterial(e,t=n(0,0),r){return this._createMaterial(s,e,this.beamSpecifier(),t,r)}}},31908:e=>{class WoodFrameHipRoofMixin{static componentsFor(e){return e.additionalWoodFrameHipRoofComponents()}static resetComponentsFor(e){e.resetWoodFrameHipRoofComponents()}static nonEssentialProperties(){return["_ridge","_rafters","_collarTies","_banding","_stripping","_windBracing","_topPlates"]}geometricPeak(){return this.pitchBaseGeometry().centroid().addZ(-this.geometryHeight())}geometryHeight(){const e=this.framingDescriptor(),t=e.materialWidth(e.ridgeSpecifier());return this.pitch()*(this.geometryWidth()-t)/2}pitchBaseGeometry(){return this.overhangEdgeGeometry()}collarTies(){return this._collarTies??=this.framer.makeCollarTies()}rafters(){return this._rafters??=this.framer.makeRafters()}ridge(){return this._ridge??=this.framer.makeRidge()}banding(){return this._banding??=this.framer.makeBanding()}stripping(){return this._stripping??=this.framer.makeStripping()}windBracing(){return this._windBracing??=this.framer.makeWindBracing()}topPlates(){return this._topPlates??=this.framer.makePostTopPlates()}additionalWoodFrameHipRoofComponents(){return[this.ridge(),...this.rafters(),...this.collarTies(),...this.banding(),...this.stripping(),...this.windBracing(),...this.topPlates()].filter(Boolean)}resetWoodFrameHipRoofComponents(){this._ridge=void 0,this._rafters=void 0,this._collarTies=void 0,this._banding=void 0,this._stripping=void 0,this._windBracing=void 0,this._topPlates=void 0}nonEssentialWoodFrameHipRoofProperties(){return WoodFrameHipRoofMixin.nonEssentialProperties()}}e.exports=WoodFrameHipRoofMixin},86580:(e,t,r)=>{const n=r(31560),i=r(97477),s=r(23525),o=r(59503),a=r(48661);e.exports=class DockRailingCollection extends i{isSelectable(){return!1}runClass(){return o}sectionClass(){return s}defaultFigure(){return new n(this)}createRunOn(e,t){const r=this.createRun(t);return r.setFrameStructure(e),r}zLevel(){return this.railingRuns().first().edge().begin().z()-this.railingHeight().toNumeric(this.unit())}threeFigure(){const e=new a(this);return e.setLayer(this.project().systemStrategy().railingsLayer()),e}}},59503:(e,t,r)=>{const n=r(33496);e.exports=class DockRailingRun extends n{frameStructure(){return this._frameStructure??=this._defaultFrameStructure()}_defaultFrameStructure(){}setFrameStructure(e){this._frameStructure=e}}},23525:(e,t,r)=>{const n=r(10590),i=r(64463);e.exports=class DockRailingSection extends n{_defaultRailingStyle(){const e=this.frameStructure().railingStyleFor?.(this.edge());return e??new i}blockClass(){return this.railingStyle().blockClass()}_classForPost(e,t){return this.railingStyle().postClass()}postLocations(){return this.postMountStyle().postLocationsFor?.(this)||super.postLocations()}frameStructure(){return this.run().frameStructure()}}},64463:(e,t,r)=>{const n=r(63768),i=r(80371),s=r(58684),o=r(3679);e.exports=class DockRailingStyle extends s{railWidth(){return n.unit(3,"in")}railDepth(){return n.unit(1,"in")}blockClass(){return o}postClass(){return i}}},30217:(e,t,r)=>{const n=r(48909),i=r(80240),s=r(85438);e.exports=class AnchorPlatformFigure extends n{constructor(e){super(),this.setModel(e)}boundingBox(){return this.model().boundingBox()}_draw(e,t){if(t.shapeOnly){const t="#f2cca8";e.fillStyle=this.model().deckingOption()?.colors?.()?.first()||t,e.strokeStyle="transparent",e._drawPolygon(this.model().geometry())}else super._draw(e,t)}defaultHandles(){return[...this.model().vertices().map((e=>new s(this.model(),e))),this.selfHandle()]}selfHandle(){return new i(this)}defaultProperties(){return{...super.defaultProperties(),strokeStyle:"#3b3be8",fillStyle:"#aaaaaa"}}}},34031:(e,t,r)=>{const{CompositeFigure:n}=r(7340),i=r(72029);e.exports=class CompositeDockFigure extends n{defaultHandles(){return[this.selfHandle()]}selfHandle(){return new i(this)}handlesAt(e,t,r={}){const{scale:n,layerManager:i}=r,s=this.layerVisible(i),o=this.selfHandle();return s&&o.contains(e,t,n)?[o]:[]}}},17053:(e,t,r)=>{const{CompositeFigure:n}=r(7340);e.exports=class DeckingSurfaceFigure extends n{constructor(e){super(),this._layer="Decking",this.setModel(e)}defaultHandles(){return[]}moveBy(){return!1}contains(e,t){return this.model().contains(e,t)}defaultProperties(){return{strokeStyle:"black",lineWidth:"0.1"}}_skipDrawing(e,{bounds:t,layerManager:r}={}){return!this.layerVisible(r)||t&&!t.intersects(this.boundingBox())}}},24448:(e,t,r)=>{const n=r(18734),i=r(14558);e.exports=class DockAccessoryFigure extends n{defaultHandles(){return[this.selfHandle()]}selfHandle(){return new i(this)}}},82110:(e,t,r)=>{const n=r(63768),{Drawable:i}=r(7340),{Polygon:s}=r(62048),o=r(46960);e.exports=class DockBankFigure extends i{constructor(e){super(),this.setModel(e)}_skipDrawing(){return!1}boundingBox(){return this.model().boundingBox()}contains(e,t){return!1}moveBy(e,t){return!1}unit(){return this.model().unit()}_draw(e,{bounds:t}={}){this._drawLand(e,t),this._drawBankByType(e,t)}_drawBankByType(e,t){this.model().isSteepEntry()?this._drawSteepEntry(e,t):this.model().isSeaWall()&&this._drawSeaWall(e,t)}_drawSteepEntry(e,t){e.strokeStyle="#C5D024",e.fillStyle="transparent";const r=this._shoreLocators(t),i=n.unit(2,"ft").toNumeric(this.unit()),a=r.map((e=>e.add(0,i)));a.reverse();const l=new s([...r,...a]);o(e,l,10,[-Math.PI_4])}_drawSeaWall(e,t){e.fillStyle="#a3a6a2";const r=this.model().seaWall().geometry(t);e._drawPolygon(r)}_drawLand(e,t){e.strokeStyle="transparent",e.fillStyle="hsla(95, 45%, 40%, 1)";const r=[...this._shoreLocators(t),t.bottomRight(),t.bottomLeft()];e._drawPolygon(new s(r))}_shoreLocators(e){return this.model().extrusionPath(e).getPoints(this.model().pathSteps()).map((e=>e.toPoint()))}}},39792:(e,t,r)=>{const n=r(85438),i=r(48426),s=r(72029),o=r(552),a=r(48909);e.exports=class DockFigure extends a{constructor(e){super(),this.setModel(e)}_draw(e,t){t.shapeOnly?this._drawDockShapeOnly(e,t):super._draw(e,t)}_drawDockShapeOnly(e,t){const r=this.model().deckingColorSource?.()??this.model().deckingOption();e.fillStyle=r?.colors2D()??"#f2cca8",e.strokeStyle="transparent",e._drawPolygon(this._shapeOnlyGeometry())}_shapeOnlyGeometry(){return this.model().geometry()}_drawFigures(e,t){const r=this.figures(),n=this.model().shouldShowSubstructure();for(let i=0;i<r.length;i++){const s=r[i];(s.model()===this.model().surface()||n)&&s.draw(e,t)}}boundingBox(){return this.model().boundingBox()}defaultHandles(){return[...this.rotationHandles(),...this.resizingHandles(),...this.slipHandles(),this.selfHandle()]}selfHandle(){return new s(this)}rotationHandles(){return this.model().vertices().map((e=>new n(this.model(),e)))}resizingHandles(){return this.model().movableEdges().map((e=>new i(e,this)))}slipHandles(){return this.model().slipHandleLocators().map((e=>new o(e,this)))}}},32398:(e,t,r)=>{const n=r(39792);e.exports=class DockFigureWithSubModels extends n{subModels(){return this.model().figureSubModels()}_drawFigures(e,t,r=this.figures()){r.filter((e=>e.zLevel().isNearTo(t.zLevel))).forEach((r=>r.draw(e,t)))}handlesAt(e,t,r){const n=super.handlesAt(e,t,r),i=[];if(this.layerVisible(r.layerManager)){this.subModels().map((e=>this.figures().find((t=>t.model()===e)))).sort(this._componentSorter.bind(this)).forEach((n=>{const s=n.selfHandle();n.layerVisible(r.layerManager)&&s.contains(e,t,r.scale)&&i.push(s)}))}return i.fastConcat(n)}_draw(e,t){if(t.shapeOnly){t.zLevel&&!t.zLevel.isNearTo(this.zLevel())||this._drawDockShapeOnly(e,t);const r=this.figures().filter((e=>this.subModels().includes(e.model())));this._drawFigures(e,t,r)}else this._drawFigures(e,t)}_shapeOnlyGeometry(){return this.model().deckingShape()}zLevels(){return[...this.figures().map((e=>e.zLevel().roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES))),this.zLevel().roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES)].uniqueValues()}}},56562:(e,t,r)=>{const{CompositeFigure:n}=r(7340);e.exports=class DockRoofFigure extends n{_draw(e,t){if(t.shapeOnly){const t=this.model().surfaceColor();e.fillStyle=t,e.strokeStyle=this._contrastHexColor(t),e.lineWidth=.3,this.model().roofing().forEach((t=>e._drawPolygon(t.geometry())))}else super._draw(e,t)}}},21158:(e,t,r)=>{const n=r(48909),i=r(78868),s=r(47910),o=r(10066);e.exports=class DockRoofFramingLevelFigure extends n{constructor(e){super(),this.setModel(e),this.setLayer(o.ROOFING)}zLevel(){return this.model().zLevel()}selfHandle(){return new s(this)}defaultHandles(){return[...this.model().edges().map((e=>new i(e,this))),this.selfHandle()]}}},41730:(e,t,r)=>{const n=r(38550),i=r(10066);e.exports=class DredgeZoneFigure extends n{_hatchingProperties(){return{...super._hatchingProperties(),lineWidth:2,spacing:15}}layer(){return i.WATER_DEPTH}}},84757:(e,t,r)=>{const n=r(85438),i=r(82874),s=r(48909),o=r(21065),a=r(35979);e.exports=class GangwayFigure extends s{constructor(e){super(),this.setModel(e)}boundingBox(){return this.model().boundingBox()}_draw(e,t){t.shapeOnly?this._drawShapeOnly(e,t):super._draw(e,t),this.drawArrow(e,t)}_drawShapeOnly(e,t){let r="#aaaaaa";this.model().surfaceType()===o.Wooden&&(r=this.model().deckingOption()?.colors?.()?.first()||"#f2cca8"),e.fillStyle=r,e.strokeStyle="transparent",e._drawPolygon(this.model().geometry())}drawArrow(e,t){e._alterAndRestoreAfter((()=>{e.fillStyle="#000000",e.strokeStyle="#000000",e.lineWidth=4,e.textAlign="center",e.textBaseline="middle";const t=this.model().locator().add(this.model().mainAxis().multipliedBy(-10)),r=this.model().locator().add(this.model().mainAxis().multipliedBy(20)),n=this.model().locator().add(this.model().mainAxis().multipliedBy(-15));e._drawArrow(t.to(r),16,12);const i=(this.model().angle()<=Math.PI?this.model().angle():this.model().angle()-Math.PI)-Math.PI_2;e.translate(n.x(),n.y()),e.rotate(i),e.fillText("Down",0,0)}))}defaultHandles(){return[...this._rotationHandles(),...this._edgeHandles(),this.selfHandle()]}_rotationHandles(){return this.model().vertices().map((e=>new n(this.model(),e)))}_edgeHandles(){if(this.model().surfaceType()!==o.Aluminum)return[];const e=new i(this.model().lowerEdge(),this);if(this.model().upperFrame())return[e];return[e,new i(this.model().upperEdge(),this)]}selfHandle(){return new a(this)}}},2309:(e,t,r)=>{const{Drawable:n}=r(7340);e.exports=class KonaCubeFigure extends n{constructor(e){super(),this.setModel(e)}boundingBox(){return this.model().boundingBox()}contains(e,t){return!1}moveBy(e,t){return!1}_draw(e,t){e._drawPolygon(this.model().geometry())}defaultProperties(){return{...super.defaultProperties(),strokeStyle:"#4d2f00",fillStyle:"#aaaaaa",lineWidth:.4}}}},98776:(e,t,r)=>{const{Drawable:n}=r(7340);e.exports=class MetalFrameSectionFigure extends n{constructor(e){super(),this.setModel(e)}boundingBox(){return this.model().boundingBox()}contains(e,t){return!1}moveBy(e,t){return!1}_draw(e,t){e._drawPolygon(this.model().geometry())}defaultProperties(){return{...super.defaultProperties(),strokeStyle:"#5c5c5c",fillStyle:"#aaaaaa",lineWidth:.3}}}},11987:(e,t,r)=>{const{Drawable:n}=r(7340),i=r(5834);e.exports=class PileFigure extends n{constructor(e){super(),this.setModel(e)}zLevel(){return this.model().topLocator().z()}_draw(e,t){e._drawCircle(this.model().geometry())}boundingBox(){return this.model().boundingBox()}properties(){const e=this.model().color();return e?{strokeStyle:"#000000",fillStyle:e,lineWidth:.1}:i(this.model().materialNames().first())}}},93240:(e,t,r)=>{const n=r(94454),i=r(73895);e.exports=class SuggestedWaterGradientBreaklineFigure extends i{_drawLine(e,t){}_drawText(e,t){this._drawPlusSign(e,t)}_drawPlusSign(e,t){const r=2*this.circleRadius(e.runningScaleX())/3;e.strokeStyle="#DADADA",e.lineWidth=e._pixelsToDrawingUnits(3).constrained(1,5),e._drawLine(t.add(-r,0),t.add(r,0)),e._drawLine(t.add(0,-r),t.add(0,r))}circleRadius(e){return super.circleRadius(e)/2}defaultProperties(){const e=super.defaultProperties();return e.fillStyle="rgba(32, 32, 32, 0.3)",e}selfHandle(){return new n(this,this.model())}}},22454:(e,t,r)=>{const{Drawable:n}=r(7340),i=r(46960);e.exports=class WalkwayMeshFigure extends n{constructor(e){super(),this.setModel(e)}boundingBox(){return this.model().boundingBox()}contains(e,t){return!1}moveBy(e,t){return!1}_draw(e,t){const r=this.model().geometry().edges().last().angle();i(e,this.model().geometry(),1.5,[20..degreesToRadians()+r,(-20).degreesToRadians()+r])}defaultProperties(){return{...super.defaultProperties(),strokeStyle:"#5c5c5c",fillStyle:"transparent",lineWidth:.5}}}},73895:(e,t,r)=>{const{Drawable:n,Handle:i}=r(7340),{$P:s}=r(62048),o=r(64873),a=r(10066);e.exports=class WaterGradientBreaklineFigure extends n{constructor(e){super(),this.setModel(e)}_draw(e,t){const r=this.circleLocator();this._drawCircle(e,r),this._drawLine(e,t),this._drawText(e,r)}_drawCircle(e,t){e._alterAndRestoreAfter((()=>{const r=this.circleRadius(e.runningScaleX());e.shadowColor="rgba(0, 0, 0, 0.3)",e.shadowBlur=24,e.shadowOffsetY=8,e._drawCircle(t.expandedByRadius(r))}))}_drawLine(e,t){const r=t.bounds;e._alterAndRestoreAfter((()=>{const t=this.model().locator().y();e._pixelLineWidth=3,e.globalCompositeOperation="destination-over",e._drawDashedLine(s(r.left(),t),s(r.right(),t),[90,60])}))}_drawText(e,t){e.font=`${this._textFontSize(e)}px helvetica`,e.fillStyle=this._textFillStyle(),e.fillText(this._text(),t.x(),t.y()+this._textDeltaY(e))}_text(){return this.model().formatDepth()}_textFillStyle(){return"#FFFFFF"}_textFontSize(e){return e._pixelsToDrawingUnits(21).constrained(7,28)}_textDeltaY(e){const t=this._text();return e.measureText(t).actualBoundingBoxAscent/2}circleLocator(){const e=this._baseLocator();return e.add(this.model().locator()).relatedTo(e)}_baseLocator(){return this.model().gradient().locator()}circleRadius(e){return(30/e).constrained(10,40)}defaultProperties(){return{fillStyle:"rgba(31, 160, 246, 0.6)",strokeStyle:"rgba(31, 160, 246, 0.6)",textBaseline:"alphabetic",textAlign:"center"}}contains(){return!1}_skipDrawing(e,{layerManager:t}={}){return!this.layerVisible(t)}layer(){return a.WATER_DEPTH}handlesAt(e,t,{scale:r,layerManager:n,validWhen:s=[i.VALID_FOR_HOVER],visibleBounds:o}={}){return this.layerVisible(n)?this.handles().fastFilter((n=>s.includes(n.validWhen())&&n.contains(e,t,r,o))):[]}defaultHandles(){return[this.selfHandle()]}selfHandle(){return new o(this,this.model())}}},76972:(e,t,r)=>{const n=r(63768),{CompositeFigure:i}=r(7340),s=r(93240),o=r(90019),a=r(46748),l=r(10066);e.exports=class WaterGradientFigure extends i{static paddingLeft(e){return(120/e).constrained(40,160)}constructor(e){super(),this.setModel(e)}layer(){return l.WATER_DEPTH}_drawSelf(e,t){this.suggestedBreaklineFigures().forEach((r=>r.draw(e,t)))}handlesAt(e,t,r){const n=super.handlesAt(e,t,r),i=this.suggestedBreaklineFigures();for(let s=i.length-1;s>=0;s--)n.fastMerge(i[s].handlesAt(e,t,r));return n}suggestedBreaklines(){return this._suggestedBreaklines??=this._defaultSuggestedBreaklines()}_defaultSuggestedBreaklines(){const e=this.model().breaklines(),t=[];for(let r=1;r<e.length;r++){const n=e.at(r-1),i=e.at(r),s=a`(${i.distanceFromShore()} + ${n.distanceFromShore()}) / 2`,o=a`(${i.depth()} + ${n.depth()}) / 2`;t.push(this._createSuggestedBreakline(s,o))}const r=e.at(-1);return t.push(this._createSuggestedBreakline(n.add(r.distanceFromShore(),n.unit(10,"ft")),r.depth())),t}_createSuggestedBreakline(e,t){const r=new o(e,t);return r.setComponentOf(this.model()),r}suggestedBreaklineFigures(){return this._suggestedBreaklineFigures??=this._defaultSuggestedBreaklineFigures()}_defaultSuggestedBreaklineFigures(){return this.suggestedBreaklines().map((e=>new s(e)))}resetSuggestedBreaklines(){this._suggestedBreaklines=void 0,this._suggestedBreaklineFigures=void 0}updateFigures(){super.updateFigures(),this.resetSuggestedBreaklines()}zLevel(){return-1/0}_draw(e,t){if(t.visibleBounds){const r=t.visibleBounds.left()+this.constructor.paddingLeft(e.runningScaleX());this.model().updateLocatorX(r)}super._draw(e,t)}}},81882:(e,t,r)=>{const n=r(63768),{Drawable:i}=r(7340),{Polygon:s,$P:o}=r(62048),a=r(35668);e.exports=class WaterGradientProjectedFigure extends i{constructor(e,t,r,n){super(),this.setModel(e),this.setAxes(t,r,n)}xAxis(){return this._xAxis}yAxis(){return this._yAxis}zAxis(){return this._zAxis}setAxes(e,t,r){this._xAxis=e,this._yAxis=t,this._zAxis=r??e.cross(t)}_draw(e,t){this._drawSeaFloor(e,t),this._drawWater(e,t)}_drawWater(e,t){const r=this.locators().slice(),n=this.model().project().bank().shoreLine(),i=new a(n,this.xAxis(),this.yAxis(),this.zAxis());r.unshift(i),r.push(o(t.bounds.right(),r.last().y())),r.push(o(t.bounds.right(),0));const l=this._waterFillStyle(e);this._setFillStyle(e,l,t),e._drawPolygon(new s(r))}_waterFillStyle(e){const t=n.unit(10,"ft").toNumeric(this.model().project().unit()),r=e.createLinearGradient(0,0,0,t);return r.addColorStop(0,"rgba(25, 76, 179, 0.2)"),r.addColorStop(1,"rgba(19, 76, 134, 0.5)"),r}_drawSeaFloor(e,t){const r=this.locators().slice();r.unshift(o(t.bounds.left(),r.first().y())),r.unshift(t.bounds.bottomLeft()),r.push(o(t.bounds.right(),r.last().y())),r.push(t.bounds.bottomRight());this._setFillStyle(e,"#381d05",t),e._drawPolygon(new s(r))}_setFillStyle(e,t,r){r.printWithColor?(e.fillStyle=t,e.strokeStyle="transparent"):(e.fillStyle="transparent",e.strokeStyle="#000000")}boundingBox(){return new s(this.locators()).boundingBox()}locators(){return this.model().breaklines().map((e=>new a(e.locator(),this.xAxis(),this.yAxis(),this.zAxis())))}zLevel(){return 1/0}_getAnnotationsFromModel(){return[]}}},80240:(e,t,r)=>{const n=r(47910);e.exports=class AnchorPlatformHandle extends n{activate(){this._didMove=void 0}deactivate(){this._didMove&&this.selectableComponent().detachAllGangways()}moveFromTo(e,t,r,n){const i=super.moveFromTo(e,t,r,n);return this._didMove||(this._didMove=i),i}}},14558:(e,t,r)=>{const{$P:n,FixedEdgeLocator:i,NormalToEdgeLocator:s}=r(62048),o=r(47910);e.exports=class DockAccessoryHandle extends o{model(){return this.object().model()}activate(e){this._tool=e}deactivate(){this._offset=void 0,this._frame&&(this.model().detachFromFrame(),this._frame.addAccessory(this.model())),this._tool=void 0}tool(){return this._tool}moveFromTo(e,t,r,i){this.setCursorStyle(r,i);const s=this.model().referencePoint();this._offset||(this._offset=n(e,t).subtract(s));const o=n(r,i).subtract(this._offset),{locator:a,frame:l}=this.snappingLocation(o);this._frame=l;const c=a??o,u=!s.edge()?.equals(c.edge?.());s.setSource(c),u&&this.model().locatorSourceChanged();const d=c.subtract(s),h=l?-l.accessoryAttachmentHeight().toNumeric(this.model().unit())-s.z():0;return s.moveBy(d.x(),d.y(),h)}setCursorStyle(e,t){this.isCursorOverInvalidLocation(e,t)?this.tool()?.setCursor("not-allowed"):this.tool()?.setCursor()}snappingLocation(e){return 0===this._snappableFrames().length?{}:this._findSnappingLocation(e)}_findSnappingLocation(e){return this._snapAroundConnectionBrackets(e)}_snapAroundConnectionBrackets(e){const t=this.model().width().toNumeric(this.model().unit()),r=this._snappableFrames().flatMap((e=>e.dockAccessorySnappingEdges().map((t=>({edge:t,frame:e}))))).map((({edge:r,frame:n})=>{const i=r.stretchedBy(-t).closestPointTo(e,!1);return this._frameRelativeLocatorFor(i,r,n)}));return this._closestPoint(r,e)}_frameRelativeLocatorFor(e,t,r){const n=r.edges().find((e=>e.direction().equals(t.direction()))),o=e.subtract(n.begin()),a=o.dot(n.normal()),l=o.dot(n.direction()),c=new i(n,0);return{locator:new s(c,a,l),frame:r}}_snappableFrames(){return this.model().project().docks().filter(this.model().frameFilter())}isCursorOverInvalidLocation(e,t){const r=this.model().frameFilter();return this.model().project().docks().filter((e=>!r(e))).some((r=>r.geometry().contains(e,t)))}_closestPoint(e,t){return e.sort(this._sortByDistance.bind(this,t)).first()}_sortByDistance(e,t,r){return t.locator.distanceTo(e)-r.locator.distanceTo(e)}}},36669:(e,t,r)=>{const{LocatorHandle:n,CircleFigure:i}=r(7340),{$P:s}=r(62048);e.exports=class DockBankControlPointHandle extends n{constructor(e){super(e.locator()),this._controlPoint=e}controlPoint(){return this._controlPoint}selectableComponent(){return this.controlPoint()}locator(){return this.object()}activate(e){}deactivate(e){this._offset=void 0}moveFromTo(e,t,r,n){const i=this.object();this._offset||(this._offset=s(e,t).subtract(i));const o=s(r,n).subtract(this._offset),a=(this.constrainTarget(o)??o).subtract(i),l=this.moveBy(a.x(),a.y());return l&&!this.controlPoint().includedInControlPoints()&&this.controlPoint().componentOf().addControlPoint(this.controlPoint()),l}constrainTarget(e){if(!this.controlPoint().includedInControlPoints())return;const t=this.adjacentControlPoints().find((({point:t,constrainAxis:r})=>t&&e.subtract(t.locator()).dot(r)>=0));if(t){const r=t.point.locator();return r.to(r.add(this.normalAxis())).closestPointTo(e,!0)}}adjacentControlPoints(){const e=this.constrainAxis(),t=this._controlPoints().indexOf(this.controlPoint());return[{point:this._controlPoints()[t-1],constrainAxis:e.negated()},{point:this._controlPoints()[t+1],constrainAxis:e}]}constrainAxis(){return this.controlPoint().componentOf().extrusionDirection()}normalAxis(){return this.constrainAxis().rotatedBy(s(0,0),Math.PI_2)}_controlPoints(){return this.controlPoint().componentOf().controlPoints()}shape(){return this.object().expandedByRadius(4)}contains(e,t,r){return this.shape().contains(e,t)}draw(e,t){this.drawHandle(e,this.indicatorProperties(),t)}drawSelected(e,t){this.drawHandle(e,this._selectedProperties(),t)}drawEditMode(e,t){this.controlPoint().includedInControlPoints()&&this.drawHandle(e,this._editModeProperties(),t)}drawHandle(e,t,r){const n=new i(this.shape());n.updateProperties(t),n.draw(e,r)}_selectedProperties(){return{fillStyle:"rgba(31, 160, 246, 0.3)",strokeStyle:"#1FA0F6",_pixelLineWidth:3}}_editModeProperties(){return{fillStyle:"rgba(255, 120, 0, 0.3)",strokeStyle:"#ff7800",_pixelLineWidth:3}}}},552:(e,t,r)=>{const n=r(63768),{FrameAdjusterHandle:i,Handle:s}=r(7340),{NormalToEdgeLocator:o,Polygon:a,$P:l}=r(62048),{extend:c}=r(50988),u=r(29245),d=r(54896),h=r(84434);class DockSlipHandle extends i{constructor(e,t){super(void 0,t),this._slipHandleLocator=e,this._figure=t}frame(){return this.newDock()}dock(){return this._figure.model()}newDock(){return this._newDock}newDockFigure(){return this._newDockFigure}slipHandleLocator(){return this._slipHandleLocator}setSlipHandleLocator(e){this._slipHandleLocator=e}selectableComponent(){return this.newDock()||this.dock()}validWhen(){return s.VALID_FOR_SELECTED}activate(e){const t=this.slipHandleLocator().edge(),r=this.dock().minimumLength(),i=this.dock().deckingOptionProvider(),s=this.slipHandleLocator().add(t.normal().multipliedBy(r/2)),o=this.dock().constructor.builder(i).length(n.unit(r,this.dock().unit())).referencePoint(s).angle(t.normalAngle()).build();this.dock().project().add(o),this.dock().project().slipDockAdded(o),this._newDock=o,this._newDockFigure=o.defaultFigure();const a=o.endEdges().first();this.setObject(a),this.setSlipHandleLocator(a.center())}deactivate(){this._newDockFigure=void 0,this.snapToSize()}moveFromTo(e,t,r,n){const i=l(r,n),s=this.object().normal().multipliedBy(this.object().normal().dot(i)).subtract(this.slipHandleLocator());return this.moveBy(s.x(),s.y())}snapToSize(){const e=this.snappedSize();if(e){const t=this.newDock().length(),r=n.subtract(e,t).toNumeric(this.newDock().unit()),i=this.object().normal().multipliedBy(r);this.object().moveBy(i.x(),i.y())}}snappedSize(){const e=this.newDock().length(),t=this.newDock().snappableSizes?.(this.object());if(t&&t.length>0){const r=this.newDock().unit(),n=e.toNumeric(r);return t.slice().sort(((e,t)=>Math.abs(e.toNumeric(r)-n)-Math.abs(t.toNumeric(r)-n))).first()}const r=this.snapToIncrement();if(r)return e.roundedToIncrement(r)}snapToIncrement(){const e=this.newDock().snapToIncrement?.(this.object());if(e)return e;const t=this.newDock().snapToUnit?.(this.object());return t?n.unit(1,t):void 0}contains(e,t,r){this._setScale(r);const n=this.slipHandleLocator(),i=this._offsetFromEdge(),s=this._arrowWidth()/2,l=this.flipped(),c=this._lineLength()+this._arrowLength(),u=l?s:this._lineLength(),d=l?this._lineLength():s;if(new o(n,i+c/2).distanceTo(e,t)>c)return!1;return new a([new o(n,i+c,-u),new o(n,i+c,d),new o(n,i-this._lineWidth()/2,d),new o(n,i-this._lineWidth()/2,-u)]).contains(e,t)}draw(e,t){this._drawHandle(e,this.indicatorProperties(),t)}drawSelected(e,t){this._drawHandle(e,this._selectedProperties(),t)}flipped(){if(void 0===this._flipped){const e=this.slipHandleLocator(),t=e.edge();this._flipped=e.distanceTo(t.begin())<e.distanceTo(t.end())}return this._flipped}_offsetFromEdge(){return Math.max(this._pixelsToDrawingUnits(4),3)+this._lineWidth()/2}_arrowLength(){return this._pixelsToDrawingUnits(12)}_arrowWidth(){return this._pixelsToDrawingUnits(16)}_lineLength(){return this._pixelsToDrawingUnits(12)}_drawHandle(e,t,r){this._setScaleFromContext(e);const n=this.slipHandleLocator(),i=this.flipped(),s=new o(n,this._offsetFromEdge()),a=new o(s,this._lineLength()+this._arrowLength()),l=new o(s,this._lineLength()),c=new o(s,0,i?this._lineLength():-this._lineLength()),u=this._arrowLength(),d=this._arrowWidth();e._alterAndRestoreAfter((()=>{Object.assign(e,t),e.lineWidth=this._lineWidth(),e.beginPath(),e.moveTo(c.x(),c.y()),e.lineTo(s.x(),s.y()),e.lineTo(l.x(),l.y()),e.stroke();const r=d/2,i=Math.sqrt(u*u+r*r),o=Math.atan(r/u);e._drawArrowhead(a,n.edge().normalAngle(),i,o)})),this.newDockFigure()&&this.newDockFigure().draw(e,r)}_lineWidth(){return this._arrowWidth()/3}_selectedProperties(){return d}indicatorProperties(){return h}}c(DockSlipHandle,u),e.exports=DockSlipHandle},78868:(e,t,r)=>{const{$P:n}=r(62048),i=r(11288);e.exports=class FramingLevelEdgeAdjusterHandle extends i{level(){return this._figure.model()}foundation(){return this.level().foundation()}edge(){return this.object()}selectableComponent(){return this.level()}adjustFrame(){this.foundation().frameResized?.({fromSetter:!0})}deactivate(){this._offset=void 0}moveFromTo(e,t,r,i){const s=this.edge();this._offset||(this._offset=n(e,t).subtract(s.center()));const o=n(r,i).subtract(this._offset),a=this.movementFor(o);return!!a&&(!!s.moveBy(a.x(),a.y())&&(this.hasInvertedEdges()?(s.moveBy(-a.x(),-a.y()),!1):(this.adjustFrame(),!0)))}hasInvertedEdges(){const e=this.level().geometry();return this.level().edges().some((t=>e.containsPoint(t.center().add(t.normal()))))}movementFor(e){const t=this.findBestSnappingLine(e);if(!t)return;const r=this.edge(),n=r.normal(),i=this.foundation(),s=i.framingDescriptor().framingLevelSupportPostSpecifier().details().width.toNumeric(i.unit())/2;return n.multipliedBy(t.center().subtract(r.center()).dot(n)+s)}findBestSnappingLine(e){const t=this.edge().normal();return this.validSnappingLines().findSmallest((r=>Math.abs(e.subtract(r.center()).dot(t))))}validSnappingLines(){const e=this.edge();return this.foundation().snappingLines().filter((t=>Math.abs(t.direction().dot(e.direction())).isNearTo(1)))}contains(e,t,r){return 0!==this.validSnappingLines().length&&super.contains(e,t,r)}_drawHandle(e,t,r){0!==this.validSnappingLines().length&&super._drawHandle(e,t,r)}}},82874:(e,t,r)=>{const n=r(63768),{General:{locatorR:i,locatorX:s,locatorY:o}}=r(62048),a=r(48426);e.exports=class GangwayEdgeHandle extends a{snapToIncrement(){const e=this.frame().snapToIncrement?.(this.object());if(e)return e;const t=this.frame().snapToUnit?.(this.object())??"ft";return t?n.unit(1,t):void 0}snapToSize(){const e=this.frame(),t=this.snappedSize();if(t){const r=this._modelDimension(),a=n.subtract(t,r).toNumeric(this.frame().unit()),l=s(a,e.angle(),Math.PI_2-e.slopeAngle()),c=o(a,e.angle(),Math.PI_2-e.slopeAngle()),u=Math.sign(a)*i(l,c),d=this.object().normal().multipliedBy(u);this.object().moveBy(d.x(),d.y())}}}},94454:(e,t,r)=>{const n=r(64873);e.exports=class SuggestedWaterGradientBreaklineHandle extends n{deactivate(...e){if(super.deactivate(...e),!this._didMove){this.breakline().gradient().addBreakline(this.breakline())}}indicatorProperties(){return{fillStyle:"rgba(0, 0, 0, 0.3)"}}moveFromTo(e,t,r,n){return this._didMove||=this.deltaIsSignificant(r-e,n-t),!this._didMove}selectableComponent(){if(!this._didMove)return this.breakline()}}},64873:(e,t,r)=>{const n=r(63768),{Handle:i,CircleFigure:s}=r(7340),{$P:o}=r(62048),a=r(46748);e.exports=class WaterGradientBreaklineHandle extends i{constructor(e,t){super(e),this._breakline=t}deactivate(...e){super.deactivate(...e),this._didMove&&this._roundDistanceFromShore()}_roundDistanceFromShore(){const e=n.unit(1,"ft"),t=this.breakline(),r=a`max(round(${t.distanceFromShore()} / ${e}), 1) * ${e}`;t.setDistanceFromShore(r)}activate(...e){super.activate(...e),this._didMove=void 0}breakline(){return this._breakline}shape(e){return this.object().circleLocator().expandedByRadius(this.object().circleRadius(e))}contains(e,t,r){return this.shape(r).contains(e,t)}moveFromTo(e,t,r,n){const i=this.breakline().waterDepthService().distanceFromShoreTo(o(r,n)),s=this.breakline().distanceFromShore(),a=!i.equals(s);return this.breakline().setDistanceFromShore(i),this._didMove||=a,a}selectableComponent(){return this.breakline()}draw(e,t){this.drawHandle(e,this.indicatorProperties(),t)}drawSelected(e,t){this.drawHandle(e,this._selectedProperties(),t)}drawHandle(e,t,r){const n=new s(this.shape(e.runningScaleX()));n.updateProperties(t),n.draw(e,r)}_selectedProperties(){return{fillStyle:"rgba(31, 160, 246, 0.3)",strokeStyle:"#1FA0F6",_pixelLineWidth:3}}}},31560:(e,t,r)=>{const n=r(48909);e.exports=class DockRailingCollectionFigure extends n{constructor(e){super(),this.setModel(e)}defaultHandles(){return[]}zLevel(){return this.model().zLevel()}_draw(e,t){t.shapeOnly||super._draw(e,t)}layer(){return this.model().project().systemStrategy().railingsLayer()}}},86402:(e,t,r)=>{const n=r(89929),i=r(59602);e.exports=class DockAccessoryTool extends n{hideToolPanelDivider(){return!0}category(){return i.accessory}isPlacementNotAllowed(){return 0===this.project().docks().filter(this.unplacedComponent().frameFilter()).length}addToProject(){return this._addToProject??=!1}setAddToProject(e){this._addToProject=e}activate(){super.activate(),this.updateAllowedToPlace()}updateAllowedToPlace(){this.isPlacementNotAllowed()?(this.setContextMessage(this.componentClass().disabledToolMessage()),this._controller().setCursor("not-allowed")):(this.resetContextMessage(),this._controller().setDefaultCursor())}setCursor(e){this.isPlacementNotAllowed()||(e?this._controller().setCursor(e):this._controller().setDefaultCursor())}_place(e,t,r){this.isPlacementNotAllowed()||(this._move(e,t,r),this.unplacedComponentHandle().deactivate(this),this.addToProject()&&this._controller().project().add(e),this._controller().snapshotProjectAndRedraw(),this._controller().select(e),this.updateAllowedToPlace())}_afterAssetPlaced(){this.resetTool()}resetTool(){this._unplacedComponent=void 0,this._unplacedComponentFigure=this.unplacedComponent().defaultFigure(),this._unplacedComponentHandle=this.unplacedComponentFigure().selfHandle(),this.unplacedComponentHandle().activate(this)}draw(e,t){this.isPlacementNotAllowed()||super.draw(e,t)}}},26659:(e,t,r)=>{const n=r(89929),i=r(10066);e.exports=class DredgePlacementTool extends n{activate(){this._controller().layerManager().show(i.WATER_DEPTH),this._controller().draw(),super.activate()}}},92504:(e,t,r)=>{const{DisplayProperties:n,EditableProperty:i}=r(7340),{extend:s}=r(50988),o=r(22431),a=r(63002),l=r(36669);class EditDockBankTool extends a{static toolPanelClassName(){return"ToolPropertyPanel"}iconName(){return"edit-curve"}displayName(){return"Edit Bank"}contextMessage(){}defaultDisplayProperties(){return[new i(this,"Reset Bank",{type:"action",perform:()=>this.resetBank()})]}resetBank(){this._bank().resetControlPoints(),this._controller().draw()}_topHandleUnderCursor(e,t,r){return this.handles().find((n=>n.contains(e,t,r)))}handles(){return[...this._bank().controlPoints().map((e=>new l(e))),...this._nonControlPointHandles()]}_nonControlPointHandles(){return this._shoreLocators().map((e=>{const t=new o(e);return t.setComponentOf(this._bank()),new l(t)}))}deactivate(){super.deactivate(),this._controller().draw()}activate(){super.activate(),this._controller().draw()}draw(e,t){this.handles().forEach((r=>r.drawEditMode(e,t))),super.draw(e,t);this.handles().filter((e=>this._controller().selection().components().includes(e.controlPoint()))).forEach((r=>r.drawSelected(e,t)))}_bank(){return this._controller().project().bank()}_shoreLocators(){return this._bank().extrusionPath(this._bank().bounds(),!1).getPoints(this._bank().pathSteps()).map((e=>e.toPoint()))}addToolContextMessageChangedObserver(){}removeToolContextMessageChangedObserver(){}}s(EditDockBankTool,n),e.exports=EditDockBankTool},898:(e,t,r)=>{const{DisplayProperties:n,EditableProperty:i}=r(7340),{extend:s}=r(50988),o=r(63002),a=r(66462),l=r(45292);class OverridePostRowsTool extends o{static toolPanelClassName(){return"ToolPropertyPanel"}displayName(){return"Override Pile Rows"}iconName(){return"post-override"}defaultDisplayProperties(){return[new i(this,"Reset Posts",{type:"action",perform:()=>this.resetPosts()})]}resetPosts(){this._docks().forEach((e=>e.resetOverriddenPostRows())),this._controller().snapshotProjectAndRedraw()}_topHandleUnderCursor(e,t,r){return this.handles().find((n=>n.contains(e,t,r)))}handles(){return this._docks().flatMap((e=>{const t=e.overriddenPostRows().map((e=>new l(e))),r=e.dockFramer().adjustablePostEdges().map((r=>{if(t.some((e=>e.postRow().edge().overlaps(r))))return;const n=new a(r);return n.setComponentOf(e),new l(n)})).filter((e=>e));return[...t,...r]}))}activate(){super.activate(),this._controller().draw()}deactivate(){super.deactivate(),this._controller().draw()}draw(e,t){this.handles().forEach((r=>r.draw(e,t))),super.draw(e,t);this.handles().filter((e=>this._controller().selection().components().includes(e.postRow()))).forEach((r=>r.drawSelected(e,t)))}_docks(){return this._controller().project().docks()}contextMessage(){}addToolContextMessageChangedObserver(){}removeToolContextMessageChangedObserver(){}}s(OverridePostRowsTool,n),e.exports=OverridePostRowsTool},75313:(e,t,r)=>{const{ThreeGeometryFigure:n,three:i}=r(37732),s="grass",o="ground",a="underground";e.exports=class BankShoreThreeFigure extends n{materialNames(){return[s,o,a]}threeGeometry(){const e=this.model().shape3D();return this._generateUVCoordinates(e),this.setMaterials(e),e}_generateUVCoordinates(e){const t=this._mainAxis(),r=new i.Vector3(0,-1,0),n=e.getAttribute("position"),s=e.getAttribute("uv"),o=new i.Vector3,a=new i.Vector2;for(let e=0;e<n.count;e++)o.fromBufferAttribute(n,e),a.set(o.dot(t),o.dot(r)),s.setXY(e,a.x,a.y)}setMaterials(e){const{edgeIndices:t,underwaterIndices:r,landIndices:n}=this._generateMaterialIndices(e);this._createMaterialGroups(e,t,r,n)}_generateMaterialIndices(e){const t=new i.Vector3(0,0,1),r=[],n=[],s=[];return this._eachFace(e,((e,i,o,a)=>{const l=Math.max(i.z,o.z,a.z);e.normal.dot(t).isNearTo(0)||e.normal.dot(t).isNearTo(1)?r.push(e.a,e.b,e.c):l>0?n.push(e.a,e.b,e.c):s.push(e.a,e.b,e.c)})),{edgeIndices:r,underwaterIndices:n,landIndices:s}}_createMaterialGroups(e,t,r,n){const i=[];e.clearGroups(),e.addGroup(i.length,t.length,this.materialNames().indexOf(a)),i.fastMerge(t),e.addGroup(i.length,r.length,this.materialNames().indexOf(o)),i.fastMerge(r),e.addGroup(i.length,n.length,this.materialNames().indexOf(s)),i.fastMerge(n),e.setIndex(i)}_eachFace(e,t){const r=e.getAttribute("position"),n=new i.Vector3,s=new i.Vector3,o=new i.Vector3,a=new i.Vector3;for(let e=0;e<r.count;e+=3){const l={a:e,b:e+1,c:e+2,normal:new i.Vector3};n.fromBufferAttribute(r,l.a),s.fromBufferAttribute(r,l.b),o.fromBufferAttribute(r,l.c),l.normal.subVectors(o,s).cross(a.subVectors(n,s)).normalize(),t(l,n,s,o)}}}},83745:(e,t,r)=>{const{$P:n}=r(62048),i=r(15004);e.exports=class Board3DFigure extends i{materialNames(){return this.model().materialNames()}_generateUVCoordinates(e,t,r,n){t.push(e.dot(r)+this._textureOffset().x(),e.dot(n)+this._textureOffset().y())}_textureOffset(){return this.__textureOffset??=n(Math.ceil(60*Math.random()),Math.ceil(20*Math.random()))}}},58190:(e,t,r)=>{const{Composite3DFigure:n}=r(37732),{Cube:i}=r(62048),s=r(75313);e.exports=class DockBank3DFigure extends n{constructor(e){super(),this.setModel(e)}selfFigure(){return this._selfFigure||(this._selfFigure=new s(this.model())),this._selfFigure}addToScene(e){super.addToScene(e),this.selfFigure().addToScene(e)}removeFromScene(e){this.figures().forEach((t=>t.removeFromScene(e))),this.selfFigure().removeFromScene(e)}boundingCube(){const e=[this.selfFigure(),...this.parts()];return i.mergedFiniteCubes(e)}}},23675:(e,t,r)=>{const n=r(15004);e.exports=class Float3DFigure extends n{materialNames(){return["plastic"]}}},16279:(e,t,r)=>{const{three:n}=r(37732),i=r(15004);e.exports=class Pile3DFigure extends i{threeGeometry(){const e=this.model().geometry().radius(),t=2*Math.PI*e,r=this.model().height().toNumeric(this.model().unit()),i=new n.CylinderGeometry(e,e,r,Math.ceil(3*t));i.rotateX(Math.PI_2);const s=this.model().locator().addZ(this.model().verticalOffset().toNumeric(this.model().unit()));return i.translate(s.x(),s.y(),s.z()+r/2),this._generateUVCoordinates(i),i}_generateUVCoordinates(e){const t=this._mainAxis(),r=e.getAttribute("position"),i=e.getAttribute("uv"),s=e.index.array,o=new n.Vector3,a=new n.Vector3,l=new n.Vector3,c=new n.Vector3,u=new n.Vector3(1,0,0),d=this.model().locator().xy().toThreeJS();for(let e=0;e<s.length;e+=3)o.fromBufferAttribute(r,s[e]),a.fromBufferAttribute(r,s[e+1]),l.fromBufferAttribute(r,s[e+2]),o.z.isNearTo(a.z)&&o.z.isNearTo(l.z)?(i.setXY(s[e],0,0),i.setXY(s[e+1],0,0),i.setXY(s[e+2],0,0)):(i.setXY(s[e],...this.uvCoordinateFor(o,d,t,c,u)),i.setXY(s[e+1],...this.uvCoordinateFor(a,d,t,c,u)),i.setXY(s[e+2],...this.uvCoordinateFor(l,d,t,c,u)))}uvCoordinateFor(e,t,r,n,i){const s=this.model().geometry().radius();n.subVectors(e,t),n.setZ(0);const o=n.angleTo(i)*s;return[e.dot(r),o]}materialNames(){return this.model().materialNames()}}},73531:(e,t,r)=>{const n=r(63768),{three:i}=r(37732),s=r(19702),o=r(79591),a=r(50254);e.exports=class DockDesignerDrawing3DController extends o{draw(){if(!this._isLoaded)return;const e=this.project().bank().bounds(),t=Math.max(e.width(),e.height())/2;this.scene().fog=new i.Fog("#F9F9F9",t-.65*s.BANK_SIZE,t-.4*s.BANK_SIZE),super.draw()}_initialCameraZoomAdjustment(){const e=this.boundingCube(),t=Math.max(e.width(),e.height(),e.depth()),r=this._cameraFieldOfView().degreesToRadians();return 1.2*Math.abs(t/2/Math.tan(r/2))}_ensureAllFiguresAreUpToDate(){super._ensureAllFiguresAreUpToDate(),this._waterPlane.update()}_initialCameraDirection(){return new i.Vector3(.4,1,-.5).normalize()}_shadowPlane(e,t,r){return this.water()}water(){const e=this.project().bank(),t=e.bounds(),s=n.unit(24,"in").toNumeric(e.unit()),o=Math.max(...e.controlPoints().map((e=>e.locator().y())),e.shoreLine().y())+s-t.topLeft().y(),l=new i.PlaneGeometry(t.width(),o);this._water=new i.Group,this._waterPlane=new a(l,{waterNormals:(new i.TextureLoader).load(r(18377),(e=>{e.wrapS=e.wrapT=i.RepeatWrapping})),sunDirection:this.mainLightOffset(),waterColor:"#639CED",distortionScale:3.7,fog:!0}),this._waterPlane.position.set(t.center().x(),t.topLeft().y()+o/2,0),this._waterPlane.rotateX(-Math.PI);const c=t.width()/2-1,u=new i.Shape([new i.Vector2(-o/2,c),new i.Vector2(o/2,c),new i.Vector2(o/2,-c),new i.Vector2(-o/2,-c),new i.Vector2(o/2,-c),new i.Vector2(o/2,c)]),d=this.project().bank().height().toNumeric(this.project().bank().unit()),h=new i.Mesh(new i.ExtrudeGeometry(u,{extrudePath:new i.LineCurve3(new i.Vector3(0,0,0),new i.Vector3(0,0,d))}),new i.MeshStandardMaterial({color:"#639CED",opacity:.6,transparent:!0}));return h.position.set(t.center().x(),t.topLeft().y()+o/2,0),this._water.add(h),this._water.add(this._waterPlane),this._water}setupARScene(){super.setupARScene(),this._bankFigure=this.drawing().figureFor(this.project().bank()),this._bankFigure.removeFromScene(this.xrScene()),this._occluder=new i.Mesh(this._waterPlane.geometry,new i.MeshBasicMaterial({colorWrite:!1,side:i.DoubleSide})),this._occluder.matrix.copy(this._water.matrix),this._occluder.renderOrder=-1,this.xrScene().remove(this._water),this.xrScene().add(this._occluder),this._occluder.updateMatrixWorld()}tearDownARScene(){super.tearDownARScene(),this.scene().remove(this._occluder),this._occluder.material.dispose(),this._occluder=void 0,this._bankFigure=this.drawing().figureFor(this.project().bank()),this._bankFigure.addToScene(this.scene()),this.scene().add(this._water)}}},94652:(e,t,r)=>{const n=r(63768),{VersionedProject:i}=r(7340),s=r(7524),o=r(98272);e.exports=class DockDesignerDrawingController extends o{defaultProject(){return new i(new s)}_drawBackground(e,t){t.skipBackground||(e.fillStyle=this._waterGradient(e),e.strokeStyle="transparent",e._drawRectangle(t.bounds),t.hideGrid||super._drawBackground(e,t))}_waterGradient(e){const t=e.createLinearGradient(this.project().bank().shoreLine().x(),this.project().bank().shoreLine().y(),this.project().bank().shoreLine().x(),this.project().bank().shoreLine().y()-n.unit(40,"ft").toNumeric(this.project().unit()));return t.addColorStop(0,"rgba(25, 76, 179, 0.2)"),t.addColorStop(1,"rgba(19, 76, 134, 0.5)"),t}}},21065:e=>{e.exports=Object.freeze({Wooden:"Wooden",Aluminum:"Aluminum"})},81620:(e,t,r)=>{const{PolarCoordinate:n}=r(62048);e.exports=class StandardPostRowMixin{postRows(e=this.posts(),t=this.mainAxis()){const r=new n(1,t.theta()+Math.PI_2),i=Object.values(e.reduce(((e,r)=>{const n=r.locator().dot(t).rounded(3);return e[n]?e[n].push(r):e[n]=[r],e}),{}));return i.forEach((e=>{e.sort(((e,t)=>t.locator().dot(r)-e.locator().dot(r)))})),i.sort(((e,r)=>e.first().locator().dot(t).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES)-r.first().locator().dot(t).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES))),i}}},63019:(e,t,r)=>{const{MaterialSpecifier:n,ConstructionComponent:i}=r(93613),{EditableProperty:s}=r(7340),o=r(92472),a=r(94263),l=r(42947);e.exports=class AdditionalLineItemComponent extends i{nameProperty(){return this._nameProperty||(this._nameProperty=new s(this,"Name",{type:"text"})),this._nameProperty}name(){return this._name||(this._name=""),this._name}setName(e){this._name=e}amountProperty(){return this._amountProperty||(this._amountProperty=new s(this,"Amount",{type:"number"})),this._amountProperty}amount(){return this._amount||(this._amount=0),this._amount}setAmount(e){this._amount=e}_specifierName(){return this.__specifierName||(this.__specifierName=o()),this.__specifierName}delete(){this.componentOf().removeAdditionalLineItem(this)}editableLineItem(){return this._editableLineItem||(this._editableLineItem=a.builder(this.materialSpecifier(),{useMultiplier:this.usePricingMultiplier(),deleteFunction:this.delete.bind(this)}).propertiesCollection({[this.nameColumn()]:this.nameProperty(),[l.amount]:this.amountProperty()}).build()),this._editableLineItem}materialSpecifier(){return new n(this._specifierName(),this._specifierName(),{abstractPart:!0})}usePricingMultiplier(){return this.componentOf().usePricingMultiplierForAdditionalLineItems()}nameColumn(){return this.componentOf().additionalLineItemNameColumn()??l.item}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_nameProperty","_amountProperty","__specifierName","_editableLineItem"]}}},77869:e=>{e.exports=Object.freeze({LEFT:"left",CENTER:"center",RIGHT:"right"})},20149:(e,t,r)=>{const n=r(44476);e.exports=class ArbitraryDimensionAnnotation extends n{constructor(e,t,r=30,n={}){super(e,r,void 0,n),this._text=t}text(){return this._text}}},67287:(e,t,r)=>{const n=r(77869),i=r(27586),s=e=>void 0!==e?e.toString():"--";class BreakdownElement{constructor(e,t,r=void 0,n=s){this._label=e,this._value=t,this.__stringFormat=n,this._alignmentHint=r}static forValue(e,t,r){return new BreakdownElement(e,t,r)}static forDollarValue(e,t){return new BreakdownElement(e,t.toFixed(2),n.RIGHT,i)}label(){return this._label}value(){return this._value}_stringFormat(){return this.__stringFormat}alignmentHint(){return this._alignmentHint}formattedValue(){return this._stringFormat()(this.value())}}e.exports=BreakdownElement},17130:e=>{const t="Miscellaneous";e.exports=class BreakdownLineItem{static UNCATEGORIZED_SORT_KEY="ZZZ";static BOTTOM_SORT_KEY="ZZZZ";static DEFAULT_CATEGORY_NAME=t;static CATEGORY_COLUMN_LABEL="Category";constructor(e=[],r=t,n=void 0){this._elements=e,this._categoryName=r,this._infoIcon=n}isDeletable(){return!1}categoryName(){return this._categoryName}setCategoryName(e){this._categoryName=e}excludeFromCSV(){return this._excludeFromCSV??=!1}setExcludeFromCSV(e){this._excludeFromCSV=e}elements(){return this._elements}classes(){return this._cssClasses??=[]}setClasses(e){this._cssClasses=e}infoIcon(){return this._infoIcon}setInfoIcon(e){this._infoIcon=e}addElement(e){this.elements().push(e)}labels(){return this.elements().map((e=>e.label()))}values(){return this.elements().map((e=>e.value()))}valuesWithCategory(){if(!this.excludeFromCSV())return[this.categoryName(),...this.values()]}sortKey(){return this._sortKey||(this._sortKey=this.values()?.first()||""),this._sortKey}valueMap(){const e=this.labels(),t=this.values(),r=e.map(((e,r)=>[e,t[r]]));return new Map(r)}setSortKey(e){this._sortKey=e}}},44622:(e,t,r)=>{const n=r(17130);e.exports=class BreakdownLineItemCollection{constructor(e=[]){this._lineItems=e}lineItems(){return this._lineItems}columnLabels(){const e=this.first();return e?this.isSingleCategory()?e.labels():[n.CATEGORY_COLUMN_LABEL,...e.labels()]:[]}cellValues(){return this.isSingleCategory()?this.lineItems().map((e=>e.values())):this.lineItems().map((e=>e.valuesWithCategory())).filter(Boolean)}mappedData(){const e=this.columnLabels();return this.cellValues().map((t=>e.reduce(((e,r,n)=>(e[r]=t[n],e)),{})))}get length(){return this.lineItems().length}find(e,t){return this.lineItems().find(e,t)}first(){return this.lineItems().first()}forEach(e,t){this.lineItems().forEach(e,t)}map(e,t){return this.lineItems().map(e,t)}isSingleCategory(){return this.lineItems().every((e=>e.categoryName()===this.first().categoryName()))}}},95348:(e,t,r)=>{const n=r(67287),i=r(17130);e.exports=class BreakdownPricingStrategy{breakdownLineItems(e,t){return Object.entries(e.priceBreakdown()).map((([e,t])=>{const r=new i;return r.addElement(n.forValue("Item",e)),r.addElement(n.forDollarValue("Price",t)),r}))}totalPrice(e){return Object.values(e.priceBreakdown()).sum()}}},98683:e=>{e.exports=class BulkMaterial{constructor(e,t){this._quantity=e,this._materialSpecifier=t}quantity(){return this._quantity}materialSpecifier(){return this._materialSpecifier}}},34794:(e,t,r)=>{r(77869),r(67287);const n=r(6556),i=r(42947);e.exports=class CategoryHeaderLineItem extends n{constructor(e){super(0,e)}unitPrice(){return 0}materialCost(){return 0}breakdownItemSortKey(){return this.category().sortKey}generatedColumnValues(){return{[i.item]:()=>this.category().name}}pricingColumns(){return[]}breakdownLineItem(e,t,r){const n=super.breakdownLineItem(e,t,r);return n.setClasses(["parts-breakdown-table__category-header"]),n.setExcludeFromCSV(!0),n}breakdownElement(e,t,r){return this.breakdownItemFor(e,r,this._breakdownElementValueFor(e,t),this._alignmentFor(e))}_rightAlignedColumns(){return super.pricingColumns()}}},69435:(e,t,r)=>{const n=r(63768),{Circle:i,$P:s}=r(62048),o=r(2198);e.exports=class CircularRail extends o{constructor(e,t=n.unit(1,"in"),r="aluminum"){super(e),this._radius=t,this._material=r}material(){return this._material}materialNames(){return[this.material()]}width(){return n.multiply(this.radius(),2)}radius(){return this._radius}steps(){return n.multiply(Math.TWO_PI,this.radius()).toNumeric("mm").rounded()}crossSection(){return new i(s(0,0),this.radius().toNumeric(this.unit())).toPolygon(this.steps())}}},43320:(e,t,r)=>{const n=r(90218);e.exports=class ComponentColor extends n{constructor(e,t,r,n,i={}){super(e,i),this._materialName=t,this._fillStyle=r,this._strokeStyle=n}materialName(){return this._materialName}fillStyle(){return this._fillStyle}strokeStyle(){return this._strokeStyle}equals(e){return this.materialName()===e.materialName()}}},84514:(e,t,r)=>{const n=r(67603);e.exports=class CompositePropertiesCollection extends n{constructor(e,t){super(e),this._collections=t}collections(){return this._collections}displayProperties(){return this.collections().flatMap((e=>[...e]))}append(e){this._collections.push(e),this.isObserving()&&this._startObservingCollection(e)}isObserving(){return this._isObserving??=!1}startObserving(){this.isObserving()||(this._isObserving=!0,this.collections().forEach(this._startObservingCollection.bind(this)))}_startObservingCollection(e){e.addPropertiesChangedObserver?.(this,this.propertiesChanged),e.startObserving?.()}stopObserving(){this._isObserving=!1,this.collections().forEach((e=>{e.removePropertiesChangedObserver?.(this,this.propertiesChanged),e.stopObserving?.()}))}propertiesChanged(){super.propertiesChanged(),this.model().notifyDisplayPropertiesChangedObservers(!0)}}},37937:e=>{e.exports=class ConnectableFrame{locator(){}project(){}mainAxis(){}alongCrossAxis(e){}alongMainAxis(e){}boundingBox(){}edges(){}unit(){}surfaceOverhang(){}attachedConnectors(){}snapToFramesFilter(){}snapToConnectorsFilter(){}connectorsShouldSnapToCenter(){}addHeightChangedObserver(){}removeHeightChangedObserver(){}notifyHeightChangedObservers(){}snappingVectorForFrame(e,t,r){}snappableEdgesForFrame(e){}didSnapToFrame(e){}}},68243:e=>{e.exports=class Connector{locator(){}mainAxis(){}project(){}unit(){}upperEdge(){}lowerEdge(){}upperFrame(){}lowerFrame(){}detachFrame(e){}detachUpperFrame(){}detachLowerFrame(){}attachUpperFrame(e){}offsetFromFrameWhenAttached(e){}offsetWithOverhang(e){}snapToFramesFilter(){}snapsToCenter(){}canAcceptLowerFrame(e){}}},75086:(e,t,r)=>{const n=r(63768),{ExtrudedPolygon:i,RelativeLocator:s,$P:o}=r(62048),a=r(5752),l=r(26214),c=r(6556),u=r(83102),d=r(15004);e.exports=class CoveringMaterial extends u{constructor(e,t,r){super(),this._geometry=e,this._materialSpecifier=t,this._direction=r}primaryDirection(){const e=this.direction(),t=e.rotatedBy(o(0,0),-Math.PI_2),r=this.geometry().vertices().findSmallest((t=>e.dot(t))),n=this.geometry().vertices().findLargest((t=>e.dot(t)));return r.z().isNearTo(n.z())?e:t}color(){return this.materialSpecifier().details().color}materialNames(){return[this.materialSpecifier().details().materialName]}geometry(){return this._geometry}materialSpecifier(){return this._materialSpecifier}direction(){return this._direction}shape3D(){return this._shape3D??=this._defaultShape3D()}_defaultShape3D(){return new i(this.geometry(),this.thickness(),this._extrudeVertices.bind(this))}_extrudeVertices(e,t){const r=this.geometry().normal().multipliedBy(t);return e.map((e=>new s(e,r.x(),r.y(),r.z())))}thickness(){return this.depth().toNumeric(this.unit())}area(){const e=`${this.unit()}^2`;return n.unit(this.geometry().area(),e)}depth(){return this.materialSpecifier().details().depth}boundingCube(){return this.shape3D().boundingCube()}zLevel(){return Math.min(...this.geometry().vertices().map((e=>e.z())))}xLevel(){return Math.min(...this.geometry().vertices().map((e=>e.x())))}yLevel(){return Math.min(...this.geometry().vertices().map((e=>e.y())))}defaultFigure(){return new a(this)}threeFigure(){return new d(this)}projectedViewFigure(e,t,r){return new l(this,e,t,r)}projectedAnnotations(){return[]}selfMaterialLineItems(){return[new c(this._pricingArea(),this.materialSpecifier())]}_pricingArea(){const e=this._pricingUnit(),t=this.area();return e?n.unit(Math.ceil(t.toNumeric(e)),e):t}_pricingUnit(){return this.materialSpecifier().details().pricingUnit}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_shape3D"]}}},74225:(e,t,r)=>{const{three:n}=r(37732);function CubicPoly(){let e=0,t=0,r=0,n=0;function i(i,s,o,a){e=i,t=o,r=-3*i+3*s-2*o-a,n=2*i-2*s+o+a}return{initCatmullRom(e,t,r,n,s){i(t,r,s*(r-e),s*(n-t))},initNonuniformCatmullRom(e,t,r,n,s,o,a){let l=(t-e)/s-(r-e)/(s+o)+(r-t)/o,c=(r-t)/o-(n-t)/(o+a)+(n-r)/a;l*=o,c*=o,i(t,r,l,c)},calc(i){const s=i*i;return e+t*i+r*s+n*(s*i)}}}const i=new n.Vector3,s=new CubicPoly,o=new CubicPoly,a=new CubicPoly;class CreasedCornerCurve extends n.CatmullRomCurve3{constructor(e,t,r,i){super(e,!1,"catmullrom",i),this.direction=t,this.binormal=r,this.normal=t&&r?(new n.Vector3).crossVectors(r,t):void 0}getPoint(e,t=new n.Vector3){const r=t,l=this.points,c=l.length,u=(c-(this.closed?0:1))*e;let d,h,p=Math.floor(u),m=u-p;this.closed?p+=p>0?0:(Math.floor(Math.abs(p)/c)+1)*c:0===m&&p===c-1&&(p=c-2,m=1),this.closed||p>0?d=l[(p-1)%c]:(i.subVectors(l[0],l[1]).add(l[0]),d=i);const f=l[p%c],g=l[(p+1)%c];this.closed||p+2<c?h=l[(p+2)%c]:(i.subVectors(l[c-1],l[c-2]).add(l[c-1]),h=i);const y=this.creaseSharpCorners()&&this.direction.dot(f).isNearTo(this.direction.dot(g))?0:this.tension;return s.initCatmullRom(d.x,f.x,g.x,h.x,y),o.initCatmullRom(d.y,f.y,g.y,h.y,y),a.initCatmullRom(d.z,f.z,g.z,h.z,y),r.set(s.calc(m),o.calc(m),a.calc(m)),r}creaseSharpCorners(){return!0}getUtoTmapping(e){return e}computeFrenetFrames(e,t){const r=e+1,n=[],i=[],s=[],o=this.binormal,a=this.normal,l=this.direction;for(let e=0;e<r;e++)n[e]=l,i[e]=a,s[e]=o;return{tangents:n,normals:i,binormals:s}}originalFrenetFrames(e,t){return super.computeFrenetFrames(e,t)}}e.exports=CreasedCornerCurve},48511:(e,t,r)=>{const n=r(74716),i=r(97563),s=r(30202);e.exports=class CubicBezierExtrusionMaterial extends s{static builder(e){return new i(this,e)}constructor(e,t,r,n,i,s,o,a,l,c){super(e,n,i,s,o,a,l,c),this._controlPoint1=t,this._controlPoint2=r}beginLocator(){return this.locator()}controlPoint1(){return this._controlPoint1}controlPoint2(){return this._controlPoint2}threeFigure(){return new n(this)}}},7568:(e,t,r)=>{const n=r(63768),i=r(6556),s=r(42947);e.exports=class CutLengthMaterialLineItem extends i{constructor(e,t,r,{purchaseLength:n,...i}={}){super(e,t,i),this._length=r,this._purchaseLength=n}length(){return this._length}purchaseLength(){return this._purchaseLength??this.length()}_quantityNumeric(e){return this.quantity().roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES)}generatedColumnValues(e){return{...super.generatedColumnValues(e),[s.unit]:()=>""}}unitPrice(e){const t=super.unitPrice(e);return this.perUnit(e)?n.multiply(t,this.purchaseLength()):t}_unitPriceNumeric(e){return this.unitPrice(e)}}},41776:(e,t,r)=>{const{Polygon:n,Cube:i}=r(62048);e.exports=class Cylinder{constructor(e,t){this._edge=e,this._radius=t}edge(){return this._edge}radius(){return this._radius}height(){return this.edge().length()}boundingBox(){return this.edge().boundingBox().insettedBy(-this.radius())}boundingCube(){return i.extrudeRectangleFromTo(this.boundingBox(),this.edge().begin().z(),this.edge().end().z())}frontProjections(){return[this._sideProjection(this.edge().xz())]}leftSideProjections(){return[this._sideProjection(this.edge().yz())]}_sideProjection(e){const t=this.radius();return new n([e.begin().add(t,0),e.begin().add(-t,0),e.end().add(-t,0),e.end().add(t,0)])}}},8275:(e,t,r)=>{const n=r(17130);e.exports=class DeleteableBreakdownLineItem extends n{constructor(e,t,r){super(e,r),this._model=t}model(){return this._model}isDeletable(){return!0}delete(){this.model().delete()}}},9500:(e,t,r)=>{const{DisplayProperty:n}=r(7340);e.exports=class DividerProperty extends n{constructor(e="divider",{label:t="",imageURL:r}={}){super(e,"divider"),this._label=t,this._imageURL=r}editable(){return!1}get(){}options(){return{}}label(){return this._label}imageURL(){return this._imageURL}update(){}isCompatibleWith(e){return!1}}},36539:(e,t,r)=>{const n=r(67287);e.exports=class EditableBreakdownElement extends n{constructor(e,t,r=void 0){super(t,void 0,r),this._property=e}property(){return this._property}value(){return this.property().get()}type(){return this.property().type()}}},81813:(e,t,r)=>{const n=r(5393);e.exports=class EditableMarginPercentageLineItem extends n{constructor(e,t,r,n={}){super(e,t,r,{...n,type:"unit",propertyOptions:{defaultUnit:"percent"}})}materialCost(e){const t=this.subtotal();return(t/(1-this.quantity().toNumeric("percent")/100)-t).roundedTo(2)}}},21856:(e,t,r)=>{const n=r(63768),i=r(94263),s=r(42947);e.exports=class EditableMultiplierLineItem extends i{constructor(e,t,r,{subtotal:n,...i}={}){super(e,t,r,i),this._subtotal=n}subtotal(){return this._subtotal}materialCost(e){return n.evaluate(`${this.quantity()} * ${this.subtotal()}`)}_allowedColumns(){const e=super._allowedColumns();return e.remove(s.unitPrice),e}generatedColumnValues(e){return{...super.generatedColumnValues(e),[s.unit]:()=>""}}}},94263:(e,t,r)=>{r(77869);const n=r(36539),i=r(6556),s=r(17130),o=r(8275),a=r(73233),l=r(42947),c={[l.amount]:[l.item,l.description,l.amount,l.invoice],[l.invoice]:[l.item,l.description,l.invoice]};e.exports=class EditablePricingLineItem extends i{static builder(e,t){return new a(e,t,this)}constructor(e,t,r,{unit:n,deleteFunction:i,...s}={}){super(e,t,s),this._propertiesCollection=r,this._unit=n,this._deleteFunction=i}unit(){return this._unit}propertiesCollection(){return this._propertiesCollection??=this._defaultPropertiesCollection()}_defaultPropertiesCollection(){return{}}delete(){this._deleteFunction?.()}isDeletable(){return Boolean(this._deleteFunction)}quantity(){const e=this.propertiesCollection()[l.quantity];return e?e.get():super.quantity()}unitPrice(e){const t=this.propertiesCollection()[l.unitPrice];return t?t.get():super.unitPrice(e)}invoicePrice(e){const t=this.propertiesCollection()[l.invoice];return t?t.get():super.invoicePrice(e)}materialCost(e){const t=this.propertiesCollection()[l.amount];return t?t.get():super.materialCost(e)}item(){const e=this.propertiesCollection()[l.item];return e?e.get():super.item()}breakdownLineItem(e,t,r){let n;n=this.isDeletable()?new o(e.map((e=>this.breakdownElement(e,t,r))),this):super.breakdownLineItem(e,t,r);const i=this.breakdownItemSortKeyOverride();return i&&n.setSortKey(i),n}breakdownItemSortKeyOverride(){const e=this.category();return e?.sortKey&&e!==this.constructor.UNCATEGORIZED?`${e.sortKey}-${s.BOTTOM_SORT_KEY}`:s.BOTTOM_SORT_KEY}_allowedColumns(){const e=Object.keys(this.propertiesCollection()).map((e=>(c[e]??Object.values(l)).slice()));if(0===e.length)return Object.values(l);const t=e.first();return 1===e.length?t:t.map((t=>e.every((e=>e.includes(t)))?t:void 0)).filter((e=>e))}breakdownElement(e,t,r){if(!this._allowedColumns().includes(e))return this.breakdownItemFor(e,r,"");const i=this.propertiesCollection()[e];return i?new n(i,e,this._alignmentFor(e)):super.breakdownElement(e,t,r)}generatedColumnValues(e){return{...super.generatedColumnValues(e),[l.unit]:()=>this.unit()}}}},5393:(e,t,r)=>{const{EditableProperty:n}=r(7340),i=r(21856),s=r(42947);e.exports=class EditableQuantityMultiplierLineItem extends i{constructor(e,t,r,{project:n,type:i="number",propertyOptions:s={},...o}={}){super(e,t,r,o),this._project=n,this._type=i,this._propertyOptions=s}project(){return this._project}type(){return this._type}propertyOptions(){return this._propertyOptions}_defaultPropertiesCollection(){const e=new n(this,"Quantity",{type:this.type(),...this.propertyOptions()});return{[s.quantity]:e}}quantity(){return this.project().editableLineItemValueMap()[this.specifier().identifier()]}setQuantity(e){this.project().editableLineItemValueMap()[this.specifier().identifier()]=e}}},68720:(e,t,r)=>{const{EditableProperty:n}=r(7340),i=r(94263),s=r(42947);e.exports=class EditableQuantityPricingLineItem extends i{constructor(e,t,r,{project:n,type:i="number",propertyOptions:s={},...o}={}){super(e,t,r,o),this._project=n,this._type=i,this._propertyOptions=s}project(){return this._project}type(){return this._type}propertyOptions(){return this._propertyOptions}_defaultPropertiesCollection(){const e=new n(this,"Quantity",{type:this.type(),...this.propertyOptions()});return{[s.quantity]:e}}quantity(){return this.project().editableLineItemValueMap()[this.specifier().identifier()]}setQuantity(e){this.project().editableLineItemValueMap()[this.specifier().identifier()]=e}}},92096:(e,t,r)=>{const{EditableProperty:n}=r(7340),i=r(94263),s=r(42947);e.exports=class EditableUnitPricePricingLineItem extends i{constructor(e,t,r,{project:n,pricingSource:i,...s}={}){super(e,t,r,s),this._project=n,this._pricingSource=i}project(){return this._project}pricingSource(){return this._pricingSource}_defaultPropertiesCollection(){const e=new n(this,"Unit Price",{type:"number"});return{[s.unitPrice]:e}}unitPrice(){return this.project().editableLineItemValueMap()[this.specifier().identifier()]??this._defaultUnitPrice()}_defaultUnitPrice(){return this.pricingSource().unitPrice(this._calculatedPricingIdentifier())??0}setUnitPrice(e){this.project().editableLineItemValueMap()[this.specifier().identifier()]=e}}},30202:(e,t,r)=>{const n=r(63768),{Material:i}=r(93613),{ExtrudedPolygon:s,PlanarNormalToEdgeLocator:o,Polygon:a,ProportionalEdgeLocator:l,Rectangle:c,$P:u}=r(62048),{extend:d,MissingOverride:h,isDeepEqual:p}=r(50988),{NullDrawable:m}=r(7340),f=r(6272),g=r(39902),y=r(53558),b=r(42638),v=r(91154),_=r(30691),x=r(17043),w=r(5895);class ExtrusionMaterial extends i{static builder(e){return new v(this,e)}constructor(e,t,r,n,i,s,o,a){super(e,n,0),this._endLocator=t,this._crossSection=r,this._planarNormal=i,this._beginMiterDirection=s,this._endMiterDirection=o,this._color=a}beginLocator(){return this.locator()}endLocator(){return this._endLocator}crossSection(){return this._crossSection??this._defaultCrossSection()}beginMiterDirection(){return this._beginMiterDirection??this.edge().direction()}endMiterDirection(){return this._endMiterDirection??this.edge().direction()}_defaultCrossSection(){throw new h(this,"_defaultCrossSection")}planarNormal(){return this._planarNormal}edge(){return this.locator().to(this.endLocator())}extrusionEdge(){return this.edge()}geometry(){return this._geometry??=this._defaultGeometry()}_defaultGeometry(){const e=this.extrusionEdge(),t=new l(e,0),r=this.planarNormal()?.negated()??this.edge().normal().cross(this.edge().direction()),n=this.crossSection().toThreeJS().extractPoints().shape;return new a(n.map((e=>new o(t,r,e.x,0,e.y))))}shape3D(){return this._shape3D??=new s(this.beginGeometry(),this.extrusionEdge().length(),((...e)=>this._extrudeVertices(...e)))}beginGeometry(){const e=this.geometry().vertices();return new a(this._applyMiterToVertices(e,this.locator(),this.beginMiterDirection()).map((e=>e.relatedTo(this.locator()))))}endGeometry(){const e=this.extrusionEdge().vector(),t=this.geometry().vertices().map((t=>t.add(e)));return new a(this._applyMiterToVertices(t,this.endLocator(),this.endMiterDirection()).map((e=>e.relatedTo(this.endLocator()))))}_applyMiterToVertices(e,t,r){const i=this.edge().direction();if(this.edge().direction().dot(r).isNearTo(0))return console.error("The miter direction must not be perpendicular to the materials direction"),e;const s=[r.x(),r.y(),r.z(),r.dot(t)];return e.map((e=>{const t=e.to(e.add(i)),r=n.intersect([t.begin().x(),t.begin().y(),t.begin().z()],[t.end().x(),t.end().y(),t.end().z()],s);return u(...r)}))}_extrudeVertices(e,t){return this.endGeometry().vertices()}longestLineAlongAxis(e){const t=this.edge().center(),r=[...this.beginGeometry().vertices(),...this.endGeometry().vertices()],i=this._verticeOffsetsAlongAxis(r,e),s=n.min(...i),o=n.max(...i),a=t.add(e.multipliedBy(s)),l=t.add(e.multipliedBy(o));return a.to(l).relativeTo(this.locator())}shortestLineAlongAxis(e){const t=this.edge().center(),r=this.beginGeometry().vertices(),i=this.endGeometry().vertices(),s=this._verticeOffsetsAlongAxis(r,e),o=this._verticeOffsetsAlongAxis(i,e),a=n.max(...s),l=n.min(...o),c=t.add(e.multipliedBy(a)),u=t.add(e.multipliedBy(l));return c.to(u).relativeTo(this.locator())}_verticeOffsetsAlongAxis(e,t){const r=this.edge().center();return e.map((e=>e.subtract(r).dot(t)))}longestEdgeLine(){const e=this.miteredVertexOffsets(this.beginGeometry().vertices(),this.edge().begin()),t=n.min(...e),r=this.miteredVertexOffsets(this.endGeometry().vertices(),this.edge().end()),i=n.max(...r);return _.stretchedEdgeBy(this.edge(),-t,i).relativeTo(this.locator())}shortestEdgeLine(){const e=this.miteredVertexOffsets(this.beginGeometry().vertices(),this.edge().begin()),t=n.max(...e),r=this.miteredVertexOffsets(this.endGeometry().vertices(),this.edge().end()),i=n.min(...r);return _.stretchedEdgeBy(this.edge(),-t,i).relativeTo(this.locator())}miteredVertexOffsets(e,t){const r=this.edge().direction();return e.map((e=>e.subtract(t).dot(r)))}identifyingValues(){return{}}equals(e){if(!(e instanceof ExtrusionMaterial))return!1;if(!(this.canBeEqualTo(e)&&e.canBeEqualTo(this)))return!1;const t=this.edge(),r=this.planarNormal(),n=this.beginMiterDirection(),i=this.endMiterDirection(),s=e.edge(),o=e.planarNormal(),a=e.beginMiterDirection(),l=e.endMiterDirection(),c=t.length().isNearTo(s.length()),u=p(this.crossSection(),e.crossSection()),d=this._directionalVectorComparison(r,e,o),h=this._vectorComparison(n,e,a),m=this._vectorComparison(i,e,l),f=p(this.identifyingValues(),e.identifyingValues());return c&&u&&d&&h&&m&&f}canBeEqualTo(e){return!0}boundingBox(){const e=this.boundingCube();return new c(e.x(),e.y(),e.width(),e.height())}boundingCube(){return this.shape3D().boundingCube()}localZAxis(){return this.planarNormal()?this.planarNormal().negated():this.localYAxis().cross(this.localXAxis())}localYAxis(){return this.planarNormal()?this.localXAxis().cross(this.localZAxis()):this.edge().normal()}localXAxis(){return this.edge().direction()}_vectorComparison(e,t,r){return this._directionalVectorComparison(e,t,r)||this._directionalVectorComparison(e,t,r.negated())}_directionalVectorComparison(e,t,r){return!e&&!r||!(!e||!r)&&(this.localXAxis().dot(e).isNearTo(t.localXAxis().dot(r))&&this.localYAxis().dot(e).isNearTo(t.localYAxis().dot(r))&&this.localZAxis().dot(e).isNearTo(t.localZAxis().dot(r)))}dimensionAlongAxis(e){const t=this.shape3D().vertices().map((t=>t.dot(e))),r=Math.min(...t),n=Math.max(...t);return Math.abs(n-r)}furthestEdgeAlongAxis(e){const t=this.edge(),r=t.direction(),n=this.shape3D().vertices(),i=t.center(),s=n.filter((e=>e.subtract(i).dot(r)<0)),o=n.filter((e=>e.subtract(i).dot(r)>0)),a=s.selectLargest((t=>t.dot(e))),l=o.selectLargest((t=>t.dot(e))),c=a.findLargest((e=>e.dot(r))),u=l.findSmallest((e=>e.dot(r))),d=t.closestPointTo(c,!0).subtract(c).normalized().negated();return t.closestPointTo(c,!0).add(d).relatedTo(t.begin()).to(t.closestPointTo(u,!0).add(d).relatedTo(t.end()))}setVisibleIn2D(e){this._visibleIn2D=e}visibleIn2D(){return this._visibleIn2D??=!0}defaultFigure(){return this.visibleIn2D()?new f(this):new m(this)}primaryDirection(){return this.edge().direction()}threeFigure(){return new y(this)}projectedViewFigure(e,t,r){return new g(this,e,t,r)}projectedAnnotations(e,t,r){return this.componentOf()?[...this.projectedDimensionAnnotations(e,t,r),...this.projectedAngleAnnotations(e,t,r)]:[]}projectedDimensionAnnotations(e,t,r){return[...this._axisAnnotationEdges(this.localXAxis(),e,t,r),...this._axisAnnotationEdges(this.localYAxis().negated(),e,t,r),...this._axisAnnotationEdges(this.localZAxis(),e,t,r)].map((e=>this.makeDimensionAnnotation(e)))}projectedAngleAnnotations(e,t,r){return[]}makeDimensionAnnotation(e,t=30){const r=new(this.componentOf().systemStrategy().annotationType())(e,t,this.componentOf().unit(),{formatter:this.project().unitFormatter()});return r.setLayer(w.PROJECTED_EXTRUSION_ANNOTATION),r}_axisAnnotationEdges(e,t,r,i){const s=this.longestLineAlongAxis(e);if(n.abs(s.direction().dot(i)).isNearTo(1))return[];const o=this.projectedDimensionEndpointOffset(e,t,r),a=s.begin().add(o),l=s.end().add(o),c=_.projectedEdge(a.to(l),t,r,i),u=this.shortestLineAlongAxis(e),d=u.end().subtract(o),h=u.begin().subtract(o),p=_.projectedEdge(d.to(h),t,r,i),m=[c];return c.length().isNearTo(p.length())||m.push(p),m.filter((e=>!e.length().isNearTo(0)))}projectedDimensionEndpointOffset(e,t,r){const i=[t.negated(),r.negated()].findSmallest((t=>n.abs(e.dot(t)))),s=this.longestLineAlongAxis(i);return i.multipliedBy(s.length()/2)}color(){return this._color}materialNames(){return[this.color()?.materialName()??this.materialSpecifier().details().materialName]}fillStyle(){return this.color()?.fillStyle()??this.materialSpecifier().details().fillStyle}strokeStyle(){return this.color()?.strokeStyle()??this.materialSpecifier().details().strokeStyle}lineWidth(){return this.materialSpecifier().details().lineWidth}zLevel(){return this.boundingCube().high()}project(){return this.componentOf()?.project()}get materials(){return this.componentOf().materials}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_shape3D","_geometry","_visibleIn2D"]}projectedAnnotationPDFBoundingBox(e,t,r,n){const i=(this.projectedAnnotations(t,r,n)??[]).flatMap((t=>t.pdfBoundingBox?.(e))).filter(Boolean);if(0!==i.length)return i.reduce(((e,t)=>e.merge(t)))}}d(ExtrusionMaterial,b),d(ExtrusionMaterial,x),e.exports=ExtrusionMaterial},74215:(e,t,r)=>{const{extend:n}=r(50988),{MaterialSpecifier:i}=r(93613),s=r(2198),o=r(28219);class ExtrusionRail extends s{materialSpecifier(){return new i("Rail","Rail",{materialName:"aluminum"})}}n(ExtrusionRail,o),e.exports=ExtrusionRail},73399:(e,t,r)=>{const{extend:n}=r(50988),i=r(80365),s=r(87763),o=r(83465),a=r(27817);class Framer{constructor(e){this._frame=e}frame(){return this._frame}get materials(){return this.frame().materials}_unit(){return this.frame().unit()}framingDescriptor(){return this.frame().framingDescriptor()}get descriptor(){return this.framingDescriptor()}offsetHelper(){return this._offsetHelper??=new s(this.frame())}_makeBoard(e,t,r=void 0,n=void 0){const i=this._createMaterial(o,e,t,r,n,this.boardMaterialName()),s=this.frame().framingColorSource?.();return s&&i.setColorSource(s),i}_createMaterial(e,t,r,n,i,s){const o=i??t.normal(),a=this.frame(),l=t.relativeTo(a.referencePoint()),c=e.builder(a).beginLocator(l.begin()).endLocator(l.end()).materialSpecifier(r).offsetFromCenter(n).planarNormal(o).materialName(s).build();return c.setComponentOf(a),c}boardMaterialName(){return this.frame().framingMaterialName?.()??"pressure-treated"}}a(Framer,"framingDescriptor",["materialWidth","materialDepth"]),n(Framer,i),e.exports=Framer},61447:e=>{e.exports=class FramingDescriptor{constructor(e){this._frame=e}frame(){return this._frame}get materials(){return this.frame().materials}unit(){return this.frame().unit()}materialWidth(e){return this.materialDimensionNumeric(e,"width")}materialDepth(e){return this.materialDimensionNumeric(e,"depth")}materialDimensionNumeric(e,t){return e.details()[t].toNumeric(this.unit()).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES)}}},80866:(e,t,r)=>{const n=r(63768),{ProportionalEdgeLocator:i,$P:s}=r(62048),{Composite3DFigure:o}=r(37732),{EditableProperty:a,PropertiesCollection:l}=r(7340),c=r(22093),u=r(83465),d=r(55848),h=r(32896),p=r(48119),{lumber:m}=r(71181),f=r(10066);e.exports=class FreestandingRoof extends d{static displayName(){return"Roof"}static iconName(){return"roof"}static defaultWidth(){return n.unit(12,"ft")}static defaultLength(){return n.unit(18,"ft")}static builder(e){return new c(e,this)}defaultDisplayProperties(){return new l(this,[new a(this,"Roof Type",{type:"select",choices:this.roofTypeOptions()}),new a(this,"Width",{type:"unit",defaultUnit:"in",get:this.roundedWidth.bind(this)}),new a(this,"Length",{type:"unit",defaultUnit:"in",get:this.roundedLength.bind(this)}),...this._namespaceProperties(this.roof().displayProperties())])}_namespaceProperties(e){return e.map((e=>(e.label().startsWith("Roof")||e.namespace("Roof"),e)))}angleChanged(){this._resetComponents()}frameResized(e){super.frameResized(e),this._resetComponents()}_resetComponents(){this._topFraming=void 0,this._piles=void 0,this.roof().reset()}zLevel(){return 0}roofZLevel(){return this.roof().zLevel()}structureMaterialName(){return"pressure-treated"}topFraming(){return this._topFraming??=this._defaultTopFraming()}_defaultTopFraming(){const e=this.topFrameSpecifier(),t=n.divide(e.details().depth,2).toNumeric(this.unit()),r=e.details().width.toNumeric(this.unit()),i=this.pileHeightAboveWater().toNumeric(this.unit()),o=this.framingColorSource();return this.edges().flatMap((n=>{const a=n.addZ(-i),l=a.shiftedAlongNormalBy(-r);return[this._makeBoard(a.begin(),a.end(),e,s(t,-r/2),n.normal(),o),this._makeBoard(l.begin(),l.end(),e,s(t,-r/2),n.normal(),o)]}))}framingColors(){const e=this.framingColorSource();if(e)return e.colors()}framingColorSource(){return this.project()?.framingColorSource?.()}topFrameSpecifier(){return m.PT2x12}piles(){return this._piles??=this._defaultPiles()}_defaultPiles(){const e=this.pileHeightAboveWater().toNumeric(this.unit()),t=this.pileLength().toNumeric(this.unit());return this._pileLocations().map((r=>{const n=r.addZ(-e),i=n.addZ(t);return this._makePile(n,i)}))}_makePile(e,t){return this._makeBoard(e,t,this.pileSpecifier(),s(0,0),e.to(t).normal(),this.pileColorSource())}pileColors(){const e=this.pileColorSource();if(e)return e.colors()}pileColorSource(){return this.project()?.postColorSource?.()}pileSpecifier(){return m.PT6x6}_pileLocations(){const e=this._pileLayoutEdges(),t=this.pileSpacingNumeric();return e.flatMap((e=>{const r=e.length().roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES),n=Math.ceil(r/t),s=r/n;return new Array(n+1).fill("").map(((t,n)=>new i(e,n*s/r)))}))}_pileLayoutEdges(){const e=this.pileSpecifier().details().width.toNumeric(this.unit());return this.sideEdges().map((t=>t.shiftedAlongNormalBy(-e/2).stretchedBy(-e).relativeToEdge(t)))}_makeBoard(e,t,r,n,i,s){const o=u.builder(this).beginLocator(e).endLocator(t).materialSpecifier(r).offsetFromCenter(n).planarNormal(i).materialName(this.structureMaterialName()).build();return o.setComponentOf(this),s&&o.setColorSource(s),o}minimumSpan(e){return this.roof().minimumSpan(e)}maximumSpan(e){return this.roof().maximumSpan(e)}_roundToNearestInchNumeric(e){return n.round(e.toNumeric("in"))}setLength(e){const t=s(0,0).to(this.crossAxis()),r=this._roundToNearestInchNumeric(e).constrained(this.minimumSpan(t),this.maximumSpan(t)),i=n.unit(r,this.unit());return super.setLength(i)}roundedLength(){const e=super.length(),t=this._roundToNearestInchNumeric(e);return n.unit(t,this.unit())}setWidth(e){const t=s(0,0).to(this.mainAxis()),r=this._roundToNearestInchNumeric(e),i=n.unit(r.constrained(this.minimumSpan(t),this.maximumSpan(t)),this.unit());return super.setWidth(i)}roundedWidth(){const e=super.width(),t=this._roundToNearestInchNumeric(e);return n.unit(t,this.unit())}pileSpacing(){return n.unit(12,"ft")}pileSpacingNumeric(){return this.pileSpacing().toNumeric(this.unit()).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES)}pileHeightAboveWater(){return n.unit(10,"ft")}supportHeight(){return this.pileHeightAboveWater()}pileLength(){return n.unit(30,"ft")}setRoofType(e){this._roofType=e;const t=this.roof().pitch(),r=this.roof().roofingSpecifier();this._roof=void 0,this.roof().setPitch(t),this.roof().setRoofingSpecifier(r),this.resetDisplayProperties()}roofType(){return this._roofType??=this.roofTypeOptions().first()}roofTypeOptions(){return this._roofTypeOptions??=this._defaultRoofTypeOptions()}_defaultRoofTypeOptions(){return[new p]}showRoofTypeProperty(){return this.roofTypeOptions().length>1}roof(){return this._roof??=this._defaultRoof()}_defaultRoof(){const e=this.roofType();return e.setDrawingLayer(f.ROOFING),e.setStructure(this),e.setComponentOf(this),e}roofColor(){return this.roof().roofingSpecifier().details().color}components(){return[...this.piles(),this.roof(),...this.topFraming()]}selfMaterialLineItems(){return[]}componentsMaterialLineItems(){return this.components().flatMap((e=>e.materialLineItems?.()??[]))}boundingBox(){return this.geometry().boundingBox()}boundingCube(){return this.components().map((e=>e.boundingCube())).reduce(((e,t)=>e.merge(t)))}defaultFigure(){return new h(this)}threeFigure(){return o.withModel(this)}snapToConnectorsFilter(){return()=>!1}snapToFramesFilter(){return()=>!1}attachedConnectors(){return[]}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_piles","_topFraming","_roof","_roofTypeOptions"]}}},81996:(e,t,r)=>{const n=r(63768),{ExtrudedPolygon:i,Polygon:s}=r(62048),{MissingOverride:o}=r(50988),{roundToFraction:a}=r(10240),l=r(15004),c=r(59663),u=r(83102),d=r(30691),h=r(6556),p=r(39902);e.exports=class GlassPanel extends u{constructor(e,t,r){super(),this._edge=e,this._height=t,this._panelThickness=r}load(){}isLevel(){return d.isLevel(this.edge())}edge(){return this._edge}locator(){return this.edge().begin()}height(){return this._height}panelThickness(){return this._panelThickness}topEdge(){const e=this.height().toNumeric(this.unit());return this.edge().addZ(-e)}geometry(){if(!this._geometry){const e=this.edge(),t=this.panelThickness().toNumeric(this.unit()),r=e.shiftedAlongNormalBy(-t/2),n=e.shiftedAlongNormalBy(t/2);this._geometry=new s([r.begin(),r.end(),n.end(),n.begin()])}return this._geometry}shape3D(){return this._shape3D||(this._shape3D=new i(this.geometry(),-this.height().toNumeric(this.unit()))),this._shape3D}area(){const e=this.edge(),t=e.shortestLineFrom(this.topEdge().begin(),!0).length()*e.length(),r=n.unit(t,`${this.unit()}^2`);return n.unit(n.ceil(r.toNumeric("ft^2")),"ft^2")}boundingBox(){return this.geometry().boundingBox()}boundingCube(){return this.shape3D().boundingCube()}zLevel(){return this.topEdge().begin().z()}threeFigure(){return new l(this)}defaultFigure(){return new c(this,{strokeStyle:"white",fillStyle:"black",lineWidth:.12})}projectedViewFigure(e,t,r){return new p(this,e,t,r)}materialNames(){return["glass"]}selfMaterialLineItems(){return[new h(1,this.materialSpecifier())]}materialSpecifier(){throw new o(this,"materialSpecifier")}projectedAnnotations(e,t,r){return[]}length(){return n.unit(this.edge().length(),this.unit())}_dimensionsMatch(e){const t=this._distanceUnitsMatch(this.length(),e.length()),r=this._distanceUnitsMatch(this.height(),e.height()),n=this.slopeDegrees(),i=e.slopeDegrees(),s=n.isNearTo(i);return r&&t&&s}_distanceUnitsMatch(e,t){const r=e.toNumeric(this.unit()),n=t.toNumeric(this.unit()),i=this.fractionPrecisionDenominator();return a(r,i)===a(n,i)}fractionPrecisionDenominator(){return 8}slope(){if(this.isLevel())return n.unit(0,"rad");const e=this.edge(),t=Math.abs(e.begin().z()-e.end().z()),r=e.xy().length();return n.unit(Math.atan(t/r),"rad")}slopeDegrees(){const e=this.slope().toNumeric("deg"),t=this.slopePrecision();return e.roundedTo(t)}slopePrecision(){return 2}}},72539:(e,t,r)=>{const{fraction:n}=r(63768),{Annotation:i,Polygon:s}=r(62048),{$P:o}=r(62048),a=r(88101);e.exports=class GradientAnnotation extends i{constructor(e,t,{riseText:r,runText:n,hypotenuseText:i,magnification:s=25,direction:o}={}){super(t),this._edge=e,this._riseText=r,this._runText=n,this._hypotenuseText=i,this._magnification=s,this._direction=o}edge(){return this._edge}riseText(){return this._riseText}runText(){return this._runText}hypotenuseText(){return this._hypotenuseText}magnification(){return this._magnification}direction(){return this._direction}_horizontalVector(){return this.__horizontalVector||this._calculate(),this.__horizontalVector}_verticalVector(){return this.__verticalVector||this._calculate(),this.__verticalVector}slopeFraction(){const e=this._verticalVector().r(),t=this._horizontalVector().r();return n(e/t)}rise(){return this.slopeFraction().n}run(){return this.slopeFraction().d}_calculate(){const e=this.edge().direction(),t=-e.x(),r=e.y(),n=1/Math.min(Math.abs(t),Math.abs(r));let i=t*n,s=r*n;r>0&&(i*=-1,s*=-1),this.__horizontalVector=o(i,0),this.__verticalVector=o(0,s)}generateShapeFrom(e,t){const r=this._horizontalVector().multipliedBy(t),n=this._verticalVector().multipliedBy(t),i=r.dividedBy(2),o=n.dividedBy(2),a=i.add(o).negated(),l=e.add(a),c=l.add(n),u=l.add(r),d=new s([c,u,l]);return d.isCounterClockwise()&&d.vertices().reverse(),d}defaultFigure(){const e=new a(this);return e.setLayer(this.layer()),e}nonEssentialProperties(){return[...super.nonEssentialProperties(),"__horizontalVector","__verticalVector"]}}},96100:e=>{e.exports=class LumberMaterial{constructor(e,t){this._length=e,this._materialSpecifier=t}length(){return this._length}materialSpecifier(){return this._materialSpecifier}}},77030:(e,t,r)=>{const{MaterialList:n}=r(27871),i=r(6556);e.exports=class MaterialAggregator{aggregate(e){const t=new Map;return e.forEach((e=>{const r=e.materialSpecifier().identifier(),n=t.get(r)||[];n.push(e),t.set(r,n)})),t}aggregateLumberForPurchase(e){const t=this.aggregate(e),r=new n;for(const e of t.keys()){const n=t.get(e),s=n.first().materialSpecifier();if(s.details().cutLengths)s.lumberYardSpecifiers(n).forEach((e=>{const t=new i(e.quantity,e.specifier);r.add(t)}));else{const e=n.reduce(((e,t)=>e+(t.quantity?.()??1)),0),t=new i(e,s);r.add(t)}}return r}}},15838:e=>{class MaterialListProperty{constructor(e,t=!0){this._name=e,this._editable=t}name(){return this._name}editable(){return this._editable}static propertiesFromNames(e=[]){return e.map((e=>new MaterialListProperty(e)))}static propertiesFromObjects(e){return e.map((e=>new MaterialListProperty(e.name,e.editable)))}}e.exports=MaterialListProperty},6556:(e,t,r)=>{const n=r(63768),{MaterialLineItem:i}=r(27871),s=r(67287),o=r(17130),a=r(77869),l=r(46103),c=r(42947);class MaterialPricingLineItem extends i{static makeCategory(e,t=e){return{name:e,sortKey:t}}static UNCATEGORIZED_SORT_KEY=o.UNCATEGORIZED_SORT_KEY;static BOTTOM_SORT_KEY=o.BOTTOM_SORT_KEY;static UNCATEGORIZED=MaterialPricingLineItem.makeCategory(o.DEFAULT_CATEGORY_NAME,MaterialPricingLineItem.UNCATEGORIZED_SORT_KEY);static quantityOfCutLength(e,t,r,n){const i=[];for(let s=0;s<e;s++)i.push(new this(t,r,n));return i}constructor(e,t=new l,{useMultiplier:r=!0,category:n}={}){super(e,t),this._useMultiplier=r,this._category=n||t.details().defaultCategory}useMultiplier(){return this._useMultiplier}category(){return this._category??this.constructor.UNCATEGORIZED}setCategory(e){this._category=e}materialCost(e){const t=this.unitPrice(e);return 0===t?t:n.multiply(this.quantity(),t)}invoicePrice(e){return this.useMultiplier()?e.multiplier()*this.materialCost(e):this.materialCost(e)}_calculatedPricingIdentifier(){const e=this.specifier();return e.details().pricingIdentifier||e.identifier()}unitPrice(e){return e.unitPrice(this._calculatedPricingIdentifier())??0}perUnit(e){return e.perUnit(this._calculatedPricingIdentifier())}item(){return this.specifier().name()}description(){return this.specifier().description()??""}breakdownLineItem(e,t,r){const n=e.map((e=>this.breakdownElement(e,t,r))),i=new o(n,this.category().name);return i.setSortKey(this.breakdownItemSortKey()),i}breakdownItemSortKey(){return`${this.category().sortKey}-${this.specifier().identifier()}`}breakdownItemFor(e,t,r="",n=a.LEFT){const i=this.specifier(),o=t?.[i.identifier()],l=t?.[i.details().pricingIdentifier],c=o?.[e]??l?.[e]??r;return s.forValue(e,c,n)}dollarBreakdownItemFor(e,t){return s.forDollarValue(e,t)}breakdownElement(e,t,r){const n=this._breakdownElementValueFor(e,t);return this.pricingColumns().includes(e)?this.dollarBreakdownItemFor(e,n):this.breakdownItemFor(e,r,n)}_breakdownElementValueFor(e,t){return this.generatedColumnValues(t)[e]?.()??this.specifierColumnValue(e)}generatedColumnValues(e){return{[c.item]:()=>this.item(),[c.description]:()=>this.description(),[c.quantity]:()=>this._quantityNumeric(e),[c.unit]:()=>this.perUnit(e),[c.unitPrice]:()=>this._unitPriceNumeric(e),[c.amount]:()=>this.materialCost(e),[c.invoice]:()=>this.invoicePrice(e)}}specifierColumnValue(e){return this.specifier().details()[e]}pricingColumns(){return[c.unitPrice,c.amount,c.invoice]}_rightAlignedColumns(){return this.pricingColumns()}_alignmentFor(e){return this._rightAlignedColumns().includes(e)?a.RIGHT:a.LEFT}_unitPriceNumeric(e){const t=this.unitPrice(e),r=this.perUnit(e);return r?n.multiply(t,n.unit(1,r)):t}_quantityNumeric(e){const t=this.quantity(),r=this.perUnit(e),n=this.specifier().details().lineItemDecimals??Math.SIGNIFICANT_DECIMAL_PLACES;return r?t.toNumeric(r).roundedTo(n):t.roundedTo(n)}}e.exports=MaterialPricingLineItem},54400:(e,t,r)=>{const n=r(42947);e.exports=class MaterialPricingStrategy{constructor(e,t,r){this._pricingSource=e,this._columns=r}pricingSource(){return this._pricingSource}columns(){return this._columns??[n.item,n.quantity,n.unit,n.unitPrice,n.amount]}breakdownLineItems(e,t){const r=this.allLineItems(e).map((e=>this.breakdownElementFor(e,t)));return r.sort(this._breakdownLineItemsSortFunction.bind(this)),r}_breakdownLineItemsSortFunction(e,t){return e.sortKey().localeCompare(t.sortKey())}breakdownElementFor(e,t){return e.breakdownLineItem(this.columns(),this.pricingSource(),t)}projectLineItems(e){return e.materialList().lineItems()}allLineItems(e){return this.projectLineItems(e)}subtotal(e){return this._totalForLineItems(this.projectLineItems(e))}totalPrice(e){return this._totalForLineItems(this.allLineItems(e))}_totalForLineItems(e){return e.sum((e=>e.materialCost(this.pricingSource())))}}},35032:(e,t,r)=>{const n=r(63768).unit,{ConstructionComponent:i}=r(93613),{ShapeFromVertices:s,Polygon:o}=r(62048),{extend:a}=r(50988),{Composite3DFigure:l}=r(37732),c=r(14098),u=r(48909);class MetalStairTread extends i{static defaultThickness(){return n(1,"in")}static defaultMaterialThickness(){return n(.25,"in")}static defaultTreadDepth(){return n(10,"in")}constructor(e,t,r){super(),this._beginLocator=e,this._endLocator=t,this._treadDepth=r}thickness(){return this.constructor.defaultThickness()}beginLocator(){return this._beginLocator}endLocator(){return this._endLocator}zLevel(){return this.beginLocator().z()}topEdge(){return this.beginLocator().to(this.endLocator())}backEdge(){const e=-this.depth().toNumeric(this.unit());return this.topEdge().shiftedAlongNormalBy(e)}bottomEdge(){const e=this.thickness().toNumeric(this.unit());return this.topEdge().addZ(e)}depth(){return this._treadDepth||this.constructor.defaultTreadDepth()}width(){return this.beginLocator().distanceTo(this.endLocator())}vertices(){return[this.beginLocator(),this.endLocator(),this.backEdge().end(),this.backEdge().begin()]}geometry(){return this._geometry||(this._geometry=new o(this.vertices())),this._geometry}sideEdges(){return[this.topEdge(),this.backEdge()]}endEdges(){return[this.topEdge().begin().to(this.backEdge().begin()),this.topEdge().end().to(this.backEdge().end())]}surfaceMeshThickness(){return this.constructor.defaultMaterialThickness()}surfaceFrameDepth(){return this.thickness()}surfaceFrameThickness(){return this.constructor.defaultMaterialThickness()}surfaceFrameEdges(){return this.sideEdges()}surface(){return this._surface||(this._surface=new c(this)),this._surface}components(){return[this.surface()]}defaultFigure(){return u.withModel(this)}threeFigure(){return l.withModel(this)}materialLineItems(){return[]}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_geometry","_surface"]}}a(MetalStairTread,s),e.exports=MetalStairTread},82188:(e,t,r)=>{const n=r(63768),i=n.unit,{FixedEdgeLocator:s}=r(62048),{Composite3DFigure:o}=r(37732),a=r(28823),l=r(35032),c=r(76816),u=r(59252),d=r(99105),h=r(99831);class MetalStairwayRailingDelegate extends h{constructor(e){super(),this._postLocatorZOffset=e}postLocatorZOffset(){return this._postLocatorZOffset}railingMaterial(){return"safety-red"}}e.exports=class MetalStairway extends a{static defaultStepRise(){return i(8,"in")}static minimumStepRise(){return i(6.5,"in")}static defaultWidth(){return n.add(i(36,"in"),c.defaultWidth())}static minimumWidth(){return i(22,"in")}constructor(e,t=i(40,"in")){if(super(e,t),n.larger(t,this.maximumTotalRise()))throw new Error(`Cannot construct Stairway with rise greater than ${this.maximumTotalRise()}`);if(n.smaller(t,this.minimumTotalRise()))throw new Error(`Cannot construct Stairway with rise smaller than ${this.minimumTotalRise()}`)}static displayName(){return"Stairway"}static iconName(){return"stairs"}snapToFramesFilter(){return e=>n.largerEq(e.height(),this.minimumTotalRise())&&n.smallerEq(e.height(),this.maximumTotalRise())}minimumTotalRise(){return n.multiply(this.minimumStepRise(),2)}minimumStepRise(){return this.constructor.minimumStepRise()}maximumStepRise(){return i(9.5,"in")}maximumTotalRise(){return i(12,"ft")}minimumStepRun(){return i(9.5,"in")}maximumStepRun(){return i(11,"in")}minimumAngleDegrees(){return 30}maximumAngleDegrees(){return 50}minimumWidth(){return this.constructor.minimumWidth()}maximumWidth(){const e=this.frameEdgeAttachedTo()?.length()||1/0,t=i(e,this.unit());return n.min(i(48,"in"),t)}updateHeight(){super.updateHeight();const e=this.inclineAngle().radiansToDegrees(),t=this._defaultInclineAngle().radiansToDegrees();this._inclineAngleValid(e)||t===e||this.setInclineAngle(t.degreesToRadians());const r=this._defaultNumberOfRises();this.numberOfRises()!==r&&this.setNumberOfRises(r)}threeFigure(){return o.withModel(this)}defaultFigure(){return new u(this)}validInclineAnglesAndRises(){const e={};for(let t=this.minimumAngleDegrees();t<=this.maximumAngleDegrees();t++)e[t]=this._validRisesForAngle(t);return e}_validRisesForAngle(e){const t=this.totalRise().toNumeric(this.unit()),r=Math.round(t/Math.tan(e.degreesToRadians())),n=Math.ceil(Math.max(t/this.maximumStepRise().toNumeric(this.unit()),r/this.maximumStepRun().toNumeric(this.unit()),2)),s=Math.floor(Math.min(t/this.minimumStepRise().toNumeric(this.unit()),r/this.minimumStepRun().toNumeric(this.unit()))),o=[];for(let e=n;e<=s;e++){const n=t/e,s=r/e;i(24,"in").toNumeric(this.unit())<=2*n+s<=i(27,"in").toNumeric(this.unit())&&o.push(e)}return o}_defaultNumberOfRises(){const e=this._validRisesForAngle(this.inclineAngle().radiansToDegrees());if(e.length>0)return Math.max(...e);const t=this.totalRise().toNumeric(this.unit()),r=this.constructor.defaultStepRise().toNumeric(this.unit());return Math.round(Math.max(1,t/r))}_defaultInclineAngle(){return this._inclineAngleValid(40)?40..degreesToRadians():this._closestValidInclineAngleTo(40).degreesToRadians()}_closestValidInclineAngleTo(e){const t=this.validInclineAnglesAndRises(),r=[];Object.entries(t).forEach((([e,t])=>{const n=parseFloat(e);t.length>0&&r.push(n)})),r.sort(((e,t)=>e-t));const n=r.filter((t=>t<e)),i=r.filter((t=>t>e));return n.length>0?n.last():i.length>0?i.first():e}_inclineAngleValid(e){return this._validRisesForAngle(e).length>0}setInclineAngleAndRises(e,t){this.setInclineAngle(e);const r=this.lowerPlatformEdge();r&&this.snapToEdge([r],0),this.setNumberOfRises(t)}insideWidth(){return this.insideBottomEdge().length()}_defaultStringers(){return[this.rightStringer(),this.leftStringer()]}_stringerDistanceFromBegin(){return n.divide(this.stepRise(),this.stepRun())*this.stringerDepth().toNumeric(this.unit())}leftStringer(){const e=this.sideEdges();return new c(e.last().end(),new s(e.last(),this._stringerDistanceFromBegin()),this.stringerDepth())}rightStringer(){const e=this.sideEdges();return new c(new s(e.first(),this._stringerDistanceFromBegin()),e.first().end(),this.stringerDepth())}_defaultTreads(){const e=[],t=this.sideEdges(),r=c.defaultWidth().toNumeric(this.unit()),n=[this._makeEdgeForTreads(t.first(),-r),this._makeEdgeForTreads(t.last(),r)],i=this._stepDistanceAlongSideEdge(),o=this.numberOfRises()-1;for(let t=0;t<o;t++)e.push(new l(new s(n.first(),i*(t+1)),new s(n[1],i*(t+1)),this.stepRun()));return e}_makeEdgeForTreads(e,t){return e.shiftedAlongNormalBy(t)}_stepDistanceAlongSideEdge(){const e=this.stepRun().toNumeric(this.unit()),t=this.stepRise().toNumeric(this.unit());return Math.sqrt(e**2+t**2)}_makeEdgeForRailing(e,t){const r=e.center(),n=t.center();return r.to(n)}railingSections(){const e=this.stringerWidth().toNumeric(this.unit()),t=this.treads().first(),r=this.treads().last(),i=[this._makeEdgeForRailing(t.endEdges().first(),r.endEdges().first()).shiftedAlongNormalBy(e),this._makeEdgeForRailing(r.endEdges().last(),t.endEdges().last()).shiftedAlongNormalBy(e)],s=n.multiply(this.stepRun(),.5),o=t.thickness(),a=n.tan(this.inclineAngle()),l=n.add(n.multiply(s,a),o),c=new MetalStairwayRailingDelegate(l);return i.map((e=>{const t=new d(e,c);return t.setComponentOf(this),t}))}components(){return[...super.components(),...this.railingSections()]}}},390:(e,t,r)=>{const{PolarCoordinate:n,Angle:i}=r(62048),s=r(74225);e.exports=class MiterCurve extends s{constructor(e,t=0,r=void 0){super(e,r,void 0,t)}creaseSharpCorners(){return Boolean(this.direction)}computeFrenetFrames(e,t){const r=this.originalFrenetFrames(e,t),n=[];for(let t=0;t<r.binormals.length;t++){const i=this.getPoint(t/e),s=t>0?this.getPoint((t-1)/e):void 0,o=t<e?this.getPoint((t+1)/e):void 0,a=r.binormals[t];n[t]=this.calculateBinormal(s,i,o,a)}return{tangents:r.tangents,normals:r.normals,binormals:n}}calculateBinormal(e,t,r,s){if(!e||!r)return s;const o=new i(t.toPoint(),e.toPoint(),r.toPoint()),a=o.smallestDeltaRadians()/2,l=Math.abs(1/Math.sin(a)),c=new n(l,o.bisectingTheta()).toThreeJS();return s.dot(c)>0?c:c.negate()}}},39064:(e,t,r)=>{const{three:n}=r(37732),{General:i}=r(62048),s=new n.Vector3(0,0,-1),o=new n.Vector3,a=new n.Vector3;class MiterLineCurve extends n.LineCurve3{constructor(e,t,r,n){super(e,t),this.__beginMiterVector=r,this.__endMiterVector=n}_endMiterVector(){return this.__endMiterVector}_beginMiterVector(){return this.__beginMiterVector}_direction(){return this.__direction??=(new n.Vector3).subVectors(this.v2,this.v1).normalize()}_normal(){return this.__normal??=new n.Vector3(1,0,0).applyAxisAngle(s,i.locatorNormalAngle(this._direction().x,this._direction().y)).negate()}_binormal(){return this.__binormal??=(new n.Vector3).crossVectors(this._direction(),this._normal())}_adjustVectorForMiter(e,t){const r=t.clone(),i=this._direction();t.dot(i)<0&&r.negate();const s=o.copy(e).multiplyScalar(r.dot(e)).add(a.copy(i).multiplyScalar(r.dot(i))).normalize(),l=(new n.Quaternion).setFromUnitVectors(i,s),c=i.angleTo(s);return e.clone().applyQuaternion(l).normalize().multiplyScalar(1/Math.cos(c))}computeFrenetFrames(e,t){const r=e-1;return{tangents:Array(r+2).fill(this._direction()),normals:[this._adjustVectorForMiter(this._normal(),this._beginMiterVector()),...Array(r).fill(this._normal()),this._adjustVectorForMiter(this._normal(),this._endMiterVector())],binormals:[this._adjustVectorForMiter(this._binormal(),this._beginMiterVector()),...Array(r).fill(this._binormal()),this._adjustVectorForMiter(this._binormal(),this._endMiterVector())]}}}e.exports=MiterLineCurve},2932:e=>{e.exports=class MultiStateToggle{addState(e,t){if(this.getDetailsFor(e))throw new Error(`"${e}": State already exists in toggle.`);this.namesOfStates().push(e),this.#n[e]=t}removeState(e){const t=this.getDetailsFor(e);if(!t)return;const r=this.current().name,n=r===e?void 0:r;return delete this.#n[e],this.#i.splice(this.#i.indexOf(e),1),this.#s(n),t}getDetailsFor(e){return this.#n[e]}current(){return this.#o}toggle(){if(this.numberOfStates()<1)throw new Error("No states exist in toggle.");return this.#a()}namesOfStates(){return this.#i}numberOfStates(){return this.#i.length}get#i(){return this._stateNames??=[]}get#n(){return this._stateDetails??={}}get#l(){return this._currentStateIndex??=0}get#o(){return this._current??=(()=>{if(this.numberOfStates()<1)return;const e=this.#i[this.#l];return t=e,r=this.getDetailsFor(e),{name:t,details:r};var t,r})()}#a(){return this._currentStateIndex=(this.#l+1)%this.numberOfStates(),this._current=void 0,this.current()}#s(e){this._current=void 0,this._currentStateIndex=Math.max(0,this.#i.indexOf(e))}}},36310:(e,t,r)=>{const{Polygon:n,PlanarNormalToEdgeLocator:i}=r(62048);e.exports=class NormalPostGeometryStrategy{_planeNormal(e){const t=e.locator().edge();return t.direction().cross(t.normal())}generateGeometry(e){const t=this._planeNormal(e),r=e.length().toNumeric(e.unit())/2,s=e.width().toNumeric(e.unit())/2;return new n([new i(e.locator(),t,-s,-r),new i(e.locator(),t,s,-r),new i(e.locator(),t,s,r),new i(e.locator(),t,-s,r)])}}},5090:e=>{class ObjectKeyMap{constructor(e=[]){e.forEach((e=>{this.set(e.first(),e.last())}))}keys(){return this._keys||(this._keys=[]),this._keys}values(){return this._values||(this._values=[]),this._values}get(e){const t=this._matchingKey(e);return this.values()[this.keys().indexOf(t)]}has(e){return Boolean(this._matchingKey(e))}set(e,t){if(this.has(e)){const r=this.keys().indexOf(this._matchingKey(e));this.values()[r]=t}else this.keys().push(e),this.values().push(t)}delete(e){const t=this.keys().indexOf(this._matchingKey(e));-1!==t&&(this.keys().splice(t,1),this.values().splice(t,1))}clone(){const e=new ObjectKeyMap;return e._keys=this.keys().slice(),e._values=this.values().slice(),e}_matchingKey(e){return this.keys().find((t=>t===e))??this.keys().find((t=>t.equals?.(e)))}toDebugString(){const e={},t=this.keys(),r=this.values();for(let n=0;n<t.length;n++){const i=t[n].toString(),s=r[n].toString();e[n]={key:i,value:s}}return e}}e.exports=ObjectKeyMap},25630:(e,t,r)=>{const{CompositeEditableProperty:n}=r(7340),i=r(67603);e.exports=class OverlappingPropertiesCollection extends i{constructor(e,t=void 0){super(),this._models=e,this._inclusionFlag=t}models(){return this._models}inclusionFlag(){return this._inclusionFlag}observableModels(){return this.models()}displayProperties(){return n.overlappingProperties(this.models()).filter((e=>!this.inclusionFlag()||e.options()[this.inclusionFlag()]))}}},8297:(e,t,r)=>{const n=r(63768),i=n.unit,{ExtrudedPolygon:s}=r(62048),{simpleObserver:o}=r(50988),{EditableProperty:a}=r(7340),l=r(55848),c=r(22093),u=r(11419),d=r(15004);class Platform extends l{static defaultWidth(){return n.unit(5,"ft")}static defaultLength(){return n.unit(5,"ft")}static defaultHeight(){return n.unit(0,"ft")}static builder(e){return new c(e,this)}static displayName(){return"Platform"}static iconName(){return"platform"}async load(){return Promise.all(this.components().map((e=>e.load?.())))}boundingBox(){return this.geometry().boundingBox()}boundingCube(){return this.shape3D().boundingCube()}center(){return this.shape().boundingBox().center()}constrainWidthAdjustment(e){return e}constrainLengthAdjustment(e){return e}minimumWidth(){return n.unit(0,"ft")}maximumWidth(){return n.unit(1/0,"ft")}maximumHeight(){return n.unit(1/0,"ft")}minimumLength(){return n.unit(0,"ft")}maximumLength(){return n.unit(1/0,"ft")}snapToConnectorsFilter(){return e=>e.canAcceptLowerFrame(this)}snapToFramesFilter(){return e=>!0}attachedConnectors(){return[...this.connectorsGoingDown(),...this.connectorsGoingUp()]}connectorsShouldSnapToCenter(){return!1}surfaceOverhang(){return i(0,"in")}moveBy(e,t,r){const n=this.referencePoint().moveBy(e,t,r);return n&&r&&this.heightChanged(),n}zLevel(){return-this.height().toNumeric(this.unit())}height(){return this._height||(this._height=this.constructor.defaultHeight()),this._height}setHeight(e){const t=e.toNumeric(this.unit()),r=this.maximumHeight().toNumeric(this.unit()),i=Math.min(t,r);if(i>0){const e=this.height().toNumeric(this.unit());this._height=n.unit(i,this.unit());const t=e-i;this.moveBy(0,0,t),this.heightChanged()}}heightChanged(){this.notifyHeightChangedObservers(this)}frameResized(){super.frameResized(),this.frameResizedNotificationsEnabled()&&this.notifyFrameResizedObservers()}connectorsGoingDown(){return this._connectorsGoingDown||(this._connectorsGoingDown=[]),this._connectorsGoingDown}addConnectorGoingDown(e){this._startObservingConnectorGoingDown(e),this.connectorsGoingDown().push(e)}removeConnectorGoingDown(e){const t=this.connectorsGoingDown().indexOf(e);return-1!==t&&(this._stopObservingConnectorGoingDown(e),this.connectorsGoingDown().splice(t,1),!0)}_startObservingConnectorGoingDown(e){}_stopObservingConnectorGoingDown(e){}connectorsGoingUp(){return this._connectorsGoingUp||(this._connectorsGoingUp=[]),this._connectorsGoingUp}addConnectorGoingUp(e){this._moveToConnectorGoingUp(e),this._startObservingConnectorGoingUp(e),this.connectorsGoingUp().push(e)}_moveToConnectorGoingUp(e){const t=e.lowerEdge(),r=t.normal(),n=this.edges().find((e=>-1===e.normal().dot(r))).center().to(t.center()).vector().dot(r),i=r.multipliedBy(n);this.moveBy(i.x(),i.y(),0)}removeConnectorGoingUp(e){const t=this.connectorsGoingUp().indexOf(e);return-1!==t&&(this._stopObservingConnectorGoingUp(e),this.connectorsGoingUp().splice(t,1),!0)}_startObservingConnectorGoingUp(e){}_stopObservingConnectorGoingUp(e){}components(){return[]}materialLineItems(){return[]}thickness(){return n.unit(1,"in")}shape3D(){return new s(this.geometry(),this.thickness().toNumeric(this.unit()))}threeFigure(){return new d(this)}defaultFigure(){return new u(this)}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_heightChangedObservers","_frameResizedObservers"]}defaultHeightProperty(){return new a(this,"Height",{type:"unit",defaultUnit:"ft"})}defaultWidthProperty(){return new a(this,"Width",{type:"unit",defaultUnit:"ft"})}defaultLengthProperty(){return new a(this,"Length",{type:"unit",defaultUnit:"ft"})}defaultDisplayProperties(){return[this.defaultHeightProperty(),this.defaultWidthProperty(),this.defaultLengthProperty()]}}o(Platform,"heightChanged"),o(Platform,"frameResized"),e.exports=Platform},60115:(e,t,r)=>{const n=r(63768);e.exports=class PricingSource{constructor(e,t){this._pricing=e,this._multiplierSource=t}pricing(){return this._pricing}unitPrice(e){const t=this.pricing()[e];if(!t)return;const{price:r,perUnit:i}=t;return i?n.unit(r,`1/${i}`):r}perUnit(e){const t=this.pricing()[e];if(t)return t.perUnit}multiplier(){return this._multiplierSource?.multiplier?.()??1}}},35668:(e,t,r)=>{const{Locator:n}=r(62048);e.exports=class ProjectedLocator extends n{static unproject(e,t,r,n=t.cross(r)){return t.normalized().multipliedBy(e.x()).add(r.normalized().multipliedBy(e.y())).add(n.normalized().multipliedBy(e.z()))}constructor(e,t,r,n=t.cross(r)){super(),this._referenceLocator=e,this._xAxis=t.normalized(),this._yAxis=r.normalized(),this._zAxis=n.normalized()}referenceFrame(){this.referenceLocator().referenceFrame()}referenceLocator(){return this._referenceLocator}xAxis(){return this._xAxis}yAxis(){return this._yAxis}zAxis(){return this._zAxis}x(){return this.referenceLocator().dot(this.xAxis())}y(){return this.referenceLocator().dot(this.yAxis())}z(){return this.referenceLocator().dot(this.zAxis())}}},67603:(e,t,r)=>{const{extend:n}=r(50988),i=r(3569);class PropertiesCollection{constructor(e,t){this._model=e,this._displayProperties=t}}n(PropertiesCollection,i),PropertiesCollection.prototype[Symbol.iterator]=i.prototype[Symbol.iterator],e.exports=PropertiesCollection},2198:(e,t,r)=>{const n=r(63768),{ProportionalEdgeLocator:i,Polygon:s,NormalToEdgeLocator:o}=r(62048),{MissingOverride:a}=r(50988),{MaterialSpecifier:l}=r(93613),c=r(59663),u=r(39644),d=r(83102),h=r(6556);e.exports=class Rail extends d{constructor(e){super(),this._edge=e}get railingsConfig(){return this.strategyProjectConfig().railings}edge(){return this._edge}beginLocator(){return this.edge().begin()}endLocator(){return this.edge().end()}referencePoint(){return this.edge().center()}length(){return this.edge().length()}geometry(){return this._geometry||(this._geometry=this.defaultGeometry()),this._geometry}zLevel(){return this.geometry().zLevel()}defaultGeometry(){return this._defaultGeometryForEdge(this.edge())}_defaultGeometryForEdge(e){const t=this.width().toNumeric(this.unit())/2,r=new i(e,0),n=new i(e,1);return new s([new o(r,-t),new o(r,t),new o(n,t),new o(n,-t)])}materialSpecifier(){const e=this.pricingLength();return new l(`Rail${e.toNumeric("in").rounded().toString().padStart(4,"0")}`,`Rail (${e.toString()})`)}pricingLength(){return n.unit(this.edge().length(),this.unit())}materialLineItems(){return[new h(1,this.materialSpecifier())]}crossSection(){throw new a(this,"crossSection")}defaultFigure(){return new c(this)}threeFigure(){return new u(this)}components(){return[]}async load(){return Promise.all(this.components().map((e=>e.load?.())))}}},87763:(e,t,r)=>{const{Polygon:n,$P:i,RelativeLocator:s,ProportionalEdgeLocator:o,PlanarNormalToEdgeLocator:a}=r(62048);e.exports=class RectangularGeometryOffsetHelper{constructor(e){this._frame=e}frame(){return this._frame}mainAxis(){return this.frame().mainAxis()}crossAxis(){return this.frame().crossAxis()}applyOffsetToEdges(e,t){const r=this._centerOfEdgeGroup(e);return e.map((e=>this._applyOffsetToVertex(e.begin(),t,r).to(this._applyOffsetToVertex(e.end(),t,r))))}_centerOfEdgeGroup(e){return new n(e.flatMap((e=>[e.begin(),e.end()]))).boundingBox().center()}applyOffsetToGeometry(e,t){const r=e.vertices().map((r=>this._applyOffsetToVertex(r,t,e.centroid())));return new n(r)}applyOffsetToEdge(e,t,r=t){const n=new o(e,0),i=new o(e,1),s=new a(n,e.normal(),t.z(),t.x(),t.y()),l=new a(i,e.normal(),r.z(),-r.x(),r.y());return s.to(l)}_applyOffsetToVertex(e,t,r){const n=this.mainAxis(),o=this.crossAxis(),a=e.subtract(r),l=Math.sign(n.dot(a)),c=Math.sign(o.dot(a)),u=i(l*t.x(),c*t.y(),t.z()),d=this._projectIntoLocalCoordinates(u);return new s(e,d.x(),d.y(),d.z())}_projectIntoLocalCoordinates(e){const t=this.mainAxis(),r=this.crossAxis();return t.multipliedBy(e.x()).add(r.multipliedBy(e.y())).add(t.cross(r).multipliedBy(e.z()))}}},57418:(e,t,r)=>{const{MaterialSpecifier:n}=r(93613);e.exports=class ReferenceMaterialSpecifier extends n{specifierForDescription(e){return this.specifierFor(e)}specifierFor(e,t={}){const r=this.identifier(),i=`${r}_specifier_for_${e.split(" ").join("_")}`,s={...this.details(),...t};return s.pricingIdentifier??=r,new n(i,e,s)}}},14244:(e,t,r)=>{const{ReadableProperty:n,EditableProperty:i}=r(7340),{extend:s}=r(50988),o=r(3569),a=r(41409);class RepeatingEditableProperty extends i{constructor(e,t,{addButtonLabel:r="Add",clearButtonLabel:n="Clear All",basePropertyLabel:i,defaultValue:s,canAddProperty:o,...a}={}){super(e,t,a),a.label=void 0,this._addButtonLabel=r,this._clearButtonLabel=n,this._basePropertyLabel=i,this._propertyOptions=a,this._defaultValue=s,o&&(this.canAddProperty=o)}addButtonLabel(){return this._addButtonLabel}clearButtonLabel(){return this._clearButtonLabel}propertyOptions(){return this._propertyOptions}defaultValue(){return this._defaultValue}model(){return this._component}format(e){return this.component()[this._formatterName]?this.component()[this._formatterName](e):e.toString()}visibleProperties(){return[this.groupLabel(),...this.displayProperties(),this.addPropertyButton(),this.clearPropertiesButton()]}groupLabel(){return this._groupLabel??=new n(this,this.label(),{type:"text",get:()=>"",visible:()=>this.visible()})}addPropertyButton(){return new i(this,"Add Property",{type:"action",label:this.addButtonLabel(),perform:()=>this._addProperty(),visible:()=>this.visible(),disabled:this._addButtonDisabled()})}clearPropertiesButton(){return this._clearPropertiesButton??=new i(this,"Clear Properties",{type:"action",label:this.clearButtonLabel(),perform:()=>this._clearProperties(),visible:()=>this.visible()})}basePropertyLabel(){return this._basePropertyLabel??=this.label()}_addProperty(){const e=this.displayProperties(),t=e.length+1,r=this._createPropertyWrapper(void 0,t);e.push(r.property()),this.updateStoredValues(),this.propertiesChanged()}_clearProperties(){this.set([]),this._displayProperties=[],this.propertiesChanged()}_createPropertyWrapper(e=this.defaultValue(),t=0){return new a(this,{name:`${this.basePropertyLabel()} ${t}`,value:e,...this.propertyOptions()})}displayProperties(){return this._displayProperties??=this._defaultDisplayProperties()}_defaultDisplayProperties(){return this.get().map(((e,t)=>this._createPropertyWrapper(e,t+1).property()))}get(){return super.get()??[]}validate(e,t,r){if(this.component()[this._validatorName])return this.component()[this._validatorName](e,t,this._indexForProperty(r),this._propertyValues(r))}_propertyValues(){return this.displayProperties().map((e=>e.get()))}updateStoredValues(){this.set(this._propertyValues())}_indexForProperty(e){return this.displayProperties().findIndex((t=>t===e))}_addButtonDisabled(){return!this.canAddProperty(this._propertyValues())}canAddProperty(e){return!0}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_groupLabel","_clearPropertiesButton"]}}s(RepeatingEditableProperty,o),RepeatingEditableProperty.prototype[Symbol.iterator]=o.prototype[Symbol.iterator],e.exports=RepeatingEditableProperty},41409:(e,t,r)=>{const{EditableProperty:n}=r(7340);e.exports=class RepeatingEditablePropertyWrapper{constructor(e,{name:t,value:r="",...i}){this._parentProperty=e,this._value=r,this._property=new n(e,t,{...i,restorable:!1,get:()=>this.get(),set:e=>this.set(e),toggle:()=>this._value=!this._value,validate:(...e)=>this.parentProperty().validate(...e,this.property()),parse:e=>this.parentProperty().parse(e),format:()=>this.parentProperty().format(this._value),visible:()=>this.parentProperty().visible()})}parentProperty(){return this._parentProperty}property(){return this._property}get(){return this._value}set(e){this._value=e,this.parentProperty().updateStoredValues()}}},38536:(e,t,r)=>{const{EditableProperty:n}=r(7340),i=r(90218);e.exports=class SelectPropertySupport{static propertyKey(e,t){return e?`${e} ${t}`:t}constructor(e){this._object=e}get object(){return this._object}get _selectPropertyMap(){return this.object.selectPropertyMap()}_get(e){return this._selectPropertyMap.get(e)}_set(e,t){this._selectPropertyMap.set(e,t)}_propertyKey(e,t){return this.constructor.propertyKey(e,t)}_propertyGetterForKey(e){return()=>this._get(e)}_propertySetterForKey(e,t=(()=>{})){return r=>{this._set(e,r),this.object.resetDisplayProperties?.(),t()}}_initializeValueForKey(e,t,r){const n=this._get(t);(r||void 0===n)&&this._set(t,e)}buildEditableProperty(e,t,r=(()=>{})){const s=e.dependsOn;let o;if(s){const r=this._propertyKey(t,s),n=this._get(r);o=e.optionsMap[n.identifier]}else o=e.options;const a=this._propertyKey(t,e.label),l=i.optionsForConfigs(o),c=1===l.length;return this._initializeValueForKey(l.first(),a,s),new n(this.object,a,{label:e.label,type:"select",choices:l,get:this._propertyGetterForKey(a),set:this._propertySetterForKey(a,r),disabled:c})}}},11464:(e,t,r)=>{const{Polygon:n,$P:i}=r(62048),s=r(88646),o=r(86755),a=r(72596);e.exports=class SteelChannel extends a{_defaultCrossSection(){const e=this.materialSpecifier(),t=e.details().width.toNumeric(this.unit())/2,r=e.details().depth.toNumeric(this.unit())/2,a=e.details().thickness.toNumeric(this.unit());return new s([new o(new n([i(-r,-t),i(-r,t),i(r,t),i(r,-t),i(r-a,-t),i(r-a,t-a),i(-r+a,t-a),i(-r+a,-t)]))])}color(){return"#aaaaaa"}}},72596:(e,t,r)=>{const n=r(63768),{ProportionalEdgeLocator:i,PlanarNormalToEdgeLocator:s,Polygon:o,$P:a}=r(62048),l=r(30202),c=r(88646),u=r(86755),d=r(84296),h=r(6556);e.exports=class SteelExtrusion extends l{static builder(e){return new d(this,e)}constructor(e,t,r,n,i){super(e,t,void 0,r,i),this._offset=n}materialNames(){return["steel"]}color(){return this.project()?.steelColor?.()??"#aaaaaa"}centerEdge(){const e=this.edge(),t=this.offset(),r=this.planarNormal(),n=new i(e,0),o=new i(e,1);return new s(n,r,t.x(),0,t.y()).to(new s(o,r,t.x(),0,t.y()))}extrusionEdge(){return this.centerEdge()}_defaultCrossSection(){const e=this.materialSpecifier(),t=e.details().width.toNumeric(this.unit())/2,r=e.details().depth.toNumeric(this.unit())/2;return new c([new u(new o([a(-r,-t),a(-r,t),a(r,t),a(r,-t)]))])}length(){return n.unit(this.edge().length(),this.unit())}selfMaterialLineItems(){return[new h(this.length(),this.materialSpecifier())]}}},28823:(e,t,r)=>{const n=r(63768),i=n.unit,{Edge:s,FixedEdgeLocator:o,$P:a,RelativeLocator:l,ShapeFromVertices:c}=r(62048),{extend:u,simpleObserver:d,MissingOverride:h}=r(50988),{StableID:p}=r(7340),{Composite3DFigure:m}=r(37732),{MaterialList:f}=r(27871),g=r(54798),y=r(35032);class SteppedStructureConnector extends g{static defaultWidth(){throw new h(this,"defaultWidth")}static builder(e){return{build:()=>{const t=this.defaultWidth().toNumeric(e.unit()),r=new this([a(0,0),a(t,0)]),n=r.totalRise().toNumeric(r.unit());return r.moveBy(0,0,-n),r}}}constructor(e,t=i(40,"in")){super(),this._topVertices=e,this._totalRise=t}async load(){return Promise.all(this.components().map((e=>e.load?.())))}snappableAngles(){const e=[];for(let t=0;t<360;t+=45)e.push(t.degreesToRadians());return e}angle(){return this.forwardDirection().theta().normalizedAngle()}setAngle(e){const t=e-this.angle();if(Math.abs(t)>Math.DEFAULT_TOLERANCE){const e=this.locator();this.topVertices().forEach((r=>{r.rotateBy(e,t)})),this.reset()}}geometry(){return this.shape()}locator(){return this.boundingBox().center()}height(){return this.totalRise()}totalRise(){return this._totalRise}topVertices(){return this._topVertices}upperFrame(){return this._upperFrame}lowerFrame(){return this._lowerFrame}minimumWidth(){}minimumTotalRise(){return i(0,"in")}maximumWidth(){}topEdge(){return new s(...this.topVertices())}forwardDirection(){return this.topEdge().normal()}mainAxis(){const e=this.forwardDirection(),t=-(Math.PI_2-this.inclineAngle());return e.rotatedBy(a(0,0),0,t)}snapToFramesFilter(){return e=>!0}snapsToCenter(){return!1}canAcceptLowerFrame(e){if(!this.upperFrame())return!0;const t=this.upperFrame().height(),r=n.subtract(t,e.height());return n.largerEq(r,this.minimumTotalRise())}upperEdge(){return this.topEdge()}lowerEdge(){return this.bottomEdge()}offsetFromFrameWhenAttached(e){return i(0,"in")}offsetWithOverhang(e){return e}width(){return i(this.topEdge().length(),this.unit())}setWidth(e){const t=n.max(n.min(e,this.maximumWidth()),this.minimumWidth()),r=n.subtract(t,this.width()).toNumeric(this.unit()),i=this.upperEdge().direction().multipliedBy(r);this.topVertices().last().moveBy(i.x(),i.y(),i.z()),this.checkUpperFrameAttachment(),this.detachLowerFrame(),this.frameResized()}setTopVertices(e){this._topVertices=e,this.reset()}_estimatedRunForRise(e){const t=this.stepRun().toNumeric(this.unit()),r=this.stepRise().toNumeric(this.unit());return e*t/r-r}_estimatedVerticesForRise(e){const t=this._estimatedRunForRise(e),r=this.topEdge().shiftedAlongNormalBy(t).movedBy(0,0,e);return[r.begin(),r.end()]}detachFrame(e){e&&(e===this.upperFrame()&&this.detachUpperFrame(),e===this.lowerFrame()&&this.detachLowerFrame())}detachUpperFrame(){if(!this.upperFrame())return;const e=this.topVertices();this.setTopVertices(e.map((e=>e.snapshot()))),this.upperFrame().removeConnectorGoingDown(this),this.upperFrame().removeFrameResizedObserver(this,this.checkUpperFrameAttachment),this.upperFrame().removeHeightChangedObserver(this,this._upperFrameHeightChanged),this._upperFrame=void 0}attachUpperFrame(e){if(this.detachUpperFrame(),this._upperFrame=e,e){this.setTotalRise(e.height());const t=this.frameEdgeAttachedTo(),r=this.upperEdge(),n=t.closestPointTo(r.begin()),i=t.closestPointTo(r.end());this.setTopVertices([n,i]),e.addConnectorGoingDown(this),this._observeUpperFrame()}}_observeUpperFrame(){this.upperFrame().addFrameResizedObserver(this,this.checkUpperFrameAttachment),this.upperFrame().addHeightChangedObserver(this,this._upperFrameHeightChanged)}_upperFrameHeightChanged(){this.detachLowerFrame(),this.updateHeight()}checkUpperFrameAttachment(){const e=this.frameEdgeAttachedTo();if(!e)return;const t=this.width().toNumeric(this.unit());if(e.length()<t)this.attachUpperFrame(void 0);else if(!e.containsEdge(this.topEdge())){const t=this.topVertices(),r=e.end().subtract(t.last());t.first().moveBy(r.x(),r.y(),r.z()),t.last().moveBy(r.x(),r.y(),r.z())}}frameEdgeAttachedTo(){return this._frameEdgeAttachedTo||(this._frameEdgeAttachedTo=this.findClosestEdge(this.topEdge().center())),this._frameEdgeAttachedTo}detachLowerFrame(){this.lowerFrame()&&(this.lowerFrame().removeConnectorGoingUp(this),this.lowerFrame().removeFrameResizedObserver(this,this.detachLowerFrame),this.lowerFrame().removeHeightChangedObserver(this,this.detachLowerFrame),this._lowerFrame=void 0,this.updateHeight())}attachLowerFrame(e){this.detachLowerFrame(),this._lowerFrame=e,this.updateHeight(),e&&(e.addConnectorGoingUp(this),this._observeLowerFrame())}_observeLowerFrame(){this.lowerFrame().addFrameResizedObserver(this,this.detachLowerFrame),this.lowerFrame().addHeightChangedObserver(this,this.detachLowerFrame)}stringers(){return this._stringers||(this._stringers=this._defaultStringers()),this._stringers}_defaultStringers(){return[]}treads(){return this._treads||(this._treads=this._defaultTreads()),this._treads}_defaultTreads(){return[]}setNumberOfRises(e){this._numberOfRises=e,this._resetComponents()}_round(e){const t=e.toNumeric(this.unit()),r=Math.round(t);return i(r,this.unit())}totalRun(){if(!this._totalRun){const e=n.divide(this.totalRise(),Math.tan(this.inclineAngle()));this._totalRun=this._round(e)}return this._totalRun}setTotalRise(e){e.equals(this.totalRise())||(this._totalRise=e,this.reset())}stepRise(){return this._stepRise||(this._stepRise=this._round(n.divide(this.totalRise(),this.numberOfRises()))),this._stepRise}stepRun(){return this._stepRun||(this._stepRun=this._round(n.divide(this.totalRun(),this.numberOfRises()))),this._stepRun}frameResized(){this.notifyFrameResizedObservers(this)}reset(){this._resetShape(),this.setNumberOfRises(this._defaultNumberOfRises())}_resetShape(){this._vertices=void 0,this._footprintBottomVertices=void 0,this._stringerBottomVertices=void 0,this._totalRun=void 0}_resetComponents(){this._frameEdgeAttachedTo=void 0,this._stepRise=void 0,this._stepRun=void 0,this._stringers=void 0,this._treads=void 0}updateHeight(){const e=this.lowerFrame()?this.lowerFrame().height():i(0,this.unit());if(this.upperFrame()){const t=n.subtract(this.upperFrame().height(),e);this.setTotalRise(t)}const t=-n.add(e,this.totalRise()).toNumeric(this.unit());this.topVertices().forEach((e=>{const r=t-e.z();e.moveBy(0,0,r)}))}updateSupports(){}updateRails(){}findClosestEdge(e,t=this.exposedFrameEdges()){return t.reduce(((t,r)=>(this.identifyFrameEdgeToPoint(r,e),t.distance===r.distance?t.deltaAngle<r.deltaAngle?t:r:r.distance<t.distance?r:t)),{distance:1/0}).edge}exposedFrameEdges(){return this.upperFrame()?this.upperFrame().edges().map((e=>({edge:e}))):[]}identifyFrameEdgeToPoint(e,t){e.shortestLine=e.edge.shortestLineFrom(t),e.deltaAngle=e.shortestLine.end().equals(e.edge.end())?e.shortestLine.reversed().angle()-e.edge.reversed().angle():e.edge.angle()-e.shortestLine.reversed().angle(),e.deltaAngle=(e.deltaAngle+Math.TWO_PI)%Math.TWO_PI,e.distance=e.shortestLine.length()}numberOfRises(){return this._numberOfRises||(this._numberOfRises=this._defaultNumberOfRises()),this._numberOfRises}_defaultNumberOfRises(){}inclineAngle(){return this._inclineAngle||(this._inclineAngle=this._defaultInclineAngle()),this._inclineAngle}_defaultInclineAngle(){}setInclineAngle(e){this._inclineAngle=e,this.reset()}bottomEdge(){return new s(...this.stringerBottomVertices())}bottomOfStringerEdge(){const e=this.stringers().flatMap((e=>e.shape3D().vertices())),t=this._findVerticesAtMaximum(e,(e=>e.z())),r=this.forwardDirection(),n=this._findVerticesAtMaximum(t,(e=>-e.dot(r))),i=this.topEdge().vector().normalized();return n.sort(((e,t)=>e.dot(i)-t.dot(i))),n.first().to(n.last())}_findVerticesAtMaximum(e,t){const r=e.reduce(((e,r)=>Math.max(e,t(r))),-1/0);return e.fastFilter((e=>t(e).isNearTo(r)))}stringerWidth(){return this.stringers().first().width()}insideBottomEdge(){const e=this.bottomEdge(),t=this.stringerWidth().toNumeric(this.unit());return new s(new o(e,t),new o(e,-t))}zLevel(){const e=this.stringers().first();return Math.min(e.beginLocator().z(),e.endLocator().z())}stringerDepth(){const e=this.stepRun(),t=y.defaultThickness(),r=n.add(e,n.divide(t,n.tan(this.inclineAngle())));return n.multiply(r,n.sin(this.inclineAngle()))}sideEdges(){const e=this.topVertices(),t=this.footprintBottomVertices(),r=[new s(e.first(),t.first()),new s(e.last(),t.last())],i=n.divide(this.stepRise(),this.stepRun()),a=n.divide(this.stringerDepth(),i).toNumeric(this.unit());return r.map((e=>new s(e.begin(),new o(e,-a))))}lowerPlatformEdge(){if(!this.lowerFrame())return;const e=this.lowerFrame().edges().filter((e=>e.isParallelTo(this.topEdge()))),t=this.topEdge().center();return e.reduce(((e,r)=>e.center().distanceTo(t)<r.center().distanceTo(t)?e:r))}vertices(){return this._vertices||(this._vertices=this._defaultVertices()),this._vertices}_defaultVertices(){const e=this.stringerBottomVertices().slice().reverse();return[...this.topVertices(),...e]}footprintBottomVertices(){return this._footprintBottomVertices||(this._footprintBottomVertices=this._defaultFootprintBottomVertices()),this._footprintBottomVertices}_defaultFootprintBottomVertices(){const e=this.totalRise().toNumeric(this.unit()),t=this.totalRun().toNumeric(this.unit()),r=this.topEdge().shiftedAlongNormalBy(t).movedBy(0,0,e);return[l.makeRelativeTo(r.begin(),this.topVertices().first()),l.makeRelativeTo(r.end(),this.topVertices().last())]}stringerBottomVertices(){return this._stringerBottomVertices||(this._stringerBottomVertices=this._defaultStringerBottomVertices()),this._stringerBottomVertices}_defaultStringerBottomVertices(){return this.sideEdges().map((e=>e.end()))}delete(){super.delete(),this.lowerFrame()&&(this.lowerFrame().removeConnectorGoingUp(this),this.detachLowerFrame()),this.upperFrame()&&(this.upperFrame().removeConnectorGoingDown(this),this.detachUpperFrame())}components(){return[...this.treads(),...this.stringers()]}allLocatedMaterials(){return this.locatedMaterials()}locatedMaterials(){return this.components()}materialList(){return new f(this)}materialLineItems(){return[]}componentMaterialLists(){return[]}boundingBox(){return this.components().map((e=>e.boundingBox())).reduce(((e,t)=>e.merge(t)))}boundingCube(){return this.components().map((e=>e.boundingCube())).reduce(((e,t)=>e.merge(t)))}threeFigure(){return m.withModel(this)}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_shape3D","_totalRun","_stringers","_treads","_frameResizedObservers","_footprintBottomVertices","_stringerBottomVertices","_vertices","_exposedFrameEdges"]}postRestorationAction(){this.upperFrame()&&this._observeUpperFrame(),this.lowerFrame()&&this._observeLowerFrame()}}u(SteppedStructureConnector,p),u(SteppedStructureConnector,c),d(SteppedStructureConnector,"frameResized"),e.exports=SteppedStructureConnector},76816:(e,t,r)=>{const n=r(63768).unit,{ConstructionComponent:i}=r(93613),{ExtrudedPolygon:s,NormalToEdgeLocator:o,ProportionalEdgeLocator:a,RelativeLocator:l,ShapeFromVertices:c}=r(62048),{extend:u}=r(50988),d=r(59663);class Stringer extends i{static defaultWidth(){return n(.375,"in")}static defaultDepth(){return n(8,"in")}constructor(e,t,r,n){super(),this._beginLocator=e,this._endLocator=t,this._depth=r,this._width=n}depth(){return this._depth??=this.constructor.defaultDepth()}width(){return this._width??=this.constructor.defaultWidth()}length(){return this.edge().length()}thickness(){return this.depth()}edge(){return this.beginLocator().to(this.endLocator())}beginLocator(){return this._beginLocator}endLocator(){return this._endLocator}vertices(){if(!this._vertices){const e=this.beginLocator().to(this.endLocator()),t=new a(e,0),r=new a(e,1),n=-this.width().toNumeric(this.unit());this._vertices=[this.beginLocator(),this.endLocator(),new o(r,n),new o(t,n)]}return this._vertices}shape3D(){return this._shape3D??=this._defaultShape3D()}_defaultShape3D(){const e=this.thickness().toNumeric(this.unit());return new s(this.shape(),e,this._extrudeVertices.bind(this))}_extrudeVertices(e,t){const r=this.shape().normal().normalized().multipliedBy(t);return e.map((e=>new l(e,r.x(),r.y(),r.z())))}defaultFigure(){return new d(this)}materialLineItems(){return[]}}u(Stringer,c),e.exports=Stringer},55848:(e,t,r)=>{const n=r(63768),{$P:i,PolarCoordinate:s}=r(62048),{MissingOverride:o}=r(50988),a=r(54798);e.exports=class StructuralFoundation extends a{static builder(){throw new o(this,"builder")}constructor(e,t,r){super(),this._geometryStrategy=e,this._referencePoint=t,this._angle=r??this._defaultAngle()}geometryStrategy(){return this._geometryStrategy}moveBy(e,t,r){return this.referencePoint().moveBy(e,t,r)}area(){return n.unit(this.geometry().area(),`${this.unit()}^2`)}frameResized({fromSetter:e}={fromSetter:!1}){e||this.updateDisplayProperties()}mainAxis(){return new s(1,this.angle())}crossAxis(){return new s(1,this.angle()+Math.PI_2)}alongMainAxis(e){const t=e.normalized();return Math.abs(t.dot(this.mainAxis())).isNearTo(1)}alongCrossAxis(e){const t=e.normalized();return Math.abs(t.dot(this.crossAxis())).isNearTo(1)}isPerpendicularTo(e){return this.alongCrossAxis(e.mainAxis())}referencePoint(){return this._referencePoint||(this._referencePoint=i(0,0)),this._referencePoint}locator(){return this.geometry().centroid?.()||this.geometry().center?.()||this.referencePoint()}zLevel(){throw new o(this,"zLevel")}vertices(){return this.geometry().vertices()}geometry(){return this._geometry||(this._geometry=this.defaultGeometry()),this._geometry}defaultGeometry(){const e=this.referencePoint(),t=this.angle(),r=this.zLevel();return this.geometryStrategy().buildGeometry(e,t,r)}resetGeometry(){this.setGeometry(void 0)}setGeometry(e){this._geometry=e}_rotateGeometry(e){return this.geometryStrategy().rotateGeometry(this.geometry(),e)}_rotateGeometryAround(e,t){return this.geometryStrategy().rotateGeometryAround(this.geometry(),e,t)}angle(){return this._angle}_defaultAngle(){return Math.THREE_PI_2}setAngle(e){const t=e-this.angle();Math.abs(t)>Math.DEFAULT_TOLERANCE&&(this._angle=e,this._geometry&&this._rotateGeometry(t),this.angleChanged(e,t,this.locator()))}rotateBy(e,t){if(Math.abs(t)>Math.DEFAULT_TOLERANCE){const r=this.angle()+t;this._angle=r,this._geometry&&this._rotateGeometryAround(e,t),this.angleChanged(r,t,e)}}angleChanged(e,t,r){}snappableAngles(){const e=[];for(let t=0;t<360;t+=45)e.push(t.degreesToRadians());return e}normal(){return this.geometry().normal()}edges(e=this.geometry()){return e.edges()}endEdges(e){return this.edges(e).fastFilter((e=>this.alongCrossAxis(e.vector())))}sideEdges(e){return this.edges(e).fastFilter((e=>this.alongMainAxis(e.vector())))}findEdgeInDirection(e){return this.edges().find((t=>t.direction().equals(e)))}deckingEdges(){throw new o(this,"deckingEdges")}width(){const e=this.crossAxis(),t=this.vertices().map((t=>t.dot(e)));return n.unit(Math.max(...t)-Math.min(...t),this.unit())}setWidth(e){const t=e.toNumeric(this.unit()),r=this.geometryStrategy().setDimension(t,this.geometry(),this.crossAxis());return r&&this.frameResized({fromSetter:!0}),r}length(){const e=this.vertices().map((e=>e.dot(this.mainAxis())));return n.unit(Math.max(...e)-Math.min(...e),this.unit())}setLength(e){const t=e.toNumeric(this.unit()),r=this.geometryStrategy().setDimension(t,this.geometry(),this.mainAxis());return r&&this.frameResized({fromSetter:!0}),r}defaultAnnotations(){return this.geometryStrategy().buildAnnotations(this.geometry(),this.unit(),this.annotationDistance())}annotationDistance(){}surface(){throw new o(this,"surface")}components(){throw new o(this,"components")}}},69979:(e,t,r)=>{const n=r(17130),i=r(6556),s=r(42947);e.exports=class SubtotalLineItem extends i{constructor(e,t,{isCategoryTotal:r=!1,isSectionTotal:n=!1}={}){super(void 0,void 0,{useMultiplier:!1}),this._label=e,this._subtotal=t,this._isCategoryTotal=r,this._isTotal=n}label(){return this._label}subtotal(){return this._subtotal}isCategoryTotal(){return this._isCategoryTotal}isSectionTotal(){return this._isTotal}materialCost(e){return 0}breakdownItemSortKey(){return n.BOTTOM_SORT_KEY}generatedColumnValues(e){return{[s.item]:()=>this.label(),[s.amount]:()=>this.subtotal()}}pricingColumns(){return[s.amount]}breakdownLineItem(...e){const t=super.breakdownLineItem(...e),r=["parts-breakdown-table__row--subtotal"];return this.isCategoryTotal()&&r.push("parts-breakdown-table__row--category-total"),this.isSectionTotal()&&r.push("parts-breakdown-table__row--section-total"),t.setClasses(r),t}}},16727:(e,t,r)=>{const n=r(63768),{CompositeFigure:i}=r(7340),{simpleObserver:s}=r(50988),o=r(83102),a=r(48661),l=r(26933);class Surface extends o{constructor(e){super(),this._frame=e}frame(){return this._frame}unit(){return this.frame().unit()}zLevel(){return this.frame().zLevel()}referencePoint(){return this.frame().referencePoint()}geometry(){return this.frame().geometry()}overhang(){return n.unit(0,"in")}frameChanged(){this.resetComponents(),this.notifyFrameChangedObservers()}boundingCube(){return this.components().map((e=>e.boundingCube())).reduce(((e,t)=>e.merge(t)))}boundingBox(){return this.components().map((e=>e.boundingBox())).reduce(((e,t)=>e.merge(t)))}components(){return[]}allLocatedMaterials(){return this.components().flatMap((e=>e.allLocatedMaterials()))}resetComponents(){}defaultFigure(){return i.withModel(this)}threeFigure(){return new a(this)}projectedViewFigure(e,t,r){return l.withModel(this,e,t,r)}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_frameChangedObservers"]}}s(Surface,"frameChanged"),e.exports=Surface},57473:(e,t,r)=>{const{$P:n}=r(62048),i=r(41908);e.exports=class ThunderCloud3DModel extends i{constructor(e,t,r={w:1,x:0,y:0,z:0},i=n(1,1,1),s=void 0){super(e),this.__modelIdentifier=t,this._rotation=r,this._scale=i,this._materialNames=s}moveBy(e,t,r){return this.referencePoint().moveBy(e,t,r)}_modelIdentifier(){return this.__modelIdentifier}rotation(){return this._rotation}scale(){return this._scale}materialIdentifiers(){return this._materialNames?this._materialNames:super.materialIdentifiers()}get materials(){return this.componentOf().materials}}},39463:(e,t,r)=>{const{AngleAnnotation:n}=r(62048),i=r(76697);e.exports=class ThunderCloudAngleAnnotation extends n{defaultFigure(){const e=new(this.figureClass())(this);return e.setLayer(this.layer()),e}figureClass(){return i}}},34732:(e,t,r)=>{const{$P:n}=r(62048),i=r(9343),s=r(37198);e.exports=class ThunderCloudBadgeTextAnnotation extends i{constructor(e,t,{badgeShape:r=n(0,0).expandedByRadius(8).toPolygon(64),badgeFillStyle:i="#fff",badgeStrokeStyle:s="#000",...o}={}){super(e,t,t,o),this._badgeShape=r,this._badgeFillStyle=i,this._badgeStrokeStyle=s}badgeShape(){return this._badgeShape}badgeFillStyle(){return this._badgeFillStyle}badgeStrokeStyle(){return this._badgeStrokeStyle}figureClass(){return s}}},83465:(e,t,r)=>{const n=r(63768),{Board:i}=r(93613),{Polygon:s,PlanarNormalToEdgeLocator:o,ProportionalEdgeLocator:a,$P:l}=r(62048),{extend:c}=r(50988),u=r(83745),d=r(27287),h=r(6556),p=r(42638),m=r(43023),f=r(12002),g=r(66379);class ThunderCloudBoard extends i{static builder(e){return new m(this,e)}constructor(e,t,r,n,i,s,o){super(e,t,r,n,i),this._materialName=s,this._deckingOption=o}deckingOption(){return this._deckingOption??this.componentOf()?.deckingOption?.()}colorSource(){return this._colorSource??=this.deckingOption()}setColorSource(e){this._colorSource=e}materialName(){return this._materialName??this.deckingOption()?.material()??"pressure-treated"}materialNames(){return[this.materialName()]}color(){const e=this.colorSource(),t=e?.overrideMaterialColor?.();if(this._hasOwnMaterialName()&&!t)return;const r=this._getColorByPosition(e?.colors());return r||(this._materialColor()?this._materialColor():void 0)}color2D(){const e=this.colorSource(),t=e?.overrideMaterialColor?.();if(this._hasOwnMaterialName()&&!t)return;const r=this._getColorByPosition(e?.colors2D());return r||(this._materialColor()?this._materialColor():void 0)}_hasOwnMaterialName(){return Boolean(this._materialName)}_materialColor(){return this.materialSpecifier().details().materialColor}_getColorByPosition(e){if(e?.length>1){const t=this.width().toNumeric(this.unit());return e[(9973*Math.floor(this.edge().normal().dot(this.locator())/t)%e.length+e.length)%e.length]}return e?.first?.()}centerEdge(){const e=this.edge(),t=this.offset(),r=this.planeNormal(),n=new a(e,0),i=new a(e,1);return new o(n,r,t.x(),0,t.y()).to(new o(i,r,t.x(),0,t.y()))}xLevel(){return this.boundingCube().left()}boundingBox(){return this.shape3D().boundingCube().boundingBox()}selfMaterialLineItems(){return[new h(this.materialLength(),this.materialSpecifier())]}materialLength(){const e=this.edge().direction(),t=this.geometry().vertices().map((t=>t.dot(e))),r=Math.max(...t)-Math.min(...t);return n.unit(r,this.unit())}defaultFigure(){return new d(this)}shape3D(){return this._shape3D||(this._shape3D=new f(this.shape(),this.thickness(),this._extrudeVertices.bind(this),!1)),this._shape3D}threeFigure(){return new u(this)}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_shape3D"]}clone(){return new this.constructor(this.locator(),this.endLocator(),this.materialSpecifier(),this.offset(),this.planeNormal(),this._materialName)}cutIntoBoardsFor(e){const t=this._findIntersections(e,this.geometry()),r=t.shift(),n=[];return r&&(this.setShape(r),n.push(this)),n.push(...t.map((e=>{const t=this.clone();return t.setShape(e),t}))),n}crosscutBoardFor(e){const t=this.centerEdge().segmentsInsidePolygon(e).map((e=>e.relativeTo(this.locator(),this.endLocator()))),r=t.shift(),n=[];return r&&(this.setCenterEdge(r),n.push(this)),n.push(...t.map((e=>{const t=this.clone();return t.setCenterEdge(e),t}))),n}setCenterEdge(e){this._locator=e.begin(),this._endLocator=e.end(),this._geometry=void 0,this._shape3D=void 0,this._offset=l(0,0)}_findIntersections(e,t){const r=this.edge().direction(),n=this.planeNormal().normalized(),i=r.cross(n).normalized(),o=this._projectedPolygon(e,r,i,n),a=this._projectedPolygon(t,r,i,n);return o.intersection(a).map((e=>new s(e.vertices().map((e=>r.multipliedBy(e.x()).add(i.multipliedBy(e.y())).add(n.multipliedBy(e.z())))))))}_findIntersection(e,t){return this._findIntersections(e,t).first()}projectedViewFigure(e,t,r){return new g(this,e,t,r)}}c(ThunderCloudBoard,p),e.exports=ThunderCloudBoard},83102:(e,t,r)=>{const{ConstructionComponent:n}=r(93613),{extend:i}=r(50988),s=r(19744);class ThunderCloudComponent extends n{get materials(){return this.componentOf?.().materials??{}}get colors(){return this.componentOf?.().colors??{}}setComponentOf(e){this._beforeSetComponentOf(e),super.setComponentOf(e),this._afterSetComponentOf(e)}_beforeSetComponentOf(e){}_afterSetComponentOf(e){}}i(ThunderCloudComponent,s),e.exports=ThunderCloudComponent},41908:(e,t,r)=>{const{ComponentFrom3DModel:n}=r(37732),{NullDrawable:i}=r(7340),{three:s}=r(37732),{Cube:o,$P:a}=r(62048),{extend:l}=r(50988),c=r(35668),u=r(19744),d=r(18719),h=r(39238);class ThunderCloudComponentFrom3DModel extends n{constructor(e,t=0){super(),this._referencePoint=e,this._angle=t}project(){return this.componentOf()?.project()}isRelative(){return!0}_modelRepository(){return d.instance()}async load(){if(!this._geometry3D){const e=await this._threeGeometryFrom3DModel();this._geometry3D=e.geometry,this._materialIdentifiers=e.materialIdentifiers}}async _threeGeometryFrom3DModel(){return this._modelRepository().getModel(this._modelIdentifier())}referencePoint(){return this._referencePoint}locator(){return this.referencePoint()}angle(){return this._angle}setAngle(e){this._angle=e}rotation(){return(new s.Quaternion).setFromAxisAngle(new s.Vector3(0,0,1),this.angle())}shape3D(){return this._loadCachedGeometryAndMaterials(),this._geometry3D}_loadCachedGeometryAndMaterials(){if(!this._geometry3D&&this._modelRepository().isModelCached(this._modelIdentifier())){const e=this._modelRepository().getCachedModel(this._modelIdentifier());this._geometry3D=e.geometry,this._materialIdentifiers=e.materialIdentifiers}this._geometry3D||console.debug(`ComponentFrom3DModel: no 3D model loaded for identifier '${this._modelIdentifier()}'`)}_box3(){if(this.shape3D())return super._box3()}projectedViewShapes(e,t,r){const n=new c(this.referencePoint(),e,t,r);return this._2dProjections(r.toThreeJS(),(n=>{const i=new c(a(...n),e,t,r);return[i.x(),i.y(),i.z()]}),n)}boundingBox(){return this.shape3D()?super.boundingBox():this.locator().expandedBy(1)}boundingCube(){return this.shape3D()?super.boundingCube():o.extrudeRectangleFromTo(this.boundingBox(),this.locator().z()+.5,this.locator().z()-.5)}zLevel(){return this._zLevel||(this._zLevel=this.boundingCube().high()),this._zLevel}moveBy(e,t,r){return r.isNearTo(0)||(this._zLevel=void 0),super.moveBy(e,t,r)}materialIdentifiers(){return this._loadCachedGeometryAndMaterials(),this._materialIdentifiers}defaultFigure(){return new i(this)}transform(){const e=super.transform();return e.setPosition(this.locator().toThreeJS()),e}threeFigure(){return new h(this,this.materialIdentifiers())}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_materialIdentifier","_geometry3D"]}}l(ThunderCloudComponentFrom3DModel,u),e.exports=ThunderCloudComponentFrom3DModel},44476:(e,t,r)=>{const{DimensionAnnotation:n,Unit:i}=r(62048),{ImperialFractionLengthFormatter:s}=r(7340),o=r(84510),a=r(44387);e.exports=class ThunderCloudDimensionAnnotation extends n{static defaultDistance=30;constructor(e,t=30,r="in",{formatWithFeet:n=!0,fractionDenominator:i=1,fadeWithDistance:o=!1,color:a="#111111",formatter:l,crampedTextAngle:c}={}){super(e,t,r),this._formatter=l||new s(i,n),this._fadeWithDistance=o,this._color=a,this._crampedTextAngle=c}formatter(){return this._formatter}fadeWithDistance(){return this._fadeWithDistance}color(){return this._color}crampedTextAngle(){return this._crampedTextAngle}text(){return this.formatter().format(this.measurement())}measurement(){const e=this.edge().length();return new i(e,this.unit())}figureClass(){return o}defaultFigure(){const e=new(this.figureClass())(this);return e.setProperty("fillStyle",this.color()),e.setProperty("strokeStyle",this.color()),e.setLayer(this.layer()),e}pdfBoundingBox(e){return this.offsetEdgeForScale(e).boundingBox()}offsetEdgeForScale(e){const t=a(e,this.distance());return this.edge().shiftedAlongNormalBy(t)}}},98305:(e,t,r)=>{const{Annotation:n}=r(62048),i=r(66399);e.exports=class ThunderCloudEdgeAnnotation extends n{constructor(e,{dashed:t=!0,dashLength:r=5,dashGapLength:n=3,...i}={}){super(),this._edge=e,this._dashed=t,this._dashLength=r,this._dashGapLength=n,this._options=i}edge(){return this._edge}dashed(){return this._dashed}dashLength(){return this._dashLength}dashGapLength(){return this._dashGapLength}options(){return this._options}edgeBegin(){return this.edge().begin()}edgeEnd(){return this.edge().end()}boundingBox(){return this.edge().boundingBox()}defaultFigure(){return new i(this)}}},84255:(e,t,r)=>{const{ExternalObjectCache:n}=r(57075),i=r(73157);e.exports=class ThunderCloudExternalObjectCache extends n{memoryCache(){return this._memoryCache||(this._memoryCache=new Map),this._memoryCache}async store(e){return this.memoryCache().set(e.id(),e),e}async retrieve(e){return this.memoryCache().get(e)??this._loadFromServer(e)}async _loadFromServer(e){const t=e.split("/").last(),r=`/api/attachments/${t}`,n=await fetch(r,{method:"GET",credentials:"same-origin"});if(!n.ok)return;const s=await n.blob(),o=new i(s,t,1);return this.memoryCache().set(e,o),o}}},12002:(e,t,r)=>{const{ExtrudedPolygon:n}=r(62048);e.exports=class ThunderCloudExtrudedPolygon extends n{topProjections(){return this._topProjections||(this._topProjections=super.topProjections()),this._topProjections}}},16994:(e,t,r)=>{const{Annotation:n}=r(62048),i=r(47952);e.exports=class ThunderCloudLocatorAnnotation extends n{constructor(e,{markCenter:t=!0,...r}={}){super(),this._locator=e,this._markCenter=t,this._options=r}locator(){return this._locator}markCenter(){return this._markCenter}options(){return this._options}boundingBox(){return this.locator().boundingBox()}defaultFigure(){return new i(this)}}},38374:(e,t,r)=>{const n=r(16994),i=r(49416);e.exports=class ThunderCloudLocatorCircleAnnotation extends n{constructor(e,{radius:t=5,...r}={}){super(e,r),this._radius=t}radius(){return this._radius}markCenter(){return this._markCenter}circle(){return this._circle??=this.locator().expandedByRadius(this.radius())}boundingBox(){return this.circle().boundingBox()}defaultFigure(){return new i(this)}}},33603:(e,t,r)=>{const n=r(16994),i=r(97009);e.exports=class ThunderCloudLocatorRectangleAnnotation extends n{constructor(e,{width:t=5,length:r=t,...n}={}){super(e,n),this._width=t,this._length=r}width(){return this._width}length(){return this._length}rectangle(){return this._rectangle??=this.locator().expandedBy(this.width(),this.length())}boundingBox(){return this.rectangle().boundingBox()}defaultFigure(){return new i(this)}}},23696:e=>{e.exports=class ThunderCloudMaterialList{constructor(e){this._lineItems=e}add(e){this.lineItems().push(e)}lineItems(){return this._lineItems??=[]}}},56768:(e,t,r)=>{const n=r(63768),{FreeFloatingDimensionAnnotation:i,DisplayProperties:s,PropertiesCollection:o,EditableProperty:a}=r(7340),{$P:l,RelativeLocator:c,Cube:u,PolarCoordinate:d}=r(62048),{extend:h}=r(50988),p=r(56438),m=r(17043);class ThunderCloudMeasurementAnnotation extends i{static displayName(){return"Measurement"}constructor(e=l(0,0),t=void 0,r=void 0){super(void 0,t),this._begin=new c(e),this._formatter=r}formatter(){return this._formatter}displayName(){return this.constructor.displayName()}defaultDisplayProperties(){return new o(this,[new a(this,"Length",{type:"unit",defaultUnit:"in",get:()=>this.measurement(),format:()=>this.text(),ignoreIntermediateEdits:!0}),new a(this,"Should Snap Angle",{type:"boolean",label:"Angle Snapping"})])}setLength(e){const t=n.subtract(e,this.measurement()).toNumeric(this.unit());this.edge().stretchBy(t),this._resetLocatorReferencePoints()}validateLength(e,t){if(!e)return;const r=n.unit(0,"in");return n.smallerEq(t,r)?"Must be greater than 0":void 0}shouldSnapAngle(){return this._shouldSnapAngle??=!0}setShouldSnapAngle(e){this._shouldSnapAngle=e}toggleShouldSnapAngle(){this.setShouldSnapAngle(!this.shouldSnapAngle())}angleSnapDirections(){return this._angleSnapDirections??=this._defaultAngleSnapDirections()}_defaultAngleSnapDirections(){const e=15..degreesToRadians(),t=360..degreesToRadians()/e,r=[];for(let n=1;n<t;n++){const t=n*e;r.push(new d(1,t))}return r}setAngleSnapDirections(e){this._angleSnapDirections=e}text(){const e=this.formatter();return e?e.format(this.measurement()):this.measurement().toString()}isRelative(){return!1}moveBy(e,t){return this._resetLocatorReferencePoints(),this.begin().moveBy(e,t),this.end().moveBy(e,t)}_resetLocatorReferencePoints(){const e=l(0,0);this.begin().setSource(e),this.end().setSource(e)}begin(){return this._begin}end(){return this._end}setEnd(e){this._end=new c(e)}currentEnd(){return this.end()??this.begin()}bothEndpointsPlaced(){return Boolean(this.begin())&&Boolean(this.end())}edge(){if(this.end())return this.begin().to(this.end())}didSnap(){return void 0===this._didSnap&&(this._didSnap=!1),this._didSnap}setDidSnap(e){this._didSnap=e}defaultFigure(){return new p(this)}zLevel(){return-200}boundingCube(){const e=this.begin(),t=this.end();return u.extrudeRectangleFromTo(e.toCorner(t),e.z(),t.z())}nonEssentialProperties(){return[...super.nonEssentialProperties(),...s.nonEssentialProperties()]}}h(ThunderCloudMeasurementAnnotation,m),h(ThunderCloudMeasurementAnnotation,s),e.exports=ThunderCloudMeasurementAnnotation},18719:(e,t,r)=>{const{Model3DRepository:n,ThreeMaterialLibrary:i}=r(37732),s=r(40431);e.exports=class ThunderCloudModel3DRepository extends n{async getModel(e){const{modelName:t,modelFile:r}=this._modelFileInfo(e),n=await this._loadModelFromFile(r);return this._findGeometryInGroup(n,t,r)}getCachedModel(e){const{modelName:t,modelFile:r}=this._modelFileInfo(e),n=this.models().get(r);return this._findGeometryInGroup(n,t,r)}isModelCached(e){const{modelFile:t}=this._modelFileInfo(e),r=this.models().get(t);return Boolean(r)&&!r.then}_getGLBFilename(e){return r(14678)(`./${e}`)}_modelFileInfo(e){const[t,r]=e.split("->");return{modelName:r,modelFile:`${t}.glb`}}async _loadAndParseFile(e){try{const t=this._getGLBFilename(e),r=await this._parseFile(t);return this.models().set(e,r),r}catch(t){console.error(`Unable to load and parse 3D model in ${e}:`,t)}}async _parseFile(e){return new Promise(((t,r)=>{this.loader().load(e,t,void 0,r)}))}_findMeshInGroup(e,t,r){if(t){const n=e.scene.getObjectByName(t);return n||void console.error(`Unable to find ${t} in ${r}`)}return e.scene.children.first()}_findGeometryInGroup(e,t,r){const n=this._findMeshInGroup(e,t,r);if(!n)return;const{geometry:i,material:s}=n,o=[s].flat();o.forEach(((e,n)=>this._ensureMaterialRegistered(e,t,r,n)));return{geometry:i,materialIdentifiers:o.map((e=>e.userData.libraryIdentifier))}}_ensureMaterialRegistered(e,t,r,n){if(e.userData.libraryIdentifier)return;if(i.instance().materialDefinitions()[e.name])return void(e.userData.libraryIdentifier=e.name);const s=`${r}/${t}-${n}`;e.userData.libraryIdentifier=s,i.instance().register(s,(()=>e))}loader(){return this._loader||(this._loader=new s),this._loader}_loadModelFromFile(e){if(!this.models().has(e)){const t=this._loadAndParseFile(e);this.models().set(e,t)}return this.models().get(e)}materialNames(e){if(!this.isModelCached(e))return;const{modelName:t,modelFile:r}=this._modelFileInfo(e),n=this.models().get(r),i=this._findMeshInGroup(n,t,r);if(!i)return;let s=i.material;Array.isArray(s)||(s=[s]);const o=s.map((e=>e.name)).filter((e=>e));return 0!==o.length?o:void 0}}},52832:(e,t,r)=>{const n=r(62106),i=r(44476);e.exports=class ThunderCloudOffsetTextDimensionAnnotation extends i{constructor(e,t=30,r="in",{textAtBegin:n=!0,...i}={}){super(e,t,r,i),this._textAtBegin=n}textAtBegin(){return this._textAtBegin}figureClass(){return n}}},73164:(e,t,r)=>{const{Project:n,FreeFloatingDimensionAnnotation:i,EditableProperty:s,DisplayProperties:o}=r(7340),{Cube:a,Rectangle:l,Polygon:c,$P:u}=r(62048),{extend:d,simpleObserver:h}=r(50988),{MaterialList:p}=r(27871),{MissingOverride:m}=r(50988),f=r(63019),g=r(3611),y=r(27154),b=r(73157),v=r(11511),_=r(19532),x=r(79137),w=r(40769),R=r(35668),k=r(17043),j=r(63189),z=r(44622),q=r(80317);class ThunderCloudProject extends n{static type(){throw new m(this,"type")}defaultDisplayProperties(){let e=[];const t=this.systemStrategy().t("plan_background_title");return this.systemStrategy().allowAddingPlanBackground()&&(e=[new s(this,"Plan Background",{label:t,type:"file",accept:".pdf,application/pdf"}),...this.planScale()?.displayProperties().map((e=>e.namespace(t)))??[]]),[...this.systemStrategy().defaultDisplayProperties(this),...e,...this.colorProperties()]}colorProperties(){return[]}get config(){return this.systemStrategy().projectConfig()}get colors(){return this._colors??=this._defaultColors()}_defaultColors(){return{}}setColor(e,t){this.colors[e]=t}afterBuildFromTemplate(){}externalPersistenceJSON(e,t){return"{}"}isInitialized(){return this._initialized??!0}setIsInitialized(e){this._initialized=e}systemStrategy(){return this._systemStrategy??=v.strategy()}setSystemStrategy(e){this._systemStrategy=e}editableLineItemValueMap(){return this._editableLineItemValueMap??=this._defaultEditableLineItemValueMap()}_defaultEditableLineItemValueMap(){return{}}name(){return this.metadataManager().metadata().name}drawing(){return new x(this)}drawing3D(){return new g(this)}drawingProjected(e,t,r){return new w(this,e,t,r)}async load(){await Promise.all(this.components().map((e=>e.load?.())))}unit(){return"in"}lengthFormatter(){return this.systemStrategy().lengthFormatter()}get materials(){throw new m(this,"materials")}materialList(){const e=this.systemStrategy().materialList(this);if(e)return e;const t=this._materialLineItems();return new p(t)}_materialLineItems(){const e=this.components().flatMap((e=>e.materialLineItems?.()??[]));return[...this._processMaterialLineItems(e),...this.editableMaterialLineItems()]}_processMaterialLineItems(e){return this._materialLineItemProcessors().reduce(((e,t)=>t.process(e)),e)}_materialLineItemProcessors(){return[]}editableMaterialLineItems(){return this.additionalLineItemComponents().map((e=>e.editableLineItem()))}additionalLineItemComponents(){return this._additionalLineItemComponents||(this._additionalLineItemComponents=[]),this._additionalLineItemComponents}addAdditionalLineItem(){const e=new f;e.setComponentOf(this),this.additionalLineItemComponents().push(e)}removeAdditionalLineItem(e){this.additionalLineItemComponents().remove(e),e.setComponentOf(void 0)}usePricingMultiplierForAdditionalLineItems(){return this.systemStrategy().usePricingMultiplierForAdditionalLineItems()}additionalLineItemNameColumn(){}priceList(){return this._priceList??this.temporaryPriceList()}setPriceList(e){this._updatePriceListTimestamp(),this._priceList=e}temporaryPriceList(){return this._temporaryPriceList}setTemporaryPriceList(e){this._temporaryPriceList=e}resetPriceList(){this._priceList=void 0}priceListTimestamp(){return this._priceListTimestamp}_updatePriceListTimestamp(){this._priceListTimestamp=(new Date).toUTCString()}totalPrice(e){return this.systemStrategy().totalPrice(this,e)}priceForMaterial(e){const t=this.systemStrategy().pricingSource(this),r=e.identifier();return t.unitPrice(r)??0}priceBreakdown(){return this.systemStrategy().priceBreakdown(this)}breakdownLineItems({priceList:e,materialDefinitions:t,columns:r}={}){const n=this.systemStrategy().breakdownLineItems(this,e,t,r);return new z(n)}materialDefinitions(){return this._materialDefinitions??={}}setMaterialDefinitions(e){this._materialDefinitions=e}pricingNoteLabel(){return"Pricing Note"}pricingNoteStrings(){return[]}measurementSnapEdges(){return[]}xrOrigin(){return this.referencePoint()}xrDirection(){return u(1,0,0)}componentForRoles(...e){return this.components().find((t=>e.includes(t.role?.())))}componentsForRoles(...e){return this.components().filter((t=>e.includes(t.role?.())))}regionOfInterest(){return this._regionOfInterest}setRegionOfInterest(e){this._regionOfInterest=e,this.notifyRegionOfInterestChangedObservers()}regionOfInterest3D(){return this.boundingCubeWithoutPlanBackground()}boundingCubeWithoutPlanBackground(){const e=this.parts().filter((e=>e.role&&e.role()!==q.BACKGROUND));return a.mergedFiniteCubes(e)}async projectForPDF(){const e=this.pdfRoleExclusions(),t=await this.clone();return t.setPDFMetadata(this.metadata),t.componentsForRoles(...e).forEach((e=>e.delete())),t}pdfRoleExclusions(){return[]}pdfMetadata(){return this._pdfMetadata}setPDFMetadata(e){this._pdfMetadata=e}logo(){return"lightningcad-logo.png"}watermarkLogo(){return this.logo()}watermarkAlpha(){return.04}pdfDocumentClass(){return ProjectPDFDocument}nonEssentialProperties(){return[...super.nonEssentialProperties(),...o.nonEssentialProperties(),"_regionOfInterest","_regionOfInterestChangedObservers","_stateRecoveredObservers","_userMessageBroadcastObservers","_systemStrategy","_temporaryPriceList","_materialDefinitions"]}setPlanBackground(e){if(this.planBackground()&&(this._stopObservingScale(),this.remove(this.planBackground())),e){const t=new b(e,void 0,1),r=this.boundingBox(),n=new y(t,r.center().x(),r.center().y(),(()=>this._planBackgroundLoaded()));this.add(n),this._startObservingScale()}this.resetDisplayProperties()}removeInvalidPlanBackground(e={message:void 0,level:void 0}){this.setPlanBackground(void 0),this.notifyStateRecoveredObservers(),e.message&&this.broadcastUserMessage(e.message,e.level)}_planBackgroundLoaded(){this.setRegionOfInterest(this.drawing().boundingBox())}planBackground(){return this.componentForRoles(q.BACKGROUND)}planScale(){return this.planBackground()?.scale()}_rescaleComponents(e){this.components().forEach((t=>t.rescale?.(e)))}_stopObservingScale(){this.planBackground().scale().removeScaleSetObserver(this,this._rescaleComponents)}_startObservingScale(){this.planBackground().scale().addScaleSetObserver(this,this._rescaleComponents)}postRestorationAction(){this.planBackground()?.scale().addScaleSetObserver(this,this._rescaleComponents),Object.entries(this._defaultEditableLineItemValueMap()).forEach((([e,t])=>{this.editableLineItemValueMap()[e]??=t}))}defaultScale(){return 1}_boundingBoxComponents(){return this.components()}_boundingBoxAdditions(){return[]}_accumulatedAnnotations(e){return j.walk({components:()=>e},(e=>e.annotations()))}boundingBox(){const e=this._boundingBoxComponents();if(0===e.length)return new l(0,0,0,0);const t=this._accumulatedAnnotations(e);return[...[...e,...t].map((e=>e.boundingBox())),...this._boundingBoxAdditions()].reduce(((e,t)=>e.merge(t)))}boundingBoxProjected(e,t,r){const n=this.parts();if(0===n.length)return new l(0,0,0,0);return n.map((n=>{const i=(n.shape3D?.().vertices()??n.boundingCube().vertices()).map((n=>new R(n,e,t,r).xy()));return new c(i).boundingBox()})).reduce(((e,t)=>e.merge(t)))}project(){return this}addComponentObservers(e){}broadcastUserMessage(e,t){this.notifyUserMessageBroadcastObservers(e,t)}}i.prototype.allLocatedMaterials=()=>[],i.prototype.threeFigure=function(){return new _(this)},d(ThunderCloudProject,o),h(ThunderCloudProject,"regionOfInterestChanged"),h(ThunderCloudProject,"stateRecovered"),h(ThunderCloudProject,"userMessageBroadcast"),d(ThunderCloudProject,k),e.exports=ThunderCloudProject},66886:(e,t,r)=>{const{three:n}=r(37732),{RelativeLocator:i,$P:s,Polygon:o}=r(62048),a=r(57473),l=r(13534),c=r(11115);e.exports=class ThunderCloudRotatable3DModelComponent extends a{static builder(e){return new l(e,this)}constructor(e=new i(s(0,0))){super(),this._locator=e}locator(){return this._locator}referencePoint(){return this.locator()}vertices(){return this.geometry()?this.geometry().vertices():[this.locator()]}geometry(){return this._geometry??=this._defaultGeometry()}_defaultGeometry(){if(!this.shape3D())return;const e=this.topProjections().map((e=>e)).flatMap((e=>e.vertices())),t=e.reduce(((e,t)=>e.y()<t.y()?e:t)),r=e.reduce(((e,t)=>e.y()>t.y()?e:t)),n=e.reduce(((e,t)=>e.x()<t.x()?e:t)),i=e.reduce(((e,t)=>e.x()>t.x()?e:t)),s=new o([t.snapshot(),r.snapshot(),n.snapshot(),i.snapshot()]),a=this.angle();s.rotateBy(this.locator(),-a);const l=s.boundingBox().toPolygon();return l.rotateBy(this.locator(),a),l.relatedTo(this.locator())}_modelIdentifier(){return"debug-axis"}materialIdentifiers(){return["debug-red","debug-green","debug-blue"]}rotation(){return(new n.Quaternion).setFromAxisAngle(new n.Vector3(0,0,1),this.angle())}angle(){return this._angle??=this._defaultAngle()}_defaultAngle(){return 0}setAngle(e){const t=e-this.angle();Math.abs(t)<Math.DEFAULT_TOLERANCE||(this._angle=e,this.angleChanged(e,t))}angleChanged(e,t){this._rotateGeometry(t),this._resetTopProjections()}_resetTopProjections(){this._geometryTop=void 0}_rotateGeometry(e){this.geometry().vertices().forEach((t=>t.rotateBy(this.locator(),e)))}snappableAngles(){const e=[];for(let t=0;t<360;t+=45)e.push(t.degreesToRadians());return e}moveBy(e,t,r){return this.locator().moveBy(e,t,r)}defaultFigure(){return new c(this)}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_geometry"]}}},63106:(e,t,r)=>{const n=r(63768),{ImperialDecimalLengthFormatter:i}=r(7340),s=r(67244),o=r(44476);e.exports=class ThunderCloudStairHeightAnnotation extends o{constructor(e,t,r,n=new i){super(e,t,r),this._formatter=n}formatter(){return this._formatter}_format(e){return this.formatter().format(e)}beginHeight(){return this._format(n.unit(-this.edgeBegin().z(),this.unit()))}endHeight(){return this._format(n.unit(-this.edgeEnd().z(),this.unit()))}fadeWithDistance(){return!0}defaultFigure(){const e=new s(this);return e.setLayer(this.layer()),e}}},9343:(e,t,r)=>{const{TextAnnotation:n}=r(7340),i=r(65277),s=r(44387);e.exports=class ThunderCloudTextAnnotation extends n{constructor(e,t,r,{color:n="#000000",adjustLocationForZoomLevel:i=!0,orthogonalTextRendering:s=!1}={}){super(e,t,r,n),this._adjustLocationForZoomLevel=i,this._orthogonalTextRendering=s}adjustLocationForZoomLevel(){return this._adjustLocationForZoomLevel}orthogonalTextRendering(){return this._orthogonalTextRendering}defaultFigure(){const e=new(this.figureClass())(this);return e.setLayer(this.layer()),e}figureClass(){return i}boundingBox(){return this.edge().boundingBox()}edge(){return this.anchor().to(this.textLocation())}pdfBoundingBox(e){return this.edgeForScale(e).boundingBox()}edgeForScale(e){const t=this.textLocationForScale(e);return this.anchor().to(t)}textLocationForScale(e){const t=this.edge(),r=t.direction(),n=this.anchor(),i=s(e,t.length(),{minScale:1});return n.add(r.multipliedBy(i))}}},54798:(e,t,r)=>{const{extend:n}=r(50988),i=r(83102),s=r(95052);class TopLevelComponent extends i{static role(){return"component"}nonEssentialProperties(){return[...super.nonEssentialProperties(),...this.accumulatedNonEssentialProperties()]}}n(TopLevelComponent,s),e.exports=TopLevelComponent},24421:e=>{e.exports=class UnitProvider{unit(){}}},46103:(e,t,r)=>{const{MaterialSpecifier:n}=r(93613);class UnknownMaterialSpecifier extends n{static unknownMaterialIdentifier="unknown_material";constructor(e="Unknown",t={}){const r=UnknownMaterialSpecifier.unknownMaterialIdentifier;super(`${r}_${e.toLowerCase()}`,e,{pricingIdentifier:r,...t})}}e.exports=UnknownMaterialSpecifier},29531:(e,t,r)=>{const{$P:n}=r(62048);e.exports=class VerticalPostGeometryStrategy{generateGeometry(e){const t=e.locator(),r=t.edge(),i=e.length().toNumeric(e.unit())/2,s=e.width().toNumeric(e.unit())/2;return n(0,0,0).expandedBy(i,s).toPolygon().rotatedBy(n(0,0,0),r.theta()).movedBy(t.x(),t.y(),t.z()).relatedTo(t)}}},94046:(e,t,r)=>{const n=r(63768),i=r(80371);e.exports=class VerticalPostRailingPost extends i{static defaultWidth(){return n.unit(1,"in")}static defaultLength(){return n.unit(1.5,"in")}constructor(e,t){super(e),this._height=t}height(){return this._height}}},99105:(e,t,r)=>{const n=r(63768),i=n.unit,{ProportionalEdgeLocator:s,RelativeLocator:o}=r(62048),a=r(10590),l=r(69435),c=r(80371),u=r(99831),d=r(94046);e.exports=class VerticalPostRailingSection extends a{constructor(e,t=new u){super(e,void 0),this._delegate=t}delegate(){return this._delegate}componentLayoutEdge(){return this.edge()}componentLayoutLine(){return this.edge()}boundingBox(){return this.rails().first().boundingBox()}boundingCube(){return this.railingPosts().map((e=>e.boundingCube())).reduce(((e,t)=>e.merge(t)))}postLocatorZOffset(){return this.delegate().postLocatorZOffset()}_locator(){return this.edge().begin()}postLocatorEdge(){const e=this.postLocatorZOffset().toNumeric(this.unit()),t=this.edge().movedBy(0,0,e),r=n.divide(c.defaultWidth(),2).toNumeric(this.unit()),i=t.shiftedAlongNormalBy(r),s=this.postInset().toNumeric(this.unit()),o=i.stretchedBy(-s);return this._makeRelativeEdge(o)}railingMaterial(){return this.delegate().railingMaterial()}handRailHeight(){return this.delegate().handRailHeight()}handRailRadius(){return i(1,"in")}kneeRailHeight(){return this.delegate().kneeRailHeight()}kneeRailRadius(){return i(.4,"in")}materialLineItems(){return[]}postSpacing(){return this.delegate().postSpacing()}postInset(){return this.delegate().postInset()}handRailOverhang(){return this.delegate().handRailOverhang()}_defaultRails(){return[this.generateHandRail(),this.generateKneeRail()]}_makeRelativeEdge(e){const t=e.begin(),r=e.end(),n=o.makeRelativeTo(t,this._locator()),i=o.makeRelativeTo(r,this._locator());return n.to(i)}generateHandRail(){const e=this.railingPosts().first().topLocator(),t=this.railingPosts().last().topLocator(),r=this.handRailOverhang().toNumeric(this.unit()),n=this._makeRelativeEdge(e.to(t).stretchedBy(r));return new l(n,this.handRailRadius(),this.railingMaterial())}generateKneeRail(){const e=n.subtract(this.handRailHeight(),this.kneeRailHeight()).toNumeric(this.unit()),t=this.railingPosts().first().topLocator(),r=this.railingPosts().last().topLocator(),i=this._makeRelativeEdge(t.to(r).movedBy(0,0,e));return new l(i,this.kneeRailRadius(),this.railingMaterial())}_defaultRailingPosts(){const e=this.postLocatorEdge(),t=Math.floor(e.length()/this.postSpacing().toNumeric(this.unit()))+1,r=[],i=this.postLocatorZOffset(),o=n.add(this.handRailHeight(),i);for(let n=0;n<=t;n++){const i=new s(e,n/t);r.push(new d(i,o))}return r}blocks(){return[]}}},99831:(e,t,r)=>{const n=r(63768).unit;e.exports=class VerticalPostRailingSectionDefaults{postLocatorZOffset(){return n(0,"in")}railingMaterial(){return"aluminum"}handRailHeight(){return n(3,"ft")}kneeRailHeight(){return n(1.5,"ft")}postSpacing(){return n(5,"ft")}postInset(){return n(0,"in")}handRailOverhang(){return n(5,"in")}}},89682:e=>{e.exports=class VerticalPostRailingSectionDelegate{postLocatorZOffset(){}railingMaterial(){}handRailHeight(){}handRailRadius(){}kneeRailHeight(){}kneeRailRadius(){}postSpacing(){}postInset(){}handRailOverhang(){}}},47256:(e,t,r)=>{const n=r(63768),{EditableProperty:i}=r(7340),{NullDrawable3D:s}=r(37732),o=r(55848),a=r(22093),l=r(38550),c=r(80317);e.exports=class Zone extends o{static role(){return c.ZONE}static builder(e){return new a(e,this)}static defaultWidth(){return this.minDimension()}static defaultLength(){return this.minDimension()}static minDimension(){return n.unit(1,"ft")}static displayName(){return"Zone"}static iconName(){return"zone"}snapToUnit(){return this.unit()}defaultDisplayProperties(){return[new i(this,"Width",{type:"unit",defaultUnit:"ft",ignoreIntermediateEdits:!0}),new i(this,"Length",{type:"unit",defaultUnit:"ft",ignoreIntermediateEdits:!0})]}setWidth(e){super.setWidth(e),this._zoneChanged()}validateWidth(e,t){return this._validateDimension(e,t)}formatWidth(){return this.formatDimension(this.width())}setLength(e){super.setLength(e),this._zoneChanged()}validateLength(e,t){return this._validateDimension(e,t)}formatLength(){return this.formatDimension(this.length())}_validateDimension(e,t){if(!e)return;const r=this.constructor.minDimension(),i=this.formatDimension(r);return n.smaller(t,r)?`Must be ${i} or more.`:void 0}moveBy(...e){const t=super.moveBy(...e);return this._zoneChanged(),t}delete(){const e=this.project();super.delete(),this._zoneChanged(e)}resizingFinished(){this._zoneChanged()}movableEdges(){return this.edges()}components(){return[]}_zoneChanged(e=this.project()){}zLevel(){return 0}overlaps(e){return this.geometry().xy().overlapsShape(e.xy())}defaultFigure(){return new l(this)}threeFigure(){return new s(this)}}},81428:e=>{e.exports=Object.freeze({geometryType:{extrusion:"extrusion",model3D:"model3D"}})},56124:e=>{e.exports={alwaysVisibleLayers:{},colors:{primary:"#5485d2",notice:"#00b000",info:"#004085",warning:"#f9cd48",error:"#f95849",text:"#111111",white:"#ffffff",black:"#1a202c",ultraBlack:"#000000",contrast:{lower:"#f9f9f9",low:"#ebebeb",medium:"#e0e0e0",mediumHigh:"#a8a8a8",high:"#5e6168",higher:"#1a202c"}},significantDecimalPlaces:{angles:1,linear:2}}},22809:(e,t,r)=>{const n=r(15905),i=r(56124);e.exports={base:i,railings:n,defaults:{},messages:{}}},75450:e=>{function t(e){return Object.keys(e).filter((e=>!e.startsWith("_")))}e.exports=function e(r,n){if(r===n)return!0;if(typeof r!=typeof n)return!1;if("function"==typeof r)return r.name===n.name;if("object"!=typeof r)return!1;const i=t(r),s=t(n),o=[...new Set([...i,...s])];return i.length===o.length&&s.length===o.length&&i.every((t=>e(r[t],n[t])))}},38611:(e,t,r)=>{const n=r(5660),i=r(42051);e.exports=function(e,t=i){const r=[t,e];return n.mergeDeep({},{sources:r})}},38282:(e,t,r)=>{const n=r(5660),i=r(22809);e.exports=function(e){const t=[i,e];return n.mergeDeep({},{sources:t})}},90462:(e,t,r)=>{const n=r(5660),i=r(42126);e.exports=function(e,t=i){const r=[t,e];return n.mergeDeep({},{sources:r})}},51486:e=>{e.exports=function(e,t=!1){return void 0===e.show?t:"function"==typeof e.show?e.show():e.show}},76385:(e,t,r)=>{const{PolarCoordinate:n}=r(62048);class ArcPathSegment{constructor(e,t,r,n,i){this._center=e,this._radius=t,this._startAngle=r,this._endAngle=n,this._counterClockwise=i}addToPath(e){const t=this._center.add(new n(this._radius,this._endAngle));e.absarc(this._center.x(),this._center.y(),this._radius,this._startAngle,this._endAngle,this._counterClockwise),e.currentLocation=t}scaledBy(e=1){return new ArcPathSegment(this._center.multipliedBy(e),this._radius*e,this._startAngle,this._endAngle,this._counterClockwise)}}e.exports=ArcPathSegment},20901:(e,t,r)=>{const{Circle:n}=r(62048);class CirclePathSegment{constructor(e){this._circle=e}circle(){return this._circle}addToPath(e){e.moveTo(this.circle().center().x(),this.circle().center().y()),e.arc(0,0,this.circle().radius(),0,Math.TWO_PI,!1),e.currentLocation=void 0}designerSettings(e){const t=this.circle();return`new CirclePathSegment(\n$P(${t.x().roundedTo(2)}, ${t.y().roundedTo(2)}).expandedByRadius(this.radius().toNumeric(this.unit()))\n)`}designerSettingsDependentFunctions(e="Depth"){const t=e.toLowerCase();return[{dependencies:[{type:"package",name:"math",packageName:"mathjs"}],name:"static defaultRadius",type:"get",value:`math.unit(${this.circle().radius().roundedTo(2)}, 'in')`},{dependencies:[{type:"package",name:"math",packageName:"mathjs"}],name:"static defaultWidth",type:"get",value:"math.multiply(this.defaultRadius(), 2)"},{dependencies:[{type:"package",name:"math",packageName:"mathjs"}],name:`static default${e}`,type:"get",value:"math.multiply(this.defaultRadius(), 2)"},{dependencies:[],name:"radius",type:"get",value:"this.constructor.defaultRadius()"},{dependencies:[{type:"package",name:"math",packageName:"mathjs"}],name:"width",type:"get",value:"math.multiply(this.radius(), 2)"},{dependencies:[{type:"package",name:"math",packageName:"mathjs"}],name:t,type:"get",value:"math.multiply(this.radius(), 2)"}]}scaledBy(e=1){return new CirclePathSegment(new n(this.circle().center().multipliedBy(e),this.circle().radius()*e))}}e.exports=CirclePathSegment},88646:(e,t,r)=>{const{three:n}=r(37732);class CrossSection{constructor(e,t){this._pathSegments=e??[],this._begin=t}addSegment(e){this._pathSegments.push(e)}toCanvasPath(){return this._addTo(this._canvasPath())}_canvasPath(){const e=new Path2D;return e.absarc=e.arc,e}toThreeJS(){return this._addTo(this._threeJSPath())}_threeJSPath(){return new n.Shape}_addTo(e){return e.currentLocation=this._begin,this._begin&&e.moveTo(this._begin.x(),this._begin.y()),this._addSegmentsTo(e),e.closePath(),e}_addSegmentsTo(e){this._pathSegments.forEach((t=>{t.addToPath(e)}))}pathSegments(){return this._pathSegments}scaledBy(e=1){return new CrossSection(this.pathSegments().map((t=>t.scaledBy(e))),this._begin)}}e.exports=CrossSection},23202:(e,t,r)=>{const n=r(19178),i=r(39352);class CubicBezierPathSegment{constructor(e,t,r,n){this._begin=e,this._end=n,this._controlPoint1=t,this._controlPoint2=r}begin(){return this._begin}end(){return this._end}controlPoint1(){return this._controlPoint1}setControlPoint1(e){this._controlPoint1=e}controlPoint2(){return this._controlPoint2}setControlPoint2(e){this._controlPoint2=e}addToPath(e){e.currentLocation?.equals(this._begin)||e.moveTo(this._begin.x(),this._begin.y()),e.bezierCurveTo(this._controlPoint1.x(),this._controlPoint1.y(),this._controlPoint2.x(),this._controlPoint2.y(),this._end.x(),this._end.y()),e.currentLocation=this._end}handles(){return[new i(this.begin()),new n(this.controlPoint1(),this.begin(),this.controlPoint2()),new n(this.controlPoint2(),this.end()),new i(this.end())]}designerSettings(e){return`new CubicBezierPathSegment(${this.pointToSettings(this.begin())}, ${this.pointToSettings(this.controlPoint1())}, ${this.pointToSettings(this.controlPoint2())}, ${this.pointToSettings(this.end())})`}designerSettingsDependentFunctions(e){return[]}pointToSettings(e){return`$P(${this.prepareNumber(e.x())}, ${this.prepareNumber(e.y())})`}prepareNumber(e){return(e/12).roundedTo(2)}scaledBy(e=1){return new CubicBezierPathSegment(this.begin().multipliedBy(e),this.controlPoint1().multipliedBy(e),this.controlPoint2().multipliedBy(e),this.end().multipliedBy(e))}}e.exports=CubicBezierPathSegment},1487:(e,t,r)=>{const n=r(39352);class LinePathSegment{constructor(e,t){this._begin=e,this._end=t}begin(){return this._begin}end(){return this._end}addToPath(e){e.currentLocation?.equals(this._begin)||e.moveTo(this._begin.x(),this._begin.y()),e.lineTo(this._end.x(),this._end.y()),e.currentLocation=this._end}handles(){return[new n(this.begin()),new n(this.end())]}designerSettings(e){return`new LinePathSegment(${this.pointToSettings(this.begin())}, ${this.pointToSettings(this.end())})`}designerSettingsDependentFunctions(e){return[]}pointToSettings(e){return`$P(${this.prepareNumber(e.x())}, ${this.prepareNumber(e.y())})`}prepareNumber(e){return(e/12).roundedTo(2)}scaledBy(e=1){return new LinePathSegment(this.begin().multipliedBy(e),this.end().multipliedBy(e))}}e.exports=LinePathSegment},86755:(e,t,r)=>{const{Polygon:n}=r(62048);class PolygonPathSegment{constructor(e){this._polygon=e}addToPath(e){const t=this._polygon.vertices().slice(),r=t.shift();e.moveTo(r.x(),r.y()),t.forEach((t=>{e.lineTo(t.x(),t.y())})),e.lineTo(r.x(),r.y()),e.currentLocation=void 0}scaledBy(e=1){return new PolygonPathSegment(new n(this._polygon.vertices().map((t=>t.multipliedBy(e)))))}}e.exports=PolygonPathSegment},56214:(e,t,r)=>{const{Rectangle:n}=r(62048);class RectanglePathSegment{constructor(e){this._rectangle=e}rectangle(){return this._rectangle}addToPath(e){const t=this.rectangle().vertices().slice(),r=t.shift();e.moveTo(r.x(),r.y()),t.forEach((t=>{e.lineTo(t.x(),t.y())})),e.lineTo(r.x(),r.y()),e.currentLocation=void 0}designerSettings(e="Depth"){const t=e.toLowerCase(),r=this.rectangle().center();return`new RectanglePathSegment(\n$P(${r.x().roundedTo(2)}, ${r.y().roundedTo(2)}).expandedBy(this.width().toNumeric(this.unit()) / 2, this.${t}().toNumeric(this.unit()) / 2)\n)`}designerSettingsDependentFunctions(e="Depth"){const t=e.toLowerCase();return[{dependencies:[{type:"package",name:"math",packageName:"mathjs"}],name:"static defaultWidth",type:"get",value:`math.unit(${this.rectangle().width().roundedTo(2)}, 'in')`},{dependencies:[],name:`static default${e}`,type:"get",value:`math.unit(${this.rectangle().height().roundedTo(2)}, 'in')`},{dependencies:[],name:"width",type:"get",value:"this.constructor.defaultWidth()"},{dependencies:[],name:t,type:"get",value:`this.constructor.default${e}()`}]}scaledBy(e=1){return new RectanglePathSegment(new n(this._rectangle.topLeft().multipliedBy(e),void 0,this._rectangle.width()*e,this._rectangle.height()*e))}}e.exports=RectanglePathSegment},45641:(e,t,r)=>{const{Rectangle:n}=r(62048);e.exports=class ThunderCloudRectangle extends n{static fromDimensions(e,t,r,n){return new this(e,t,e+r,t+n)}constructor(e,t,r,n){super(e,t),this._right=r,this._bottom=n}right(){return this._right}bottom(){return this._bottom}width(){return this.right()-this.left()}height(){return this.bottom()-this.top()}area(){return this.width()*this.height()}merge(e){return new this.constructor(Math.min(this.left(),e.left()),Math.min(this.top(),e.top()),Math.max(this.right(),e.right()),Math.max(this.bottom(),e.bottom()))}}},36189:(e,t,r)=>{const n=r(63768),i=r(30691),s=r(6556);e.exports=class SurfaceCoveringMaterialCalculator{static lineItemsForShapes(e,t,r,n,i){if(0===t.length)return[];return t.first().union(...t.slice(1)).flatMap((t=>this._lineItemsForShape(e,t,r,n,i)))}static _lineItemsForShape(e,t,r,n,i){return new this(e,t,r,n,i).lineItems()}constructor(e,t,r,i,{gap:s=n.unit(0,"in"),unit:o="in"}={}){this._specifier=e,this._shape=t,this._mainAxis=r,this._crossAxis=i,this._unit=o,this._gap=s}specifier(){return this._specifier}shape(){return this._shape}mainAxis(){return this._mainAxis}crossAxis(){return this._crossAxis}unit(){return this._unit}gap(){return this._gap}lineItems(){const e=this.specifier(),t=e.details().depth.toNumeric(this.unit()),r=this.gap().toNumeric(this.unit()),i=this._maxMainAxisDistance(),o=[];for(let a=this._minMainAxisDistance();!a.isNearTo(i)&&a<i;a+=t+r){const t=this._deckingEdgeSegmentsAt(a);o.push(...t.map((t=>new s(n.unit(t.length(),this.unit()),e))))}return o}_deckingEdgeSegmentsAt(e){const t=this.specifier().details().depth.toNumeric(this.unit()),r=e+t,n=this._edgeAt(e),s=this._edgeAt(r),o=this.mainAxis().multipliedBy(t/2),a=n.segmentsInsidePolygon(this.shape()).map((e=>e.movedBy(o.x(),o.y(),o.z()))),l=s.segmentsInsidePolygon(this.shape()).map((e=>e.movedBy(-o.x(),-o.y(),-o.z())));return i.mergeOverlappingEdges([...a,...l])}_edgeAt(e){const t=this.crossAxis().multipliedBy(this._minCrossAxisDistance()),r=this.crossAxis().multipliedBy(this._maxCrossAxisDistance()),n=this.mainAxis().multipliedBy(e);return n.add(t).to(n.add(r))}_minMainAxisDistance(){return this.__minMainAxisDistance??=Math.min(...this._mainAxisDistances())}_maxMainAxisDistance(){return this.__maxMainAxisDistance??=Math.max(...this._mainAxisDistances())}_minCrossAxisDistance(){return this.__minCrossAxisDistance??=Math.min(...this._crossAxisDistances())}_maxCrossAxisDistance(){return this.__maxCrossAxisDistance??=Math.max(...this._crossAxisDistances())}_mainAxisDistances(){return this.__mainAxisDistances??=this.shape().vertices().map((e=>e.dot(this.mainAxis())))}_crossAxisDistances(){return this.__crossAxisDistances??=this.shape().vertices().map((e=>e.dot(this.crossAxis())))}}},29906:(e,t,r)=>{const{MaterialSpecifier:n}=r(93613),i=r(34794),s=r(42525);e.exports=class CategorizedMaterialProcessor extends s{constructor(e){super(),this._processors=e}processors(){return this._processors}process(e){const t=this._categorizeLineItems(e);return Object.entries(t).flatMap((([e,{category:t,lineItems:r}])=>this._processCategory(e,t,r)))}_categorizeLineItems(e){return e.reduce(((e,t)=>{const r=t.category();return e[r.name]??={category:r,lineItems:[]},e[r.name].lineItems.push(t),e}),{})}_processCategory(e,t,r){return[new i(new n(e,e,{defaultCategory:t})),...this.processors().reduce(((e,t)=>t.process(e)),r)]}}},87960:(e,t,r)=>{const n=r(42525);e.exports=class ConsolidationProcessor extends n{constructor(e=void 0){super(),this._materialsToProcess=e}process(e){return[...this._consolidateLineItems(e),...this._otherLineItems(e)]}_consolidateLineItems(e){const t=this._lineItemsToProcess(e),r={};return t.forEach((e=>{const t=r[e.specifier().identifier()];t?t.add(e.quantity()):r[e.specifier().identifier()]=e})),Object.values(r)}_otherLineItems(e){const t=this._lineItemsToProcess(e);return e.filter((e=>!t.includes(e)))}_lineItemsToProcess(e){if(!this._materialsToProcess)return e;const t=this._materialsToProcess.map((e=>e.identifier()));return e.filter((e=>t.includes(e.specifier().identifier())))}}},8519:(e,t,r)=>{const n=r(63768),i=r(42525),s=r(7568);e.exports=class ManufacturedLengthLinearMaterialProcessor extends i{isMaterialToProcess(e){return Boolean(e.specifier().details().purchaseLengthSpecifiers)}processLineItem(e){const t=e.quantity(),r=e.specifier(),n=this._purchaseSpecifiersFor(r),i=e.category();return this.lineItemsFor(t,r,n,i)}lineItemsFor(e,t,r,i){if(this._canUseRemainder(e,t))return[];const o=this._findBestPurchaseSpecifier(e,r),a=n.subtract(e,o.details().length),l=new s(1,o,o.details().length,{category:i});return this._isNearTo0(a)?[l]:this._isLessThan0(a)?(this._addRemainder(t,n.multiply(a,-1)),[l]):[l,...this.lineItemsFor(a,t,r,i)]}_findBestPurchaseSpecifier(e,t){return t.find((t=>{const r=n.subtract(e,t.details().length);return this._isLessThan0(r)||this._isNearTo0(r)}))??t.last()}_canUseRemainder(e,t){const r=this._remainders().find((({specifier:r,length:i})=>r.identifier()===t.identifier()&&n.smallerEq(e,i)));if(r)return r.length=n.subtract(r.length,e),!0}_remainders(){return this.__remainders??=[]}_addRemainder(e,t){this._remainders().push({specifier:e,length:t}),this._remainders().sort((({length:e},{length:t})=>n.sign(n.subtract(e,t))))}_isNearTo0(e){return e.toNumeric("in").isNearTo(0)}_isLessThan0(e){return n.sign(e)<0}_purchaseSpecifiersFor(e){return e.details().purchaseLengthSpecifiers.slice().sort(((e,t)=>n.smaller(e.details().length,t.details().length)?-1:1))}}},42525:e=>{e.exports=class MaterialProcessor{process(e){return e.flatMap((e=>this.isMaterialToProcess(e)?this.processLineItem(e):e))}isMaterialToProcess(e){return this.materialsToProcess().includes(e.specifier().identifier())}materialsToProcess(){return[]}processLineItem(e){return e}}},18371:(e,t,r)=>{const n=r(94263),i=r(42525);e.exports=class RemoveZeroQuantityProcessor extends i{isMaterialToProcess(e){return!(e instanceof n)&&0===e.quantity()}processLineItem(e){return[]}}},69515:(e,t,r)=>{const n=r(6556),i=r(42525);e.exports=class RoundUpProcessor extends i{constructor(e){super(),this._materialsToProcess=e}materialsToProcess(){return this._materialsToProcess}processLineItem(e){const t=Math.ceil(e.quantity());return new n(t,e.specifier(),{category:e.category()})}}},55093:(e,t,r)=>{const n=r(63768),i=r(6556),s=r(42525);e.exports=class UnitRoundUpProcessor extends s{constructor(e,t){super(),this._roundToUnit=e,this._materialsToProcess=t}roundToUnit(){return this._roundToUnit}materialsToProcess(){return this._materialsToProcess}isMaterialToProcess(e){if(this.materialsToProcess()){return this.materialsToProcess().map((e=>e.identifier())).includes(e.specifier().identifier())}return e.quantity()?.equalBase?.(n.unit(1,this.roundToUnit()))}processLineItem(e){const t=this.roundToUnit(),r=e.quantity().toNumeric(t).rounded(),s=n.unit(r,t);return new i(s,e.specifier(),{category:e.category()})}}},20632:e=>{e.exports=class CompositionMixin{mixins(){return this.constructor.mixins??[]}accumulatedComponents(){return this.mixins().flatMap((e=>e.componentsFor?.(this)??[]))}resetAccumulatedComponents(){return this.mixins().flatMap((e=>e.resetComponentsFor?.(this)??[]))}accumulatedNonEssentialProperties(){return this.mixins().flatMap((e=>e.nonEssentialProperties?.()??[]))}accumulatedDisplayProperties(){return this.mixins().flatMap((e=>e.defaultDisplayPropertiesFor?.(this)??[]))}accumulatedClone(e){return this.mixins().flatMap((t=>t.cloneFor?.(this,e)??[]))}}},87991:(e,t,r)=>{const{FixedEdgeLocator:n}=r(62048),i=r(76905);e.exports=class ContainEndEdgesOnSideEdgesSnappingMixin{snappingVectorForFrame(e,t,r){let s,o,a;if(e.alongCrossAxis(t.vector())?(s=t,o=this.snappingEdgesFor?.(r)??[r],a=this):(s=r,o=e.snappingEdgesFor?.(t)??[t],a=e),o.some((t=>this._shouldApplyDefaultSnapping(t,s,a,e))))return;const l=o.flatMap((e=>[{locator:()=>new n(e,s.length()/2)},{locator:()=>new n(e,-s.length()/2)}])),{locatable:c}=i.findClosest(s.center(),l);let u=c.locator().subtract(s.center());return e.alongCrossAxis(t.vector())||(u=u.negated()),u}_shouldApplyDefaultSnapping(e,t,r,n){return!this._shouldSnapToEndpoint(e,t,r,n)}_shouldSnapToEndpoint(e,t,r,n){const i=e.begin().distanceTo(t.center())<e.end().distanceTo(t.center()),s=r===this?n:this,o=r.cornerSnappingTolerance?.(e,t,i,s).toNumeric(this.unit())??0,a=Math.abs((e.length()-t.length())/2)-o,l=e.center().subtract(t.center()).dot(e.direction());return Math.abs(l)>=a}}},80365:(e,t,r)=>{const{FixedEdgeLocator:n,ProportionalEdgeLocator:i}=r(62048),{MissingOverride:s}=r(50988);e.exports=class EqualSpacedDistanceMixin{unit(){const e=this._unit?.();if(e)return e;throw new s(this,"unit")}equallySpacedDistances(e,t,r=!0){const n=Math.ceil(e.roundedTo(0)/t.toNumeric(this.unit())),i=e/n,s=[],o=r?0:1;for(let e=o;e<=n-o;e++)s.push(e*i);return s}equallySpaceAlongEdges(e,t,r){return this.equallySpacedDistances(e.first().length(),t,r).map((t=>this.spanAcrossEdgesAt(t,e)))}spanAcrossEdgesAt(e,t){const r=t.first().direction(),i=t.map((e=>e.direction().dot(r).isNearTo(-1)?e.reversed():e));return new n(i.first(),e).to(new n(i.last(),e))}proportionallySpaceDistances(e,t){const r=1/e,n=[],i=t?0:1;for(let t=i;t<=r-i;t++)n.push(t*e);return n}proportionallySpaceAlongEdges(e,t,r){return this.proportionallySpaceDistances(t,r).map((t=>this.spanAcrossEdgesProportionallyAt(t,e)))}spanAcrossEdgesProportionallyAt(e,t){const r=t.first().direction(),n=t.map((e=>e.direction().dot(r).isNearTo(-1)?e.reversed():e));return new i(n.first(),e).to(new i(n.last(),e))}}},28219:(e,t,r)=>{const n=r(63768),{Rectangle:i}=r(62048),s=r(30202),o=r(88646),a=r(56214);e.exports=class ExtrusionMixin{width(){return n.unit(2,"in")}depth(){return n.unit(1,"in")}extrusion(){return this._extrusion??=this._defaultExtrusion()}planarNormal(){}_defaultExtrusion(){const e=this.extrusionClass().builder(this).beginLocator(this.beginLocator()).endLocator(this.endLocator()).crossSection(this.crossSection()).planarNormal(this.planarNormal()).materialSpecifier(this.extrusionMaterialSpecifier()).beginMiterDirection(this.beginMiterDirection()).endMiterDirection(this.endMiterDirection()).color(this.color()).build();return e.setComponentOf(this),e}extrusionMaterialSpecifier(){return this.materialSpecifier()}extrusionClass(){return s}beginMiterDirection(){}endMiterDirection(){}crossSection(){const e=this.width().toNumeric(this.unit())/2,t=this.depth().toNumeric(this.unit());return new o([new a(new i(-e,0,2*e,t))])}color(){}boundingCube(){return this.extrusion().boundingCube()}threeFigure(){return this.extrusion().threeFigure()}projectedViewFigure(e,t,r){return this.extrusion().projectedViewFigure(e,t,r)}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_extrusion"]}}},42638:(e,t,r)=>{const n=r(6556);e.exports=class MaterialLineItemMixin{selfMaterialLineItems(){return[]}componentsMaterialLineItems(){return"function"!=typeof this.components?[]:this.components().flatMap((e=>e.materialLineItems?.()??[]))}materialLineItems(){const e=[...this.selfMaterialLineItems(),...this.componentsMaterialLineItems()];return e.filter((e=>this.applyCategoryToAllLineItems()||e.category?.()===n.UNCATEGORIZED)).forEach((e=>e.setCategory?.(this.materialCategory()))),e}materialCategory(){}applyCategoryToAllLineItems(){return!1}}},3569:(e,t,r)=>{const{simpleObserver:n}=r(50988);class PropertiesCollectionMixin{*[Symbol.iterator](){for(let e=0;e<this.visibleProperties().length;e++)yield this.visibleProperties()[e]}model(){return this._model}displayProperties(){return this._displayProperties??=[]}visibleProperties(){return this.displayProperties().filter((e=>e.visible()))}map(e){return this.visibleProperties().map(e)}filter(e){return this.visibleProperties().filter(e)}forEach(e){this.visibleProperties().forEach(e)}find(e){return this.visibleProperties().find(e)}includes(e){return this.visibleProperties().includes(e)}observableModels(){return[this.model()]}startObserving(){this._isObserving||(this._isObserving=!0,this.observableModels().forEach((e=>{e.addDisplayPropertiesChangedObserver(this,this.propertiesChanged)})))}stopObserving(){this._isObserving=!1,this.observableModels().forEach((e=>{e.removeDisplayPropertiesChangedObserver(this,this.propertiesChanged)}))}propertiesChanged(e){e||this.notifyPropertiesChangedObservers()}}n(PropertiesCollectionMixin,"propertiesChanged"),e.exports=PropertiesCollectionMixin},17043:(e,t,r)=>{const{SmartJsonBuilder:n,SmartObjectBuilder:i}=r(57075);e.exports=class SmartJSONClone{async clone(){const e=new n,t=new i,{json:r}=await e.stringify(this);return await t.parse(r)}}},24360:(e,t,r)=>{const{extend:n}=r(50988),i=r(87032);class StrategyProjectConfigRadiatorMixin{static strategyProjectConfig(){return this.systemStrategy().projectConfig()}strategyProjectConfig(){return this.systemStrategy().projectConfig()}}n(StrategyProjectConfigRadiatorMixin,i),e.exports=StrategyProjectConfigRadiatorMixin},87032:(e,t,r)=>{const n=r(11511);e.exports=class SystemStrategyRadiatorMixin{static systemStrategy(){return n.strategy()}systemStrategy(){return this.project?.()?.systemStrategy?.()||this.constructor.systemStrategy()}}},19744:(e,t,r)=>{const{extend:n}=r(50988),i=r(42638),s=r(5090),o=r(24360);class ThunderCloudComponentMixin{isRelative(){return!1}annotationPDFBoundingBox(e){const t=this.annotations?.()??[],r=this.components?.()??[],n=[...t.flatMap((t=>t.pdfBoundingBox?.(e))),...r.flatMap((t=>t.annotationPDFBoundingBox?.(e)))].filter((e=>e));if(0!==n.length)return n.reduce(((e,t)=>e.merge(t)))}projectedAnnotationPDFBoundingBox(e,t,r,n){const i=this.projectedAnnotations?.(t,r,n)??[],s=this.components?.()??[],o=[...i.flatMap((t=>t.pdfBoundingBox?.(e))),...s.flatMap((i=>i.projectedAnnotationPDFBoundingBox?.(e,t,r,n)))].filter((e=>e));if(0!==o.length)return o.reduce(((e,t)=>e.merge(t)))}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_systemStrategy"]}lengthFormatter(){return this.project()?.lengthFormatter()??{format:e=>e.toString(),baseUnit:()=>"in"}}formatDimension(e){return this.lengthFormatter().format(e)}_linkItem(e){return e.setComponentOf(this),e}link(e){return Array.isArray(e)?e.map(this._linkItem.bind(this)):this._linkItem(e)}selectPropertyMap(){return this._selectPropertyMap??=new s}}n(ThunderCloudComponentMixin,o),n(ThunderCloudComponentMixin,i),e.exports=ThunderCloudComponentMixin},95052:(e,t,r)=>{const{extend:n}=r(50988),{StableID:i,DisplayProperties:s}=r(7340),o=r(17043),a=r(20632);class TopLevelComponentMixin{static nonEssentialProperties(){return[...s.nonEssentialProperties()]}cleanUp(){}role(){return this.constructor.role()}canDelete(){return!0}boundingCube(){return this.boundingBox().extrudedFromTo(0,this.geometry().zLevel())}updateDisplayProperties(){this.displayProperties().forEach((e=>e.update()))}}n(TopLevelComponentMixin,a),n(TopLevelComponentMixin,i),n(TopLevelComponentMixin,s),n(TopLevelComponentMixin,o),e.exports=TopLevelComponentMixin},73157:(e,t,r)=>{const n=r(78920);e.exports=class PDFImageGenerator extends n{constructor(e,t,r){super(e,t),this._pageNumber=r}pageUnit(){return"pdf"}pageNumber(){return this._pageNumber}document(){return this._document}page(){return this._page}fullSize(){return this.canvas()}canvas(){if(this._page)return this._canvas||(this._canvas=document.createElement("canvas")),this._canvas}context(){return this._context||(this._context=this.canvas().getContext("2d")),this._context}async _loadPdfjs(){const e=await Promise.resolve().then(r.bind(r,80388)),t=r(28838);return e.GlobalWorkerOptions.workerSrc=t.default,e}async prepareFullSize(e){if(this.document())return;const t=await this.file().arrayBuffer(),r=(await this._loadPdfjs()).getDocument({data:t});this._document=await r.promise,await this._loadPage(),await this._renderPDF(e)}async _loadPage(){this.page()||(this._page=await this.document().getPage(this.pageNumber()))}async _renderPDF(e){const t=this.canvas(),r=this.page(),n=r.getViewport({scale:e});t.height=n.height,t.width=n.width;const i=r.render({canvasContext:this.context(),viewport:n});await i.promise}}},27154:(e,t,r)=>{const n=r(63768),{Rectangle:i}=r(62048),s=r(54607),o=r(82815),a=r(4558),l=r(83102),c=r(80317);e.exports=class PlanBackground extends l{constructor(e,t=0,r=0,n){super(),this._imageGenerator=e,this._centerX=t,this._centerY=r,this._onLoadCallback=n}isSelectable(){return!1}materialLineItems(){return[]}pageUnit(){return this.imageGenerator().pageUnit()}role(){return c.BACKGROUND}zLevel(){return 1/0}canGenerateBackgroundImage(){return this._canGenerateBackgroundImage??=Boolean(this.imageGenerator())}imageGenerator(){return this._imageGenerator?this._imageGenerator:this._handleImageGenerationError("imageGenerator",new Error("Invalid PDF image generator."),"ERROR")}_handleImageGenerationError(e,t,r){this._canGenerateBackgroundImage=!1;const n=this.project(),i="Cannot generate plan background image";clientLog(t,{message:i,component:"PlanBackground",action:e,context:{project:n?.metadata},fingerprint:"InvalidPlanBackground"}),n?.removeInvalidPlanBackground({message:`${i}: ${t.message}`,level:r})}fullSize(){return this.imageGenerator().fullSize()}onLoadCallback(){return this._onLoadCallback}async load(){if(!this._loaded){if(!this._loadingPromise){const e=this.onLoadCallback();this._loadingPromise=this.imageGenerator().prepareFullSize(this.resolutionFactor()).then((()=>{e&&e(),this._resetGeometry()})).catch((e=>this._handleImageGenerationError("load",e,"WARN"))).finally((()=>{this._loaded=!0,this._loadingPromise=void 0}))}return this._loadingPromise}}scale(){return this._scale||(this._scale=new a(this.pageUnit()),this._scale.setComponentOf(this),this._observeScale()),this._scale}_observeScale(){this.scale().addScaleSetObserver(this,this._resetGeometry)}resolutionFactor(){return 3}centerX(){return this._centerX}centerY(){return this._centerY}geometry(){if(!this._geometry){if(!this.fullSize())return new i(this.centerX()-60,this.centerY()-60,120,120);this._geometry=this._defaultGeometry()}return this._geometry}_defaultGeometry(){const e=this.imageGenerator().pageUnit(),t=this.scale().pageToWorld(n.unit(this.fullSize().width/this.resolutionFactor(),e)),r=this.scale().pageToWorld(n.unit(this.fullSize().height/this.resolutionFactor(),e)),s=t.toNumeric(this.unit()),o=r.toNumeric(this.unit());return new i(this.centerX()-s/2,this.centerY()-o/2,s,o)}_resetGeometry(){this._geometry=void 0}defaultFigure(){return new o(this)}threeFigure(){return new s(this)}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_loadingPromise","_loaded","_onLoadCallback","_canGenerateBackgroundImage"]}postRestorationAction(){this._observeScale()}}},78920:(e,t,r)=>{const{ExternalReference:n}=r(57075),i=r(84188);e.exports=class PlanImageGenerator extends n{constructor(e,t){super(void 0,t),t&&(this._persisted=!0),this._file=e}pageUnit(){return"in"}id(){return`${this.constructor.name}/${this.uuid()}`}object(){return this}file(){return this._file}setFile(e){this._file=e}fullSize(){}async prepareFullSize(e){}async persist(e){if(this._persisted)return;const t=`/api${e}/attachments`,r=new FormData;r.set("attachment[file]",this.file()),r.set("attachment[uuid]",this.uuid());const n=await this._post(t,r);if(!n.ok)throw new Error(`Failed to save plan image to server: ${n.statusText} (${n.status})`);return this._persisted=!0,n}_post(e,t){const r=i.csrfToken();return fetch(e,{method:"POST",body:t,headers:{"X-CSRF-Token":r},credentials:"same-origin"})}}},4558:(e,t,r)=>{const n=r(63768),{simpleObserver:i,extend:s}=r(50988),{DisplayProperties:o,EditableProperty:a}=r(7340),{UnitFromParent:l}=r(93613);class PlanScale{constructor(e){this._pageUnit=e}defaultDisplayProperties(){return[new a(this,"Scale",{type:"scale"})]}setComponentOf(e){this._componentOf=e}componentOf(){return this._componentOf}pageUnit(){return this._pageUnit||(this._pageUnit=this.worldUnit()),this._pageUnit}worldUnit(){return this.unit()}ratio(){return this._ratio||n.unit(1,this.pageUnit()).toNumeric(this.worldUnit())}set(e,t){const r=n.divide(e,t),i=this.ratio();this._ratio=r;const s=i/r;return this.notifyScaleSetObservers(s),s}isSet(){return Boolean(this._ratio)}inverseRatio(){return 1/this.ratio()}pageToWorld(e){return n.multiply(e,this.inverseRatio())}worldToPage(e){return n.multiply(e,this.ratio())}ratioFraction(){const e=n.fraction(this.ratio()),t=10**(Math.floor(Math.log10(this.ratio()))-1);return e.simplify(t)}useImperialUnits(){return n.unit(this._formatterUnit()).isImperial()}pageDistance(){return n.unit(this.ratioFraction().n,this._formatterUnit())}worldDistance(){return n.unit(this.ratioFraction().d,this._formatterUnit())}_formatterUnit(){return this.lengthFormatter().baseUnit()}toString(){if(!this.isSet())return"Not Set";const e=this.useImperialUnits();return`${e?this.pageDistance():this.ratioFraction().n} ${e?"=":":"} ${e?this.worldDistance():this.ratioFraction().d}`}nonEssentialProperties(){return[...super.nonEssentialProperties(),...o.nonEssentialProperties(),"_scaleSetObservers"]}}i(PlanScale,"scaleSet"),s(PlanScale,o),s(PlanScale,l),e.exports=PlanScale},22184:(e,t,r)=>{const{simpleObserver:n}=r(50988),i=r(21953);class PlanScaleMeasurement{begin(){return this._begin}end(){return this._end}edge(){if(this.begin())return this.unplacedEndpoint()?this.begin().to(this.unplacedEndpoint()):this.end()?this.begin().to(this.end()):void 0}length(){if(!this.hasUnplacedEndpoint())return this.begin().distanceTo(this.end())}hasUnplacedEndpoint(){return!this.begin()||!this.end()}unplacedEndpoint(){return this._unplacedEndpoint}updateUnplacedEndpoint(e){this._unplacedEndpoint=e,this.notifyLengthChangedObservers()}placeEndpoint(e){this._unplacedEndpoint=void 0,this.begin()?this.end()||(this._end=e,this.notifyMeasuredObservers()):this._begin=e}defaultFigure(){return new i(this)}}n(PlanScaleMeasurement,"measured"),n(PlanScaleMeasurement,"lengthChanged"),e.exports=PlanScaleMeasurement},80317:e=>{e.exports={ACCESSORY:"accessory",ANCHOR_PLATFORM:"anchor_platform",BACKGROUND:"background",BOATHOUSE:"boathouse",CLEAT:"cleat",DOCK:"dock",DOCK_GROUP:"dock_group",EXISTING_DOCK:"existing_dock",FIXED_BERTH_DOCK:"fixed_berth_dock",FLOATING_BERTH_DOCK:"floating_berth_dock",FLOATING_DOCK:"floating_dock",GANGWAY:"gangway",OBSTACLE:"obstacle",PILE_GUIDE:"pile_guide",PIPE_HOLD:"pipe_hold",RAILING_COLLECTION:"railing_collection",ZONE:"zone"}},21125:(e,t,r)=>{const n=r(63768),{calculate:i}=r(50988),s=r(9664),o=r(73835),a=r(30691),{$P:l}=r(62048);e.exports=class FlatRoofFraming extends s{rafterSpacing(){return n.unit(16,"in")}rafterWidth(){return this.rafterSpecifier().details().width}rafterLayoutEdges(){return this.roof().roofLayoutEdges()}rafters(){return this._rafters??=this._defaultRafters()}_defaultRafters(){const[e,t]=this.rafterLayoutEdges(),r=this.colorSource();return a.locatorsAlongEdge(e,this._numberOfRafters()).map((e=>{const n=t.closestRelativePointTo(e),i=new o(e,n,this.rafterSpecifier(),void 0,this.structureMaterialName());return i.setComponentOf(this),r&&i.setColorSource(r),i}))}_numberOfRafters(){const e=this.rafterLayoutEdges().first().length(),t=n.unit(e,this.unit()),r=this.rafterWidth(),s=this.rafterSpacing();return i`ceil((${t} - ${r}) / ${s})`}_defaultFascia(){const e=this.fasciaSpecifier(),t=e.details().width.toNumeric(this.unit()),r=e.details().depth.toNumeric(this.unit()),[n,i]=this.rafterLayoutEdges(),s=t/2,o=[n,i.end().to(n.begin()),i,n.end().to(i.begin())],a=this.roof().structure().referencePoint();return o.map((t=>{const n=t.shiftedAlongNormalBy(-s).relativeTo(a);return this._makeBoard(n.begin(),n.end(),e,l(r/2,0),n.normal())}))}reset(){super.reset(),this._rafters=void 0}components(){return[...this.rafters(),...this.fascia()]}}},18126:(e,t,r)=>{const n=r(63768),{CompositeFigure:i}=r(7340),{Composite3DFigure:s}=r(37732),{lumber:o}=r(93613),{FixedEdgeLocator:a,$P:l}=r(62048),c=r(83102),u=r(83465);e.exports=class GableRoofEndFraming extends c{constructor(e){super(),this._edge=e}zLevel(){return-n.add(this.height(),this.roofFrame().structureHeight()).toNumeric(this.unit())}spacing(){return n.unit(16,"in")}width(){return n.unit(this.edge().length(),this.unit())}height(){return n.unit(this.edge().length()/2*this.roofPitch(),this.unit())}studSpecifier(){return o.PT2x6}structureMaterialName(){return this.componentOf().structureMaterialName()}roofFrame(){return this.componentOf()}roofPitch(){return this.roofFrame().pitch()}structureEdge(){return this._edge}edge(){return this._edge}boundingCube(){return this.components().map((e=>e.boundingCube())).reduce(((e,t)=>e.merge(t)))}boundingBox(){return this.components().map((e=>e.boundingBox())).reduce(((e,t)=>e.merge(t)))}colorSource(){return this.componentOf().colorSource?.()}studs(){return this._studs??=this._defaultStuds()}_defaultStuds(){const e=this.studSpecifier(),t=[],r=this.spacing().toNumeric(this.unit()),n=this.width().toNumeric(this.unit()),i=this.roofFrame().roof().structure().topFrameSpecifier().details().depth.toNumeric(this.unit()),s=this.edge().addZ(i),o=Math.floor(s.length()/r/2)+1,c=s.vector().normalized(),u=c.negated(),d=n/2,h=e.details().depth.toNumeric(this.unit()),p=new a(s,d);t.push(this._makeBoard(p.addZ(-(d*this.roofPitch()+i)),p,e,c,l(-h/2,0)));for(let n=1;n<o;n++){const o=d-n*r,p=this.roofPitch()*o+i+this.roofFrame().rafterDepth().toNumeric(this.unit()),m=new a(s,o),f=new a(s,-o);t.push(this._makeBoard(m.addZ(-p),m,e,c,l(-h/2,0))),t.push(this._makeBoard(f.addZ(-p),f,e,u,l(h/2,0)))}const m=this.colorSource();return t.forEach((e=>{e.setComponentOf(this),m&&e.setColorSource(m)})),t}_makeBoard(e,t,r,n,i=l(0,0)){const s=u.builder(this).beginLocator(e).endLocator(t).materialSpecifier(r).offsetFromCenter(i).planarNormal(n).materialName(this.structureMaterialName()).build();s.setComponentOf(this);const o=this.colorSource();return o&&s.setColorSource(o),s}components(){return this.studs()}defaultFigure(){return i.withModel(this)}threeFigure(){return s.withModel(this)}}},50549:(e,t,r)=>{const{calculate:n}=r(50988),{NormalToEdgeLocator:i,FixedEdgeLocator:s,$P:o}=r(62048),a=r(63768),l=r(9664),c=r(18126),u=r(73835);e.exports=class GableRoofFraming extends l{zLevel(){return-this.height().toInches()}gableEndFramingClass(){return c}height(){const e=this.ridgeSpecifier().details().width,t=this.pitch(),r=this.structureHeight(),i=this.gableFraming().first().height();return n`${i} - ${e} / 2 * ${t} + ${this.rafterDepth()} + ${r}`}gableFraming(){return this._gableFraming??=this._defaultGableFraming()}_defaultGableFraming(){return this.roof().structure().endEdges().map((e=>{const t=this.structureHeight().toNumeric(this.unit()),r=this.roof().structure().topFrameSpecifier().details().width.toNumeric(this.unit()),n=new s(e,r).to(new s(e,-r)),i=new(this.gableEndFramingClass())(n.addZ(-t));return i.setComponentOf(this),i}))}rakeOverhangDistance(){return a.unit(1,"ft")}ridgeCenterLine(){const e=this.rakeOverhangDistance().toNumeric(this.unit()),t=this.pitch(),r=this.ridgeSpecifier().details().width,s=this.gableFraming().first().height(),o=this.structureHeight(),a=this.rafterDepth(),l=n`${r} / 2 * ${t}`,c=n`${o} + ${s} + ${a} - ${l}`,u=this.roof().structure().endEdges().first().center().addZ(-c.toNumeric(this.unit())),d=this.roof().structure().endEdges().last().center().addZ(-c.toNumeric(this.unit()));return new i(u,e).to(new i(d,e))}rafters(){return this._rafters??=this._defaultRafters()}_defaultRafters(){const e=this._ridgeSideEdgesForRafters(),t=[];for(let r=0;r<this._numberOfRafters();r++){const n=this._findRafterOffset(r);t.push(...this._createRafterPair(e,n))}return t.push(...this._addRaftersOnEnd(e)),t}_ridgeSideEdgesForRafters(){const e=this.rakeOverhangDistance().toNumeric(this.unit()),t=this.ridgeSpecifier().details().width.toNumeric(this.unit()),r=this.ridge().edge();return[r.shiftedAlongNormalBy(t/2),r.shiftedAlongNormalBy(-t/2)].map((t=>new s(t,e).to(new s(t,-e))))}_numberOfRafters(){const e=this.rafterSpecifier().details().width,t=this._ridgeSideEdgesForRafters().first().length();return n`ceil((${a.unit(t,this.unit())} - ${e}) / ${this.rafterSpacing()})`}_createRafterPair(e,t){const r=n`${this.rafterOverhang()} + (${this.width()} / 2) - (${this.ridgeSpecifier().details().width} / 2)`.toNumeric(this.unit()),o=this.colorSource();return e.map(((e,n)=>{const a=n%2==0?r:-r,l=new s(e,0),c=new i(l,0,t),d=new i(l,a,t).addZ(this.rafterOverhangHeight(r)),h=new u(c,d,this.rafterSpecifier(),void 0,this.structureMaterialName());return h.setComponentOf(this),o&&h.setColorSource(o),h}))}_addRaftersOnEnd(e){const t=this.rafterSpecifier().details().width.toNumeric(this.unit());return this._createRafterPair(e,e.first().length()-t/2)}_findRafterOffset(e){const t=this.rafterSpecifier().details().width;return n`min(${this.length()} - (${t} * 3), ${this.rafterSpacing()} * ${e}) + ${t} / 2`.toNumeric(this.unit())}rafterOverhang(){return a.unit(12,"in")}rafterSpacing(){return a.unit(16,"in")}rafterOverhangHeight(e){return this.pitch()*e}flyRafters(){return this._flyRafters??=this._defaultFlyRafters()}_defaultFlyRafters(){const e=this.ridgeSpecifier().details().width.toNumeric(this.unit()),t=this.ridge().edge(),r=[t.shiftedAlongNormalBy(e/2),t.shiftedAlongNormalBy(-e/2)],n=this.rafterSpecifier().details().width.toNumeric(this.unit());return[...this._createRafterPair(r,n/2),...this._addRaftersOnEnd(r)]}_defaultFascia(){const e=this.fasciaSpecifier(),t=this.crossAxis().dot(this.rafters().first().edge().vector()),r=this.ridgeSpecifier().details().width.toNumeric(this.unit()),n=e.details().width.toNumeric(this.unit()),i=e.details().depth.toNumeric(this.unit()),s=t+n/2,a=this.ridge().edge();return[a.shiftedAlongNormalBy(s+r/2).addZ(s*this.pitch()),a.shiftedAlongNormalBy(-(s+r/2)).addZ(s*this.pitch())].map((t=>this._makeBoard(t.begin(),t.end(),e,o(i/2,0),t.normal())))}_defaultRidge(){const e=super._defaultRidge(),t=this.colorSource();return t&&e.setColorSource(t),e}reset(){super.reset(),this._rafters=void 0,this._gableFraming=void 0,this._flyRafters=void 0}components(){return[...super.components(),...this.gableFraming(),...this.rafters(),...this.flyRafters()]}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_rafters","_gableFraming","_flyRafters"]}}},9664:(e,t,r)=>{const{CompositeFigure:n}=r(7340),{Composite3DFigure:i}=r(37732),s=r(63768),{lumber:o}=r(93613),{calculate:a}=r(50988),{$P:l}=r(62048),c=r(83102),u=r(83465);e.exports=class RoofFraming extends c{static rafterSpecifier(){return o.PT2x6}constructor(e){super(),this._roof=e}roof(){return this._roof}structureHeight(){return this.roof().structure().supportHeight()}width(){return this.roof().width()}length(){return this.roof().length()}pitch(){return this.roof().pitch()}mainAxis(){return this.roof().mainAxis()}crossAxis(){return this.roof().crossAxis()}ridgeSpecifier(){return o.PT2x10}rafterSpecifier(){return this.constructor.rafterSpecifier()}collarTieSpecifier(){return o.PT2x6}fasciaSpecifier(){return o.PT2x6}colorSource(){return this.componentOf()?.framingColorSource?.()}structureMaterialName(){return this.componentOf()?.structureMaterialName?.()??"pressure-treated"}rafterDepth(){const e=this.rafterSpecifier().details().depth,t=this.pitch();return a`sqrt(${e} ^ 2 + (${e} * ${t}) ^ 2)`}ridge(){return this._ridge??=this._defaultRidge()}_defaultRidge(){const e=this.ridgeSpecifier(),t=this.ridgeCenterLine(),r=this._makeBoard(t.begin(),t.end(),e,l(s.divide(e.details().depth,2).toNumeric(this.unit()),0));return r.setComponentOf(this),r}_makeBoard(e,t,r,n=l(0,0)){const i=u.builder(this).beginLocator(e).endLocator(t).materialSpecifier(r).offsetFromCenter(n).planarNormal(e.to(t).normal()).materialName(this.structureMaterialName()).build();i.setComponentOf(this);const s=this.colorSource();return s&&i.setColorSource(s),i}ridgeCenterLine(){const e=this.pitch(),t=this.ridgeSpecifier().details().width,r=this.structureHeight(),n=this.rafterDepth(),i=a`${t} / 2 * ${e}`,s=a`${r} + ${n} - ${i}`,o=this.roof().structure().endEdges().first().center().addZ(-s.toNumeric(this.unit())),l=this.roof().structure().endEdges().last().center().addZ(-s.toNumeric(this.unit()));return o.to(l)}collarTies(){return this._collarTies??=this._defaultCollarTies()}_defaultCollarTies(){return[]}fascia(){return this._fascia??=this._defaultFascia()}_defaultFascia(){return[]}components(){return[this.ridge(),...this.collarTies(),...this.fascia()]}shiftEdgeAlongPitch(e,t){return e.shiftedAlongNormalBy(t).addZ(t*this.pitch())}boundingCube(){return this.components().map((e=>e.boundingCube())).reduce(((e,t)=>e.merge(t)))}boundingBox(){return this.components().map((e=>e.boundingBox())).reduce(((e,t)=>e.merge(t)))}defaultFigure(){return n.withModel(this)}threeFigure(){return i.withModel(this)}reset(){this._ridge=void 0,this._collarTies=void 0,this._fascia=void 0}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_ridge","_collarTies","_fascia"]}}},17087:(e,t,r)=>{const n=r(63768),{Polygon:i}=r(62048),s=r(21125),o=r(34076);e.exports=class FlatRoof extends o{static type(){return"Flat"}framingClass(){return s}framingColorSource(){return this.componentOf()?.framingColorSource?.()}structureMaterialName(){return this.componentOf()?.structureMaterialName()??"pressure-treated"}showPitchProperty(){return!1}overhang(){return n.unit(1,"ft")}height(){const e=this.framingClass().rafterSpecifier().details().depth,t=this.structure().supportHeight();return n.add(e,t)}_defaultSheathing(){const e=this.sheathingSpecifier(),t=e.details().depth.toNumeric(this.unit());return this._makeRoofing(this.sheathingMaterialClass(),e,t)}_defaultRoofing(){const e=this.roofingSpecifier(),t=this.sheathingSpecifier(),r=e.details().depth.toNumeric(this.unit()),n=t.details().depth.toNumeric(this.unit());return this._makeRoofing(this.roofMaterialClass(),e,r+n)}roofPolygons(){const e=this.roofLayoutEdges();return[new i([...e.first().endpoints(),...e.last().endpoints()])]}roofLayoutEdges(){const e=this.overhang().toNumeric(this.unit()),t=this.structure().endEdges(),r=-this.height().toNumeric(this.unit());return t.map((t=>t.stretchedBy(2*e).shiftedAlongNormalBy(e).addZ(r).relativeToEdge(t)))}}},48119:(e,t,r)=>{const{Polygon:n}=r(62048),{calculate:i}=r(50988),s=r(63768),o=r(34076),a=r(50549);e.exports=class GableRoof extends o{static type(){return"Gable"}framingClass(){return a}framingColorSource(){return this.componentOf()?.framingColorSource?.()}structureMaterialName(){return this.componentOf()?.structureMaterialName()??"pressure-treated"}_defaultSheathing(){const e=this.framing().ridgeCenterLine(),t=this._heightAboveRidge().toNumeric(this.unit()),r=e.addZ(-t),o=this.structure().width(),a=this.framing().fasciaSpecifier().details().width,l=i`${o} / 2 + ${s.unit(1,"ft")} + ${a}`.toNumeric(this.unit()),c=l*this.pitch(),u=[r,r.reversed()],d=this.sheathingMaterialClass();return u.map((e=>{const t=e.shiftedAlongNormalBy(l).addZ(c);return new d(new n([e.begin(),e.end(),t.end(),t.begin()]),this.sheathingSpecifier(),this.mainAxis())}))}_defaultRoofing(){const e=this.framing().ridgeCenterLine(),t=this.sheathing().first().thickness(),r=this.structure().width(),o=this._heightAboveRidge().toNumeric(this.unit())+t,a=e.addZ(-o),l=this.framing().fasciaSpecifier().details().width,c=i`${r} / 2 + ${s.unit(1,"ft")} + ${l}`.toNumeric(this.unit()),u=c*this.pitch(),d=[a,a.reversed()],h=this.roofMaterialClass();return d.map((e=>{const t=e.shiftedAlongNormalBy(c).addZ(u);return new h(new n([e.begin(),e.end(),t.end(),t.begin()]),this.roofingSpecifier(),this.mainAxis())}))}}},34076:(e,t,r)=>{const{DisplayProperties:n,EditableProperty:i,CompositeFigure:s,PropertiesCollection:o}=r(7340),{Polygon:a}=r(62048),{extend:l,MissingOverride:c,calculate:u}=r(50988),d=r(63768),h=r(83102),p=r(50549),m=r(75086),f=r(48661),{material:g}=r(71181);class Roof extends h{static type(){return new c(this,"type")}get value(){return this}get label(){return this.constructor.type()}structure(){return this._structure}setStructure(e){this._structure=e}defaultDisplayProperties(){return new o(this,[new i(this,"Pitch",{type:"select",choices:this.pitchOptions()}),new i(this,"Roofing Specifier",{type:"select",choices:this.roofMaterialOptions(),label:"Material"})])}roofingSpecifier(){return this._roofingSpecifier??=this.roofMaterialOptions().first().value}setRoofingSpecifier(e){this._roofingSpecifier=e,this.reset()}roofMaterialOptions(){return[{label:g.RIBBED_METAL.name(),value:g.RIBBED_METAL},{label:g.SHINGLES.name(),value:g.SHINGLES}]}minimumSpan(e){return this._isEdgeAlongMainAxis(e)?this.minimumSpanAlongMainAxis():this.minimumSpanAlongCrossAxis()}maximumSpan(e){return this._isEdgeAlongMainAxis(e)?this.maximumSpanAlongMainAxis():this.maximumSpanAlongCrossAxis()}minimumSpanAlongMainAxis(){return d.unit(3,"ft").toNumeric(this.unit())}minimumSpanAlongCrossAxis(){return d.unit(3,"ft").toNumeric(this.unit())}maximumSpanAlongMainAxis(){return 1/0}maximumSpanAlongCrossAxis(){return 1/0}_isEdgeAlongMainAxis(e){return this.structure().alongMainAxis(e.vector())}width(){return this.structure().width()}length(){return this.structure().length()}framing(){return this._framing??=this._defaultFraming()}_defaultFraming(){const e=new(this.framingClass())(this);return e.setComponentOf(this),e}framingClass(){return p}sheathingSpecifier(){return g.PW4x8}sheathing(){return this._sheathing??=this._defaultSheathing()}roofing(){return this._roofing??=this._defaultRoofing()}_defaultSheathing(){return this._makeRoofing(this.sheathingMaterialClass(),this.sheathingSpecifier(),this._sheathingHeightOffset())}_defaultRoofing(){return this._makeRoofing(this.roofMaterialClass(),this.roofingSpecifier(),this._roofingHeightOffset())}_sheathingHeightOffset(){return this._heightAboveRidge().toNumeric(this.unit())}_roofingHeightOffset(){const e=this.sheathing().first().thickness();return this._sheathingHeightOffset()+e}_makeRoofing(e,t,r){const n=this.structure().referencePoint();return this.roofPolygons().map((i=>{const s=this._axisForRoofPolygon(i),o=i.movedBy(0,0,-r).relatedTo(n);return new e(o,t,s)}))}_axisForRoofPolygon(e){return this.mainAxis()}roofMaterialClass(){return m}sheathingMaterialClass(){return this.roofMaterialClass()}roofPolygons(){const e=this.framing().ridgeCenterLine(),t=this.structure().width(),r=this.framing().fasciaSpecifier().details().width,n=u`${t} / 2 + ${d.unit(1,"ft")} + ${r}`.toNumeric(this.unit()),i=n*this.pitch();return[e,e.reversed()].map((e=>{const t=e.shiftedAlongNormalBy(n).addZ(i);return new a([e.begin(),e.end(),t.end(),t.begin()])}))}zLevel(){return this.boundingCube().high()}mainAxis(){return this.structure().mainAxis()}crossAxis(){return this.structure().crossAxis()}pitch(){return this._pitch??=this._defaultPitch()}_defaultPitch(){return this.pitchOptions().find((e=>e.default)).value}setPitch(e){this._pitch=e,this.reset()}pitchOptions(){return[{label:"2 / 12",value:2/12},{label:"3 / 12",value:.25},{label:"4 / 12",value:4/12},{label:"5 / 12",value:5/12},{label:"6 / 12",value:.5,default:!0},{label:"7 / 12",value:7/12},{label:"8 / 12",value:8/12},{label:"9 / 12",value:.75},{label:"10 / 12",value:10/12},{label:"11 / 12",value:11/12},{label:"12 / 12",value:1}]}_heightAboveRidge(){const e=this.framing().ridgeSpecifier().details().width,t=this.pitch();return u`${e} / 2 * ${t}`}height(){return u`
      ${this.framing().height()}
      + ${this._heightAboveRidge()}
      + ${this.sheathingSpecifier().details().depth}
      + ${this.roofingSpecifier().details().depth}
    `}components(){return[this.framing(),...this.sheathing(),...this.roofing()]}selfMaterialLineItems(){return[]}componentsMaterialLineItems(){return[this.framing(),...this.roofing()].flatMap((e=>e.materialLineItems?.()??[]))}reset(){this.framing().reset(),this._sheathing=void 0,this._roofing=void 0}equals(e){return this.constructor===e.constructor}defaultAnnotations(){return[]}boundingCube(){return this.components().map((e=>e.boundingCube())).reduce(((e,t)=>e.merge(t)))}boundingBox(){return this.components().map((e=>e.boundingBox())).reduce(((e,t)=>e.merge(t)))}setDrawingLayer(e){this._drawingLayer=e}drawingLayer(){return this._drawingLayer}_preparedFigure(e){return this.drawingLayer()&&e.setLayer(this.drawingLayer()),e}defaultFigure(){return this._preparedFigure(s.withModel(this))}threeFigure(){return this._preparedFigure(new f(this))}nonEssentialProperties(){return[...super.nonEssentialProperties(),...n.nonEssentialProperties(),"_sheathing","_roofing","_drawingLayer","_framing"]}}l(Roof,n),e.exports=Roof},26933:(e,t,r)=>{const{CompositeFigure:n,NullDrawable:i}=r(7340);e.exports=class CompositeProjectedFigure extends n{static withFigures(e,t,r,n){const i=super.withFigures(e);return i.setAxes?.(t,r,n),i}static withModel(e,t,r,n){const i=super.withModel(e);return i.setAxes?.(t,r,n),i}static withStrategy(e,t=void 0,r,n,i){const s=super.withStrategy(e,t);return s.setAxes?.(r,n,i),s}xAxis(){return this._xAxis}yAxis(){return this._yAxis}zAxis(){return this._zAxis}setAxes(e,t,r){this._xAxis=e,this._yAxis=t,this._zAxis=r??e.cross(t)}defaultFigures(){const e=this.strategy().defaultFigures();return e.forEach((e=>e.setAxes?.(this.xAxis(),this.yAxis(),this.zAxis()))),e}_componentRenderer(e){const t=e.projectedViewFigure?.(this.xAxis(),this.yAxis(),this.zAxis());return t??new i(e)}_getAnnotationsFromModel(){return this.model()?.projectedAnnotations?this.model().projectedAnnotations(this.xAxis(),this.yAxis(),this.zAxis()):[]}}},48909:(e,t,r)=>{const{CompositeFigure:n}=r(7340);e.exports=class CompositionCompositeFigure extends n{_skipDrawing(e,{bounds:t,layerManager:r}={}){return!this.layerVisible(r)||t&&!t.intersects(this.boundingBox())}contains(e,t){return this.model().contains(e,t)}moveBy(e,t){return this.model().moveBy(e,t)}handlesAt(e,t,r){const{scale:n,layerManager:i,validWhen:s}=r;return this.layerVisible(i)?this.handles().fastFilter((r=>s.includes(r.validWhen())&&r.contains(e,t,n))):[]}annotationHandles(){return this.selfAnnotationHandles()}annotationHandlesAt(e,t,r={}){const{scale:n,layerManager:i}=r;let s=[];return this.annotationsVisible(i)&&(s=this.selfAnnotationHandles().fastFilter((r=>r.contains(e,t,n)))),s}_drawAnnotations(e,t){this.annotationFigures().forEach((r=>r.draw(e,t)))}}},91229:(e,t,r)=>{const n=r(26933);e.exports=class CompositionCompositeProjectedFigure extends n{_drawAnnotations(e,t){this.annotationFigures().forEach((r=>r.draw(e,t)))}}},5752:(e,t,r)=>{const{Drawable:n}=r(7340);e.exports=class CoveringMaterialFigure extends n{constructor(e){super(),this.setModel(e)}boundingBox(){return this.model().boundingBox()}zLevel(){return this.model().zLevel()}_draw(e,t){e.fillStyle=this.model().color(),e.strokeStyle=this._contrastHexColor(this.model().color()),e._drawPolygon(this.model().geometry())}defaultProperties(){return{lineWidth:.3}}}},26214:(e,t,r)=>{const n=r(39902);e.exports=class CoveringMaterialProjectedFigure extends n{zLevel(){const e=this.model().geometry().vertices();return Math.min(...e.map((e=>this.zAxis().dot(e))))}}},6272:(e,t,r)=>{const{Drawable:n}=r(7340);e.exports=class ExtrusionMaterialFigure extends n{constructor(e){super(),this.setModel(e)}zLevel(){return this.model().zLevel()}contains(e,t){return!1}boundingBox(){return this.model().boundingBox()}_draw(e,t){this._setColorsFromModel(e);const r=this.model().shape3D().polygonFaces().slice();r.sort(((e,t)=>t.zLevel()-e.zLevel()));const n=this._shapeProjections(),i=n.shift(),s=i?.union(...n).first();r.length>0&&(e._drawPolygon(r.first()),s&&e._drawPolygon(s),e._drawPolygon(r.last()))}_shapeProjections(){return this.model().shape3D().topProjections()}_setColorsFromModel(e){const t=this.model();e.lineWidth=t.lineWidth?.()||.3;const r=t.color?.();"string"==typeof r?(e.fillStyle=r,e.strokeStyle=this._contrastHexColor(r)):(e.fillStyle=t.fillStyle?.()??e.fillStyle,e.strokeStyle=t.strokeStyle?.()??e.strokeStyle)}}},39902:(e,t,r)=>{const{$P:n,Polygon:i,Rectangle:s}=r(62048),o=r(35668),a=r(6272);e.exports=class ExtrusionMaterialProjectedFigure extends a{constructor(e,t=n(1,0,0),r=n(0,1,0),i){super(e),this.setAxes(t,r,i)}xAxis(){return this._xAxis}yAxis(){return this._yAxis}zAxis(){return this._zAxis}setAxes(e,t,r){this._xAxis=e,this._yAxis=t,this._zAxis=r??e.cross(t)}shape3D(){return this.model().shape3D()}_frontfaceShapeProjections(){return this.shape3D().faces().fastFilter((e=>e.normal().dot(this.zAxis())<0)).map((e=>{const t=e.vertices().map((e=>new o(e,this.xAxis(),this.yAxis(),this.zAxis()).xy()));return new i(t)}))}_backfaceShapeProjections(){return this.shape3D().faces().fastFilter((e=>e.normal().dot(this.zAxis().negated())<0)).map((e=>{const t=e.vertices().map((e=>new o(e,this.xAxis(),this.yAxis(),this.zAxis()).xy()));return new i(t)}))}boundingBox(){const e=this.joinedPolygons();if(e)return e.boundingBox();const t=this.model().boundingBox(),r=t.topLeft(),n=new o(r,this.xAxis(),this.yAxis()),i=t.width(),a=t.height();return new s(n,void 0,i,a)}_draw(e,t){this._applyStyles(e,t),this._frontfaceShapeProjections().forEach((t=>e._drawPolygon(t))),this._drawBackfaces(e,t)}_applyStyles(e,t){t.printWithColor?this._setColorsFromModel(e):(e.lineWidth=.01,e.fillStyle="transparent",e.strokeStyle="#000000")}_drawBackfaces(e,t){if(t.printWithColor)return;const r=this._frontfaceShapeProjections().flatMap((e=>e.edges())),n=this._backfaceShapeProjections().flatMap((e=>e.edges())).filter((e=>!r.some((t=>t.containsEdge(e))))),i=[.05,.05];n.forEach((t=>{e._drawDashedLine(t.begin(),t.end(),i)}))}joinedPolygons(){const e=this._frontfaceShapeProjections(),t=e.shift();return t?.union(...e).first()}_getAnnotationsFromModel(){return this.model().projectedAnnotations(this.xAxis(),this.yAxis(),this.zAxis())}zLevel(){const e=this.shape3D().boundingCube().center();return new o(e,this.xAxis(),this.yAxis(),this.zAxis()).z()}}},32896:(e,t,r)=>{const n=r(48909),i=r(85438),s=r(72029),o=r(11288);e.exports=class FreestandingRoofFigure extends n{constructor(e){super(),this.setModel(e)}_draw(e,t){t.shapeOnly?(e.fillStyle=this.model().roofColor(),e._drawPolygon(this.model().geometry())):super._draw(e,t)}boundingBox(){return this.model().boundingBox()}moveBy(e,t){return this.model().moveBy(e,t)}zLevel(){return this.model().roofZLevel()}handles(){return[...this.rotationHandles(),...this.resizingHandles(),this.selfHandle()]}rotationHandles(){return this.model().vertices().map((e=>new i(this.model(),e)))}resizingHandles(){return this.model().geometry().edges().map((e=>new o(e,this)))}selfHandle(){return new s(this)}}},88101:(e,t,r)=>{const{Drawable:n}=r(7340),{Rectangle:i,NormalToEdgeLocator:s}=r(62048),{$P:o}=r(62048);e.exports=class GradientAnnotationFigure extends n{constructor(e){super(),this._model=e,this._scaleValue=1}defaultProperties(){return{...super.defaultProperties(),_pixelLineWidth:.5}}_scale(){return this._scaleValue}_setScale(e){this._scaleValue=e}_setScaleFromContext(e){this._setScale(e.runningScaleX())}_pixelsToDrawingUnits(e){return e/this._scale()}_skipDrawing(e,t){return this._setScaleFromContext(e),super._skipDrawing(e,t)}_offsetDistance(){return this._pixelsToDrawingUnits(this.annotation().distance())}_annotationMagnification(){const e=this.annotation().magnification();return this._pixelsToDrawingUnits(e).constrained(e,150)}annotation(){return this._model}contains(e,t){return!1}moveBy(e,t){return!1}boundingBox(){return new i(this.locator(),void 0,100,100)}edge(){return this.annotation().edge()}locator(){const e=this.model().direction();return e?this.edge().center().add(e.multipliedBy(this._offsetDistance())):new s(this.edge().center(),this._offsetDistance())}fontFamily(){return"sans-serif"}fontSize(e){return this._pixelsToDrawingUnits(12)}_setFontSizeOnContext(e){e.font=`${this.fontSize(e)}px ${this.fontFamily()}`}_draw(e,t){this._setFontSizeOnContext(e);const r=this._annotationMagnification(),n=this.annotation(),i=n.generateShapeFrom(this.locator(),r);e._alterAndRestoreAfter((()=>{e.beginPath(),e._addPolygonToCurrentPath(i),e.closePath(),e.stroke();const t=i.edges(),r=t.find((e=>e.isNearlyVertical())),s=t.find((e=>e.isNearlyHorizontal())),o=t.find((e=>e!==r&&e!==s)),a=this.model().riseText()??n.rise(),l=this.model().runText()??n.run(),c=this.model().hypotenuseText();this._printTextOnEdge(r,a,e),this._printTextOnEdge(s,l,e),c&&this._printTextOnEdge(o,c,e)}))}_printTextOnEdge(e,t,r){r.textAlign="center",r.textBaseline="middle";const n=r.measureText(t),i=n.width/2,s=(Math.abs(n.actualBoundingBoxAscent)+Math.abs(n.actualBoundingBoxDescent))/2,a=Math.abs(e.normal().dot(o(i,s)))+this._pixelsToDrawingUnits(8),l=e.normal().multipliedBy(a),c=e.center().add(l);r.fillText(t,c.x(),c.y())}}},82815:(e,t,r)=>{const{Drawable:n,CanvasSpinner:i}=r(7340);e.exports=class PlanBackgroundFigure extends n{constructor(e){super(),this.setModel(e)}contains(){return!1}moveBy(){return!1}boundingBox(){return this.model().geometry()}zLevel(){return this.model().zLevel()}_draw(e,t){if(!this.model().canGenerateBackgroundImage())return;const r=this.model().fullSize();if(r){const t=this.model().geometry();e.drawImage(r,t.x(),t.y(),t.width(),t.height())}else this._isLoadingBackgroundImage()||this._redrawOnceLoaded(e._requestRedraw);this._isLoadingBackgroundImage()&&this._drawLoadingSpinner(e,t)}_isLoadingBackgroundImage(){return Boolean(this._loadingSpinner)}_drawLoadingSpinner(e,t){this._loadingSpinner?.draw(e,t)}_createLoadingSpinner(){this._loadingSpinner??=new i(this)}_disposeLoadingSpinner(){this._loadingSpinner?.dispose(),this._loadingSpinner=void 0}async _redrawOnceLoaded(e){this._createLoadingSpinner(),await this.model().load(),this._disposeLoadingSpinner(),e()}}},21953:(e,t,r)=>{const{Drawable:n}=r(7340),{$P:i,FixedEdgeLocator:s}=r(62048),o=r(89954);e.exports=class PlanScaleMeasurementFigure extends n{constructor(e){super(),this.setModel(e)}_skipDrawing(){return!1}_draw(e,t){const r=this.model().edge(),n=e._pixelsToDrawingUnits(10);r&&e._alterAndRestoreAfter((()=>{const t=e._pixelsToDrawingUnits(20),i=e._pixelsToDrawingUnits(10),o=new s(r,n+i),a=new s(r,-n-i);e._drawDashedLine(o,a,[t,i])}));const o=[this.model().begin(),this.model().end()].filter((e=>e)),a=e._pixelsToDrawingUnits(4),l=e._pixelsToDrawingUnits(14);o.forEach((t=>{e._drawLine(i(t.x(),t.y()+a),i(t.x(),t.y()+a+l)),e._drawLine(i(t.x(),t.y()-a),i(t.x(),t.y()-a-l)),e._drawLine(i(t.x()+a,t.y()),i(t.x()+a+l,t.y())),e._drawLine(i(t.x()-a,t.y()),i(t.x()-a-l,t.y())),e._drawCircle(t.expandedByRadius(n))}))}defaultHandles(){return[this.model().begin(),this.model().end()].filter((e=>e)).map((e=>new o(e,this)))}defaultProperties(){return{...super.defaultProperties(),_pixelLineWidth:2,strokeStyle:"#FF0000",fillStyle:"rgba(0, 0, 0, 0)"}}}},11419:(e,t,r)=>{const n=r(48909),i=r(85438),s=r(72029),o=r(55033);e.exports=class PlatformFigure extends n{constructor(e){super(),this.setModel(e)}platform(){return this.model()}boundingBox(){return this.model().boundingBox()}constrainWidthAdjustment(e){return this.platform().constrainWidthAdjustment(e)}constrainLengthAdjustment(e){return this.platform().constrainLengthAdjustment(e)}_sideEdgeHandles(){return this.model().sideEdges().map((e=>new o(e,this,this.constrainWidthAdjustment.bind(this))))}_endEdgeHandles(){return this.model().endEdges().map((e=>new o(e,this,this.constrainLengthAdjustment.bind(this))))}defaultHandles(){return[...this.model().vertices().map((e=>new i(this.model(),e))),...this._sideEdgeHandles(),...this._endEdgeHandles(),this.selfHandle()]}selfHandle(){return new s(this)}defaultProperties(){return{strokeStyle:"#000",fillStyle:"#ddd7"}}}},59252:(e,t,r)=>{const n=r(48909),i=r(85438),s=r(35979),o=r(8743);e.exports=class StairwayFigure extends n{constructor(e){super(),this.setModel(e)}boundingBox(){return this.stairway().boundingBox()}_draw(e,t){t.shapeOnly?e._drawPolygon(this.model().geometry()):super._draw(e,t)}stairway(){return this.model()}zLevel(){return this.stairway().zLevel()}defaultHandles(){return[...this.rotationHandles(),...this.edgeHandles(),this.selfHandle()]}_attachedToUpperFrame(){return Boolean(this.stairway().upperFrame())}_attachedToLowerFrame(){return Boolean(this.stairway().lowerFrame())}_attachedToFrame(){return this._attachedToUpperFrame()||this._attachedToLowerFrame()}rotationHandles(){return this._attachedToFrame()?[]:this.stairway().topVertices().map((e=>new i(this.stairway(),e)))}edgeHandles(){if(this._attachedToUpperFrame()&&!this._attachedToLowerFrame()){const e=this.stairway();return[new o(e.sideEdges()[0],this,e.sideEdges()[1]),new o(e.sideEdges()[1].reversed(),this,e.sideEdges()[0])]}return[]}selfHandle(){return new s(this)}defaultProperties(){return{strokeStyle:"#000",fillStyle:"#ddd7"}}}},76697:(e,t,r)=>{const{AngleAnnotationFigure:n}=r(7340),i=r(9366);e.exports=class ThunderCloudAngleAnnotationFigure extends n{_setFontSizeOnContext(e){e.font=`${this.fontSize(e)}px ${this.fontFamily()}`}_drawArrowHeads(e){const t=this.arrowLength();let r=this._ray1().normalAngle(),n=this._ray2().normalAngle();this._angle().clockwise()?n+=Math.PI:r+=Math.PI,e._drawArrowhead(this.arrowHead1TipLocator(),r,t),e._drawArrowhead(this.arrowHead2TipLocator(),n,t)}arrowLength(){const e=i.arrowLengthForScale(this._scale(),13);return this._pixelsToDrawingUnits(e)}fontFamily(){return"sans-serif"}fontSize(e){return this._pixelsToDrawingUnits(12)}}},37198:(e,t,r)=>{const n=r(65277);e.exports=class ThunderCloudBadgeTextAnnotationFigure extends n{_draw(e){this._drawBadge(e),this._drawText(e)}_drawBadge(e){const t=this.model().badgeShape();e._alterAndRestoreAfter((()=>{const r=1/this._scale();e.fillStyle=this.model().badgeFillStyle(),e.strokeStyle=this.model().badgeStrokeStyle(),e.lineWidth=.5;const n=this._textLocation();e.translate(n.x(),n.y()),e.scale(r,r),e._drawPolygon(t)}))}fontSize(e){return e?Math.min(10,30*this._scale()):10}fontFamily(){return"monospace"}}},27287:(e,t,r)=>{const{BoardFigure:n}=r(93613);e.exports=class ThunderCloudBoardFigure extends n{draw(e,t={}){if(this._skipDrawing(e,t))return;e.fillStyle=this.model().color2D?.()||"#f2cca8",e.lineWidth=.1,this._draw(e,t)}_draw(e,t){this.model().shape3D().topProjections().forEach((t=>{e._drawPolygon(t)}))}_skipDrawing(){return!1}}},66379:(e,t,r)=>{const n=r(39902);e.exports=class ThunderCloudBoardProjectedFigure extends n{_applyStyles(e,t){if(t.printWithColor){const t="#f2cca8";e.fillStyle=this.model().color2D?.()??t,e.lineWidth=.1}else super._applyStyles(e,t)}_getAnnotationsFromModel(){return[]}}},18734:(e,t,r)=>{const n=r(59663),i=r(5834);e.exports=class ThunderCloudComponentFrom3DModelFigure extends n{contains(e,t){return this.model().boundingBox()&&this.model().boundingBox().contains(e,t)}model3D(){return this.model()}_isReadyForDrawing(){return Boolean(this.model3D().shape3D())}_prepareForDrawing(e,t){this.load3DModel()}_prepareForRedraw(e){this._redrawCallback=()=>e._requestRedraw()}shapes2D(){return this.model3D().topProjections().sort(((e,t)=>t.zLevel()-e.zLevel()))}load3DModel(){return this.model3D().shape3D()||this._loadingPromise||(this._loadingPromise=this.model3D().load().then((()=>this._loadFinished()))),this._loadingPromise}_loadFinished(){this._redraw(),this._loadingPromise=void 0}_redraw(){this._redrawCallback&&(this.updateProperties(this.defaultProperties()),this._redrawCallback())}defaultProperties(){return i(this.model().materialIdentifiers()?.first())}}},97528:(e,t,r)=>{const{$P:n}=r(62048),i=r(18734);e.exports=class ThunderCloudComponentFrom3DModelProjectedFigure extends i{constructor(e,t=n(1,0,0),r=n(0,1,0),i){super(e),this.setAxes(t,r,i)}xAxis(){return this._xAxis}yAxis(){return this._yAxis}zAxis(){return this._zAxis}setAxes(e,t,r){this._xAxis=e,this._yAxis=t,this._zAxis=r??e.cross(t)}_sortedShapes(){return this.model().projectedViewShapes(this.xAxis(),this.yAxis(),this.zAxis()).sort(((e,t)=>t.zLevel()-e.zLevel()))}}},59663:(e,t,r)=>{const{Circle:n,Polygon:i}=r(62048),{ConstructionComponentFigure:s}=r(93613);e.exports=class ThunderCloudConstructionComponentFigure extends s{constructor(e,t={strokeStyle:"#5c5c5c",fillStyle:"#aaaaaa",lineWidth:.3}){super(e),this._lineWidthPixels=t.lineWidthPixels,delete t.lineWidthPixels,this._defaultProperties=t}resetHandles(){this._otherHandles=void 0,this._selfHandle=void 0}defaultHandles(){return[...this.otherHandles(),this.selfHandle()].filter(Boolean)}otherHandles(){return this._otherHandles??=[]}setOtherHandles(e){this._otherHandles=e}selfHandle(){return this._selfHandle}setSelfHandle(e){this._selfHandle=e}_skipDrawing(e,{layerManager:t}={}){return!this.layerVisible(t)}_updateFigureHandles(){this.model().updateFigureHandles?.(this)}_prepareForDrawing(e,t){e.lineWidth=this.model().lineWidth?.()||e.lineWidth,e.strokeStyle=this.model().strokeStyle?.()||e.strokeStyle,e.fillStyle=this.model().fillStyle?.()||e.fillStyle,this._setScaledLineWidthInContext(e),this._updateFigureHandles()}lineWidthPixels(){return this._lineWidthPixels}_setScaledLineWidthInContext(e){const t=this.lineWidthPixels();t&&(e.lineWidth=e._pixelsToDrawingUnits(t))}_isReadyForDrawing(){return!0}_prepareForRedraw(e){}_polygonShape(e){return e instanceof i?e:e.toPolygon()}_drawShape(e,t){if(t instanceof n)return void e._drawCircle(t);const r=this._polygonShape(t);e._drawPolygon(r)}_draw(e,t){this._prepareForDrawing(e,t),this._isReadyForDrawing()?this.shapes2D().forEach((t=>this._drawShape(e,t))):this._prepareForRedraw(e)}shapes2D(){return this.model().shapes2D?.()||[this.shape()]}shape(){return this.model().shape()}contains(e,t,r){return this.shapes2D().some((n=>n.contains(e,t,r)))}moveBy(e,t){return this.model().moveBy(e,t)}defaultProperties(){const e=this.model().materialSpecifier?.();return e?{fillStyle:e.details().fillStyle||this._defaultProperties.fillStyle,strokeStyle:e.details().strokeStyle||this._defaultProperties.strokeStyle,lineWidth:e.details().lineWidth||this._defaultProperties.lineWidth}:this._defaultProperties}}},84510:(e,t,r)=>{const{DimensionAnnotationFigure:n}=r(7340),{FixedEdgeLocator:i,NormalToEdgeLocator:s,Polygon:o}=r(62048),a=r(9366),l=r(44387);e.exports=class ThunderCloudDimensionAnnotationFigure extends n{_skipDrawing(e,t){return super._skipDrawing(e,t)||this._isBelowSizeThreshold()}_setFontSizeOnContext(e){e.font=`${this.fontSize(e)}px ${this.fontFamily()}`}fontFamily(){return"sans-serif"}fontSize(e){return Math.min(10,30*this._scale())}_scaledFontSize(){return this.fontSize()/this._scale()}_fadeWithDistance(){return this.model().fadeWithDistance()}_isBelowSizeThreshold(){return!!this._fadeWithDistance()&&Math.abs(this.distance())>this._fadeSize()}_setGlobalAlpha(e){if(!this._fadeWithDistance())return;const t=this.fontSize(),r=this._fadeSize(),n=1/(t-r),i=0-n*r;e.globalAlpha=(Math.abs(this.distance())*n+i).constrained(0,1)}_fadeSize(){return 3*this.fontSize()}_draw(e,t){this._setGlobalAlpha(e),this._setFontSizeOnContext(e);const r=this._dimensionLineEdge(),n=this._textOffsetAlongEdge(e,t.bounds,r),i=this._scale(),s=e.measureText(this.annotation().text()),o=s.width/i,a=(Math.abs(s.actualBoundingBoxAscent)+Math.abs(s.actualBoundingBoxDescent))/i,l=this._shouldRotateText(o,r),c=l?a:o,u=this._fitsOnDimensionLine(c,r);this._drawBrackets(e,u),this._drawDimensionLine(e,c,n,r),this._drawLabel(e,c,n,r,l)}_dimensionLinePadding(){return 2/this._scale()}_drawRightLineSegment(e,t,r,n){const s=new i(e,r+t/2+this._dimensionLinePadding()),o=e.end();n._drawLine(s,o)}_drawLeftLineSegment(e,t,r,n){const s=e.begin(),o=new i(e,r-t/2-this._dimensionLinePadding());n._drawLine(s,o)}_shouldRotateText(e,t){return void 0!==this.annotation().crampedTextAngle()&&!this._fitsOnDimensionLine(e,t)}_drawBrackets(e,t){const r=this.annotation().edgeBegin(),n=this.annotation().edgeEnd(),i=this._offset(),o=this._popOutTextDistance()+i/2,a=t?this.distance():this.distance()-o,l=new s(r,i),c=new s(r,a),u=new s(n,i),d=new s(n,a);e._drawLine(l,c),e._drawLine(u,d)}_drawDimensionLine(e,t,r,n){this._fitsOnDimensionLine(t,n)?this._drawLineSegmentsAroundLabel(e,t,r,n):(n=n.shiftedAlongNormalBy(-this._popOutTextDistance()),this._drawPopOutTextLines(e,r,n)),this._drawArrows(e,n)}_drawPopOutTextLines(e,t,r){const n=new i(r,t),o=this._scaledFontSize()/2,a=new s(n,o);e._drawLine(r.begin(),r.end()),e._drawLine(n,a)}_drawArrows(e,t){const r=this.arrowLength(),n=this._shouldMoveArrowsOutsideEdge()?Math.PI:0,i=t.angle()+n;e._drawArrowhead(t.begin(),i+Math.PI,r,Math.PI/8),e._drawArrowhead(t.end(),i,r,Math.PI/8)}_shouldMoveArrowsOutsideEdge(){const e=this.arrowLength();return this._dimensionLineEdge().length()/2<=e}arrowLength(){const e=a.arrowLengthForScale(this._scale(),7);return this._pixelsToDrawingUnits(e)}_drawLabel(e,t,r,n,i){const s=this.annotation().text();e._alterAndRestoreAfter((()=>{this._positionText(e,t,r,n,i),this._orientText(e,i),this._drawText(e,s)}))}_positionText(e,t,r,n,o){const a=new i(n,r),l=this._fitsOnDimensionLine(t,n)?0:this._popOutTextDistance(),c=new s(a,l);this._textShape=this.defaultTextShape(c,t);const u=this._popOutTextAlignment(e,o);e.textBaseline="middle",e.textAlign=l>0?u:"center",e.translate(c.x(),c.y())}_popOutTextAlignment(e,t){if(!t)return"center";const r=this.annotation().crampedTextAngle();return this._isTextOrientedUpsideDown(r+e.runningRotation())?"right":"left"}_popOutTextDistance(){return this._scaledFontSize()/2}_orientText(e,t){if(!t)return super._orientText(e);let r=this.annotation().crampedTextAngle();this._isTextOrientedUpsideDown(r+e.runningRotation())&&(r+=Math.PI),e.rotate(r)}_drawText(e,t){e._alterAndRestoreAfter((()=>{const r=1/this._scale();e.scale(r,r),e.fillText(t,0,0)}))}_fitsOnDimensionLine(e,t){const r=2*this.arrowLength();return e<=t.length()-r}defaultTextShape(e,t){const r=this.fontSize()/2,n=t/2;return new o([e.add(-n,-r),e.add(n,-r),e.add(n,r),e.add(-n,r)])}distance(){return l(this._scale(),this.model().distance())}_textOffsetAlongEdge(e,t,r){if(!t)return r.length()/2;const n=r.segmentsInsidePolygon(t).first();if(!n)return r.length()/2;const i=n.center();return r.begin().distanceTo3D(i)}}},79137:(e,t,r)=>{const{Drawing:n}=r(7340),{Rectangle:i,$P:s}=r(62048);e.exports=class ThunderCloudDrawing extends n{boundingBox(){return this.model().boundingBox()}boundingBoxInBounds(e){const t=this.model().parts().filter((t=>t.boundingBox().intersects(e)));if(0===t.length)return new i(0,0,1,1);const r=t.map((e=>e.boundingBox())).reduce(((e,t)=>e.merge(t)));return s(Math.max(e.left(),r.left()),Math.max(e.top(),r.top())).toCorner(s(Math.min(e.right(),r.right()),Math.min(e.bottom(),r.bottom())))}boundingBoxWithAnnotations(e){const t=this.boundingBox(),r=this.annotationBoundingBoxes(e).reduce(((e,t)=>e.merge(t)),t);return t.merge(r)}annotationBoundingBoxes(e){return this.model().parts().map((t=>t.annotationPDFBoundingBox?.(e))).filter(Boolean)}_drawFigures(e,t){const r=this.figures().flatMap((e=>(e.zLevels?.()??[e.zLevel()]).map((t=>({figure:e,zLevel:t})))));r.sort((({zLevel:e},{zLevel:t})=>t-e)),r.forEach((({figure:r,zLevel:n})=>r.draw(e,{...t,zLevel:n})))}}},40769:(e,t,r)=>{const{NullDrawable:n}=r(7340),i=r(79137);e.exports=class ThunderCloudDrawingProjected extends i{constructor(e,t,r,n){super(e),this.setAxes(t,r,n)}xAxis(){return this._xAxis}yAxis(){return this._yAxis}zAxis(){return this._zAxis}setAxes(e,t,r){this._xAxis=e,this._yAxis=t,this._zAxis=r??this._xAxis.cross(this._yAxis)}boundingBox(){return this.model().boundingBoxProjected(this.xAxis(),this.yAxis(),this.zAxis())}annotationBoundingBoxes(e){return this.model().parts().map((t=>t.projectedAnnotationPDFBoundingBox?.(e,this.xAxis(),this.yAxis(),this.zAxis()))).filter(Boolean)}_componentRenderer(e){const t=e.projectedViewFigure?.(this.xAxis(),this.yAxis(),this.zAxis());return t??new n(e)}}},66399:(e,t,r)=>{const n=r(2858);e.exports=class ThunderCloudEdgeAnnotationFigure extends n{dashed(){return this.annotation().dashed()}dashLength(){return this.annotation().dashLength()}dashGapLength(){return this.annotation().dashGapLength()}drawShape(e,t){const r=this.annotation().edgeBegin(),n=this.annotation().edgeEnd();if(this.dashed()){const t=e._pixelsToDrawingUnits(this.dashLength()),i=e._pixelsToDrawingUnits(this.dashGapLength());e._drawDashedLine(r,n,[t,i])}else e._drawLine(r,n)}}},2858:(e,t,r)=>{const{Drawable:n}=r(7340);e.exports=class ThunderCloudGeometryAnnotationFigure extends n{constructor(e){super(),this._model=e}annotation(){return this.model()}options(){return this.annotation().options()}strokeStyle(){return this.options().strokeStyle??="#000000"}fillStyle(){return this.options().fillStyle??="#000000"}lineWidth(){return this.options().lineWidth??=.01}boundingBox(){return this.annotation().boundingBox()}_draw(e,t){e._alterAndRestoreAfter((()=>{this._setPropertiesOnContext(e),this.drawShape(e,t)}))}drawShape(e,t){}_setPropertiesOnContext(e){e.strokeStyle=this.strokeStyle(),e.fillStyle=this.fillStyle(),e.lineWidth=e._pixelsToDrawingUnits(this.lineWidth())}}},47952:(e,t,r)=>{const n=r(2858);e.exports=class ThunderCloudLocatorAnnotationFigure extends n{locator(){return this.annotation().locator()}markCenter(){return this.annotation().markCenter()}centerRadius(){return 3}_draw(e,t){e._alterAndRestoreAfter((()=>{this._setPropertiesOnContext(e),this.drawShape(e,t),this.drawCenter(e,t)}))}drawCenter(e,t){if(!this.markCenter())return;e.fillStyle=this.strokeStyle();const r=this.centerRadius(),n=this.locator().expandedByRadius(r);e._drawCircle(n)}}},49416:(e,t,r)=>{const n=r(47952);e.exports=class ThunderCloudLocatorCircleAnnotationFigure extends n{locator(){return this.annotation().locator()}markCenter(){return this.annotation().markCenter()}circle(){return this.annotation().circle()}centerRadius(){return this.annotation().radius()/4}drawShape(e,t){e._drawCircle(this.circle())}}},97009:(e,t,r)=>{const n=r(47952);e.exports=class ThunderCloudLocatorRectangleAnnotationFigure extends n{width(){return this.annotation().width()}length(){return this.annotation().length()}rectangle(){return this.annotation().rectangle()}centerRadius(){return Math.min(this.width(),this.length())/4}drawShape(e,t){e._drawRectangle(this.rectangle())}}},56438:(e,t,r)=>{const{FreeFloatingDimensionAnnotationFigure:n}=r(7340),i=r(73541),s=r(43416);e.exports=class ThunderCloudMeasurementAnnotationFigure extends n{zLevel(){return this.annotation().zLevel()}_vertexHandles(){return[this.handleForEndpoint(this.annotation().begin()),this.handleForEndpoint(this.annotation().end())]}handleForEndpoint(e){return new i(e,this)}selfHandle(){return new s(this.annotation(),this)}_skipDrawing(e,t){return!!this.annotation().bothEndpointsPlaced()&&super._skipDrawing(e,t)}_draw(e,t){this.annotation().bothEndpointsPlaced()?super._draw(e,t):this.annotation().didSnap()&&(e.fillStyle="#FFD45D8f",e.strokeStyle="#FFD45D",e._pixelLineWidth=3,e._drawCircle(this.annotation().begin().expandedByRadius(3)))}}},62106:(e,t,r)=>{const n=r(84510);e.exports=class ThunderCloudOffsetTextDimensionAnnotationFigure extends n{_textAtBegin(){return this.annotation().textAtBegin()}_drawDimensionLine(e,t,r,n){this._drawLineSegmentsAroundLabel(e,t,r,n),this._drawArrows(e,n)}_drawLineSegmentsAroundLabel(e,t,r,n){e._drawLine(n.begin(),n.end())}_positionText(e,t,r,n,i){const s=this._shouldMoveArrowsOutsideEdge()?this.arrowLength():0,o=this._textAtBegin()?n.direction().negated():n.direction(),a=this._textAtBegin()?n.begin():n.end(),l=a.add(o.multipliedBy(s)).relatedTo(a);this._textShape=this.defaultTextShape(l,t),e.textBaseline="middle",e.textAlign=this._textAtBegin()?"right":"left",e.translate(l.x(),l.y())}_orientText(e,t){let r=this.annotation().edge().angle();this._isTextOrientedUpsideDown(r+e.runningRotation())&&(r+=Math.PI),e.rotate(r)}}},11115:(e,t,r)=>{const n=r(18734),i=r(85438),s=r(21108);e.exports=class ThunderCloudRotatable3DModelComponentFigure extends n{defaultHandles(){return[...this.rotationHandles(),this.selfHandle()]}selfHandle(){return new s(this)}rotationHandles(){return this.model().vertices().map((e=>new i(this.model(),e)))}}},67244:(e,t,r)=>{const{NormalToEdgeLocator:n,Edge:i,Rectangle:s,FixedEdgeLocator:o}=r(62048),a=r(84510);e.exports=class ThunderCloudStairHeightAnnotationFigure extends a{handles(){return[]}_drawLabel(e,t,r,n){const i=this._pixelsToDrawingUnits(5),o=e.measureText(t),a=o.width/this._scale(),l=o.actualBoundingBoxLeft/this._scale(),c=(Math.abs(o.actualBoundingBoxAscent)+Math.abs(o.actualBoundingBoxDescent))/this._scale(),u=-o.actualBoundingBoxAscent/this._scale();e._alterAndRestoreAfter((()=>{this._positionText(e,a,r,n),this._orientText(e);const o=new s(l-i,u-i,a+2*i,c+2*i).toPolygon(),d=this.properties();e.fillStyle=d.labelBackgroundColor,e._drawRoundedRectangle(o,5),e.fillStyle=d.labelTextColor,this._drawText(e,t)}))}_positionText(e,t,r,i){const s=this.annotation().edge().angle(),a=new o(i,r),l=this._isTextOrientedUpsideDown(s+e.runningRotation())?1:-1,c=new n(a,l*this.fontSize()/3,l*t/2);this._textShape=this.defaultTextShape(c,t),e.translate(c.x(),c.y())}_textLineEdge(){return new i(new n(this.annotation().edgeBegin(),this.distance()),new n(this.annotation().edgeEnd(),this.distance()))}_draw(e,t){this._setFontSizeOnContext(e),this._setGlobalAlpha(e),this._drawBrackets(e);const r=this._textLineEdge(),n=this.annotation().edge();this._drawLabel(e,this.annotation().beginHeight(),0,r),this._drawLabel(e,this.annotation().endHeight(),n.length(),r)}defaultProperties(){return{...super.defaultProperties(),labelBackgroundColor:"#fff",labelTextColor:"#000"}}}},65277:(e,t,r)=>{const{TextAnnotationFigure:n}=r(7340),{FixedEdgeLocator:i}=r(62048);e.exports=class ThunderCloudTextAnnotationFigure extends n{_skipDrawing(e,t){return this._setScaleFromContext(e),super._skipDrawing(e,t)||!this.layerVisible(t.layerManager)}_drawText(e){e._alterAndRestoreAfter((()=>{e.font=this.font();const t=this._textLocation();e.translate(t.x(),t.y()),this._orientText(e);const r=1/this._scale();e.scale(r,r),e.fillText(this.model().text(),0,0)}))}orthogonalText(){return this.model().orthogonalTextRendering()}_orientText(e){if(!this.orthogonalText())return;let t=this.model().edge().angle()+Math.PI_2;this._isTextOrientedUpsideDown(t+e.runningRotation())&&(t+=Math.PI),e.rotate(t)}_isTextOrientedUpsideDown(e){const t=e.normalizedAngle();return t>Math.PI_2-.001&&t<Math.THREE_PI_2-.001}_drawArrow(e){const t=this.orthogonalText(),r=this._pixelsToDrawingUnits(9),n=t?this._pixelsToDrawingUnits(this.fontSize())/2:0,s=this._textLocation(),o=this.model().anchor(),a=s.to(o),l=new i(a,n),c=a.angle();t||this._clipAroundText(e),e._drawLine(l,o),e._drawArrowhead(o,c,r)}_clipAroundText(e){const t=-2/this._scale(),r=-3/this._scale(),n=this.textBoundingBox(e).insettedBy(t),i=this.model().anchor().toCorner(n.center()).merge(n).insettedBy(r);e.beginPath(),e.rect(i.x(),i.y(),i.width(),i.height()),e.rect(n.x(),n.y(),n.width(),n.height()),e.closePath(),e.clip("evenodd")}textBoundingBox(e){const t=e.measureText(this.text()).width;return this._textLocation().expandedBy(t/2/this._scale(),this.fontSize()/2/this._scale())}fontSize(e){return e?Math.min(10,30*this._scale()):12}font(){return`${this.fontSize()}px ${this.fontFamily()}`}fontFamily(){return"sans-serif"}_pixelsToDrawingUnits(e){return e/this._scale()}_scale(){return this._scaleValue??=1}_setScale(e){this._scaleValue=e}_setScaleFromContext(e){this._setScale(e.runningScaleX())}_textLocation(){return this.adjustLocationForZoomLevel()?this.model().textLocationForScale(this._scale()):this.model().textLocation()}adjustLocationForZoomLevel(){return this.model().adjustLocationForZoomLevel()}defaultProperties(){return{fillStyle:this.model().color(),strokeStyle:this.model().color(),_pixelLineWidth:.5,shapeOnly:!0,textBaseline:"middle",textAlign:"center"}}}},21260:e=>{e.exports=class ToggleStateIconDrawingStyleDescriptor{constructor(e,t,r=[]){this._backgroundColor=e,this._strokeColor=t,this._lineDash=r}get backgroundColor(){return this._backgroundColor}get strokeColor(){return this._strokeColor}get lineDash(){return this._lineDash}}},38550:(e,t,r)=>{const{ConstructionComponentHandle:n}=r(93613),i=r(48426),s=r(59663),o=r(46960);e.exports=class ZoneFigure extends s{_draw(e,t){this._drawZoneShape(e,t)}_drawZoneShape(e,t){const r=this._hatchingProperties(),n=this._borderProperties(),i=this.shape();e=this._setContextProperties(e,r),o(e,i,r.spacing,r.angles),(e=this._setContextProperties(e,n))._drawPolygon(i)}defaultHandles(){return[...super.defaultHandles(),...this.model().movableEdges().map((e=>new i(e,this)))]}selfHandle(){return new n(this.model())}_setContextProperties(e,t){return e.fillStyle=t.fillStyle||e.fillStyle,e.strokeStyle=t.strokeStyle||e.strokeStyle,e.lineWidth=t.lineWidth||e.lineWidth,e}_hatchingProperties(){return{strokeStyle:"rgba(254, 183, 0, 65%)",lineWidth:3,spacing:8,angles:[20..degreesToRadians()]}}_borderProperties(){return{fillStyle:"transparent",strokeStyle:"#694a1d",lineWidth:.5}}}},46960:(e,t,r)=>{const{PolarCoordinate:n}=r(62048);e.exports=(e,t,r,i)=>{e._alterAndRestoreAfter((()=>{((e,t)=>{e.beginPath?(e.beginPath(),e._addPolygonToCurrentPath(t),e.closePath()):e.polygon(...t.toArray()),e.clip()})(e,t),i.forEach((i=>{const s=new n(1,i),o=new n(1,i+Math.PI_2),a=t.vertices().map((e=>e.dot(s))),l=Math.min(...a),c=Math.max(...a),u=t.vertices().map((e=>e.dot(o))),d=Math.floor(Math.min(...u)/r)*r,h=Math.max(...u)-d,p=Math.ceil(h/r)-1;e.beginPath&&e.beginPath();for(let t=0;t<p;t++){const n=s.multipliedBy(l).add(o.multipliedBy(d+(t+1)*r)),i=s.multipliedBy(c).add(o.multipliedBy(d+(t+1)*r));e.moveTo(n.x(),n.y()),e.lineTo(i.x(),i.y())}e.stroke()}))}))}},85438:(e,t,r)=>{const{$P:n,PolarCoordinate:i,Polygon:s,NormalToEdgeLocator:o,ProportionalEdgeLocator:a}=r(62048),{Handle:l}=r(7340),{extend:c}=r(50988),u=r(29245),d=r(54896),h=r(84434);class AssetRotationHandle extends l{constructor(e,t){super(e),this._locator=t}selectableComponent(){return this.object()}locator(){return this._locator}contains(e,t,r){this._setScale(r);const n=this.object(),l=this._radius(),c=n.locator().to(this.locator()),u=this._arrowLength(),d=c.theta()+Math.PI/8,h=c.theta()-Math.PI/8,p=new i(l,d).add(new i(u-this._pixelsToDrawingUnits(2),d+Math.PI_2)),m=new i(l,h).add(new i(u-this._pixelsToDrawingUnits(2),h-Math.PI_2)),f=new o(new a(c,1),0,this._offsetAlongEdge());return new s([f,f.add(p),f.add(new i(l,c.theta())),f.add(m)]).contains(e,t)}keyboardShortCuts(){return{toggleAngleSnapping:[{keys:"s"}]}}toggleAngleSnapping(){this._angleSnappingEnabled=!this.angleSnappingEnabled()}_shouldAllowAngleSnapToggling(e){return!!e&&this.object().allowsArbitraryRotationAngles?.()}activate(e){this._shouldAllowAngleSnapToggling(e)&&(e.addKeyboardShortcuts(this.keyboardShortCuts(),this),e.setContextMessage("Press S key to toggle angle snapping"))}deactivate(e){this._shouldAllowAngleSnapToggling(e)&&(e.removeKeyboardShortcuts(this.keyboardShortCuts(),this),e.resetContextMessage())}angleSnappingEnabled(){return this._angleSnappingEnabled??=!0}_snappedAngle(e){if(!this.angleSnappingEnabled())return e.normalizedAngle();const t=this.object().snappableAngles().slice();return t.includes(0)&&t.push(Math.TWO_PI),t.sort(((t,r)=>Math.abs(t-e.normalizedAngle())-Math.abs(r-e.normalizedAngle()))).first()}moveFromTo(e,t,r,i){const s=this.object().locator().to(n(r,i)).angle()+(this.object().angle()-this.object().locator().to(this.locator()).angle());return this.object().setAngle(this._snappedAngle(s)),!0}drawSelected(e,t){this._drawHandle(e,this._selectedProperties(),t)}drawArcWithArrows(e,t){const r=this._arrowLength(),n=this._arrowWidth()/2,s=Math.atan(n/r),l=t.theta()+Math.PI/8,c=t.theta()-Math.PI/8,u=this._radius(),d=new i(u,l).add(new i(r-this._pixelsToDrawingUnits(2),l+Math.PI_2)),h=new i(u,c).add(new i(r-this._pixelsToDrawingUnits(2),c-Math.PI_2)),p=new o(new a(t,1),0,this._offsetAlongEdge());e.beginPath(),e.arc(p.x(),p.y(),u,l,c,!0),e.stroke(),e._drawArrowhead(p.add(d),l+Math.PI_2,r,s),e._drawArrowhead(p.add(h),c-Math.PI_2,r,s)}_radius(){return this._pixelsToDrawingUnits(15)}_arrowWidth(){return this._pixelsToDrawingUnits(16)}_arrowLength(){return this._pixelsToDrawingUnits(12)}_offsetAlongEdge(){return(Math.max(this._pixelsToDrawingUnits(4),3)+this._lineWidth()/2)/Math.cos(Math.PI_4)-this._radius()}_lineWidth(){return this._pixelsToDrawingUnits(5)}draw(e,t){this._drawHandle(e,this.indicatorProperties(),t)}_drawHandle(e,t,r){this._setScaleFromContext(e),e._alterAndRestoreAfter((()=>{Object.assign(e,t),e.lineWidth=this._lineWidth(),this.drawArcWithArrows(e,this.object().locator().to(this.locator()))}))}validWhen(){return l.VALID_FOR_SELECTED}_selectedProperties(){return d}indicatorProperties(){return h}}c(AssetRotationHandle,u),e.exports=AssetRotationHandle},72029:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),s=r(47910);e.exports=class ConnectableFrameHandle extends s{activate(){this._didMove=void 0,this._snappedConnectors=[]}deactivate(){this._offset=void 0;const e=this.selectableComponent();if(this._didMove){const t=this._snappedConnectors,r=e.attachedConnectors().filter((e=>!t.includes(e))),n=t.filter((t=>!e.attachedConnectors().includes(t)));r.forEach((t=>t.detachFrame(e))),n.forEach((t=>t.attachLowerFrame(e))),e.movingFinished?.()}}moveFromTo(e,t,r,n){const i=this.selectableComponent();i.prepareForMove?.();let s=this._moveFrameFromTo(e,t,r,n);const o=this._snapToConnectors(i);s||=o;const a=this._snapToFrames(i);return s||=a,this._didMove||=s}_moveFrameFromTo(e,t,r,n){const s=this.selectableComponent();this._offset||(this._offset=i(e,t).subtract(s.locator()));const o=i(r,n).subtract(this._offset).subtract(s.locator());return this.moveBy(o.x(),o.y())}_snapToConnectors(e){const t=this._nearlyOrthogonalOrParallelConnectors().filter(e.snapToConnectorsFilter());return this._snappedConnectors=t.filter((e=>this._snapToConnector(e))),this._snappedConnectors.length>0}_snapToFrames(e){return this._framesWithParallelEdges().filter(e.snapToFramesFilter()).filter((e=>this._snapToFrame(e))).length>0}_framesWithParallelEdges(){const e=this.selectableComponent(),t=e.project().frames().filter((t=>t!==e)),r=e.edges(),n=t.filter((e=>{const t=e.edges();return r.some((e=>t.some((t=>e.isParallelTo(t)))))})),i=e.boundingBox().insettedBy(-this.snappingTolerance().toNumeric(e.unit()));return n.filter((e=>i.intersects(e.boundingBox())))}_nearlyOrthogonalOrParallelConnectors(){const e=this.selectableComponent();return e.project().connectors().filter((t=>e.alongCrossAxis(t.mainAxis().xy())||e.alongMainAxis(t.mainAxis().xy())))}_snapToFrame(e){const t=this.selectableComponent();return(t.snappableEdgesForFrame?.(e)??t.edges()).find((r=>(e.snappableEdgesForFrame?.(t)??e.edges()).filter((e=>this._candidateEdgeFilter(r,e))).find((n=>{const i=r.closestPointTo(n.center()),s=i.to(i.add(r.normal())),o=n.intersectionsWithLineIn2D(s).first(),a=this.snappingTolerance().toNumeric(t.unit());if(!o)return;if(!n.xy().containsPoint(o.xy()))return;let l=e.snappingVectorForFrame?.(t,r,n);return l||(l=o.subtract(i)),l.r()>a?void 0:(this.moveBy(l.x(),l.y()),t.didSnapToFrame?.(e),!0)}))))}snappingTolerance(){return n.unit(1,"ft")}_snapToConnector(e){const t=this.selectableComponent(),r=e.lowerEdge(),n=t.edges().find((e=>this._candidateEdgeFilter(r,e))),i=n.closestPointTo(r.center()),s=i.to(i.add(n.normal())),o=r.intersectionsWithLineIn2D(s).first(),a=this.snappingTolerance().toNumeric(t.unit());if(!o)return;if(!r.xy().containsPoint(o.xy()))return;if(i.distanceTo(o)>a)return;const l=e.offsetWithOverhang(t.surfaceOverhang()).toNumeric(t.unit()),c=o.add(r.normal().multipliedBy(l)).subtract(i);return this.moveBy(c.x(),c.y()),!0}_candidateEdgeFilter(e,t){return e.normal().dot(t.normal()).isNearTo(-1)}_moveBy(e,t){return this.selectableComponent().moveBy(e,t)}}},35979:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),s=r(47910);e.exports=class ConnectorHandle extends s{activate(){this._didMove=void 0}deactivate(){const e=this.selectableComponent();this._offset=void 0,this._didMove&&(e.detachUpperFrame(),this._snappedToFrame&&e.attachUpperFrame(this._snappedToFrame),e.detachLowerFrame())}moveFromTo(e,t,r,n){const s=this.selectableComponent();this._offset||(this._offset=i(e,t).subtract(s.locator()));const o=i(r,n).subtract(this._offset),a=s.mainAxis().negated(),l=s.project().frames().filter(s.snapToFramesFilter()).find((e=>{const t=e.edges().find((e=>e.normal().dot(a.xy().normalized()).isNearTo(-1)));if(!t)return!1;const r=o.subtract(s.locator()),n=s.upperEdge().movedBy(r.x(),r.y()),i=t.normal().multipliedBy(s.offsetFromFrameWhenAttached(e).toNumeric(s.unit()));let l;l=e.connectorsShouldSnapToCenter()&&s.snapsToCenter()?t.center():t.closestPointTo(n.center());const c=l.add(i),u=this.snappingTolerance().toNumeric(s.unit());if(!c)return!1;if(c.distanceTo(n.center())>u)return!1;const d=c.subtract(s.upperEdge().center());return this.moveBy(d.x(),d.y()),!0}));let c;if(l)this._snappedToFrame=l,c=!0;else{this._snappedToFrame=void 0;const e=o.subtract(s.locator());c=this.moveBy(e.x(),e.y())}return this._didMove||(this._didMove=c),c}snappingTolerance(){return n.unit(1,"ft")}}},55033:(e,t,r)=>{const{PolarCoordinate:n}=r(62048),i=r(11288);e.exports=class ConstrainedEdgeHandle extends i{constructor(e,t,r){super(e,t),this._constrainingFunction=r}edge(){return this.object()}constrainedMovementAlongNormal(e,t){const r=this.movementAlongNormal(e,t),i=r.r(),s=this.edge().normal().theta()%Math.TWO_PI,o=r.theta()%Math.TWO_PI,a=s.isNearTo(o)?1:-1,l=Math.abs(this._constrainingFunction(i*a));return new n(l,r.theta())}}},13541:(e,t,r)=>{const n=r(72029);e.exports=class InteriorConnectableFrameHandle extends n{_candidateEdgeFilter(e,t){return e.normal().dot(t.normal()).isNearTo(1)}}},19178:(e,t,r)=>{const{LocatorHandle:n,CircleFigure:i}=r(7340),s=r(84434);e.exports=class PathSegmentControlPointHandle extends n{constructor(e,t,r){super(e),this._beforeLocator=t,this._afterLocator=r}beforeLocator(){return this._beforeLocator}afterLocator(){return this._afterLocator}selectableComponent(){return this._selectableComponent}setSelectableComponent(e){this._selectableComponent=e}activate(){}deactivate(){}shape(){return this.object().expandedByRadius(2)}contains(e,t){return this.shape().contains(e,t)}draw(e,t){this.drawHandle(e,this.indicatorProperties(),t)}drawSelected(e,t){this.drawHandle(e,this._selectedProperties(),t)}drawHandle(e,t,r){const n=new i(this.shape());n.updateProperties(t),n.draw(e,r),e._alterAndRestoreAfter((()=>{e.lineWidth=.1,e.setLineDash([2,2]),e.strokeStyle="#000000",this.beforeLocator()&&e._drawLine(this.beforeLocator(),this.object()),this.afterLocator()&&e._drawLine(this.object(),this.afterLocator())}))}_selectedProperties(){const e="#5bb2e4";return{fillStyle:`${e}4d`,strokeStyle:e,_pixelLineWidth:3}}indicatorProperties(){const e={...s,_pixelLineWidth:3};return e.fillStyle=`${e.fillStyle}4d`,e}}},39352:(e,t,r)=>{const{LocatorHandle:n,PolygonFigure:i}=r(7340),s=r(84434);e.exports=class PathSegmentPointHandle extends n{activate(){}deactivate(){}shape(){return this.object().expandedBy(2)}contains(e,t){return this.shape().contains(e,t)}draw(e,t){this.drawHandle(e,this.indicatorProperties(),t)}drawSelected(e,t){this.drawHandle(e,this._selectedProperties(),t)}drawHandle(e,t,r){const n=new i(this.shape().toPolygon());n.updateProperties(t),n.draw(e,r)}_selectedProperties(){const e="#5bb2e4";return{fillStyle:`${e}4d`,strokeStyle:e,_pixelLineWidth:3}}indicatorProperties(){const e={...s,_pixelLineWidth:3};return e.fillStyle=`${e.fillStyle}4d`,e}}},89954:(e,t,r)=>{const{LocatorHandle:n}=r(7340);e.exports=class PlanScaleEndpointHandle extends n{tolerance(e){return 18/e}draw(e){}moveBy(e,t){const r=super.moveBy(e,t);return r&&this._figure.model().notifyLengthChangedObservers(),r}}},48426:(e,t,r)=>{const n=r(63768),i=r(11288);e.exports=class SnappableFrameEdgeHandle extends i{deactivate(){super.deactivate(),this.snapToSize(),this.frame().resizingFinished?.()}snapToIncrement(){const e=this.frame().snapToIncrement?.(this.edge());if(e)return e;const t=this.frame().snapToUnit?.(this.edge());return t?n.unit(1,t):void 0}snappedSize(){const e=this._modelDimension(),t=this.frame().snappableSizes?.(this.edge());if(t&&t.length>0){const r=this.frame().unit(),n=e.toNumeric(r);return t.slice().sort(((e,t)=>Math.abs(e.toNumeric(r)-n)-Math.abs(t.toNumeric(r)-n))).first()}const r=this.snapToIncrement();if(r)return e.roundedToIncrement(r)}snapToSize(){const e=this.snappedSize();if(e){const t=this._modelDimension(),r=n.subtract(e,t).toNumeric(this.frame().unit()),i=this.edge().normal().multipliedBy(r);this.moveBy(i.x(),i.y())}}_modelDimension(){return this._isEndEdge()?this.frame().length():this.frame().width()}_isEndEdge(){return this.frame().alongCrossAxis(this.edge().vector())}edge(){return this.object()}}},8743:(e,t,r)=>{const{FixedEdgeLocator:n,$P:i}=r(62048),{EdgeHandle:s}=r(7340);e.exports=class StairwayEdgeHandle extends s{constructor(e,t,r){super(e,t),this._stairsFigure=t,this._edgeOfOtherHandle=r}minimumWidth(){return this.stairway().minimumWidth().toNumeric(this.stairway().unit())}stairway(){return this._stairsFigure.model()}edgeOfOtherHandle(){return this._edgeOfOtherHandle}moveFromTo(e,t,r,n){if(!this.deltaIsSignificant(r-e,n-t))return!1;const s=this._locatorNearestFrameEdge(this.object()),o=i(r,n),a=this._moveAlongEdge(o,s);return a&&this.stairway().frameResized(),a}_separationBetweenHandlesIsTooSmall(e,t,r){const n=t.to(r).containsPoint(e,Math.DEFAULT_TOLERANCE/2);return e.to(r).containsPoint(t)&&!t.equals(r)||n}_separationBetweenHandlesIsTooLarge(e,t,r){const n=t.to(r).containsPoint(e,Math.DEFAULT_TOLERANCE/2);return e.to(t).containsPoint(r)&&!t.equals(r)||n}_locationOfMinimumSeparationFromOtherHandle(e,t){const r=this.stairway().topVertices(),i=r.find((e=>e.equals(t))),s=this.stairway().topEdge(),o=s.end()===i,a=r.length>2?s.length()+Math.DEFAULT_TOLERANCE:-this.minimumWidth();return new n(s,o?a:-a)}_locationOfMaximumSeparationFromOtherHandle(e,t){const r=this.stairway().topVertices().find((e=>e.equals(t))),i=this.stairway().topEdge(),s=i.end()===r,o=this.stairway().maximumWidth();return new n(i,s?-o:o)}_locatorNearestFrameEdge(e){const t=t=>Math.min(t.distanceTo(e.begin()),t.distanceTo(e.end()));return this.stairway().topVertices().reduce(((e,r)=>t(e)<t(r)?e:r))}_moveAlongEdge(e,t){const r=this.stairway().frameEdgeAttachedTo(),n=r.closestPointTo(e);let s=n.subtract(t);const o=this._locatorNearestFrameEdge(this.edgeOfOtherHandle()),a=this._locationOfMinimumSeparationFromOtherHandle(t,o),l=this._locationOfMaximumSeparationFromOtherHandle(t,o),c=r.containsPoint(o)&&this._separationBetweenHandlesIsTooSmall(o,n,a),u=r.containsPoint(o)&&this._separationBetweenHandlesIsTooLarge(o,n,l);c?s=a.subtract(t):u&&(s=l.subtract(t));return!s.distanceTo(i(0,0,0)).isNearTo(0)&&(t.moveBy(s.x(),s.y(),0),!0)}_moveBy(e,t){const r=this.object().begin();return this.moveFromTo(r.x(),r.y(),r.x()+e,r.y()+t)}}},21108:(e,t,r)=>{const{$P:n}=r(62048),i=r(47910);e.exports=class ThunderCloudAssetMovementHandle extends i{model(){return this.object().model()}locator(){return this.model().locator()}deactivate(){this._mouseOffset=void 0}mouseOffset(e,t){return this._mouseOffset??=n(e,t).subtract(this.locator())}moveFromTo(e,t,r,i){const s=this.locator(),o=this.mouseOffset(e,t),a=n(r,i).subtract(o).subtract(s);return this.model().moveBy(a.x(),a.y())}}},11288:(e,t,r)=>{const{Handle:n,FrameAdjusterHandle:i}=r(7340),{Polygon:s,NormalToEdgeLocator:o}=r(62048),{extend:a}=r(50988),l=r(29245),c=r(54896),u=r(84434);class ThunderCloudFrameAdjusterHandle extends i{constructor(e,t){super(void 0,e,t)}figure(){return this._figure}frame(){return this.figure().model()}validWhen(){return n.VALID_FOR_SELECTED}draw(e,t){this._drawHandle(e,this.indicatorProperties(),t)}drawSelected(e,t){this._drawHandle(e,this._selectedProperties(),t)}contains(e,t,r){this._setScale(r);const n=this.object().center(),i=this._offsetFromEdge(),a=this._overallLength(),l=this._arrowWidth()/2;if(new o(n,i+a/2).distanceTo(e,t)>a)return!1;return new s([new o(n,i,l),new o(n,i,-l),new o(n,i+a,-l),new o(n,i+a,l)]).contains(e,t)}snapToGrid(e){}_offsetFromEdge(){return Math.max(this._pixelsToDrawingUnits(4),3)}_arrowLength(){return this._pixelsToDrawingUnits(12)}_arrowWidth(){return this._pixelsToDrawingUnits(16)}_lineLength(){return this._pixelsToDrawingUnits(6)}_overallLength(){return 2*this._arrowLength()+this._lineLength()}_drawHandle(e,t){this._setScaleFromContext(e);const r=this.object().center(),n=new o(r,this._overallLength()+this._offsetFromEdge()),i=new o(r,this._offsetFromEdge()),s=this._arrowLength(),a=this._arrowWidth(),l=new o(r,this._offsetFromEdge()+this._arrowLength()+this._lineLength()/2);e._alterAndRestoreAfter((()=>{Object.assign(e,t),e.lineWidth=this._lineWidth(),e._drawArrow(l.to(n),s,a),e._drawArrow(l.to(i),s,a)}))}_lineWidth(){return this._arrowWidth()/3}_selectedProperties(){return c}indicatorProperties(){return u}}a(ThunderCloudFrameAdjusterHandle,l),e.exports=ThunderCloudFrameAdjusterHandle},89852:(e,t,r)=>{const n=r(17420);e.exports=class ThunderCloudInteriorSnappingFrameAdjusterHandle extends n{_candidateEdgeFilter(e,t){return e.normal().dot(t.normal()).isNearTo(1)}}},73541:(e,t,r)=>{const{LocatorHandle:n,CircleFigure:i}=r(7340),{$P:s}=r(62048),o=r(84434);e.exports=class ThunderCloudMeasurementAnnotationEndpointHandle extends n{model(){return this._figure.annotation()}selectableComponent(){return this.model()}otherEndpoint(){return[this.model().begin(),this.model().end()].filter(Boolean).find((e=>!e.equals(this.object())))}shape(){return this.object().expandedByRadius(5)}contains(e,t){return this.shape().contains(e,t)}moveFromTo(e,t,r,n){const i=this.object();this._offset||(this._offset=s(e,t).subtract(i));const o=s(r,n).subtract(this._offset),a=this._lockToAngle(o),l=this.snappingLocationFor(a);let c=a.subtract(i),u=!1;return l&&l.distanceTo(a)<this.snappingTolerance()?(c=l.subtract(i),i.setSource(l),u=!0):i.setSource(s(0,0)),this.model().setDidSnap(u),this.moveBy(c.x(),c.y())}snappingTolerance(){return 12}snappingLocationFor(e){return(this.shouldSnapAngle()&&this.otherEndpoint()?this._snappingLocationsAlongSameAngle(e):this._snappingLocationsAlongAnyAngle(e)).sort(((t,r)=>t.distanceTo(e)-r.distanceTo(e))).first()}_snappingLocationsAlongSameAngle(e){const t=this.model().componentOf().measurementSnapEdges(),r=this.otherEndpoint().to(e);return t.flatMap((e=>e.intersectionsWithLineIn2D(r).filter((t=>e.xy().containsPoint(t.xy()))).map((t=>e.closestRelativePointTo(t)))))}_snappingLocationsAlongAnyAngle(e){return this.model().componentOf().measurementSnapEdges().map((t=>t.closestRelativePointTo(e)))}shouldSnapAngle(){return this.model().shouldSnapAngle()}angleSnapDirections(){return this.model().angleSnapDirections()}_lockToAngle(e){const t=this.otherEndpoint();if(!this.shouldSnapAngle()||!t)return e;const r=this._nearestValidAngleLockDirection(t.to(e)),n=t.to(t.add(r)),i=n.closestPointTo(e,!0);return n.containsPoint(i)?n.end():i}_nearestValidAngleLockDirection(e){const t=e.direction();return this.angleSnapDirections().reduce(((e,r)=>Math.abs(t.dot(r))>Math.abs(t.dot(e))?r:e))}validWhen(){return this.constructor.VALID_FOR_SELECTED}draw(e,t){this.drawHandle(e,this.indicatorProperties(),t)}drawSelected(e,t){this.drawHandle(e,this._selectedProperties(),t)}drawHandle(e,t,r){const n=new i(this.shape());n.updateProperties(t),n.draw(e,r)}_selectedProperties(){const e="#5bb2e4";return{fillStyle:`${e}4d`,strokeStyle:e,_pixelLineWidth:3}}indicatorProperties(){const e={...o,_pixelLineWidth:3};return e.fillStyle=`${e.fillStyle}4d`,e}}},43416:(e,t,r)=>{const{FreeFloatingDimensionAnnotationHandle:n}=r(7340);e.exports=class AMMeasurementAnnotationHandle extends n{_moveBy(e,t){return this.object().moveBy(e,t)}}},17420:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),s=r(11288);e.exports=class ThunderCloudSnappingFrameAdjusterHandle extends s{edge(){return this.object()}snappingTolerance(){return n.unit(1,"ft")}constrainedMovementAlongNormal(e,t){const r=super.constrainedMovementAlongNormal(e,t),n=this.edge().movedBy(r.x(),r.y()),i=this.offsetForSnap(n);return r.add(i)}offsetForSnap(e){const t=this.frame(),r=this._framesWithParallelEdges(e).filter(t.snapToFramesFilter()).flatMap((t=>this._candidateEdgesForFrame(t,e))).map((t=>this._snapOffsetBetweenEdges(e,t))).filter(Boolean);if(0===r.length)return i(0,0);return r.reduce(((e,t)=>t.r()<e.r()?t:e))}_candidateEdgesForFrame(e,t){const r=this.frame();return(e.snappableEdgesForFrame?.(r)??e.edges()).filter((e=>this._candidateEdgeFilter(t,e)))}_snapOffsetBetweenEdges(e,t){const r=e.closestPointTo(t.center()),n=r.to(r.add(e.normal())),i=t.intersectionsWithLineIn2D(n).first(),s=this.snappingTolerance().toNumeric(this.frame().unit());if(!i)return;if(!t.xy().containsPoint(i.xy()))return;const o=i.subtract(r);return o.r()>s?void 0:o}_framesWithParallelEdges(e){const t=this.frame();return t.project().frames().filter((e=>e!==t)).filter((t=>t.edges().some((t=>e.isParallelTo(t)))))}_candidateEdgeFilter(e,t){return e.normal().dot(t.normal()).isNearTo(-1)}}},47910:(e,t,r)=>{const{ConstructionComponentHandle:n}=r(93613),{PolygonFigure:i}=r(7340),s=r(84434);e.exports=class TopLevelComponentHandle extends n{selectableComponent(){return this.object().model()}_drawHandle(e,t,r){const n=new i(this.object().model().vertices());n.updateProperties(t),n.draw(e,r)}_selectedProperties(){const e="#5bb2e4";return{fillStyle:`${e}4d`,strokeStyle:e,_pixelLineWidth:3}}indicatorProperties(){const e={...s,_pixelLineWidth:3};return e.fillStyle=`${e.fillStyle}4d`,e}}},84434:e=>{const t="#FFD45D";e.exports={fillStyle:t,strokeStyle:t}},54896:e=>{const t="#222E3D";e.exports={fillStyle:t,strokeStyle:t}},9366:(e,t,r)=>{const n=r(45790);e.exports=class AnnotationFigureArrowHelper{static arrowLengthForScale(e,t=13,r=5){return n.positionAlongRange(e,.5,2)*(t-r)+r}}},5834:e=>{const t={aluminum:{strokeStyle:"#5c5c5c",fillStyle:"#aaaaaa",lineWidth:.3},steel:{strokeStyle:"#5c5c5c",fillStyle:"#aaaaaa",lineWidth:.3},"black-plastic":{strokeStyle:"#000000",fillStyle:"#000000"},"white-plastic":{strokeStyle:"#FFFFFF",fillStyle:"#FFFFFF"},"pressure-treated":{strokeStyle:"black",fillStyle:"#f2cca8",lineWidth:.1}},r={strokeStyle:"#FF00FF",fillStyle:"#FF00FF"};e.exports=e=>t[e]??r},29245:e=>{e.exports=class ContextScaling{_scale(){return this._scaleValue??1}_setScale(e){this._scaleValue=e}_setScaleFromContext(e){this._setScale(e.runningScaleX())}_pixelsToDrawingUnits(e){return e/this._scale()}}},89929:(e,t,r)=>{const{simpleObserver:n}=r(50988),i=r(36305),s=r(19075),o=r(59602);class AssetPlacementTool extends i{constructor(e,...t){super(...t),this._componentClass=e}static withBuilder(e,t,...r){const n=new AssetPlacementTool(t,...r);return n._builder=e,n}hideToolPanelDivider(){return!0}category(){return o.editorTool}componentClass(){return this._componentClass}displayName(){return this._displayName??this.builder().displayName?.()??this.componentClass().displayName()}setDisplayName(e){this._displayName=e}iconName(){return this.componentClass().iconName?.()}unplacedComponentFigure(){return this._unplacedComponentFigure}unplacedComponentHandle(){return this._unplacedComponentHandle}unplacedComponent(){return this._unplacedComponent||(this._unplacedComponent=this._createComponent()),this._unplacedComponent}_defaultBuilder(){return this.componentClass().builder(this.project())}builder(){return this._builder||(this._builder=this._defaultBuilder()),this._builder}project(){return this._controller().project()}_createComponent(){const e=this.builder().build();return e.setComponentOf(this.project()),e}activate(){super.activate(),this._unplacedComponentFigure=this.unplacedComponent().defaultFigure(),this._unplacedComponentHandle=this.unplacedComponentFigure().selfHandle(),this._controller().setShapeOnly(!0),this.unplacedComponentHandle().activate(this)}deactivate(){super.deactivate(),this._unplacedComponentFigure=void 0,this._unplacedComponentHandle=void 0,this._unplacedComponent=void 0,this._controller().setShapeOnly(!1),this._controller().draw()}draw(e,t){const r=this.unplacedComponent().zLevel();this.unplacedComponentFigure().draw(e,{...t,zLevel:r})}mouseDown(e,t,r){super.mouseDown(e,t,r),this._lastX=e,this._lastY=t,this._didChange=!1}mouseMove(e,t,r){super.mouseMove(e,t,r),this._move(this.unplacedComponent(),e,t)&&this._controller().draw()}mouseUp(e,t,r){super.mouseUp(e,t,r),this.didPanOrZoom()||(this._place(this.unplacedComponent(),e,t),this._afterAssetPlaced()),this._lastX=void 0,this._lastY=void 0,this._lastMultiTouch=void 0}_afterAssetPlaced(){this.notifySelfDeactivationEventObservers()}_place(e,t,r){this._move(e,t,r),this.unplacedComponentHandle().deactivate(this),this._controller().project().add(e),this._componentAddedToProject(e),this._controller().snapshotProjectAndRedraw(),this._controller().select(e)}_componentAddedToProject(e){}_move(e,t,r){const n=e.locator();return this.unplacedComponentHandle().moveFromTo(n.x(),n.y(),t,r)}_topHandleUnderCursor(e,t,r){}deactivateSelf(){this.deactivate(),this.notifySelfDeactivationEventObservers()}_keyboardShortcuts(){return{...super._keyboardShortcuts(),deactivateSelf:[{keys:"escape"}]}}keyboardShortcutsSlot(){return"AssetPlacementTool"}keyboardShortcutsInfo(){return[{modifiers:[],key:s.specialKeys.ESCAPE,title:"Deactivate Placement"}]}}n(AssetPlacementTool,"selfDeactivationEvent"),e.exports=AssetPlacementTool},19575:(e,t,r)=>{const{ComponentSelectionTool:n}=r(7340),{simpleObserver:i}=r(50988),s=r(19075),o=r(59602);class FramingLevelPlacementTool extends n{constructor(e,...t){super(...t),this._framingLevelClass=e}static withBuilder(e,t,...r){const n=new FramingLevelPlacementTool(t,...r);return n._builder=e,n}category(){return o.editorTool}framingLevelClass(){return this._framingLevelClass}displayName(){return this.framingLevelClass().displayName()}iconName(){return this.framingLevelClass().iconName?.()}project(){return this._controller().project()}_createFramingLevel(e){const t=this.framingLevelClass().for(e);return t.setComponentOf(e),t}activate(){super.activate(),this._controller().layerManager().show("Roofing"),this._controller().draw()}mouseDrag(e,t,r={}){this.panZoomTool().mouseDrag(e,t,r),this.activeHandle()&&this.didPanOrZoom()&&(this._deactivateHandle(),this._activeHandle=void 0,this._controller().draw())}mouseUp(e,t,r){if(this.panZoomTool().mouseUp(e,t,r),this.isMouseButtonInUse(this.mouseButtonToActivate(),r)||this._isTouchEvent(r.event)&&!this.didPanOrZoom()){const r=this.activeHandle();if(r){this._deactivateHandle();const n=r.selectableComponent();0===n.framingLevels().length&&(this._placeFramingLevelOn(n,e,t),this._afterPlaced())}}this._lastX=void 0,this._lastY=void 0,this._lastMultiTouch=void 0,this._activeHandle=void 0}_afterPlaced(){this.notifySelfDeactivationEventObservers()}_placeFramingLevelOn(e,t,r){const n=this._createFramingLevel(e);e.addFramingLevel(n),this._controller().snapshotProjectAndRedraw(),this._controller().select(n)}_topHandleUnderCursor(e,t,r){const n=this._controller().drawing();return this.project().framingLevelFoundations().map((e=>n.figureFor(e))).map((e=>e.selfHandle())).fastFilter((n=>n.contains(e,t,r))).shift()}deactivateSelf(){this.deactivate(),this.notifySelfDeactivationEventObservers()}_keyboardShortcuts(){return{...super._keyboardShortcuts(),deactivateSelf:[{keys:"escape"}]}}keyboardShortcutsSlot(){return"FramingLevelPlacementTool"}keyboardShortcutsInfo(){return[{modifiers:[],key:s.specialKeys.ESCAPE,title:"Deactivate Placement"}]}}i(FramingLevelPlacementTool,"selfDeactivationEvent"),e.exports=FramingLevelPlacementTool},21437:(e,t,r)=>{const{ComponentSelectionTool:n,Handle:i}=r(7340),{$P:s}=r(62048),o=r(14025),a=r(10590),l=r(59602);e.exports=class OpeningPlacementTool extends n{iconName(){return"default-opening"}displayName(){return"Opening"}category(){return l.editorTool}openingType(){return this._openingType??o}setOpeningType(e){this._openingType=e}_allHandlesUnderCursor(e,t,r){const n=[i.VALID_FOR_HOVER,i.VALID_FOR_SELECTED];return super._allHandlesUnderCursor(e,t,r,n).filter((e=>e.object()instanceof a))}_topHandleOfSelectedComponent(){}mouseDown(e,t,r={}){this.panZoomTool().mouseDown(e,t,r)}mouseUp(e,t,r={}){if(this.panZoomTool().mouseUp(e,t,r),this.didPan())return;const n=this.hoveredHandle()?.object(),i=n?.run?.();if(!i)return;const o=i.edge().closestPointTo(s(e,t)),a=i.edge().direction(),l=this.openingType().defaultWidth(),c=this.openingType().fromLocator(o,a,l);i.addOpening(c)&&(this._controller().select(c),this._controller().snapshotProjectAndRedraw())}}},63002:(e,t,r)=>{const{ComponentSelectionTool:n,Handle:i}=r(7340),{extend:s}=r(50988),o=r(59602),a=r(31851);class ThunderCloudComponentSelectionTool extends n{iconName(){return"select"}category(){return o.default}drawShapeOnly(){return!0}mouseDrag(...e){this._controller().setShapeOnly(this.drawShapeOnly()),this.autoScrollCanvas(),super.mouseDrag(...e)}mouseUp(...e){this._controller().setShapeOnly(!1),this._controller().draw(),super.mouseUp(...e)}project(){return this._controller().project()}drawing(){return this._drawing()}autoScrollCanvas(){if(!this.activeHandle())return;const e=this.activeHandle().locator?.();e&&this._controller().autoScrollCanvas?.(e)}setCursor(e){e?this._controller().setCursor(e):this._controller().setDefaultCursor()}_topHandleOfSelectedComponent(e,t,r){const n=this._controller().selection();if(n&&!this._modifyingCurrentSelection()){const s=[i.VALID_FOR_HOVER,i.VALID_FOR_SELECTED],o=this._controller().handleOptions(r,s);return(n.handlesAt(e,t,o)||[]).shift()}}addKeyboardShortcuts(e,t){this._controller().shortcutManager().registerShortcuts(e,t)}removeKeyboardShortcuts(e,t){this._controller().shortcutManager().unregisterShortcuts(e,t)}}s(ThunderCloudComponentSelectionTool,a),e.exports=ThunderCloudComponentSelectionTool},63197:(e,t,r)=>{const{simpleObserver:n}=r(50988),{$P:i}=r(62048),s=r(36305),o=r(56768),a=r(19075);class ThunderCloudMeasurementTool extends s{displayName(){return"Measure"}iconName(){return"straighten"}_activeCursor(){return"crosshair"}project(){return this._controller().project()}activate(){super.activate(),this._controller().setCursor(this._activeCursor()),this._controller().clearSelection(),this._unplacedAnnotationFigure=this.unplacedAnnotation().defaultFigure(),this._controller().setShapeOnly(!0)}deactivate(){super.deactivate(),this._unplacedAnnotation=void 0,this._unplacedAnnotationFigure=void 0,this._controller().setCursor(void 0),this._controller().setShapeOnly(!1),this._controller().draw()}toggleAngleSnapping(){this.unplacedAnnotation().toggleShouldSnapAngle()}_resetState(){this._unplacedAnnotation=void 0,this._unplacedAnnotationFigure=this.unplacedAnnotation().defaultFigure()}unplacedAnnotation(){return this._unplacedAnnotation||(this._unplacedAnnotation=this._defaultUnplacedAnnotation()),this._unplacedAnnotation}_defaultUnplacedAnnotation(){const e=new o(i(0,0),this.project().unit(),this.formatter());return e.setComponentOf(this.project()),e}unplacedAnnotationFigure(){return this._unplacedAnnotationFigure}async mouseUp(e,t,r={}){await super.mouseUp(e,t,r),!this.didPanOrZoom()&&this.isClick()&&(this._moveEndpointTo(e,t),this.unplacedAnnotation().end()?(this.project().add(this.unplacedAnnotation()),await this._controller().snapshotProjectAndRedraw(),this._resetState()):this.unplacedAnnotation().setEnd(i(e,t)))}mouseMove(e,t,r){super.mouseMove(e,t,r),this.didPanOrZoom()||this._moveEndpointTo(e,t)&&this._controller().draw()}isClick(){return!this.panTool().didDrag()}_moveEndpointTo(e,t){const r=this.unplacedAnnotation().currentEnd();return this.unplacedAnnotationFigure().handleForEndpoint(r).moveFromTo(r.x(),r.y(),e,t)}draw(e,t){this.unplacedAnnotationFigure().draw(e,t)}deactivateSelf(){this.deactivate(),this.notifySelfDeactivationEventObservers()}_keyboardShortcuts(){return{...super._keyboardShortcuts(),deactivateSelf:[{keys:"escape"}]}}keyboardShortcutsSlot(){return"ThunderCloudMeasurementTool"}keyboardShortcutsInfo(){return[{modifiers:[],key:a.specialKeys.ESCAPE,title:"Deactivate Measurement"}]}formatter(){return this._formatter}setFormatter(e){this._formatter=e}hideToolPanelDivider(){return!0}}n(ThunderCloudMeasurementTool,"selfDeactivationEvent"),e.exports=ThunderCloudMeasurementTool},36305:(e,t,r)=>{const{CompositePanZoomTool:n}=r(7340),{extend:i}=r(50988),s=r(31851);class ThunderCloudTool extends n{guideAnnotations(){return[]}drawGuideAnnotations(e,t){this.guideAnnotations().forEach((r=>{r.defaultFigure().draw(e,t)}))}draw(e,t){super.draw(e,t),this.drawGuideAnnotations(e,t)}}i(ThunderCloudTool,s),e.exports=ThunderCloudTool},31851:(e,t,r)=>{const{simpleObserver:n}=r(50988);class ToolContextMessageMixin{static toolPanelClassName(){return"ToolContextMessagePanel"}contextMessage(){return this._contextMessage??=this._defaultContextMessage()}_defaultContextMessage(){}setContextMessage(e){this._contextMessage=e,this.notifyToolContextMessageChangedObservers()}resetContextMessage(){this._contextMessage=void 0,this.notifyToolContextMessageChangedObservers()}}n(ToolContextMessageMixin,"toolContextMessageChanged"),e.exports=ToolContextMessageMixin},59602:e=>{e.exports=Object.freeze({default:"default",editorTool:"editor-tool",accessory:"accessory"})},74716:(e,t,r)=>{const{three:n}=r(37732),i=r(53558);e.exports=class CubicBezierExtrusion3DFigure extends i{extrudePath(){return new n.CubicBezierCurve3(this.normalizeLocator(this.model().locator()),this.normalizeLocator(this.model().controlPoint1()),this.normalizeLocator(this.model().controlPoint2()),this.normalizeLocator(this.model().endLocator()))}normalizeLocator(e){const t=e.subtract(this.model().locator());return new n.Vector3(this.xAxis().dot(t),this.yAxis().dot(t),this.zAxis().dot(t))}stepCount(){return 100}}},53558:(e,t,r)=>{const{three:n}=r(37732),i=r(39064),s=r(15004);e.exports=class ExtrusionMaterial3DFigure extends s{hasPlanar(){return Boolean(this.model().planarNormal())}xAxis(){return this.hasPlanar()?this.model().planarNormal().negated():this.yAxis().cross(this.zAxis())}yAxis(){return this.hasPlanar()?this.zAxis().cross(this.xAxis()):this.model().extrusionEdge().normal()}zAxis(){return this.model().extrusionEdge().direction()}extrudePath(){const e=this.model().extrusionEdge();return new i(new n.Vector3(0,0,0),new n.Vector3(0,0,e.length()),this.beginMiterVector(),this.endMiterVector())}beginMiterVector(){return this._projectLCADToThreeJS(this.model().beginMiterDirection())}endMiterVector(){return this._projectLCADToThreeJS(this.model().endMiterDirection())}_projectLCADToThreeJS(e){return new n.Vector3(this.xAxis().dot(e),this.yAxis().dot(e),this.zAxis().dot(e))}stepCount(){return 1}threeGeometry(){const e=this.model().crossSection().toThreeJS(),t=new n.ExtrudeGeometry(e,{curveSegments:30,steps:this.stepCount(),bevelEnabled:!1,extrudePath:this.extrudePath()}),r=this.xAxis(),i=this.yAxis(),s=this.zAxis(),o=(new n.Matrix3).set(r.x(),i.x(),s.x(),r.y(),i.y(),s.y(),r.z(),i.z(),s.z()),a=(new n.Matrix4).setFromMatrix3(o),l=this.model().extrusionEdge().begin(),c=(new n.Matrix4).makeTranslation(l.x(),l.y(),l.z());return t.applyMatrix4(a.premultiply(c)),t.computeVertexNormals(),t.computeBoundsTree(),t}}},48661:(e,t,r)=>{const{StaticFigureStrategy:n}=r(7340),{Composite3DFigure:i,three:s}=r(37732),o=r(28400);e.exports=class GroupedComposite3DFigure extends i{constructor(e){super(),this.setModel(e)}removeFromScene(e){const t=this.group();this.figures().forEach((e=>{e.removeFromScene(t)})),e.remove(t)}addToScene(e){this.resetGroup(),e.add(this.group()),this.update()}resetGroup(){this._group=void 0}group(){return this._group||(this._group=this._defaultGroup()),this._group}_defaultGroup(){const e=new s.Group;return e.figure=this,this.figures().forEach((t=>{t.addToScene(e)})),e}update(e){this.group().visible=this.layerVisible(e),super.update(e)}_defaultStrategy(){return this.model()?new o(this):new n}}},28400:(e,t,r)=>{const{CompositeModel3DStrategy:n}=r(37732);e.exports=class GroupedComposite3DFigureStrategy extends n{updateFigures(){const e=this.model().components();this._removeDeadFigures(e),this.figures().forEach((e=>e.updateFigures())),this._addMissingFigures(e),this.compositeFigure().updateAnnotationFigures(),this.compositeFigure().update()}_removeDeadFigures(e){this._deadFigures(e).forEach((e=>this._removeFigure(e)))}_removeFigure(e){const t=this.figures().indexOf(e);if(t>-1&&(this.figures().splice(t,1),e.stopObserving&&e.stopObserving(),e.removeFromScene)){const t=this.compositeFigure().group();e.removeFromScene(t)}}_addMissingFigures(e){const t=this.figures().map((e=>e.model())),r=this.compositeFigure().group();e.forEach((e=>{if(t.includes(e))return;const n=this._componentRenderer(e);n.addToScene(r),this.compositeFigure().add(n)}))}}},72496:(e,t,r)=>{const{three:n}=r(37732),i=r(15004);e.exports=class MiterExtrusion3DFigure extends i{extrudePath(){return this.model().extrusionPath()}threeGeometry(){const e=this.model().crossSection().toThreeJS(),t=this.extrudePath(),r=this.model().pathSteps?.()??t.points.length-1,i=new n.ExtrudeGeometry(e,{curveSegments:30,steps:r,bevelEnabled:!1,extrudePath:t});return i.computeVertexNormals(),i.computeBoundsTree(),this._generateUVCoordinates(i),i}_generateUVCoordinates(e){const t=this.extrudePath(),r=this.model().pathSteps?.()??t.points.length-1,i=t.getPoints(r),s=t.getLengths(r),o=e.getAttribute("uv"),a=new n.Vector3(0,0,-1);this._eachFace(e,((e,t,r,l)=>{let c=[t,r,l];Math.abs(e.normal.z).isNearTo(1)||(c=c.map((e=>{const t=i.findSmallest((t=>t.distanceTo(e))),r=i.indexOf(t);return new n.Vector2(s[r],a.dot(e))}))),o.setXY(e.a,c[0].x,c[0].y),o.setXY(e.b,c[1].x,c[1].y),o.setXY(e.c,c[2].x,c[2].y)}))}_eachFace(e,t){const r=e.getAttribute("position"),i=new n.Vector3,s=new n.Vector3,o=new n.Vector3,a=new n.Vector3;for(let e=0;e<r.count;e+=3){const l={a:e,b:e+1,c:e+2,normal:new n.Vector3};i.fromBufferAttribute(r,l.a),s.fromBufferAttribute(r,l.b),o.fromBufferAttribute(r,l.c),l.normal.subVectors(o,s).cross(a.subVectors(i,s)).normalize(),t(l,i,s,o)}}}},19532:(e,t,r)=>{const{Drawable3D:n}=r(37732),{Cube:i}=r(62048);e.exports=class NullDrawable3D extends n{constructor(e){super(),this.setModel(e)}addToScene(e){}removeFromScene(e){}boundingCube(){const e=this.model().referencePoint();return new i(e.x(),e.y(),e.z(),0,0,0)}}},54607:(e,t,r)=>{const{three:n}=r(37732),i=r(39238);e.exports=class PlanBackground3DFigure extends i{threeGeometry(){return this._threeGeometry||(this._threeGeometry=new n.PlaneGeometry(1,1,1,1)),this._threeGeometry}_threeMeshFigure(){const e=new n.Mesh(this.threeGeometry());return this.updateMaterial(e),e.figure=this,this._mesh=e,e.renderOrder=100,this._setMeshTransform(e),e}_materials(){return this.__materials||(this.__materials=new n.MeshBasicMaterial({map:new n.CanvasTexture(this.model().fullSize()),depthWrite:!1})),this.__materials}_setMeshTransform(e=this.mesh()){const t=this.model().geometry();e.position.set(t.center().x(),t.center().y(),0),e.quaternion.setFromAxisAngle(new n.Vector3(1,0,0),Math.PI),e.scale.set(t.width(),t.height(),1)}}},39644:(e,t,r)=>{const{three:n}=r(37732),i=r(15004);e.exports=class Rail3DFigure extends i{materialNames(){return this.model().materialNames?.()||["aluminum"]}threeGeometry(){const e=this.model(),t=e.edge().begin().toThreeJS(),r=e.edge().end().toThreeJS(),i=e.crossSection().vertices().map((e=>e.toThreeJS())),s=t.z.isNearTo(r.z)?Math.PI_2:Math.PI,o=(new n.Quaternion).setFromAxisAngle(new n.Vector3(0,0,1),s);i.forEach((e=>e.applyQuaternion(o)));const a=new n.Shape(i),l=new n.LineCurve3(t,r),c=new n.ExtrudeGeometry(a,{extrudePath:l});return c.computeVertexNormals(),c.computeBoundsTree(),c}}},51432:(e,t,r)=>{const{three:n}=r(37732),{$P:i}=r(62048),s=r(74716),o=new n.Vector3;e.exports=class Rope3DFigure extends s{threeGeometry(){const e=super.threeGeometry();return this._generateUVCoordinates(e),e}_generateUVCoordinates(e){const t=this._mainAxis(),r=this.model().primaryDirection().rotatedBy(i(0,0,0),Math.PI_2).toThreeJS(),s=r.clone().cross(t),o=e.getAttribute("position"),a=e.getAttribute("uv"),l=e.index.array,c=new n.Vector3,u=this.model().locator().toThreeJS();for(let e=0;e<l.length;e++)c.fromBufferAttribute(o,l[e]),a.setXY(l[e],...this.uvCoordinateFor(c,u,t,r,s))}uvCoordinateFor(e,t,r,n,s){const a=o.subVectors(e,t).dot(r),l=this.curve().getPoint(a/this.length());o.subVectors(e,l).normalize();const c=i(o.dot(s),o.dot(n)).theta(),u=this.model().componentOf().radius().toNumeric(this.model().unit()),d=(c+Math.PI)/Math.TWO_PI;return[a/(u*Math.TWO_PI),d]}curve(){return this._curve??=new n.CubicBezierCurve3(this.model().locator().toThreeJS(),this.model().controlPoint1().toThreeJS(),this.model().controlPoint2().toThreeJS(),this.model().endLocator().toThreeJS())}length(){return this._length??=this.model().edge().length()}materialNames(){return this.model().materialNames()}}},3611:(e,t,r)=>{const{Drawing3D:n}=r(37732),{Cube:i}=r(62048);e.exports=class ThunderCloudDrawing3D extends n{boundingCube(){return i.mergedFiniteCubes(this.model().parts())}}},15004:(e,t,r)=>{const{Shape3DFigure:n}=r(37732);e.exports=class ThunderCloudShape3DFigure extends n{constructor(e){super(),this.setModel(e)}_materials(){const e=super._materials(),t=Array.isArray(e)?e:[e],r=this._recoloredMaterials(t);return 1===r.length?r.first():r}_recoloredMaterials(e){const t=this.model().color3D?.()||this.model().color?.();return t?e.map((e=>{const r=e.clone();return r.color.set(t),r})):e}layer(){return this._layer}shape3D(){return this.model().shape3D()}materialNames(){return this.model().materialNames?.()??[]}addToScene(e){e.add(this._threeMeshFigure())}update(e){this.mesh().visible=this.layerVisible(e),super.update(e)}applyLayerMapping(){}}},39238:(e,t,r)=>{const{ThreeGeometryFigure:n}=r(37732);e.exports=class ThunderCloudThreeGeometryFigure extends n{constructor(e,t){super(e),this._materialIdentifiers=t}materialNames(){return this._materialIdentifiers??this.model().materialIdentifiers()}_setMeshTransform(e=this.mesh()){if(super._setMeshTransform(e),this.model().locator){const t=this.model().locator();e.position.set(t.x(),t.y(),t.z())}e.updateMatrixWorld()}}},13584:(e,t,r)=>{const{registerStandardMaterial:n}=r(2454),i=r(94111);n("concrete",{textureMaps:[i.color,i.normal,i.roughness],textureFolder:"concrete-textures",textureRepeatX:.01,textureRepeatY:.01})},63017:(e,t,r)=>{const{registerStandardMaterial:n}=r(2454),i={namePrefix:"debug-",metalness:0,roughness:1};n("red",{color:"#FF0000",...i}),n("green",{color:"#00FF00",...i}),n("blue",{color:"#0000FF",...i})},41046:(e,t,r)=>{const{registerStandardMaterial:n}=r(2454),i=r(94111);n("composite-decking",{textureMaps:[i.color,i.normal,i.roughness],textureFolder:"composite-decking-textures",textureRepeatX:.025,textureRepeatY:.18})},25632:(e,t,r)=>{const{ThreeMaterialLibrary:n}=r(37732);n.instance().register("fiberon",(e=>n.instance().lookupMaterial("weardeck")))},45915:(e,t,r)=>{const{registerStandardMaterial:n}=r(2454),i=r(94111);n("ipe",{textureMaps:[i.color,i.normal,i.roughness],textureFolder:"ipe-textures",textureRepeatX:.02,textureRepeatY:.02})},14668:(e,t,r)=>{const{registerStandardMaterial:n}=r(2454);n("lumberrock",{textureMaps:[r(94111).normal],textureFolder:"lumber-rock-textures",textureRepeatX:.08,textureRepeatY:.08})},58432:(e,t,r)=>{const{registerStandardMaterial:n}=r(2454),i=r(94111),s=[i.normal,i.roughness],o={textureFolder:"pressure-treated-textures",textureRepeatX:.05,textureRepeatY:.05};n("pressure-treated",{textureMaps:[...s,i.color],...o}),n("painted-pressure-treated",{textureMaps:[...s],...o})},68057:(e,t,r)=>{const{registerStandardMaterial:n}=r(2454),i=r(94111);n("weardeck",{textureMaps:[i.color,i.normal,i.roughness],textureFolder:"weardeck-textures",textureRepeatX:.025,textureRepeatY:.18})},49653:(e,t,r)=>{const{ThreeMaterialLibrary:n}=r(37732);n.instance().register("fixed-dock",(()=>{const e=n.instance().lookupMaterial("pressure-treated").clone();return e.opacity=.8,e}))},707:(e,t,r)=>{const{registerPhysicalMaterial:n}=r(2454);n("glass",{metalness:0,roughness:0,transmission:.4,transparent:!0})},65601:(e,t,r)=>{const{registerStandardMaterial:n}=r(2454);n("aluminum",{metalness:.6,roughness:.15})},15122:(e,t,r)=>{const{registerStandardMaterial:n}=r(2454),i=r(94111),s={transparent:!0,textureFolder:"aluminum-walkway-mesh-textures",textureRepeatX:.05,textureRepeatY:.05},o=[i.normal,i.alpha,i.roughness];n("aluminum-walkway-mesh",{...s,textureMaps:[i.color,...o]}),n("painted-aluminum-walkway-mesh",{...s,textureMaps:o})},5916:(e,t,r)=>{const{registerStandardMaterial:n}=r(2454),i=r(94111),s={namePrefix:"metallic-mesh-",nameSuffix:"-low-gloss",metalness:.9,roughness:.8,transparent:!0,textureMaps:[i.normal,i.alpha],textureFolder:"aluminum-walkway-mesh-textures",textureRepeatX:.05,textureRepeatY:.05};n("beige",{color:"#e8d1a5",...s}),n("light-grey",{color:"#cdd1d1",...s})},97926:(e,t,r)=>{const{registerStandardMaterial:n}=r(2454),i={namePrefix:"metallic-",nameSuffix:"-low-gloss",metalness:.9,roughness:.8};n("beige",{color:"#e8d1a5",...i}),n("black",{color:"#0f0f0f",...i}),n("grey",{color:"#7c8080",...i}),n("light-grey",{color:"#cdd1d1",...i}),n("white",{color:"#d7d9d0",...i}),n("brass",{color:"#D9AC41",...i,roughness:.6}),n("bronze",{color:"#302214",...i,metalness:.4,roughness:.6}),n("tan",{color:"#9c8773",...i,metalness:.4,roughness:.6}),n("yellow",{color:"#dc9300",...i,metalness:1,roughness:.75})},91139:(e,t,r)=>{const{registerPhysicalMaterial:n}=r(2454);n("safety-red",{clearcoat:.8,metalness:1,roughness:.15,color:"#FF0000"})},97360:(e,t,r)=>{const{registerStandardMaterial:n}=r(2454);n("steel",{metalness:.45,roughness:.3,color:"#828282"})},57475:(e,t,r)=>{const{registerStandardMaterial:n}=r(2454),i=r(94111);n("grass",{textureMaps:[i.color,i.normal,i.roughness],textureFolder:"grass-textures",textureRepeatX:.04,textureRepeatY:.04})},98994:(e,t,r)=>{const{registerStandardMaterial:n}=r(2454),i=r(94111);n("ground",{textureMaps:[i.color,i.normal,i.roughness],textureFolder:"ground-textures",textureRepeatX:.01,textureRepeatY:.01})},19512:(e,t,r)=>{const{registerStandardMaterial:n}=r(2454);n("underground",{metalness:0,roughness:1,color:"#0e0701"})},73932:(e,t,r)=>{const{registerStandardMaterial:n}=r(2454),i={metalness:0,roughness:.9};n("black-plastic",{color:"#000000",...i}),n("white-plastic",{color:"#EEEEEE",...i})},58152:(e,t,r)=>{const{registerStandardMaterial:n}=r(2454),i={namePrefix:"plastic-",metalness:0,roughness:.9};n("plastic",{metalness:0,roughness:.9}),n("light-grey",{color:"#858a8a",...i}),n("beige",{color:"#97825c",...i}),n("blue",{color:"#06112e",...i})},2454:(e,t,r)=>{const{ThreeMaterialLibrary:n,three:i}=r(37732);function s(e,t,n,s=1,o=1){if(!n)return{};return t.reduce(((t,a)=>{const l=e.load(function(t){return e.loadArg?.(`./textures/${n}/${t.image}.jpg`)||r(75247)(`./${n}/${t.image}.jpg`)}(a));return l.wrapS=i.RepeatWrapping,l.wrapT=i.RepeatWrapping,l.repeat.set(s,o),t[a.map]=l,t}),{})}function o(e,t,{namePrefix:r="",nameSuffix:i="",textureMaps:o={},textureRepeatX:a,textureRepeatY:l,textureFolder:c,...u}={}){const d=r+e+i;n.instance().register(d,(e=>{const r=s(e,o,c,a,l);return new t({...r,...u})}))}e.exports={registerStandardMaterial:function(e,t={}){o(e,i.MeshStandardMaterial,t)},registerPhysicalMaterial:function(e,t={}){o(e,i.MeshPhysicalMaterial,t)}}},89580:(e,t,r)=>{const{registerStandardMaterial:n}=r(2454),i=r(94111);n("metal-roof",{textureMaps:[i.color,i.normal,i.roughness,i.metalness],textureFolder:"metal-roof-textures",textureRepeatX:.025,textureRepeatY:.025})},52556:(e,t,r)=>{const{registerStandardMaterial:n}=r(2454),i=r(94111);n("shingle",{textureMaps:[i.color,i.displacement,i.normal,i.roughness],textureFolder:"shingle-textures",textureRepeatX:.01,textureRepeatY:.01})},24107:(e,t,r)=>{const{registerStandardMaterial:n}=r(2454),i=r(94111);n("rope",{textureMaps:[i.color,i.normal,i.roughness],textureFolder:"rope-textures",textureRepeatX:2,textureRepeatY:2})},86379:(e,t,r)=>{const{three:n}=r(37732),{registerStandardMaterial:i}=r(2454),s={namePrefix:"falcon-",metalness:.9,roughness:.8},o={textureMaps:[r(94111).normal],textureFolder:"falcon-textures",textureRepeatX:.2,textureRepeatY:.2};i("black",{color:"#0f0f0f",...s}),i("bronze-c34",{color:"#3F392B",...s,metalness:.7,roughness:.6,normalScale:new n.Vector2(.07,.07),...o}),i("brown-c33",{color:"#615138",...s,metalness:.6,normalScale:new n.Vector2(.1,.1),...o}),i("nu-sparkle",{color:"#babebf",...s,metalness:.6,roughness:.15,normalScale:new n.Vector2(.2,.2),...o}),i("rideau-brown",{color:"#3F382D",...s}),i("silver",{color:"#b0b4b5",...s,metalness:.8,roughness:.3,normalScale:new n.Vector2(.02,.02),...o}),i("taupe",{color:"#483C32",...s,metalness:.6}),i("white",{color:"#e8ebeb",...s,metalness:.1})},4954:(e,t,r)=>{const{registerStandardMaterial:n}=r(2454),i={namePrefix:"hollaender-",roughness:.6,metalness:.3};n("black",{color:"#0d0d0d",...i}),n("bronze",{color:"#755334",...i}),n("safety-yellow",{color:"#eed202",...i}),n("white",{color:"#f7f9eF",...i})},7589:(e,t,r)=>{const{registerPhysicalMaterial:n,registerStandardMaterial:i}=r(2454),s={namePrefix:"omega-",clearcoat:.3,metalness:.2,roughness:.7};n("yellow",{color:"#FF9A00",...s}),n("bright-safety-yellow",{color:"#FCD408",...s}),i("omega-post-cap-black",{color:"#080808",roughness:1})},94111:e=>{e.exports={color:{map:"map",image:"color"},displacement:{map:"displacementMap",image:"displacement"},normal:{map:"normalMap",image:"normal"},roughness:{map:"roughnessMap",image:"roughness"},metalness:{map:"metalnessMap",image:"metalness"},alpha:{map:"alphaMap",image:"opacity"}}},72349:(e,t,r)=>{const{Tool3D:n,three:i}=r(37732),{simpleObserver:s}=r(50988),o=r(49410);class ARAlignmentTool extends n{displayName(){return"Set Alignment"}get referenceSpace(){return this._controller().renderer().xr.getReferenceSpace()}activate(){this.resetAligment(),this._controller().scene().add(this.reticle()),this._controller().scene().add(this.alignmentArrowHead()),this._controller().scene().add(this.alignmentArrowLine())}deactivate(){this._controller().scene().remove(this.reticle()),this._controller().scene().remove(this.alignmentArrowHead()),this._controller().scene().remove(this.alignmentArrowLine()),this._hitTestSource?.cancel(),this._hitTestSource=void 0,this._hitTestSourceRequested=!1}update(){}viewMove(e){if(this._hitTestSource||this._getHitTestSource(e.session),this._hitTestSource){const t=e.getHitTestResults(this._hitTestSource);this._updateCursor(t,this.referenceSpace,e)}}select(e){if(!this._origin())return this._setOrigin();this._setRotation(),this._placeScene(e),this.notifySelfDeactivationEventObservers()}reticle(){return this._reticle??=this._defaultReticle()}_defaultReticle(){const e=new i.MeshBasicMaterial({depthTest:!1}),t=o.mergeGeometries([new i.RingGeometry(.07,.08,32).rotateX(-Math.PI/2).rotateY(Math.PI_2),new i.CircleGeometry(.01,16).rotateX(-Math.PI/2).rotateY(Math.PI_2)]),r=new i.Mesh(t,e);return r.matrixAutoUpdate=!1,r.visible=!1,r.renderOrder=2,r}alignmentArrowHead(){return this._alignmentArrowHead??=this._defaultAlignmentArrowHead()}alignmentArrowLine(){return this._alignmentArrowLine??=this._defaultAlignmentArrowLine()}_defaultAlignmentArrowLine(){const e=this.arrowLineWidth(),t=new i.PlaneGeometry(e,1).rotateX(-Math.PI/2).rotateY(Math.PI_2).translate(.5,0,0),r=new i.Mesh(t,new i.MeshBasicMaterial({depthTest:!1}));return r.matrixAutoUpdate=!1,r.visible=!1,r.renderOrder=2,r}arrowLineWidth(){return.02}_defaultAlignmentArrowHead(){const e=this.arrowLineWidth(),t=new i.CircleGeometry(e,32).rotateX(-Math.PI/2).rotateY(Math.PI_2),r=new i.Mesh(t,new i.MeshBasicMaterial({depthTest:!1}));return r.matrixAutoUpdate=!1,r.visible=!1,r.renderOrder=2,r}_updateCursor(e,t,r){this._origin()?(this._showReticleAtOrigin(),this._updateArrowFromHitTest(e,t)):this._updateReticleFromHitTest(e,t,r)}_showReticleAtOrigin(){const e=this.reticle();e.visible=!0,e.material.color.set("#00ff00"),e.position.copy(this._origin())}_updateReticleFromHitTest(e,t,r){const n=this.reticle();if(this.alignmentArrowHead().visible=!1,this.alignmentArrowLine().visible=!1,e.length>0){const s=e[0].getPose(t).transform,o=r.getViewerPose(t).views[0].transform,a=(new i.Quaternion).copy(o.orientation),l=new i.Vector3(1,0,0).applyQuaternion(a);l.y=0,l.normalize(),n.visible=!0,n.material.color.set("#ffffff"),n.position.set(s.position.x,s.position.y,s.position.z),n.quaternion.setFromUnitVectors(new i.Vector3(1,0,0),l),n.updateMatrix()}else n.visible=!1}_updateArrowFromHitTest(e,t){const r=this.alignmentArrowLine(),n=this.alignmentArrowHead();if(e.length>0){const s=e[0].getPose(t).transform,o=new i.Vector3(s.position.x,s.position.y,s.position.z).sub(this._origin()),a=o.length();o.y=0,o.normalize(),r.visible=!0,r.position.copy(this._origin()),r.quaternion.setFromUnitVectors(new i.Vector3(1,0,0),o),r.scale.set(a,1,1),n.visible=!0,n.position.set(s.position.x,s.position.y,s.position.z),n.quaternion.setFromUnitVectors(new i.Vector3(1,0,0),o),r.updateMatrix(),n.updateMatrix()}else r.visible=!1,n.visible=!1}resetAligment(){this.__origin=void 0,this.__rotation=void 0}_origin(){return this.__origin}_setOrigin(){this.reticle().visible&&(this.__origin=(new i.Vector3).setFromMatrixPosition(this.reticle().matrix))}_rotation(){return this.__rotation}_setRotation(){this.alignmentArrowHead().visible&&(this.__rotation=(new i.Quaternion).setFromRotationMatrix(this.alignmentArrowHead().matrix))}_placeScene(e){if(!this.reticle().visible)return;const t=this._origin().clone(),r=this._rotation().clone(),n=this._controller().project().xrOrigin().toThreeJS(),s=this._controller().project().xrDirection().theta();n.applyQuaternion(this._controller().yUpRotation());const o=(new i.Quaternion).setFromAxisAngle(new i.Vector3(0,1,0),s);r.premultiply(o),n.applyQuaternion(r),n.multiplyScalar(this._controller().xrScale()),t.sub(n),this._controller().xrScene().parent.quaternion.copy(r),this._controller().xrScene().parent.position.copy(t),this._controller().xrScene().visible=!0,this._controller().anchorScene(e,t,r)}_alignScene(){}async _getHitTestSource(e){if(this._hitTestSourceRequested)return;this._hitTestSourceRequested=!0;const t=await e.requestReferenceSpace("viewer");this._hitTestSource=await e.requestHitTestSource({space:t})}}s(ARAlignmentTool,"selfDeactivationEvent"),e.exports=ARAlignmentTool},24897:(e,t,r)=>{const{simpleObserver:n}=r(50988);class AutosaveController{constructor(e){this._projectRepository=e,this.debounceMs=5e3,this.maxWaitMs=3e4}get debounceMs(){return this._debounceTime}set debounceMs(e){this._debounceTime=e}get maxWaitMs(){return this._maxWait}set maxWaitMs(e){this._maxWait=e}start(){this.projectRepository().project().addCurrentVersionChangedObserver(this,this.requestAutosave)}projectRepository(){return this._projectRepository}requestAutosave(){void 0!==this._debounceTimeoutId&&clearTimeout(this._debounceTimeoutId),this._debounceTimeoutId=setTimeout((()=>this._performSave()),this.debounceMs),void 0===this._maxWaitTimeoutId&&(this._maxWaitTimeoutId=setTimeout((()=>this._performSave()),this.maxWaitMs))}cancelAutosave(){this._cancelTimers()}async _performSave(){try{this.projectRepository().project().externalId()&&(await this.projectRepository().updateOnServer(),await this.notifyConnectionStatusObservers(!0))}catch(e){e.status&&e.status>500?this.notifyConnectionStatusObservers(!1):console.log(`Autosave failed for project ${this.projectRepository().projectId()}`,e)}finally{this._cancelTimers()}}_cancelTimers(){clearTimeout(this._debounceTimeoutId),clearTimeout(this._maxWaitTimeoutId),this._debounceTimeoutId=void 0,this._maxWaitTimeoutId=void 0}}n(AutosaveController,"connectionStatus"),e.exports=AutosaveController},10880:(e,t,r)=>{const{DrawingController:n}=r(7340),{$P:i}=r(62048);e.exports=class CrossSectionDrawingController extends n{_getCoordinatesFromEvent(e){const t=e.clientX,r=e.clientY;return i(t,r)}}},68041:(e,t,r)=>{const{ComponentSelectionTool:n,Tool:i}=r(7340),{$P:s,ProportionalEdgeLocator:o,NormalToEdgeLocator:a}=r(62048),l=r(23202),c=r(1487),u={line:"line",curve:"curve"};e.exports=class CrossSectionTool extends n{constructor(e,t,r){super(e,t),this.setPanTool(new i(e,t)),this.setZoomTool(new i(e,t)),this._crossSection=r,this.crossSection().pathSegments().length>0&&(this._finished=!0)}activate(){super.activate(),this._controller().redraw()}mode(){return this._mode??=u.line}toggleMode(){this._mode=Object.values(u).find((e=>e!==this.mode()));const e=this.crossSection().pathSegments(),t=e.last();t&&(e.remove(t),this.crossSection().addSegment(this.createPathSegment(t.begin(),t.end())),this.updateSegment(e.last()),this._controller().redraw())}createPathSegment(e,t){return this.mode()===u.line?new c(e,t):new l(e,e.snapshot(),t.snapshot(),t)}updateSegment(e){if(this.mode()===u.curve){const t=e.begin().to(e.end());e.setControlPoint1(new a(new o(t,.25),12).snapshot()),e.setControlPoint2(new a(new o(t,.75),12).snapshot())}}crossSection(){return this._crossSection}draw(e,t){e._alterAndRestoreAfter((()=>{e.strokeStyle="#ff8700",e.stroke(this.crossSection().toCanvasPath())})),this.hoveredHandle()&&this.hoveredHandle().draw(e,t),this.activeHandle()&&this.activeHandle().draw(e,t),this.handles().forEach((r=>{r.drawSelected(e,t)}))}mouseMove(e,t,r){if(super.mouseMove(e,t,r),this.finished())return;if(0===this.crossSection().pathSegments().length)return;const n=this.crossSection().pathSegments().last().end(),i=s(e,t).subtract(n);n.moveBy(i.x(),i.y()),this.updateSegment(this.crossSection().pathSegments().last()),this._controller().redraw()}mouseUp(e,t,r){if(super.mouseUp(e,t,r),!this.finished()){if(0===this.crossSection().pathSegments().length)this.crossSection().addSegment(this.createPathSegment(s(e,t),s(e,t)));else{const r=this.crossSection().pathSegments().last().end(),n=s(e,t).subtract(r);r.moveBy(n.x(),n.y()),this.updateSegment(this.crossSection().pathSegments().last()),this.crossSection().addSegment(this.createPathSegment(r,s(e,t)))}this._controller().redraw()}}resetTool(){this.crossSection().pathSegments().slice().forEach((e=>{this.crossSection().pathSegments().remove(e)})),this._finished=void 0,this._controller().redraw()}finishedPlacing(){this._finished=!0;const e=this.crossSection().pathSegments();e.remove(e.last()),this.crossSection().addSegment(this.createPathSegment(e.last().end(),e.first().begin())),this._controller().redraw()}_topHandleUnderCursor(e,t,r){return this.handles().find((n=>n.contains(e,t,r)))}handles(){return this.crossSection().pathSegments().flatMap((e=>e.handles()))}finished(){return this._finished}_keyboardShortcuts(){return{toggleMode:[{keys:"m"}],finishedPlacing:[{keys:"enter"}]}}}},76286:(e,t,r)=>{const{PropertyEventRecorder:n}=r(7340),{simpleObserver:i}=r(50988);class PartBreakdownPropertyEventRecorder extends n{constructor(e){super(),this._versionedProject=e}versionedProject(){return this._versionedProject}recordChange(){this._versionedProject.createSnapshot()}recordIntermediateChange(){this.notifyIntermediateChangeObservers()}}i(PartBreakdownPropertyEventRecorder,"intermediateChange"),e.exports=PartBreakdownPropertyEventRecorder},5432:(e,t,r)=>{const{Clipboard:n}=r(7340),{SmartJsonBuilder:i,SmartObjectBuilder:s}=r(57075),o=r(11511);e.exports=class ThunderCloudClipboard extends n{async copy(e){e&&(this._selection=await e.clone(),this.saveClipboardToLocalStorage(this._selection))}async saveClipboardToLocalStorage(e){const t=new i,{json:r}=await t.stringify(e?.components()||[]);window.localStorage.setItem(this._clipboardStorageKey(),r)}async paste(e,t,r){let n;if(n=this.contents()?await this.contents().clone():await this.restoreClipboardFromLocalStorage(),n&&!n.isEmpty())return this._moveSelectionTo(n,e,t),n.addTo(r),this._selectionManager.setSelection(n),n}async restoreClipboardFromLocalStorage(){const e=window.localStorage.getItem(this._clipboardStorageKey());if(!e)return;const t=new s,r=await t.parse(e);return this._selectionManager.selectionFactory().createSelectionForComponents(...r)}_moveSelectionTo(e,t,r){const n=t-e.location().x(),i=r-e.location().y();e.moveBy(n,i)}_clipboardStorageKey(){return`clipboard-${o.strategyIdentifier()}`}}},87935:(e,t,r)=>{const{CompositeSelection:n}=r(7340);e.exports=class ThunderCloudCompositeSelection extends n{moveBy(e,t){this.referencePoint().moveBy(e,t);return this.components().map((r=>!r.isRelative()&&r.moveBy(e,t))).some((e=>e))}_findUniqueComponents(e){return[...new Set(e.filter((e=>e)))]}delete(){this.components().filter((e=>e.isDeleteable())).forEach((e=>e.delete()))}async clone(){const e=await Promise.all(this.components().map((async e=>await e.clone())));return e.forEach((e=>e?.cleanUp?.())),this.selectionFactory().createSelectionForComponents(...e.filter((e=>e)))}}},79591:(e,t,r)=>{const n=r(63768),{PhotorealisticDrawing3DController:i,three:s}=r(37732),{simpleObserver:o,extend:a}=r(50988),l=r(80524),c=r(87032);class ThunderCloudDrawing3DController extends i{constructor(...e){super(...e),this._isLoaded=!1,this._setEnvironmentTextureUrl(),this.setMainLightOffset(1,.75,-.75)}_setEnvironmentTextureUrl(){"test"!==navigator.userAgent&&this.setEnvironmentTextureUrl(r(51947))}_configureRenderer(e){super._configureRenderer(e),e.xr.enabled=!0,e.shadowMap.enabled=this.systemStrategy().shows3DShadows()}async activate(){await this._ensure3DModelsLoaded(),super.activate(),this._isLoaded=!0,this.redraw()}async _ensure3DModelsLoaded(){return this.project().load()}deactivate(){super.deactivate(),this._isLoaded=!1}_rendererOptions(){return{alpha:!0,antialias:!0}}boundingCube(){return this.project().regionOfInterest3D()?this.project().regionOfInterest3D():super.boundingCube()}draw(){this._isLoaded&&this.canvas()&&(this.drawing().addToScene(this.scene()),this._lightScene(this.scene()),this._renderLoopActive=!0,this.renderer().setAnimationLoop(((...e)=>{this._render(...e)})),this._beforeUnloadCallback=()=>this._beforeUnload(),window.addEventListener("beforeunload",this._beforeUnloadCallback))}redraw(e){this._isLoaded&&super.redraw(e)}afterResize(){this._isLoaded&&super.afterResize()}_initialCameraDirection(){return new s.Vector3(1,1,-1).normalize()}handleMouseEvent(e){this._isLoaded&&super.handleMouseEvent(e)}handleKeyboardEvent(e){this._isLoaded&&super.handleKeyboardEvent(e)}releaseResources(){const e=this.focusPoint();this.setInitialCameraPosition(this.camera().position),super.releaseResources(),this._focusPoint=e}_cameraNearPlane(){return 1}_initialCameraZoomAdjustment(){return this.cameraZoomDistanceFor(this.boundingCube())}_initialCameraPosition(){return this.__initialCameraPosition??=super._initialCameraPosition()}setInitialCameraPosition(e){this.__initialCameraPosition=e}cameraZoomDistanceFor(e){const t=Math.max(e.width(),e.height(),e.depth()),r=this._cameraFieldOfView().degreesToRadians();return 1.5*Math.abs(t/2/Math.tan(r/2))}resetFocusPoint(){this._focusPoint=void 0}async enterXR(e){if(this._xrSession)return;switch(e){case"ar":await this._enterAR();break;case"vr":await this._enterVR();break;default:throw new Error(`Unknown XR mode: ${e}`)}this._xrSessionType=e,this._xrSession.addEventListener("end",this._exitXRSession),this.notifyXrSessionStartedObservers();const t="ar"===e?"local":"local-floor";this.renderer().xr.setReferenceSpaceType(t),await this.renderer().xr.setSession(this._xrSession),"ar"!==e&&(this._vrInterface=new l(this),this._vrInterface.setup())}async _enterAR(){this._xrSession=await window.navigator.xr.requestSession("immersive-ar",{requiredFeatures:["hit-test"],optionalFeatures:["anchors","dom-overlay","light-estimation"],domOverlay:this._domOverlay()}),this.setupXRScene(),this.setupARScene(),this._xrSession.addEventListener("select",this._handleSelect)}async _enterVR(){this._xrSession=await window.navigator.xr.requestSession("immersive-vr",{requiredFeatures:[],optionalFeatures:["local-floor","bounded-floor","dom-overlay"],domOverlay:this._domOverlay()}),this.setupXRScene(),this.setupVRScene(),this._xrSession.addEventListener("select",this._handleSelect)}_domOverlay(){return{root:document.getElementById("dom_overlay_root")}}xrScene(){return this._xrScene}setupXRScene(){this.camera().up.set(0,1,0),this.camera().near=.1,this.camera().updateProjectionMatrix();const e=new s.Group;this._xrScene=new s.Group,e.add(this._xrScene),this._xrScene.applyQuaternion(this.yUpRotation()),this._xrScene.scale.set(this.xrScale(),this.xrScale(),this.xrScale()),this.scene().children.slice().forEach((e=>{this._xrScene.add(e)})),this.scene().add(e),this.scene().add(this._mainLight),this._savedEnvironment=this.scene().environment,this._xrSession.requestLightProbe&&(this.scene().environment=void 0,this._threeLightProbe=new s.LightProbe,this.scene().add(this._threeLightProbe))}setupARScene(){this.xrScene().visible=!1}setupVRScene(){}async exitXR(){await this._xrSession.end()}_exitXRSession=()=>{this.notifyXrSessionEndedObservers(),this._xrSession.removeEventListener("end",this._exitXRSession),this._xrSession.removeEventListener("select",this._handleSelect),this._xrSession=void 0,this.tearDownXRScene()};tearDownXRScene(){this._arAnchor=void 0,this._lightProbe=void 0,this._lightProbeRequested=!1,this._threeLightProbe=void 0,this._vrInterface=void 0,this._threeLightProbe&&this.scene().remove(this._threeLightProbe),this.scene().remove(this._mainLight),this.scene().add(this.mainLight()),this.scene().remove(this._xrScene.parent),this._xrScene.children.slice().forEach((e=>this.scene().add(e))),this._xrScene=void 0,this.camera().up.set(0,0,-1),this.camera().position.copy(this._initialCameraPosition()),this.camera().lookAt(this.focusPoint()),this.camera().near=1,this.camera().updateProjectionMatrix(),this.scene().environment=this._savedEnvironment,this._savedEnvironment=void 0,"ar"===this._xrSessionType&&this.tearDownARScene(),"vr"===this._xrSessionType&&this.tearDownVRScene()}tearDownARScene(){}tearDownVRScene(){}_handleSelect=e=>{this.activeTool().select?.(e.frame)};yUpRotation(){return(new s.Quaternion).setFromAxisAngle(new s.Vector3(1,0,0),Math.PI_2)}_render(e,t){this._ensureAllFiguresAreUpToDate(),this.activeTool().update(),t&&this._handleXRFrame(t),this.renderer().render(this.scene(),this.camera())}_handleXRFrame(e){const t=this.renderer().xr.getReferenceSpace();this._vrInterface?this._vrInterface.update(e):(this.activeTool().viewMove?.(e),this._updateAnchor(e,t),this._updateLightEstimate(e,t))}_updateAnchor(e,t){if(!this._arAnchor||!e.trackedAnchors.has(this._arAnchor))return;const r=e.getPose(this._arAnchor.anchorSpace,t);r&&this.xrScene().parent.matrix.fromArray(r.transform.matrix)}async anchorScene(e,t,r){if(!e.createAnchor)return;this._arAnchor&&(this._arAnchor.delete(),this._arAnchor=void 0);const n=new XRRigidTransform({x:t.x,y:t.y,z:t.z,w:1},r);this._arAnchor=await e.createAnchor(n,this.renderer().xr.getReferenceSpace())}_updateLightEstimate(e,t){if(this._lightProbe||this._getLightProbe(),this._lightProbe){const r=e.getLightEstimate(this._lightProbe);if(r){const n=e.getPose(this._lightProbe.probeSpace,t),i=(new s.Matrix4).fromArray(n.transform.matrix),o=Math.max(0,r.primaryLightIntensity.x,r.primaryLightIntensity.y,r.primaryLightIntensity.z);this._mainLight.position.set(r.primaryLightDirection.x,r.primaryLightDirection.y,r.primaryLightDirection.z),this._mainLight.position.applyMatrix4(i),this._mainLight.color.setRGB(r.primaryLightIntensity.x/o,r.primaryLightIntensity.y/o,r.primaryLightIntensity.z/o),this._mainLight.intensity=o,this._threeLightProbe.matrix.copy(i),this._threeLightProbe.sh.fromArray(r.sphericalHarmonicsCoefficients)}}}async _getLightProbe(){this._lightProbeRequested||(this._lightProbeRequested=!0,this._xrSession.requestLightProbe&&(this._lightProbe=await this._xrSession.requestLightProbe()))}xrScale(){return n.unit(1,this.project().unit()).toNumeric("m")}mainLight(e){const t=new s.DirectionalLight(16777215,1);return t.position.copy(this.mainLightOffset()),this._mainLight=t,t}}a(ThunderCloudDrawing3DController,c),o(ThunderCloudDrawing3DController,"xrSessionStarted"),o(ThunderCloudDrawing3DController,"xrSessionEnded"),e.exports=ThunderCloudDrawing3DController},82938:(e,t,r)=>{const{Drawing3DEditor:n}=r(37732),i=r(9827);e.exports=class ThunderCloudDrawing3DEditor extends n{zoomPalette(){return this._zoomPalette??=this.defaultZoomPalette()}defaultZoomPalette(){return new i(this.drawingController())}}},98272:(e,t,r)=>{const{DrawingController:n,Handle:i,VersionedProject:s}=r(7340),{$P:o}=r(62048),{simpleObserver:a,extend:l}=r(50988),c=r(43812),u=r(87032),d=r(5432),h=r(58744),p=r(76032),{zoomForBounds:m}=r(27892);class ThunderCloudDrawingController extends n{defaultProject(){return new s(new c)}shapeOnly(){return this._shapeOnly??!1}setShapeOnly(e){this._shapeOnly=e}redraw(){super.redraw(),this.notifyCanvasChangedObservers()}setCanvas(e){super.setCanvas(e),this.setScale(),this.notifyCanvasChangedObservers()}draw(){this._drawAnimationFrameId||(this._drawAnimationFrameId=requestAnimationFrame((()=>{this._drawAnimationFrameId=void 0,super.draw()})))}_draw(e){const t=this._canvasBoundsInDrawingUnits(),r=this._visibleCanvasBounds(),n={bounds:t,layerManager:this.layerManager(),shapeOnly:this.shapeOnly(),visibleBounds:r};this.drawing().draw(e,n),this.drawing().drawAnnotations(e,n),this._drawSelectedHandle(e,n),this._drawToolAnnotations(e,n),e._alterAndRestoreAfter((()=>{e.globalCompositeOperation="destination-over",this._drawBackground(e,n)}))}_drawSelectedHandle(e,t){const r=this.selection();if(r)if(r.component){const n=r.component(),s=this.drawing().figureFor(n);if(!s||!s.selfHandle)return;const o=s.selfHandle();if(!o.drawSelected)return;o.drawSelected(e,t),s.handles().forEach((r=>{r!==o&&r.validWhen()===i.VALID_FOR_SELECTED&&r.drawSelected&&r.drawSelected(e,t)}))}else super._drawSelectedHandle(e,t)}imageOfBounds(e,t){const r=document.createElement("canvas");r.height=e.height(),r.width=e.width();r.getContext("2d").translate(-e.topLeft().x(),-e.topLeft().y()),this.drawBoundsToCanvas(e,r);const n=t,i=r.height/r.width*t;return{source:r.toDataURL("image/png"),width:n,height:i}}drawBoundsToCanvas(e,t,{clearRect:r=!0,...n}={}){const i=t.getContext("2d");i._alterAndRestoreAfter((()=>{r&&i.clearRect(e.topLeft().x(),e.topLeft().y(),e.width(),e.height()),this._drawTo(i,e,n)}))}_drawTo(e,t,{shapeOnly:r=!0,hideGrid:n=!1,showAnnotations:i=!1,...s}={}){const o={...s,bounds:t,layerManager:this.layerManager(),shapeOnly:r,hideGrid:n,visibleBounds:t};e._alterAndRestoreAfter((()=>{this._drawBackground(e,o)})),this.drawing().draw(e,o),i&&this.drawing().drawAnnotations(e,o)}_drawBackground(e,t){t.hideGrid||super._drawBackground(e,t)}defaultScale(){return this.canvas()?m(this.drawing().boundingBox(),this.canvas(),{defaultScale:this.project().defaultScale()}):super.defaultScale()}angleSnapping(){return void 0===this._angleSnapping&&(this._angleSnapping=!0),this._angleSnapping}toggleAngleSnapping(){this._angleSnapping=!this.angleSnapping()}defaultSelectionFactory(){return new h(this.drawing())}defaultBackgroundGridMeasurement(){const e=this.project();return this.systemStrategy().defaultBackgroundGridMeasurement().to(e.unit())}defaultLayerManager(){return new p}autoScrollCanvas(e){const t=this.modelCoordinatesToBrowserCoordinates(e),r=this.canvas().getBoundingClientRect(),n=this._autoScrollDistanceThreshold(),i=this._autoScrollSidePanelOffset("left"),s=this._autoScrollSidePanelOffset("right"),o=t.y()<=r.top+n,a=t.x()<=r.left+i+n,l=t.y()>=r.bottom-n,c=t.x()>=r.right-s-n,u=a?1:-1,d=o?1:-1,h=this._autoScrollSpeed(),p=a||c?h*u:0,m=o||l?h*d:0;0===p&&0===m||this.translateBy(p,m)}_autoScrollDistanceThreshold(){return 50}_autoScrollSpeed(){return 10}_autoScrollSidePanelOffset(e="left"){const t=this._sidePanel(e);return t&&!t.classList.contains("side-panel--collapsed")?t.offsetWidth:0}_visibleCanvasBounds(){const e=this._autoScrollSidePanelOffset("left"),t=this._autoScrollSidePanelOffset("right"),r=this.canvas().getBoundingClientRect(),n=o(r.left+e,r.top),i=o(r.right-t,r.bottom),s=this.browserCoordinatesToModelCoordinates(n),a=this.browserCoordinatesToModelCoordinates(i);return s.toCorner(a)}_sidePanel(e="left"){return this._sidePanelParentElement().querySelector(`.side-panel--${e}`)}_sidePanelParentElement(){if(!this.__sidePanelParentElement){const e=this.canvas();this.__sidePanelParentElement=e.closest(".drawing-editor")}return this.__sidePanelParentElement}isViewOnly(){return this._isViewOnly}setIsViewOnly(e){this._isViewOnly=e}_keyboardShortcuts(){return this.isViewOnly()?{}:super._keyboardShortcuts()}clipboard(){return this._clipboard||(this._clipboard=new d(this)),this._clipboard}async handleCopySelection(e,t){await this.clipboard().copy(this.selection())}async handlePasteSelection(e,t){await this.clipboard().paste(this.lastX(),this.lastY(),this.project())&&await this.snapshotProject()}handlesAt(e,t,r,n){const i=this.handleOptions(r,n),s=this.drawing().handlesAt(e,t,i);return s.fastMerge(this.drawing().annotationHandlesAt(e,t,i)),s}handleOptions(e,t){return{scale:e,layerManager:this.layerManager(),validWhen:t,visibleBounds:this._visibleCanvasBounds()}}}l(ThunderCloudDrawingController,u),a(ThunderCloudDrawingController,"canvasChanged"),e.exports=ThunderCloudDrawingController},86293:(e,t,r)=>{const{DrawingEditor:n,CompositePanZoomTool:i,FreeFormSelectionTool:s}=r(7340),o=r(63002);e.exports=class ThunderCloudDrawingEditor extends n{constructor(e,t){super(e),this._isViewOnly=t}isViewOnly(){return this._isViewOnly}defaultTools(){return this.isViewOnly()?this.defaultViewOnlyTools():this.defaultEditTools()}defaultViewOnlyTools(){return[new i(this.drawingController(),this.zoomPalette())]}defaultEditTools(){const e=this.project().systemStrategy();return[new o(this.drawingController(),this.zoomPalette()),this.defaultFreeFormSelectionTool(),...e.editTools(this)]}defaultFreeFormSelectionTool(){const e=new s(this.drawingController(),this.zoomPalette());return e.panTool().setMouseButtonToActivate(void 0),e.panTool().setKeyboardKeysToActivate("space"),e.setDisplayName("Lasso Select"),e.setSelectableComponentsQuery(this._selectableComponents.bind(this)),e}defaultDrawingControllerClass(){return this.project().systemStrategy().drawingControllerClass()}defaultDrawingController(){const e=super.defaultDrawingController();return e.setIsViewOnly(this.isViewOnly()),e}_selectableComponents(){return this.project().parts().filter((e=>e.isSelectable?.()??!0))}selectAll(){this.drawingController().select(...this._selectableComponents()),this.toolPalette().setActiveTool(this.toolPalette().tool("Select"))}activate(){this.drawingController().activate(),this.drawingController().shortcutManager().registerShortcuts(this._keyboardShortcuts(),this)}deactivate(){this.drawingController().deactivate(),this.drawingController().shortcutManager().unregisterShortcuts(this._keyboardShortcuts(),this)}_keyboardShortcuts(){return this.isViewOnly()?{}:{selectAll:[{keys:"cmd+a"},{keys:"ctrl+a"}]}}}},76032:(e,t,r)=>{const{LayerManager:n}=r(7340),i=r(11511);e.exports=class ThunderCloudLayerManager extends n{_alwaysShowLayer(e){if(void 0===e)return!0;return i.strategy().alwaysVisibleLayers().includes(e)}isVisible(e){return!!this._alwaysShowLayer(e)||Boolean(this.layers()[e])}}},34323:(e,t,r)=>{const{PersistentProjectRepository:n}=r(7340),{SmartObjectBuilder:i}=r(57075),{extend:s}=r(50988),o=r(87032),a=r(24897),l=r(84188);class ThunderCloudProjectRepository extends n{constructor(e){super(e),this.setBaseProjectId(this.projectId())}_pushExternalPath(e){return`/external_projects/${e.externalId()}/push_external`}async pushExternal(){const e=await this.loadPriceList(),t=await this.loadMaterialDefinitions(),r=this.project().externalPersistenceJSON(e,t),n=this._pushExternalPath(this.project());return this.apiClient().post(n,{body:{payload:r},headers:{...this.apiClient().defaultHeaders(),"X-CSRF-Token":l.csrfToken()}})}baseProjectId(){return this._baseProjectId}setBaseProjectId(e){this._baseProjectId=e}priceList(){return this._priceList}_apiPriceListPath(){return`/projects/${this.baseProjectId()}/price_list`}async loadPriceList(){return this._priceList=await this.apiClient().get(this._apiPriceListPath())}materialDefinitions(){return this._materialDefinitions}_apiMaterialDefinitionsPath(){return`/projects/${this.baseProjectId()}/material_list`}async loadMaterialDefinitions(){return this.baseProjectId()?this._materialDefnitions=await this.apiClient().get(this._apiMaterialDefinitionsPath()):{}}async updateOnServer(){const{json:e,externalObjects:t}=await this.generateProjectJSON(),r=this.priceList()??await this.loadPriceList(),n=this._updateOnServerApiUrl();await Promise.all(t.map((e=>e.persist?.(n))));const i={...this.project().metadataManager().metadata(),design:JSON.parse(e),estimate:this.project().totalPrice?.(r)};await this.apiClient().put(n,{body:{project:i},headers:{...this.apiClient().defaultHeaders(),"X-CSRF-Token":l.csrfToken()}}),await this.setLastPersistedState(e)}projectsPath(){return this._projectPath||super.projectsPath()}setProjectPath(e){this._projectPath=e}autosaveController(){return this._autosaveController||(this._autosaveController=new a(this)),this._autosaveController}setupAutosave(){this._disableAutosave||this.autosaveController().start()}disableAutosave(){this._disableAutosave=!0}_registerSystemStrategyClassMappings(){i.configure((e=>{this.systemStrategy().registerSmartObjectClassMappings(e)}))}buildObjectFromJSON(e){return this._registerSystemStrategyClassMappings(),this.objectBuilder().buildSmartObject(e)}async loadFromServer(e){const t=await this.apiClient().get(this._loadFromServerApiUrl(e));t.project&&(await this._loadFromJSON(t.project),await this.setLastPersistedState(t.project.design))}async setProject(e){await super.setProject(e);const t=await this.loadMaterialDefinitions();e.setMaterialDefinitions(t)}}s(ThunderCloudProjectRepository,o),e.exports=ThunderCloudProjectRepository},76623:(e,t,r)=>{const{PropertyEventRecorder:n}=r(7340),i=r(5647);e.exports=class ThunderCloudPropertyEventRecorder extends n{constructor(e){super(),this._drawingEditor=e}drawingEditor(){return this._drawingEditor}drawingController(){return this.drawingEditor().drawingController()}recordChange(){this.drawingController().recordChange()}recordIntermediateChange(){this.drawingController().recordIntermediateChange()}activateMeasureTool(){this.drawingEditor().toolPalette().setActiveTool(this.measureTool()),this.recordIntermediateChange()}deactivateMeasureTool(){this.drawingEditor().toolPalette().deactivateTool(),this.recordIntermediateChange()}measureToolActive(){return this.measureTool()===this.drawingController().activeTool()}measureTool(){return this.drawingEditor().toolPalette().tools().find((e=>e.identifier?.()===i.IDENTIFIER))}startObserverToolHolder(e,t){this.drawingController().toolHolder().addValueChangedObserver(e,t)}stopObserverToolHolder(e,t){this.drawingController().toolHolder().removeValueChangedObserver(e,t)}}},58744:(e,t,r)=>{const{SelectionFactory:n}=r(7340),i=r(87935),s=r(45564);e.exports=class ThunderCloudSelectionFactory extends n{createMultiSelection(e){return new i(e,this)}createSingleSelection(e){return new s(e,this._drawing,this)}}},45564:(e,t,r)=>{const{SingleSelection:n}=r(7340);e.exports=class ThunderCloudSingleSelection extends n{async clone(){const e=await this.component().clone();return e?(e.cleanUp?.(),new this.constructor(e,this._drawing,this.selectionFactory())):this.selectionFactory().createEmptySelection()}}},9827:(e,t,r)=>{const{ZoomPalette:n}=r(7340),i=r(28019),{animateSmooth:s}=r(43797);e.exports=class ThunderCloudZoomPalette3D extends n{drawingController(){return this._drawingController}camera(){return this.drawingController().camera()}zoomCanvasCenterBy(e){const t=e<1?-1:1,r=this.camera(),n=r.position.clone(),s=this.drawingController().focusPoint(),o=t*(n.distanceTo(s)/4),a=new i.Vector3;r.getWorldDirection(a);const l=n.add(a.multiplyScalar(o));this.camera().position.copy(l),this.camera().lookAt(s)}centerView(){const e=this.drawingController().boundingCube();return this._focusCameraOnCube(e)}_focusCameraOnCube(e){const t=this.camera(),r=this.drawingController(),n=e.center().toThreeJS(),o=new i.Vector3;t.getWorldDirection(o);const a=r.cameraZoomDistanceFor(e),l=n.clone().add(o.negate().multiplyScalar(a));if(l.equals(t.position,Math.DEFAULT_TOLERANCE))return;const c=t.position.clone(),u=r.focusPoint().clone(),d=Math.round(l.distanceTo(c)/4),h=Math.round(u.distanceTo(n)/4),p=Math.min(d+h,150);return s(p,(e=>{r.focusPoint().lerpVectors(u,n,e),t.position.lerpVectors(c,l,e),t.lookAt(r.focusPoint())}),(()=>{r.resetFocusPoint()}))}}},48578:(e,t,r)=>{const{PropertyEventRecorder:n}=r(7340);e.exports=class ToolPanelPropertyEventRecorder extends n{constructor(e){super(),this._tool=e}tool(){return this._tool}recordChange(){}recordIntermediateChange(){}}},80524:(e,t,r)=>{const{three:n}=r(37732),i=r(49410);e.exports=class VRInterface{constructor(e){this.drawingController=e}get renderer(){return this.drawingController.renderer()}get scene(){return this.drawingController.scene()}get raycaster(){return this._raycaster??=new n.Raycaster}get rayTransform(){return this._rayTransform??=new n.Matrix4}get reticle(){return this._reticle??=this._defaultReticle()}_defaultReticle(){const e=new n.MeshBasicMaterial({depthTest:!1}),t=i.mergeBufferGeometries([new n.RingGeometry(.07,.08,32).rotateX(-Math.PI/2).rotateY(Math.PI_2),new n.CircleGeometry(.01,16).rotateX(-Math.PI/2).rotateY(Math.PI_2)]),r=new n.Mesh(t,e);return r.matrixAutoUpdate=!1,r.visible=!1,r.renderOrder=2,r}setup(){[0,1].forEach((e=>{this.setupControllerModel(e),this.setupController(e)})),this.scene.add(this.reticle),this.computeBoundsTree()}update(e){if(!this._preferredInputSource)return;const t=e.getPose(this._preferredInputSource.targetRaySpace,this.renderer.xr.getReferenceSpace());if(!t)return;this.rayTransform.fromArray(t.transform.matrix),this.raycaster.ray.origin.set(0,0,0),this.raycaster.ray.direction.set(0,0,-1),this.raycaster.ray.applyMatrix4(this.rayTransform);const[r]=this.raycaster.intersectObject(this.drawingController.xrScene(),!0);r&&(this.reticle.position.copy(r.point),this.reticle.visible=!0,this.reticle.updateMatrix())}setupControllerModel(e){const t=this.renderer.xr.getControllerGrip(e),r=new n.Mesh(new n.CapsuleGeometry(.05,.1).rotateX(Math.PI_2),new n.MeshStandardMaterial);t.add(r),t.layers.set(16),this.scene.add(t)}setupController(e){const t=this.renderer.xr.getController(e);t.addEventListener("connected",(r=>{t.add(this.buildController(r.data)),1===e&&(this._preferredInputSource=r.data)})),t.addEventListener("disconnected",(()=>{t.remove(t.children[0])})),t.addEventListener("selectend",this._handleSelectEnd.bind(this,t)),this.scene.add(t)}buildController(e){const t=new n.BufferGeometry;t.setAttribute("position",new n.Float32BufferAttribute([0,0,0,0,0,-1],3)),t.setAttribute("color",new n.Float32BufferAttribute([.5,.5,.5,0,0,0],3));const r=new n.LineBasicMaterial({vertexColors:!0,blending:n.AdditiveBlending});return new n.Line(t,r)}computeBoundsTree(e=this.scene){e.children.forEach((e=>{e.children&&e.children.length>0&&this.computeBoundsTree(e),e.geometry&&e.geometry.computeBoundsTree&&e.geometry.computeBoundsTree()}))}_handleSelectEnd(e,t){const r=this.renderer.xr.getCamera(this.drawingController.camera()),i=(new n.Vector3).subVectors(this.reticle.position,r.position);i.y+=r.position.y,this.drawingController.xrScene().parent.position.sub(i)}}},71181:(e,t,r)=>{const n=r(63768),{lumber:i,MaterialSpecifier:s}=r(93613),o=r(42947),a=n.unit,l=[new s("AA_LABOR_PILE6",'6" Pile Driving'),new s("AA_LABOR_PILE8",'8" Pile Driving'),new s("AA_LABOR_PILE10",'10" Pile Driving'),new s("AA_LABOR_PILE12",'12" Pile Driving'),new s("AA_LABOR_BOATHOUSE","Boathouse Labor (per sq ft)",{unit:a(1,"ft^2")}),new s("AA_LABOR_DOCK","Dock Labor (per sq ft)",{unit:a(1,"ft^2")}),new s("AA_LABOR_PIER","Pier Labor (per sq ft)",{unit:a(1,"ft^2")})],c={};l.forEach((e=>{c[e.identifier()]=e}));const u=[new s("PILE6",'6" PILE',{diameter:a(6,"in"),width:a(6,"in"),laborSpecifier:c.AA_LABOR_PILE6,cutLengths:[16,18,20].map((e=>a(e,"ft")))}),new s("PILE8",'8" PILE',{diameter:a(8,"in"),width:a(8,"in"),laborSpecifier:c.AA_LABOR_PILE8,cutLengths:[16,18,20].map((e=>a(e,"ft")))}),new s("PILE10",'10" PILE',{diameter:a(10,"in"),width:a(10,"in"),laborSpecifier:c.AA_LABOR_PILE10,cutLengths:[30,35].map((e=>a(e,"ft")))}),new s("PILE12",'12" PILE',{diameter:a(12,"in"),width:a(12,"in"),laborSpecifier:c.AA_LABOR_PILE12,cutLengths:[30,35].map((e=>a(e,"ft")))}),new s("PT3x8","3 x 8",{width:a(2.5,"in"),depth:a(7.25,"in"),cutLengths:[8,10,12,16].map((e=>a(e,"ft")))})],d=[new s("SHINGLES","Shingles (sq ft)",{depth:a(.1875,"in"),coverage:a(1,"sqft"),materialName:"shingle",color:"#aaaaaa",pricingUnit:"sqft"}),new s("RIBBED_METAL","Metal Panel (sq ft)",{depth:a(.15,"in"),coverage:a(1,"ft^2"),materialName:"metal-roof",color:"#aaaaaa",pricingUnit:"sqft"}),new s("PW4x8","Plywood (4x8 sheet)",{width:a(4,"ft"),length:a(8,"ft"),coverage:a(32,"ft^2"),depth:a(.625,"in"),materialName:"pressure-treated",color:"#f2cca8",pricingUnit:"sheet"}),new s("BOLT_HD_34_16",'3/4" x 16" HD Galvanized Bolt'),new s("NUT_HD_34",'3/4" HD Hex Nut')];u.forEach((e=>{i[e.identifier()]=e,e.details().cutLengths.forEach((t=>{const r=t.toNumeric("ft"),n={...e.details()};delete n.cutLengths,n.length=t;const o=new s(`${e.identifier()}x${r}`,`${e.name()} x ${r}'`,n);i[o.identifier()]=o}))}));const h={};function p(e){const t=Object.getOwnPropertyNames(e);t.sort(),t.filter((t=>!e[t].details().cutLengths)).forEach((e=>{console.log(`    '${e}': 99999,`)}))}d.forEach((e=>{h[e.identifier()]=e})),e.exports={lumber:i,material:h,labor:c,_generatePricingMethod:function(){console.log("pricing() {"),console.log("  return {"),p(i),p(h),console.log("  }"),console.log("}\n")},lookupName:function(e,t){const r=[i,h,c].find((t=>t[e]));if(!r)return e;const n=r[e];return t?.[e]?.[o.item]||n.name()}}},36608:(e,t,r)=>{const n=r(53797),i=r(44103),s=r(13303);class EZDockPolygonSectionBuilder extends i{constructor(e){super(void 0,n,{defaultPolygon:t=>e.polygon()}),this._dockSectionType=e}build(){const e=super.build();return e.setType(this._dockSectionType),e}}const{referencePoint:o,angle:a}=i.defaultMethodNames();s(EZDockPolygonSectionBuilder,[o,a]),e.exports=EZDockPolygonSectionBuilder},99940:(e,t,r)=>{const n=r(55125),i=r(22093),s=r(13303);class EZDockSectionBuilder extends i{constructor(e,t,r=n){super(e,r,{defaultWidth:()=>t.width(),defaultLength:()=>t.length()}),this._dockSectionType=t}build(){const e=super.build();return e.setType(this._dockSectionType),e}}const{referencePoint:o,angle:a}=i.defaultMethodNames();s(EZDockSectionBuilder,[o,a]),e.exports=EZDockSectionBuilder},81740:(e,t,r)=>{const n=r(38801),i=r(59139),s=r(99940);e.exports=class EZPortSectionBuilder extends s{constructor(e,t){super(e,t),this._insetWidth=t.insetWidth(),this._insetDepth=t.insetDepth()}getComponentClass(){return n}newGeometryStrategy(){const e=this._unitProvider.unit(),t=this._width.toNumeric(e),r=this._length.toNumeric(e),n=this._insetWidth?.toNumeric(e),s=this._insetDepth?.toNumeric(e);return new i(t,r,n,s)}}},37793:(e,t,r)=>{const n=r(63768),{EditableProperty:i}=r(7340),{extend:s}=r(50988),{FixedEdgeLocator:o}=r(62048),a=r(26716),l=r(80077),c=r(55125),u=r(76905),d=r(67603),h=r(82144),p=r(24575),m=r(43775),f=r(24749),g=r(16797),y=r(49380),b=r(24607),v=r(6364);class EZDock extends a{static defaultSectionType(){return c.defaultType()}static defaultWidth(){return this.defaultSectionType().width()}static defaultLength(){return this.defaultSectionType().length()}static defaultHeight(){return this.defaultSectionType().height()}_widthIncrementNumeric(){return this.sectionType().width().toNumeric(this.unit())}_lengthIncrementNumeric(){return this.sectionType().length().toNumeric(this.unit())}minimumSpan(){return this._widthIncrementNumeric()}allowableWidths(){return this._allowableWidths??=new p(this._widthIncrementNumeric(),1/0,this.unit(),this._widthIncrementNumeric())}getNearestAllowableWidth(e){return this.allowableWidths().getNearest(e)}setWidth(e){const t=this.getNearestAllowableWidth(e);return super.setWidth(t)}constrainWidthAdjustment(e){return this.allowableWidths().getNearestDelta(this.width(),this.unit(),e)}allowableLengths(){return this._allowableLengths??=new p(this._lengthIncrementNumeric(),1/0,this.unit(),this._lengthIncrementNumeric())}getNearestAllowableLength(e){return this.allowableLengths().getNearest(e)}setLength(e){const t=this.getNearestAllowableLength(e);return super.setLength(t)}constrainLengthAdjustment(e){return this.allowableLengths().getNearestDelta(this.length(),this.unit(),e)}_sectionConfigurationProperty(){return new i(this,"Section Type",{type:"select",choices:this.sectionTypeOptions()})}defaultDisplayProperties(){return new d(this,[...super.defaultDisplayProperties(),this._sectionConfigurationProperty(),new i(this,"Color",{type:"select",choices:this.colorOptions()})])}sectionType(){return this._sectionType??=this.constructor.defaultSectionType()}setSectionType(e){this._sectionType=e,this.resetSections(),this.setWidth(this.width()),this.setLength(this.length()),this.setHeight(e.height())}sectionTypeOptions(){return[h.baby,h.forty,h.sixty,h.eighty,h.hundred,h.eightyLowProfile]}color(){return this._color??=y.beige}setColor(e){this._color=e,this.resetColorComponents()}colorOptions(){return[y.beige,y.grey]}resetColorComponents(){this.resetSections(),this.resetPocketFillers()}setHeight(e){const t=this.zLevel();this._height=n.multiply(e,this.percentAboveWaterline());const r=this.zLevel()-t;return this.geometry().moveBy(0,0,r),this.frameResized({fromSetter:!0}),!0}_defaultHeight(){return n.multiply(this.sectionType().height(),this.percentAboveWaterline())}heightBelowWaterline(){return n.subtract(this.sectionType().height(),this.height())}percentAboveWaterline(){return this.sectionType().percentAboveWaterline()}modelIdentifier(){return this.sectionType().modelId()}snappableAngles(){const e=[];for(let t=0;t<360;t+=15)e.push(t.degreesToRadians());return e}sections(){return this._sections??=this._defaultSections()}_defaultSections(){const e=this.width().toNumeric(this.unit()),t=this.length().toNumeric(this.unit()),r=this._widthIncrementNumeric()/2,n=this._lengthIncrementNumeric()/2,i=[];for(let s=r;s<e;s+=this._widthIncrementNumeric()){const r=this.crossAxis().multipliedBy(s).subtract(this.crossAxis().multipliedBy(e/2));for(let e=n;e<t;e+=this._lengthIncrementNumeric()){const n=this.mainAxis().multipliedBy(e).subtract(this.mainAxis().multipliedBy(t/2)).add(r).add(this.locator()),s=c.builder(this,this.sectionType()).referencePoint(n.relatedTo(this.referencePoint())).angle(this.angle()).build();s.setComponentOf(this),i.push(s)}}return i}couplers(){return this._couplers??=this._defaultCouplers()}_defaultCouplers(){return[...this.internalCouplers(),...this.externalCouplers()]}internalCouplers(){return this.sections().flatMap((e=>e.connectedSnapPoints())).uniqueValues().map((e=>this._makeCoupler(e)))}externalCouplers(){return this.connections().filter((e=>e.isMajorDock(this))).flatMap((e=>e.connectedSnapPoints(this))).map((e=>this._makeCoupler(e)))}_makeCoupler(e){const t=e.addZ(-this.heightBelowWaterline().toNumeric(this.unit())),r=new(this.sectionType().couplerClassForLocator(t,this.unit()))(e);return r.setComponentOf(this),r}uncoupledPocketLocations(){return this.unconnectedSnapPoints()}pocketFillers(){return this._pocketFillers??=this._defaultPocketFillers()}_defaultPocketFillers(){return this.uncoupledPocketLocations().map((e=>{const t=new g(e);return t.setComponentOf(this),t}))}setAngle(e){const t=e-this.angle();this.components().forEach((e=>{t.isNearTo(0)||e.rotateBy?.(this.locator(),t)})),super.setAngle(e)}defaultFigure(){return new l(this)}pocketSpacingHelper(){return this._pocketSpacingHelper??=new b(this.unit())}snapPoints(){return this.edges().flatMap((e=>this.snappingPointsForEdge(e)))}snappingPointsForEdge(e){return this.pocketSpacingHelper().pocketDistancesForEdge(e).map((t=>{const r=t.toNumeric(this.unit());return new o(e,r)}))}connectedSnapPoints(){return[...this.connections().flatMap((e=>e.connectedSnapPoints(this))),...this._snapPointsConnectedToAccessories()]}_snapPointsConnectedToAccessory(e){const t=this.snapPoints(),r=e.connectionPoints();return t.filter((e=>r.find((t=>e.equals(t)))))}_snapPointsConnectedToAccessories(){return this.accessories().flatMap((e=>this._snapPointsConnectedToAccessory(e)))}unconnectedSnapPoints(){const e=this.connectedSnapPoints();return this.snapPoints().filter((t=>!e.find((e=>e.equals(t)))))}unconnectedSnapPointsForAccessory(e){const t=e.connectionPoints(),r=this.connectedSnapPoints().filter((e=>!t.find((t=>e.equals(t)))));return this.snapPoints().filter((e=>!r.find((t=>t.equals(e)))))}snappingVectorForFrame(e,t,r){if(0===(e.unconnectedSnapPoints?.()??[]).length)return;const n=this._compatibleSnapPointsForFrame(e).filter((e=>r.xy().containsPoint(e.xy()))).reduce(((r,n)=>{const i=e._compatibleSnapPointsForLocators(n).filter((e=>t.xy().containsPoint(e.xy()))),s=u.findClosestLocator(n,i);return s.distance<r.distance?{...s,snapPoint:n}:r}),{distance:1/0}),i=n.snapPoint,s=n.locator;return i&&s?u.directionTo(i.xy(),s.xy()):void 0}snappableEdgesForFrame(e){const t=this._compatibleSnapPointsForFrame(e);return this.edges().filter((e=>t.some((t=>e.xy().containsPoint(t.xy())))))}_compatibleSnapPointsForFrame(e){return this._compatibleSnapPointsForLocators(...e.unconnectedSnapPoints())}_compatibleSnapPointsForLocators(...e){return this.unconnectedSnapPoints().filter((t=>e.some((e=>t.z().isNearTo(e.z())))))}dockAccessorySnappingEdges(){return this.snappableEdgesForFrame(this)}accessoryAttachmentHeight(){return this.height()}connectionZLevel(){return this.zLevel()}connectionClass(){return f}angleChanged(e){super.angleChanged(e),this.updateConnections()}frameResized({fromSetter:e=!1}={}){super.frameResized({fromSetter:e}),this.updateConnections()}delete(){this.removeAllAccessories(),this.connections().forEach((e=>e.delete())),super.delete()}clone(){const e=this._baseClone();return e.setComponentOf(this.componentOf()),this.accumulatedClone(e),e._sectionType=this.sectionType(),e._color=this.color(),e}setComponentOf(e){super.setComponentOf(e),this.accessories().forEach((t=>{e.add(t)}))}resetSections(){this._sections=void 0,this._allowableWidths=void 0,this._allowableLengths=void 0}resetCouplers(){this._couplers=void 0}resetPocketFillers(){this._pocketFillers=void 0}resetComponents(){super.resetComponents(),this.resetSections(),this.resetCouplers(),this.resetPocketFillers()}components(){return[...super.components(),...this.sections(),...this.couplers(),...this.pocketFillers()]}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_allowableWidths","_allowableLengths","_couplers","_pocketFillers","_pocketSpacingHelper"]}formatter(){return this.project().formatter()}defaultAnnotations(){return this.geometryStrategy().buildAnnotations(this.geometry(),this.unit(),void 0,{formatter:this.formatter()})}resetAnnotations(){this._annotations=void 0}accessoryAdded(e){this.resetPocketFillers()}accessoryRemoved(e){this.resetPocketFillers()}}s(EZDock,m),s(EZDock,v),e.exports=EZDock},67275:(e,t,r)=>{const{three:n}=r(37732),{MissingOverride:i}=r(50988),s=r(6556),o=r(57473);e.exports=class EZDock3DComponent extends o{rotation(){return(new n.Quaternion).setFromAxisAngle(new n.Vector3(0,0,1),this.angle())}angle(){return this.locator().edge().normal().negated().theta()}color(){return this.componentOf().color()}materialIdentifiers(){return[this.color().materialName]}selfMaterialLineItems(){return[new s(1,this.materialSpecifier())]}materialSpecifier(){throw new i(this,"materialSpecifier")}_modelIdentifier(){throw new i(this,"_modelIdentifier")}}},82253:(e,t,r)=>{const n=r(63768);e.exports=Object.freeze({standardSectionLength:n.unit(117,"in"),pocketSpacing:n.unit(19.5,"in"),standardHeight:n.unit(14.625,"in"),lowProfileHeight:n.unit(7.625,"in")})},24749:(e,t,r)=>{const n=r(57100);e.exports=class EZDockConnection extends n{connectedSnapPoints(e){const t=this.docks().filter((t=>t!==e)),r=e.snapPoints(),n=t.flatMap((e=>e.snapPoints()));return r.filter((e=>n.find((t=>e.equals(t)))))}}},61483:(e,t,r)=>{const n=r(63768),{EditableProperty:i}=r(7340),{Polygon:s}=r(62048),{three:o}=r(37732),a=r(79851),l=r(70666),c=r(82253),u=r(35716),d=r(41107),h=r(21065),p=r(6556),m=r(24575),f=r(57473),g=r(41588),y=r(72655);e.exports=class EZDockGangway extends a{static displayName(){return"Gangway"}static defaultWidth(){return n.unit(3,"ft")}static defaultLength(){return n.unit(10,"ft")}readableDimensions(){return`${this.width().toDecimalFeet(0)}x${this.length().toDecimalFeet(0)}`}defaultDisplayProperties(){return[new i(this,"Width",{type:"select",choices:this.widthOptions()}),new i(this,"Color",{type:"select",choices:this.colorOptions()}),new i(this,"Decking Type",{type:"select",choices:this.deckingTypeOptions()})]}widthOptions(){return[{label:"3 ft",value:n.unit(3,"ft")},{label:"4 ft",value:n.unit(4,"ft")}]}allowableLengths(){return this._allowableLengths??=new m(10,30,"ft",5)}constrainLength(e){return this.allowableLengths().getNearestDelta(this.length(),this.unit(),e)}_defaultWidth(){return this.constructor.defaultWidth()}_defaultLength(){return this.constructor.defaultLength()}color(){return this._color??=u.grey}setColor(e){this._color=e,this._reset3DModel()}colorOptions(){return this.deckingType().colorOptions}_coerceColor(){const e=this.color(),t=this.colorOptions(),r=t.find((t=>t.equals(e)))??t.first();this.setColor(r)}deckingType(){return this._deckingType??=this.deckingTypeOptions().first().value}setDeckingType(e){this._deckingType=e,this._coerceColor(),this._reset3DModel()}deckingTypeOptions(){return Object.values(g)}fallbackSideDockHeight(){return c.standardHeight}surfaceType(){return h.Aluminum}railingHeight(){return n.unit(41,"in")}railingWidth(){return n.unit(1.5,"in")}railingShapes(){return this.sideEdges().map((e=>{const t=this.railingHeight().toNumeric(this.unit()),r=n.unit(2.5,"ft").toNumeric(this.unit()),i=e.direction().cross(e.normal()).multipliedBy(t),o=e.stretchedBy(r).movedByDelta(i),a=this.railingWidth().toNumeric(this.unit())/2,l=o.shiftedAlongNormalBy(-a),c=o.shiftedAlongNormalBy(a);return new s([l.begin(),c.begin(),c.end(),l.end()])}))}async load(){return Promise.resolve(this.model3D().load())}frameResized(){super.frameResized(),this._reset3DModel()}_reset3DModel(){this._model3D=void 0}model3D(){return this._model3D??=this._defaultModel3D()}_defaultModel3D(){const e=this.locator().addZ(this.zLevel()).relatedTo(this.referencePoint());return new f(e,this.modelIdentifier(),this._rotationFor3DModel(),void 0,["aluminum",this.color().materialName])}modelIdentifier(){return`ez-dock-gangway-${this.deckingType().variantString.toLowerCase()}-${this.readableDimensions()}`}_rotationFor3DModel(){const e=(new o.Quaternion).setFromAxisAngle(this.crossAxis().negated().toThreeJS(),this.slopeAngle());return(new o.Quaternion).setFromAxisAngle(new o.Vector3(0,0,1),this.angle()).premultiply(e)}components(){return[this.model3D()]}formatter(){const e=this.project().formatter();return"in"===e.baseUnit()?this._decimalFeetFormatter():e}_decimalFeetFormatter(){return new l(0)}defaultAnnotations(){return this.geometryStrategy().buildAnnotations(this.geometry(),this.unit(),void 0,{formatter:this.formatter()})}resetAnnotations(){this._annotations=void 0}materialSpecifier(){const e=this.deckingType().variantString;return y[`Gangway${e}${this.readableDimensions()}`]}selfMaterialLineItems(){return[new p(1,this.materialSpecifier())]}defaultFigure(){return new d(this)}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_allowableLengths","_model3D"]}}},41588:(e,t,r)=>{const n=r(93768),i=r(35716);e.exports=Object.freeze({solid:new n("Solid",{variantString:"Solid",colorOptions:[i.beige,i.grey]}),grating:new n("Grating",{variantString:"Grating",colorOptions:[i.beigeGrating,i.greyGrating],hatchFigure:!0})})},93768:(e,t,r)=>{const n=r(90218);e.exports=class EZDockGangwayDeckingType extends n{constructor(e,{variantString:t,colorOptions:r,hatchFigure:n,...i}={}){super(e,i),this._variantString=t,this._colorOptions=r,this._hatchFigure=n}get variantString(){return this._variantString}get colorOptions(){return this._colorOptions}get hatchFigure(){return this._hatchFigure}equals(e){return this.variantString===e.variantString}}},35156:(e,t,r)=>{const n=r(44103),i=r(37793),s=r(53797),o=r(82144),a=r(47116);e.exports=class EZDockPolygonDock extends i{static defaultSectionType(){return s.defaultType()}static iconName(){return"roof"}static displayName(){return"Non-rectangular Dock"}static defaultPolygon(e){return this.defaultSectionType().polygon()}static builder(e){return new n(e,this)}sectionType(){return this._sectionType??=s.defaultType()}setSectionType(e){this._sectionType=e,this.geometryStrategy().setPolygon(e.polygon()),this.resetGeometry(),this.resetSections()}sectionTypeOptions(){return[o.triangle,o.halfHex]}_defaultSections(){const e=s.builder(this.sectionType()).referencePoint(this.referencePoint()).angle(this.angle()).build();return e.setComponentOf(this),[e]}defaultFigure(){return new a(this)}}},84308:(e,t,r)=>{const{EditableProperty:n,ImperialDecimalLengthFormatter:i}=r(7340),s=r(7524),o=r(45615),a=r(72655);e.exports=class EZDockProject extends s{get materials(){return a}defaultScale(){return 1.75}defaultDisplayProperties(){return[...super.defaultDisplayProperties(),new n(this,"Formatter",{type:"select",label:"Unit of Measure",choices:this.formatterOptions()})]}setFormatter(e){this._formatter=e,this.resetAnnotations()}resetAnnotations(){this.components().forEach((e=>{e.resetAnnotations?.()}))}connectors(){return[]}formatter(){return this._formatter??=this.formatterOptions().find((e=>"Imperial"===e.label)).value}formatterOptions(){return[{label:"Imperial",value:new i(-1,!1)},{label:"Metric",value:new o("m",1)}]}}},41742:(e,t,r)=>{const{FixedEdgeLocator:n}=r(62048),i=r(63348),s=r(58017),o=r(49380),a=r(82253),l=r(59663),c=r(39238),u=r(80317);e.exports=class EZDockAccessory extends i{static role(){return u.ACCESSORY}static disabledToolMessage(){return"No valid location available"}zLevel(){return this.locator().z()-1}color(){return this.frame()?.color()??o.beige}_availableSnapPoints(e,t){return t}snapPointsForFrames(e){return e.flatMap((e=>{const t=this._availableSnapPoints(e,[...e.unconnectedSnapPoints(),...this.connectionPoints()]);return this._associateFrameWithSnapPoints(e,t)}))}frameFilter(){return e=>this._availableSnapPoints(e,e.unconnectedSnapPoints()).length>0}_associateFrameWithSnapPoints(e,t){return t.map((t=>({locator:t,frame:e})))}_pocketSpacing(){return a.pocketSpacing.toNumeric(this.unit())}_connectionPointOffsets(){return[0]}connectionPoints(){const e=this.locator().edge?.();if(!e)return[];const t=this.locator().distanceTo(e.begin());return this._connectionPointOffsets().map((r=>new n(e,t+r)))}delete(){super.delete(),this.project().remove(this)}materialIdentifiers(){return[this.color().materialName]}angle(){return this.locator().edge()?.direction().theta()??0}shapes2D(){return[]}vertices(){const[e,...t]=this.shapes2D().map((e=>e.rotatedBy(this.locator(),-this.angle())));return e.union(...t).first().rotatedBy(this.locator(),this.angle()).vertices()}defaultFigure(){const e=this.color().figureColors,t=new l(this,{strokeStyle:e.strokeStyle,fillStyle:e.dockSurface,lineWidthPixels:2});return t.setSelfHandle(new s(t)),t}threeFigure(){return new c(this)}}},48302:(e,t,r)=>{const n=r(63768),{EditableProperty:i}=r(7340),s=r(65147),o=r(6556),a=r(41742),l=r(53777),c=r(72655);e.exports=class EZDockBench extends a{static iconName(){return"bench"}modelIdentifier(){return this.hasArmRests()?"ez-dock-bench-with-arm-rests":"ez-dock-bench"}defaultDisplayProperties(){return[...super.defaultDisplayProperties(),new i(this,"Has Arm Rests",{type:"boolean",label:"Arm Rests"})]}hasArmRests(){return this._hasArmRests??=!1}toggleHasArmRests(){this._hasArmRests=!this._hasArmRests,this.resetModel()}_availableSnapPoints(e,t){return t.filter((e=>{const r=e.edge(),n=t.filter((t=>!t.equals(e)&&t.edge().equals(r)));return this._connectionPointOffsets().every((t=>n.some((n=>n.subtract(e).dot(r.direction()).isNearTo(t)))))}))}_connectionPointOffsets(){return[-this._pocketSpacing(),this._pocketSpacing()]}selfMaterialLineItems(){return this.hasArmRests()?[new o(1,c.BenchWithArmRests)]:[new o(1,c.Bench)]}materialIdentifiers(){return[this.color().materialName,"black-plastic",this.supportColor().materialName]}supportColor(){return new l("Aluminum",{materialName:"aluminum",figureColors:{fillStyle:"#C4C4C4"}})}_benchLength(){return n.unit(55,"in").toNumeric(this.unit())}_seatGap(){return n.unit(3,"in").toNumeric(this.unit())}_seatSectionWidth(){return n.unit(5,"in").toNumeric(this.unit())}_backRestWidth(){return n.unit(7,"in").toNumeric(this.unit())}supportShapes(){const e=n.unit(3,"in").toNumeric(this.unit())/2,t=2*this._seatGap()+this._backRestWidth();return this.connectionPoints().map((r=>r.movedBy(0,1.5*-this._seatSectionWidth()).expandedBy(e,t).toPolygon().rotatedBy(r,this.angle())))}_seatSectionShapes(){return[this.locator().movedBy(0,-this._seatSectionWidth()),this.locator(),this.locator().movedBy(0,this._seatSectionWidth())].map((e=>e.expandedBy(this._benchLength()/2,this._seatSectionWidth()/2).toPolygon().rotatedBy(this.locator(),this.angle())))}_armRestShapes(){const e=n.unit(5,"in").toNumeric(this.unit())/2,t=n.unit(12,"in").toNumeric(this.unit())/2,r=this._benchLength()/2;return(this.hasArmRests()?[-r,r]:[]).map((r=>this.locator().movedBy(r,0).expandedBy(e,t).toPolygon().rotatedBy(this.locator(),this.angle())))}_backRestShape(){const e=(this._benchLength()+1)/2,t=this._backRestWidth()/2,r=1.5*-this._seatSectionWidth()-t-this._seatGap();return this.locator().movedBy(0,r).expandedBy(e,t).toPolygon().rotatedBy(this.locator(),this.angle())}primaryShapes(){return[...this._seatSectionShapes(),...this._armRestShapes(),this._backRestShape()]}shapes2D(){return[...this.supportShapes(),...this.primaryShapes()]}defaultFigure(){return new s(this)}}},97342:(e,t,r)=>{const n=r(63768),{FixedEdgeLocator:i}=r(62048),s=r(6556),o=r(41742),a=r(76905),l=r(72655);e.exports=class EZDockLadder extends o{static displayName(){return"Ladder"}static iconName(){return"ladder"}_availableSnapPoints(e,t){const r=e.edges().flatMap((e=>a.sortOnEdge(t,e)));if(0===r.length)return[];const n=[];return r.reduce(((e,t)=>{const r=e.edge().equals(t.edge()),s=e.distanceTo(t).isNearTo(this._pocketSpacing());if(!r||!s)return t;const o=e.distance(),a=(t.distance()-o)/2+o;return n.push(new i(e.edge(),a)),t})),n}_connectionPointOffsets(){return[-this._pocketSpacing()/2,this._pocketSpacing()/2]}modelIdentifier(){return"ez-dock-ladder"}selfMaterialLineItems(){return[new s(1,l.Ladder)]}shapes2D(){const e=n.unit(15,"in").toNumeric(this.unit())/2,t=n.unit(8,"in").toNumeric(this.unit())/2,r=n.unit(5,"in").toNumeric(this.unit())/2,i=t-r;return[...[this.locator().movedBy(0,3*-i),this.locator().movedBy(0,2*-i),this.locator().movedBy(0,-i)].map((r=>r.expandedBy(e,t).toPolygon().rotatedBy(this.locator(),this.angle()))),...this.connectionPoints().map((e=>e.expandedBy(r).toPolygon().rotatedBy(e,this.angle())))]}}},31150:(e,t,r)=>{const n=r(63768),i=r(67275),s=r(49380),o=r(59663);e.exports=class AirAssist extends i{static width(){return n.unit(16,"in")}static length(){return n.unit(14,"in")}_modelIdentifier(){return"ez-dock-air-assist"}materialSpecifier(){return this.materials.AirAssist}width(){return this.constructor.width()}length(){return this.constructor.length()}geometry(){return this._geometry??=this.defaultGeometry()}defaultGeometry(){const e=this.width().toNumeric(this.unit()),t=this.length().toNumeric(this.unit());return this.locator().expandedBy(t/2,e/2).toPolygon().rotatedBy(this.locator(),this.angle()).relatedTo(this.referencePoint())}angleChanged(){this._geometry=void 0}color(){return s.grey}defaultFigure(){return new o(this,{fillStyle:this.color().figureColors.fillStyle,strokeStyle:this.color().figureColors.strokeStyle,lineWidthPixels:1})}}},83087:(e,t,r)=>{const{EditableProperty:n}=r(7340),i=r(29355),s=r(37648),o=r(41684);e.exports=class EZBoatPort extends s{static defaultSectionType(){return o.boatPort}static displayName(){return"Boat Port"}getNearestAllowableWidth(e){return e}getNearestAllowableLength(e){return e}angleChanged(){super.angleChanged(),this.components().forEach((e=>e.angleChanged?.()))}_sectionConfigurationProperty(){return new n(this,"Section Provider",{type:"select",label:"Configuration",choices:this.sectionProviderOptions()})}sectionProviderOptions(){return[i.BP2000,i.BP3000,i.BP3001,i.BP4000,i.BP4001,i.BP5000,i.BP5001]}sectionProvider(){return this._sectionProvider??=i.BP2000}setSectionProvider(e){this._sectionProvider=e,this.setWidth(e.width()),this.setLength(e.length())}components(){return[...super.components(),...this.bunks(),...this.floatTankWithAirAssist()]}resetComponents(){super.resetComponents(),this._bunks=void 0,this._floatTankWithAirAssist=void 0}_sectionConnectorLineItems(){return this.sectionProvider().connectorLineItems()}componentsMaterialLineItems(){return[...super.componentsMaterialLineItems(),...this._sectionConnectorLineItems()]}bunks(){return this._bunks??=this.link(this.sectionProvider().bunks(this))}floatTankWithAirAssist(){return this._floatTankWithAirAssist??=this.link(this.sectionProvider().floatTankWithAirAssist(this))}_defaultSections(){return this.link(this.sectionProvider().buildSections(this))}clone(){const e=super.clone();return e._sectionProvider=this.sectionProvider(),e}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_sections","_bunks","_floatTankWithAirAssist"]}}},29355:(e,t,r)=>{const n=r(37177),i=r(82144);e.exports={BP2000:new n("Boat Port only - 7' x 14'"),BP3000:new n("Boat Port, side extensions - 10' x 14'",{includeSideExtensions:!0}),BP3001:new n("Boat Port, side extensions, 60\" dock - 10' x 19'",{includeSideExtensions:!0,dockSectionType:i.sixty,isDockPerpendicularToPort:!0}),BP4000:new n("Boat Port, baby docks, float tank & air-assist - 80\" x 19'",{dockSectionType:i.baby,includeFloatTank:!0}),BP4001:new n('Boat Port, 80" dock, float tank & air-assist - 80" x 24\'',{dockSectionType:i.eighty,includeFloatTank:!0}),BP5000:new n("Boat Port, side extensions, 80\" dock, float tank & air-assist - 10' x 20'6\"",{includeSideExtensions:!0,dockSectionType:i.eighty,isDockPerpendicularToPort:!0,includeFloatTank:!0}),BP5001:new n("Boat Port, side extensions, 60\" docks, float tank & air-assist - 10' x 24'",{includeSideExtensions:!0,dockSectionType:i.sixty,includeFloatTank:!0})}},37177:(e,t,r)=>{const n=r(63768),{NormalToEdgeLocator:i,ProportionalEdgeLocator:s}=r(62048),o=r(6556),a=r(55125),l=r(38801),c=r(41684),u=r(31150),d=r(55819),h=r(189),p=r(72655);e.exports=class EZBoatPortSectionProvider{constructor(e,{includeSideExtensions:t=!1,dockSectionType:r,isDockPerpendicularToPort:n=!1,includeFloatTank:i=!1}={}){this._label=e,this._includeSideExtensions=t,this._dockSectionType=r,this._isDockPerpendicularToPort=n,this._includeFloatTank=i}get label(){return this._label}get value(){return this}includeSideExtensions(){return this._includeSideExtensions}dockSectionType(){return this._dockSectionType}isDockPerpendicularToPort(){return this._isDockPerpendicularToPort}includeFloatTank(){return this._includeFloatTank}width(){const e=this.portType().width();if(!this.includeSideExtensions())return e;const t=n.multiply(this.sideExtensionType().width(),2);return n.add(e,t)}length(){const e=this.portType().length();return this._includeDockSection()?n.add(e,this._dockRelativeLength()):e}buildSections(e){return[this._portSection(e),...this._sideExtensions(e),...this._dockSections(e)]}portType(){return c.boatPort}_portSectionLocator(e){const t=this.portType().length().toNumeric(e.unit())/2;return e.sternEdge().center().subtract(e.mainAxis().multipliedBy(t)).relatedTo(e.referencePoint())}_portSection(e){return l.builder(e,this.portType()).referencePoint(this._portSectionLocator(e)).angle(e.angle()).build()}sideExtensionType(){return c.boatPortSideExtension}_sideExtensions(e){if(!this.includeSideExtensions())return[];const t=n.add(this.portType().width(),this.sideExtensionType().width()).toNumeric(e.unit())/2;return[this._portSectionLocator(e).add(e.crossAxis().multipliedBy(t)),this._portSectionLocator(e).add(e.crossAxis().multipliedBy(-t))].map((t=>l.builder(e,this.sideExtensionType()).referencePoint(t.relatedTo(e.referencePoint())).angle(e.angle()).build()))}_dockRelativeLength(){const e=this.dockSectionType();return this.isDockPerpendicularToPort()?e.width():e.length()}_dockRelativeWidth(){const e=this.dockSectionType();return this.isDockPerpendicularToPort()?e.length():e.width()}_dockRelativeAngle(){return this.isDockPerpendicularToPort()?Math.PI_2:0}_includeDockSection(){return Boolean(this.dockSectionType())}_dockSections(e){if(!this._includeDockSection())return[];const t=this.width().toNumeric(e.unit()),r=this._dockRelativeWidth().toNumeric(e.unit()),i=Math.ceil(t/r),s=e.angle()+this._dockRelativeAngle(),o=-n.add(this.portType().length(),this._dockRelativeLength()).toNumeric(e.unit())/2,l=[];for(let n=0;n<i;n++){const i=r/2+r*n-t/2,c=e.mainAxis().multipliedBy(o).add(e.crossAxis().multipliedBy(i)),u=this._portSectionLocator(e).add(c).relatedTo(e.referencePoint());l.push(a.builder(e,this.dockSectionType()).referencePoint(u).angle(s).build())}return l}_bunkOffset(){return n.unit(17.3836,"in")}bunks(e){const t=e.crossAxis().multipliedBy(this._bunkOffset().toNumeric(e.unit()));return[this._portSectionLocator(e).add(t),this._portSectionLocator(e).subtract(t)].map((t=>new h(t.relatedTo(e.referencePoint()),e.angle())))}floatTankWithAirAssist(e){return this.includeFloatTank()?[this._floatTank(e),this._airAssist(e)]:[]}_floatTank(e){const t=this.portType().height().toNumeric(e.unit());return new d(e.sternEdge().addZ(t).center())}_airAssist(e){const t=new s(e.bowEdge(),1),r=u.length().toNumeric(e.unit()),n=u.width().toNumeric(e.unit()),o=new i(t,-r,-n);return new u(o)}connectorLineItems(){return this.includeSideExtensions()?[new o(2,p.HConnector)]:this.includeFloatTank()?[new o(2,p.TConnector)]:[]}equals(e){return this.constructor===e.constructor&&this.label===e.label}}},55819:(e,t,r)=>{const n=r(67275);e.exports=class FloatTank extends n{angle(){return this.locator().edge().normalAngle()}_modelIdentifier(){return"ez-dock-float-tank"}materialSpecifier(){return this.materials.FloatTank}}},189:(e,t,r)=>{const n=r(67275);e.exports=class LongBunk extends n{constructor(e,t=0){super(e),this._angle=t}angle(){return this._angle}_modelIdentifier(){return"ez-dock-long-bunk"}materialIdentifiers(){return["plastic-blue"]}rotateBy(e,t){if(Math.abs(t)>Math.DEFAULT_TOLERANCE){const r=this.angle()+t;this._angle=r,this.locator().rotateBy(e,t)}}materialSpecifier(){return this.materials.LongBunk}}},53777:(e,t,r)=>{const n=r(90218);e.exports=class EZDockColor extends n{constructor(e,{materialName:t,figureColors:r={},...n}={}){super(e,n),this._materialName=t,this._figureColors=r}get materialName(){return this._materialName}get figureColors(){return this._figureColors}equals(e){return this.label===e.label}}},49380:(e,t,r)=>{const n=r(53777);e.exports=Object.freeze({beige:new n("Beige",{materialName:"plastic-beige",figureColors:{strokeStyle:"#362d29",fillStyle:"#B2A895",sectionStrokeStyle:"#362d2944",dockSurface:"#B2A895",emptyCoupler:"#e3e3e3",filledCoupler:"#2e2e2e",lowProfileEmptyCoupler:"#d9ae14",interiorFilledCoupler:"#6B675F"}}),grey:new n("Grey",{materialName:"plastic-light-grey",figureColors:{strokeStyle:"#362d29",fillStyle:"#D3D3D3",sectionStrokeStyle:"#362d2944",dockSurface:"#D3D3D3",emptyCoupler:"#e3e3e3",filledCoupler:"#2e2e2e",lowProfileEmptyCoupler:"#d9ae14",interiorFilledCoupler:"#8c8c8c"}})})},35716:(e,t,r)=>{const n=r(53777);e.exports=Object.freeze({beige:new n("Beige",{materialName:"metallic-beige-low-gloss",figureColors:{deckingSurface:"#B2A895",strokeStyle:"#362d29",railing:"#C4C4C4"}}),grey:new n("Grey",{materialName:"metallic-light-grey-low-gloss",figureColors:{deckingSurface:"#C4C4C4",strokeStyle:"#362d29",railing:"#C4C4C4"}}),beigeGrating:new n("Beige",{materialName:"metallic-mesh-beige-low-gloss",figureColors:{deckingSurface:"#B2A895",strokeStyle:"#362d29",railing:"#C4C4C4"}}),greyGrating:new n("Grey",{materialName:"metallic-mesh-light-grey-low-gloss",figureColors:{deckingSurface:"#C4C4C4",strokeStyle:"#362d29",railing:"#C4C4C4"}})})},5403:(e,t,r)=>{const n=r(16797);e.exports=class EZDockCoupler extends n{_modelIdentifier(){return"ez-dock-dog-bone-coupler"}materialIdentifiers(){return["black-plastic"]}materialSpecifier(){return this.materials.DogBoneCoupler}}},77848:(e,t,r)=>{const n=r(6556),i=r(5403);e.exports=class EZDockCouplerLowProfile extends i{_modelIdentifier(){return"ez-dock-dog-bone-coupler-low-profile"}selfMaterialLineItems(){return[new n(1,this.materials.DogBoneCouplerLowProfile)]}}},16797:(e,t,r)=>{const n=r(67275);e.exports=class EZDockPocketFiller extends n{angle(){return this.locator().edge().normal().theta()}_modelIdentifier(){return"ez-dock-pocket-filler"}materialSpecifier(){return this.materials.PocketFiller}}},59139:(e,t,r)=>{const{Polygon:n}=r(62048),i=r(16810);e.exports=class EZPortGeometryStrategy extends i{constructor(e,t,r,n){super(e,t),this._insetWidth=r,this._insetDepth=n}hasInset(){return void 0!==this.insetDepth()}insetWidth(){return this._insetWidth}insetDepth(){return this._insetDepth}rotateGeometry(e,t){const r=e.boundingBox().center();this.rotateGeometryAround(e,r,t)}buildGeometry(e,t,r=0){const i=e.xy(),s=this.defaultWidth()/2,o=this.defaultLength()/2,a=this.insetWidth()/2,l=o-this.insetDepth(),c=[i.movedBy(o,-a),i.movedBy(l,-a),i.movedBy(l,a),i.movedBy(o,a)],u=new n([i.movedBy(-o,-s),i.movedBy(o,-s),...this.hasInset()?c:[],i.movedBy(o,s),i.movedBy(-o,s)]).movedBy(0,0,r).relatedTo(e);return this.rotateGeometry(u,t),u}}},72655:(e,t,r)=>{const{MaterialSpecifier:n}=r(93613),i=[new n("DogBoneCoupler","Dog Bone Coupler"),new n("DogBoneCouplerLowProfile","Dog Bone Coupler Low Profile"),new n("PocketFiller","Pocket Filler"),new n("DockSectionBaby","Baby Dock Section"),new n("DockSection40in",'40" Dock Section'),new n("DockSection60in",'60" Dock Section'),new n("DockSection80in",'80" Dock Section'),new n("DockSection100in",'100" Dock Section'),new n("DockSection80inLowProfile",'80" Low Profile Dock Section'),new n("DockSectionTriangle","Triangle Dock Section"),new n("DockSectionHalfHex","Half Hexagon Dock Section"),new n("PortSectionVXP","EZ Port VXP"),new n("PortSection260","EZ Port 260"),new n("PortSection280","EZ Port 280"),new n("PortSection2i","EZ Port 2i"),new n("PortMAXSectionExtension","EZ Port MAX Extension"),new n("PortMAXSectionEntry","EZ Port MAX Entry"),new n("PortMAXSectionEasyLiftEntry","EZ Port MAX Easy-Lift Entry"),new n("PortMAXFullDeckBow","EZ Port MAX Full Deck Bow"),new n("PortMAXSmallBow","EZ Port MAX Small Bow"),new n("Port2iBow","EZ Port 2i Bow"),new n("EZLaunch","EZ Launch"),new n("EZBoatPort","EZ BoatPort"),new n("EZBoatPortSideExtension","EZ BoatPort Side Extension"),new n("HConnector","H Connector"),new n("TConnector","T Connector"),new n("LongBunk","Long Bunk"),new n("FloatTank","Float Tank"),new n("AirAssist","Air Assist"),new n("GangwaySolid3x10","Gangway - Solid - 3' x 10'"),new n("GangwaySolid3x15","Gangway - Solid - 3' x 15'"),new n("GangwaySolid3x20","Gangway - Solid - 3' x 20'"),new n("GangwaySolid3x25","Gangway - Solid - 3' x 25'"),new n("GangwaySolid3x30","Gangway - Solid - 3' x 30'"),new n("GangwaySolid4x10","Gangway - Solid - 4' x 10'"),new n("GangwaySolid4x15","Gangway - Solid - 4' x 15'"),new n("GangwaySolid4x20","Gangway - Solid - 4' x 20'"),new n("GangwaySolid4x25","Gangway - Solid - 4' x 25'"),new n("GangwaySolid4x30","Gangway - Solid - 4' x 30'"),new n("GangwayGrating3x10","Gangway - Grating - 3' x 10'"),new n("GangwayGrating3x15","Gangway - Grating - 3' x 15'"),new n("GangwayGrating3x20","Gangway - Grating - 3' x 20'"),new n("GangwayGrating3x25","Gangway - Grating - 3' x 25'"),new n("GangwayGrating3x30","Gangway - Grating - 3' x 30'"),new n("GangwayGrating4x10","Gangway - Grating - 4' x 10'"),new n("GangwayGrating4x15","Gangway - Grating - 4' x 15'"),new n("GangwayGrating4x20","Gangway - Grating - 4' x 20'"),new n("GangwayGrating4x25","Gangway - Grating - 4' x 25'"),new n("GangwayGrating4x30","Gangway - Grating - 4' x 30'"),new n("Ladder","Ladder"),new n("Bench","Bench"),new n("BenchWithArmRests","Bench with arm rests")],s={};i.forEach((e=>{s[e.identifier()]=e})),e.exports=s},28887:(e,t,r)=>{const{Polygon:n}=r(62048),i=r(39334),s=r(37648),o=r(41684),a=r(11216);e.exports=class EZDockLaunch extends s{static defaultSectionType(){return o.kayakLaunch}static displayName(){return"Kayak & Canoe Launch"}showSectionTypeProperty(){return!1}angleChanged(){this.resetShapes2D()}polygonStrategy(){return this._polygonStrategy??=new a(this.polygon())}polygon(){const e=this.geometry().snapshot();e.rotateBy(e.centroid(),-this.angle());const[t,r,i,s]=e.vertices(),o=t.to(s).center(),a=r.to(i).center(),l=o.to(a),c=t.to(r).length(),[u,d]=l.stretchedBy(.66*-c).endpoints(),h=t.to(r).shiftedAlongNormalBy(-5),p=s.to(i).shiftedAlongNormalBy(5),[m,f]=h.endpoints(),[g,y]=p.endpoints();return new n([t,r,f,d,y,i,s,g,u,m])}shapes2D(){return this._shapes2D??=[this.polygonStrategy().buildGeometry(this.referencePoint(),this.angle(),this.zLevel())]}resetShapes2D(){this._shapes2D=void 0}defaultFigure(){return new i(this)}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_polygonStrategy","_shapes2D"]}}},8004:(e,t,r)=>{const{FixedEdgeLocator:n}=r(62048),{NullDrawable:i}=r(7340),s=r(38801),o=r(24607),a=r(82253),l=r(30691),c=r(46748);let u;e.exports=class EZDockLaunchSection extends s{static builder(e,t){return u??=r(99940),new u(e,t,this)}pocketSpacingHelper(){return this._pocketSpacingHelper??=new o(this.unit())}snapPoints(){return[this._highSnapPointEdge(),this._lowSnapPointEdge()].flatMap((e=>this.snappingPointsForEdge(e)))}internalOnlySnapPoints(){return[]}_highSnapPointEdge(){return this.sideEdges().last()}_lowSnapPointEdge(){const e=this.componentOf().percentAboveWaterline(),t=a.lowProfileHeight.toNumeric(this.unit())*e;return l.flattenedAtZ(this.sideEdges().first(),-t).relativeToEdge(this.sideEdges().first())}snappingPointsForEdge(e){return this.pocketSpacingHelper().pocketDistancesForEdge(e,this._snapPointEdgeInset()).map((t=>{const r=t.toNumeric(this.unit());return new n(e,r)}))}_snapPointEdgeInset(){const e=a.standardSectionLength,t=a.pocketSpacing;return c`${this.length()} - ${e} + ${t}`}defaultFigure(){return new i(this)}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_pocketSpacingHelper"]}}},40156:(e,t,r)=>{const n=r(8004),i=r(57665);e.exports=class EZDockLaunchSectionType extends i{sectionClass(){return n}}},37648:(e,t,r)=>{const{EditableProperty:n}=r(7340),i=r(37793),s=r(38801),o=r(62193),a=r(41684),l=r(67603);e.exports=class EZPort extends i{static defaultSectionType(){return s.defaultType()}static iconName(){return"rectangle"}static displayName(){return"PWC Port"}bowEdge(){return this.endEdges().find((e=>e.normal().dot(this.mainAxis()).isNearTo(-1)))}sternEdge(){return this.endEdges().find((e=>e.normal().dot(this.mainAxis()).isNearTo(1)))}allowableLengths(){return this._allowableLengths??=this.sectionType().allowablePortLengths(this)}defaultDisplayProperties(){return new l(this,[...super.defaultDisplayProperties(),...this.sectionType().defaultDisplayProperties(this),new n(this,"Has Bow Stops",{type:"boolean",label:"Bow Stop"})])}hasBowStops(){const e=this.sectionType();return e.isBowStopOptional()?this._hasBowStops??=!0:Boolean(e.bowStopClass())}toggleHasBowStops(){this.setHasBowStops(!this.hasBowStops())}setHasBowStops(e){this._hasBowStops=e,this.resetBowStops()}showHasBowStopsProperty(){return this.sectionType().isBowStopOptional()}resetColorComponents(){super.resetColorComponents(),this.resetBowStops()}maxEntryTypeOptions(){return[a.maxEntry,a.maxEasyLiftEntry]}maxEntryType(){return this._maxEntryType??=this.maxEntryTypeOptions().first()}setMaxEntryType(e){this._maxEntryType=e,this.resetAllowableLengths(),this.resetSections()}hasAdjustableEndEdges(){return this.sectionType().hasAdjustableEndEdges()}setSectionType(e){this._sectionType=e,this.setWidth(e.width()),this.setHeight(e.height()),this.resetAllowableLengths(),this.resetDisplayProperties()}resetComponents(){super.resetComponents(),this.resetBowStops()}resetAllowableLengths(){this._allowableLengths=void 0,this.setLength(this.length())}sectionTypeOptions(){return[a["2i"],a.vxp,a[260],a[280],a.max]}_defaultSections(){return this.sectionType().defaultSections(this)}bowStops(){return this.hasBowStops()?this._bowStops??=this.sections().flatMap((e=>e.bowStop?.())).filter((e=>e)):[]}resetBowStops(){this._bowStops=void 0}uncoupledPocketLocations(){return[...this.unconnectedSnapPoints(),...this.unconnectablePocketLocations()]}unconnectablePocketLocations(){return this.sections().flatMap((e=>e.internalOnlySnapPoints())).filter((e=>this.edges().some((t=>t.xy().containsPoint(e.xy())))))}snapPoints(){return this.sections().flatMap((e=>e.snapPoints().filter((e=>this.edges().some((t=>t.xy().intersectsPoint(e.xy())))))))}components(){return[...super.components(),...this.bowStops()]}defaultFigure(){return new o(this)}}},24253:(e,t,r)=>{const n=r(67275);e.exports=class EZPort2iBowStop extends n{_modelIdentifier(){return"ez-port-2i-bow-stop"}materialSpecifier(){return this.materials.Port2iBow}}},24402:(e,t,r)=>{const n=r(24253),i=r(57665);e.exports=class EZPort2iSectionType extends i{isBowStopOptional(){return!0}bowStopClass(e){return n}}},24742:(e,t,r)=>{const n=r(63768),i=r(67275);e.exports=class EZPortFullDeckBow extends i{static heightAboveDock(){return n.unit(4.1875,"in")}_modelIdentifier(){return"ez-port-full-deck-bow"}materialSpecifier(){return this.materials.PortMAXFullDeckBow}}},87851:(e,t,r)=>{const n=r(57665),i=r(59465);e.exports=class EZPortMaxEntrySectionType extends n{bowStopClass(e){return i}}},64313:(e,t,r)=>{const{EditableProperty:n}=r(7340),i=r(57665),s=r(24575),o=r(38801),a=r(24742),l=r(59465),c=r(46748);e.exports=class EZPortMaxSectionType extends i{defaultDisplayProperties(e){return[new n(this,"Entry Type",{type:"select",choices:e.maxEntryTypeOptions(),set:t=>e.setMaxEntryType(t),get:()=>e.maxEntryType()})]}hasAdjustableEndEdges(){return!0}percentAboveWaterline(){const e=this.constructor.defaultHeight(),t=super.percentAboveWaterline();return c`(${this.height()} - ${e} * (1 - ${t})) / ${this.height()}`}allowablePortLengths(e){const t=this.length().toNumeric(e.unit()),r=e.maxEntryType().length().toNumeric(e.unit());return new s(t+r,1/0,e.unit(),t)}defaultSections(e){const t=e.length().toNumeric(e.unit()),r=this.length().toNumeric(e.unit()),n=e.maxEntryType().length().toNumeric(e.unit()),i=t-n,s=[];for(let n=r/2;n<i;n+=r){const r=e.mainAxis().multipliedBy(n).subtract(e.mainAxis().multipliedBy(t/2)),i=e.locator().add(r),a=o.builder(e,this).referencePoint(i.relatedTo(e.referencePoint())).angle(e.angle()).build();a.setComponentOf(e),s.push(a)}const a=t/2-n/2,l=e.locator().add(e.mainAxis().multipliedBy(a)),c=o.builder(e,e.maxEntryType()).referencePoint(l.relatedTo(e.referencePoint())).angle(e.angle()).build();return c.setComponentOf(e),[...s,c]}bowStopClass(e){return e?a:l}}},38801:(e,t,r)=>{const n=r(63768),{FixedEdgeLocator:i}=r(62048),s=r(30691),o=r(55125);let a,l;e.exports=class EZPortSection extends o{static defaultType(){return l||(l=r(41684)),l["2i"]}static builder(e,t){return a??=r(81740),new a(e,t)}heightBelowWaterline(){return this.componentOf().heightBelowWaterline()}locator(){return this.geometry().boundingBox().center().addZ(this.zLevel())}sideEdges(){const e=this.length().toNumeric(this.unit());return this.edges().filter((t=>t.length().isNearTo(e)&&this.alongMainAxis(t.vector())))}bowEdge(){return this.endEdges().find((e=>e.normal().dot(this.mainAxis()).isNearTo(-1)))}sternEdge(){return this.endEdges().find((e=>e.normal().dot(this.mainAxis()).isNearTo(1)))}_isFirstSection(){return this.bowEdge().containsEdge(this.componentOf().bowEdge())}bowStop(){const e=this.type().bowStopClass(this._isFirstSection());if(!e)return;const t=new e(this.bowEdge().center());return t.setComponentOf(this),t}_heightAboveWaterlineFor(e){return n.subtract(e,this.heightBelowWaterline())}bowEndPocketLocationHeight(){const e=this.pocketSpacingHelper().bowEndHeight(this.type().height(),this._isFirstSection());return this._heightAboveWaterlineFor(e)}sternEndPocketLocationHeight(){const e=this.pocketSpacingHelper().sternEndHeight(this.type().height());return this._heightAboveWaterlineFor(e)}pocketSpacingHelper(){return this.type().pocketSpacingHelper()}snapPoints(){const e=this.pocketSpacingHelper();return[...this._sideEdgePocketLocations(e.snapPointDistancesAlongSideEdges()),...this._bowEdgePocketLocations(e.snapPointDistancesFromBowEdgeEndpoints()),...this._sternEdgePocketLocations(e.snapPointDistancesFromSternEdgeEndpoints())]}connectedSnapPoints(){return[...this.snapPoints(),...this.internalOnlySnapPoints()].filter((e=>this.edgesInternalToDock().some((t=>t.xy().containsPoint(e.xy())))))}internalOnlySnapPoints(){const e=this.pocketSpacingHelper();return[...this._sideEdgePocketLocations(e.internalOnlySnapPointDistancesAlongSideEdges()),...this._bowEdgePocketLocations(e.internalOnlySnapPointDistancesFromBowEdgeEndpoints()),...this._sternEdgePocketLocations(e.internalOnlySnapPointDistancesFromSternEdgeEndpoints())]}_sideEdgePocketLocations(e){return this.sideEdges().flatMap((t=>{const r=t.direction().dot(this.mainAxis());return e.map((e=>{const n=e.toNumeric(this.unit()),o=-(n>=t.length()/2?this.sternEndPocketLocationHeight():this.bowEndPocketLocationHeight()).toNumeric(this.unit()),a=s.flattenedAtZ(t,o);return new i(a,n*r)}))}))}_bowEdgePocketLocations(e){return this._pocketLocationsFromEndpoints(this.bowEdge(),this.bowEndPocketLocationHeight(),e)}_sternEdgePocketLocations(e){return this._pocketLocationsFromEndpoints(this.sternEdge(),this.sternEndPocketLocationHeight(),e)}_pocketLocationsFromEndpoints(e,t,r){const n=-t.toNumeric(this.unit()),o=s.flattenedAtZ(e,n);return r.flatMap((e=>{const t=e.toNumeric(this.unit());return[new i(o,t),new i(o,-t)]})).uniqueValues()}}},57665:(e,t,r)=>{const n=r(24575),i=r(49237),s=r(38801),o=r(47159);e.exports=class EZPortSectionType extends i{constructor(e,t,r,{width:n,length:i,height:s,insetWidth:o,insetDepth:a,pocketSpacingHelperClass:l}={}){super(e,t,r,n,i,s),this._insetWidth=o,this._insetDepth=a,this._pocketSpacingHelperClass=l}insetWidth(){return this._insetWidth}insetDepth(){return this._insetDepth}defaultDisplayProperties(){return[]}hasAdjustableEndEdges(){return!1}isBowStopOptional(){return!1}allowablePortLengths(e){const t=this.length().toNumeric(e.unit());return new n(t,t,e.unit(),0)}defaultSections(e){const t=this.sectionClass().builder(e,this).referencePoint(e.locator().relatedTo(e.referencePoint())).angle(e.angle()).build();return t.setComponentOf(e),[t]}pocketSpacingHelperClass(){return this._pocketSpacingHelperClass??o}pocketSpacingHelper(){if(!this._pocketSpacingHelper){const e=this.pocketSpacingHelperClass();this._pocketSpacingHelper=new e}return this._pocketSpacingHelper}sectionClass(){return s}bowStopClass(e){}equals(e){if(!e.insetWidth||!e.insetDepth)return!1;const t=this.insetWidth()&&e.insetWidth()?this.insetWidth().equals(e.insetWidth()):!this.insetWidth()&&!e.insetWidth(),r=this.insetDepth()&&e.insetDepth()?this.insetDepth().equals(e.insetDepth()):!this.insetDepth()&&!e.insetDepth();return super.equals(e)&&t&&r}nonEssentialProperties(){return["_pocketSpacingHelperClass"]}}},41684:(e,t,r)=>{const n=r(63768),i=r(57665),s=r(64313),o=r(90907),a=r(10711),l=r(89941),c=r(34459),u=r(27915),d=r(98573),h=r(40156),p=r(87851),m=r(24402);e.exports={vxp:new i("EZ Port VXP","ez-port-vxp","PortSectionVXP",{width:n.unit(58.5,"in"),length:n.unit(153,"in"),insetWidth:n.unit(4,"in"),insetDepth:n.unit(11,"in"),pocketSpacingHelperClass:o}),260:new i("EZ Port 260","ez-port-260","PortSection260",{width:n.unit(60,"in"),length:n.unit(156,"in"),insetWidth:n.unit(11,"in"),insetDepth:n.unit(22,"in")}),280:new i("EZ Port 280","ez-port-280","PortSection280",{width:n.unit(78,"in"),length:n.unit(156,"in"),insetWidth:n.unit(11,"in"),insetDepth:n.unit(22,"in"),pocketSpacingHelperClass:a}),"2i":new m("EZ Port 2i","ez-port-2i","PortSection2i",{width:n.unit(58.5,"in"),length:n.unit(168,"in"),insetWidth:n.unit(8,"in"),insetDepth:n.unit(25,"in")}),max:new s("EZ Port MAX","ez-port-max-extension","PortMAXSectionExtension",{width:n.unit(58.5,"in"),length:n.unit(146,"in"),height:n.unit(10.4375,"in"),pocketSpacingHelperClass:l}),maxEntry:new p("EZ Port MAX Entry","ez-port-max-entry","PortMAXSectionEntry",{width:n.unit(58.5,"in"),length:n.unit(149,"in"),height:n.unit(10.4375,"in"),pocketSpacingHelperClass:c}),maxEasyLiftEntry:new i("EZ Port MAX Easy-Lift Entry","ez-port-max-easy-lift-entry","PortMAXSectionEasyLiftEntry",{width:n.unit(58.5,"in"),length:n.unit(43.5,"in"),height:n.unit(10.4375,"in"),insetWidth:n.unit(8,"in"),insetDepth:n.unit(25,"in"),pocketSpacingHelperClass:u}),kayakLaunch:new h("Kayak Launch","ez-dock-kayak-launch","EZLaunch",{width:n.unit(58,"in"),length:n.unit(168,"in")}),boatPort:new i("EZ BoatPort","ez-boat-port","EZBoatPort",{width:n.unit(78,"in"),length:n.unit(164,"in"),insetWidth:n.unit(20,"in"),insetDepth:n.unit(5.75,"in"),pocketSpacingHelperClass:d}),boatPortSideExtension:new i("EZ BoatPort Side Extension","ez-boat-port-side-extension","EZBoatPortSideExtension",{width:n.unit(19.5,"in"),length:n.unit(164,"in"),pocketSpacingHelperClass:d})}},59465:(e,t,r)=>{const n=r(67275);e.exports=class EZPortSmallBow extends n{_modelIdentifier(){return"ez-port-small-bow"}materialSpecifier(){return this.materials.PortMAXSmallBow}}},53797:(e,t,r)=>{const n=r(55125),i=r(82144);let s;e.exports=class EZDockPolygonSection extends n{static builder(e){return s??=r(36608),new s(e)}static defaultType(){return i.triangle}static defaultPolygon(e){return this.defaultType().polygon()}}},23301:(e,t,r)=>{const n=r(49237);e.exports=class EZDockPolygonSectionType extends n{constructor(e,t,r,n){super(e,t,r),this._polygon=n}polygon(){return this._polygon}}},55125:(e,t,r)=>{const{Composite3DFigure:n,three:i}=r(37732),s=r(26716),o=r(57473),a=r(82144),l=r(6556),c=r(28430);let u;e.exports=class EZDockSection extends s{static builder(e,t){return u??=r(99940),new u(e,t)}static defaultType(){return a.sixty}static defaultWidth(){return this.defaultType().width()}static defaultLength(){return this.defaultType().length()}static defaultHeight(){return this.defaultType().height()}type(){return this._type??=this._defaultType()}setType(e){this._type=e,this.resetComponents()}width(){return this.type().width()}length(){return this.type().length()}height(){return this.componentOf().height()}_defaultType(){return this.constructor.defaultType()}color(){return this.componentOf().color()}thickness(){return this.height().toNumeric(this.unit())}angleChanged(e){super.angleChanged(e),this.resetComponents()}resetComponents(){this._model3D=void 0,super.resetComponents()}_modelIdentifier(){return this.type().modelId()}model3D(){return this._model3D??=this._defaultModel3D()}_defaultModel3D(){const e=this._rotationFor3DModel();return new o(this.locator().relatedTo(this.referencePoint()),this._modelIdentifier(),e,void 0,[this.color().materialName])}_rotationFor3DModel(){return(new i.Quaternion).setFromAxisAngle(new i.Vector3(0,0,1),this.angle())}materialSpecifier(){const e=this.type().materialSpecifierId();return this.materials[e]}selfMaterialLineItems(){return[new l(1,this.materialSpecifier())]}edgesInternalToDock(){const e=this.componentOf().edges();return this.edges().filter((t=>!e.some((e=>e.containsEdge(t)))))}snapPoints(){return this.edges().flatMap((e=>this.componentOf().snappingPointsForEdge(e)))}internalOnlySnapPoints(){return[]}connectedSnapPoints(){return this.snapPoints().filter((e=>this.edgesInternalToDock().some((t=>t.containsPoint(e)))))}components(){return[...super.components(),this.model3D()]}defaultFigure(){return new c(this)}threeFigure(){return n.withModel(this)}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_model3D"]}}},49237:(e,t,r)=>{const n=r(5403),i=r(77848),s=r(82253);e.exports=class EZDockSectionType{static defaultHeight(){return s.standardHeight}constructor(e,t,r,n,i,s){this._label=e,this._modelId=t,this._materialSpecifierId=r,this._width=n,this._length=i,this._height=s??this.constructor.defaultHeight()}get label(){return this._label}get value(){return this}modelId(){return this._modelId}materialSpecifierId(){return this._materialSpecifierId}width(){return this._width}length(){return this._length}height(){return this._height}percentAboveWaterline(){return.825}couplerClassForLocator(e,t){const r=-this.constructor.defaultHeight().toNumeric(t);return e.z().isNearTo(r)?this.regularCouplerClass():this.lowProfileCouplerClass()}regularCouplerClass(){return n}lowProfileCouplerClass(){return i}equals(e){return this.modelId()===e.modelId()}}},82144:(e,t,r)=>{const n=r(63768),{Polygon:i,$P:s}=r(62048),o=r(23301),a=r(49237),l=r(82253),c=n.unit(58.5,"in"),u=l.standardSectionLength,d=n.unit(78,"in"),h=function(){const e=c.toNumeric("in"),t=d.toNumeric("in"),r=s(0,0),n=s(e,0),o=s(e,e),a=o.to(r),l=-Math.abs(a.length()-t),u=a.stretchedBy(l);return new i([r,n,o,u.begin(),u.end()])}(),p=function(){const e=u.toNumeric("in"),t=c.toNumeric("in"),r=s(0,0).to(s(0,e)),n=30..degreesToRadians(),o=-Math.cos(n)*t,a=r.stretchedBy(-t).movedBy(o);return new i([r.begin(),r.end(),a.end(),a.begin()])}();e.exports={baby:new a("Baby Dock","ez-dock-baby-dock","DockSectionBaby",n.unit(39,"in"),c),forty:new a('40" Dock',"ez-dock-40in","DockSection40in",n.unit(39,"in"),u),sixty:new a('60" Dock',"ez-dock-60in","DockSection60in",c,u),eighty:new a('80" Dock',"ez-dock-80in","DockSection80in",d,u),hundred:new a('100" Dock',"ez-dock-100in","DockSection100in",n.unit(98,"in"),d),eightyLowProfile:new a('80" Low Profile Dock',"ez-dock-80in-low-profile","DockSection80inLowProfile",d,u,l.lowProfileHeight),triangle:new o("Triangle","ez-dock-tri","DockSectionTriangle",h),halfHex:new o("Half Hexagon","ez-dock-half-hex","DockSectionHalfHex",p)}},65147:(e,t,r)=>{const n=r(58017),i=r(59663);e.exports=class EZDockBenchFigure extends i{_prepareForDrawing(e,t){super._prepareForDrawing(e,t),e.fillStyle=this.supportColors().fillStyle,this.model().supportShapes().forEach((t=>e._drawPolygon(t))),e.fillStyle=this.colors().fillStyle}shapes2D(){return this.model().primaryShapes()}colors(){return this.model().color().figureColors}supportColors(){return this.model().supportColor().figureColors}selfHandle(){return new n(this)}}},80077:(e,t,r)=>{const n=r(39792),i=r(55033),s=r(82253);e.exports=class EZDockFigure extends n{_drawSelf(e,t){this._drawDockShapeOnly(e,t)}dock(){return this.model()}_drawDockShapeOnly(e,t){e.fillStyle=this.colors().dockSurface,e.strokeStyle=this.colors().strokeStyle,e.lineWidth=e._pixelsToDrawingUnits(this.properties().dockLineWidth),e._drawPolygon(this._shapeOnlyGeometry()),this._drawSnapPoints(e)}constrainWidthAdjustment(e){return this.dock().constrainWidthAdjustment(e)}constrainLengthAdjustment(e){return this.dock().constrainLengthAdjustment(e)}_sideEdgeHandles(){return this.dock().sideEdges().map((e=>new i(e,this,this.constrainWidthAdjustment.bind(this))))}_endEdgeHandles(){return this.dock().endEdges().map((e=>new i(e,this,this.constrainLengthAdjustment.bind(this))))}_drawSnapPoints(e){this._drawSnapPointsAtLocators(this.model().unconnectedSnapPoints(),e,this.colors().emptyCoupler,this.colors().lowProfileEmptyCoupler),this._drawSnapPointsAtLocators(this.model().connectedSnapPoints(),e,this.colors().filledCoupler)}_drawSnapPointsAtLocators(e,t,r,n=r){t._alterAndRestoreAfter((()=>{t.strokeStyle=this.colors().strokeStyle,t.lineWidth=t._pixelsToDrawingUnits(this.properties().couplerLineWidth),e.forEach((e=>{const i=this._isSnapPointLowProfile(e);t.fillStyle=i?n:r;const s=this._snapPointShape(e);t._drawPolygon(s)}))}))}_isSnapPointLowProfile(e){const t=s.lowProfileHeight.toNumeric(this.dock().unit()),r=this.dock().percentAboveWaterline?.();if(!r)return!1;const n=-t*r;return e.z().isNearTo(n)}_snapPointShape(e){const t=1.5,r=e.edge().direction(),n=e.edge().normal(),i=n.multipliedBy(-1.5),s=n.multipliedBy(-2),o=r.multipliedBy(t),a=o.add(s),l=o.negated().add(s),c=e.add(i).expandedBy(t).toPolygon().xy(),u=c.rotatedBy(c.centroid(),n.theta()),d=e.add(a).expandedByRadius(1).toPolygon(8).xy(),h=e.add(l).expandedByRadius(1).toPolygon(8).xy();return u.union(d,h).first()}defaultHandles(){return[...this.rotationHandles(),...this._endEdgeHandles(),...this._sideEdgeHandles(),this.selfHandle()]}colors(){return this._baseColors()}_baseColors(){return this.dock().color().figureColors}defaultProperties(){return{dockLineWidth:2,couplerLineWidth:1}}}},41107:(e,t,r)=>{const n=r(84757),i=r(55033),s=r(46960);e.exports=class EZDockGangwayFigure extends n{_drawSelf(e,t){this._drawShapeOnly(e,t),this._drawRailings(e,t);this.model().deckingType().hatchFigure&&this._drawHatching(e,t)}_drawShapeOnly(e,t){e.fillStyle=this.colors().deckingSurface,e.strokeStyle=this.colors().strokeStyle,e.lineWidth=e._pixelsToDrawingUnits(1.5),e._drawPolygon(this.model().geometry())}_drawRailings(e,t){e.lineWidth=e._pixelsToDrawingUnits(1),e.fillStyle=this.colors().railing,this.model().railingShapes().forEach((t=>{e._drawPolygon(t)}))}_drawHatching(e,t){const r=this.model().angle(),n=r+90..degreesToRadians(),i=this.model().geometry();e._alterAndRestoreAfter((()=>{e.lineWidth=.3,e.strokeStyle=this.colors().strokeStyle,s(e,i,5,[r,n])}))}colors(){return this.model().color().figureColors}_constrainLength(e){return this.model().constrainLength(e)}_edgeHandles(){return this.model().endEdges().map((e=>new i(e,this,this._constrainLength.bind(this))))}}},39334:(e,t,r)=>{const n=r(80077);e.exports=class EZDockLaunchFigure extends n{_shapeOnlyGeometry(){return this.model().shapes2D().first()}defaultHandles(){return[...this.rotationHandles(),this.selfHandle()]}}},47116:(e,t,r)=>{const n=r(85438),i=r(80077);e.exports=class EZDockPolygonDockFigure extends i{_endEdgeHandles(){return[]}_sideEdgeHandles(){return[]}rotationHandles(){return this._rotationHandleLocations().map((e=>new n(this.model(),e)))}_rotationHandleLocations(){const e=this.model().vertices();return e.filter(((t,r)=>{const n=e[r-1]??e.last(),i=e[r+1]??e.first();return!n.to(i).containsPoint(t)}))}}},28430:(e,t,r)=>{const n=r(80077);e.exports=class EZDockSectionFigure extends n{_drawSnapPoints(e){this._drawSnapPointsAtLocators(this.model().connectedSnapPoints(),e,this.colors().filledCoupler)}defaultHandles(){return[]}colors(){const e={...this._baseColors()};return e.dockSurface="transparent",e.emptyCoupler="transparent",e.strokeStyle=e.sectionStrokeStyle,e.filledCoupler=e.interiorFilledCoupler,e}defaultProperties(){return{...super.defaultProperties(),dockLineWidth:1}}}},62193:(e,t,r)=>{const n=r(80077);e.exports=class EZPortFigure extends n{_shapeOnlyGeometry(){const e=this.model().locator(),t=this.model().angle(),[r,...n]=this.model().sections().map((r=>r.geometry().rotatedBy(e,-t)));return r.union(...n).first().rotatedBy(e,t)}_endEdgeHandles(){return this.model().hasAdjustableEndEdges()?super._endEdgeHandles():[]}defaultHandles(){return[...this.rotationHandles(),...this._endEdgeHandles(),this.selfHandle()]}}},58017:(e,t,r)=>{const n=r(14558);e.exports=class EZDockAccessoryHandle extends n{_findSnappingLocation(e){const t=this.model().snapPointsForFrames(this._snappableFrames());return this._closestPoint(t,e)}}},98573:(e,t,r)=>{const n=r(63768),i=r(10711);e.exports=class EZBoatPortPocketSpacingHelper extends i{internalOnlySnapPointDistancesAlongSideEdges(){return[n.multiply(this.basePocketSpacingIncrement(),4.5)]}sternEndHeight(){return n.unit(10.25,"in")}}},24607:(e,t,r)=>{const n=r(63768),i=r(82253);e.exports=class EZDockPocketSpacingHelper{constructor(e){this._unit=e}unit(){return this._unit}pocketSpacing(){return i.pocketSpacing}pocketDistancesForEdge(e,t=this.pocketSpacing()){const r=this.pocketSpacing(),i=t.toNumeric(this.unit()),s=r.toNumeric(this.unit()).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES);if(e.length()<=i)return[];const o=e.length()-i,a=Math.round(o/s),l=n.divide(t,2),c=[l];let u=l;for(let e=0;e<a;e++)u=n.add(u,r),c.push(u);return c}}},10711:(e,t,r)=>{const n=r(63768),i=r(47159);e.exports=class EZPort280PocketSpacingHelper extends i{snapPointDistancesFromBowEdgeEndpoints(){return[...super.snapPointDistancesFromBowEdgeEndpoints(),n.multiply(this.basePocketSpacingIncrement(),1.5)]}}},27915:(e,t,r)=>{const n=r(34459);e.exports=class EZPortMaxEasyLiftEntryPocketSpacingHelper extends n{snapPointDistancesAlongSideEdges(){return[]}}},89941:(e,t,r)=>{const n=r(63768),i=r(34459);e.exports=class EZPortMaxExtensionPocketSpacingHelper extends i{snapPointDistancesFromBowEdgeEndpoints(e){const t=super.snapPointDistancesFromBowEdgeEndpoints();return e?[...t,n.multiply(this.basePocketSpacingIncrement(),1.5)]:t}snapPointDistancesFromSternEdgeEndpoints(){return[n.divide(this.basePocketSpacingIncrement(),2)]}}},34459:(e,t,r)=>{const n=r(63768),i=r(24742),s=r(47159);e.exports=class EZPortMaxPocketSpacingHelper extends s{internalOnlySnapPointDistancesAlongSideEdges(){return[]}bowEndHeight(e,t){return t?n.add(e,i.heightAboveDock()):e}sternEndHeight(e){return e}}},47159:(e,t,r)=>{const n=r(63768),i=r(82253);e.exports=class EZPortPocketSpacingHelper{basePocketSpacingIncrement(){return i.pocketSpacing}internalOnlySnapPointDistancesFromBowEdgeEndpoints(){return[]}internalOnlySnapPointDistancesFromSternEdgeEndpoints(){return[]}internalOnlySnapPointDistancesAlongSideEdges(){return[n.multiply(this.basePocketSpacingIncrement(),6.5)]}snapPointDistancesAlongSideEdges(){return[n.divide(this.basePocketSpacingIncrement(),2),n.multiply(this.basePocketSpacingIncrement(),1.5)]}snapPointDistancesFromBowEdgeEndpoints(){return[n.divide(this.basePocketSpacingIncrement(),2)]}snapPointDistancesFromSternEdgeEndpoints(){return[]}bowEndHeight(e){return e}sternEndHeight(){return n.unit(10.75,"in")}}},90907:(e,t,r)=>{const n=r(63768),i=r(47159);e.exports=class EZPortVXPPocketSpacingHelper extends i{internalOnlySnapPointDistancesAlongSideEdges(){return[n.multiply(this.basePocketSpacingIncrement(),5.5)]}}},56858:(e,t,r)=>{const n=r(90218);e.exports=Object.freeze({none:new n("None"),horizontal:new n("Horizontal",{addPosts:!0}),vertical:new n("Vertical",{verticalWrap:!0})})},65979:(e,t,r)=>{const{CircleFigure:n}=r(7340),i=r(83102),s=r(35668);e.exports=class FalconGlassHole extends i{constructor(e,t){super(),this._locator=e,this._radius=t}locator(){return this._locator}radius(){return this._radius}materialPricingLineItemFor(e,t,r={}){return this.componentOf().materialPricingLineItemFor(e,t,r)}selfMaterialLineItems(){return[this.materialPricingLineItemFor(1,this.materials.GlassHole)]}projectedViewFigure(e,t,r){const i=this.radius().toNumeric(this.unit()),o=new s(this.locator(),e,t,r),a=new n(o,i);return a.updateProperties({fillStyle:"#00000000",strokeStyle:"#000",lineWidth:.01}),a}}},5205:(e,t,r)=>{const n=r(63768),{EditableProperty:i}=r(7340),s=r(94263),o=r(42947);e.exports=class FalconMaterialPricingLineItem extends s{constructor(e,t,r,{...n}={}){super(e,t,void 0,{...n}),this._project=r}project(){return this._project}projectPriceList(){return this.project().priceList()}_defaultPropertiesCollection(){return{[o.unitPrice]:new i(this,"Custom Unit Price",{type:"number",label:"Unit Price"})}}_calculatedPricingIdentifier(){const e=this.specifier(),t=this.projectPriceList(),r=this._specifierIdentifier();return t.retail[r]?r:e.details().pricingIdentifier||r}_specifierIdentifier(){return this.specifier().identifier()}_pricingIdentifier(){return this.specifier().details().pricingIdentifier||this._specifierIdentifier()}customUnitPrice(){const e=this._calculatedPricingIdentifier();return this.projectPriceList().retail[e]??0}setCustomUnitPrice(e){const t=this._specifierIdentifier();this.projectPriceList().retail[t]=e}unitPrice(e){const t=this.perUnit(e),r=this.customUnitPrice();return t?n.unit(r,`1/${t}`):r}perUnit(e){return e.perUnit(this._pricingIdentifier())}breakdownItemSortKeyOverride(){}}},60261:(e,t,r)=>{const n=r(63768),{EditableProperty:i}=r(7340),{extend:s}=r(50988),o=r(67603),a=r(97477),l=r(97807),c=r(76281),u=r(72175),d=r(28184),h=r(46651),p=r(84514),m=r(25630),f=r(97209),g=r(17092),y=r(56858),b=r(29892);class FalconRailingCollection extends a{railingStyles(){return g()}sectionClass(){return this.railingStyle().sectionClass?.()||l}runClass(){return d}defaultDisplayProperties(){return this._observeSectionProperties(),new p(this,[new o(this,[new i(this,"Railing Style",{type:"trayselect",choices:this.railingStyleChoices()}),new i(this,"Railing Height",{type:"select",choices:this.railingHeightChoices()}),...this._postProperties(),...this._handrailProperties(),...this.railingStyle().displayProperties(),new i(this,"Toggle Platform Side",{type:"action",perform:()=>this.togglePlatformSide()}),this.baselineHeightProperty()]),new m(this.sections(),"showOnCollection")])}_observeSectionProperties(){this.sections().forEach((e=>e.addPropertyChangedObserver(this,this._sectionPropertyChanged)))}_sectionPropertyChanged(){this.resetDisplayProperties()}_handrailProperties(){return this.railingStyle().canHaveHandrail()?[...this._baseHandrailProperties(),...this._supplementalHandrailProperties()].filter((e=>e)):[]}_baseHandrailProperties(){return[new i(this,"Handrail Color",{type:"select",choices:this.handrailColorChoices()}),new i(this,"Handrail Height",{type:"select",choices:this.handrailHeightChoices()})]}_supplementalHandrailProperties(){return[new i(this,"ADA Handrail Type",{type:"select",choices:this.adaHandrailTypeChoices()})]}_postProperties(){const e=[new i(this,"Fascia Mounted",{type:"boolean",label:"Fascia Mounted"}),new i(this,"Post Style",{type:"segment",choices:this.postStyleChoices()})],t=new i(this,"Post Height",{type:"select",choices:this.postHeightChoices()});this.railingStyle().canSetPostHeight()&&e.push(t),e.push(...this._postWidthProperties());const r=new i(this,"Post Color",{type:"select",choices:this.postColorChoices()});return e.push(r),e}_postWidthProperties(){const e=[],t=new i(this,"Post Width",{type:"select",choices:this.postWidthChoices()});this.railingStyle().supportedPostWidths().length>1&&e.push(t);const r=this.railingStyle().supportedPostWidths().last().equals(this.postWidth()),n=new i(this,"Use Mixed Width Posts",{type:"boolean",label:'Make Terminal Posts 2.5"',disabled:r}),s=this.railingStyles();return this.railingStyle().equals(s.picket)&&e.push(n),e}showPostColorProperty(){return this.railingStyle().showPostColorProperty()}togglePlatformSide(){this._platformAlongNormal=!this.platformAlongNormal(),this.resetSections(),this.sections().forEach((e=>{e.resetAnnotations()}))}platformAlongNormal(){return void 0===this._platformAlongNormal&&(this._platformAlongNormal=!0),this._platformAlongNormal}toggleStructureSide(){this.togglePlatformSide()}structureAlongNormal(){return this.platformAlongNormal()}_defaultPostDescriptor(){const e=this.postMountStyle().postZOffset(),t=n.add(this.postHeight(),e);return new c(`${this.railingHeight()} - ${this.railingStyle().label}`,t,[this.railingHeight()],{postWidth:this.postWidth(),postStyle:this.postStyle(),postColor:this.postColor(),railingStyle:this.railingStyle(),postMountStyle:this.postMountStyle(),terminalPostWidth:this.terminalPostWidth()})}resetPostDescriptor(){this.setPostDescriptor()}glassPanelHeightAboveGround(){return n.unit(3,"in")}railingHeight(){return this._railingHeight||(this._railingHeight=this._defaultRailingHeight()),this._railingHeight}_defaultRailingHeight(){return n.unit(39,"in")}setRailingHeight(e){this._railingHeight=e,this.railingStyle().isPostHeightLinkedToRailingHeight()&&this.resetPostHeight(),this.resetPostDescriptor()}railingHeightChoices(){return this.railingStyle().supportedRailingHeights().map((e=>({label:`${Math.round(e.toNumeric("in"))}"`,value:e})))}_coerceRailingHeight(){const e=this.railingStyle().supportedRailingHeights(),t=e.map((e=>e.toNumeric(this.unit()).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES))),r=this.railingHeight().toNumeric(this.unit()).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES);t.includes(r)||this.setRailingHeight(e.first())}railingStyle(){return this._railingStyle||(this._railingStyle=this._defaultRailingStyle(),this.startObservingRailingStyle()),this._railingStyle}_coercePostStyle(){const e=this.railingStyle().supportedPostStyles();e.includes(this.postStyle())||this.setPostStyle(e.first())}setRailingStyle(e){e?.copyPropertiesFromStyle(this.railingStyle()),this.stopObservingRailingStyle(),this._railingStyle=e,this.startObservingRailingStyle(),this._coercePostStyle(),this._coerceRailingHeight(),this._coercePostHeight(),this._coercePostWidth(),this._coercePostMountStyle(),this._coerceStairMountSurface(),this.railingStyle().coerceGlassThickness?.(),this.resetPostDescriptor(),this.resetDisplayProperties()}startObservingRailingStyle(){this.railingStyle()?.addPropertyChangedObserver(this,this.railingStylePropertyChanged)}stopObservingRailingStyle(){this.railingStyle()?.removePropertyChangedObserver(this,this.railingStylePropertyChanged)}railingStylePropertyChanged(){this.resetSections()}railingStyleChoices(){const e=this.railingStyles();return[e.standardGlass,e.infinity,e.picket,e.framed,e.baseShoe,e.standoff].filter((e=>e.canApplyToRailingCollection(this)))}_defaultRailingStyle(){return this.railingStyles().standardGlass}_coerceRailingStyle(){this.railingStyle().canApplyToRailingCollection(this)||this.setRailingStyle(this.railingStyleChoices().first())}_coerceStairMountSurface(){this.sections().forEach((e=>e.coerceStairMountSurface()))}postMountStyle(){return this._postMountStyle??=this._defaultPostMountStyle()}setPostMountStyle(e){this._postMountStyle=e,this.resetPostDescriptor()}_defaultPostMountStyle(){return this.railingStyle().supportedPostMountStyles().first()}_coercePostMountStyle(){const e=this.railingStyle().supportedPostMountStyles(),t=this.postMountStyle();e.some((e=>e.equals(t)))||this.setPostMountStyle(e.first())}fasciaMounted(){return this.postMountStyle().isFascia()}setFasciaMounted(e){if(!1===e&&!1===this.fasciaMounted())return;const t=e?new h:void 0;this.setPostMountStyle(t)}toggleFasciaMounted(){this.setFasciaMounted(!this.fasciaMounted())}showFasciaMountedProperty(){const e=this.railingStyle().supportedPostMountStyles();return!!e.some((e=>e.isFascia()))&&e.length>1}postStyle(){return this._postStyle||(this._postStyle=this.postStyleChoices().first().value),this._postStyle}setPostStyle(e){this._postStyle=e,this.resetPostDescriptor()}postStyleChoices(){const e=this.railingStyle().supportedPostStyles();return u.POST_STYLES_CHOICES.filter((t=>e.includes(t.value)))}showPostStyleProperty(){return this.railingStyle().hasPosts()}postHeight(){return this._postHeight||(this._postHeight=this._defaultPostHeight()),this._postHeight}_defaultPostHeight(){return this.railingStyle().isPostHeightLinkedToRailingHeight()?this.railingHeight():this._defaultIndependentPostHeight()}_defaultIndependentPostHeight(){return n.unit(36,"in")}setPostHeight(e){this._postHeight=e,this.resetPostDescriptor()}resetPostHeight(){this._postHeight=void 0}postHeightChoices(){return this.railingStyle().supportedPostHeights().map((e=>({label:`${e.toNumeric("in").roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES)}"`,value:e})))}_coercePostHeight(){if(this.railingStyle().isPostHeightLinkedToRailingHeight())return void this.resetPostHeight();const e=this.railingStyle().supportedPostHeights(),t=e.map((e=>e.toNumeric(this.unit()).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES))),r=this.postHeight().toNumeric(this.unit()).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES);t.includes(r)||this.setPostHeight(e.first())}postWidth(){return this._postWidth||(this._postWidth=n.unit(2.5,"in")),this._postWidth}setPostWidth(e){this._postWidth=e,this.resetDisplayProperties(),this.resetPostDescriptor()}postWidthChoices(){return this.railingStyle().supportedPostWidths().map((e=>({label:`${e.toNumeric("in").roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES)}"`,value:e})))}useMixedWidthPosts(){return void 0===this._useMixedWidthPosts&&(this._useMixedWidthPosts=!0),this._useMixedWidthPosts}setUseMixedWidthPosts(e){this._useMixedWidthPosts=Boolean(e),this.resetPostDescriptor()}toggleUseMixedWidthPosts(){this.setUseMixedWidthPosts(!this.useMixedWidthPosts())}terminalPostWidth(){return this.useMixedWidthPosts()?this.railingStyle().supportedPostWidths().last():this.postWidth()}_coercePostWidth(){const e=this.railingStyle().supportedPostWidths(),t=e.map((e=>e.toNumeric(this.unit()).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES))),r=this.postWidth().toNumeric(this.unit()).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES);t.includes(r)||this.setPostWidth(e.first())}postColor(){return this._postColor||(this._postColor=this.postColorChoices().first().value),this._postColor}setPostColor(e){this._postColor=e,this.resetPostDescriptor()}postColorChoices(){return[b.black,b.bronze,b.brown,b.nuSparkle,b.rideauBrown,b.silver,b.taupe,b.white]}handrailColorChoices(){return[...this.postColorChoices(),b.brass].sort(((e,t)=>e.label>t.label?1:-1))}handrailColor(){return this._handrailColor||(this._handrailColor=this.handrailColorChoices().first().value),this._handrailColor}setHandrailColor(e){this._handrailColor=e,this.resetHandrailDescriptor()}handrailHeight(){return this._handrailHeight||(this._handrailHeight=this.handrailHeightChoices().first().value),this._handrailHeight}setHandrailHeight(e){this._handrailHeight=e,this.resetHandrailDescriptor()}handrailHeightChoices(){return[n.unit(36,"in"),n.unit(42,"in")].map((e=>({label:`${e.toNumeric("in")}"`,value:e})))}adaHandrailType(){return this._adaHandrailType??=y.horizontal}setADAHandrailType(e){this._adaHandrailType=e,this.resetHandrailDescriptor()}adaHandrailTypeChoices(){return[y.none,y.horizontal,y.vertical]}_defaultHandrailDescriptor(){return{height:this.handrailHeight(),color:this.handrailColor(),radius:n.unit(1,"in"),extensionSegmentLength:n.unit(12,"in"),adaHandrailType:this.adaHandrailType()}}handrailDescriptor(){return this._handrailDescriptor??=this._defaultHandrailDescriptor()}setHandrailDescriptor(e){this._handrailDescriptor=e,this.resetSections()}resetHandrailDescriptor(){this.setHandrailDescriptor()}runAdded(e){super.runAdded(e),this._coerceRailingStyle()}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_postDescriptor","_handrailDescriptor"]}postRestorationAction(){this.railingRuns().filter((e=>0===e.edge().xy().length())).forEach((e=>this.removeRun(e))),0===this.railingRuns().length&&this.componentOf().remove(this),super.postRestorationAction(),this.startObservingRailingStyle()}}s(FalconRailingCollection,f),e.exports=FalconRailingCollection},13353:(e,t,r)=>{const n=r(14025),i=r(67042);e.exports=class FalconRailingOpening extends n{gateTypes(){return i}railingHeight(){return this.postProvider().railingHeight()}colorOptions(){return this.postProvider().postDescriptor().options().postColor}annotationDirection(){return this.componentOf().structureAlongNormal()}postMountStyleAnnotationOffset(){return this.componentOf().sections().first().postMountStyleAnnotationOffset()}}},28184:(e,t,r)=>{const n=r(63768),{StableID:i,DisplayProperties:s}=r(7340),{extend:o}=r(50988),a=r(33496),l=r(71096);class FalconRailingRun extends a{stringerHeightAboveStairNose(){return n.unit(2,"in")}extendStringerThroughLastStep(){return!1}_sectionsHaveBeenGenerated(){this._observeSectionProperties()}_observeSectionProperties(){this.sections().forEach((e=>e.addPropertyChangedObserver(this,this._sectionPropertyChanged)))}_sectionPropertyChanged(){this.saveSectionProperties()}components(){return[...super.components(),this.structure()].filter((e=>e))}minimumAngleBetweenRuns(){return 0}hasStringer(){return this.sections().first().hasStringer()}_postWidth(){const e=this.sections().first().railingPosts().first();return e?e.postWidth():n.unit(0,"in")}sectionLengthAdjusterIncrement(){const e=this.placementStrategy();return e.stepSnapSize?e.stepSnapSize():super.sectionLengthAdjusterIncrement()}postRestorationAction(){super.postRestorationAction(),this._observeSectionProperties()}}o(FalconRailingRun,i),o(FalconRailingRun,s),o(FalconRailingRun,l),e.exports=FalconRailingRun},73645:(e,t,r)=>{const n=r(54400),i=r(67287),s=r(17130),o=r(36539),a=r(42947);e.exports=class FalconRailingsPricingStrategy extends n{breakdownLineItems(e,t){const r=super.breakdownLineItems(e,t),n=new s;return n.addElement(i.forValue(a.item,"Multiplier")),n.addElement(new o(e.multiplierProperty(),a.quantity)),n.addElement(i.forValue(a.unit,"")),n.addElement(i.forValue(a.unitPrice,"")),n.addElement(i.forValue(a.amount,"")),n.addElement(i.forValue(a.invoice,"")),r.push(n),r}subtotal(e){return e.materialList().lineItems().sum((e=>e.invoicePrice(this.pricingSource())))}totalPrice(e){return this.subtotal(e)}}},88367:(e,t,r)=>{const n=r(61750),{EditableProperty:i}=r(7340),s=r(43812),o=r(94263),a=r(5205),l=r(5090),c=r(42947),u=r(80317),d=r(95580);e.exports=class FalconRailingsProject extends s{logo(){return"falcon-railings-logo.png"}railingCollections(){return this.componentsForRoles(u.RAILING_COLLECTION)}get materials(){return d}multiplierProperty(){return this._multiplierProperty||(this._multiplierProperty=new i(this,"Multiplier",{type:"number",label:"Quantity"})),this._multiplierProperty}multiplier(){return void 0===this._multiplier&&(this._multiplier=2),this._multiplier}setMultiplier(e){this._multiplier=e}laborQuantityProperty(){return this._laborQuantityProperty||(this._laborQuantityProperty=new i(this,"Labor Quantity",{type:"number",label:"Quantity"})),this._laborQuantityProperty}laborQuantity(){return void 0===this._laborQuantity&&(this._laborQuantity=1),this._laborQuantity}setLaborQuantity(e){this._laborQuantity=e}_materialLineItems(){const e=super._materialLineItems();if(e.length>0){const t=o.builder(this.materials.Labor).propertiesCollection({[c.quantity]:this.laborQuantityProperty()}).build();e.push(t)}return e}materialPricingLineItemFor(e,t,r={}){return new a(e,t,this,r)}pdfDocumentClass(){return n}glassPanels(){const e=this.railingCollections();return[...e.flatMap((e=>e.sections())).flatMap((e=>e.glassPanels?.()??[])),...e.flatMap((e=>e.gates())).map((e=>e.panel?.())).filter(Boolean)]}glassPanelsMap(){return this._glassPanelsMap??=this._defaultGlassPanelsMap()}_defaultGlassPanelsMap(){const e=this.glassPanels(),t=e.uniqueValues();return new l(t.map((t=>{const r=e.filter((e=>t.equals(e)));return[t,r.length]})))}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_multiplierProperty","_laborQuantityProperty","_glassPanelsMap"]}}},57854:(e,t,r)=>{const n=r(63768),{DimensionAnnotation:i}=r(62048),s=r(74372),o=r(95208);e.exports=class FalconStairHeightAnnotation extends i{_format(e){return o(e.toInches(),void 0,!0)}beginHeight(){return this._format(n.unit(-this.edgeBegin().z(),this.unit()))}endHeight(){return this._format(n.unit(-this.edgeEnd().z(),this.unit()))}fadeWithDistance(){return!0}defaultFigure(){return new s(this)}}},54648:(e,t,r)=>{const{NormalToEdgeLocator:n}=r(62048),i=r(63768),s=r(69435),o=r(59663);e.exports=class FalconStandoffButton extends s{static radius(){return i.unit(.75,"in")}constructor(e){super(),this._locator=e}locator(){return this._locator}endLocator(){return this._endLocator??=this._defaultEndLocator()}_defaultEndLocator(){const e=this.componentOf().structureDirection()*this.length().toNumeric(this.unit());return new n(this.locator(),e)}length(){return i.unit(2,"in")}radius(){return this.constructor.radius()}edge(){return this._edge??=this.locator().to(this.endLocator())}railingStyle(){return this.componentOf().railingStyle()}color(){return this.componentOf().railingStyle().standoffButtonColor()}material(){return this.color().materialName()}materialSpecifier(){return this.materials.StandoffButton}materialLineItems(){return[this.project().materialPricingLineItemFor(1,this.materialSpecifier())]}defaultFigure(){return new o(this,{strokeStyle:this.color().strokeStyle(),fillStyle:this.color().fillStyle(),lineWidth:.3})}}},94931:(e,t,r)=>{const n=r(63768),i=r(1828);e.exports=class FalconBaseShoeGlassBlock extends i{glassHeightSubtraction(){return n.unit(.5,"in")}}},14294:(e,t,r)=>{const n=r(63768),i=r(53185);e.exports=class FalconFramedGlassRailBlock extends i{_glassPanelRailInset(){return n.unit(3/8,"in")}_glassPanelPostInset(){return n.unit(-1.5,"in")}resetComponents(){super.resetComponents(),this._glassPanel=void 0}components(){return[...super.components(),this.glassPanel()].filter((e=>e))}glassThickness(){return this.section().glassThickness()}glassPanel(){return this._glassPanel||(this._glassPanel=this._defaultGlassPanel(),this._glassPanel.setComponentOf(this)),this._glassPanel}glassPanelHeight(){const e=n.subtract(this.topRailHeight(),this.bottomRailHeight());return n.subtract(e,this._glassPanelRailInset())}_defaultGlassPanel(){const e=this.section().glassPanelClass(),t=this.section().glassThickness(),r=e.GLASS_THICKNESS_OPTIONS.find((e=>e.value===t)).value;return new e(this._glassPanelBottomEdge(),this.glassPanelHeight(),r,this.section())}_glassPanelEdge(){return this.edge().stretchedBy(2*-this._glassPanelInset()).relativeToEdge(this.edge())}_glassPanelBottomEdge(){const e=this.bottomRailHeight(),t=n.subtract(e,this._glassPanelRailInset()).toNumeric(this.unit());return this._glassPanelEdge().addZ(-t)}_glassPanelInset(){return this.postWidth().toNumeric(this.unit())/2-this._glassPanelPostInset().toNumeric(this.unit())}materialLineItems(){return[...this.components().flatMap((e=>e.materialLineItems()))]}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_glassPanel"]}}},1828:(e,t,r)=>{const n=r(63768),i=r(14294);e.exports=class FalconNoPostGlassBlock extends i{_glassPanelInset(){return this.componentOf().panelGap().toNumeric(this.unit())/2}glassHeightSubtraction(){return n.unit(0,"in")}_glassPanelRailInset(){return n.unit(0,"in")}bottomRailHeight(){return this.glassHeightSubtraction()}components(){return[this.glassPanel()]}}},53947:(e,t,r)=>{const n=r(63768),{FixedEdgeLocator:i}=r(62048),s=r(61940),o=r(60044),a=r(53185);class FalconPicketRailBlock extends a{static supportBarThreshold=n.unit(48,"in");constructor(e,t){super(e),this._picketEdge=t||e}railEdge(){return this.edge()}picketEdge(){return this._picketEdge}supportBarZOffset(){return n.unit(6,"in")}supportBarThreshold(){return this.constructor.supportBarThreshold}picketSpacing(){return n.unit(4,"in")}picketHeight(){const e=this.topRailHeight().toNumeric(this.unit()),t=this.topRailDepth().toNumeric(this.unit()),r=this.bottomRailHeight().toNumeric(this.unit());return n.unit(e-t-r,"in")}resetComponents(){super.resetComponents(),this._supportBar=void 0,this._railingPickets=void 0}components(){return[...super.components(),...this.railingPickets(),this.supportBar()].filter((e=>e))}_defaultLengthAnnotation(){return super._defaultLengthAnnotation(this.picketEdge())}railingPickets(){return this._railingPickets||(this._railingPickets=this._defaultRailingPickets()),this._railingPickets}supportBar(){return this._supportBar||(this._supportBar=this._defaultSupportBar()),this._supportBar}_defaultSupportBar(){if(!this.topRailHeight().equals(this.supportBarThreshold()))return;const e=-n.subtract(this.topRailHeight(),this.supportBarZOffset()).toNumeric(this.unit()),t=this.picketEdge().addZ(e),r=new s(t,this.bottomRailWidth(),this.bottomRailDepth(),this.colorOptions());return r.setComponentOf(this),r}_defaultRailingPickets(){const e=-this.bottomRailHeight().toNumeric(this.unit()),t=this.picketSpacing().toNumeric(this.unit()),r=this.picketEdge().addZ(e),n=r.length();if(2*t>=n)return[this._makePicket(r,n/2)];const i=r.stretchedBy(this._picketLayoutEdgeInset()).relativeToEdge(this.picketEdge()),s=Math.ceil(i.length()/t),o=i.length()/s,a=[];for(let e=0;e<=s;e++){const t=this._makePicket(i,o*e);a.push(t)}return a}_picketLayoutEdgeInset(){return-this.picketSpacing().toNumeric(this.unit())}_makePicket(e,t){const r=new o(new i(e,t),this.picketHeight(),this.postProvider());return r.setComponentOf(this),r}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_supportBar","_railingPickets"]}}e.exports=FalconPicketRailBlock},53185:(e,t,r)=>{const n=r(63768),i=r(84155),s=r(61940),o=r(44476);e.exports=class FalconRailingBlock extends i{postWidth(){return this.section().postWidth()}colorOptions(){return this.section().colorOptions()}railingHeight(){return this.section().railingHeight()}topRailHeight(){return this.infillTopHeight()}topRailDepth(){return this.section().topRailDepth()}_levelSectionInfillBottomHeight(){return n.unit(3,"in")}bottomRailHeight(){const e=this.infillBottomHeight(),t=n.add(n.divide(this.bottomRailDepth(),2),this.section().stringerHeightAboveStairNose?.()||n.unit(0,"in"));return n.add(e,t)}bottomRailWidth(){return n.unit(1.5,"in")}bottomRailDepth(){return n.unit(1,"in")}generateBottomRail(){const e=-this.bottomRailHeight().toNumeric(this.unit()),t=this.edge().addZ(e),r=new s(t,this.bottomRailWidth(),this.bottomRailDepth(),this.colorOptions());return r.setComponentOf(this),r}shouldHaveTopRail(){return!1}shouldHaveBottomRail(){return!1}rails(){return this._rails??=this._defaultRails()}_defaultRails(){return[this.generateBottomRail()]}resetComponents(){super.resetComponents(),this._rails=void 0}components(){return[...super.components(),...this.rails()].filter((e=>e))}allLocatedMaterials(){return this.components().flatMap((e=>e.allLocatedMaterials()))}annotations(){return[...super.annotations(),this.lengthAnnotation()].filter((e=>e))}lengthAnnotation(){return this._lengthAnnotation||(this._lengthAnnotation=this._defaultLengthAnnotation()),this._lengthAnnotation}_defaultLengthAnnotation(e=this.edge()){const t=35+this.section().postMountStyleAnnotationOffset();return new o(e.xy(),t*this.section().annotationDirection(),this.unit(),{formatWithFeet:!1,fractionDenominator:8,fadeWithDistance:!0})}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_rails","_lengthAnnotation"]}}},3668:(e,t,r)=>{const n=r(63768),i=r(1828);e.exports=class FalconStandoffGlassBlock extends i{glassPanelHeight(){const e=super.glassPanelHeight(),t=this.componentOf().postMountStyle().postZOffset();return n.add(e,t)}}},29892:(e,t,r)=>{const n=r(43320);e.exports=Object.freeze({black:new n("Black","falcon-black","#0f0f0f","#3b3b3b"),brass:new n("Brass","metallic-brass-low-gloss","#c7a130","#a4771b"),bronze:new n("Bronze C34","falcon-bronze-c34","#3F392B","#635a44"),brown:new n("Brown C33","falcon-brown-c33","#615138","#947f5f"),nuSparkle:new n("Nu Sparkle","falcon-nu-sparkle","#babebf","#e8eced"),rideauBrown:new n("Rideau Brown","falcon-rideau-brown","#3F382D","#695e4c"),silver:new n("Silver","falcon-silver","#b0b4b5","#e6e5e3"),taupe:new n("Taupe","falcon-taupe","#483C32","#706358"),white:new n("White","falcon-white","#e8ebeb","#9fa1a1"),stainlessSteel:new n("Stainless Steel","aluminum","#b0b4b5","#8a8b8b")})},67042:(e,t,r)=>{const{GateType:n}=r(8423),i=r(4125),s=r(16819);e.exports={DEFAULT:new n("None",void 0),GLASS:new n("Glass",i),PICKET:new n("Picket",s)}},4125:(e,t,r)=>{const n=r(63768),{MaterialSpecifier:i}=r(93613),{Composite3DFigure:s}=r(37732),{RelativeLocator:o}=r(62048),a=r(27424),l=r(5063),c=r(98190),u=r(48909);e.exports=class FalconGlassGate extends l{static minimumPostHeight(){return a.supportedPostHeights().first()}postProvider(){return this.opening().postProvider()}postMountStyleAnnotationOffset(){return this.componentOf().postMountStyleAnnotationOffset()}colorOptions(){return this.postProvider().postColor()}materialName(){return this.colorOptions().materialName()}materialSpecifier(){return new i("GlassGate","Glass Gate")}requiredOpeningWidth(e){return n.unit(3,"ft")}reset(){super.reset(),this.resetComponents()}resetComponents(){this._panel=void 0,this._hinges=void 0}panelInset(){return n.unit(4,"in")}componentLayoutLine(){const e=this.flipped(),t=this.opening(),r=e?t.postAfter():t.postBefore(),n=e?r.nextSection():r.previousSection(),i=r.mountStyle().componentLayoutEdgeOffset(n),s=this.panelInset().toNumeric(this.unit());return t.edge().stretchedBy(-s).shiftedAlongNormalBy(i)}panel(){return this._panel||(this._panel=this.defaultPanel()),this._panel}panelHeight(){return n.subtract(this.postProvider().railingHeight(),this.glassPanelHeightAboveGround())}glassPanelHeightAboveGround(){return this.postProvider().glassPanelHeightAboveGround()}_glassThicknessCode(){return this.railingStyle().glassThickness()}thickness(){return this.materials[this.railingStyle().materialIdentifier()].details().thickness}railingStyle(){return this.postProvider().railingStyle()}panelEdge(){const e=-this.glassPanelHeightAboveGround().toNumeric(this.unit());return this.componentLayoutLine().addZ(e)}defaultPanel(){const e=new(this.railingStyle().glassPanelClass())(this.panelEdge(),this.panelHeight(),this._glassThicknessCode());return e.setComponentOf(this),e}hinges(){return this._hinges||(this._hinges=this.defaultHinges()),this._hinges}defaultHinges(){const e=this.flipped(),t=e?this.opening().postAfter():this.opening().postBefore(),r=this.hingeZOffset().toNumeric(this.unit()),n=t.postWidth().toNumeric(this.unit())/2,i=this.edge().direction(),s=e?i.negated():i,a=s.multipliedBy(n),l=t.surfaceLocator().add(a),u=t.topLocator().add(a),d=l.movedBy(0,0,-r),h=u.movedBy(0,0,r),p=o.makeRelativeTo(d,this.edge().end()),m=o.makeRelativeTo(h,this.edge().end()),f=new c(p,s);f.setComponentOf(this);const g=new c(m,s);return g.setComponentOf(this),[g,f]}hingeZOffset(){return n.unit(8,"in")}components(){return[this.panel(),...this.hinges()]}defaultFigure(){const e=u.withModel(this);return e.setHandles([]),e}threeFigure(){return s.withModel(this)}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_panel","_hinges"]}}},98190:(e,t,r)=>{const{three:n}=r(37732),{$P:i,Polygon:s,RelativeLocator:o}=r(62048),a=r(41908),l=r(59663);e.exports=class FalconGlassGateHinge extends a{constructor(e,t){super(),this._locator=e,this._direction=t}locator(){return this._locator}direction(){return this._direction}referencePoint(){return this.locator()}colorOptions(){return this.componentOf().colorOptions()}materialName(){return this.colorOptions().materialName()}_modelIdentifier(){return"falcon-glass-gate-hinge"}materialIdentifiers(){return[this.materialName()]}rotation(){return(new n.Quaternion).setFromUnitVectors(new n.Vector3(0,-1),this.direction().toThreeJS())}_normal(){const e=this.direction().multipliedBy(1),t=i(0,0),r=t.add(e);return t.to(r).normal()}geometry(){return this._geometry||(this._geometry=this.defaultGeometry()),this._geometry}defaultGeometry(){const e=this._glassPanel().panelThickness().toNumeric(this.unit()),t=this._normal().multipliedBy(e),r=this.direction().multipliedBy(3),n=this.locator();return new s([o.makeRelativeTo(n.add(t),n),o.makeRelativeTo(n.add(t.negated()),n),o.makeRelativeTo(n.add(t.negated()).add(r),n),o.makeRelativeTo(n.add(t).add(r),n)])}_glassPanel(){return this.componentOf().panel()}defaultFigure(){const e=this.colorOptions().fillStyle();return new l(this,{strokeStyle:"#0f0f0f",fillStyle:e,lineWidth:.1})}}},16819:(e,t,r)=>{const n=r(63768),{MaterialSpecifier:i}=r(93613),{Composite3DFigure:s}=r(37732),{Rectangle:o}=r(62048),a=r(5063),l=r(27424),c=r(53947),u=r(48909),d=r(30202),h=r(88646),p=r(56214),m=r(61453);e.exports=class FalconPicketGate extends a{static minimumPostHeight(){return l.supportedPostHeights().first()}requiredOpeningWidth(e){return n.unit(3,"ft")}railingHeight(){return this.componentOf().railingHeight()}postProvider(){return this.componentOf().postProvider()}colorOptions(){return this.componentOf().colorOptions()}materialName(){return this.colorOptions().materialName()}fillStyle(){return this.colorOptions().fillStyle()}strokeStyle(){return this.colorOptions().strokeStyle()}annotationDirection(){return this.componentOf().annotationDirection()}postMountStyleAnnotationOffset(){return this.componentOf().postMountStyleAnnotationOffset()}topRailDepth(){return m.topRailDepth}railBlock(){return this._railBlock||(this._railBlock=this._defaultRailBlock()),this._railBlock}_defaultRailBlock(){const e=this.blockEdge(),t=new c(e);return t.setComponentOf(this),t}blockEdge(){const e=-(this.frameSideWidth()+this.componentOf().postBefore().postWidth().toNumeric(this.unit())+n.unit(1.5,"in").toNumeric(this.unit()));return this.edge().stretchedBy(e).relativeToEdge(this.edge())}frameSides(){return this._frameSides||(this._frameSides=this._defaultFrameSides()),this._frameSides}_defaultFrameSides(){const e=this.edge().vector().xy().normalized(),t=this.blockEdge().stretchedBy(-this.frameSideWidth()).relativeToEdge(this.edge()),r=t.begin(),n=t.end(),i=-this.railBlock().bottomRailHeight().toNumeric(this.unit()),s=-this.railBlock().topRailHeight().toNumeric(this.unit()),o=r.addZ(i),a=r.addZ(s),l=n.addZ(i),c=n.addZ(s);return[new d(o,a,this._gateSideCrossSection(),this._gateSideSpecifier(),e),new d(l,c,this._gateSideCrossSection(),this._gateSideSpecifier(),e)]}frameSideWidth(){return this.thickness().toNumeric(this.unit())}_gateSideSpecifier(){return new i("Gate Frame","Gate Frame",{materialName:this.materialName(),fillStyle:this.fillStyle(),strokeStyle:this.strokeStyle()})}_gateSideCrossSection(){const e=this.frameSideWidth()/2;return new h([new p(new o(-e,-e,2*e,2*e))])}thickness(){return n.unit(1.5,"in")}components(){return[this.railBlock(),...this.frameSides()]}reset(){super.reset(),this.resetComponents()}resetComponents(){this._railBlock=void 0,this._frameSides=void 0}materialSpecifier(){return new i("PicketGate","Picket Gate")}defaultFigure(){const e=u.withModel(this);return e.setHandles([]),e}threeFigure(){return s.withModel(this)}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_railBlock","_frameSides"]}}},5063:(e,t,r)=>{const n=r(35961);e.exports=class FalconSingleGate extends n{materialLineItems(){return[this.project().materialPricingLineItemFor(1,this.materialSpecifier())]}}},68773:(e,t,r)=>{const n=r(63768),{Polygon:i,ExtrudedPolygon:s,RelativeLocator:o,ProportionalEdgeLocator:a,$P:l}=r(62048),c=r(81996),u=r(44476),d=r(98305),h=r(30691),p=r(26933),m=r(65979),f=r(76905),g=r(35668),y=[{label:'3/8"',value:"3_8"},{label:'1/2"',value:"1_2"},{label:'1/4"',value:"1_4"},{label:'7/16" LAM',value:"7_16"},{label:'9/16" LAM',value:"9_16"}];e.exports=class FalconGlassPanel extends c{static GLASS_THICKNESS_OPTIONS=y;static maxPanelWidth(){return n.unit(48,"in")}constructor(e,t,r,n){super(e,t),this._thicknessCode=r,this._section=n}thicknessCode(){return this._thicknessCode}section(){return this._section}hasGlassMountedHandrail(){return this.section()?.hasGlassMountedHandrail()}isScalloped(){return this.section()?.hasScallopStairGlass()}thicknessLabel(){const e=this.thicknessCode();return this.constructor.GLASS_THICKNESS_OPTIONS.find((t=>t.value===e)).label}isBeginPanel(){if(this.componentOf()!==this.section())return!1;return this===this.section().glassPanels().first()}isEndPanel(){if(this.componentOf()!==this.section())return!1;return this===this.section().glassPanels().last()}materialPricingLineItemFor(e,t,r={}){return this.project().materialPricingLineItemFor(e,t,r)}selfMaterialLineItems(){const e=[],t=this._glassLineItem(this.area(),this.panelMaterial(),"sqft");if(this.isLevel()||(t.add(n.multiply(t.quantity(),.5)),e.push(this.materialPricingLineItemFor(1,this.materials.NonRectangularGlass)),this.isScalloped()&&e.push(this.materialPricingLineItemFor(1,this.materials.ScallopedGlass))),e.push(t),this.hasGlassMountedHandrail()){const t=this._handrailBracketQuantity();e.push(this.materialPricingLineItemFor(t,this.materials.GlassHandrailBracket))}return e}materialSpecifier(){}holes(){return this._holes??=this._defaultHoles()}_defaultHoles(){const e=[...this.terminalHoles(),...this.handrailHoles()];return e.forEach((e=>e.setComponentOf(this))),e}terminalHoleRadius(){return n.unit(.5,"in")}handrailHoleRadius(){return n.unit(.375,"in")}terminalHoles(){if(!this.hasTerminalHoles())return[];const e=this._baseTerminalHoleLocations(),t=this._terminalHoleHeights();return e.flatMap((e=>t.map((t=>e.addZ(-t))))).map((e=>new m(e,this.terminalHoleRadius())))}_baseTerminalHoleLocations(){const e=this.section().postLocations(),t=this.edge(),r=[];if(this.isBeginPanel()){const n=t.closestPointTo(e.first());r.push(n)}if(this.isEndPanel()){const n=t.closestPointTo(e.last());r.push(n)}return r}_terminalHoleHeights(){return[n.unit(3,"in").toNumeric(this.unit()),n.unit(18,"in").toNumeric(this.unit())]}hasTerminalHoles(){const e=this.componentOf().railingStyle(),t=e.hasTerminalGlassHoles?.(),r=this.isBeginPanel()||this.isEndPanel();return t&&r}handrailHoles(){return this.hasGlassMountedHandrail()?this._handrailHoleLocations().map((e=>new m(e,this.handrailHoleRadius()))):[]}handrailHoleLayoutEdge(){const e=n.unit(31,"in").toNumeric(this.unit());return this.edge().addZ(-e)}_handrailHoleLocations(){const e=this._handrailBracketQuantity(),t=this.handrailHoleLayoutEdge();return h.locatorsAlongEdge(t,e)}_handrailBracketQuantity(){if(!this.hasGlassMountedHandrail())return 0;const e=this.handrailDoubleBracketLengthThreshold().toNumeric(this.unit());return this.edge().length()>e?2:1}handrailDoubleBracketLengthThreshold(){return n.unit(48,"in")}_glassLineItem(e,t,r){return this.materialPricingLineItemFor(e,t,{unit:r})}panelMaterial(){const e=this.isLevel()?"":"_Stair";return this.materials[`Glass${e}${this.thicknessCode()}`]}panelThickness(){return this._panelThickness||(this._panelThickness=this.panelMaterial().details().thickness),this._panelThickness}panelHeightAboveGround(){return this.section().glassPanelHeightAboveGround()}zLevel(){return this.edge().begin().z()}shape3D(){return this._shape3D??=this.isScalloped()?this._scallopGlassShape3D():super.shape3D()}_scallopGlassShape3D(){const e=this.section(),t=this.edge(),r=this.panelThickness().toNumeric(this.unit()),n=(e.isBeginAtSlopeBottom()?t.reversed():t).shiftedAlongNormalBy(-r/2),a=n.xy(),l=this.height().toNumeric(this.unit()),[c,u]=n.endpoints().map((e=>e.addZ(-l))),d=this.panelHeightAboveGround().toNumeric(this.unit()),h=this._scallopGlassHeightAboveTread().toNumeric(this.unit()),[p,m]=n.endpoints().map((e=>e.addZ(d-h))),f=e.placementStrategy(),g=f.stepRise().toNumeric(this.unit()),y=[p.z(),m.z()+g],b=f.defaultStructureRepresentation().treadEdges().filter((e=>{const t=e.begin().z();return y.first()<t&&t<y.last()})),v=a.direction(),_=this._scallopGlassHeightOffsetFromRiser().toNumeric(this.unit()),x=v.multipliedBy(_),w=b.first().shortestLineFrom(p).xy().vector().negated().add(x).addZ(-h),R=[b.first().end().add(w)];b.slice(1,-1).forEach((e=>{e.endpoints().forEach((e=>R.push(e.add(w))))})),R.push(b.last().begin().add(w));const k=p.xy().addZ(R.first().z()),j=m.xy().addZ(R.last().z()),z=new i([c,k,...R,j,u]);return new s(z,r,((e,t)=>{const r=a.normal().multipliedBy(t);return e?.map((e=>new o(e,r.x(),r.y(),0)))}),!1)}_scallopGlassHeightAboveTread(){return n.unit(3,"in")}_scallopGlassHeightOffsetFromRiser(){return n.unit(1,"in")}projectedAnnotations(e,t,r){return[...this.projectedBoundingDimensionAnnotations(e,t,r),...this.projectedBoundingEdgeAnnotations(e,t,r),...this.projectedTerminalHoleAnnotations(e,t,r),...this.projectedHandrailHoleAnnotations(e,t,r)]}projectedBoundingDimensionAnnotations(e,t,r){return this.projectedBoundingEdges(e,t,r).map((e=>new u(e,30,this.unit())))}projectedBoundingEdgeAnnotations(e,t,r){if((this.edge().end().z()-this.edge().begin().z()).isNearTo(0))return[];return this.projectedBoundingEdges(e,t,r).map((e=>new d(e)))}projectedTerminalHoleAnnotations(e,t,r){return this.hasTerminalHoles()?[...this.projectedTerminalHoleCenterlineAnnotations(e,t,r),...this.projectedTerminalHoleHorizontalDistanceAnnotations(e,t,r),...this.projectedTerminalHoleVerticalDistanceAnnotations(e,t,r)]:[]}projectedTerminalHoleCenterlineAnnotations(e,t,r){return this.terminalHoleEdgeSideEdgeMap().map((n=>{const i=h.projectedEdge(n.layoutEdge,e,t,r);return new d(i)}))}projectedTerminalHoleHorizontalDistanceAnnotations(e,t,r){const n=this.terminalHoleEdgeSideEdgeMap();return n.map((({layoutEdge:n,sideEdge:i})=>{const s=new a(n,.25),o=new a(i,.25);return h.projectedEdge(s.to(o),e,t,r)})).map((e=>new u(e,0,this.unit())))}projectedTerminalHoleVerticalDistanceAnnotations(e,t,r){return this.terminalHoleEdgeSideEdgeMap().flatMap((({layoutEdge:n,sideEdge:i})=>{const s=n.begin(),o=this._terminalHoleHeights().map((e=>s.addZ(-e))),a=[s,...o],l=h.pointArrayToEdges(a),c=h.projectedEdge(n,e,t,r),u=h.projectedEdge(i,e,t,r),d=f.directionTo(c.begin(),u.begin()).normalized(),p=c.normal();return d.dot(p)<0?l.map((e=>e.reversed())):l})).map((n=>{const i=h.projectedEdge(n,e,t,r);return new u(i,30,this.unit())}))}projectedHandrailHoleAnnotations(e,t,r){return this.hasGlassMountedHandrail()?[this.projectedHandrailHoleCenterlineAnnotation(e,t,r),this.projectedHandrailHoleVerticalDistanceAnnotation(e,t,r),...this.projectedHandrailHoleHorizontalDistanceAnnotations(e,t,r)]:[]}projectedHandrailHoleCenterlineAnnotation(e,t,r){const n=h.projectedEdge(this.handrailHoleLayoutEdge(),e,t,r);return new d(n)}projectedHandrailHoleVerticalDistanceAnnotation(e,t,r){const n=h.projectedEdge(this.handrailHoleLayoutEdge(),e,t,r),i=h.projectedEdge(this.topEdge(),e,t,r),s=1===this._handrailBracketQuantity()?.125:.5,o=new a(n,s),l=new a(i,s),c=o.to(l);return new u(c,0,this.unit())}projectedHandrailHoleHorizontalDistanceAnnotations(e,t,r){const n=this._handrailHoleLocations(),i=this.topEdge(),s=n.map((e=>i.closestPointTo(e))),o=i.begin(),a=i.end();return s.map((n=>{const i=n.distanceTo(o)<n.distanceTo(a)?o.to(n):n.to(a);return h.projectedEdge(i,e,t,r)})).map((e=>new u(e,30,this.unit())))}projectedBoundingEdges(e,t,r){const n=this.height().toNumeric(this.unit()),i=this.edge().begin(),s=this.edge().end(),o=i.z()<=s.z(),a=o?i.z()-n:s.z()-n,l=o?s.z():i.z(),c=h.flattenedAtZ(this.edge(),a),u=h.flattenedAtZ(this.edge(),l),d=o?u.begin().to(c.begin()):c.end().to(u.end());return[h.projectedEdge(d,e,t,r),h.projectedEdge(u.reversed(),e,t,r)]}terminalHoleEdgeSideEdgeMap(){const e=this.edge(),t=this.topEdge(),r=this._baseTerminalHoleLocations(),n=[e.begin().to(t.begin()),e.end().to(t.end())];return r.map((r=>{const n=e.closestPointTo(r),i=t.closestPointTo(r);return n.to(i)})).map((e=>{const t=n.reduce(((t,r)=>r.begin().distanceTo(e.begin())<t.begin().distanceTo(e.begin())?r:t));return{layoutEdge:e,sideEdge:t}}))}equals(e){const t=this._dimensionsMatch(e),r=this._panelHolesEquals(e),n=this._scallopedEquals(e);return t&&r&&n}_scallopedEquals(e){const t=this.isScalloped(),r=e.isScalloped();return!t&&!r}_panelHolesEquals(e){const t=this.holes(),r=e.holes();if(t.length!==r.length)return!1;const n=this.edge(),i=e.edge(),s=l(0,0,1),o=[n.xy().direction(),s],a=[i.xy().direction(),s],c=t.map((e=>new g(e.locator(),...o))),u=r.map((e=>new g(e.locator(),...a))),d=new g(n.begin(),...o),h=new g(i.begin(),...a),p=c.map((e=>f.directionTo(e,d))),m=u.map((e=>f.directionTo(e,h)));return p.every(((e,t)=>e.equals(m[t])))}_dimensionsMatch(e){return this._distanceUnitsMatch(this.panelThickness(),e.panelThickness())&&super._dimensionsMatch(e)}projectedViewFigure(e,t,r){const n=super.projectedViewFigure(e,t,r),i=this.holes().map((n=>n.projectedViewFigure(e,t,r)));return p.withFigures([n,...i],e,t,r)}components(){return this.holes()}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_holes"]}}},60044:(e,t,r)=>{const n=r(63768),{MaterialSpecifier:i}=r(27871),{CompositeFigure:s}=r(7340),{Composite3DFigure:o}=r(37732),{$P:a}=r(62048),l=r(30202),c=r(88646),u=r(56214),d=r(80371);e.exports=class FalconPicket extends d{constructor(e,t){super(e),this._height=t}height(){return this._height}width(){return n.unit(.625,"in")}length(){return this.width()}descriptor(){return this.postProvider().postDescriptor()}selectedColorOptions(){return this.descriptor().options().postColor}materialName(){return this.selectedColorOptions().materialName()}colorName(){return this.selectedColorOptions().label}fillStyle(){return this.selectedColorOptions().fillStyle()}strokeStyle(){return this.selectedColorOptions().strokeStyle()}components(){return[this.picket()]}picket(){return this._picket||(this._picket=this._defaultPicket()),this._picket}_defaultPicket(){const e=this.materialSpecifier(),t=this.locator().edge().vector().xy().normalized();return new l(this.topLocator(),this.locator(),this._crossSection(),e,t)}_crossSection(){const e=this.width().toNumeric(this.unit())/2,t=a(0,0).expandedBy(e);return new c([new u(t)])}defaultFigure(){return s.withModel(this)}threeFigure(){return o.withModel(this)}materialSpecifier(){const e=this.colorName();return new i(`${e}Picket`,`${e} Picket`,{materialName:this.materialName(),fillStyle:this.fillStyle(),strokeStyle:this.strokeStyle()})}materialLineItems(){return[]}}},94699:(e,t,r)=>{const{ExtrudedPolygon:n,Polygon:i,RelativeLocator:s}=r(62048),o=r(68773);e.exports=class FalconStandoffGlassPanel extends o{shape3D(){return this._shape3D??=this._defaultShape3D()}_defaultShape3D(){return this._isPanelAtStairBottom()?this.bottomOfStairsShape3D():super.shape3D()}bottomOfStairsShape3D(){const e=this.panelThickness().toNumeric(this.unit()),t=e/2,r=-this.height().toNumeric(this.unit()),o=this.edge().shiftedAlongNormalBy(-t),a=o.addZ(r),l=this._bottomCutEdge(),c=l.intersectionsWithLine(o).first(),u=l.closestPointTo(a.end());if(!c||!u)return super.shape3D();const d=new i([o.begin(),c.relatedTo(this.edge().begin()),u.relatedTo(this.edge().begin()),a.end(),a.begin()]);return new n(d,e,((e,t)=>{const r=this.edge().normal().multipliedBy(t);return e?.map((e=>new s(e,r.x(),r.y(),0)))}),!1)}_isPanelAtStairBottom(){if(this.section().isLevel())return!1;const e=this.componentOf(),t=e.isFirstBlock(),r=e.isLastBlock();if(!t&&!r)return!1;const n=this.section();return t?n.isBeginAtSlopeBottom():n.isEndAtSlopeBottom()}_bottomCutEdge(){const e=this._bottomTreadStandoffButtonEdge(),t=this.section().edge().length(),r=e.stretchedBy(t).shiftedAlongNormalBy(this._normalOffsetForBottomCutEdge()),n=this.section().standoffButtonInset().toNumeric(this.unit());return r.addZ(n)}_bottomTreadStandoffButtonEdge(){const e=this.section().standoffButtonLocations(),[t,r]=e.slice(-2);return t.to(r)}_normalOffsetForBottomCutEdge(){const e=this.panelThickness().toNumeric(this.unit())/2,t=this.section().structureAlongNormal()?-e:e;return(this.section().postMountStyle().sectionEdgeOffsetFromCenter().toNumeric(this.unit())+t)*this.section().structureDirection()}}},95580:(e,t,r)=>{const n=r(63768),{MaterialSpecifier:i}=r(93613),s=[new i("InlinePost","Inline Posts"),new i("CornerPost","Corner Posts"),new i("TerminalPost","Terminal Posts"),new i("StairInlinePost","Stair Inline Posts"),new i("StairCornerPost","Stair Corner Posts"),new i("StairTerminalPost","Stair Terminal Posts"),new i("StairTransitionPost","Transition Posts"),new i("StairTransitionCornerPost","Transition Corner Posts"),new i("StairStringerMountPost","Stair Stringer Mount Posts"),new i("FasciaMount","Fascia Mount"),new i("Glass1_4",'1/4" Glass Panels',{thickness:n.unit(1/4,"in")}),new i("Glass3_8",'3/8" Glass Panels',{thickness:n.unit(3/8,"in")}),new i("Glass1_2",'1/2" Glass Panels',{thickness:n.unit(.5,"in")}),new i("Glass7_16",'7/16" Glass Panels',{thickness:n.unit(7/16,"in")}),new i("Glass9_16",'9/16" Glass Panels',{thickness:n.unit(9/16,"in")}),new i("Glass_Stair3_8",'3/8" Stair Glass Panels',{thickness:n.unit(3/8,"in"),pricingIdentifier:"Glass3_8"}),new i("Glass_Stair1_2",'1/2" Stair Glass Panels',{thickness:n.unit(.5,"in"),pricingIdentifier:"Glass1_2"}),new i("Glass_Stair1_4",'1/4" Stair Glass Panels',{thickness:n.unit(1/4,"in"),pricingIdentifier:"Glass1_4"}),new i("Glass_Stair7_16",'7/16" LAM Stair Glass Panels',{thickness:n.unit(7/16,"in"),pricingIdentifier:"Glass7_16"}),new i("Glass_Stair9_16",'9/16" LAM Stair Glass Panels',{thickness:n.unit(9/16,"in"),pricingIdentifier:"Glass9_16"}),new i("Handrail","Handrails"),new i("TopGuard","Top Guards"),new i("SecondGuard","Second Guards"),new i("NonRectangularGlass","Non-rectangular glass panels"),new i("ScallopedGlass","Scalloped glass panels"),new i("GlassHole","Glass Hole"),new i("GlassHandrailBracket","Glass-Mount Handrail Bracket"),new i("PicketRail","Picket Rail"),new i("PicketRail48",'48" Picket Rail'),new i("BaseShoeRail36",'36" Base Shoe Rail'),new i("BaseShoeRail42",'42" Base Shoe Rail'),new i("BaseShoeRail48",'48" Base Shoe Rail'),new i("StandoffRail36",'36" Standoff Rail'),new i("StandoffRail39",'39" Standoff Rail'),new i("StandoffRail42",'42" Standoff Rail'),new i("Rail","Top/Bottom Rail"),new i("StandoffButton","Standoff Button"),new i("Labor","Labor")],o={};s.forEach((e=>{o[e.identifier()]=e})),e.exports=o},46651:(e,t,r)=>{const n=r(63768),i=r(9760);e.exports=class FalconFasciaMountStyle extends i{get label(){return"Fascia"}postZOffset(){return n.unit(10,"in")}materialLineItems(e,t){return[t.materialPricingLineItemFor(1,e.FasciaMount)]}sectionEdgeOffsetFromCenter(e){return n.divide(e,2)}terminalPostInset(e){const t=e.postWidth(),r=this.sectionEdgeOffsetFromCenter(t),i=this.anchorOffset(),s=n.add(r,i);return n.multiply(s,-1)}hasBasePlate(){return!1}isFascia(){return!0}}},9760:(e,t,r)=>{const n=r(63768),i=r(83741);e.exports=class FalconPostMountStyle extends i{structureEdgeOffsetFromCenter(e){return n.unit(0,"in")}sectionEdgeOffsetFromCenter(e){return n.unit(0,"in")}terminalPostInset(e){const t=e.postWidth();return this.sectionEdgeOffsetFromCenter(t)}anchorOffset(){return n.unit(1.5,"in")}annotationOffset(e){return 0}hasBasePlate(){return!0}isFascia(){return!1}}},303:(e,t,r)=>{const n=r(63768),i=r(9760),s=r(72175);e.exports=class FalconStandardMountStyle extends i{postZOffset(){return n.unit(0,"in")}structureEdgeOffsetFromCenter(e){const t=s.basePlateMaterialSpecifier().details().width,r=n.divide(t,2),i=this.anchorOffset();return n.add(r,i)}annotationOffset(e){const t=e.postWidth();return-this.sectionEdgeOffsetFromCenter(t).toNumeric(e.unit())}}},75706:(e,t,r)=>{const n=r(63768),i=r(46651);e.exports=class FalconStandoffFasciaMountStyle extends i{postZOffset(){return n.unit(8,"in")}sectionEdgeOffsetFromCenter(e){return n.unit(1.5,"in")}}},18479:(e,t,r)=>{const n=r(72175);e.exports=class FalconPicketRailingPost extends n{heightReduction(){return this.componentOf().topRailDepth()}}},7127:(e,t,r)=>{const{MaterialSpecifier:n}=r(93613),{three:i}=r(37732),s=r(57473),o=r(18479);e.exports=class FalconPicketRailingTerminalPost extends o{legMaterialSpecifier(){if(!this._legMaterialSpecifier){const e=super.legMaterialSpecifier(),t=this.postProvider().postDescriptor().options().terminalPostWidth,r=e.details();r.width=t,this._legMaterialSpecifier=new n(e.identifier(),e.name(),r)}return this._legMaterialSpecifier}railConnectorSleeveParts(){return this._railConnectorSleeveParts||(this._railConnectorSleeveParts=this._defaultRailConnectorSleeveParts()),this._railConnectorSleeveParts}_defaultRailConnectorSleeveParts(){const e=this.previousSection(),t=this.nextSection();if(!(e&&t))return[];if(e.edge().direction().equals(t.edge().direction()))return[];return e.sloped()||t.sloped()?this._createSlopeRailSleeve(e,t):this._createCornerRailSleeve(e,t)}railSleeveDepth(){return this.componentOf().topRailDepth().toNumeric(this.unit())-.1}_createSlopeRailSleeve(e,t){const r=e.edge().begin(),n=t.edge().end(),i=-this.surfaceLocator().z()>-r.z(),o=-this.surfaceLocator().z()>-n.z(),a=i||o?"down":"up",l="down"===a?0:-this.railSleeveDepth(),c=this.topLocator().addZ(l),u=`falcon-picket-rail-${a}ward-slope-sleeve`,d=this._rotationForSection(e),h=this._rotationForSection(t,!0),p=[this.materialName()];return[new s(c,u,d,void 0,p),new s(c,u,h,void 0,p)]}_createCornerRailSleeve(e,t){const r=this.topLocator(),n="falcon-picket-rail-corner-sleeve",i=this._rotationForSection(e),o=this._rotationForSection(t,!0),a=[this.materialName()];return[new s(r,n,i,void 0,a),new s(r,n,o,void 0,a)]}_rotationForSection(e,t=!1){const r=t?e.edge().reversed():e.edge(),n=r.normalizedAngle()+Math.PI_2,s=r.phi()-Math.PI_2,o=(new i.Quaternion).setFromAxisAngle(new i.Vector3(0,0,1),n);return(new i.Quaternion).setFromAxisAngle(new i.Vector3(1,0),s).premultiply(o)}components(){return[...super.components(),...this.railConnectorSleeveParts()]}nonEssentialProperties(){return[super.nonEssentialProperties(),"_railConnectorSleeveParts"]}}},88394:(e,t,r)=>{const n=r(22295);e.exports=class FalconRailingCornerPost extends n{postLineItem(){const e=this.componentOf()?.sloped?.(),t=e?this.materials.StairCornerPost:this.materials.CornerPost;return this.materialPricingLineItemFor(1,t)}}},72175:(e,t,r)=>{const n=r(63768),{MaterialSpecifier:i}=r(93613),{CompositeFigure:s}=r(7340),{Composite3DFigure:o}=r(37732),{$P:a,Rectangle:l}=r(62048),c=r(30202),u=r(80371),d=r(88646),h=r(56214),p=r(23202),m={round:"round",square:"square"},f=[{label:"Square",value:m.square,icon:"square"},{label:"Round",value:m.round,icon:"circle"}];e.exports=class FalconRailingPost extends u{static POST_STYLES=m;static POST_STYLES_CHOICES=f;static basePlateMaterialSpecifier(){return new i("BasePlate","Base Plate",{width:n.unit(4,"in"),depth:n.unit(4,"in"),thickness:n.unit(.25,"in")})}static legMaterialSpecifier(){return new i("InlinePost","InlinePost",{width:n.unit(2.5,"in"),depth:n.unit(2.5,"in")})}static glassPlateMaterialSpecifier(){return new i("GlassPlate","Glass Plate",{width:n.unit(2.5,"in"),depth:n.unit(.25,"in")})}constructor(e,t){super(e),this._gatePost=t}isGatePost(){return this._gatePost}materialPricingLineItemFor(e,t){return this.project().materialPricingLineItemFor(e,t)}basePlateMaterialSpecifier(){if(!this._basePlateMaterialSpecifier){const e=this.constructor.basePlateMaterialSpecifier(),t=this.colorName();this._basePlateMaterialSpecifier=new i(`${t}BasePlate`,`${t} Base Plate`,{width:e.details().width,depth:e.details().depth,thickness:e.details().thickness,materialName:this.materialName(),fillStyle:this.fillStyle(),strokeStyle:this.strokeStyle()})}return this._basePlateMaterialSpecifier}legMaterialSpecifier(){if(!this._legMaterialSpecifier){const e=this.constructor.legMaterialSpecifier(),t=this.colorName(),r=this.componentOf().postWidth();this._legMaterialSpecifier=new i(`${t}Post`,`${t} Post`,{width:r||e.details().width,depth:e.details().depth,materialName:this.materialName(),fillStyle:this.fillStyle(),strokeStyle:this.strokeStyle()})}return this._legMaterialSpecifier}glassPlateMaterialSpecifier(){if(!this._glassPlateMaterialSpecifier){const e=this.constructor.glassPlateMaterialSpecifier(),t=this.colorName();this._glassPlateMaterialSpecifier=new i(`${t}GlassPlate`,`${t} Glass Plate`,{width:e.details().width,depth:e.details().depth,materialName:this.materialName(),fillStyle:this.fillStyle(),strokeStyle:this.strokeStyle()})}return this._glassPlateMaterialSpecifier}descriptor(){return this.postProvider().postDescriptor()}mountStyle(){return this.descriptor().options().postMountStyle}railingStyle(){return this.descriptor().options().railingStyle}selectedColorOptions(){return this.descriptor().options().postColor||this.postProvider().postColorChoices().first().value}length(){return this.basePlateMaterialSpecifier().details().width}width(){return this.basePlateMaterialSpecifier().details().width}materialName(){return this.selectedColorOptions().materialName()}colorName(){return this.selectedColorOptions().label}fillStyle(){return this.selectedColorOptions().fillStyle()}strokeStyle(){return this.selectedColorOptions().strokeStyle()}surfaceLocator(){return this._relativeLocator(this.heightBelowSurface())}bottomLocator(){return this._simpleBottomLocator()}heightExtension(){return n.unit(0,"in")}heightReduction(){return n.unit(0,"in")}height(){const e=this.descriptor().postHeight(),t=n.add(e,this.heightExtension());return n.subtract(t,this.heightReduction())}heightBelowSurface(){return this.mountStyle().postZOffset()}basePlate(){return this._basePlate||(this._basePlate=this._defaultBasePlate()),this._basePlate}basePlateWidth(){return this.basePlateMaterialSpecifier().details().width}postWidth(){return this.legMaterialSpecifier().details().width}_defaultBasePlate(){if(!this.mountStyle().hasBasePlate())return;const e=this.basePlateMaterialSpecifier(),t=e.details().thickness.toNumeric(this.unit()),r=this.locator().edge().vector().xy().normalized();return new c(this.locator().addZ(-t),this.locator(),this._crossSection(e.details().width,e.details().depth),e,r)}leg(){return this._leg||(this._leg=this._defaultLeg()),this._leg}_defaultLeg(){const e=this.legMaterialSpecifier(),t=this.locator().edge().vector().xy().normalized();return new c(this.topLocator(),this.locator(),this._crossSection(this.postWidth()),e,t)}glassPlate(){return this._glassPlate||(this._glassPlate=this._defaultGlassPlate()),this._glassPlate}_defaultGlassPlate(){if(!this.railingStyle().hasGlassCoverPlate?.())return;const e=this.glassPlateMaterialSpecifier(),t=this.postProvider().glassPanelHeightAboveGround(),r=this.heightAboveSurface().toNumeric(this.unit())-t.toNumeric(this.unit()),n=this.locator().edge().vector().xy().normalized();return new c(this.topLocator(),this.topLocator().addZ(r),this._glassPlateCrossSection(e.details().width,e.details().depth),e,n)}_crossSection(e,t=e){const r=e.toNumeric(this.unit())/2,n=t.toNumeric(this.unit())/2,i=r/1.4;return this.descriptor().options().postStyle===this.constructor.POST_STYLES.round&&r===n?new d([new p(a(-r,0),a(-r,-i),a(-i,-r),a(0,-r)),new p(a(0,-r),a(i,-r),a(r,-i),a(r,0)),new p(a(r,0),a(r,i),a(i,r),a(0,r)),new p(a(0,r),a(-i,r),a(-r,i),a(-r,0))]):new d([new h(new l(-r,-n,2*r,2*n))])}_glassPlateCrossSection(e,t){const r=e.toNumeric(this.unit())/2,n=t.toNumeric(this.unit()),i=this.legMaterialSpecifier().details().width;let s=this.materials[this.railingStyle().materialIdentifier()].details().thickness.toNumeric(this.unit())+i.toNumeric(this.unit())/2;return this.postProvider().platformAlongNormal()||(s=-(s+n)),new d([new h(new l(s,-r,n,2*r))])}components(){return[this.basePlate(),this.leg(),this.glassPlate()].filter((e=>e))}postLineItem(){const e=this.componentOf()?.sloped?.(),t=e?this.materials.StairInlinePost:this.materials.InlinePost;return this.materialPricingLineItemFor(1,t)}materialLineItems(){return[...[this.postLineItem()],...this.mountStyle().materialLineItems(this.materials,this.project())]}boundingCube(){return this.components().map((e=>e.boundingCube())).reduce(((e,t)=>e.merge(t)))}zLevel(){return this.locator().z()}defaultFigure(){return s.withModel(this)}threeFigure(){return o.withModel(this)}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_leg","_basePlate","_glassPlate"]}}},91784:(e,t,r)=>{const n=r(72175);e.exports=class FalconRailingStairTransitionCornerPost extends n{postLineItem(){return this.materialPricingLineItemFor(1,this.materials.StairTransitionCornerPost)}}},4697:(e,t,r)=>{const n=r(72175);e.exports=class FalconRailingStairTransitionPost extends n{postLineItem(){return this.materialPricingLineItemFor(1,this.materials.StairTransitionPost)}}},39353:(e,t,r)=>{const n=r(63768),{MaterialSpecifier:i}=r(93613),{Rectangle:s}=r(62048),o=r(18479),a=r(30202),l=r(88646),c=r(56214);e.exports=class FalconRailingStringerPost extends o{static basePlateMaterialSpecifier(){return new i("BasePlate","Base Plate",{width:n.unit(3,"in"),depth:n.unit(8,"in"),thickness:n.unit(.25,"in")})}isBeginPost(){return!1}isEndPost(){return!1}section(){return this.componentOf()}placementStrategy(){return this.section().placementStrategy()}postLineItem(){return this.materialPricingLineItemFor(1,this.materials.StairStringerMountPost)}heightReduction(){return this.componentOf().topRailDepth?.()||n.unit(0,this.unit())}bottomLocator(){const e=n.add(this.section().stringerHeightAboveStairNose(),this.placementStrategy().verticalClearanceOffset(this.postWidth()));return super.bottomLocator().addZ(-e.toNumeric(this.unit()))}_defaultBasePlate(){if(!this.mountStyle().hasBasePlate())return;const e=this.basePlateMaterialSpecifier(),t=e.details().thickness.toNumeric(this.unit()),r=e.details().depth.toNumeric(this.unit())/2,n=e.details().width.toNumeric(this.unit())/2,i=this.locator().edge(),o=i.direction(),u=this.bottomLocator().addZ(-t),d=u.add(o.multipliedBy(-r)),h=u.add(o.multipliedBy(r)),p=new s(-n,0,2*n,-t),m=o.cross(i.normal()).normalized(),f=a.builder(this).beginLocator(d.relatedTo(u)).endLocator(h.relatedTo(u)).crossSection(new l([new c(p)])).materialSpecifier(e).planarNormal(m).build();return f.setComponentOf(this),f}}},22295:(e,t,r)=>{const n=r(63768),i=r(72175);e.exports=class FalconRailingTerminalPost extends i{postLineItem(){const e=this.componentOf()?.sloped?.(),t=e?this.materials.StairTerminalPost:this.materials.TerminalPost;return this.materialPricingLineItemFor(1,t)}heightExtension(){return this.isGatePost()?n.unit(3,"in"):n.unit(0,"in")}}},98666:(e,t,r)=>{const{PropertiesCollection:n,EditableProperty:i}=r(7340),s=r(25365),o=r(36941),a=r(43412),l=r(303);e.exports=class FalconBaseShoeGlassRailingStyle extends o{sectionClass(){return s}defaultDisplayProperties(){return new n(this,[new i(this,"Glass Thickness",{type:"select",choices:this.glassThicknessChoices()}),this.topGuardProperty()])}defaultSupportedGlassThicknesses(){return["1_2","9_16"]}supportedStairMountSurfaces(){return[new a]}supportedPostMountStyles(){return[new l]}canHaveHandrail(){return!0}hasPosts(){return!1}}},36941:(e,t,r)=>{const n=r(63768),{EditableProperty:i}=r(7340),s=r(86794),o=r(72175),a=r(27424),l=r(67042),c=r(68773);e.exports=class FramedGlassRailingStyle extends a{sectionClass(){return s}defaultDisplayProperties(){return[...super.defaultDisplayProperties(),...this._defaultDisplayProperties()]}_defaultDisplayProperties(){return[new i(this,"Glass Thickness",{type:"select",choices:this.glassThicknessChoices()})]}minMaxPostSpacing(){return n.unit(12,"in")}maxMaxPostSpacing(){return n.unit(60,"in")}glassPanelClass(){return c}defaultSupportedPostStyles(){return[o.POST_STYLES.square]}defaultSupportedRailingHeights(){return[n.unit(36,"in"),n.unit(42,"in"),n.unit(48,"in")]}defaultSupportedPostWidths(){return[n.unit(1.375,"in")]}_defaultSupportedGateTypes(){return[l.DEFAULT,l.GLASS]}canHaveHandrail(){return!1}canSetPostHeight(){return!1}glassThickness(){return this._glassThickness||(this._glassThickness=this.glassThicknessChoices().first().value),this._glassThickness}materialIdentifier(){return`Glass${this.glassThickness()}`}setGlassThickness(e){this._glassThickness=e,this.notifyPropertyChangedObservers()}coerceGlassThickness(){const e=this.supportedGlassThicknesses();e.includes(this.glassThickness())||this.setGlassThickness(e.first())}glassThicknessChoices(){const e=this.supportedGlassThicknesses();return this.glassPanelClass().GLASS_THICKNESS_OPTIONS.filter((t=>e.includes(t.value)))}supportedGlassThicknesses(){return this._supportedGlassThicknesses||(this._supportedGlassThicknesses=this.defaultSupportedGlassThicknesses()),this._supportedGlassThicknesses}defaultSupportedGlassThicknesses(){return["1_4"]}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_supportedGlassThicknesses"]}}},78924:(e,t,r)=>{const n=r(63768),{EditableProperty:i,PropertiesCollection:s}=r(7340),o=r(68773),a=r(27424),l=r(97807),c=r(67042);e.exports=class FalconGlassRailingStyle extends a{sectionClass(){return l}defaultDisplayProperties(){return new s(this,[new i(this,"Glass Thickness",{type:"select",choices:this.glassThicknessChoices()}),...this._supplementalDisplayProperties()])}_supplementalDisplayProperties(){return[this.topGuardProperty(),new i(this,"Has Second Guard",{type:"boolean",label:"Second Guard"})]}_defaultSupportedGateTypes(){return[c.DEFAULT,c.GLASS]}isPostHeightLinkedToRailingHeight(){return!1}supportedGlassThicknesses(){return this._supportedGlassThicknesses||(this._supportedGlassThicknesses=this.defaultSupportedGlassThicknesses()),this._supportedGlassThicknesses}glassPanelClass(){return o}defaultSupportedGlassThicknesses(){return["3_8","1_2","7_16","9_16"]}glassThickness(){return this._glassThickness||(this._glassThickness=this.glassThicknessChoices().first().value),this._glassThickness}materialIdentifier(){return`Glass${this.glassThickness()}`}setGlassThickness(e){this._glassThickness=e,this.notifyPropertyChangedObservers()}coerceGlassThickness(){const e=this.supportedGlassThicknesses();e.includes(this.glassThickness())||this.setGlassThickness(e.first())}glassThicknessChoices(){const e=this.supportedGlassThicknesses();return this.glassPanelClass().GLASS_THICKNESS_OPTIONS.filter((t=>e.includes(t.value)))}canSetGlassThickness(){return this.supportedGlassThicknesses().length>1}canHaveScallopStairGlass(){return!0}glassPanelCenterOffset(e){return n.unit(0,"in")}hasSecondGuard(){return this._hasSecondGuard||(this._hasSecondGuard=!1),this._hasSecondGuard}toggleHasSecondGuard(){this.setHasSecondGuard(!this._hasSecondGuard)}setHasSecondGuard(e){this._hasSecondGuard=!!e}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_supportedGlassThicknesses"]}}},89600:(e,t,r)=>{const n=r(63768),i=r(61453),s=r(72175),o=r(27424),a=r(67042);e.exports=class FalconPicketRailingStyle extends o{sectionClass(){return i}defaultSupportedPostStyles(){return[s.POST_STYLES.square]}defaultSupportedRailingHeights(){return[n.unit(36,"in"),n.unit(42,"in"),n.unit(48,"in")]}defaultSupportedPostWidths(){return[n.unit(1.75,"in"),n.unit(2.5,"in")]}_defaultSupportedGateTypes(){return[a.DEFAULT,a.PICKET]}canHaveHandrail(){return!1}canSetPostHeight(){return!1}}},27424:(e,t,r)=>{const n=r(63768),{EditableProperty:i}=r(7340),s=r(58684),o=r(72175),a=r(41349),l=r(43412),c=r(303),u=r(46651);e.exports=class FalconRailingStyle extends s{static supportedRailingHeights(){return[n.unit(36,"in"),n.unit(39,"in"),n.unit(42,"in"),n.unit(48,"in")]}static supportedPostHeights(){return[n.unit(30,"in"),n.unit(33,"in"),n.unit(36,"in"),n.unit(42,"in"),n.unit(48,"in")]}static supportedPostWidths(){return[n.unit(2.5,"in")]}materialLineItems(e){return[]}hasGlassCoverPlate(){return!1}canHaveScallopStairGlass(){return!1}canHaveHandrail(){return!0}canSetPostHeight(){return!0}supportedPostStyles(){return this._supportedPostStyles??=this.defaultSupportedPostStyles()}defaultDisplayProperties(){return[]}defaultSupportedPostStyles(){return[o.POST_STYLES.square,o.POST_STYLES.round]}supportedStairMountSurfaces(){return[new a,new l]}supportedPostMountStyles(){return[new c,new u]}isPostHeightLinkedToRailingHeight(){return!0}supportedPostHeights(){return this._supportedPostHeights??=this.defaultSupportedPostHeights()}defaultSupportedPostHeights(){return this.isPostHeightLinkedToRailingHeight()?this.constructor.supportedRailingHeights():this.constructor.supportedPostHeights()}topGuardProperty(){return new i(this,"Has Top Guard",{type:"boolean",label:"Top Guard"})}hasTopGuard(){return this._hasTopGuard??=!1}toggleHasTopGuard(){this.setHasTopGuard(!this._hasTopGuard)}setHasTopGuard(e){this._hasTopGuard=e}hasPosts(){return!0}showPostColorProperty(){return!0}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_supportedPostStyles","_supportedPostHeights"]}}},44775:(e,t,r)=>{const n=r(63768),{PropertiesCollection:i,EditableProperty:s}=r(7340),o=r(36941),a=r(37220),l=r(75706),c=r(94699),u=r(29892);e.exports=class FalconStandoffGlassRailingStyle extends o{sectionClass(){return a}glassPanelClass(){return c}defaultDisplayProperties(){return new i(this,[new s(this,"Standoff Button Color",{type:"select",choices:this.standoffButtonColorChoices()}),...super.defaultDisplayProperties(),this.topGuardProperty()])}standoffButtonColor(){return this._standoffButtonColor??=this.standoffButtonColorChoices().first()}setStandoffButtonColor(e){this._standoffButtonColor=e,this.notifyPropertyChangedObservers()}standoffButtonColorChoices(){return[u.black,u.stainlessSteel]}defaultSupportedRailingHeights(){return[n.unit(36,"in"),n.unit(39,"in"),n.unit(42,"in")]}defaultSupportedGlassThicknesses(){return["1_2","9_16"]}supportedPostMountStyles(){return[new l]}canHaveHandrail(){return!0}hasPosts(){return!1}showPostColorProperty(){return!1}}},9297:(e,t,r)=>{const n=r(63768),{EditableProperty:i}=r(7340),s=r(72175),o=r(68773),a=r(78924),l=r(30691),c=r(67042),u=r(40603),d=n.unit(8.5,"in"),h={EVENLY_SPACED_POSTS:"EvenlySpacedPosts",EQUALLY_SIZED_PANELS:"EquallySizedPanels"},p={[h.EVENLY_SPACED_POSTS]:d,[h.EQUALLY_SIZED_PANELS]:n.unit(0,"in")},m={[h.EVENLY_SPACED_POSTS]:n.unit(0,"in"),[h.EQUALLY_SIZED_PANELS]:d};e.exports=class InfinityRailingStyle extends a{static layoutStyles=h;sectionClass(){return u}hasGlassCoverPlate(){return!0}canHaveScallopStairGlass(){return!1}hasTerminalGlassHoles(){return!0}requiredGlassThickness(){return n.unit(.5,"in")}glassPanelCenterOffset(e){const t=this.requiredGlassThickness();return n.multiply(n.add(e,t),.5)}canApplyToRailingCollection(e){const t=e.railingRuns().every((e=>l.isLevel(e.edge()))),r=e.openings().every((e=>!e.gate())),n=this._sectionsMeetMinimumLengthCriteria(e);return t&&r&&n}_sectionsMeetMinimumLengthCriteria(e){if(0===e.railingRuns().length)return!0;const t=new(this.sectionClass());return e.sections().every((e=>n.smallerEq(t.minLength(e),e.length())))}glassPanelClass(){return o}defaultSupportedGlassThicknesses(){return["1_2","7_16","9_16"]}defaultSupportedPostStyles(){return[s.POST_STYLES.square]}defaultSupportedPostHeights(){return[n.unit(24,"in"),n.unit(18,"in")]}_defaultSupportedGateTypes(){return[c.DEFAULT]}terminalPostInset(){return m[this.layoutStyle()]}edgeInsetForLayout(){return p[this.layoutStyle()]}defaultDisplayProperties(){return[...super.defaultDisplayProperties(),new i(this,"Layout Style",{type:"select",choices:this.layoutStyles()})]}layoutStyle(){return this._layoutStyle||(this._layoutStyle=h.EVENLY_SPACED_POSTS),this._layoutStyle}setLayoutStyle(e){this._layoutStyle=e,this.notifyPropertyChangedObservers()}layoutStyles(){return[{label:"Equally Spaced Posts",value:h.EVENLY_SPACED_POSTS},{label:"Equally Sized Panels",value:h.EQUALLY_SIZED_PANELS}]}structureEdgeOffsetFromCenter(e){return this.glassPanelCenterOffset(e)}}},17092:(e,t,r)=>{const n=r(78924),i=r(89600),s=r(9297),o=r(36941),a=r(98666),l=r(44775),c="standard-glass",u="infinity",d="picket",h="framed",p="baseShoe",m="standoff";e.exports=function(){return{standardGlass:new n(c,"Standard Glass","glass-rail-post-to-top"),infinity:new s(u,"Infinity","glass-rail-infinity"),picket:new i(d,"Picket","picket-rail"),framed:new o(h,"Framed Glass","framed-glass"),baseShoe:new a(p,"Base Shoe","base-shoe-glass-rail"),standoff:new l(m,"Standoff","standoff-glass-rail")}}},92058:(e,t,r)=>{const n=r(61940);e.exports=class FalconBaseShoeBottomRail extends n{materialLineItems(){return[]}}},66798:(e,t,r)=>{const{CompositeFigure:n}=r(7340),{Composite3DFigure:i}=r(37732),{Polygon:s,$P:o}=r(62048),a=r(83102),l=r(32347);e.exports=class FalconHandrailExtension extends a{constructor(e,{extendFromBegin:t=!1,fullExtension:r=!0}={}){super(),this._handrailDescriptor=e.handrailDescriptor(),this._extendFromBegin=t,this._fullExtension=r,this._segmentLength=this.handrailDescriptor().extensionSegmentLength.toNumeric(e.unit()),this._handrailEdge=l.makeEdge(e,this.handrailDescriptor()),this._handrailDirection=t?e.handrailDirection():-e.handrailDirection()}handrailEdge(){return this._handrailEdge}handrailDescriptor(){return this._handrailDescriptor}adaHandrailType(){return this.handrailDescriptor().adaHandrailType}extendFromBegin(){return this._extendFromBegin}fullExtension(){return this._fullExtension}handrailDirection(){return this._handrailDirection}verticalWrap(){return Boolean(this.adaHandrailType().details().verticalWrap)}segmentLength(){return this._segmentLength??=this.handrailDescriptor().extensionSegmentLength.toNumeric(this.unit())}segments(){return this._segments??=this._defaultSegments()}_defaultSegments(){const e=this.firstSegmentEdge();return[e,...this.additionalSegmentEdges(e)].map((e=>{const t=new l(e,this.handrailDescriptor());return t.setComponentOf(this),t}))}firstSegmentEdge(){const e=this.handrailEdge(),t=e.xy().direction(),r=(this.extendFromBegin()?t.negated():t).multipliedBy(this.segmentLength()),n=this.extendFromBegin()?e.begin():e.end(),i=n.add(r);return n.to(i).relativeToEdge(e)}additionalSegmentEdges(e){if(!this.fullExtension())return[];const t=this.verticalWrap()?1:this.handrailDirection(),r=this.verticalWrap()?o(0,0,1):e.normal(),n=this.segmentLength()*t,i=r.multipliedBy(n),s=e.movedByDelta(i).relativeToEdge(e);return[e.end().to(s.end()).relativeToEdge(e),s]}components(){return this.segments()}geometry(){const e=this.segments().first().edge().begin(),t=this.segments().first().edge().end(),r=this.segments().last().edge().end(),n=this.segments().last().edge().begin();return new s([e,t,r,n]).relatedTo(e)}z(){if(!this._z){const e=this.components().first();this._z=e.edge().begin().z()}return this._z}defaultFigure(){return n.withModel(this)}threeFigure(){return i.withModel(this)}allLocatedMaterials(){return this.components().flatMap((e=>e.allLocatedMaterials()))}}},61940:(e,t,r)=>{const{$P:n}=r(62048),i=r(88646),s=r(1487),o=r(85491);e.exports=class FalconPicketBottomRail extends o{crossSection(){const e=this.width().toNumeric(this.unit())/2,t=this.depth().toNumeric(this.unit());return new i([new s(n(e,0),n(-e,0)),new s(n(-e,t),n(e,t))])}}},85491:(e,t,r)=>{const n=r(63768),{extend:i}=r(50988),s=r(28219),o=r(72226);class FalconPicketRail extends o{constructor(e,t,r,n){super(e,n),this._width=t,this._depth=r}width(){return this._width||(this._width=n.unit(1,"in")),this._width}depth(){return this._depth||(this._depth=this.width()),this._depth}lineItemMaterial(){return this.materials.Rail}materialSpecifierName(){return"Rail"}}i(FalconPicketRail,s),e.exports=FalconPicketRail},54732:(e,t,r)=>{const{$P:n}=r(62048),i=r(85491),s=r(88646),o=r(1487),a=r(23202);e.exports=class FalconPicketTopRail extends i{crossSection(){const e=this.width().toNumeric(this.unit())/2,t=this.depth().toNumeric(this.unit()),r=t/2;return new s([new o(n(e,t),n(e,r)),new a(n(e,r),n(e,0),n(-e,0),n(-e,r)),new o(n(-e,r),n(-e,t))])}}},72226:(e,t,r)=>{const n=r(63768),{MaterialSpecifier:i}=r(27871),{MissingOverride:s}=r(50988),o=r(59663),a=r(2198);e.exports=class FalconRailingsRail extends a{constructor(e,t){super(e),this._colorOptions=t}colorOptions(){return this._colorOptions}materialName(){return this.colorOptions().materialName()}colorName(){return this.colorOptions().details().colorName}fillStyle(){return this.colorOptions().fillStyle()}strokeStyle(){return this.colorOptions().strokeStyle()}materialSpecifier(){return new i(this.materialSpecifierName().split(" ").join(""),this.materialSpecifierName(),{materialName:this.materialName(),fillStyle:this.fillStyle(),strokeStyle:this.strokeStyle()})}materialSpecifierName(){throw new s(this,"materialSpecifierName")}defaultFigure(){return new o(this)}materialNames(){return[this.materialSpecifier().details().materialName]}materialLineItems(){const e=n.unit(this.length(),this.unit()),t=n.unit(n.ceil(e.toNumeric("ft")),"ft");return[this.project().materialPricingLineItemFor(t,this.lineItemMaterial(),{unit:"ft"})]}lineItemMaterial(){throw new s(this,"lineItemMaterial")}}},32347:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),{RelativeLocator:s}=r(62048),o=r(72226);class Handrail extends o{static handrailForSection(e,t){const r=Handrail.makeEdge(e,t);return new Handrail(r,t)}static makeEdge(e,t){const r=t.radius,n=t.height.toNumeric(e.unit())-r.toNumeric(e.unit()),i=e.handrailOffset(),o=e.componentLayoutEdge(),a=o.shiftedAlongNormalBy(i).movedBy(0,0,-n);return s.makeRelativeTo(a.begin(),o.begin()).to(s.makeRelativeTo(a.end(),o.end()))}constructor(e,t={}){super(e,t.color),this._handrailDescriptor=t}handrailDescriptor(){return this._handrailDescriptor}width(){return n.multiply(this.radius(),2)}radius(){return this.handrailDescriptor().radius}crossSection(){const e=this.radius().toNumeric(this.unit());return i(0,0).expandedByRadius(e).toPolygon(32)}materialSpecifierName(){return"Handrail"}lineItemMaterial(){return this.materials.Handrail}}e.exports=Handrail},91186:(e,t,r)=>{const n=r(63768),i=r(19716);e.exports=class HandrailStyle{constructor(e,t=i.Rail,r=n.unit(5,"in")){this._label=e,this._mountPosition=t,this._distanceFromMountSurface=r}get value(){return this}get label(){return this._label}equals(e){return this.label===e.label&&this.mountPosition()===e.mountPosition()&&this.distanceFromMountSurface().equals(e.distanceFromMountSurface())}mountPosition(){return this._mountPosition}isWallMounted(){return this.mountPosition()===i.Wall}distanceFromMountSurface(){return this._distanceFromMountSurface}_wallDistanceNumeric(e){return e.defaultStructureRepresentationWidth().toNumeric(e.unit())}offsetForSection(e){const t=this.distanceFromMountSurface().toNumeric(e.unit()),r=this.isWallMounted()?this._wallDistanceNumeric(e)-t:t;return e.handrailDirection()*r}}},30357:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),{RelativeLocator:s,Polygon:o}=r(62048),a=r(72226);class SecondGuard extends a{static secondGuardForSection(e,t,r){const i=e.beginPost().height().toNumeric(e.unit())+r.toNumeric(e.unit())-e.postZOffsetNumeric(),o=(e.structureDirection()?n.subtract:n.add)(e.postWidth(),t),a=-e.structureDirection()*o.toNumeric(e.unit()),l=e.componentLayoutEdge(),c=l.shiftedAlongNormalBy(a).movedBy(0,0,-i),u=s.makeRelativeTo(c.begin(),l.begin()).to(s.makeRelativeTo(c.end(),l.end())),d=e.postProvider().postColor();return new SecondGuard(u,t,r,d)}constructor(e,t,r,n){super(e,n),this._radiusX=t,this._radiusY=r}width(){return n.multiply(this.radiusX(),2)}radiusX(){return this._radiusX}radiusY(){return this._radiusY}crossSection(){const e=this.radiusX().toNumeric(this.unit()),t=this.radiusY().toNumeric(this.unit()),r=i(0,0).expandedByRadius(1).toPolygon(32);return new o(r.vertices().map((r=>{const n=r.x()*e,s=r.y()*t;return i(n,s)})))}materialSpecifierName(){return"Second Guard"}lineItemMaterial(){return this.materials.SecondGuard}}e.exports=SecondGuard},98750:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),s=r(72226);class TopGuard extends s{static topGuardForSection(e){const t=e.glassPanels().first().panelThickness(),r=e.postProvider().postColor();return new TopGuard(e.topGlassEdge(),t,r)}constructor(e,t,r){super(e,r),this._glassThickness=t}glassThickness(){return this._glassThickness}width(){const e=this._wallThicknessNumeric();return n.add(this.glassThickness(),n.unit(2*e,"in"))}_height(){const e=this._wallThicknessNumeric();return n.add(this.glassThickness(),n.unit(e,"in"))}_wallThicknessNumeric(){return n.unit(.125,"in").toNumeric(this.unit())}crossSection(){const e=this.width().toNumeric(this.unit()),t=this._height().toNumeric(this.unit()),r=this.glassThickness().toNumeric(this.unit()),n=this._wallThicknessNumeric();return i(0,(r+n)/2-n).expandedBy(e/2,t/2).toPolygon()}materialSpecifierName(){return"Top Guard"}lineItemMaterial(){return this.materials.TopGuard}}e.exports=TopGuard},19716:e=>{e.exports=Object.freeze({Rail:"Rail",Wall:"Wall",None:"None"})},68401:(e,t,r)=>{const n=r(91186),i=r(19716);e.exports=Object.freeze({None:new n("None",i.None),Post:new n("Post Attached"),Glass:new n("Glass Attached"),Wall:new n("Wall Attached",i.Wall)})},25365:(e,t,r)=>{const n=r(63768),i=r(94931),s=r(92058),o=r(64226);e.exports=class FalconBaseShoeGlassRailingSection extends o{static displayName(){return"Base Shoe Section"}bottomRailWidth(){return n.unit(1.5,"in")}bottomRailDepth(){return n.unit(5,"in")}panelGap(){return n.unit(.5625,"in")}maxPanelSize(){return n.unit(54,"in")}maxPostSpacing(){return n.add(this.maxPanelSize(),this.panelGap())}showMaxPostSpacingProperty(){return!1}blockClass(){return i}_defaultRails(){return[this._bottomRail()]}_bottomRail(){const e=this.bottomRailDepth(),t=e.toNumeric(this.unit()),r=this.postLayoutEdge().addZ(-t),n=new s(r,this.bottomRailWidth(),e,this.colorOptions());return n.setComponentOf(this),n}railingPosts(){return[]}selfMaterialLineItems(){const e=n.ceil(this.length().toNumeric("ft")),t=n.unit(e,"ft"),r=`BaseShoeRail${this.railingHeight().toNumeric("in").rounded()}`,i=this.materials[r];return[this.project().materialPricingLineItemFor(t,i,{unit:"ft"})]}components(){return[...super.components(),this.topGuard(),this.handrail()].filter(Boolean)}}},64226:(e,t,r)=>{const{extend:n}=r(50988),i=r(53185),s=r(43449),o=r(42638);class FalconBlockSection extends s{blockClass(){return i}colorOptions(){return this.postDescriptor().options().postColor}glassThickness(){return this.railingStyle().glassThickness()}glassPanelClass(){return this.railingStyle().glassPanelClass()}glassPanels(){if(this.blocks().first().glassPanel)return this.blocks().flatMap((e=>e.glassPanel()))}}n(FalconBlockSection,o),e.exports=FalconBlockSection},86794:(e,t,r)=>{const n=r(63768),{EditableProperty:i,PropertiesCollection:s}=r(7340),o=r(61453),a=r(14294);e.exports=class FalconFramedGlassRailingSection extends o{static displayName(){return"Framed Glass Section"}stairMaxPostSpacing(){const e=this.maxPostSpacing();return this.sloped()?n.divide(e,n.cos(this.slope())):e}defaultDisplayProperties(){return new s(this,[...super.defaultDisplayProperties(),new i(this,"Max Post Spacing",{type:"unit",defaultUnit:"in",label:"Max Post Spacing",ignoreIntermediateEdits:!0,showOnCollection:!0})])}showMaxPostSpacingProperty(){return!0}maxPostSpacing(){return this._maxPostSpacing??=this.defaultMaxPostSpacing()}defaultMaxPostSpacing(){return n.unit(48,"in")}setMaxPostSpacing(e){this._maxPostSpacing=this._validateMaxPostSpacing(e),this.resetComponents()}minMaxPostSpacing(){return this.railingStyle().minMaxPostSpacing()}maxMaxPostSpacing(){return this.railingStyle().maxMaxPostSpacing()}_validateMaxPostSpacing(e){const t=this.minMaxPostSpacing(),r=this.maxMaxPostSpacing();return n.smaller(e,t)?e=t:n.larger(e,r)&&(e=r),e}pricingReferenceMaterialSpecifier(){return this.materials.Glass1_4}_makeBlock(e,t,r){const n=this._generateBlockRailEdge(e,t,r).relativeToEdge(this.edge());return new a(n)}}},97807:(e,t,r)=>{const n=r(63768),{FixedEdgeLocator:i,RelativeLocator:s}=r(62048),o=r(72175),a=r(68773),l=r(44476),c=r(30357),u=r(66798),d=r(22295),h=r(43449),p=r(88394),m=r(4697),f=r(91784),g=r(56858);e.exports=class FalconGlassRailingSection extends h{static maxPostSpacing(){return a.maxPanelWidth()}static glassPanelInsetIntoPost(){return n.divide(n.unit(1.125,"in"),2)}resetAnnotations(){super.resetAnnotations(),this._postCentersAnnotations=void 0,this._glassPanelAnnotations=void 0}maxPostSpacing(){const e=this.constructor.maxPostSpacing();return this.sloped()?n.divide(e,n.cos(this.slope())):e}glassPanelHeightAboveGround(){const e=this.placementStrategy().verticalClearanceOffset(),t=n.add(this.postProvider().glassPanelHeightAboveGround(),this.hasStringer()?this.stringerHeightAboveStairNose():n.unit(0,this.unit()));return n.add(e,t)}glassThicknessOption(){return this._glassThicknessOption||(this._glassThicknessOption=this.railingStyle().glassThickness()),this._glassThicknessOption}glassThickness(){return this._glassThickness||(this._glassThickness=this.glassPanels().first().panelThickness()),this._glassThickness}glassPanels(){return this.rails()}_defaultRails(){return this._defaultGlassPanels()}_glassPanelInset(){const e=o.legMaterialSpecifier().details().width;return n.subtract(n.divide(e,2),this.glassPanelInsetIntoPost()).toNumeric(this.unit())}_defaultGlassPanels(){const e=this._panelBreakLocations();if(0===e.length)return[];const t=this._glassPanelInset();return this.postDescriptor().railAttachmentLevels().flatMap((r=>{const s=n.subtract(r,this.glassPanelHeightAboveGround());return e.map(((r,n)=>{const o=e[n+1];if(!o)return;const a=r.to(o).addZ(-this.glassPanelHeightAboveGround().toNumeric(this.unit())),l=new i(a,t).to(new i(a,-t)),c=new(this.railingStyle().glassPanelClass())(l,s,this.glassThicknessOption(),this);return c.setComponentOf(this),c})).filter((e=>e))}))}glassPanelInsetIntoPost(){return this.constructor.glassPanelInsetIntoPost()}terminalPostClass(){return d}cornerPostClass(){return p}_defaultLinePostClass(){return o}lineTransitionPostClass(){return m}cornerTransitionPostClass(){return f}glassPanelCenterOffsetNumeric(){return this.glassPanelCenterOffset().toNumeric(this.unit())}glassPanelCenterOffset(){const e=this.railingStyle().glassPanelCenterOffset(this.postWidth());return n.multiply(e,this.handrailDirection())}offsetForStructure(e=1){return n.multiply(this.glassPanelCenterOffset(),e)}_postADAOffsetDirection(e,t){return this._adaCompliantHandrails()?0===e?1:e===t?-1:0:0}_panelBreakLocations(){const e=this.postLocations(),t=-this.postZOffsetNumeric();return e.map((e=>e.addZ(t)))}hasSecondGuard(){return this.railingStyle().hasSecondGuard()}secondGuard(){if(this.hasSecondGuard())return this._secondGuard||(this._secondGuard=this._defaultSecondGuard()),this._secondGuard}_defaultSecondGuard(){const e=c.secondGuardForSection(this,n.unit(1,"in"),n.unit(.5,"in"));return e.setComponentOf(this),e}stairHandrailExtensions(){return this._requiresADACompliantHandrailExtensions()?(this._stairHandrailExtensions||(this._stairHandrailExtensions=this._defaultStairHandrailExtensions()),this._stairHandrailExtensions):[]}_defaultStairHandrailExtensions(){return[this._handrailExtension(!0),this._handrailExtension(!1)].filter((e=>e))}_handrailExtension(e){const t=e?this.sectionConnectedToBegin():this.sectionConnectedToEnd();if(!t){const t=!this.handrailStyle().isWallMounted();return this._createHandrailExtension(e,t)}if(!t.handrail())return this._createHandrailExtension(e,!1)}_createHandrailExtension(e,t){const r=new u(this,{extendFromBegin:e,fullExtension:t});return r.setComponentOf(this),r}handrailExtensionPosts(){return this._handrailExtensionPosts??=this._defaultHandrailExtensionPosts()}_defaultHandrailExtensionPosts(){if(!this._requiresADACompliantHandrailExtensions())return[];if(!this.adaHandrailType().details().addPosts)return[];if(this.handrailStyle().isWallMounted())return[];const e=[];return this.sectionConnectedToBegin()||e.push(this.componentLayoutEdge().begin()),this.sectionConnectedToEnd()||e.push(this.componentLayoutEdge().end()),e.map((e=>{const t=this._makeHandrailExtensionPostEdge(e),r=new i(t,this._extensionLengthNumeric()/2).addZ(this.postZOffsetNumeric());return this.makePost(r,-1)}))}_makeHandrailExtensionPostEdge(e){const t=this.componentLayoutEdge(),r=e===t.begin(),n=r?t.begin():t.end(),i=(r?t.xy().direction().multipliedBy(-1):t.xy().direction()).multipliedBy(this._extensionLengthNumeric()),o=n.movedBy(i.x(),i.y()),a=s.makeRelativeTo(o,n);return n.to(a)}_extensionLengthNumeric(){return this.handrailDescriptor().extensionSegmentLength.toNumeric(this.unit())}adaHandrailType(){return this.handrailDescriptor().adaHandrailType}_adaCompliantHandrails(){return!this.adaHandrailType().equals(g.none)}_requiresADACompliantHandrailExtensions(){return this.handrail()&&this._adaCompliantHandrails()&&this.sloped()}boundingCube(){return this.components().map((e=>e.boundingCube())).reduce(((e,t)=>e.merge(t)))}annotations(){return[...super.annotations(),...this.postCentersAnnotations(),...this.glassPanelAnnotations()]}postCentersAnnotations(){return this._postCentersAnnotations||(this._postCentersAnnotations=this._defaultPostCentersAnnotations()),this._postCentersAnnotations}_defaultPostCentersAnnotations(){const e=this.railingPosts().map((e=>e.locator()));if(e.length<2)return[];const t=this.beginPost().locator();e.includes(t)||e.unshift(s.makeRelativeTo(t,this.edge().begin()));const r=e.slice(0,-1).map(((t,r)=>t.to(e[r+1]))),n=45+this.postMountStyleAnnotationOffset();return r.map((e=>new l(e.xy(),n*this.annotationDirection(),this.unit(),{formatWithFeet:!1,fractionDenominator:8,fadeWithDistance:!0})))}glassPanelAnnotations(){return this._glassPanelAnnotations||(this._glassPanelAnnotations=this._defaultGlassPanelAnnotations()),this._glassPanelAnnotations}_defaultGlassPanelAnnotations(){const e=25+this.postMountStyleAnnotationOffset();return this.glassPanels().map((t=>new l(t.edge(),e*this.annotationDirection(),this.unit(),{formatWithFeet:!1,fractionDenominator:8,fadeWithDistance:!0})))}components(){return[...super.components(),...this._baseComponents(),...this._supplementalComponents()].filter((e=>e))}_baseComponents(){return[...this.stairHandrailExtensions(),...this.handrailExtensionPosts()]}_supplementalComponents(){return[this.secondGuard()]}resetComponents(){super.resetComponents(),this._handrail=void 0,this._stairHandrailExtensions=void 0,this._handrailExtensionPosts=void 0}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_postCentersAnnotations","_glassPanelAnnotations","_handrail","_topGuard","_stairHandrailExtensions"]}postRestorationAction(){this._heightAnnotations=void 0,this._handrail=void 0,this._topGuard=void 0}}},40603:(e,t,r)=>{const n=r(63768),{RelativeLocator:i}=r(62048),s=r(97807),o=r(72175),a=r(68773);let l;e.exports=class FalconInfinityGlassRailingSection extends s{terminalPostInset(){return n.unit(8.5,"in")}maxPostSpacing(){return this.isEquallySizedPanels()?a.maxPanelWidth():n.subtract(a.maxPanelWidth(),this.terminalPostInset())}isEquallySizedPanels(){const e=this.railingStyle().layoutStyle();return l||(l=r(9297)),e===l.layoutStyles.EQUALLY_SIZED_PANELS}minLength(e=this){const t=e.componentOf().placementStrategy();if(n.larger(t.minLength(),n.unit(0,"in")))return t.minLength();const r=n.multiply(e.postMountStyle().anchorOffset(),2),i=o.basePlateMaterialSpecifier().details().width,s=e.postWidth(),a=n.multiply(this.terminalPostInset(),2);return n.add(e.minPostSpacing(),r,i,s,a)}postLayoutEdge(){const e=this.componentLayoutEdge(),t=2*-this.terminalPostInset().toNumeric(this.unit());return e.shiftedAlongNormalBy(-this.glassPanelCenterOffsetNumeric()).stretchedBy(t).relativeToEdge(this.edge())}postSpacingLengths(){return this.isEquallySizedPanels()?this._equalPanelsPostSpacingLengths():super.postSpacingLengths()}_equalPanelsPostSpacingLengths(){const e=this.postSpacingHelper(),t=this.terminalPostInset().toNumeric(this.unit()),r=e.railLengths(this.componentLayoutEdge());return 1===r.length?[r-2*t]:[r.first()-t,...r.slice(1,-1),r.last()-t]}_panelBreakLocations(){const e=super._panelBreakLocations();if(0===e.length)return[];const t=this.componentLayoutEdge(),r=t.normal().xy().multipliedBy(this.glassPanelCenterOffsetNumeric()),n=e.slice(1,-1).map((e=>{const t=e.add(r.x(),r.y());return i.makeRelativeTo(t,e)}));return[t.begin(),...n,t.end()]}}},61453:(e,t,r)=>{const n=r(63768),i=r(18479),s=r(64226),o=r(53947),a=r(7127),l=r(54732);class FalconPicketRailingSection extends s{static topRailDepth=n.unit(1.5,"in");topRailWidth(){return n.unit(2.5,"in")}topRailDepth(){return this.constructor.topRailDepth}components(){return[...this.railingPosts(),...this.blocks(),...this.rails()]}_defaultRails(){const e=this.railLayoutEdge(),t=new l(e,this.topRailWidth(),this.topRailDepth(),this.colorOptions());return t.setComponentOf(this),[t]}railLayoutEdge(){const e=-this.railingHeight().toNumeric(this.unit());return this.postLayoutEdge().addZ(e)}terminalPostClass(){return a}cornerPostClass(){return a}_defaultLinePostClass(){return i}lineTransitionPostClass(){return a}cornerTransitionPostClass(){return a}_defaultBlocks(){const e=this.railingPosts().slice(),t=this.beginPost();e.includes(t)||e.unshift(t);const r=[];return e.forEach(((t,n)=>{const i=e[n+1];if(!i)return;const s=this._makeBlock(t,i,e);s.setComponentOf(this),r.push(s)})),r}_makeBlock(e,t,r){const n=this._generateBlockRailEdge(e,t,r),i=this._generateBlockPicketEdge(e,t),s=n.relativeToEdge(this.edge()),a=i.relativeToEdge(this.edge());return new o(s,a)}_generateBlockRailEdge(e,t,r){let n=e.surfaceLocator().snapshot(),i=t.surfaceLocator().snapshot();const s=e.directionTo(t);return 0!==r.indexOf(e)||this._previousSection()||(n=this._postBoundaryLocator(e,s.negated())),r.indexOf(e)!==r.length-2||this._nextSection()||(i=this._postBoundaryLocator(t,s)),n.to(i)}_generateBlockPicketEdge(e,t){const r=e.directionTo(t),n=this._postBoundaryLocator(e,r),i=this._postBoundaryLocator(t,r.negated());return n.to(i)}_postBoundaryLocator(e,t){const r=e.surfaceLocator().snapshot(),n=e.postWidth().toNumeric(this.unit()),i=t.multipliedBy(n/2);return r.add(i)}defaultAnnotations(){const e=this.blocks().flatMap((e=>e.annotations()));return[...super.defaultAnnotations(),...e]}lineItemMaterial(){const e=this.railingHeight(),t=o.supportBarThreshold;return e.equals(t)?this.materials.PicketRail48:this.materials.PicketRail}materialLineItems(){const e=n.ceil(this.length().toNumeric("ft")),t=n.unit(e,"ft");return[this.project().materialPricingLineItemFor(t,this.lineItemMaterial(),{unit:"ft",useMultiplier:this.usePricingMultiplier()})]}usePricingMultiplier(){return!1}allLocatedMaterials(){const e=this.components().flatMap((e=>e.allLocatedMaterials()));return e.push(this),e}}e.exports=FalconPicketRailingSection},43449:(e,t,r)=>{const n=r(63768),{MissingOverride:i,simpleObserver:s,extend:o}=r(50988),{EditableProperty:a}=r(7340),{RailLengthHelper:l}=r(8423),c=r(44476),u=r(10590),d=r(67603),h=r(26566),p=r(72175),m=r(39353),f=r(98750),g=r(30691),y=r(32347),b=r(68401),v=r(19716);class FalconRailingSection extends u{static incrementSize(){return n.unit(.125,"in")}minLength(){const e=this.componentOf().placementStrategy();if(n.larger(e.minLength(),n.unit(0,"in")))return e.minLength();const t=n.multiply(this.postMountStyle().anchorOffset(),2),r=p.basePlateMaterialSpecifier().details().width,i=this.postWidth();return n.add(this.minRailLength(),t,r,i)}defaultDisplayProperties(){return new d(this,[new a(this,"Scallop Stair Glass",{type:"boolean",showOnCollection:!0}),new a(this,"Length",{label:"Section Length",type:"unit",defaultUnit:"in",restorable:!1,ignoreIntermediateEdits:!0}),...this._handrailProperties(),...this.slopedDisplayProperties()])}showLengthProperty(){return!1}slopedDisplayProperties(){return this.sloped()?[new a(this.run(),"Create Opposite Railing",{type:"action",perform:()=>this.createOppositeRailing(),showOnCollection:!0}),new a(this,"Stair Mount Surface",{type:"select",choices:this.stairMountSurfaceOptions(),showOnCollection:!0})]:[]}_handrailProperties(){return this.postProvider().railingStyle().canHaveHandrail?.()?[new a(this,"Handrail Style",{type:"select",choices:this.handrailStyleChoices(),showOnCollection:!0})]:[]}handrailStyleChoices(){return[b.None,b.Post,b.Glass,b.Wall]}handrailStyle(){return this._handrailStyle||(this._handrailStyle=this.handrailStyleChoices().first()),this._handrailStyle}setHandrailStyle(e){this._handrailStyle=e,this.notifyPropertyChangedObservers(),this.resetComponents()}scallopStairGlass(){return this._scallopStairGlass??=!1}toggleScallopStairGlass(){this.setScallopStairGlass(!this.scallopStairGlass())}setScallopStairGlass(e){this._scallopStairGlass=Boolean(e),this.notifyPropertyChangedObservers(),this.componentOf().resetStructure(),this.resetComponents()}showScallopStairGlassProperty(){return this.canHaveScallopStairGlass()}canHaveScallopStairGlass(){return this.isStairs()&&!this.hasStringer()&&this.railingStyle().canHaveScallopStairGlass?.()}hasScallopStairGlass(){return this.scallopStairGlass()&&this.canHaveScallopStairGlass()}stairMountSurface(){return this._stairMountSurface??=this.stairMountSurfaceOptions().first()}stairMountSurfaceOptions(){return this.railingStyle().supportedStairMountSurfaces()}setStairMountSurface(e){this._stairMountSurface=e,this.notifyPropertyChangedObservers(),this.componentOf().resetStructure(),this.resetComponents()}coerceStairMountSurface(){this.railingStyle().supportedStairMountSurfaces().some((e=>e.equals(this.stairMountSurface())))||this.resetStairMountSurface()}resetStairMountSurface(){this._stairMountSurface=void 0}hasStringer(){return this.stairMountSurface().hasStringer()}stringerHeightAboveStairNose(){return this.run().stringerHeightAboveStairNose()}maxPostSpacing(){return n.unit(6,"ft")}maxRailLength(){return this.maxPostSpacing()}railingHeight(){return this.postProvider().railingHeight()}railingStyle(){return this.postProvider().railingStyle()}railingStyles(){return this.postProvider().railingStyles()}startObservingRailingStyle(){}stopObservingRailingStyle(){}postZOffsetNumeric(){return this.postProvider().postDescriptor().options().postMountStyle.postZOffset().toNumeric(this.unit())}postWidth(){return this.postProvider().postWidth()}_previousSection(){return this.componentOf().previousSectionFor(this)}_nextSection(){return this.componentOf().nextSectionFor(this)}makePost(e,t,r){const n=new(this._classForPost(t,r))(e,this.gateConnectedTo(e));return n.setComponentOf(this),n}_getPostClass(e,t,r,n){return r?t?this.cornerTransitionPostClass():this.lineTransitionPostClass():e?this.terminalPostClass():t?this.cornerPostClass():this.linePostClass(n)}_classForPost(e,t){const r=0===e,n=e===t,i=e<0,s=r&&!this.sectionConnectedToBegin(),o=n&&!this.sectionConnectedToEnd(),a=s||o,l=this.angleAtEnd().radiansToDegrees(),c=0!==l&&360!==l&&(r||n),u=n&&this.sectionConnectedToEnd()&&this.sectionConnectedToEnd()?.sloped(),d=n&&this.sectionConnectedToEnd()&&!this.sectionConnectedToEnd()?.sloped()&&this.sloped(),h=u||d;return this._getPostClass(a,c,h,i)}terminalPostClass(){throw new i(this,"terminalPostClass")}cornerPostClass(){throw new i(this,"cornerPostClass")}linePostClass(e=!1){return e||!this.stairMountSurface().hasStringer()?this._defaultLinePostClass():m}_defaultLinePostClass(){throw new i(this,"linePostClass")}lineTransitionPostClass(){throw new i(this,"lineTransitionPostClass")}cornerTransitionPostClass(){throw new i(this,"cornerTransitionPostClass")}postLocations(){const e=super.postLocations(),t=this.postZOffsetNumeric();return e.map((e=>e.addZ(t)))}postSpacingMode(){return l.mode.EVEN}isSpaceForPosts(){return!this.postLayoutEdge().length().isNearTo(0)}postLayoutEdge(){return this.componentLayoutEdge()}postMountStyle(){return this.postProvider()?.postMountStyle()}blockClass(){}hasTopGuard(){return this.railingStyle().hasTopGuard()}topGuard(){if(this.hasTopGuard())return this._topGuard??=this._defaultTopGuard()}_defaultTopGuard(){const e=f.topGuardForSection(this);return e.setComponentOf(this),e}topGlassEdge(){const e=this.postProvider().railingHeight().toNumeric(this.unit()),t=this.componentLayoutEdge().addZ(-e),r=-this._glassPanelInset();return g.stretchedEdgeBy(t,r,r).relativeToEdge(this.edge())}_glassPanelInset(){return 0}hasHandrail(){return this.handrailStyle().mountPosition()!==v.None}hasGlassMountedHandrail(){return this.handrailStyle().equals(b.Glass)}handrail(){if(this.hasHandrail())return this._handrail??=this._defaultHandrail()}handrailDescriptor(){return this.postProvider().handrailDescriptor()}handrailCenterline(e=this.handrailDescriptor(),t=this.handrailOffset()){const r=e.radius.toNumeric(this.unit()),n=e.height.toNumeric(this.unit())-r;return this.componentLayoutEdge().shiftedAlongNormalBy(t).movedBy(0,0,-n)}_adjustHandrailTerminus(e,t){const r=e.handrailCenterline(this.handrailDescriptor(),this.handrailOffset()).intersectionsWithEdge(t);if(r.length>0){const e=r.first();t.replaceNearestEndpoint(e)}}_handrailEdge(){const e=this.componentLayoutEdge(),t=this.handrailCenterline(),r=this._previousSection();r&&this._adjustHandrailTerminus(r,t);const n=this._nextSection();return n&&this._adjustHandrailTerminus(n,t),t.begin().to(t.end()).relativeToEdge(e)}_defaultHandrail(){const e=new y(this._handrailEdge(),this.handrailDescriptor());return e.setComponentOf(this),e}handrailDirection(){return-this.annotationDirection()}handrailOffset(){return this.handrailStyle().offsetForSection(this)}boundingBox(){return this.geometry().boundingBox()}postMountStyleAnnotationOffset(){return this.postMountStyle().annotationOffset(this)}sectionLengthAnnotation(){const e=70+this.postMountStyleAnnotationOffset();return new c(this.componentLayoutEdge(),e*this.annotationDirection(),this.unit(),{fractionDenominator:8,fadeWithDistance:!0})}platformLengthAnnotation(){return new c(this.edge(),90*this.annotationDirection(),this.unit(),{fractionDenominator:8,fadeWithDistance:!0})}defaultAnnotations(){return[...super.defaultAnnotations(),this.platformLengthAnnotation()].filter((e=>e))}components(){return[...super.components(),this.topGuard(),this.handrail()].filter(Boolean)}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_handrailStyle","_propertyChangedObservers"]}}s(FalconRailingSection,"propertyChanged"),o(FalconRailingSection,h),e.exports=FalconRailingSection},37220:(e,t,r)=>{const n=r(63768),{FixedEdgeLocator:i}=r(62048),s=r(64226),o=r(3668),a=r(30691),l=r(54648);e.exports=class FalconStandoffGlassRailingSection extends s{static displayName(){return"Standoff Section"}panelGap(){return n.unit(.5625,"in")}maxPanelSize(){return n.unit(50,"in")}maxPostSpacing(){return n.add(this.maxPanelSize(),this.panelGap())}showMaxPostSpacingProperty(){return!1}blockClass(){return o}railingPosts(){return[]}standoffButtonRadius(){return l.radius()}standoffButtonInset(){const e=this.standoffButtonRadius();return n.add(n.unit(.5,"in"),e)}levelStandoffButtonSpacing(){return n.unit(1,"ft")}standoffButtons(){return this._standoffButtons??=this._defaultStandoffButtons()}_defaultStandoffButtons(){const e=this.standoffButtonLocations(),t=this.isLevel(),r=2*this.standoffButtonRadius().toNumeric(this.unit());return e.flatMap((e=>{const n=this._createStandoffButton(e);if(!t)return n;const i=e.addZ(r);return[n,this._createStandoffButton(i)]}))}_createStandoffButton(e){const t=new l(e);return t.setComponentOf(this),t}standoffButtonLocations(){return this._standoffButtonLocations??=this._defaultStandoffButtonLocations()}_defaultStandoffButtonLocations(){return this.isLevel()?this._levelStandoffButtonLocations():this._stairStandoffButtonLocations()}_levelStandoffButtonLocations(){const e=this.standoffButtonInset().toNumeric(this.unit()),t=this.edge(),r=t.closestPointTo(this.postLocations().first()),n=t.closestPointTo(this.postLocations().last()),s=r.to(n).stretchedBy(2*-e).relativeToEdge(this.edge()),o=this.levelStandoffButtonSpacing().toNumeric(this.unit()),l=Math.ceil(s.length()/o);return[new i(s,0),...a.locatorsAlongEdge(s,l),new i(s,s.length())].map((t=>t.addZ(e)))}_stairStandoffButtonLocations(){const e=this.treadEdges(),t=this.standoffButtonInset().toNumeric(this.unit());return e.map((e=>{const r=new i(e,t),n=new i(e,-t);return r.to(n).addZ(t)})).flatMap((e=>e.endpoints()))}treadEdges(){const e=this.componentOf().placementStrategy().defaultStructureRepresentation().treadEdges();if(this.structureAlongNormal())return e;const t=this.componentOf().defaultStructureRepresentationWidth().toNumeric(this.unit());return e.map((e=>e.shiftedAlongNormalBy(-t)))}selfMaterialLineItems(){const e=n.ceil(this.length().toNumeric("ft")),t=n.unit(e,"ft"),r=`StandoffRail${this.railingHeight().toNumeric("in").rounded()}`,i=this.materials[r];return[this.project().materialPricingLineItemFor(t,i,{unit:"ft"})]}components(){return[...super.components(),...this.standoffButtons()]}}},43412:(e,t,r)=>{const n=r(11496);e.exports=class FalconRailingsStringerStairMountSurface extends n{get label(){return"Stringer"}hasStringer(){return!0}}},41349:(e,t,r)=>{const n=r(11496);e.exports=class FalconRailingsTreadStairMountSurface extends n{get label(){return"Tread"}treadMountPosts(){return!0}}},74372:(e,t,r)=>{const{Edge:n,NormalToEdgeLocator:i,Rectangle:s}=r(62048),o=r(84510);e.exports=class FalconStairHeightAnnotationFigure extends o{handles(){return[]}_drawLabel(e,t,r,n){const i=this._pixelsToDrawingUnits(5),o=e.measureText(t),a=o.width,l=o.actualBoundingBoxLeft,c=Math.abs(o.actualBoundingBoxAscent)+Math.abs(o.actualBoundingBoxDescent),u=-o.actualBoundingBoxAscent;e._alterAndRestoreAfter((()=>{this._positionText(e,a,r,n),this._orientText(e);const o=new s(l-i,u-i,a+2*i,c+2*i).toPolygon();e.fillStyle="#fff",e._drawRoundedRectangle(o,5),e.fillStyle="#000",this._drawText(e,t)}))}_textLineEdge(){return new n(new i(this.annotation().edgeBegin(),this.distance()),new i(this.annotation().edgeEnd(),this.distance()))}_draw(e,t){this._setFontSizeOnContext(e),this._setGlobalAlpha(e),this._drawBrackets(e);const r=this._textLineEdge(),n=this.annotation().edge();this._drawLabel(e,this.annotation().beginHeight(),0,r),this._drawLabel(e,this.annotation().endHeight(),n.length(),r)}}},76983:(e,t,r)=>{const n=r(63768),i=r(38222),s=r(3336);e.exports=class CircularGeometryStrategy extends i{constructor(e){super(),this._radius=e}radius(){return this._radius}setDimension(e,t,r){const i=n.divide(e,2);return t.setRadius(i),!0}buildGeometry(e,t,r=0){return new s(e,this.radius())}}},38222:(e,t,r)=>{const{extend:n}=r(50988),i=r(87032);class GeometryStrategy{buildGeometry(e,t,r){}rotateGeometry(e,t){}setDimension(e,t,r){return!1}buildAnnotations(e){return[]}clone(){return new this.constructor}}n(GeometryStrategy,i),e.exports=GeometryStrategy},11216:(e,t,r)=>{const n=r(38222);e.exports=class PolygonGeometryStrategy extends n{constructor(e){super(),this._polygon=e}polygon(){return this._polygon}setPolygon(e){this._polygon=e}buildGeometry(e,t,r=0){const n=this.polygon(),i=n.centroid(),s=e.subtract(i),o=n.movedBy(s.x(),s.y(),r).relatedTo(e);return this.rotateGeometry(o,t),o}rotateGeometry(e,t){this.rotateGeometryAround(e,e.centroid(),t)}rotateGeometryAround(e,t,r){e.vertices().forEach((e=>e.rotateBy(t,r)))}setDimension(e,t,r){const n=t.edges().find((e=>e.direction().dot(r).isNearTo(0))),i=t.edges().find((e=>Math.abs(e.direction().dot(r)).isNearTo(1)));if(!n)return!1;if(!i)return!1;const s=e-i.length();if(s.isNearTo(0))return!1;const o=n.normal().multipliedBy(s);return n.moveBy(o.x(),o.y())}}},25574:(e,t,r)=>{const n=r(16810);e.exports=class RectangularCutoutGeometryStrategy extends n{setCutout(e){this._cutout=e}cutout(){return this._cutout}buildGeometry(e,t,r=0){if(!this._geometry){const n=this.defaultWidth(),i=this.defaultLength(),s=e.expandedBy(i/2,n/2).toPolygon().movedBy(0,0,r).relatedTo(e);this.rotateGeometry(s,t);const o=s.difference(this.cutout().movedBy(0,0,r)).first();this._uncutShape=s,this._geometry=o.relatedTo(e)}return this._geometry}uncutShape(e,t,r){return this._uncutShape||this.buildGeometry(e,t,r),this._uncutShape}}},16810:(e,t,r)=>{const n=r(38222);e.exports=class RectangularGeometryStrategy extends n{constructor(e,t){super(),this._defaultWidth=e,this._defaultLength=t}defaultWidth(){return this._defaultWidth}setDefaultWidth(e){this._defaultWidth=e}defaultLength(){return this._defaultLength}setDefaultLength(e){this._defaultLength=e}buildGeometry(e,t,r=0){const n=this.defaultWidth(),i=this.defaultLength(),s=e.expandedBy(i/2,n/2).toPolygon().movedBy(0,0,r).relatedTo(e);return this.rotateGeometry(s,t),s}rotateGeometry(e,t){this.rotateGeometryAround(e,e.centroid(),t)}rotateGeometryAround(e,t,r){e.vertices().forEach((e=>e.rotateBy(t,r)))}tiltGeometry(e,t,r,n){const i=r.center().z();r.begin().rotateBy(n.end(),0,-t),r.end().rotateBy(n.begin(),0,-t);const s=i-r.center().z();e.moveBy(0,0,s)}setDimension(e,t,r){const n=t.vertices().map((e=>e.dot(r))),i=e-(Math.max(...n)-Math.min(...n)),s=t.edges().filter((e=>Math.abs(e.normal().dot(r)).isNearTo(1)));return this._updateDimension(s,i),!i.isNearTo(0)}_updateDimension(e,t){e.forEach((e=>{const r=e.normal().multipliedBy(t/2);e.moveBy(r.x(),r.y())}))}buildAnnotations(e,t,r=30,n){const i=this.systemStrategy().annotationType(),s=e.edges()[0],o=e.edges()[1];return[new i(s,r,t,n),new i(o,r,t,n)]}clone(){return new this.constructor(this.defaultWidth(),this.defaultLength())}}},3336:(e,t,r)=>{const{Circle:n}=r(62048);e.exports=class MutableCircle extends n{radialLocator(){return this._radialLocator??=this._defaultRadialLocator()}_defaultRadialLocator(){return this.center().movedBy(this._radius,0).relatedTo(this.center())}radialEdge(){return this.center().to(this.radialLocator())}radialDirection(){return this.radialEdge().direction()}radius(){return this.radialEdge().length()}setRadius(e){const t=e-this.radius(),r=this.radialDirection().multipliedBy(t);this.radialLocator().moveBy(r.x(),r.y(),r.z())}xy(){return new this.constructor(this.center().xy(),this.radius())}containsPoint(e){return e.z()==this.z()&&this.xy().contains(e.x(),e.y())}}},31888:(e,t,r)=>{const n=r(99720),i=r(84188);e.exports=class BackgroundTasker{constructor(e){this._taskSource=e}apiClient(){return this._apiClient||(this._apiClient=new n,this._apiClient.setDefaultHeaders({})),this._apiClient}taskSource(){return this._taskSource}_actionURL(){return this.taskSource().actionURL()}_body(){return this.taskSource().requestBody()}headers(){return{...this.taskSource().headers?.()||{},...this._defaultHeaders()}}_defaultHeaders(){return{"X-CSRF-Token":i.csrfToken()}}_completionURL(e){return this.taskSource().completionURL(e)}_requestOptions(){return this.taskSource().requestOptions?.()??{}}async execute(){await new Promise((e=>window.setTimeout(e)));const e=await this.apiClient().post(this._actionURL(),{body:await this._body(),headers:this.headers(),...this._requestOptions()});return await this._finish(e)}async _finish(e){const t=this._completionURL(e);return await new Promise(((e,r)=>{const n=setInterval((async()=>{try{const r=await this.apiClient().get(t);this.taskSource().isComplete(r)&&(clearInterval(n),e(r))}catch(e){clearInterval(n),r(e)}}),500)}))}}},77532:e=>{e.exports=class CSV{constructor(e,t){this._headers=e,this._dataRows=t}headers(){return this._headers}dataRows(){return this._dataRows}_escapeQuotes(e){return e.toString().replace(/"/g,'""')}_quote(e){const t=e.map((e=>`"${this._escapeQuotes(e)}"`)),r=t.pop();return t.push(`${r}\n`),t}blobData(){return[this._quote(this.headers()),...this.dataRows().map((e=>this._quote(e)))]}toBlob(){const e=this.blobData();return new Blob(e,{type:"text/csv"})}}},63189:e=>{e.exports=class ComponentWalker{static#c(e,t){try{const r=t(e);return Array.isArray(r)?r:[r]}catch(e){return[]}}static#u(e,t){return e.components?e.components().flatMap((e=>this.walk(e,t))):[]}static walk(e,t){return[...this.#c(e,t),...this.#u(e,t)]}}},19075:e=>{class Keyboard{static operatingSystems={LINUX:"linux",MACOS:"macos",WINDOWS:"windows"};static modifierKeys={PRIMARY:"PRIMARY",COMMAND:"COMMAND",CONTROL:"CONTROL",SHIFT:"SHIFT"};static specialKeys={ESCAPE:"ESCAPE",RETURN:"RETURN",DELETE:"DELETE",SPACE:"SPACE"};constructor(e){this.__isMac=e.toLowerCase()===Keyboard.operatingSystems.MACOS}get _keyMap(){return void 0===this.__keyMap&&(this.__keyMap={[Keyboard.modifierKeys.PRIMARY]:this._primaryKey(),[Keyboard.modifierKeys.COMMAND]:this._commandKey(),[Keyboard.modifierKeys.CONTROL]:this._controlKey(),[Keyboard.modifierKeys.SHIFT]:this._shiftKey(),[Keyboard.specialKeys.ESCAPE]:this._escapeKey(),[Keyboard.specialKeys.RETURN]:this._returnKey(),[Keyboard.specialKeys.DELETE]:this._deleteKey(),[Keyboard.specialKeys.SPACE]:this._spaceKey()}),this.__keyMap}keyString(e){return this._keyMap[e]||e}_isMac(){return this.__isMac}_primaryKey(){return this._isMac()?this._commandKey():this._controlKey()}_commandKey(){return this._isMac()?String.fromCodePoint(8984):"Win"}_controlKey(){return this._isMac()?String.fromCodePoint(8963):"Ctrl"}_shiftKey(){return this._isMac()?String.fromCodePoint(8679):"Shift"}_escapeKey(){return`${this._isMac()?`${String.fromCodePoint(9099)} `:""}Esc`}_returnKey(){return this._isMac()?"Return":"Enter"}_deleteKey(){return this._isMac()?"Delete":"Backspace"}_spaceKey(){return"Space"}}e.exports=Keyboard},76905:e=>{e.exports=class LocatorUtils{static findClosest(e,t){return t.reduce((({locatable:t,distance:r},n)=>{const i=n.locator().distanceTo(e);return i<r?{locatable:n,distance:i}:{locatable:t,distance:r}}),{locatable:void 0,distance:1/0})}static findClosestLocator(e,t){return t.reduce((({locator:t,distance:r},n)=>{const i=n.distanceTo(e);return i<r?{locator:n,distance:i}:{locator:t,distance:r}}),{locator:t.first(),distance:1/0})}static directionTo(e,t){return e.subtract(t)}static sortOnEdge(e,t){const r=t.begin();return e.filter((e=>t.containsPoint(e))).sort(((e,t)=>e.distanceTo3D(r)-t.distanceTo3D(r)))}}},91262:e=>{e.exports=class Logger{static devLog(e){"test"!==navigator?.userAgent&&"localhost"===window?.location.hostname&&console.log(`${(new Date).toISOString()} - ${e}`)}}},83071:(e,t,r)=>{const{three:n}=r(37732);class Model3DSleeveDescriptor{static identityProcessor(e){return e}static xyProcessor(e){return e.xy()}static defineSlopes(e=0,t=0,r=e,n=t){return{previous:{min:e,max:t},next:{min:r,max:n}}}static structureDirections={unflipped:1,flipped:-1,all:void 0};constructor(e,t,{slopes:r=Model3DSleeveDescriptor.defineSlopes(),modelRotation:i=new n.Quaternion(0,0,0,1),materialNames:s,...o}={}){this._type=e,this._sleeveIdentifier=t,this._slopes=r,this._modelRotation=i,this._materialNames=s,this._details=o}type(){return this._type}sleeveIdentifier(){return this._sleeveIdentifier}details(){return this._details}minSlope(e="previous"){return this._slopes[e].min??=0}maxSlope(e="previous"){return this._slopes[e].max??=0}isSlopeAdjustable(){return this.details().slopeAdjustable}isRightCorner(){return this.details().isRightCorner}modelRotation(){return this._modelRotation}get directionProcessor(){return this.details().directionProcessor??this.constructor.identityProcessor}materialNames(){return this._materialNames}structureDirection(){return this.details().structureDirection}previousLevel(){return this.details().previousLevel}nextLevel(){return this.details().nextLevel}compatibleWith(e,t,{nextSlope:r,structureDirection:n,previousLevel:i,nextLevel:s}={}){if(this.type()!==e)return!1;const o=void 0===this.previousLevel()||this.previousLevel()===i,a=void 0===this.nextLevel()||this.nextLevel()===s;if(!o)return!1;if(!a)return!1;if(!(t>=this.minSlope("previous")&&t<=this.maxSlope("previous")))return!1;if(!(!r||r>=this.minSlope("next")&&r<=this.maxSlope("next")))return!1;return!this.structureDirection()||this.structureDirection()===n}}e.exports=Model3DSleeveDescriptor},53878:(e,t,r)=>{const{three:n}=r(37732),{Angle:i,$P:s}=r(62048),o=r(24212),a=r(29854),l=r(79041),c=r(66016),u=r(31651);e.exports=class Model3DSleeveHelper{constructor(e,t,r,i){this._post=e,this._descriptorMap=t,this._locator=r,this._rotation=i??new n.Quaternion(0,0,0,1)}post(){return this._post}descriptorMap(){return this._descriptorMap}locator(){return this._locator}rotationFor(e){return e.isSlopeAdjustable()?this._rotation:this._endPostRotationFor(this._rotation)}_endPostRotationFor(e){const t=this.post().isEndPost()?Math.PI:0,r=(new n.Quaternion).setFromAxisAngle(new n.Vector3(0,0,1),t);return e.clone().multiply(r)}direction(){return this.post().componentOf().edge().direction()}generateSleeve(){const e=this.post().attachedRailDirections();return this.post().isCornerPost()?this._generateCornerSleeve(e.first().negated(),e.last()):this.post().isTerminalPost()?this._generateTerminalSleeve():this.post().isSlopeTransitionPost()?this._generateCornerSleeve(e.first().negated(),e.last()):this._generateLineSleeve()}_generateLineSleeve(e){const t=this.lineSleeveDescriptor(e);return this._makeSleeve(this.direction(),t)}_generateTerminalSleeve(){const e=this.terminalSleeveDescriptor();return this._makeSleeve(this.direction(),e)}_makeSleeve(e,t){if(!t)return;return new(t.isSlopeAdjustable()?a:c)(this.locator(),e,t,this.rotationFor(t))}_makeRightCornerSleeve(e){const t=this.post().attachedSections(),[r,n]=t.map((e=>e.edge().direction()));return new l(this.locator(),r,n,e)}_generateCornerSleeve(e,t){const r=e.phi().isNearTo(Math.PI_2),n=t.phi().isNearTo(Math.PI_2),a=r||n?0:this._slope(),l=e.phi()<t.phi(),[c,u]=r||!n&&!l?[e,t]:[t,e],d=(u.theta()-c.theta()).normalizedAngle().radiansToDegrees().rounded(),h=new i(s(0,0),c,u).smallestDeltaDegrees().rounded(),p=this.cornerSleeveDescriptorFor(d,a)??this.cornerSleeveDescriptorFor(h,a);return p?.isRightCorner()?this._makeRightCornerSleeve(p):p?this._makeSleeve(c,p):180===h?this._generateLineSleeve(a):new o(this.locator(),c,u,this.adjustableCornerSleeveDescriptor())}adjustableCornerSleeveDescriptor(){return this._lookupDescriptor(u.adjustable)}lineSleeveDescriptor(e){return this._lookupDescriptor(u.line,e)}terminalSleeveDescriptor(){return this._lookupDescriptor(u.terminal)}cornerSleeveDescriptorFor(e,t){return this._lookupDescriptor(e,t)}_lookupDescriptor(e,t){return this.descriptorMap().lookup(e,this._slope(),{nextSlope:t,structureDirection:this._structureDirection(),previousLevel:this.post().previousSection()?.isLevel(),nextLevel:this.post().nextSection()?.isLevel()})}_slope(){return this.post().connectedSlope()}_structureDirection(){return this.post().structureDirection||console.log(this.post().constructor.name),this.post().structureDirection()}}},65898:e=>{e.exports=class Model3DSleeveMap{constructor(e){this._descriptors=e}descriptors(){return this._descriptors}lookup(e,t,r={}){return this.descriptors().find((n=>n.compatibleWith(e,t,r)))}}},45790:e=>{e.exports=class NumberUtils{static positionAlongRange(e,t=0,r=1){const n=t>r;n&&([t,r]=[r,t]);const i=((e-t)/(r-t)).constrained(0,1);return n?1-i:i}}},5660:e=>{e.exports=class ObjectUtils{static isObject(e){return e&&e.constructor===Object}static mergeDeep(e,{extendArrays:t=!1,sources:r=[]}={}){if(!r.length)return e;const n=r.shift();return this.isObject(e)&&this.isObject(n)&&Object.entries(n).forEach((([r,n])=>{this.isObject(n)?(e[r]||(e[r]={}),this.mergeDeep(e[r],{extendArrays:t,sources:[n]})):this._mergeNonObjects(e,r,n,t)})),this.mergeDeep(e,{extendArrays:t,sources:r})}static _mergeNonObjects(e,t,r,n){Array.isArray(r)&&n?(e[t]||(e[t]=[]),e[t]=[...e[t],...r]):e[t]=r}}},74320:(e,t,r)=>{const{Edge:n,Locator:i}=r(62048);e.exports=class PolygonImageGenerator{constructor(e,t=100){this._polygon=e,this._canvasDimension=t}polygon(){return this._polygon}canvasDimension(){return this._canvasDimension}generateImage({highlightedElement:e,drawingStyles:t={}}={}){if(!globalThis.document)return;const r=this._offscreenCanvas(t.backgroundColor),n=r.getContext("2d");return this._drawHighlightedElement(n,e,t),r.toDataURL("image/png")}_offscreenCanvas(e){const t=this.canvasDimension(),r=document.createElement("canvas");r.width=t,r.height=t;const n=r.getContext("2d"),i=this.polygon(),s=i.boundingBox(),o=s.center(),a=Math.max(s.width(),s.height()),l=t/(a+.4*a);return n.fillStyle=e,n.strokeStyle="#a8a8a8",n.fillRect(0,0,r.width,r.height),n.translate(t/2-o.x()*l,t/2-o.y()*l),n.scale(l,l),n.lineWidth=this._getScaledSize(n,this._baseLineWidth()),n._drawPolygon(i),r}_getScaledSize(e,t){return t/e.runningScaleX()}_drawHighlightedElement(e,t,r){t&&(t instanceof n&&this._drawEdge(e,t,r),t instanceof i&&this._drawLocator(e,t,r))}_drawEdge(e,t,r){const n=1.33*this._baseLineWidth();e.lineWidth=this._getScaledSize(e,n),e.lineCap="round",e.strokeStyle=r.strokeColor,e.setLineDash(r.lineDash),e._drawLine(t.begin(),t.end())}_drawLocator(e,t,r){const n=this._getScaledSize(e,8);e.strokeStyle="rgba(0, 0, 0, 0)",e.fillStyle=r.strokeColor,e._drawCircle(t.expandedByRadius(n))}_baseLineWidth(){return 3}}},76133:(e,t,r)=>{const{PolarCoordinate:n,Polygon:i}=r(62048);e.exports=class PolygonUtils{static stretchedBy(e,t){const r=e.edges(),s=e.vertices().map((e=>{const i=r.filter((t=>t.containsPoint(e))),s=(i.first().normal().theta()+i.last().normal().theta())/2,o=Math.min(...i.map((e=>e.normal().theta().normalizedAngle()))),a=s.normalizedAngle()-o,l=t/2/Math.cos(a),c=new n(l,s);return e.add(c.x(),c.y())}));return new i(s)}static containsShapeWithTolerance(e,t,r){return t.vertices().every((t=>e.containsPoint(t,r)))}static clockwisePolygonFromEdgePair(e,t){const r=t.direction().dot(e.direction())>0?t.reversed():t,n=[e,r];return this.clockwisePolygonFromPoints(n.flatMap((e=>e.endpoints())))}static clockwisePolygonFromPoints(e){const t=new i(e);return t.isCounterClockwise()&&t.reverseVertices(),t}static constrainLocatorTo(e,t){return e.containsPoint(t)?t:t.findClosestPoint(e.edges().map((e=>e.closestPointTo(t))))}}},24575:(e,t,r)=>{const n=r(63768);e.exports=class QuantitySet{constructor(e,t,r,n=1){this._minimumNumeric=e,this._maximumNumeric=t,this._unit=r,this._incrementNumeric=n}minimumNumeric(){return this._minimumNumeric}minimum(){return n.unit(this.minimumNumeric(),this.unit())}maximumNumeric(){return this._maximumNumeric}maximum(){return n.unit(this.maximumNumeric(),this.unit())}unit(){return this._unit}incrementNumeric(){return this._incrementNumeric}increment(){return n.unit(this.incrementNumeric(),this.unit())}toOptionList(){const e=[];for(let t=this.minimumNumeric();t<=this.maximumNumeric();t+=this.incrementNumeric())e.push({label:t.toString(),value:n.unit(t,this.unit())});return e}getNearest(e){const t=e.toNumeric(this.unit());if(t<=this.minimumNumeric())return this.minimum();if(t>=this.maximumNumeric())return this.maximum();const r=Math.round((t-this.minimumNumeric())/this.incrementNumeric()),i=(this.minimumNumeric()+r*this.incrementNumeric()).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES);return n.unit(i,this.unit())}getNearestNumeric(e,t){const r=n.unit(e,t);return this.getNearest(r).toNumeric(t).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES)}getRoundDownNearest(e){const t=e.toNumeric(this.unit());if(t<=this.minimumNumeric())return this.minimum();if(t>=this.maximumNumeric())return this.maximum();const r=Math.floor((t-this.minimumNumeric())/this.incrementNumeric()),i=(this.minimumNumeric()+r*this.incrementNumeric()).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES);return n.unit(i,this.unit())}getRoundDownNearestNumeric(e,t){const r=n.unit(e,t);return this.getRoundDownNearest(r).toNumeric(t).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES)}getNearestDelta(e,t,r){const i=e.toNumeric(t),s=this.increment().toNumeric(t),o=(r<0?n.ceil:n.floor)(r/s);if(!o)return 0;const a=i+o*s;return(this.getNearestNumeric(a,t)-i).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES)}}},90218:e=>{e.exports=class SelectPropertyOption{static optionForConfig(e){const t=e.details||{};return new this(e.label,t)}static optionsForConfigs(e){return e.map((e=>this.optionForConfig(e)))}constructor(e,{disabled:t=!1,...r}={}){this._label=e,this._disabled=t,this._details=r}get value(){return this}get label(){return this._label}get disabled(){return this._disabled??!1}get identifier(){return this.details().identifier||this.label}details(){return this._details}representedObject(){const e=this.details().representedClass;if(!e)return;return new e(this.details().config)}equals(e){return!!e&&this.identifier===e.identifier}}},14933:(e,t,r)=>{const n=r(63768);e.exports=class SlopeGradeHintHelper{hintFor(e){const t=Math.tan(e),r=n.fraction(t),i=10**(Math.floor(Math.log10(t))-1),s=r.simplify(i);return`${s.n}:${s.d} (${this.slopeHint(e)})`}slopeHint(e){return e>80..degreesToRadians()?"Incredibly Steep":e>30..degreesToRadians()?"Very Steep":e>20..degreesToRadians()?"Steep":e>10..degreesToRadians()?"Moderately Steep":e>4.8.degreesToRadians()?"Slightly Steep":"Wheelchair Friendly"}}},39662:e=>{e.exports=class StringUtils{static capitalized(e){return e?`${e.substring(0,1).toUpperCase()}${e.substring(1)}`:e}static sprintf(e,...t){let r=0;return e.replace(/%([dfs])/g,((e,n)=>{const i=t[r];switch(r+=1,n){case"d":return parseInt(i,10);case"s":return"function"!=typeof i.toString?i:i.toString();default:return i}}))}static titleCaseToDashCase(e){if(!e)return e;return e.split(" ").map((e=>e.toLowerCase())).join("-")}static dashCaseToTitleCase(e){return e?e.split("-").map((e=>`${e.charAt(0).toUpperCase()}${e.slice(1)}`)).join(" "):e}}},11511:(e,t,r)=>{const n={InnovativeAluminum:()=>r(8792),DockDesignerApp:()=>r(33430),WatersideDocks:()=>r(61193),EZDock:()=>r(89489),Kwikclamp:()=>r(95422),RogueFabricators:()=>r(45089),BearRidge:()=>r(72126),OasisBoatDocks:()=>r(60332),KAndS:()=>r(9536),DocksPreview:()=>r(5633),RailingsPreview:()=>r(51752),CityPost:()=>r(44400),Hollaender:()=>r(50400),AmericanMuscleDocks:()=>r(16971),RailingDepot:()=>r(4167),FalconRailings:()=>r(10809),CoastalPierAndDock:()=>r(98006),SafesmartAccess:()=>r(44275),DIY:()=>r(37154),Kona:()=>r(70726),Demo:()=>r(23154),Omega:()=>r(91164),Ultralox:()=>r(37076),AccessPlatform:()=>r(59865)};e.exports=new class SystemStrategyService{strategyIdentifier(){return this._strategyIdentifier??=this.defaultStrategyIdentifier()}defaultStrategyIdentifier(){return"Kona"}setStrategyIdentifier(e){this._strategyIdentifier=e}bundleIdentifier(){return this._bundleIdentifier}setBundleIdentifier(e){this._bundleIdentifier=e}isAdmin(){return this._isAdmin??=!1}setIsAdmin(e){this._isAdmin=e}editorMode(){return this._editorMode}setEditorMode(e){this._editorMode=e}strategyClass(){return n[this.strategyIdentifier()]()}strategy(){const e=new(this.strategyClass())(this.bundleIdentifier());return e.setIsAdmin(this.isAdmin()),e.setEditorMode(this.editorMode()),e.setConfiguration?.(this.configuration()),e}configuration(){return this._configuration}setConfiguration(e){this._configuration=e}}},30691:(e,t,r)=>{const{EdgeUtils:n}=r(8423),{$P:i,Angle:s,FixedEdgeLocator:o,Polygon:a}=r(62048),l=r(35668);e.exports=class ThunderCloudEdgeUtils extends n{static projectedEdge(e,t,r,n){const i=new l(e.begin(),t,r,n),s=new l(e.end(),t,r,n);return i.to(s).snapshot()}static locatorsAlongEdge(e,t){if(t<=0)return[];const r=e.length()/(t+1),n=[];for(let i=1;i<=t;i++)n.push(new o(e,r*i));return n}static angleBetween(e,t){const r=e.direction(),n=t.direction();return new s(i(0,0,0),r,n.negated())}static toPolygon(e){return new a([e.begin(),e.end()])}}},43797:e=>{e.exports={animateSmooth:(e,t=(()=>{}),r=(()=>{}))=>new Promise(((n,i)=>{let s;const o=i=>{if(!s)return s=i,void requestAnimationFrame(o);const a=i-s,l=Math.min(a/10/e,1),c=(Math.sin(l*Math.PI-Math.PI_2)+1)/2;if(t(c),1===l)return n(!0),void r();requestAnimationFrame(o)};requestAnimationFrame(o)}))}},44387:(e,t,r)=>{const n=r(45790);e.exports=(e,t,{minScale:r=.5,maxScale:i=10,minPixelsMultiplier:s=.75,maxPixelsMultiplier:o=1.5}={})=>{const a=t*s;return(n.positionAlongRange(e,r,i)*(t*o-a)+a)/e}},46748:(e,t,r)=>{const n=r(63768),i={};e.exports=function(e,...t){const r={},s=e.reduce(((e,n,i)=>{const s=`value${i}`;return r[s]=t[i-1],e+s+n})).replace(/\n/g," ");return s in i||(i[s]=n.compile(s)),i[s].evaluate(r)}},42947:e=>{e.exports={item:"Item",description:"Description",quantity:"Quantity",unit:"Unit",unitPrice:"Unit Price",amount:"Amount",invoice:"Invoice"}},41784:e=>{class CustomLogger{constructor(e,t=[]){this._context=e,this._exclusions=t}get context(){return this._context}get exclusions(){return this._exclusions}_isExcluded(e){return this.exclusions.find((t=>e?.toString().includes(t)))}log(e,...t){t.filter((e=>!this._isExcluded(e))).forEach((e=>{const t=e instanceof Error?e.stack||e.message:e;this.context._logs.push(t)})),e(...t)}}e.exports={CustomLogger,configureConsoleLogging:function(e=globalThis,t=[]){e.consoleLog=e.console.log.bind(e.console),e.consoleWarn=e.console.warn.bind(e.console),e.consoleError=e.console.error.bind(e.console),e.consoleClear=e.console.clear.bind(e.console),e._logs=[];const r=new CustomLogger(e,t);e.console.clear=function(){e._logs=[],e.consoleClear.apply(e.console)},e.console.log=(...t)=>r.log(e.consoleLog,...t),e.console.warn=(...t)=>r.log(e.consoleWarn,...t),e.console.error=(...t)=>r.log(e.consoleError,...t),e.window.addEventListener("error",(t=>{r.log(e.consoleError,t.error)})),e.window.addEventListener("unhandledrejection",(t=>{r.log(e.consoleError,t.reason)}))}}},68606:e=>{function t(e,t,r,n=!0){const i=t.subtract(e).normalized(),s=e.distanceTo(t),o=Math.ceil(s.roundedTo(0)/r),a=s/o,l=[];for(let t=1;t<o;t++){const r=t*a,n=i.multipliedBy(r),s=e.add(n);l.push(s)}return n?[e,...l,t]:l}e.exports={equallySpacedEdges:function(e,r,n=!0){const[i,s]=e;return t(i.center(),s.center(),r,n).map((e=>{const t=e.subtract(i.center()),r=i.begin().add(t),n=i.end().add(t);return r.to(n)}))},equallySpacedLocators:t}},95208:(e,t,r)=>{const n=r(63768),i=r(72843);e.exports=function(e,t=16,r=!1){const s=e>=0?"":"-",o=Math.abs(i(e,t)),a=r?Math.trunc(o/12):0,l=r?o%12:o,c=Math.trunc(l),u=n.fraction(l-c),d=[];0!==a&&d.push(`${a}'`),0!==c&&d.push(c),0!==u.n&&d.push(`${u.n}/${u.d}`),0===d.length&&d.push("0");const h=d.join(" ");return 0!==c||0!==u.n?`${s}${h}"`:`${s}${h}`}},27817:e=>{e.exports=(e,t,r)=>{r.forEach((r=>{e.prototype[r]=function(...e){return this[t]()[r](...e)}}))}},12234:(e,t,r)=>{const n=r(63768),i=r(62048),s=r(7340),o=r(37732),{SmartObjectBuilder:a}=r(57075),{extend:l}=r(50988),c=r(71300),u=r(26511),d={geometry:i,"drawing-editor":s,"drawing-editor-3D":o};let h;a.configure((e=>{h=e.classes}));const p={math:n},m={defaultSleeveDescriptorDefinitions:c,generic2inPipeSleeveDescriptorDefinitions:u};e.exports=e=>{const t=(e=>{const t=e.functions.flatMap((e=>e.dependencies)).uniqueValues().map((e=>{switch(e.type){case"lcad":return{name:e.name,value:d[e.packageName][e.name]};case"class":return{name:e.name,value:h.getClass(e.name)};case"package":return{name:e.name,value:p[e.name]};case"file":return{name:e.name,value:m[e.name]}}})),r=(e.mixins??[]).map((e=>({name:e,value:h.getClass(e)})));return r.length>0&&r.push({name:"extend",value:l}),[...t,...r]})(e),r=t.map((e=>e.value)),n=e.mixins??[],i=new Function(`\n    ${t.map(((e,t)=>`const ${e.name} = arguments[${t}]`)).join("\n")}\n    const ${e.parent_class} = arguments[${t.length}]\n\n    class ${e.class_name} extends ${e.parent_class} {\n      ${e.functions.map((e=>"get"===e.type?`${e.name}() {\nreturn ${e.value}\n}\n`:"generic"===e.type?`${e.name}() {\n${e.value.join("\n")}\n}\n`:void 0)).join("\n")}\n    }\n\n    ${n.map((t=>`extend(${e.class_name}, ${t})`)).join("\n")}\n    return ${e.class_name}\n  `)(...r,h.getClass(e.parent_class));return h.addClass(i),i}},27586:e=>{e.exports=e=>{const t=Number(e);return Number.isFinite(t)?new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(t):"--"}},72843:e=>{e.exports=function(e,t=8){return Math.round(e*t)/t}},97677:(e,t,r)=>{const n=r(63768),i=r(72843);e.exports=function(e,t=16){const r=e.toJSON().unit,s=e.toNumeric(r),o=i(s,t);return n.unit(o,r)}},15411:(e,t,r)=>{const n=r(63768);e.exports=(e,t,r)=>{const i=t.slice().map((e=>e.toNumeric(r).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES))).sort(((e,t)=>t-e)),s=e.toNumeric(r).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES),o=i.last();let a=s;return i.flatMap((e=>{let t=Math.floor(a/e);return a-=t*e,a>0&&a<o&&(a+=e,t-=1),Array(t).fill(n.unit(e,r))})).reverse()}},70666:(e,t,r)=>{const{ImperialDecimalLengthFormatter:n}=r(7340);e.exports=class DecimalFeetFormatter extends n{format(e){return`${e.toDecimalFeet(this.decimalPlaces())}${this.footSymbol()}`}}},45615:(e,t,r)=>{const{LengthFormatter:n}=r(7340);class MetricFormatter extends n{static _unitConfigDefinition=(e,t,r)=>({symbol:e,meterFactor:t,decimalPlaces:r});static _defaultUnitConfigs={mm:MetricFormatter._unitConfigDefinition("mm",.001,0),cm:MetricFormatter._unitConfigDefinition("cm",.01,2),m:MetricFormatter._unitConfigDefinition("m",1,3),km:MetricFormatter._unitConfigDefinition("km",1e3,1)};constructor(e="mm",t=MetricFormatter._defaultUnitConfigs[e].decimalPlaces,r=MetricFormatter._defaultUnitConfigs[e].meterFactor){super(),this._baseUnit=e,this._config=MetricFormatter._unitConfigDefinition(e,r,t)}baseUnit(){return this._baseUnit}symbol(){return this._config.symbol}meterFactor(){return this._config.meterFactor}decimalPlaces(){return this._config.decimalPlaces}format(e){return`${(e.toNumeric("m")/this.meterFactor()).roundedTo(this.decimalPlaces())} ${this.symbol()}`}}e.exports=MetricFormatter},27892:(e,t,r)=>{const{$P:n,ProportionalEdgeLocator:i}=r(62048),{animateSmooth:s}=r(43797),o=(e,t,r)=>{const o=e.scale(),a=r-o,l=n(e.translateX(),e.translateY()),c=l.to(t),u=Math.round(a/4),d=Math.round(l.distanceTo(t)/4),h=Math.min(u+d,150);s(h,(t=>{const r=new i(c,t),n=o+t*a;e.setScale(n),e.setTranslation(r.x(),r.y()),e.draw()}))};function a(e,t,r){const n=e/t;return Number.isFinite(n)&&n||r}const l=(e,t,{defaultScale:r=1,panelWidth:n=255,padding:i=25}={})=>{const s=2*n,o=t.width-s-2*i,l=a(t.height-2*i,e.height(),r),c=a(o,e.width(),r);return Math.min(l,c)},c=(e,t)=>{const r=e.canvasCenter(),i=e.scale(),s=t.multipliedBy(i),o=r.x()-s.x(),a=r.y()-s.y();return n(o,a)};e.exports={zoomToPoint:o,zoomToBounds:(e,t)=>{const r=e.canvas(),n=l(t,r),i=e.scale();e.setScale(n);const s=c(e,t.center());e.setScale(i),o(e,s,n)},zoomForBounds:l}},84316:(e,t,r)=>{const n=r(63768),i=r(64805),s=r(50669),o=s.hw172.postMountStyles.classInstanceConfigs.ThunderCloudPostMountStyle.find((e=>e.mountingMode===i.postMountingMode.fascia)).offsetFromEdgeOfPlatform.toNumeric("in"),a=57.5.degreesToRadians(),l=s.hw172.railingPost.defaultLength.toNumeric("in")/2,c={fascia:n.unit(-(2+l+o*Math.cos(a)),"in"),surface:n.unit(-(1+l),"in")};e.exports={hw172:{terminalInset:n.unit(-3,"in"),[i.postMountingMode.fascia]:{obliqueInsetRanges:[{lowerBound:100,upperBound:129,insetAtBegin:n.unit(0,"in"),insetAtEnd:c.fascia}]},[i.postMountingMode.surface]:{obliqueInsetRanges:[{lowerBound:100,upperBound:129,insetAtBegin:n.unit(0,"in"),insetAtEnd:c.surface}]}}}},43793:(e,t,r)=>{const n=r(63768),{RailLengthHelper:i}=r(8423),s=r(35080),o=r(90348),a=r(17171),l=r(10590),c=r(38282),u=r(64805),d=r(56124),h=r(21643),p=r(55201),m=r(76486),f=r(6022),{railingTerminationModes:g,topRailTerminationMap:y,bottomRailTerminationMap:b}=r(83819),v=c({railings:{base:m,railingCollection:{defaultRailingHeight:n.unit(40,"in"),displayProperties:{railLengthMode:{show:!1,choices:[i.mode.EVEN]},railingStyle:{choices:["weldedPicket"]},terminationProperties:[{label:u.termination.mode,options:Object.values(g)},{label:"Top Rail",dependsOn:u.termination.mode,optionsMap:y},{label:"Bottom Rail",dependsOn:u.termination.mode,optionsMap:b}]}},railingRun:{annotationHelpers:{angles:{class:s,config:{layer:p.RUN_TRANSITION_ANGLE_ANNOTATIONS}}},generatedStructure:{width:n.unit(1.5,"in"),thickness:n.unit(6,"in"),defaultFigure:{styleProperties:{fillStyle:d.colors.contrast.mediumHigh,strokeStyle:d.colors.contrast.mediumHigh,lineWidth:.1}}}},railingSection:{sectionClass:l,displayProperties:{length:{label:"Deck Length",defaultUnit:"ft"},maxPostSpacing:{show:!0,defaultUnit:"ft"}},annotationHelpers:{linear:{class:o,config:{defaultModelName:"RailingSection",modelBasedAnnotations:{platform:{layer:p.DECK_LENGTH_ANNOTATIONS,distance:110},postRun:{layer:p.RAIL_RUN_LENGTHS,distance:70},postSpacing:{layer:p.POST_SPACING_ANNOTATIONS,distance:40}}}},warning:{class:a,config:{defaultModelName:"RailingSection",distance:-40,options:{orthogonalTextRendering:!0,adjustForZoomLevel:!1},modelBasedAnnotations:{maxPostSpacing:{layer:h.WARNING_ANNOTATIONS,distance:-40,shouldWarn:"hasActualPostSpacingInExcessOfMaximum",message:{key:"actualPostSpacingIsOutOfDesignWarning"}}}}}},sectionLengthAnnotationLayer:p.DECK_LENGTH_ANNOTATIONS},railingStyles:{[f.styleId]:f}},messages:{actualPostSpacingIsOutOfDesignWarning:"Post spacing is beyond the scope of IAS product engineering."},base:{alwaysVisibleLayers:h}});e.exports=v},26168:(e,t,r)=>{const{titleCaseToDashCase:n}=r(39662),i=r(43320),{registerStandardMaterial:s}=r(2454),o=r(56124),a={namePrefix:"ias-",roughness:.9,metalness:.1};function l(e,t,{materialOptions:r=a,strokeStyle:l=o.colors.black}={}){const c=n(e);return s(c,{color:t,...r}),new i(e,`${r.namePrefix||""}${c}${r.nameSuffix||""}`,t,l)}e.exports=[l("Black","#202120",{strokeStyle:o.colors.contrast.low}),l("White","#FFFFFF"),l("Beige","#A09169"),l("Coastal Grey","#7F8985"),l("Hartford Green","#224E35",{strokeStyle:o.colors.contrast.low}),l("Light Ivory","#CCC79E"),l("Oyster Gray","#C2C1A5"),l("Phantom Bronze","#3A392A",{strokeStyle:o.colors.contrast.low}),l("Rideau Brown","#202017",{strokeStyle:o.colors.contrast.low}),l("Sandalwood","#AB9878"),l("Silver Matte","#828E8C"),l("Sparrow Grey","#505153",{strokeStyle:o.colors.contrast.low}),l("Textured Black","#202120",{strokeStyle:o.colors.contrast.low})]},50669:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),s=r(22391),o=r(74134),a=r(88646),l=r(56214),c=r(64805),u=r(56124),d=r(38611),h=r(21643),{defaultPostLength:p,defaultPostWidth:m}=r(76486),f={hw172:"172_HEAVY_WALL"};e.exports={postTypeIdBases:f,hw172:{railingPost:{defaultLength:p,defaultWidth:m,defaultFigure:{styleProperties:{lineWidth:.1}},orientationHelper:{config:{cornerAngleRanges:[{lowerBound:0,upperBound:129.99,rotation:0},{lowerBound:129.99,upperBound:180,rotation:"bisect"}]}},layer:h.POSTS,parts:{leg:{geometryType:c.geometryType.extrusion,crossSection:new a([new l(i(0,0).expandedBy(p.toNumeric("in")/2,m.toNumeric("in")/2))]),defaultFigure:{styleProperties:{strokeStyle:u.colors.contrast.low,fillStyle:u.colors.black}}}}},postClasses:[o,s],postMountStyles:{classInstanceConfigs:{ThunderCloudPostMountStyle:[d({name:"Surface",id:`${f.hw172}_SMP`,mountingMode:c.postMountingMode.surface,offsetFromEdgeOfPlatform:n.unit(3,"in")}),d({name:"Fascia",id:`${f.hw172}_FMP`,mountingMode:c.postMountingMode.fascia,offsetFromEdgeOfPlatform:n.divide(p,2),offsetBelowSurfaceOfPlatform:n.unit(5,"in")})]}}}}},83819:(e,t,r)=>{const n=r(84692),i={END_CAP:{label:"End Cap"},END_SLEEVE:{label:"End Sleeve"},TOP_RAIL_WALL_MOUNT:{label:"Top Rail Wall Mount"},INSIDE_SLEEVE_WALL_MOUNT:{label:"Inside Sleeve Wall Mount"}},s={BOTTOM_RAIL_WALL_MOUNT:{label:"Bottom Rail Wall Mount"},BOTTOM_RAIL_CLIP:{label:"Bottom Rail Clip"},RAILING_STYLE_DEPENDENT:{label:"Railing Style Dependent"}},o={FREE_STANDING:{label:"Free standing",details:{identifier:"free-standing",representedClass:n,config:{includesWallMount:!1,includesPost:!0}}},RESTRAINED:{label:"Restrained",details:{identifier:"restrained",representedClass:n,config:{includesWallMount:!0,includesPost:!1}}},RESTRAINED_WITH_POST:{label:"Restrained with post",details:{identifier:"restrained-with-post",representedClass:n,config:{isWallMounted:!0,includesPost:!0}}}},a={[o.FREE_STANDING.details.identifier]:[i.END_CAP,i.END_SLEEVE],[o.RESTRAINED.details.identifier]:[i.TOP_RAIL_WALL_MOUNT,i.INSIDE_SLEEVE_WALL_MOUNT],[o.RESTRAINED_WITH_POST.details.identifier]:[i.TOP_RAIL_WALL_MOUNT,i.INSIDE_SLEEVE_WALL_MOUNT]},l={[o.FREE_STANDING.details.identifier]:[s.RAILING_STYLE_DEPENDENT],[o.RESTRAINED.details.identifier]:[s.BOTTOM_RAIL_WALL_MOUNT,s.BOTTOM_RAIL_CLIP],[o.RESTRAINED_WITH_POST.details.identifier]:[s.RAILING_STYLE_DEPENDENT]};e.exports={topRailTerminations:i,bottomRailTerminations:s,railingTerminationModes:o,topRailTerminationMap:a,bottomRailTerminationMap:l}},76486:(e,t,r)=>{const n=r(63768),i=r(26168),s=n.unit(1.72,"in");e.exports={defaultPostLength:s,defaultPostWidth:s,maxRailLength:n.unit(72,"in"),colors:[{label:"Rail Color",key:"defaultColor",palette:i}]}},6022:(e,t,r)=>{const n=r(63768),i=r(90462),s=r(50669),o=i({styleId:"weldedPicket",label:"Welded Picket",icon:"picket-rail",postLayoutEdgeInsetHelper:{config:r(84316).hw172},cornerPostReuseTolerance:n.multiply(2,s.hw172.railingPost.defaultLength),...s.hw172});e.exports=o},26885:(e,t,r)=>{const n=r(43812);e.exports=class InnovativeAluminumProject extends n{}},21643:e=>{e.exports={POSTS:"Railing Posts",WARNING_ANNOTATIONS:"Warnings"}},55201:e=>{e.exports={DECK_LENGTH_ANNOTATIONS:"Deck Lengths",RAIL_RUN_LENGTHS:"Rail Run Lengths",POST_SPACING_ANNOTATIONS:"Post Spacing",RUN_TRANSITION_ANGLE_ANNOTATIONS:"Run Transition Angles"}},97529:e=>{e.exports={PLATFORMS:"Deck Edges"}},79574:(e,t,r)=>{const n=r(63768),{NullDrawable:i}=r(7340),s=r(47256),o=r(95208);e.exports=class KAndSAntiRailBreakZone extends s{static defaultWidth(){return n.unit(2,"ft")}static defaultLength(){return n.unit(2,"ft")}formatDimension(e){return o(e.toNumeric("in"),this.fractionPrecisionDenominator())}fractionPrecisionDenominator(){return this.project().fractionPrecisionDenominator()}_zoneChanged(e=this.project()){e.resetCollectionZones()}defaultFigure(){return super.defaultFigure()}defaultAnnotations(){return[]}}},77026:(e,t,r)=>{const{CompositeFigure:n}=r(7340),{Composite3DFigure:i}=r(37732),{Polygon:s}=r(62048),o=r(83102),a=r(99784);e.exports=class KAndSBlock extends o{constructor(e){super(),this._edge=e}edge(){return this._edge}topRailBaseHeight(){return this.componentOf().topRailBaseHeight()}bottomRailHeight(){return this.componentOf().bottomRailHeight()}bottomRailHeightNumeric(){return this.bottomRailHeight().toNumeric(this.unit())}postWidth(){return this.componentOf().postWidth()}bottomRailEdge(){const e=this.slope().toNumeric("rad"),t=-this.postWidth().toNumeric(this.unit())/Math.cos(e);return this.edge().stretchedBy(t).relativeToEdge(this.edge()).addZ(-this.bottomRailHeightNumeric())}bottomRail(){return this._bottomRail||(this._bottomRail=this._defaultBottomRail()),this._bottomRail}_defaultBottomRail(){if(!this._canPlaceBottomRail())return;const e=new a(this.bottomRailEdge());return e.setComponentOf(this),e}_canPlaceBottomRail(){return this.componentOf().hasRails()}fractionPrecisionDenominator(){return this.componentOf().fractionPrecisionDenominator()}slopeAngleDecimalPrecision(){return this.componentOf().slopeAngleDecimalPrecision()}slope(){return this.componentOf().slope()}isBeginBlock(){return this===this.componentOf().beginBlock()}isEndBlock(){return this===this.componentOf().endBlock()}isStairs(){return this.componentOf().isStairs()}components(){return[this.bottomRail()].filter((e=>e))}geometry(){return new s([this.edge().begin(),this.edge().end()])}defaultFigure(){return n.withModel(this)}threeFigure(){return i.withModel(this)}async load(){return Promise.all(this.components().map((e=>e.load?.())))}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_bottomRail"]}}},99784:(e,t,r)=>{const n=r(47999),i=r(93050);e.exports=class KAndSBottomRail extends n{_referenceMaterialSpecifier(){return i.Bottom_Rail}}},27661:(e,t,r)=>{const n=r(9343),i=r(68179);e.exports=class KAndSCutAngleAnnotation extends n{defaultFigure(){const e=new i(this);return e.setLayer(this.layer()),e}}},15489:(e,t,r)=>{const n=r(63768),i=r(41478);e.exports=class KAndSFramedGlassBlock extends i{_glassPanelRailInset(){return n.unit(3/8,"in")}_glassPanelPostInset(){return n.unit(-1.5,"in")}}},53359:(e,t,r)=>{const n=r(13356),i=r(93050);e.exports=class KAndSFramedGlassSection extends n{static displayName(){return"Framed Glass Section"}glassThickness(){return this.railingStyle().glassThickness()}pricingReferenceMaterialSpecifier(){return i.Glass_5mm_Railing}}},47126:(e,t,r)=>{const n=r(63768),{FixedEdgeLocator:i}=r(62048),s=r(41478),o=r(95589);e.exports=class KAndSFramelessGlassBlock extends s{_defaultGlassPanel(){return new o(this._glassPanelBottomEdge(),this._glassPanelTopEdge())}_glassPanelPostInset(){const e=n.unit(1,"in"),t=n.subtract(this.postWidth(),e);return n.divide(t,2)}_glassPanelEdge(){return this._glassPanelEdgeBegin().to(this._glassPanelEdgeEnd())}_glassPanelEdgeBegin(){return this._shouldHaveBeginInset()?new i(this.edge(),this._glassPanelInset()):this.edge().begin()}_glassPanelEdgeEnd(){return this._shouldHaveEndInset()?new i(this.edge(),this.edge().length()-this._glassPanelInset()):this.edge().end()}_shouldHaveBeginInset(){if(!this.componentOf().hasBeginBlockInset())return!1;const e=this._sectionEdge(),t=this._terminalGlassInset(!0).toNumeric(this.unit()),r=this._cornerGlassInset().toNumeric(this.unit()),n=new i(e,t),s=new i(e,r);return!this.edge().begin().equals(n)&&!this.edge().begin().equals(s)}_shouldHaveEndInset(){if(!this.componentOf().hasEndBlockInset())return!1;const e=this._sectionEdge(),t=this._terminalGlassInset(!1).toNumeric(this.unit()),r=this._cornerGlassInset().toNumeric(this.unit()),n=new i(e,e.length()-t),s=new i(e,e.length()-r);return!this.edge().end().equals(n)&&!this.edge().end().equals(s)}_glassPanelInset(){return this.postWidth().toNumeric(this.unit())/2-this._glassPanelPostInset().toNumeric(this.unit())}_terminalGlassInset(e){return this.componentOf().terminalGlassInset(e)}_cornerGlassInset(){return this.componentOf().cornerGlassInset()}holeInset(){return this.componentOf().holeInset()}holesOnBeginSide(){const e=this.isBeginBlock(),t=this.componentOf().sectionConnectedToBegin();return this._shouldHaveHoles(e,t)}holesOnEndSide(){const e=this.isEndBlock(),t=this.componentOf().sectionConnectedToEnd();return this._shouldHaveHoles(e,t)}_shouldHaveHoles(e,t){return!!e&&(!t||!this._sectionIsParallelToBlock(t))}_sectionIsParallelToBlock(e){return this.edge().isParallelTo(e.edge())}_sectionEdge(){return this.componentOf().glassPanelSectionEdge()}annotations(){return[]}}},95589:(e,t,r)=>{const n=r(99317),i=r(93050);e.exports=class KAndSFramelessGlassPanel extends n{_slopedReferenceMaterialSpecifier(){return i.Sloped_Frameless_Glass_Panel}holesOnBeginSide(){return this.componentOf().holesOnBeginSide()}holesOnEndSide(){return this.componentOf().holesOnEndSide()}}},27776:(e,t,r)=>{const n=r(63768),{FixedEdgeLocator:i,RelativeLocator:s}=r(62048),o=r(13356),a=r(93050);e.exports=class KAndSFramelessGlassSection extends o{static displayName(){return"Frameless Glass Section"}absoluteMaxPostSpacing(){return n.unit(60,"in")}defaultMaxPostSpacing(){return n.unit(52,"in")}absoluteMinPostSpacing(){return n.unit(6,"in")}_classForPost(e,t){return this._postClass()}postLocations(){const e=super.postLocations();if(2!==e.length)return e;const t=this.postWidth().toNumeric(this.unit());return e.first().distanceTo(e.last())-t>=this.absoluteMinPostSpacing().toNumeric(this.unit())?e:[this.componentLayoutEdge().center()]}_postLayoutReferenceEdge(){const e=this.glassPanelSectionEdge().begin(),t=this.glassPanelSectionEdge().end(),r=super._postLayoutReferenceEdge().closestPointTo(e),n=super._postLayoutReferenceEdge().closestPointTo(t);return r.to(n).relativeToEdge(this.edge())}_blockBreakLocations(){let e=super.postLocations().map((e=>{const t=this.glassPanelSectionEdge().closestPointTo(e);return s.makeRelativeTo(t,this.edge().begin())}));if(this.sectionConnectedToBegin()||(e[0]=this._locatorForTerminus(!0)),this.sectionConnectedToEnd()||(e[e.length-1]=this._locatorForTerminus(!1)),this._hasBeginCorner()&&(e[0]=this._locatorForCorner(!0)),this._hasEndCorner()&&(e[e.length-1]=this._locatorForCorner(!1)),e.length<=1){const t=2*this.terminalGlassInset().toNumeric(this.unit()),r=this.glassPanelSectionEdge().stretchedBy(-t);e=[r.begin(),r.end()]}return e}_locatorForTerminus(e){const t=this.terminalGlassInset(e).toNumeric(this.unit());return this._locatorWithInset(e,t)}_locatorForCorner(e){const t=this.cornerGlassInset().toNumeric(this.unit());return this._locatorWithInset(e,t)}_locatorWithInset(e,t){const r=this.glassPanelSectionEdge(),n=e?t:r.length()-t;return new i(r,n)}glassPanelSectionEdge(){const e=this.glassPanelOffsetEdge();let t=e.begin(),r=e.end();if(this._hasBeginCorner()){const e=this.sectionConnectedToBegin().glassPanelOffsetEdge();t=this._glassPanelEdgeIntersectionPoint(e)??t}if(this._hasEndCorner()){const e=this.sectionConnectedToEnd().glassPanelOffsetEdge();r=this._glassPanelEdgeIntersectionPoint(e)??r}return t.to(r).relativeToEdge(this.edge())}_glassPanelEdgeIntersectionPoint(e){return this.glassPanelOffsetEdge().intersectionsWithLine(e).first()}glassPanelOffsetEdge(){const e=this.glassPanelNormalOffset();return this.componentLayoutEdge().shiftedAlongNormalBy(e).relativeToEdge(this.edge())}glassPanelNormalOffset(){let e=this.postWidth().toNumeric(this.unit())/2+this.glassThickness().toNumeric(this.unit())/2;return this.componentOf().structureAlongNormal()&&(e=-e),e}componentLayoutEdge(){return this.postMountStyle().componentLayoutEdgeFor(this,!1).relativeToEdge(this.edge())}_hasBeginCorner(){const e=this.sectionConnectedToBegin();return e&&!this.isParallelToSection(e)}_hasEndCorner(){const e=this.sectionConnectedToEnd();return e&&!this.isParallelToSection(e)}glassThickness(){return this.railingStyle().glassThickness()}terminalGlassInset(e){if(void 0!==e){const t=e?this.edge().begin():this.edge().end();if(this.openingConnectedTo(t))return n.unit(0,"in")}return n.unit(1,"in")}cornerGlassInset(){return n.unit(.5,"in")}cornerPostInset(e){const t=this._cornerAngleForInset(e);return 0===t||360===t?n.unit(0,"in"):n.add(this.railingStyle().postInset(),this.cornerGlassInset())}terminalPostInset(){return n.add(this.railingStyle().postInset(),this.terminalGlassInset())}holeInset(){const e=this.postLocations();let t=this.terminalPostInset();if(1===e.length){const r=this.componentLayoutEdge().begin().distanceTo(e.first());t=n.unit(r,this.unit())}const r=this.terminalGlassInset();return n.subtract(t,r)}hasRails(){return!1}_terminalPostSpacingAnnotationInset(){return this.isStairs()?super._terminalPostSpacingAnnotationInset():0}_postSpacingAnnotationLocators(){const e=this.postLocations().map((e=>this.glassPanelOffsetEdge().closestPointTo(e)));return this.isStairs()?e:[this.glassPanelOffsetEdge().begin(),...e,this.glassPanelOffsetEdge().end()]}pricingReferenceMaterialSpecifier(){return a.Glass_12mm_Railing}}},41478:(e,t,r)=>{const n=r(63768),i=r(77026),s=r(99317);e.exports=class KAndSGlassBlock extends i{glassThickness(){return this.componentOf().glassThickness()}glassPanel(){return this._glassPanel||(this._glassPanel=this._defaultGlassPanel(),this._glassPanel.setComponentOf(this)),this._glassPanel}_defaultGlassPanel(){return new s(this._glassPanelBottomEdge(),this._glassPanelTopEdge())}_glassPanelEdge(){return this.edge().stretchedBy(2*-this._glassPanelInset()).relativeToEdge(this.edge())}_glassPanelTopEdge(){const e=this.topRailBaseHeight(),t=n.add(e,this._glassPanelRailInset()).toNumeric(this.unit());return this._glassPanelEdge().addZ(-t)}_glassPanelBottomEdge(){const e=this.bottomRailHeight(),t=n.subtract(e,this._glassPanelRailInset()).toNumeric(this.unit());return this._glassPanelEdge().addZ(-t)}_glassPanelInset(){return this.postWidth().toNumeric(this.unit())/2-this._glassPanelPostInset().toNumeric(this.unit())}_glassPanelRailInset(){return n.unit(0,"in")}_glassPanelPostInset(){return n.unit(0,"in")}holeInset(){return n.unit(0,"in")}components(){return[...super.components(),this.glassPanel()]}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_glassPanel"]}}},99317:(e,t,r)=>{const n=r(63768),i=r(95208),s=r(81996),o=r(30691),a=r(93050);e.exports=class KAndSGlassPanel extends s{constructor(e,t){super(e),this._topEdge=t}panelThickness(){return this.componentOf().glassThickness()}topEdge(){return this._topEdge}height(){const e=this.topEdge().begin().z()-this.edge().begin().z();return n.unit(-e,this.unit())}length(){const e=this.topEdge().length();return n.unit(e,this.unit())}materialSpecifier(){const e=this._referenceMaterialSpecifier(),t=e.name(),r=[],n=this.formattedPricingLength();if(r.push(n),!this.isLevel()){const e=this.slope().toNumeric("deg").roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES);r.push(`${e}°`)}const i=`${t} – ${r.join(" – ")}`;return e.specifierForDescription(i)}_referenceMaterialSpecifier(){return this.isLevel()?a.Glass_Panel:this._slopedReferenceMaterialSpecifier()}_slopedReferenceMaterialSpecifier(){return a.Sloped_Framed_Glass_Panel}isLevel(){return o.isLevel(this.topEdge())}slope(){return this.componentOf().slope()}slopePrecision(){return this.componentOf().slopeAngleDecimalPrecision()}formattedPricingLength(){const e=this.topEdge().length(),t=this.fractionPrecisionDenominator();return i(e,t)}fractionPrecisionDenominator(){return this.componentOf().fractionPrecisionDenominator()}holesOnBeginSide(){return!1}holesOnEndSide(){return!1}holeInset(){return this.componentOf().holeInset()}shapeMatches(e){return this._dimensionsMatch(e)&&this._holesMatch(e)}_holesMatch(e){if(!(this.holesOnBeginSide()||this.holesOnEndSide()||e.holesOnBeginSide()||e.holesOnEndSide()))return!0;if(!this.holeInset().equals(e.holeInset()))return!1;const t=this.holesOnBeginSide(),r=e.holesOnBeginSide(),n=this.holesOnEndSide(),i=e.holesOnEndSide();if(t===r&&n===i)return!0;if(!(this.isLevel()&&e.isLevel()))return!1;return t===i&&n===r}}},55747:(e,t,r)=>{const n=r(63768),i=r(6556);e.exports=class KAndSMaterialPricingLineItem extends i{unitPrice(e){const t=super.unitPrice(e),r=this.upcharge(e);return n.add(t,r)}upcharge(e){const t=this.specifier().details(),r=t.defaultMeasurement,i=t.measurement,s=t.upchargeIncrement,o=t.upchargeSource;if(!(r&&i&&s&&o))return n.unit(0,"in");const a=e.unitPrice(o),l=this._upchargeMultiplier(i,r,s);return n.multiply(a,l)}_upchargeMultiplier(e,t,r){const i=r.toNumeric("in").rounded(),s=n.add(t,r);if(n.smaller(e,s))return 0;const o=n.subtract(e,t).toInches();return Math.floor(o/i)}}},33839:(e,t,r)=>{const n=r(63768),i=r(14025),s=r(92493),o=r(53362),a=r(95208),l=r(15189);e.exports=class KAndSOpening extends i{static defaultWidth(){return n.unit(25,"in")}static displayName(){return"Opening"}formatWidth(){return a(this.width().toNumeric("in"),this.fractionPrecisionDenominator())}gateTypes(){return o}componentLayoutEdgeOffset(){return this.componentOf().componentLayoutEdgeOffset()}makeGate(e,t){const r=super.makeGate(e,t),n=t.railingStyleClass();return r.setRailingStyle(new n),r}defaultAnnotations(){const e=40*this.annotationDirection(),t=new s(this.edge(),e,this.unit(),{formatWithFeet:!1,fractionDenominator:this.fractionPrecisionDenominator()});return t.setLayer(l.OPENING_WIDTH_ANNOTATION),[t]}annotationDirection(){return this.structureDirection()}fractionPrecisionDenominator(){return this.postProvider().fractionPrecisionDenominator()}}},22999:(e,t,r)=>{const n=r(63768),{CompositeFigure:i}=r(7340),{Polygon:s}=r(62048),{$P:o}=r(62048),a=r(83102),l=r(92493),c=r(68033),u=r(15189);e.exports=class KAndSPDFGlassPanel extends a{constructor(e,t){super(),this._sourceGlassPanel=e,this._count=t}sourceGlassPanel(){return this._sourceGlassPanel}count(){return this._count}unit(){return this.sourceGlassPanel().unit()}fractionPrecisionDenominator(){return this.sourceGlassPanel().fractionPrecisionDenominator()}length(){return this.sourceGlassPanel().edge().length()}height(){return this.sourceGlassPanel().height().toNumeric(this.unit())}skew(){const e=this.sourceGlassPanel().slope().toNumeric("rad");return Math.sin(e)*this.height()}referencePoint(){return this._referencePoint||(this._referencePoint=o(0,0)),this._referencePoint}shape(){return this.geometry()}topEdge(){const e=this.length();return o(0,0).to(o(e,0))}bottomEdge(){const e=this.topEdge(),t=this.height(),r=this.skew();return e.movedBy(r,t)}leftHeightEdge(){const e=this.topEdge().begin(),t=e.movedBy(0,this.height());return e.to(t)}rightHeightEdge(){const e=this.skew(),t=this.topEdge().end().movedBy(e),r=t.movedBy(0,this.height());return t.to(r)}heightEdges(){return[this.leftHeightEdge(),this.rightHeightEdge()]}skewEdges(){const e=this.topEdge(),t=this.bottomEdge(),r=this.leftHeightEdge(),n=this.rightHeightEdge();return[e.end().to(n.begin()),t.begin().to(r.end())]}geometry(){const e=this.topEdge(),t=this.bottomEdge();return new s([e.begin(),e.end(),t.end(),t.begin()])}annotations(){return[this.createAnnotation(this.topEdge()),this.createAnnotation(this.leftHeightEdge(),-1),...this.skewAnnotations(),...this.holeAnnotations()]}skewAnnotations(){if(this.skew().isNearTo(0))return[];return[...this.skewEdges().map((e=>this.createAnnotation(e))),...this.heightEdges().map((e=>this.createAnnotation(e,void 0,c)))]}holeAnnotations(){const e=this.panelHoles();return 0===e.length?[]:[this._holeInsetAnnotation(e.first()),...this._holeLineAnnotations()]}_holeInsetAnnotation(e){const t=this.topEdge().direction(),r=this._holesOnBeginSide(),n=r?t.negated():t,i=r?-1:1,s=this.holeInset(),o=n.multipliedBy(s),a=e.center(),l=a.to(a.add(o));return this.createAnnotation(l,i,void 0,8)}_holeLineAnnotations(){const e=[];return this._holesOnBeginSide()&&e.push(this._holeLayoutEdge(!0)),this._holesOnEndSide()&&e.push(this._holeLayoutEdge(!1)),e.map((e=>this.createAnnotation(e,void 0,c)))}createAnnotation(e,t=1,r=l,n=20){const i=new r(e,n*t,this.unit(),{formatWithFeet:!1,fractionDenominator:this.fractionPrecisionDenominator()});return i.setLayer(u.TOP_RAIL_LENGTH_ANNOTATIONS),i}components(){return[this.geometry(),...this.panelHoles()]}panelHoles(){const e=[],t=this._holesOnBeginSide(),r=this._holesOnEndSide();t&&e.push(...this._createHoles(!0)),r&&e.push(...this._createHoles(!1));return e.reduce(((e,t)=>(e.find((e=>e.center().equals(t.center())))||e.push(t),e)),[])}_holesOnBeginSide(){return this.sourceGlassPanel().holesOnBeginSide()}_holesOnEndSide(){return this.sourceGlassPanel().holesOnEndSide()}_createHoles(e){const t=this._holeLayoutEdge(e),r=t.direction(),n=this.distanceFromHolesToBottomEdge(),i=r.multipliedBy(n),s=t.begin().add(i),o=this.distanceBetweenHoles(),a=r.multipliedBy(o),l=s.add(a),c=this.holeRadius();return[l.expandedByRadius(c),s.expandedByRadius(c)]}_holeLayoutEdge(e){const t=this.topEdge(),r=this.bottomEdge(),n=e?r.begin().to(t.begin()):r.end().to(t.end()),i=this.holeInset(),s=(e?t.direction():t.direction().negated()).multipliedBy(i);return n.movedBy(s.x(),s.y())}distanceFromHolesToBottomEdge(){return n.unit(3,"in").toNumeric(this.unit())}distanceBetweenHoles(){return n.unit(12,"in").toNumeric(this.unit())}holeRadius(){return n.unit(.625,"in").toNumeric(this.unit())}holeInset(){return this.sourceGlassPanel().holeInset().toNumeric(this.unit())}defaultFigure(){const e=i.withModel(this);return e.setProperty("fillStyle","#00000000"),e.setProperty("strokeStyle","#000000"),e.setProperty("lineWidth",.25),e}annotationPDFBoundingBox(){const e=this.boundingBox(),t=e.center(),r=e.width()/2*1.5,n=e.height()/2*1.5;return t.expandedBy(r,n)}}},19007:(e,t,r)=>{const n=r(63768),{Composite3DFigure:i}=r(37732),{NullDrawable:s}=r(7340),{$P:o}=r(62048),{MaterialSpecifier:a}=r(93613),l=r(88646),c=r(56214),u=r(30202),d=r(80371);e.exports=class KAndSPicket extends d{constructor(e,t){super(e),this._height=t}height(){return this._height}width(){return n.unit(.625,"in")}length(){return this.width()}components(){return[this.picket()]}picket(){return this._picket||(this._picket=this._defaultPicket()),this._picket}_defaultPicket(){const e=this.materialSpecifier(),t=this.locator().edge().vector().xy().normalized();return new u(this.topLocator(),this.locator(),this._crossSection(),e,t)}_crossSection(){const e=this.width().toNumeric(this.unit())/2,t=o(0,0).expandedBy(e);return new l([new c(t)])}defaultFigure(){return new s(this)}threeFigure(){return i.withModel(this)}materialSpecifier(){return new a("Picket","Picket",{materialName:"aluminum"})}}},27890:(e,t,r)=>{const n=r(63768),{FixedEdgeLocator:i}=r(62048),s=r(19007),o=r(77026);e.exports=class KAndSPicketBlock extends o{picketSpacing(){return n.unit(4.5,"in")}picketHeight(){return n.subtract(this.topRailBaseHeight(),this.bottomRailHeight())}pickets(){return this._pickets||(this._pickets=this._defaultPickets()),this._pickets}picketLayoutEdge(){const e=this.bottomRailEdge(),t=this._picketLayoutEdgeInset();return e.stretchedBy(t).relativeToEdge(this.edge())}_picketLayoutEdgeInset(){return 2*-this.picketSpacing().toNumeric(this.unit())}_defaultPickets(){const e=this.picketSpacing().toNumeric(this.unit()),t=this.bottomRailEdge(),r=t.length();if(-this._picketLayoutEdgeInset()>=r)return[this._makePicket(t,r/2)];const n=this.picketLayoutEdge(),i=Math.ceil(n.length()/e),s=n.length()/i,o=[];for(let e=0;e<=i;e++){const t=this._makePicket(n,s*e);o.push(t)}return o}_makePicket(e,t){const r=new s(new i(e,t),this.picketHeight());return r.setComponentOf(this),r}components(){return[...super.components(),...this.pickets()]}}},21388:(e,t,r)=>{const n=r(63768),i=r(13356),s=r(93050);e.exports=class KAndSPicketSection extends i{static displayName(){return"Picket Section"}absoluteMaxPostSpacing(){return n.unit(90,"in")}pricingReferenceMaterialSpecifier(){return s.Picket_Railing}glassPanelNumberAnnotations(){return[]}}},80104:(e,t,r)=>{const{RailLengthHelper:n}=r(8423);e.exports=class KAndSPostSpacingHelper extends n{constructor(e,t,r="in",{maxRailLength:n=t,beginRailOverlap:i=0,endRailOverlap:s=0}={}){super(e,t,r),this._maxRailLength=n,this._beginRailOverlap=i,this._endRailOverlap=s}maxRailLength(){return this._maxRailLength}beginRailOverlap(){return this._beginRailOverlap}endRailOverlap(){return this._endRailOverlap}maxRailLengthNumeric(){return this._toNumeric(this.maxRailLength())}spacingLengths(e){return this.railLengths(e)}symmetricRailLengths(e){const t=this._toNumeric(e),r=this.maxLengthNumeric();let n=Math.ceil(t/r),i=t/n;return this._isLongestRailValid(n,i)||(n+=1,i=t/n),Array(n).fill(i)}_isLongestRailValid(e,t){const r=this.maxRailLengthNumeric(),n=this.beginRailOverlap(),i=this.endRailOverlap(),s=1===e?n+i:0;return!(t+Math.max(n,i,s)>r)}}},98198:(e,t,r)=>{const n=r(14675),{EditableProperty:i}=r(7340),s=r(43812),o=r(80317);e.exports=class KAndSProject extends s{static fractionPrecisionDenominator(){return 16}static slopeAngleDecimalPrecision(){return 2}fractionPrecisionDenominator(){return this.constructor.fractionPrecisionDenominator()}slopeAngleDecimalPrecision(){return this.constructor.slopeAngleDecimalPrecision()}defaultDisplayProperties(){return[...super.defaultDisplayProperties(),new i(this,"Industry Pricing",{type:"boolean"})]}industryPricing(){return this._industryPricing??=!1}setIndustryPricing(e){this._industryPricing=e}toggleIndustryPricing(){this.setIndustryPricing(!this.industryPricing())}zones(){return this.componentsForRoles(o.ZONE)}resetCollectionZones(){this.railingCollections().forEach((e=>e.resetZones()))}pdfRoleExclusions(){return[o.BACKGROUND]}glassPanels(){const e=this.railingCollections(),t=e.flatMap((e=>e.sections())),r=e.flatMap((e=>e.gates()));return[...t.flatMap((e=>e.blocks())),...r.flatMap((e=>e.railBlock?.()))].map((e=>e.glassPanel?.())).filter((e=>e))}glassPanelCounts(){return this._glassPanelCounts??=this._defaultGlassPanelCounts()}_defaultGlassPanelCounts(){return this.glassPanels().reduce(((e,t)=>{const r=e.find((e=>e.referencePanel.shapeMatches(t)));return r?r.count+=1:e.push({referencePanel:t,count:1}),e}),[])}resetGlassPanelCounts(){this._glassPanelCounts=void 0,setTimeout((()=>{this.railingCollections().forEach((e=>e.resetSectionAnnotations()))}))}remove(e){super.remove(e),this.resetGlassPanelCounts()}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_glassPanelCounts"]}logo(){return"k-and-s-logo.png"}watermarkLogo(){return"k-and-s-watermark.png"}pdfDocumentClass(){return n}}},47999:(e,t,r)=>{const n=r(63768),{MissingOverride:i,extend:s}=r(50988),o=r(2198),a=r(28219),l=r(95208);class KAndSRail extends o{static width(){return n.unit(2,"in")}static depth(){return n.unit(1,"in")}width(){return this.constructor.width()}depth(){return this.constructor.depth()}materialSpecifier(){const e=this._referenceMaterialSpecifier(),t=this._railDescriptionForSpecifier(e);return e.specifierForDescription(t)}_railDescriptionForSpecifier(e){return`${e.name()} – ${this._formattedPricingLength()}${this._specifierSlopeDescription()}`}_specifierSlopeDescription(){const e=this.componentOf().slope().toNumeric("deg").rounded();if(e.isNearTo(0))return"";return` – ${e}° ${this.componentOf().isStairs()?"Stairs":"Ramp"}`}_referenceMaterialSpecifier(){throw new i(this,"_referenceMaterialSpecifier")}_formattedPricingLength(){const e=this.pricingLength().toNumeric("in"),t=this.componentOf().fractionPrecisionDenominator();return l(e,t)}}s(KAndSRail,a),e.exports=KAndSRail},63595:(e,t,r)=>{const{RailLengthHelper:n}=r(8423),i=r(30691);e.exports=class KAndSRailLengthHelper extends n{constructor(e,t,r="in",n){super(e,t,r),this._blockEdges=n}blockEdges(){return this._blockEdges}_blockBreakLocations(){const e=this.blockEdges();return[e.first().begin(),...e.map((e=>e.end()))]}railLengths(e=[]){const t=this._zonedEdges(e),r=[];return t.reduce(((e,n,i)=>{const s=n.length(),o=e+s,a=i===t.length-1,l=o>this.maxLengthNumeric();l&&r.push(e);const c=l?s:o;return a&&r.push(c),c}),0),r}_zonedEdges(e=[]){const t=this._blockBreakLocations(),r=t.length-1,n=[];return t.reduce(((t,i,s)=>{if(this.isLocatorInsideAnyZone(i,e)&&!(0===s||s===r))return t.push(i),t;return this._isRequiredLengthTooLong(n.last(),i)&&n.push(...t),n.push(i),[]}),[]),i.pointArrayToEdges(n)}_isRequiredLengthTooLong(e,t){if(!e||!t)return!1;return e.distanceTo(t)>this.maxLengthNumeric()}isLocatorInsideAnyZone(e,t){const r=t.find((t=>t.containsPoint(e)));return Boolean(r)}}},8567:(e,t,r)=>{const n=r(63768),{CompositeFigure:i}=r(7340),{Composite3DFigure:s}=r(37732),{RelativeLocator:o}=r(62048),a=r(30202),l=r(83102),c=r(7531),u=r(93050);e.exports=class KAndSRailSleeve extends l{static length(){return n.unit(6,"in")}constructor(e){super();const t=this.padding().toNumeric(this.unit());this._locator=e.addZ(-t)}locator(){return this._locator}beginLocator(){const e=this.edgeDirection(),t=this.length().toNumeric(this.unit()),r=e.negated().multipliedBy(t/2),n=this.locator().movedBy(r.x(),r.y(),r.z());return o.makeRelativeTo(n,this.locator())}endLocator(){const e=this.edgeDirection(),t=this.length().toNumeric(this.unit()),r=e.multipliedBy(t/2),n=this.locator().movedBy(r.x(),r.y(),r.z());return o.makeRelativeTo(n,this.locator())}edgeDirection(){return this.locator().edge().direction()}_railDepth(){return this.railShapeExtrusion().depth()}_railWidth(){return this.railShapeExtrusion().width()}depth(){return n.add(this._railDepth(),this._doubleSidedPadding())}width(){return n.add(this._railWidth(),this._doubleSidedPadding())}length(){return this.constructor.length()}padding(){return n.unit(.1,"in")}_doubleSidedPadding(){return n.multiply(this.padding(),2)}railSleeveExtrusion(){return this._railSleeveExtrusion||(this._railSleeveExtrusion=this._defaultRailSleeveExtrusion()),this._railSleeveExtrusion}_defaultRailSleeveExtrusion(){return new a(this.beginLocator(),this.endLocator(),this.crossSection(),this.materialSpecifier())}railShape(){return this.componentOf().railShape()}railShapeExtrusion(){return this.railShape().extrusion()}crossSection(){const e=n.add(this.railShapeExtrusion().width(),this._doubleSidedPadding()),t=n.add(this.railShapeExtrusion().depth(),this._doubleSidedPadding());return new(0,this.railShapeExtrusion().constructor)(e,t).crossSection()}cutAngle(){return this.componentOf().cutAngle()}materialSpecifier(){const e=this._referenceMaterialSpecifier(),t=`${e.name()} – ${this.cutAngle()}° Cut`;return e.specifierForDescription(t)}_referenceMaterialSpecifier(){const e=Object.keys(c).filter((e=>c[e].equals(this.railShape())));return u[`Rail_Sleeve_${e}`]}defaultFigure(){return i.withModel(this)}threeFigure(){return s.withModel(this)}components(){return[this.railSleeveExtrusion()]}}},91659:(e,t,r)=>{const n=r(63768),{EditableProperty:i,CompositeEditableProperty:s}=r(7340),{RailLengthHelper:o}=r(8423),a=r(97477),l=r(72718),c=r(28608),u=r(67022),d=r(87580),h=r(53359),p=r(68989),m=r(89081),f=r(40019),g=r(95208),y={SURFACE:c,FASCIA:u},b={CONCRETE:m,WOOD:f};e.exports=class KAndSRailingCollection extends a{static postMountStyles=y;static platformTypes=b;sectionClass(){return this.railingStyle().sectionClass?.()||h}runClass(){return l}fractionPrecisionDenominator(){return this.componentOf().fractionPrecisionDenominator()}slopeAngleDecimalPrecision(){return this.componentOf().slopeAngleDecimalPrecision()}defaultDisplayProperties(){const e=this.railingStyle().displayProperties(),t=this.postMountStyle().displayProperties(),r=s.overlappingProperties(this.sections()).filter((e=>e.options().showOnCollection));return[new i(this,"Flip Platform",{type:"action",perform:()=>this.toggleStructureSide()}),new i(this,"Platform Type",{type:"select",choices:this.platformTypeOptions()}),new i(this,"Rail Length Mode",{type:"select",choices:this.railLengthModeOptions(),label:"Layout Mode"}),new i(this,"Railing Style",{type:"segment",choices:this.railingStyleChoices()}),new i(this,"Railing Height",{type:"unit",defaultUnit:"in",ignoreIntermediateEdits:!0}),new i(this,"Stair Railing Height",{type:"unit",defaultUnit:"in",ignoreIntermediateEdits:!0}),...e,new i(this,"Post Mount Style",{type:"select",choices:this.postMountStyleOptions(),label:"Mount Style"}),...t,this.baselineHeightProperty(),...r]}railLengthModeOptions(){return[{label:"Even spacing",value:o.mode.SYMMETRIC},{label:"Max length spacing",value:o.mode.MAX_LENGTH}]}railingHeightAdjustment(){const e=this.railingStyle().actualRailDepth(),t=this.railingStyle().referenceRailDepth();return n.subtract(e,t)}actualRailingHeight(e){return n.add(e,this.railingHeightAdjustment())}railingHeight(){return this._railingHeight??=this.defaultRailingHeight()}topRailBaseHeight(e=this.railingHeight()){return n.subtract(e,this.railingStyle().referenceRailDepth())}defaultRailingHeight(){return n.unit(43,"in")}setRailingHeight(e){this._railingHeight=e,this.resetSections(),this.resetGates()}validateRailingHeight(e,t){return this._validateRailingHeight(e,t)}formatRailingHeight(){return g(this.railingHeight().toNumeric("in"),this.fractionPrecisionDenominator())}coerceRailingHeight(){const e=this.railingHeight(),t=this.minRailingHeight(),r=this.maxRailingHeight();n.smaller(e,t)?this._railingHeight=t:n.larger(e,r)&&(this._railingHeight=r)}stairRailingHeight(){return this._stairRailingHeight??=this.defaultStairRailingHeight()}defaultStairRailingHeight(){return n.unit(37,"in")}setStairRailingHeight(e){this._stairRailingHeight=e,this.resetSections()}validateStairRailingHeight(e,t){return this._validateRailingHeight(e,t)}formatStairRailingHeight(){return g(this.stairRailingHeight().toNumeric("in"),this.fractionPrecisionDenominator())}coerceStairRailingHeight(){const e=this.stairRailingHeight(),t=this.minRailingHeight(),r=this.maxRailingHeight();n.smaller(e,t)?this._stairRailingHeight=t:n.larger(e,r)&&(this._stairRailingHeight=r)}minRailingHeight(){return this.railingStyle().minRailingHeight()}maxRailingHeight(){return this.railingStyle().maxRailingHeight()}_validateRailingHeight(e,t){if(!e)return;const r=this.minRailingHeight(),i=this.maxRailingHeight(),s=g(r.toNumeric("in"),this.fractionPrecisionDenominator()),o=g(i.toNumeric("in"),this.fractionPrecisionDenominator());return n.smaller(t,r)?`Must be ${s} or more.`:n.larger(t,i)?`Must be ${o} or less.`:void 0}toggleStructureSide(){super.toggleStructureSide(),this.resetGates()}platformType(){return this._platformType||(this._platformType=this.platformTypeOptions().first()),this._platformType}setPlatformType(e){this._platformType=e,this.resetSections()}platformTypeOptions(){return this._platformTypeOptions||(this._platformTypeOptions=this._defaultPlatformTypeOptions()),this._platformTypeOptions}_defaultPlatformTypeOptions(){return[new b.CONCRETE,new b.WOOD]}railingStyle(){return this._railingStyle||(this._railingStyle=this.railingStyleChoices().first(),this.startObservingRailingStyle()),this._railingStyle}setRailingStyle(e){e?.copyPropertiesFromStyle(this.railingStyle()),this.stopObservingRailingStyle(),this._railingStyle=e,this.startObservingRailingStyle(),this.coerceRailingHeight(),this.coerceStairRailingHeight(),this.resetSections(),this.resetGates(),this.sections().forEach((e=>e.coerceMaxPostSpacing()))}startObservingRailingStyle(){this.railingStyle()?.addPropertyChangedObserver(this,this.railingStylePropertyChanged)}stopObservingRailingStyle(){this.railingStyle()?.removePropertyChangedObserver(this,this.railingStylePropertyChanged)}railingStylePropertyChanged(){this.resetSections(),this.resetGates()}railingStyleChoices(){return[p().framedGlass,p().framelessGlass,p().picket].filter((e=>e.canApplyToRailingCollection(this)))}formatBaselineHeight(){return g(this.baselineHeight().toNumeric("in"),this.fractionPrecisionDenominator())}postMountStyle(){return this._postMountStyle||(this._postMountStyle=this.postMountStyleOptions().first(),this.startObservingPostMountStyle()),this._postMountStyle}setPostMountStyle(e){this.stopObservingPostMountStyle(),this._postMountStyle=e,this.startObservingPostMountStyle(),this.resetSections(),this.resetGates()}startObservingPostMountStyle(){this.postMountStyle()?.addPropertyChangedObserver(this,this.postMountStylePropertyChanged)}stopObservingPostMountStyle(){this.postMountStyle()?.removePropertyChangedObserver(this,this.postMountStylePropertyChanged)}postMountStyleOptions(){return this._postMountStyleOptions||(this._postMountStyleOptions=this._defaultPostMountStyleOptions()),this._postMountStyleOptions}_defaultPostMountStyleOptions(){return[new y.FASCIA,new y.SURFACE]}postMountStylePropertyChanged(){this.resetSections(),this.resetGates()}reset(){super.reset(),this.resetZones()}resetGates(){this.railingRuns().forEach((e=>e.resetOpeningGates()))}resetSections(){super.resetSections(),this.resetGlassPanelCounts()}resetSectionComponents(){super.resetSectionComponents(),this.resetGlassPanelCounts()}resetGlassPanelCounts(){this.componentOf().resetGlassPanelCounts()}glassPanelCounts(){return this.componentOf().glassPanelCounts()}existingPostAtBegin(e){const t=e.postLayoutEdge().begin(),r=this.previousSectionFor(e),n=r?.endPost();if(n)return n.geometry().containsPoint(t,.01)?n:void 0}existingPostAtEnd(e){const t=e.postLayoutEdge().end(),r=this.nextSectionFor(e),n=r?.beginPost();if(n)return n.geometry().containsPoint(t,.01)?n:void 0}zones(){return this._zones??=this._defaultZones()}_defaultZones(){return this.project().zones().filter((e=>e.overlaps(this.geometry())))}resetZones(){this._zones=void 0,this.railingRuns().forEach((e=>e.resetZones()))}runAdded(e){super.runAdded(e),this.resetZones()}moveBy(e,t){const r=super.moveBy(e,t);return this.resetZones(),r}defaultFigure(){const e=super.defaultFigure();return e.setStrategy(new d(e)),e}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_zones","_postMountStyleOptions"]}postRestorationAction(){super.postRestorationAction(),this.startObservingPostMountStyle(),this.startObservingRailingStyle()}}},58773:(e,t,r)=>{const n=r(63768),{EditableProperty:i}=r(7340),{$P:s}=r(62048),o=r(70971),a=r(7491),l=r(53416),c=n.unit(15,"deg");e.exports=class KAndSRailingPlacementStrategy extends o{static STAIR_SLOPE_THRESHOLD=c;displayPropertiesExposedAfterDrawing(){return[new i(this,"Slope",{type:"unit",defaultUnit:"deg",ignoreIntermediateEdits:!0})]}clone(){const e=super.clone();return e.setSlope(this.slope()),e}slopeRiseNumeric(){if(!this.railingRun())return this._initialRiseRunNumeric();return this.slopeRunNumeric()*n.tan(this.slope())}slopeRunNumeric(){return this.railingRun()?this.railingRun().edge().xy().length():this._initialRiseRunNumeric()}_initialRiseRunNumeric(){return 24}slope(){return this._slope??=n.unit(0,"deg")}setSlope(e){this._slope=e,this.notifyPropertyChangedObservers()}validateSlope(e,t){if(!e)return;const r=n.unit(0,"deg"),i=n.unit(89,"deg");if(n.smaller(t,r)){return`Must be ${`${Math.floor(r.toNumeric("deg")).rounded()}°`} or more.`}if(n.larger(t,i)){return`Must be ${`${Math.floor(i.toNumeric("deg")).rounded()}°`} or less.`}}formatSlope(){const e=this.slopeAngleDecimalPrecision();return`${n.round(this.slope().toNumeric("deg"),e)} deg`}stepCount(){if(!this.railingRun())return 1;const e=this.slopeRunNumeric(),t=this._optimalStepRun();return n.ceil(e/t)}_optimalStepRun(){const e=this.railingRun().sections().first().maxPostSpacing().toNumeric(this.unit())*n.cos(this.slope()),t=n.unit(11,"in").toNumeric(this.unit());return e/Math.ceil(e/t)}stepRise(){return n.unit(this.slopeRiseNumeric()/this.stepCount(),this.unit())}stepRun(){return n.unit(this.slopeRunNumeric()/this.stepCount(),this.unit())}initialEdge(e,t,r){const i=this.incrementSize(r).toNumeric(t),o=i*n.cos(this.slope()),a=i*n.sin(this.slope()),l=-this.surfaceHeight().toNumeric(t),c=s(e.x(),e.y(),l),u=c.add(o,0,a);return c.to(u)}isLevel(){return this.slope().equals(n.unit(0,"deg"))}isStairs(){return n.larger(this.slope(),c)}endpointMovedTo(e,t,{constrainToValidPosition:r,constrainToLengthIncrements:i}={}){const s=super.endpointMovedTo(e,t,{constrainToValidPosition:r,constrainToLengthIncrements:i}),o=this.railingRun().edge(),a=e===o.begin()?o.end():o.begin(),l=a.distanceTo(s);let c=Math.sign(e.z()-a.z());0===c&&(c=1);const u=c*l*n.divide(this.slopeRiseNumeric(),this.slopeRunNumeric()),d=a.z()+u;return s.addZ(d)}_generateStructureRepresentation(e,t,r,n){if(this.isStairs())return this._generateSteppedStructureRepresentation(e,t,r,n);const i=this.railingRun().defaultStructureRepresentationThickness(),s=this.railingRun().defaultStructureRepresentationWidth();return new l(e,{thickness:i,width:s})}_generateSteppedStructureRepresentation(e,t,r,i){const s=(e.end().z()>e.begin().z()?e.begin().to(t.begin()):t.end().to(e.end())).endpoints().slice();-1===r&&s.reverse();const o=n.unit(this.slopeRiseNumeric(),this.unit());return new a(s,o,this.stepRise(),this.stepRun(),this.railingRun())}slopeAngleDecimalPrecision(){return this.railingRun()?.slopeAngleDecimalPrecision()||2}}},72718:(e,t,r)=>{const n=r(63768),{Angle:i}=r(62048),s=r(33496),o=r(94966),a=r(92493),l=r(58773),c=r(57963),u=r(15189);e.exports=class KAndSRailingRun extends s{static angleSignificantDecimalPlaces=1;componentLayoutEdgeOffset(){return this.sections().first().componentLayoutEdgeOffset()}zones(){return this._zones??=this._defaultZones()}_defaultZones(){return this.componentOf().zones().filter((e=>e.overlaps(this.geometry())))}postMountStyle(){return this.componentOf().postMountStyle()}railingStyle(){return this.componentOf().railingStyle()}defaultStructureRepresentationThickness(){return this.componentOf().postMountStyle().platformThickness()}defaultStructureEdgeOffset(){return n.unit(0,"in")}structureMountingEdgeOffset(){return this.hasDripEdge()&&this.dripEdgeShouldOverhang()?n.subtract(this.dripEdgeWidth(),this.dripEdgeOverhangThreshold()):n.unit(0,"in")}dripEdgeOverhangThreshold(){return this.postMountStyle().dripEdgeOverhangThreshold()}dripEdgeShouldOverhang(){if(!this.postMountStyle().hasDripEdge())return!1;const e=this.postMountStyle().dripEdgeWidth(),t=this.dripEdgeOverhangThreshold();return n.larger(e,t)}hasDripEdge(){return this.postMountStyle().hasDripEdge()}dripEdgeWidth(){return this.postMountStyle().dripEdgeWidth()}resetZones(){this._zones=void 0,this.sections().forEach((e=>e.resetZones()))}reset(){super.reset(),this.resetZones()}stopEditing(){super.stopEditing(),this.componentOf().resetZones()}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_zones"]}defaultAnnotations(){return[this._angleAnnotation(),this._platformLengthAnnotation()].filter((e=>e))}_angleAnnotation(){const e=this.previousRun();if(!e)return;const t=this.edge().xy(),r=e.edge().xy(),n=new i(t.begin(),t.end(),r.begin());if(180===n.smallestDeltaDegrees())return;const s=new o(n,36,2);return s.setLayer(u.ANGLE_ANNOTATIONS),s.setSignificantDecimalPlaces(this.constructor.angleSignificantDecimalPlaces),s}_platformLengthAnnotation(){const e=90*this.annotationDirection(),t=new a(this.edge(),e,this.unit(),{formatWithFeet:!1,fractionDenominator:this.fractionPrecisionDenominator(),color:c.PLATFORM_LENGTH_ANNOTATION});return t.setLayer(u.PLATFORM_LENGTH_ANNOTATIONS),t}annotationDirection(){return this.structureDirection()}fractionPrecisionDenominator(){return this.componentOf().fractionPrecisionDenominator()}slopeAngleDecimalPrecision(){return this.componentOf().slopeAngleDecimalPrecision()}isStairs(){return this.placementStrategy().isStairs()}isLevel(){return this.placementStrategy().isLevel()}slope(){return this.placementStrategy().slope()}placementStrategy(){return this._placementStrategy??=new l(this)}stairPostSpacing(){return this._stairPostSpacing??=[]}setStairPostSpacing(e){this._stairPostSpacing=e}}},13356:(e,t,r)=>{const n=r(63768),{EditableProperty:i,ImperialFractionLengthFormatter:s}=r(7340),{FixedEdgeLocator:o,RelativeLocator:a}=r(62048),{$P:l}=r(62048),{MissingOverride:c}=r(50988),u=r(63595),d=r(80104),h=r(30691),p=r(92493),m=r(55747),f=r(95208),g=r(16914),y=r(6256),b=r(34808),v=r(46742),_=r(10590),x=r(19201),w=r(48280),R=r(66955),k=r(9343),j=r(67603),z=r(84514),q=r(14244),$=r(97677),Z=r(15189);e.exports=class KAndSRailingSection extends _{static incrementSize(){return n.unit(.0625,"in")}static minLength(){return n.unit(16,"in")}static displayName(){return"Railing Section"}defaultDisplayProperties(){const e=this.componentOf().placementStrategyProperties();return new z(this,[new j(this,[new i(this,"Max Rail Length",{label:"Maximum Rail Length",type:"unit",defaultUnit:"in",showOnCollection:!0,ignoreIntermediateEdits:!0}),new i(this,"Max Post Spacing",{label:"Maximum Post Spacing",type:"unit",defaultUnit:"in",showOnCollection:!0,ignoreIntermediateEdits:!0}),new i(this,"Length",{label:"Section Length",type:"unit",defaultUnit:"in",restorable:!1,ignoreIntermediateEdits:!0})]),e,new j(this,[new i(this,"Flip Slope",{type:"action",perform:()=>this.flipSlope(),restorable:!1})]),new q(this,"Stair Post Spacing",{label:"Post Spacing",basePropertyLabel:"Spacing",type:"unit",defaultUnit:"in",defaultValue:this.minPostSpacing(),cannotAddMessageText:"No space for additional posts",canAddProperty:this.canAddStairPostSpacing.bind(this)})])}stairPostSpacing(){return this.componentOf().stairPostSpacing()}setStairPostSpacing(e){this.componentOf().setStairPostSpacing(e),this.resetComponents()}validateStairPostSpacing(e,t,r,i){if(!e)return;const s=this.minPostSpacing();if(n.smaller(t,s)){return`Must be ${f(s.toNumeric("in"))} or more.`}const o=i.reduce(((e,t,i)=>i===r?e:n.add(e,t)),s),a=n.unit(this.postLayoutEdge().length(),this.unit()),l=this.fractionPrecisionDenominator(),c=$(n.subtract(a,o),l);if(n.larger(t,c)){return`Must be ${f(c.toNumeric("in"))} or less.`}}canAddStairPostSpacing(e){const t=this.minPostSpacing().toNumeric(this.unit());return e.map((e=>e.toNumeric(this.unit()))).sum()+t<this.edge().length()-t}showStairPostSpacingProperty(){return this.isSurfaceStairs()}isStairs(){return this.componentOf().isStairs()}isSurfaceStairs(){return this.isStairs()&&!this.isFasciaMount()}isLevel(){return this.componentOf().isLevel()}validateLength(e,t){if(!e)return;const r=this.minLength();if(n.smaller(t,r)){return`Must be ${f(r.toNumeric("in"))} or more.`}}formatLength(){return f(this.length().toNumeric("in"),this.fractionPrecisionDenominator(),!1)}hasBeginBlockInset(){return!0}hasEndBlockInset(){return!0}canMiterRails(){return!this.isStairs()}railingStyle(){return this.postProvider().railingStyle()}startObservingRailingStyle(){}stopObservingRailingStyle(){}hasRails(){return!0}bottomRailHeight(){return this.railingStyle().bottomRailHeight()}minRailLength(){return this.minLength()}absoluteMaxRailLength(){return n.unit(235,"in")}maxRailLength(){return this._maxRailLength||(this._maxRailLength=this.defaultMaxRailLength()),this._maxRailLength}setMaxRailLength(e){this._maxRailLength=e,this.resetComponents(),this.postProvider().resetGlassPanelCounts(),this.resetAnnotations()}defaultMaxRailLength(){return n.unit(190,"in")}validateMaxRailLength(e,t){if(!e)return;const r=this.minRailLength(),i=this.absoluteMaxRailLength(),s=this.maxPostSpacing(),o=f(r.toNumeric("in"),this.fractionPrecisionDenominator()),a=f(i.toNumeric("in"),this.fractionPrecisionDenominator());return n.smaller(t,r)?`Must be ${o} or more.`:n.larger(t,i)?`Must be ${a} or less.`:n.smaller(t,s)?"Cannot be shorter than the maximum post spacing.":void 0}formatMaxRailLength(){return f(this.maxRailLength().toNumeric("in"),this.fractionPrecisionDenominator())}showMaxRailLengthProperty(){return!this.isSurfaceStairs()}absoluteMaxPostSpacing(){return n.unit(67,"in")}minPostSpacing(){return this.minRailLength()}maxPostSpacing(){return this._maxPostSpacing||(this._maxPostSpacing=this.defaultMaxPostSpacing()),this._maxPostSpacing}setMaxPostSpacing(e){this._maxPostSpacing=e,this.resetComponents(),this.postProvider().resetGlassPanelCounts(),this.resetAnnotations()}defaultMaxPostSpacing(){return n.unit(60,"in")}validateMaxPostSpacing(e,t){if(!e)return;const r=this.minPostSpacing(),i=this.absoluteMaxPostSpacing(),s=this.maxRailLength(),o=f(r.toNumeric("in"),this.fractionPrecisionDenominator()),a=f(i.toNumeric("in"),this.fractionPrecisionDenominator());return n.smaller(t,r)?`Must be ${o} or more.`:n.larger(t,i)?`Must be ${a} or less.`:n.larger(t,s)?"Cannot be longer than the maximum rail length.":void 0}formatMaxPostSpacing(){return f(this.maxPostSpacing().toNumeric("in"),this.fractionPrecisionDenominator())}showMaxPostSpacingProperty(){return!this.isSurfaceStairs()}coerceMaxPostSpacing(){const e=this.maxPostSpacing(),t=this.minPostSpacing(),r=this.absoluteMaxPostSpacing();n.smaller(e,t)?this._maxPostSpacing=t:n.larger(e,r)&&(this._maxPostSpacing=r)}postWidth(){return this._postClass().defaultWidth()}_postClass(){return this.railingStyle().postClass()}fractionPrecisionDenominator(){return this.componentOf().fractionPrecisionDenominator()}slopeAngleDecimalPrecision(){return this.componentOf().slopeAngleDecimalPrecision()}platformType(){return this.postProvider().platformType()}structureAlongNormal(){return this.postProvider().structureAlongNormal()}isFasciaMount(){return this.postMountStyle().isFasciaMount()}_createPostLocation(e,t,r,n){if(r===n&&this._alignEndPostWithConnectedEdge()){const e=this.sectionConnectedToEnd().postLayoutEdge();return new o(e,0)}return new o(e,t)}_alignEndPostWithConnectedEdge(){return this.isStairs()&&!this.isEndAtStairBottom()&&this._isRightAngleLevelToStairTransition(!1)}_isRightAngleLevelToStairTransition(e){const t=e?this.sectionConnectedToBegin():this.sectionConnectedToEnd();if(!t)return!1;const r=e?this.angleAtBegin().radiansToDegrees():this.angleAtEnd().radiansToDegrees(),n=r.isNearTo(90)||r.isNearTo(270);return this.isStairs()!==t.isStairs()&&n}postSpacingHelper(){const e=this.isStairs()?this._defaultStairPostSpacingHelper():this._defaultPostSpacingHelper();return e.setMode(this.postProvider().railLengthMode?.()),e}_defaultStairPostSpacingHelper(){return this.isFasciaMount()?this._defaultPostSpacingHelper():new w(this)}_defaultPostSpacingHelper(){const e=this.postLayoutEdge(),t=this.railLayoutEdge(),r=t.begin().distanceTo(e.begin()),n=t.end().distanceTo(e.end());return new d(this.minPostSpacing(),this.maxPostSpacing(),this.unit(),{maxRailLength:this.maxRailLength(),beginRailOverlap:r,endRailOverlap:n})}postLayoutEdgeInsetHelperClass(){return this.railingStyle().postLayoutEdgeInsetHelperClass()}_postLayoutReferenceEdge(){return this.componentLayoutEdge()}_insetForPostLocator(e){const t=this.edge(),r=e.equals(t.begin()),n=e.equals(t.end());if(!r&&!n)return l(0,0,0);const i=r?t.direction():t.direction().negated();if(this.openingConnectedTo(e)){const e=this.postWidth().toNumeric(this.unit())/2;return i.multipliedBy(e)}if(!(r?this.sectionConnectedToBegin():this.sectionConnectedToEnd()))return l(0,0,0);const s=this.cornerPostInset(r).toNumeric(this.unit());return i.multipliedBy(s)}_isInsideCorner(e){return this.structureAlongNormal()?e<180:e>180}terminalPostInset(){return this.railingStyle().terminalPostInset()}cornerPostInset(e){const t=this._cornerAngleForInset(e);return this.isFasciaMount()&&this._isRightAngleLevelToStairTransition(e)||0===t||360===t?n.unit(0,"in"):this._isInsideCorner(t)?this._insideCornerPostInset(t):this._outsideCornerPostInset(t)}_insideCornerPostInset(e){return this.postMountStyle().insideCornerPostInset(e)}_outsideCornerPostInset(e){return this.postMountStyle().outsideCornerPostInset(e)}railingHeight(){const e=this.postProvider();return this.isStairs()?e.stairRailingHeight():e.railingHeight()}makePost(e,t,r){const n=new(this._classForPost(t,r))(e);return n.setComponentOf(this),n}_classForPost(e,t){const r=0===e,n=e===t,i=r?this.sectionConnectedToBegin():this.sectionConnectedToEnd(),s=Boolean(r&&i),o=Boolean(n&&i);if(s||o)return i.isStairs()!==this.isStairs()?R:this.isParallelToSection(i)?v:b;if(r||n)return x;const a=this.postLocations().map((e=>e.xy())),l=this.railEdges().flatMap((e=>[e.xy().begin(),e.xy().end()])),c=a[e];return l.some((e=>e.equals(c)))?v:this._postClass()}_defaultRails(){return this.hasRails()?this.railEdges().map((e=>{const t=new y(e);return t.setComponentOf(this),t})):[]}topRailBaseHeight(){return this.postProvider().topRailBaseHeight(this.railingHeight())}railEdges(){const e=this.postProvider().actualRailingHeight(this.railingHeight());return h.pointArrayToEdges(this._railBreakLocations()).map((t=>t.addZ(-e.toNumeric(this.unit()))))}_railBreakLocations(){const e=this.railLayoutEdge(),t=n.unit(this.edge().length().roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES),this.unit());if(n.smaller(t,this.minRailLength()))return[];const r=new u(this.minRailLength(),this.maxRailLength(),this.unit(),this._railBreakSourceEdges());r.setMode(this.postProvider().railLengthMode?.());const i=r.railLengths(this.zones()),s=[new o(e,0)];return i.reduce(((t,r)=>{const n=t+r,i=new o(e,n);return s.push(i),n}),0),s}_railBreakSourceLocators(){const e=this.railLayoutEdge();return[e.begin(),...this.postLocations().slice(1,-1),e.end()]}_railBreakSourceEdges(){return h.pointArrayToEdges(this._railBreakSourceLocators())}railLayoutEdge(){const e=this.componentLayoutEdge().begin(),t=this.componentLayoutEdge().end(),r=this._insetForRailEndpoint(this.edge().begin()),n=this._insetForRailEndpoint(this.edge().end()),i=e.snapshot().add(r),s=t.snapshot().add(n);return i.to(s).relativeToEdge(this.edge())}_insetForRailEndpoint(e){if(this.openingConnectedTo(e))return l(0,0,0);const t=this.edge(),r=e.equals(t.begin()),n=r?t.direction():t.direction().negated(),i=r?this.sectionConnectedToBegin():this.sectionConnectedToEnd(),s=i&&this.isStairs()!==i.isStairs();if(this.isStairs()){if(!(r?this.isBeginAtStairBottom():this.isEndAtStairBottom()))return l(0,0,0);const e=this.bottomOfStairsRailExtension().toNumeric(this.unit());return n.negated().multipliedBy(e)}if(s&&!this.isStairs()){const e=this.stairTransitionRailInset(r).toNumeric(this.unit());return n.multipliedBy(e)}if(!i){const e=this.terminalRailExtension().toNumeric(this.unit());return n.multipliedBy(-e)}const o=this.cornerRailInset(r).toNumeric(this.unit());return n.multipliedBy(o)}terminalRailExtension(){return n.divide(this.postWidth(),2)}cornerRailInset(e){const t=this._cornerAngleForInset(e);return 0===t||360===t?n.unit(0,"in"):this._isInsideCorner(t)?this._insideCornerRailInset(t):this._outsideCornerRailInset(t)}bottomOfStairsRailExtension(){return n.unit(2,"in")}stairTransitionRailInset(e){const t=this._cornerAngleForInset(e),r=n.divide(this.postWidth(),-2);return this._isRightAngleLevelToStairTransition(e)?r:0===t||360===t?this._parallelLevelStairTransitionRailInset(e):this.postMountStyle().stairTransitionRailInset(t)}_parallelLevelStairTransitionRailInset(e){const t=e?this.sectionConnectedToBegin():this.sectionConnectedToEnd(),r=e?t.isEndAtStairBottom():t.isBeginAtStairBottom(),i=!this.isFasciaMount();return r||i?n.divide(this.postWidth(),-2):this.postMountStyle().basePlateOutsidePadding()}_cornerAngleForInset(e){return e?this.angleAtBegin().radiansToDegrees():this.angleAtEnd().radiansToDegrees()}_outsideCornerRailInset(e){return this.postMountStyle().outsideCornerRailInset(e)}_insideCornerRailInset(e){return this.postMountStyle().insideCornerRailInset(e)}blockClass(){return this.railingStyle().blockClass()}blockEdges(){return h.pointArrayToEdges(this._blockBreakLocations())}_blockBreakLocations(){const e=this.postLocations(),t=this.postLayoutEdge();if(t.length()<this.minLength().toNumeric(this.unit()))return e;const r=e.last();if(t.containsPoint(r))return e;const n=e.slice(0,-1),i=t.closestPointTo(r).relatedTo(this.edge().end());return n.push(i),n}beginBlock(){return this.blocks().first()}endBlock(){return this.blocks().last()}zones(){return this._zones??=this._defaultZones()}_defaultZones(){return this.componentOf().zones().filter((e=>e.overlaps(this.boundingPolygon())))}resetZones(){this._zones=void 0,this.resetComponents()}postMountStyle(){return this.postProvider().postMountStyle()}startObservingPostMountStyle(){}stopObservingPostMountStyle(){}_defaultSideEdges(){const e=g.shapeSize();return[this.edge().shiftedAlongNormalBy(e),this.edge().shiftedAlongNormalBy(-e)]}railShapeExtrusion(){return this.railingStyle().railShapeExtrusion()}railShape(){return this.railingStyle().railShape()}slope(){return this.componentOf().slope()}structureMountingEdgeOffset(){return this.componentOf().structureMountingEdgeOffset()}defaultAnnotations(){return[...this.components().flatMap((e=>e.annotations?.())).filter((e=>e)),...this.topRailLengthAnnotations(),...this.postSpacingAnnotations(),this.stairHeightAnnotation(),...this.glassPanelNumberAnnotations()].filter((e=>e))}topRailLengthAnnotations(){const e=60*this.annotationDirection();return this.rails().map((t=>{const r=new p(t.edge(),e,this.unit(),{formatWithFeet:!1,fractionDenominator:this.fractionPrecisionDenominator()});return r.setLayer(Z.TOP_RAIL_LENGTH_ANNOTATIONS),r}))}postSpacingAnnotations(){const e=this._postSpacingAnnotationLocators(),t=this.postWidth().toNumeric(this.unit())/2,r=this.slope().toNumeric("rad"),n=Math.cos(r),i=[];return e.forEach(((r,s)=>{const o=e.length-1;if(s===o)return;let a=t,l=t;0===s&&(a=this._terminalPostSpacingAnnotationInset()),s+1===o&&(l=this._terminalPostSpacingAnnotationInset());const c=a/n,u=l/n,d=e[s+1],h=r.to(d).direction(),p=r.add(h.multipliedBy(c)),m=d.subtract(h.multipliedBy(u)),f=p.to(m).relativeToEdge(this.edge());i.push(this._makePostSpacingAnnotation(f))})),i}_terminalPostSpacingAnnotationInset(){return this.postWidth().toNumeric(this.unit())/2}_postSpacingAnnotationLocators(){return this.postLocations()}_makePostSpacingAnnotation(e){const t=25*this.annotationDirection(),r=new p(e,t,this.unit(),{formatWithFeet:!1,fadeWithDistance:!0,fractionDenominator:this.fractionPrecisionDenominator()});return r.setLayer(Z.POST_SPACING_ANNOTATIONS),r}stairHeightAnnotation(){const e=new s(this.fractionPrecisionDenominator(),!1),t=super.stairHeightAnnotation(110,e);return t&&t.setLayer(Z.STAIR_HEIGHT_ANNOTATIONS),t}glassPanelNumberAnnotations(){const e=this.blocks().map((e=>e.glassPanel?.()));if(0===e.length)return[];const t=this.postProvider().glassPanelCounts(),r=[];return t.forEach(((t,n)=>{const i=e.find((e=>e.shapeMatches(t.referencePanel)));if(i){const e=i.edge(),t=e.normal(),s=e.center(),o=25*-this.annotationDirection(),l=a.makeRelativeTo(s.add(t.multipliedBy(o)),s),c=new k(`#${n+1}`,l,s);c.setLayer(Z.GLASS_PANEL_NUMBER_ANNOTATIONS),r.push(c)}})),r}selfMaterialLineItems(){const e=n.ceil(this.length().toNumeric("ft")),t=n.unit(e,"ft");return[new m(t,this.pricingMaterialSpecifier())]}pricingMaterialSpecifier(){const e=this.railingHeight().toInches(),t=f(e,this.fractionPrecisionDenominator()),r=this.pricingReferenceMaterialSpecifier(),n=`${r.name()} – ${t} tall`,i=r.specifierForDescription(n);return i.details().defaultMeasurement=this.postProvider().defaultRailingHeight(),i.details().measurement=this.railingHeight(),i}pricingReferenceMaterialSpecifier(){throw new c(this,"pricingReferenceMaterialSpecifier")}resetComponents(){super.resetComponents(),this._blocks=void 0}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_zones"]}}},48280:e=>{e.exports=class KAndSSurfaceStairPostSpacingHelper{constructor(e){this._section=e}section(){return this._section}unit(){return this.section().unit()}edge(){return this.section().postLayoutEdge()}railLengths(e){return this.spacingLengths()}spacingLengths(){const e=this.section(),t=this.edge().length(),r=e.stairPostSpacing().map((e=>e.toNumeric(this.unit()))).reverse();return[Math.max(t-r.sum(),0),...r]}setMode(){}}},6256:(e,t,r)=>{const n=r(47999),i=r(7531),s=r(44894),o=r(93050);e.exports=class KAndSTopRail extends n{railShape(){return this.componentOf().railShape()}crossSection(){return this.railShape().extrusion().crossSection()}_railDescriptionForSpecifier(e){const t=super._railDescriptionForSpecifier(e),r=this.cutAnglesForSpecifierDescription();return`${t} – ${r.first()}° Cut – ${r.last()}° Cut`}cutAnglesForSpecifierDescription(){const e=[this.beginCutAngle(),this.endCutAngle()];return this.structureAlongNormal()||e.reverse(),e}isFirstRailOfSection(){return!this.componentOf().isGate?.()&&this===this.componentOf().rails().first()}isFirstRailOfCollection(){const e=this.componentOf().sectionConnectedToBegin();return this.isFirstRailOfSection()&&!e}isLastRailOfSection(){return!this.componentOf().isGate?.()&&this===this.componentOf().rails().last()}isLastRailOfCollection(){const e=this.componentOf().sectionConnectedToEnd();return this.isLastRailOfSection()&&!e}beginCutAngle(){if(!this._canMiterRails()||!this.isFirstRailOfSection()||this.isFirstRailOfCollection())return 0;if(!this.componentOf().sectionConnectedToBegin().canMiterRails())return 0;const e=this.componentOf().angleAtBegin();return this._cutAngleFromRadians(e)}endCutAngle(){if(!this._canMiterRails()||!this.isLastRailOfSection()||this.isLastRailOfCollection())return 0;if(!this.componentOf().sectionConnectedToEnd().canMiterRails())return 0;const e=this.componentOf().angleAtEnd();return this._cutAngleFromRadians(e)}_canMiterRails(){return this.componentOf().canMiterRails()}_cutAngleFromRadians(e){const t=e.radiansToDegrees().rounded(),r=Math.abs(180-t);return s(r)}_referenceMaterialSpecifier(){const e=Object.keys(i).filter((e=>i[e].equals(this.railShape())));return o[`Rail_${e}`]}structureAlongNormal(){return this.componentOf().structureAlongNormal()}}},94966:(e,t,r)=>{const n=r(39463),i=r(22459);e.exports=class KAndSAngleAnnotation extends n{figureClass(){return i}}},92493:(e,t,r)=>{const n=r(44476),i=r(14720);e.exports=class KAndSDimensionAnnotation extends n{figureClass(){return i}}},68033:(e,t,r)=>{const n=r(44476),i=r(3300);e.exports=class KAndSImaginaryEdgeAnnotation extends n{figureClass(){return i}}},37700:(e,t,r)=>{const n=r(9343),i=r(17027);e.exports=class KAndSTextAnnotation extends n{figureClass(){return i}}},27460:(e,t,r)=>{const n=r(63768),{Composite3DFigure:i}=r(37732),{RelativeLocator:s}=r(62048),o=r(48909),a=r(6256),l=r(28608),c=r(52189),u=r(59214),d=r(92493),h=r(55747),p=r(95208),m=r(15189),f=r(93050);e.exports=class KAndSBlockGate extends u{minGateWidth(){return n.unit(25,"in")}absoluteMaxGateWidth(){return n.unit(50,"ft")}paddingNeeded(){return n.unit(3.5,"in")}hasBeginBlockInset(){return!1}hasEndBlockInset(){return!1}canMiterRails(){return!1}postProvider(){return this.componentOf().postProvider()}fractionPrecisionDenominator(){return this.postProvider().fractionPrecisionDenominator()}slopeAngleDecimalPrecision(){return this.postProvider().slopeAngleDecimalPrecision()}structureAlongNormal(){return this.postProvider().structureAlongNormal()}annotationDirection(){return this.componentOf().structureDirection()}componentLayoutEdgeOffset(){return this.componentOf().componentLayoutEdgeOffset()}blockClass(){return this.railingStyle().blockClass()}postWidth(){return this.railingStyle().postClass().defaultWidth()}railingHeight(){return this.postProvider().railingHeight()}railShape(){return this.railingStyle().railShape()}bottomRailHeight(){return this.railingStyle().bottomRailHeight()}glassThickness(){return this.railingStyle().glassThickness()}hasRails(){return!0}postMountStyle(){return new l}slope(){return n.unit(0,"deg")}railingStyle(){return this._railingStyle}setRailingStyle(e){this._railingStyle=e,this.updateRailingStyleProperties()}updateRailingStyleProperties(){const e=this.railingStyle(),t=this.postProvider().railingStyle();e.setRailShape(t.railShape())}railBlock(){return this._railBlock||(this._railBlock=this._defaultRailBlock()),this._railBlock}_defaultRailBlock(){const e=this.blockEdge(),t=new(this.blockClass())(e);return t.setComponentOf(this),t}beginBlock(){return this.railBlock()}endBlock(){return this.railBlock()}_defaultEdge(){return this.opening().edge().shiftedAlongNormalBy(this.componentLayoutEdgeOffset())}componentLayoutEdge(){const e=-this.paddingNeeded().toNumeric(this.unit());return this.edge().stretchedBy(e).relativeToEdge(this.edge())}blockEdge(){const e=-this.postWidth().toNumeric(this.unit());return this.componentLayoutEdge().stretchedBy(e).relativeToEdge(this.edge())}topRail(){return this._topRail||(this._topRail=this._defaultTopRail()),this._topRail}_defaultTopRail(){const e=new a(this.topRailEdge());return e.setComponentOf(this),e}topRailBaseHeight(){return this.postProvider().topRailBaseHeight(this.railingHeight())}topRailEdge(){const e=this.postProvider().actualRailingHeight(this.railingHeight());return this.componentLayoutEdge().addZ(-e.toNumeric(this.unit()))}framePosts(){return this._framePosts||(this._framePosts=this._defaultFramePosts()),this._framePosts}_defaultFramePosts(){const e=this.postWidth().toNumeric(this.unit())/2,t=this.componentLayoutEdge().direction(),r=t.multipliedBy(e),n=t.negated().multipliedBy(e),i=this.componentLayoutEdge().begin().add(r),o=this.componentLayoutEdge().end().add(n),a=s.makeRelativeTo(i,this.edge().begin()),l=s.makeRelativeTo(o,this.edge().end()),u=new c(a,this.postProvider());u.setComponentOf(this);const d=new c(l,this.postProvider());return d.setComponentOf(this),[u,d]}formatMeasurement(e){return p(e.toNumeric("in"),this.fractionPrecisionDenominator())}components(){return[this.railBlock(),this.topRail(),...this.framePosts()]}reset(){super.reset(),this.resetComponents(),this.updateRailingStyleProperties()}resetComponents(){this._railBlock=void 0,this._topRail=void 0,this._framePosts=void 0}materialLineItems(){return[new h(1,this.materialSpecifier())]}materialSpecifier(){const e=this._referenceMaterialSpecifier(),t=e.name(),r=[`${this.formatMeasurement(this.railingHeight())} tall`,`${this.formatMeasurement(this._topRailLength())} top rail`,`${this.formatMeasurement(this._bottomRailLength())} channel`],n=this.railBlock().glassPanel?.();n&&r.push(`${n.formattedPricingLength()} glass`);const i=`${t} – ${r.join(" – ")}`,s=e.specifierForDescription(i);return s.details().defaultMeasurement=this.postProvider().defaultRailingHeight(),s.details().measurement=this.railingHeight(),s}_referenceMaterialSpecifier(){const e=this._gateMaterialType();return f[`${e}_Gate`]}_gateMaterialType(){const e=this.railBlock().glassPanel?.();return e?"Framed_Glass":"Picket"}_topRailLength(){const e=this.topRailEdge();return n.unit(e.length(),this.unit())}_bottomRailLength(){const e=this.railBlock().bottomRailEdge();return n.unit(e.length(),this.unit())}defaultFigure(){const e=o.withModel(this);return e.setHandles([]),e}threeFigure(){return i.withModel(this)}annotations(){return[...this.components().flatMap((e=>e.annotations?.())).filter((e=>e)),this.topRailLengthAnnotation(),this.bottomRailLengthAnnotation()]}resetAnnotations(){this._topRailLengthAnnotation=void 0,this._bottomRailLengthAnnotation=void 0}topRailLengthAnnotation(){return this._topRailLengthAnnotation||(this._topRailLengthAnnotation=this._defaultTopRailLengthAnnotation()),this._topRailLengthAnnotation}_defaultTopRailLengthAnnotation(){const e=30*this.annotationDirection(),t=new d(this.topRail().edge(),e,this.unit(),{formatWithFeet:!1,fractionDenominator:this.fractionPrecisionDenominator()});return t.setLayer(m.TOP_RAIL_LENGTH_ANNOTATIONS),t}bottomRailLengthAnnotation(){return this._bottomRailLengthAnnotation||(this._bottomRailLengthAnnotation=this._defaultBottomRailLengthAnnotation()),this._bottomRailLengthAnnotation}_defaultBottomRailLengthAnnotation(){const e=15*this.annotationDirection(),t=this.railBlock().bottomRailEdge(),r=new d(t,e,this.unit(),{formatWithFeet:!1,fadeWithDistance:!0,fractionDenominator:this.fractionPrecisionDenominator()});return r.setLayer(m.POST_SPACING_ANNOTATIONS),r}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_railBlock","_topRail","_framePosts","_topRailLengthAnnotation","_bottomRailLengthAnnotation"]}}},76581:(e,t,r)=>{const n=r(63768),i=r(27460),s=r(93050);e.exports=class KAndSBlockGate180Degree extends i{paddingNeeded(){return n.unit(2,"in")}_referenceMaterialSpecifier(){const e=this._gateMaterialType();return s[`${e}_Gate_180`]}}},57895:(e,t,r)=>{const{GateType:n}=r(8423);e.exports=class KAndSRailStyleGateType extends n{constructor(e,t,r){super(e,t),this._railingStyleClass=r}railingStyleClass(){return this._railingStyleClass}}},53362:(e,t,r)=>{const{GateType:n}=r(8423),i=r(92339),s=r(44614),o=r(27460),a=r(76581),l=r(57895);e.exports={DEFAULT:new n("None",void 0),PICKET_GATE:new l("Picket Gate",o,s),PICKET_GATE_180:new l("Picket Gate 180°",a,s),FRAMED_GLASS_GATE:new l("Glass Gate",o,i),FRAMED_GLASS_GATE_180:new l("Glass Gate 180°",a,i)}},72287:(e,t,r)=>{const n=r(63768),i=r(55559);e.exports=class KAndSFramelessGlassPostLayoutEdgeInsetHelper extends i{levelCornerInset(e,t,r){const i=n.add(e.railingStyle().postInset(),e.cornerGlassInset());return n.multiply(i,-1)}terminalInset(e,t){const r=n.add(e.railingStyle().postInset(),e.terminalGlassInset());return n.multiply(r,-1)}fasciaMountParallelSlopeTopTransitionInset(e,t){const r=e.postMountStyle().baseplateWidth(),i=n.divide(r,2),s=this._insetAlongSectionSlope(e,i);return n.multiply(s,-1)}slopeTopTransitionRightAngleInset(e,t){if(!e.isFasciaMount())return super.slopeTopTransitionRightAngleInset(e,t);const r=e.isBeginAtSlopeTop()?e.edge().begin():e.edge().end(),n=this.levelCornerInset(e,t,r);return this._insetAlongSectionSlope(e,n)}slopeBottomTransitionRightAngleInset(e,t){if(!e.isFasciaMount())return super.slopeBottomTransitionRightAngleInset(e,t);const r=e.isBeginAtSlopeBottom()?e.edge().begin():e.edge().end(),n=this.levelCornerInset(e,t,r);return this._insetAlongSectionSlope(e,n)}}},55559:(e,t,r)=>{const{RailingLayoutInsetHelper:n}=r(8423),i=r(63768);e.exports=class KAndSPostLayoutEdgeInsetHelper extends n{insetFor(e,t){if(!this._isLocatorSectionEdgeEndpoint(e,t))return this.fallbackInset(e);const r=e.sectionConnectedAt(t);if(!r)return this.terminalInset(e,t);if(e.isLevel()&&r.isLevel())return this.levelInset(e,r,t);return e.isSloped()===r.isSloped()?this.slopedInset(e,r,t):this.slopeTransitionInset(e,r,t)}terminalInset(e,t){return e.openingConnectedTo(t)?this.terminalOpeningInset(e):this.terminalRunInset(e)}terminalOpeningInset(e){return i.divide(e.postWidth(),-2)}terminalRunInset(e){return i.unit(0,"in")}levelInset(e,t,r){return e.isParallelToSection(t)?this.parallelInset(e,t):this.levelCornerInset(e,t,r)}levelCornerInset(e,t,r){const n=e.edge().begin().equals(r)?e.angleAtBegin().radiansToDegrees():e.angleAtEnd().radiansToDegrees();return(e.structureAlongNormal()?n<180:n>180)?this.insideCornerInset(e,n):this.outsideCornerInset(e,n)}insideCornerInset(e,t){return i.multiply(e.postMountStyle().insideCornerPostInset(t),-1)}outsideCornerInset(e,t){return i.multiply(e.postMountStyle().outsideCornerPostInset(t),-1)}parallelSlopeTopTransitionInset(e,t){return e.isFasciaMount()?this.fasciaMountParallelSlopeTopTransitionInset(e):this.surfaceMountParallelSlopeTopTransitionInset(e)}surfaceMountParallelSlopeTopTransitionInset(e){return i.unit(0,"in")}fasciaMountParallelSlopeTopTransitionInset(e){const t=e.postMountStyle().basePlateOutsidePadding(),r=i.divide(e.postWidth(),2),n=i.add(t,r),s=this._insetAlongSectionSlope(e,n);return e.sloped()?s:i.multiply(s,-1)}_insetAlongSectionSlope(e,t){const r=e.slope().toNumeric("rad");return i.divide(t,Math.cos(r))}}},57963:e=>{e.exports={PLATFORM_LENGTH_ANNOTATION:"#408ee8"}},15189:e=>{e.exports={PLATFORM_LENGTH_ANNOTATIONS:"Platform Lengths",TOP_RAIL_LENGTH_ANNOTATIONS:"Top Rail Lengths",POST_SPACING_ANNOTATIONS:"Post Spacings",ANGLE_ANNOTATIONS:"Section Angles",CUT_ANGLE_ANNOTATIONS:"Cut Angles",STAIR_HEIGHT_ANNOTATIONS:"Heights",GLASS_PANEL_NUMBER_ANNOTATIONS:"Glass Panel Numbers"}},93050:(e,t,r)=>{const n=r(63768),{MaterialSpecifier:i}=r(93613),s=r(57418),o=n.unit(6,"in"),a="Picket_Extra_Height",l="Framed_Glass_Extra_Height",c="Frameless_Glass_Extra_Height",u="Picket_Gate_Extra_Height",d="Picket_Gate_180_Extra_Height",h="Framed_Glass_Gate_Extra_Height",p="Framed_Glass_Gate_180_Extra_Height",m=[new i(a,'Extra 6" of height for picket railing'),new i(l,'Extra 6" of height for 5mm glass railing'),new i(c,'Extra 6" of height for 12mm glass railing'),new i(u,'Extra 6" of picket gate height'),new i(d,'Extra 6" of 180° picket gate height'),new i(h,'Extra 6" of glass gate height'),new i(p,'Extra 6" of 180° glass gate height'),new s("Picket_Railing","Picket Railing",{upchargeIncrement:o,upchargeSource:a}),new s("Glass_5mm_Railing","5mm Glass Railing",{upchargeIncrement:o,upchargeSource:l}),new s("Glass_12mm_Railing","12mm Glass Railing",{upchargeIncrement:o,upchargeSource:c}),new s("Rail_RECTANGLE_2","2 x 1 Rectangle Rail",{materialName:"aluminum"}),new s("Rail_RECTANGLE_3","3 x 1.5 Rectangle Rail",{materialName:"aluminum"}),new s("Rail_CIRCLE","2.75 x 2.25 Circle Rail",{materialName:"aluminum"}),new s("Rail_OVAL","3.15 x 1.25 Oval Rail",{materialName:"aluminum"}),new s("Rail_CURVED","2.75 x 1.75 Curved Rail",{materialName:"aluminum"}),new s("Bottom_Rail","Bottom Rail",{materialName:"aluminum"}),new s("Glass_Panel","Glass Panel"),new s("Sloped_Framed_Glass_Panel","Sloped Framed Glass Panel"),new s("Sloped_Frameless_Glass_Panel","Sloped Frameless Glass Panel"),new s("Rail_Sleeve_RECTANGLE_2","2 x 1 Rectangle Rail Sleeve",{materialName:"omega-yellow"}),new s("Rail_Sleeve_RECTANGLE_3","3 x 1.5 Rectangle Rail Sleeve",{materialName:"omega-yellow"}),new s("Rail_Sleeve_CIRCLE","2.75 x 2.25 Circle Rail Sleeve",{materialName:"omega-yellow"}),new s("Rail_Sleeve_OVAL","3.15 x 1.25 Oval Rail Sleeve",{materialName:"omega-yellow"}),new s("Rail_Sleeve_CURVED","2.75 x 1.75 Curved Rail Sleeve",{materialName:"omega-yellow"}),new s("Post","Post",{materialName:"aluminum"}),new s("Frameless_Glass_Post","Frameless Glass Post",{materialName:"aluminum"}),new s("Picket_Gate","Picket Gate",{upchargeIncrement:o,upchargeSource:u}),new s("Picket_Gate_180","Picket Gate 180°",{upchargeIncrement:o,upchargeSource:d}),new s("Framed_Glass_Gate","Glass Gate",{upchargeIncrement:o,upchargeSource:h}),new s("Framed_Glass_Gate_180","Glass Gate 180°",{upchargeIncrement:o,upchargeSource:p})],f={};m.forEach((e=>{f[e.identifier()]=e})),e.exports=f},89081:(e,t,r)=>{const n=r(63768);e.exports=class KAndSConcretePlatformType{get label(){return"Concrete"}get value(){return this}anchorOffset(){return n.unit(1.5,"in")}}},40019:(e,t,r)=>{const n=r(63768);e.exports=class KAndSWoodPlatformType{get label(){return"Wood"}get value(){return this}anchorOffset(){return n.unit(1,"in")}}},67022:(e,t,r)=>{const n=r(63768),{EditableProperty:i}=r(7340),{$P:s}=r(62048),o=r(73739),a=r(80265),l=r(95208);e.exports=class KAndSPostFasciaMountStyle extends o{baseplateHeight(){return n.unit(5,"in")}sectionEdgeOffsetFromCenter(e){const t=this.baseplateThickness(),r=n.divide(e,2),i=n.add(r,t);return n.add(i,this.dripEdgeOverhangThreshold())}_componentLayoutEdgeOffsetDelta(e){return this.sectionEdgeOffsetFromCenter(e.postWidth())}cornerPostBaseplateWidth(){return n.unit(3.5,"in")}postZOffset(){const e=n.unit(.5,"in"),t=this.baseplateHeight();return n.add(this.dripEdgeHeight(),t,e)}platformThickness(){return n.add(this.dripEdgeHeight(),this.fasciaRevealHeight())}defaultDisplayProperties(){return[new i(this,"Drip Edge Height",{type:"unit",defaultUnit:"in",ignoreIntermediateEdits:!0}),new i(this,"Drip Edge Width",{type:"unit",defaultUnit:"in",label:"Drip Edge Projection",ignoreIntermediateEdits:!0}),new i(this,"Fascia Reveal Height",{type:"unit",defaultUnit:"in",ignoreIntermediateEdits:!0}),new i(this,"Has Terminal Base Plate Inset",{type:"boolean",label:"Terminal Base Plate Inset"})]}hasDripEdge(){return!0}isFasciaMount(){return!0}dripEdgeHeight(){return this._dripEdgeHeight||(this._dripEdgeHeight=n.unit(2,"in")),this._dripEdgeHeight}setDripEdgeHeight(e){this._dripEdgeHeight=e,this.notifyPropertyChangedObservers()}validateDripEdgeHeight(e,t){if(!e)return;const r=n.unit(.25,"in"),i=l(r.toNumeric("in"),this.fractionPrecisionDenominator());return n.smaller(t,r)?`Must be ${i} or more.`:void 0}formatDripEdgeHeight(){return l(this.dripEdgeHeight().toNumeric("in"),this.fractionPrecisionDenominator())}dripEdgeWidth(){return this._dripEdgeWidth||(this._dripEdgeWidth=n.unit(.5,"in")),this._dripEdgeWidth}setDripEdgeWidth(e){this._dripEdgeWidth=e,this.notifyPropertyChangedObservers()}validateDripEdgeWidth(e,t){if(!e)return;const r=n.unit(.0625,"in"),i=n.unit(1.625,"in"),s=l(r.toNumeric("in"),this.fractionPrecisionDenominator()),o=l(i.toNumeric("in"),this.fractionPrecisionDenominator());return n.smaller(t,r)?`Must be ${s} or more.`:n.larger(t,i)?`Must be ${o} or less.`:void 0}formatDripEdgeWidth(){return l(this.dripEdgeWidth().toNumeric("in"),this.fractionPrecisionDenominator())}dripEdgeOverhangThreshold(){return n.unit(.5,"in")}fasciaRevealHeight(){return this._fasciaRevealHeight||(this._fasciaRevealHeight=n.unit(6,"in")),this._fasciaRevealHeight}setFasciaRevealHeight(e){this._fasciaRevealHeight=e,this.notifyPropertyChangedObservers()}validateFasciaRevealHeight(e,t){if(!e)return;const r=n.unit(5,"in"),i=l(r.toNumeric("in"),this.fractionPrecisionDenominator());return n.smaller(t,r)?`Must be ${i} or more.`:void 0}formatFasciaRevealHeight(){return l(this.fasciaRevealHeight().toNumeric("in"),this.fractionPrecisionDenominator())}hasTerminalBasePlateInset(){return void 0===this._hasTerminalBasePlateInset&&(this._hasTerminalBasePlateInset=!0),this._hasTerminalBasePlateInset}toggleHasTerminalBasePlateInset(){this._hasTerminalBasePlateInset=!this.hasTerminalBasePlateInset(),this.notifyPropertyChangedObservers()}cornerPostInset(e){const t=a.defaultWidth(),r=this.sectionEdgeOffsetFromCenter(t);let i=(Math.abs(180-e)%360).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES);0===i&&(i=180);const s=i/2,o=Math.tan(s.degreesToRadians()),l=n.divide(r,o),c=this.insetFromMountingSurfaceCorner();return n.add(l,c)}insetFromMountingSurfaceCorner(){return n.unit(2,"in")}get label(){return"Fascia"}componentLayoutEdgeFor(e,t=!0){const r=super.componentLayoutEdgeFor(e,t),n=e.sectionConnectedToBegin(),i=e.sectionConnectedToEnd(),s=this._componentLayoutEdgeLocator(r.begin(),r,e,n),o=this._componentLayoutEdgeLocator(r.end(),r,e,i);return s.to(o)}_componentLayoutEdgeLocator(e,t,r,n){if(!n)return super._componentLayoutEdgeLocator(e,t,r,n);const i=r.unit(),o=t.direction(),a=e===t.begin(),l=this.bottomOfStairsGap().toNumeric(i);let c=s(0,0,0);return a&&n.isEndAtStairBottom()?c=o.multipliedBy(l):!a&&n?.isBeginAtStairBottom()&&(c=o.multipliedBy(-l)),e.add(c)}}},73739:(e,t,r)=>{const n=r(63768),i=r(83741),s=r(98198);e.exports=class KAndSPostMountStyle extends i{fractionPrecisionDenominator(){return s.fractionPrecisionDenominator()}structureEdgeOffsetFromCenter(e){return n.unit(0,"in")}sectionEdgeOffsetFromCenter(e){return n.unit(0,"in")}platformThickness(){return n.unit(18,"in")}basePlateStartLocatorOffset(e){const t=this.basePlateOutsidePadding(),r=n.subtract(e.baseplateWidth(),e.width()),i=n.divide(r,2);return n.subtract(i,t).toNumeric("in")}basePlateOutsidePadding(){return n.unit(.25,"in")}baseplateWidth(){return n.unit(4,"in")}cornerPostBaseplateWidth(){return this.baseplateWidth()}baseplateHeight(){return this.baseplateWidth()}baseplateThickness(){return n.unit(.25,"in")}hasDripEdge(){return!1}isFasciaMount(){return!1}cornerPostInset(e){const t=n.divide(this.baseplateWidth(),2);return n.add(t,n.unit(1,"in"))}insideCornerPostInset(e){return this.cornerPostInset(e)}outsideCornerPostInset(e){return this.cornerPostInset(e)}insideCornerRailInset(e){return this._defaultCornerRailInset(e)}outsideCornerRailInset(e){return this._defaultCornerRailInset(e)}stairTransitionRailInset(e){const t=this._defaultCornerRailInset(e),r=n.divide(this.baseplateWidth(),2);return n.add(t,r)}_defaultCornerRailInset(e){const t=this._referenceAngleFor(e);return t<=90?n.unit(3/4,"in"):t<=150?n.unit(1/32,"in"):n.unit(0,"in")}bottomOfStairsGap(){return n.unit(4,"in")}_referenceAngleFor(e){return(180-Math.min(360-e,e)).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES)}_componentLayoutEdgeLocator(e,t,r,n){const i=e===t.begin()?r.objectConnectedToBegin():r.objectConnectedToEnd(),s=r.railingStyle();if(i||r.isStairs()||s.blocksExtendPastPosts())return e;const o=e===t.begin()?1:-1,a=r.terminalPostInset().toNumeric(r.unit())*o,l=t.direction();return e.add(l.multipliedBy(a))}}},28608:(e,t,r)=>{const n=r(63768),i=r(73739),s=r(34808),o=r(80265);e.exports=class KAndSPostSurfaceMountStyle extends i{sectionEdgeOffsetFromCenter(e){return n.multiply(this.baseplateWidth(),-.5)}hasTerminalBasePlateInset(){return!1}basePlateStartLocatorOffset(e){const t=e.isStairPost?.();if(t)return super.basePlateStartLocatorOffset(e);return!(e instanceof s)||e.cornerAngle().isNearTo(90)?0:super.basePlateStartLocatorOffset(e)}insideCornerPostInset(e){return 90===this._referenceAngleFor(e)?n.unit(0,"in"):this.cornerPostInset(e)}outsideCornerPostInset(e){return 90===this._referenceAngleFor(e)?n.unit(0,"in"):this.cornerPostInset(e)}_defaultCornerRailInset(e){return 90===this._referenceAngleFor(e)?this.rightAngleCornerRailInset():super._defaultCornerRailInset(e)}rightAngleCornerRailInset(){return n.unit(1/4,"in")}stairTransitionRailInset(e){const t=n.divide(o.defaultWidth(),2);return n.multiply(t,-1)}componentLayoutEdgeFor(e,t=!0){const r=super.componentLayoutEdgeFor(e,t);if(e.isStairs())return r;const n=e.sectionConnectedToBegin(),i=e.sectionConnectedToEnd(),s=this._componentLayoutEdgeLocator(r.begin(),r,e,n),o=this._componentLayoutEdgeLocator(r.end(),r,e,i);return s.to(o)}_baseComponentLayoutEdge(e){const t=super._baseComponentLayoutEdge(e);return e.isStairs()?this._baseStairComponentLayoutEdge(e,t):t}_baseStairComponentLayoutEdge(e,t){const r=e.isEndAtStairBottom(),n=t.xy().direction(),i=r?n.negated():n,s=e.unit(),o=this._anchorOffsetForSection(e).toNumeric(s),a=i.multipliedBy(o);return t.movedBy(a.x(),a.y())}_componentLayoutEdgeLocator(e,t,r,i){if(!i)return super._componentLayoutEdgeLocator(e,t,r,i);if(t.isParallelToIn3D(i.edge()))return e;const s=r.unit(),o=n.multiply(this._anchorOffsetForSection(r),r.structureDirection()).toNumeric(s),a=this.bottomOfStairsGap().toNumeric(s),l=e===t.begin(),c=l?i.isEndAtStairBottom():i.isBeginAtStairBottom(),u=l?t.direction():t.direction().negated();if(c){const t=u.multipliedBy(a-o);return e.add(t)}const d=(l?r.angleAtBegin():r.angleAtEnd()).radiansToDegrees();if(0!==d&&360!==d)return e;const h=n.equal(r.slope(),i.slope());if(r.isStairs()!==i.isStairs()||h){const t=u.multipliedBy(o);return e.add(t)}const p=this.baseplateWidth().toNumeric(s)/2,m=t.direction().negated().multipliedBy(p);return e.add(m)}_componentLayoutEdgeOffsetDelta(e){const t=super._componentLayoutEdgeOffsetDelta(e),r=this._anchorOffsetForSection(e);return n.subtract(t,r)}_anchorOffsetForSection(e){return e.platformType().anchorOffset()}}},34808:(e,t,r)=>{const{Angle:n,RelativeLocator:i,FixedEdgeLocator:s,PolarCoordinate:o}=r(62048),a=r(27661),l=r(46742),c=r(8567),u=r(15189);e.exports=class KAndSCornerPost extends l{baseplateWidth(){return this.mountStyle().cornerPostBaseplateWidth()}_topCornerLocator(){const e=this.edge().intersectionsWithLineIn2D(this.nextSectionEdge()).first(),t=this.postProvider().actualRailingHeight(this.railingHeight());return e.addZ(-t.toNumeric(this.unit()))}_railSleeveLocator(){const e=this.edge().direction(),t=this._railSleeveLength().toNumeric(this.unit())/2,r=e.negated().multipliedBy(t),n=this._topCornerLocator().movedBy(r.x(),r.y(),r.z()),o=new s(this.edge(),this.edge().length());return i.makeRelativeTo(n,o)}nextSectionRailSleeve(){return this._nextSectionRailSleeve||(this._nextSectionRailSleeve=this._defaultNextSectionRailSleeve()),this._nextSectionRailSleeve}_defaultNextSectionRailSleeve(){if(this._canPlaceRailSleeve())return this._generateRailSleeve(this._nextSectionRailSleeveLocator())}_nextSectionRailSleeveLocator(){const e=this.nextSectionEdge().direction(),t=this._railSleeveLength().toNumeric(this.unit())/2,r=e.multipliedBy(t),n=this._topCornerLocator().movedBy(r.x(),r.y(),r.z()),o=new s(this.nextSectionEdge(),0);return i.makeRelativeTo(n,o)}_railSleeveLength(){return c.length()}cornerAngle(){const e=(this.isBeginPost()?this.previousSection().angleAtEnd():this.nextSection().angleAtBegin()).radiansToDegrees().rounded();return Math.abs(180-e)}nextSectionEdge(){return this.nextSection().componentLayoutEdge()}annotations(){return[this.cutAngleAnnotation()].filter((e=>e))}cutAngleAnnotation(){return this._cutAngleAnnotation||(this._cutAngleAnnotation=this._defaultCutAngleAnnotation()),this._cutAngleAnnotation}_defaultCutAngleAnnotation(){if(!this._canPlaceRailSleeve())return;const e=this.edge().end(),t=this.edge().begin(),r=this.nextSectionEdge().end(),i=new n(e,t,r),s=new o(1,i.bisectingTheta()).negated().multipliedBy(50),l=e.add(s),c=`${this.cutAngle()}°`,d=new a(c,l,e);return d.setLayer(u.CUT_ANGLE_ANNOTATIONS),d}_canPlaceRailSleeve(){return super._canPlaceRailSleeve()&&this.isEndPost()}_basePlateStartLocatorOffset(){return this.mountStyle().basePlateStartLocatorOffset(this)}components(){return[...super.components(),this.nextSectionRailSleeve()].filter((e=>e))}}},46122:(e,t,r)=>{const n=r(63768),{Rectangle:i}=r(62048),s=r(80265),o=r(30202),a=r(88646),l=r(56214),c=r(47999),u=r(93050);e.exports=class KAndSFramelessGlassPost extends s{static defaultWidth(){return n.unit(2.5,"in")}height(){const e=n.unit(21,"in");return n.add(e,this.heightBelowSurface())}glassPlate(){return this._glassPlate||(this._glassPlate=this._defaultGlassPlate()),this._glassPlate}_defaultGlassPlate(){const e=this.glassPanelHeightAboveGround().toNumeric(this.unit()),t=this.heightAboveSurface().toNumeric(this.unit())-e,r=this.locator().edge().vector().xy().normalized();return new o(this.topLocator(),this.topLocator().addZ(t),this._glassPlateCrossSection(),this.materialSpecifier(),r)}_glassPlateCrossSection(){const e=this.width().toNumeric(this.unit())/2,t=this.glassPlateThickness().toNumeric(this.unit()),r=this.width().toNumeric(this.unit())/2;let n=this.glassThickness().toNumeric(this.unit())+r;return this.postProvider().structureAlongNormal()||(n=-(n+t)),new a([new l(new i(n,-e,t,2*e))])}glassPlateThickness(){return n.unit(.25,"in")}glassThickness(){return this.componentOf().glassThickness()}glassPanelHeightAboveGround(){return n.subtract(this.componentOf().bottomRailHeight(),c.depth())}referenceMaterialSpecifier(){return u.Frameless_Glass_Post}components(){return[...super.components(),this.glassPlate()]}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_glassPlate"]}}},52189:(e,t,r)=>{const n=r(63768),i=r(80265),s=r(99784);e.exports=class KAndSGateFramePost extends i{railingStyle(){return this.componentOf().railingStyle()}heightBelowSurface(){const e=this.railingStyle().bottomRailHeight(),t=s.depth(),r=n.subtract(e,t);return n.multiply(r,-1)}components(){return[this.leg()]}materialSpecifier(){return super.referenceMaterialSpecifier()}}},80265:(e,t,r)=>{const n=r(63768),{RelativeLocator:i,Polygon:s,PolarCoordinate:o,ExtrudedPolygon:a}=r(62048),{CompositeFigure:l}=r(7340),{Composite3DFigure:c}=r(37732),{$P:u}=r(62048),d=r(80371),h=r(6556),p=r(30202),m=r(88646),f=r(56214),g=r(95208),y=r(93050);e.exports=class KAndSPost extends d{static defaultWidth(){return n.unit(2,"in")}descriptor(){return this.postProvider().postDescriptor()}mountStyle(){return this.componentOf().postMountStyle()}edge(){return this.componentOf().componentLayoutEdge()}planarNormal(){return this.edge().vector().xy().normalized()}halfWidthNumeric(){return this.width().toNumeric(this.unit())/2}baseplateWidth(){return this.mountStyle().baseplateWidth()}halfBaseplateWidthNumeric(){return this.baseplateWidth().toNumeric(this.unit())/2}baseplateHeight(){return this.mountStyle().baseplateHeight()}halfBaseplateHeightNumeric(){return this.baseplateHeight().toNumeric(this.unit())/2}baseplateThickness(){return this.mountStyle().baseplateThickness()}blockingLength(){if(!this.mountStyle().hasDripEdge())return n.unit(0,"in");const e=this.mountStyle().dripEdgeWidth(),t=this.minimumBlockingLength();return n.larger(t,e)?t:e}minimumBlockingLength(){return this.mountStyle().dripEdgeOverhangThreshold()}isFasciaMounted(){return this.mountStyle().isFasciaMount()}topLocator(){const e=this.heightAboveSurface().toNumeric(this.unit());return this.locator().addZ(-e)}surfaceLocator(){return this.locator()}bottomLocator(){return this._simpleBottomLocator()}height(){return n.add(this.postProvider().topRailBaseHeight(this.railingHeight()),this.heightBelowSurface())}railingHeight(){return this.componentOf().railingHeight()}railShape(){return this.componentOf().railShape()}defaultGeometry(){const e=this.bottomLocator(),t=this.componentOf().edge().direction(),r=new o(1,t.theta()+Math.PI_2),n=this.width().toNumber(this.unit())/2,a=t.multipliedBy(n),l=r.multipliedBy(n),c=[e.add(a).add(l),e.add(a.negated()).add(l),e.add(a.negated()).add(l.negated()),e.add(a).add(l.negated())].map((t=>i.makeRelativeTo(t,e)));return new s(c)}shape3D(){const e=this.height().toNumeric(this.unit());return this._shape3D||(this._shape3D=new a(this.geometry(),-e,this._extrudeVertices.bind(this),!1)),this._shape3D}materialSpecifier(){const e=this.referenceMaterialSpecifier(),t=this._postDescription();return e.specifierForDescription(t)}_postDescription(){const e=this.componentOf().fractionPrecisionDenominator(),t=[],r=g(this.height().toNumeric("in"),e);t.push(r);const n=g(this.baseplateWidth().toNumeric("in"),e),i=this._baseplateTypeDescription();if(t.push(`${n} ${i}`),this.isFasciaMounted()){const r=g(this.blockingLength().toNumeric("in"),e);t.push(`${r} blocking`)}if(!this.levelBaseplate()){const e=this.slope().toNumeric("deg").roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES);t.push(`${e}°`)}return`${this.isFasciaMounted()?"Fascia":"Surface"} ${this.materialPostName()} – ${t.join(" – ")}`}_baseplateTypeDescription(){if(0===this._basePlateStartLocatorOffset())return"baseplate";if(!this.isFasciaMounted())return"baseplate (offset)";const e=this._baseplateOffsetDirection(),t=this.edge().xy().direction();return`baseplate (${e.dot(t)>0?"left":"right"})`}materialPostName(){return this.referenceMaterialSpecifier().name()}referenceMaterialSpecifier(){return y.Post}selfMaterialLineItems(){return[new h(1,this.materialSpecifier())]}leg(){return this._leg||(this._leg=this._defaultLeg()),this._leg}_defaultLeg(){return new p(this.bottomLocator(),this.topLocator(),this._legCrossSection(),this.materialSpecifier(),this.planarNormal())}_legCrossSection(){const e=this.halfWidthNumeric();return new m([new f(u(0,0).expandedBy(e))])}baseplate(){return this._baseplate||(this._baseplate=this._defaultBaseplate()),this._baseplate}_defaultBaseplate(){return new p(this._baseplateStartLocator(),this._baseplateEndLocator(),this._baseplateCrossSection(),this.materialSpecifier(),this._baseplatePlanarNormal())}_baseplatePlanarNormal(){return this.levelBaseplate()?this.planarNormal():this.edge().vector().normalized()}_baseplateStartLocator(){const e=this.isFasciaMounted()?this._baseplateStrutEndLocator():this.bottomLocator(),t=this._baseplateOffsetDirection(),r=this._basePlateStartLocatorOffset(),n=t.multipliedBy(r),s=e.add(n);return i.makeRelativeTo(s,this.bottomLocator())}_baseplateOffsetDirection(){if(!this.isStairPost()){const e=this.edge().xy().direction();return this.isEndPost()?e.negated():e}const e=this.componentOf();let t=e;e.isStairs()||(t=this.isBeginPost()?e.sectionConnectedToBegin():e.sectionConnectedToEnd());const r=t.edge().xy().direction();return!t.isBeginAtStairBottom()?r.negated():r}_basePlateStartLocatorOffset(){return!this.isFasciaMounted()&&this.isStairPost()?this.mountStyle().basePlateStartLocatorOffset(this):0}_baseplateEndLocator(){return this.isFasciaMounted()?this._fasciaMountBaseplateEndLocator():this._surfaceMountBaseplateEndLocator()}_fasciaMountBaseplateEndLocator(){const e=this.baseplateThickness().toNumeric(this.unit()),t=this._fasciaBaseplateExtrusionDirection().multipliedBy(-e),r=this._baseplateStartLocator().add(t);return i.makeRelativeTo(r,this.bottomLocator())}_surfaceMountBaseplateEndLocator(){const e=this.baseplateThickness().toNumeric(this.unit()),t=this._baseplateStartLocator();if(this.levelBaseplate())return t.addZ(-e);const r=this.componentOf().edge(),n=r.direction().cross(r.normal()).multipliedBy(e),s=t.add(n);return i.makeRelativeTo(s,t)}_baseplateCrossSection(){const e=this.halfBaseplateWidthNumeric(),t=this.halfBaseplateHeightNumeric();return new m([new f(u(0,0).expandedBy(t,e))])}baseplateStrut(){return this._baseplateStrut||(this._baseplateStrut=this._defaultBaseplateStrut()),this._baseplateStrut}_defaultBaseplateStrut(){if(this.isFasciaMounted())return new p(this._baseplateStrutStartLocator(),this._baseplateStrutEndLocator(),this._baseplateStrutCrossSection(),this.materialSpecifier(),this.planarNormal())}_baseplateStrutStartLocator(){const e=this.halfWidthNumeric(),t=this.halfBaseplateHeightNumeric(),r=this._fasciaBaseplateExtrusionDirection().multipliedBy(e),n=this.bottomLocator().add(r).addZ(-t);return i.makeRelativeTo(n,this.bottomLocator())}_baseplateStrutEndLocator(){const e=this.mountStyle().sectionEdgeOffsetFromCenter(this.width()).toNumeric(this.unit())+this.section().structureMountingEdgeOffset().toNumeric(this.unit())-this.halfWidthNumeric(),t=this._fasciaBaseplateExtrusionDirection().multipliedBy(e),r=this._baseplateStrutStartLocator().add(t);return i.makeRelativeTo(r,this.bottomLocator())}_baseplateStrutCrossSection(){const e=this.halfWidthNumeric(),t=this.halfBaseplateHeightNumeric();return new m([new f(u(0,0).expandedBy(t,e))])}_fasciaBaseplateExtrusionDirection(){const e=this.edge().xy().normal();return this.postProvider().structureAlongNormal()?e.negated():e}levelBaseplate(){return!(!this.isFasciaMounted()&&!this.componentOf().isLevel())||this.componentOf().isStairs()}slope(){return this.componentOf().slope()}isStairPost(){const e=this.componentOf(),t=e.sectionConnectedToBegin(),r=e.sectionConnectedToEnd();return!(!this.isBeginPost()||!t?.isStairs()||t.isEndAtStairBottom())||(!(!this.isEndPost()||!r?.isStairs()||r.isBeginAtStairBottom())||this.componentOf().isStairs())}isSinglePostCorner(){return 2===this.attachedSections().length&&!this.isDoublePostCorner()}railSleeve(){}components(){return[this.leg(),this.baseplate(),this.baseplateStrut()].filter((e=>e))}defaultFigure(){return l.withModel(this)}threeFigure(){return c.withModel(this)}}},46742:(e,t,r)=>{const n=r(80265),i=r(8567),s=r(6556),o=r(44894);e.exports=class KAndSRailIntersectionLinePost extends n{railSleeve(){return this._railSleeve||(this._railSleeve=this._defaultRailSleeve()),this._railSleeve}_defaultRailSleeve(){if(this._canPlaceRailSleeve())return this._generateRailSleeve(this._railSleeveLocator())}_canPlaceRailSleeve(){return this.componentOf().hasRails()}_generateRailSleeve(e){const t=new i(e);return t.setComponentOf(this),t}_railSleeveLocator(){const e=this.postProvider().actualRailingHeight(this.railingHeight());return this.locator().addZ(-e.toNumeric(this.unit()))}cornerAngle(){return 180}cutAngle(){return o(this.cornerAngle())}components(){return[...super.components(),this.railSleeve()].filter((e=>e))}selfMaterialLineItems(){return[...super.selfMaterialLineItems(),this._railSleeveMaterialLineItem()].filter((e=>e))}_railSleeveMaterialLineItem(){if(this._canPlaceRailSleeve())return new s(1,this.railSleeve().materialSpecifier())}zLevel(){return this._canPlaceRailSleeve()?this.railSleeve().locator().z():-this.thickness()}}},66955:(e,t,r)=>{const n=r(63768),i=r(19201);e.exports=class KAndSStairTransitionPost extends i{railingHeight(){const e=this.componentOf(),t=this.locator().equals(e.beginPost().locator()),r=t?e.sectionConnectedToBegin():e.sectionConnectedToEnd(),i=t?r.endPost():r.beginPost(),s=this.locator().equals(i.locator()),o=e.railingHeight(),a=r.railingHeight();return s?n.max(o,a):o}}},19201:(e,t,r)=>{const n=r(80265);e.exports=class KAndSTerminalPost extends n{_basePlateStartLocatorOffset(){return this.mountStyle().hasTerminalBasePlateInset()?this.mountStyle().basePlateStartLocatorOffset(this):super._basePlateStartLocatorOffset()}}},62901:(e,t,r)=>{const{$P:n}=r(62048),i=r(88646),s=r(81389),o=r(76385);e.exports=class KAndSCircleRailShapeExtrusion extends s{crossSection(){const e=this.depth().toNumeric(this.unit()),t=this.width().toNumeric(this.unit())/2,r=e-t,s=Math.asin(r/t);return new i([new o(n(0,t),t,Math.PI-s,s,!1)])}}},18724:(e,t,r)=>{const{$P:n}=r(62048),i=r(88646),s=r(81389),o=r(1487),a=r(23202);e.exports=class KAndSCurvedRailShapeExtrusion extends s{crossSection(){const e=this.width().toNumeric(this.unit())/2,t=this.depth().toNumeric(this.unit()),r=t/7;return new i([new o(n(-e,t),n(-e,r)),new a(n(-e,r),n(-e/2,0),n(0,0),n(0,0)),new a(n(0,0),n(0,0),n(e/2,0),n(e,r)),new o(n(e,r),n(e,t))])}}},80377:(e,t,r)=>{const{$P:n}=r(62048),i=r(88646),s=r(81389),o=r(1487),a=r(23202);e.exports=class KAndSOvalRailShapeExtrusion extends s{crossSection(){const e=this.width().toNumeric(this.unit())/2,t=this.depth().toNumeric(this.unit()),r=t/5;return new i([new o(n(-(e-r),t),n(-(e-r),t-r)),new a(n(-(e-r),t-r),n(-e,t-1.5*r),n(-e,t/2),n(-e,t/2)),new a(n(-e,t/2),n(-e,0),n(0,0),n(0,0)),new a(n(0,0),n(0,0),n(e,0),n(e,t/2)),new a(n(e,t/2),n(e,t/2),n(e,t-1.5*r),n(e-r,t-r)),new o(n(e-r,t-r),n(e-r,t))])}}},35940:e=>{e.exports=class KAndSRailShape{constructor(e,t,r){this._name=e,this._icon=t,this._extrusion=r}get label(){return`${`${this._width().toNumeric(this._unit()).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES)} x ${this._depth().toNumeric(this._unit()).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES)}`} ${this.name()} Rail`}get value(){return this}get icon(){return this._icon}name(){return this._name}extrusion(){return this._extrusion}_width(){return this.extrusion().width()}_depth(){return this.extrusion().depth()}_unit(){return this.extrusion().unit()}equals(e){return this.label===e.label}}},81389:(e,t,r)=>{const{$P:n}=r(62048),i=r(88646),s=r(1487);e.exports=class KAndSRailShapeExtrusion{constructor(e,t){this._width=e,this._depth=t}width(){return this._width}depth(){return this._depth}unit(){return"in"}crossSection(){const e=this.width().toNumeric(this.unit())/2,t=this.depth().toNumeric(this.unit());return new i([new s(n(-e,t),n(-e,0)),new s(n(-e,0),n(e,0)),new s(n(e,0),n(e,t))])}}},7531:(e,t,r)=>{const n=r(63768),i=r(35940),s=r(81389),o=r(62901),a=r(80377),l=r(18724),c={RECTANGLE_2:new s(n.unit(2,"in"),n.unit(1,"in")),RECTANGLE_3:new s(n.unit(3,"in"),n.unit(1.5,"in")),CIRCLE:new o(n.unit(2.75,"in"),n.unit(2.25,"in")),OVAL:new a(n.unit(3.15,"in"),n.unit(1.25,"in")),CURVED:new l(n.unit(2.75,"in"),n.unit(1.75,"in"))},u=Object.freeze({RECTANGLE_2:new i("Rectangle","2-inch-rectangle-rail-shape",c.RECTANGLE_2),RECTANGLE_3:new i("Rectangle","3-inch-rectangle-rail-shape",c.RECTANGLE_3),CIRCLE:new i("Circle","circle-rail-shape",c.CIRCLE),OVAL:new i("Oval","oval-rail-shape",c.OVAL),CURVED:new i("Curved","curved-rail-shape",c.CURVED)});e.exports=u},92339:(e,t,r)=>{const n=r(63768),i=r(53359),s=r(57590),o=r(15489);e.exports=class KAndSFramedGlassRailingStyle extends s{sectionClass(){return i}glassThickness(){return n.unit(5,"mm")}blockClass(){return o}}},96706:(e,t,r)=>{const n=r(63768),{EditableProperty:i}=r(7340),s=r(27776),o=r(57590),a=r(95208),l=r(47126),c=r(46122),u=r(72287);e.exports=class KAndSFramelessGlassRailingStyle extends o{sectionClass(){return s}blockClass(){return l}postClass(){return c}postLayoutEdgeInsetHelperClass(){return u}referenceRailDepth(){return n.unit(0,"in")}bottomRailHeight(){return n.unit(3,"in")}actualRailDepth(){return n.unit(0,"in")}glassThickness(){return n.unit(12,"mm")}minRailingHeight(){return n.unit(20.5,"in")}maxRailingHeight(){return n.unit(52,"in")}defaultDisplayProperties(){return[new i(this,"Post Inset",{type:"unit",defaultUnit:"in"})]}postInset(){return this._postInset??=n.unit(12.75,"in")}setPostInset(e){this._postInset=e,this.notifyPropertyChangedObservers()}validatePostInset(e,t){if(!e)return;const r=n.unit(3,"in"),i=n.unit(14,"in"),s=a(r.toNumeric("in"),this.fractionPrecisionDenominator()),o=a(i.toNumeric("in"),this.fractionPrecisionDenominator());return n.smaller(t,r)?`Must be ${s} or more.`:n.larger(t,i)?`Must be ${o} or less.`:void 0}formatPostInset(){return a(this.postInset().toNumeric("in"),this.fractionPrecisionDenominator())}blocksExtendPastPosts(){return!0}}},44614:(e,t,r)=>{const n=r(27890),i=r(21388),s=r(57590);e.exports=class KAndSPicketRailingStyle extends s{sectionClass(){return i}blockClass(){return n}}},57590:(e,t,r)=>{const n=r(63768),{EditableProperty:i}=r(7340),s=r(13356),o=r(58684),a=r(95208),l=r(98198),c=r(77026),u=r(80265),d=r(55559),h=r(7531);e.exports=class KAndSRailingStyle extends o{sectionClass(){return s}blockClass(){return c}postClass(){return u}postLayoutEdgeInsetHelperClass(){return d}minRailingHeight(){return n.unit(6,"in")}maxRailingHeight(){return n.unit(90,"in")}bottomRailHeight(){return n.unit(4,"in")}referenceRailDepth(){return n.unit(1.75,"in")}actualRailDepth(){return this.railShapeExtrusion().depth()}defaultDisplayProperties(){return[new i(this,"Rail Shape",{type:"segment",choices:this.railShapeOptions()}),new i(this,"Terminal Post Inset",{type:"unit",defaultUnit:"in"})]}railShape(){return this._railShape||(this._railShape=this.railShapeOptions().first().value),this._railShape}setRailShape(e){this._railShape=e,this.notifyPropertyChangedObservers()}railShapeOptions(){return[h.RECTANGLE_2,h.RECTANGLE_3,h.CIRCLE,h.OVAL,h.CURVED]}railShapeExtrusion(){return this.railShape().extrusion()}fractionPrecisionDenominator(){return l.fractionPrecisionDenominator()}terminalPostInset(){return this._terminalPostInset||(this._terminalPostInset=n.unit(3,"in")),this._terminalPostInset}setTerminalPostInset(e){this._terminalPostInset=e,this.notifyPropertyChangedObservers()}validateTerminalPostInset(e,t){if(!e)return;const r=n.unit(1.5,"in"),i=n.unit(4.5,"in"),s=a(r.toNumeric("in"),this.fractionPrecisionDenominator()),o=a(i.toNumeric("in"),this.fractionPrecisionDenominator());return n.smaller(t,r)?`Must be ${s} or more.`:n.larger(t,i)?`Must be ${o} or less.`:void 0}formatTerminalPostInset(){return a(this.terminalPostInset().toNumeric("in"),this.fractionPrecisionDenominator())}blocksExtendPastPosts(){return!1}}},68989:(e,t,r)=>{const n=r(44614),i=r(92339),s=r(96706),o="framed-glass",a="frameless-glass",l="picket";e.exports=function(){return{framedGlass:new i(o,"Framed Glass","glass-rail-post-to-top"),framelessGlass:new s(a,"Frameless Glass","glass-rail-infinity"),picket:new n(l,"Picket","picket-rail")}}},22459:(e,t,r)=>{const n=r(76697);e.exports=class KAndSAngleAnnotationFigure extends n{_skipDrawing(e,t){const r=t.layerManager.layerNames(),n=this.layer(),i=r.includes(n);return super._skipDrawing(e,t)||!i}}},87580:(e,t,r)=>{const{CompositeModelStrategy:n}=r(7340);e.exports=class KAndSCompositeModelStrategy extends n{_componentFigures(){return this.model().components().map(this._componentRenderer.bind(this)).reverse().sort(this._componentSorter())}updateFigures(){const e=this.model().components();this._removeDeadFigures(e),this.figures().forEach((e=>e.updateFigures())),this._addMissingFigures(e),this.figures().sort(((t,r)=>e.indexOf(r.model())-e.indexOf(t.model()))),this.figures().sort(this._componentSorter()),this.compositeFigure().updateAnnotationFigures()}}},68179:(e,t,r)=>{const{FixedEdgeLocator:n}=r(62048),i=r(65277);e.exports=class KAndSCutAngleAnnotationFigure extends i{constructor(...e){super(...e),this._setScale(1)}_skipDrawing(e,t){const r=t.layerManager,n=r.layerNames(),i=this.layer(),s=n.includes(i);return!this.layerVisible(r)||!s}defaultProperties(){return{_pixelLineWidth:1,strokeStyle:"#111111",fillStyle:"#111111"}}_draw(e){this._setScaleFromContext(e),this._drawLabel(e),this._drawLine(e)}_drawLine(e){const t=this._textLocation().to(this.anchor()),r=new n(t,this.fontSize()),i=t.end();e._drawLine(r,i)}_drawLabel(e){const t=this.text();e._alterAndRestoreAfter((()=>{this._setFontSizeOnContext(e),this._positionText(e,t),this._drawText(e,t)}))}_drawText(e,t){e.fillText(t,0,0)}_positionText(e,t){const r=e.measureText(t),n=this._textLocation(),i=-r.width/2;e.translate(n.x()+i,n.y())}_setFontSizeOnContext(e){e.font=`${this.fontSize(e)}px ${this.fontFamily()}`}_scale(){return this._scaleValue}_setScale(e){this._scaleValue=e}_setScaleFromContext(e){this._setScale(e.runningScaleX())}_pixelsToDrawingUnits(e){return e/this._scale()}}},14720:(e,t,r)=>{const n=r(84510);e.exports=class KAndSDimensionAnnotationFigure extends n{_skipDrawing(e,t){const r=t.layerManager.layerNames(),n=this.layer(),i=r.includes(n);return super._skipDrawing(e,t)||!i}}},3300:(e,t,r)=>{const n=r(84510);e.exports=class KAndSImaginaryEdgeAnnotationFigure extends n{_draw(e,t){const r=this.annotation().edgeBegin(),n=this.annotation().edgeEnd(),i=e._pixelsToDrawingUnits(5),s=e._pixelsToDrawingUnits(3);e._drawDashedLine(r,n,[i,s])}}},17027:(e,t,r)=>{const n=r(65277);e.exports=class KAndSTextAnnotationFigure extends n{_skipDrawing(e,t){const r=t.layerManager.layerNames(),n=this.layer(),i=r.includes(n);return super._skipDrawing(e,t)||!i}}},44894:e=>{e.exports=function(e){return(90-(e-90))/2}},62423:(e,t,r)=>{const{CompositeEditableProperty:n,EditableProperty:i}=r(7340),s=r(97477),o=r(67603),a=r(63562),l=r(216),c=r(84514),u=r(25630);e.exports=class KwikclampCollection extends s{railingStyle(){return this.sections().first().railingStyle()}_defaultRailingHeight(){return this.railingStyle().railingHeight()}resetRailingHeight(){this._railingHeight=void 0}defaultDisplayProperties(){return new c(this,[new o(this,[new i(this,"Create Opposite Railing",{type:"action",perform:()=>this.createOppositeRailing()}),new n("Railing Style","segment",this.sections().map((e=>e.railingStyleProperty()))),new n("DDA Compliant","boolean",this.sections().map((e=>e.ddaCompliantProperty()))),new n("Post Mount Style","select",this.sections().map((e=>e.postMountStyleProperty()))),this.baselineHeightProperty(this.lengthFormatter().baseUnit()),new i(this,"Flip Platform",{type:"action",perform:()=>this.toggleStructureSide()})]),new u(this.sections(),"showOnCollection")])}showCreateOppositeRailingProperty(){const e=this.sections();return e.every(((t,r)=>{const n=e[r+1];return!n||t.isParallelToSection(n)}))}formatBaselineHeight(){return this.lengthFormatter().format(this.baselineHeight())}runClass(){return a}sectionClass(){return l}toggleStructureSide(){super.toggleStructureSide(),this.openings().forEach((e=>{e.resetGate()}))}}},9526:(e,t,r)=>{const n=r(65898),i=r(83071),s=r(53878),o=r(31651),a=r(82437);e.exports=class KwikclampEndWallConnection extends a{static _defaultTopRailSleeveDescriptorMap(){return new n([new i(o.terminal,"kwikclamp-139_d48")])}static _defaultLowerRailSleeveDescriptorMap(){return new n([new i(o.terminal,"kwikclamp-139_d48")])}leg(){}baseplate(){}kickplateMountingBracket(){}_kickplateBoltCount(){return 0}hasJTerminator(){return!1}topRailSleeveHelper(){const e=this.section().topRailEdge();return new s(this,this.topRailSleeveDescriptorMap(),this.isBeginPost()?e.begin():e.end())}}},32805:(e,t,r)=>{const n=r(63768),{Polygon:i,$P:s}=r(62048),o=r(30202),a=r(88646),l=r(86755),c=r(6556);e.exports=class KwikclampKickplate extends o{static defaultHeight(){return n.unit(10,"mm")}static cornerBracketLength(){return n.unit(250,"mm")}height(){return this.constructor.defaultHeight()}cornerBracketLength(){return this.constructor.cornerBracketLength()}materialSpecifier(){return this.materials.kickplate}section(){return this.componentOf()}miterDirectionFor(e){const t=this.section(),r=t.sectionConnectedAt(e);if(!r)return;if(r.sloped()||t.sloped()||!r.includeKickplate())return;return r.edge().direction().add(t.edge().direction()).normalized()}beginMiterDirection(){return this.miterDirectionFor(this.section().edge().begin())??super.beginMiterDirection()}endMiterDirection(){return this.miterDirectionFor(this.section().edge().end())??super.endMiterDirection()}_defaultCrossSection(){const e=this.materialSpecifier().details().width.toNumeric(this.unit())/2,t=this.materialSpecifier().details().depth.toNumeric(this.unit()),r=this.materialSpecifier().details().thickness.toNumeric(this.unit()),o=n.unit(19,"mm").toNumeric(this.unit()),c=n.unit(43,"mm").toNumeric(this.unit()),u=n.unit(67,"mm").toNumeric(this.unit()),d=n.unit(10,"mm").toNumeric(this.unit()),h=this.section().structureDirection();return new a([new l(new i([s(h*e,2*e-t),s(h*-e,-t),s(h*-e,-t+o),s(h*(e-r),-t+o),s(h*(e-r),-t+o+d),s(h*-e,-t+o+d),s(h*-e,-t+c),s(h*(e-r),-t+c),s(h*(e-r),-t+c+d),s(h*-e,-t+c+d),s(h*-e,-t+u),s(h*(e-r),-t+u),s(h*(e-r),-t+u+d),s(h*-e,-t+u+d),s(h*-e,0),s(h*e,0)]))])}selfMaterialLineItems(){const e=n.unit(this.edge().length(),this.unit()).toNumeric("mm").rounded(),t=n.unit(e,"mm"),r=[this.section().sectionConnectedToBegin(),this.section().sectionConnectedToEnd()].filter((e=>this._kickplateCornerBracketAt(e))).length,i=this.cornerBracketLength(),s=n.multiply(i,r),o=n.subtract(t,s);return[new c(o,this.materials.kickplate),this._kickplateCornerBracketMaterial(),this._rampTransitionBracketMaterial(),new c(this._kickplateEndCapCount(),this.materials.kickplateEndCap)].filter(Boolean)}_kickplateCornerBracketMaterial(){const e=this.section().sectionConnectedToEnd();if(!this._kickplateCornerBracketAt(e))return;const t=this.edge().theta(),r=90===((e.edge().theta()-t)*this.section().structureDirection()).normalizedAngle().radiansToDegrees().rounded()?this.materials.kickplateInsideCorner:this.materials.kickplateOutsideCorner;return new c(1,r)}_kickplateCornerBracketAt(e){const t=this.section();return e&&e.includeKickplate()&&t.isPerpendicularToSection(e)&&!t.sloped()&&!e.sloped()}_kickplateEndCapCount(){return[this.section().sectionConnectedToBegin(),this.section().sectionConnectedToEnd()].filter((e=>!e||!e.includeKickplate())).length}_rampTransitionBracketMaterial(){const e=this.section().sectionConnectedToEnd();if(this._rampTransitionBracketAt(e))return new c(1,this.materials.kickplateRampTransition)}_rampTransitionBracketAt(e){const t=this.section();return!!t.ddaCompliant()&&(!t.isParallelToSectionIn3D(e)&&(e&&e.includeKickplate()&&t.isParallelToSection(e)))}}},90675:(e,t,r)=>{const n=r(63768),i=r(14025),s=r(18026);e.exports=class KwikclampOpening extends i{static defaultWidth(){return n.unit(1e3,"mm")}static minimumWidth(){return n.unit(500,"mm")}gateTypes(){return s}}},82417:(e,t,r)=>{const n=r(52494);e.exports=class KwikclampPlacementStrategy extends n{showSlopeProperty(){return!0}showHypotenuseProperty(){return!0}}},52320:(e,t,r)=>{const n=r(21856),i=r(54400),s=r(42947),o=r(64840);e.exports=class KwikclampPricingStrategy extends i{allLineItems(e){return[...super.allLineItems(e),this._taxLineItem(e)]}_taxLineItem(e){return n.builder(o.Tax,{subtotal:this.subtotal(e)}).propertiesCollection({[s.quantity]:e.taxRatioProperty()}).build()}}},54474:(e,t,r)=>{const n=r(43489),i=r(63768),{EditableProperty:s}=r(7340),o=r(8519),a=r(55093),l=r(43812),c=r(64840);e.exports=class KwikclampProject extends l{get materials(){return c}logo(){return"kwikclamp-logo.png"}watermarkLogo(){return"kwikclamp-watermark.png"}watermarkAlpha(){return.075}_materialLineItemProcessors(){return[new a("mm"),new o]}taxRatio(){return this._taxRatio??=i.unit(10,"percent")}setTaxRatio(e){this._taxRatio=e}taxRatioProperty(){return this._taxRatioProperty??=new s(this,"Tax Ratio",{type:"unit",defaultUnit:"percent",label:"Tax",ignoreIntermediateEdits:!0})}pdfDocumentClass(){return n}uniquePostFittingCombinations(){return this.railingCollections().flatMap((e=>e.sections())).flatMap((e=>e.railingPosts())).reduce(((e,t)=>{const r=t.fittingCombination();return e.includes(r)||e.push(r),e}),[])}fittingCombinationNumberForPost(e){const t=this.uniquePostFittingCombinations(),r=e.fittingCombination();return t.findIndex((e=>e===r))+1}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_taxRatioProperty"]}}},216:(e,t,r)=>{const n=r(63768),{EditableProperty:i}=r(7340),{Polygon:s}=r(62048),{RailLengthHelper:o}=r(8423),a=r(10590),l=r(9217),c=r(93961),u=r(82437),d=r(15166),h=r(81056),p=r(79191),m=r(17326),f=r(89105),g=r(77642),y=r(39971),b=r(30691),v=r(20120),_=r(32805),x=r(34142),w=r(5090),R=r(9526),k=r(7940),j=r(35337),z=r(46748),q=r(36761),$="begin",Z="end";e.exports=class KwikclampRailingSection extends a{static postMountStyleClasses(){return[l,c,k]}static doublePostInsetLength(){return n.multiply(_.cornerBracketLength(),-1)}static incrementSize(){return n.unit(1,"mm")}static minLength(){return n.unit(.1,"m")}static maxLength(){return n.unit(1,"km")}static railingStyleClasses(){return[h,p,m,f,g,y]}static terminalKeys={begin:$,end:Z};_defaultRailingStyle(){return this.railingStyleChoices().find((e=>"KwikclampStandardRailingStyle"===e.constructor.name))}_selfDisplayProperties(){return[new i(this,"Include Kickplate",{type:"boolean",showOnCollection:!0}),...this.slopedDisplayProperties(),new i(this,"Create Opposite Railing",{type:"action",perform:()=>this.createOppositeRailing()}),this.maxRailLengthProperty(),new i(this,"Terminate At Wall",{type:"locator-boolean-map",label:"Terminate at Wall",geometry:this._edgePolygon()}),new i(this,"J End Termination",{type:"locator-boolean-map",geometry:this._edgePolygon()}),new i(this,"D End Termination",{type:"locator-boolean-map",geometry:this._edgePolygon()})]}slopedDisplayProperties(){return[new i(this,"Flip Slope",{type:"action",perform:()=>this.flipSlope()})]}ddaCompliantProperty(){return new i(this,"Dda Compliant",{label:"DDA Compliant",type:"boolean",showOnCollection:!0})}showDdaCompliantProperty(){return!this.forceDDA()}showPostMountStyleProperty(){return!this.forceDDA()}forceDDA(){return this.railingStyle().forceDDA?.()}ddaCompliant(){return!!this.forceDDA()||(this._ddaCompliant??=!1)}toggleDdaCompliant(){this.setDdaCompliant(!this.ddaCompliant())}setDdaCompliant(e){this._ddaCompliant=e,this.resetConnectedComponents()}useLongTopRail(){return this.ddaCompliant()}topRailEdge(){return this.useLongTopRail()?this.rails().first().edge():this.railLayoutEdge()}showIncludeKickplateProperty(){return!this.isStairs()}showTerminateAtWallProperty(){return this.railingStyle().supportsWallTermination(this)}showJEndTerminationProperty(){return this.railingStyle().supportsJEndTermination(this)}showDEndTerminationProperty(){return this.railingStyle().supportsDEndTermination(this)}restorableProperties(){return[...super.restorableProperties(),this.ddaCompliantProperty(),this.postMountStyleProperty(),this.railingStyleProperty(),this.maxRailLengthProperty()]}_edgePolygon(){return new s([this.edge().begin(),this.edge().end()])}_endPointForKey(e){return e===$?this.edge().begin():this.edge().end()}_endMapNames(){return["terminateAtWall","jEndTermination","dEndTermination"]}terminateAtWall(){return this._getMap("terminateAtWall")}setTerminateAtWall(e,t){this._setMapping("terminateAtWall",e,t)}jEndTermination(){return this._getMap("jEndTermination")}setJEndTermination(e,t){this._setMapping("jEndTermination",e,t)}dEndTermination(){return this._getMap("dEndTermination")}setDEndTermination(e,t){this._setMapping("dEndTermination",e,t)}_getMap(e){const t=this._variableName(e);return this[t]??=new w([$,Z].map((e=>[e,!1]))),this._cleanMapValues(this[t]),this[t]}_variableName(e){return`_${e}`}_cleanMapValues(e){e.keys().forEach((t=>{const r=this._endPointForKey(t),n=e.get(t);e.set(t,n&&this._endpointIsNotConnected(r))}))}_unsetComplements(e,t){this._endMapNames().filter((t=>t!==e)).forEach((e=>{this[e]().set(t,!1)}))}_setMapping(e,t,r){if(t instanceof w){return void(this[this._variableName(e)]=t.clone())}this[e]().set(t,r),r&&this._unsetComplements(e,t),this.resetComponents()}_endpointIsNotConnected(e){return!(e===this.edge().begin()?this.objectConnectedToBegin():this.objectConnectedToEnd())}maxRailLengthProperty(){const e=this.lengthFormatter().baseUnit();return new i(this,"Max Rail Length",{type:"unit",defaultUnit:e,label:"Max Post Spacing",showOnCollection:!0,ignoreIntermediateEdits:!0})}lengthFormatter(){return this.placementStrategy().lengthFormatter()}blockClass(){return this.railingStyle().blockClass()}_classForPost(e,t){return[0,t].includes(e)?this._terminalPostClass(e,t):this.primaryPostClass()}_defaultPrimaryPostClass(){return this.ddaCompliant()?d:u}primaryPostClass(){return this.railingStyle().primaryPostClass?.()??this._defaultPrimaryPostClass()}_keyForTerminalPost(e){return e.isBeginPost()?$:Z}requiresJEndTerminationForPost(e){if(!e.isTerminalPost())return!1;const t=this._keyForTerminalPost(e);return this.jEndTermination().get(t)}requiresDEndTerminationForPost(e){if(!e.isTerminalPost())return!1;const t=this._keyForTerminalPost(e);return this.dEndTermination().get(t)}_terminalPostClass(e){const t=0===e?$:Z;return this.terminateAtWall().get(t)?R:this.ddaCompliant()?this.railingStyle().ddaEndPostClass():this.railingStyle().endPostClass(this)}_defaultRails(){return this.ddaCompliant()?[new x(this)]:[]}maxRailLength(){return this._maxRailLength??=this._defaultMaxRailLength()}_defaultMaxRailLength(){return this._idealMaxRailLength()}_idealMaxRailLength(){return this.railingStyle().defaultRailLength()}formatMaxRailLength(){return this.lengthFormatter().format(this.maxRailLength())}validateMaxRailLength(e,t){if(!e)return;const r=this.maxCertifiedPostSpacing();if(n.larger(t,r))return`Cannot exceed the maximum certified distance (${r.toString()})`;const i=this.minLength();return n.smaller(t,i)?`Cannot be less than the minimum section length (${i.toString()})`:void 0}setMaxRailLength(e){this._maxRailLength=e,this.resetComponents()}setRailingStyle(e){super.setRailingStyle(e),this.setMaxRailLength(e.defaultRailLength()),this.postProvider().resetRailingHeight()}postSpacingMode(){return this.railingStyle().postSpacingMode()}postWidth(){return u.defaultWidth()}maxCertifiedPostSpacing(){return this.railingStyle().maxRailLength()}maxPostSpacing(){return this._maxPostSpacingForSectionLength(this.maxRailLength())}stairMaxPostSpacing(){return this._maxPostSpacingForSectionLength(super.stairMaxPostSpacing())}_maxPostSpacingForSectionLength(e){const t=this.maxCertifiedPostSpacing();if(t<e)return t;const r=this._idealMaxRailLength();if(e<=r)return e;const i=n.divide(this.length(),r)%1;return i.isNearTo(0)||i.isNearTo(1)?r:e}_defaultSlopedPostSpacingHelper(){return this._defaultPostSpacingHelper()}_railLengthHelperSystemParametersConfig(){return o.defaultSystemParametersConfig.METRIC}shouldHavePostAtBegin(){if(this.shouldHaveCornerBlockAtBegin())return!0;const e=this.sectionConnectedToBegin();if(e&&e.includeKickplate()&&!this.includeKickplate())return!1;if(!e?.includeKickplate()&&this.includeKickplate())return!0;const t=this.postProvider()?.existingPostAtBegin(this);return!t}shouldHavePostAtEnd(){if(this.shouldHaveCornerBlockAtEnd())return!0;const e=this.sectionConnectedToEnd();return!e||!(e.includeKickplate()&&!this.includeKickplate())}adjustedEdgeForRailCornerAtBegin(e,t=this.defaultInsetForRailCornerEdge(),r=!1){if(!this.shouldHaveCornerBlockAtBegin()&&!r)return e.snapshot();const n=t.toNumeric(this.unit());return b.stretchedEdgeBy(e,-n,0)}adjustedEdgeForRailCornerAtEnd(e,t=this.defaultInsetForRailCornerEdge(),r=!1){if(!this.shouldHaveCornerBlockAtEnd()&&!r)return e.snapshot();const n=t.toNumeric(this.unit());return b.stretchedEdgeBy(e,0,-n)}defaultInsetForRailCornerEdge(){return this.railingStyle().cornerRailInset()}doublePostInsetLength(){return this.constructor.doublePostInsetLength()}lowerRailHeights(){return this.railingStyle().lowerRailHeights()}postLayoutEdgeInsetHelperClass(){return this.railingStyle().postLayoutEdgeInsetHelperClass()}includeKickplate(){return!this.isStairs()&&(this._includeKickplate??=!1)}toggleIncludeKickplate(){this.setIncludeKickplate(!this.includeKickplate())}setIncludeKickplate(e){this._includeKickplate=e,this.resetConnectedComponents()}kickplate(){if(this.includeKickplate())return this._kickplate??=this._defaultKickplate()}_defaultKickplate(){const e=this._classForKickplate(),t=this.kickplateLayoutEdge(),r=new e(t.begin(),t.end());return r.setComponentOf(this),r}_classForKickplate(){return _}kickplateLayoutEdge(){if(!this.includeKickplate())return;const e=this.sectionConnectedToBegin()?.kickplateLayoutLine(),t=this.sectionConnectedToEnd()?.kickplateLayoutLine(),r=this._kickplateIntersectionHelper().edge(e,t).relativeToEdge(this.edge()),n=this._kickplateInsetFor(this.edge().begin()),i=this._kickplateInsetFor(this.edge().end());return b.stretchedEdgeBy(r,-n,-i).relativeToEdge(this.edge())}kickplateLayoutLine(){if(!this.includeKickplate())return;return this._kickplateIntersectionHelper().line()}kickplateLayoutOffset(){const e=this.materials.kickplate.details().width,t=n.unit(41,"mm");return z`-(${this.structureDirection()} * (${t} + ${e} / 2))`}_kickplateIntersectionHelper(){const e=this.componentLayoutEdge().addZ(-_.defaultHeight().toNumeric(this.unit()));return new j(e,this.kickplateLayoutOffset().toNumeric(this.unit()))}_kickplateInsetFor(e){if(this.isFasciaMount()||this.sloped())return 0;const t=n.unit(-55,"mm").toNumeric(this.unit()),r=this.sectionConnectedAt(e);return r&&r.includeKickplate()?0:t}cornerBlocks(){return this._cornerBlocks??=this._defaultCornerBlocks()}_defaultCornerBlocks(){if(!this.shouldHaveCornerBlockAtEnd())return[];const e=new v(this.edge().end());return e.setComponentOf(this),[e]}shouldHaveCornerBlockAtBegin(){return Boolean(this.sectionConnectedToBegin()?.shouldHaveCornerBlockAtEnd())}shouldHaveCornerBlockAtEnd(){const e=this.sectionConnectedToEnd();return Boolean(e)&&!this.isParallelToSection(e)&&(this.ddaCompliant()||this.isFasciaMount()||this.includeKickplate()&&e.includeKickplate()&&!(this.isStairs()||e.isStairs()))}resetComponents(){super.resetComponents(),this._kickplate=void 0,this._cornerBlocks=void 0}beginRailMiterDirection(){if(!this.railingStyle().miterRailsAtKickplateCorner())return;const e=this.sectionConnectedToBegin();return e&&this.includeKickplate()&&e.includeKickplate()&&!this.isParallelToSection(e)?e.edge().direction().add(this.edge().direction()).normalized():void 0}endRailMiterDirection(){if(!this.railingStyle().miterRailsAtKickplateCorner())return;const e=this.sectionConnectedToEnd();return e&&this.includeKickplate()&&e.includeKickplate()&&!this.isParallelToSection(e)?e.edge().direction().add(this.edge().direction()).normalized():void 0}isFasciaMount(){return this.postMountStyle().isFasciaMount()}railHeightAboveTopOfPost(){const e=this.railingPosts().find((e=>{const t=e.topFittingMaterialSpecifier()?.details()??{};return Boolean(t.heightAboveTopOfPost)})),t=e?e.topFittingMaterialSpecifier().details().heightAboveTopOfPost:n.unit(0,"mm"),r=this.ddaCompliant()?x.defaultRadius():n.unit(0,"mm");return n.add(t,r)}components(){return[...super.components(),this.kickplate(),...this.cornerBlocks()].filter(Boolean)}defaultAnnotations(){return[...super.defaultAnnotations(),...this.railingPosts().map((e=>e.fittingsAnnotation()))]}sectionLengthAnnotationLayer(){return q.SECTION_LENGTH_ANNOTATIONS}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_kickplate","_cornerBlocks"]}}},63562:(e,t,r)=>{const n=r(33496),i=r(82417);e.exports=class KwikclampRun extends n{_defaultPlacementStrategy(){return new i(this)}}},85976:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),{extend:s}=r(50988),o=r(81304),a=r(88646),l=r(20901),c=r(99343),u=r(6556);class KwikclampBarrierBlock extends o{infillRadius(){return n.unit(6,"mm")}infillSpacing(){return n.unit(100,"mm")}infillSpecifier(){return this.materials.picket}infillCrossSection(){const e=this.infillRadius().toNumeric(this.unit());return new a([new l(i(0,0).expandedByRadius(e))])}selfMaterialLineItems(){return[new u(1,this.materials.barrierPanel)]}componentsMaterialLineItems(){return[]}}s(KwikclampBarrierBlock,c),e.exports=KwikclampBarrierBlock},64489:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),{extend:s}=r(50988),o=r(20901),a=r(88646),l=r(81304),c=r(6556),u=r(99343);class KwikclampBikewayBlock extends l{infillTopHeight(){return this.railingStyle().midRailHeight()}infillRadius(){return n.unit(6,"mm")}infillSpacing(){return n.unit(100,"mm")}infillCrossSection(){const e=this.infillRadius().toNumeric(this.unit());return new a([new o(i(0,0).expandedByRadius(e))])}componentsMaterialLineItems(){return[...this.topRail()?.materialLineItems()??[],new c(1,this.materials.barrierPanel)]}}s(KwikclampBikewayBlock,u),e.exports=KwikclampBikewayBlock},20120:(e,t,r)=>{const n=r(63768),{CompositeFigure:i}=r(7340),{Composite3DFigure:s}=r(37732),{Polygon:o}=r(62048),a=r(83102),l=r(24212),c=r(79041),u=r(6556),d=r(83071),h=r(31651),p=r(67065);e.exports=class KwikclampCornerBlock extends a{constructor(e){super(),this._locator=e}locator(){return this._locator}section(){return this.componentOf()}adjustedEdgeForRailCornerAtBegin(e,t){return this.section().adjustedEdgeForRailCornerAtBegin(e,t,!0)}adjustedEdgeForRailCornerAtEnd(e,t){return this.section().adjustedEdgeForRailCornerAtEnd(e,t,!0)}structureDirection(){return this.section().structureDirection()}postProvider(){return this.section().postProvider()}railingStyle(){return this.section().railingStyle()}useLongTopRail(){return this.section().useLongTopRail()}postMountStyle(){return this.section().postMountStyle()}blockClass(){return this.section().blockClass()}postAtLocator(e){return this.section().postAtLocator(e)}slope(){return this.section().slope()}railingHeight(){return this.section().railingHeight()}endRailMiterDirection(){return this.previousSection().endRailMiterDirection()}beginRailMiterDirection(){return this.nextSection().beginRailMiterDirection()}beginBlock(){return this.blocks().last()}endBlock(){return this.blocks().first()}previousSection(){return this.section()}nextSection(){return this.previousSection().sectionConnectedToEnd()}_postBefore(){return this.previousSection().endPost()}_postAfter(){return this.nextSection().beginPost()}blocks(){return this._blocks??=this._defaultBlocks()}_defaultBlocks(){const e=this.blockClass();return this.blockEdges().map((t=>{const r=new e(t);return r.setComponentOf(this),r}))}geometry(){return new o(this.blockEdges().flatMap((e=>e.endpoints())))}blockEdges(){const e=this._postBefore().locator(),t=this._postAfter().locator(),r=e.to(e.add(this.previousSection().edge().direction())),n=t.to(t.add(this.nextSection().edge().direction())),i=n.intersectionsWithLineIn2D(r).first(),s=i.to(i.addZ(1)),o=r.intersectionsWithLine(s).first(),a=n.intersectionsWithLine(s).first();return[e.to(o),a.to(t)].map((e=>e.relativeTo(this.locator())))}railSleeves(){return this._railSleeves??=this._defaultRailSleeves()}_defaultRailSleeves(){if(this.railingStyle().miterRailsAtKickplateCorner())return[];const e=this.blockEdges(),t={previous:e.first().direction(),next:e.last().direction()};t.previousNegated=t.previous.negated(),t.toRailCenterIntersection=t.previousNegated.add(t.next);const r=[this._topRailSleeveLocator()],n=this.intersectionLocator();return this.railingStyle().lowerRailHeights().forEach((e=>{const t=e.toNumeric(this.unit());r.push(n.addZ(-t))})),r.map((e=>{let r;return r=this.rightAngleCorner()?new c(e,t.previous,t.next,this._rightAngleSleeveDescriptor()):new l(e,t.previous,t.next,this._adjustableSleeveDescriptor()),r.setComponentOf(this),r}))}_adjustableSleeveDescriptor(){return new d(h.adjustable,"kwikclamp-764_d48")}_topRailSleeveLocator(){const e=this.topRailHeight().toNumeric(this.unit());return this.intersectionLocator().addZ(-e)}topRailHeight(){const e=this.section().railingHeight(),t=this.section().railHeightAboveTopOfPost();return n.add(e,t)}_rightAngleSleeveDescriptor(){return new d(90,"kwikclamp-725_d48",{isRightCorner:!0})}intersectionLocator(){const e=this.section().edge().direction();return this.blockEdges().find((t=>t.direction().equals(e))).end()}materialLineItems(){const e=this._materialLineItemsWithoutScrews();return[...e,...p.screwLineItems(e)]}_materialLineItemsWithoutScrews(){return this.railingStyle().miterRailsAtKickplateCorner()?this.rightAngleCorner()?this.previousSection().sloped()||this.nextSection().sloped()?[]:[new u(1,this.materials.barrierPanelCorner)]:[]:[...super.materialLineItems(),...this._railSleeveMaterialLineItems()]}componentsMaterialLineItems(){return[]}_railSleeveMaterialLineItems(){if(this.railingStyle().miterRailsAtKickplateCorner())return[];const e=this.railSleeves().length,t=this.rightAngleCorner()?this.materials.FITTING725_D48:this.materials.FITTING764_D48;return[new u(e,t)]}rightAngleCorner(){return this.previousSection().isPerpendicularToSection(this.nextSection())}components(){return[...this.blocks(),...this.railSleeves()]}async load(){return Promise.all(this.components().map((e=>e.load?.())))}defaultFigure(){return i.withModel(this)}threeFigure(){return s.withModel(this)}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_blocks","_railSleeves"]}}},81304:(e,t,r)=>{const n=r(63768),i=r(84155),s=r(81785),o=r(42632);e.exports=class KwikclampStandardBlock extends i{structureDirection(){return this.componentOf().structureDirection()}_levelSectionInfillBottomHeight(){return this.railingStyle().lowerRailHeights().last()}topRailHeight(){return this.section().railingHeight()}topRailNormalOffset(){return n.multiply(this.railingStyle().topRailNormalOffset(),-this.structureDirection())}railingStyle(){return this.section().railingStyle()}railEdge(){let e=this.edge();return this.isFirstBlock()&&(e=this.section().adjustedEdgeForRailCornerAtBegin(e)),this.isLastBlock()&&(e=this.section().adjustedEdgeForRailCornerAtEnd(e)),e}railBeginMiter(){if(this.isFirstBlock())return this.section().beginRailMiterDirection()}railEndMiter(){if(this.isLastBlock())return this.section().endRailMiterDirection()}rails(){return this._rails??=this._defaultRails()}_defaultRails(){const e=this.section().useLongTopRail()?[]:[this._createRail(this.topRailHeight(),this.topRailNormalOffset())];return this.railingStyle().lowerRailHeights().forEach((t=>{e.push(this._createRail(t))})),e}_defaultBottomRail(){return this._createRail(this.bottomRailHeight())}_createRail(e,t){return o.createRail(this._classForRails(),this,e,t,this.railBeginMiter(),this.railEndMiter())}_classForRails(){return s}topRail(){return this.section().useLongTopRail()?void 0:this.rails().first()}components(){return[...this.infill(),...this.accumulatedComponents(),...this.rails()]}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_rails"]}}},18026:(e,t,r)=>{const{GateType:n}=r(8423),i=r(85004),s=r(56059);e.exports={DEFAULT:new n("None",void 0),MEZZANINE:new n("Mezzanine",i),SLIDING:new n("Sliding",s)}},85004:(e,t,r)=>{const n=r(63768),{Polygon:i}=r(62048),{three:s,Composite3DFigure:o}=r(37732),a=r(59663),l=r(84374),c=r(57473);e.exports=class KwikclampMezzanineGate extends l{static minimumPostHeight(){return n.unit(1,"mm")}requiredOpeningWidth(){return n.unit(1925,"mm")}materialSpecifier(){return this.materials.mezzanineGate}geometry(){return this._geometry??=this._defaultGeometry()}_defaultGeometry(){const e=this.requiredOpeningWidth().toNumeric(this.unit()),t=-this.componentOf().structureDirection(),r=this.edge(),n=r.shiftedAlongNormalBy(e*t);return new i([r.begin(),r.end(),n.end(),n.begin()])}reset(){super.reset(),this._geometry=void 0}model(){const e=this.edge().center(),t=[this.materialSpecifier().details().materialName],r=this.modelRotation();return new c(e,"kwikclamp-mezzanine-gate",r,void 0,t)}modelRotation(){const e=this.componentOf().structureDirection(),t=this.edge().normalizedAngle()+Math.PI_2*e;return(new s.Quaternion).setFromAxisAngle(new s.Vector3(0,0,1),t)}boundingBox(){return this.geometry().boundingBox()}defaultFigure(){return new a(this)}threeFigure(){return o.withModel(this)}components(){return[...super.components(),this.model()]}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_geometry"]}}},56059:(e,t,r)=>{const n=r(63768),{CompositeFigure:i}=r(7340),{Rectangle:s}=r(62048),{Composite3DFigure:o}=r(37732),a=r(35961),l=r(48960),c=r(82437),u=r(30202),d=r(88646),h=r(56214);e.exports=class KwikclampSlidingGate extends a{static minimumPostHeight(){return n.unit(1,"mm")}requiredOpeningWidth(){return n.unit(2e3,"mm")}materialSpecifier(){return this.materials.slidingGate}thickness(){return n.unit(6,"in")}_defaultGeometry(){return this.edge()}structureDirection(){return this.opening().structureDirection()}slidingSection(){return this._slidingSection??=this._defaultSlidingSection()}_defaultSlidingSection(){const e=this._slidingSectionEdge(),t=new l(e,this);return t.setComponentOf(this),t}_slidingSectionEdge(){const e=-this.opening().structureDirection(),t=c.defaultWidth().toNumeric(this.unit());return this.edge().shiftedAlongNormalBy(t*e).relativeToEdge(this.edge())}railingRun(){return this.opening().railingRun()}postProvider(){return this.opening().postProvider()}placementStrategy(){return this.railingRun().placementStrategy()}railingHeight(){return this.postProvider().railingHeight()}gateTrack(){return this._gateTrack??=this._defaultGateTrack()}_defaultGateTrack(){const e=this._gateTrackEdge();return u.builder(this).beginLocator(e.begin()).endLocator(e.end()).crossSection(this._gateTrackCrossSection()).materialSpecifier(this.materialSpecifier()).build()}_gateTrackEdge(){const e=this.slidingSection().componentLayoutEdge(),t=this.flipped()?e.direction().negated():e.direction(),r=e.length(),n=t.multipliedBy(r);return e.movedByDelta(n).relativeToEdge(this.edge())}_gateTrackCrossSection(){const e=n.unit(25,"mm").toNumeric(this.unit());return new d([new h(new s(-e/2,-e/2,e,e))])}components(){return[this.slidingSection(),this.gateTrack()]}reset(){super.reset(),this._slidingSection=void 0,this._gateTrack=void 0}defaultFigure(){return i.withModel(this)}threeFigure(){return o.withModel(this)}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_slidingSection","_gateTrack"]}}},10774:(e,t,r)=>{const n=r(81304),i=r(47299);e.exports=class KwikclampSlidingGateBlock extends n{_classForRails(){return i}}},7213:(e,t,r)=>{const n=r(32805);e.exports=class KwikclampSlidingGateKickplate extends n{materialSpecifier(){return this.materials.slidingGateKickplate}}},92665:(e,t,r)=>{const n=r(82437);e.exports=class KwikclampSlidingGatePost extends n{materialSpecifier(){return this.materials.slidingGatePost}}},47299:(e,t,r)=>{const n=r(81785);e.exports=class KwikclampSlidingGateRail extends n{materialSpecifier(){return this.materials.slidingGateRail}}},48960:(e,t,r)=>{const n=r(216),i=r(79191),s=r(10774),o=r(7213),a=r(92665);e.exports=class KwikclampSlidingGateSection extends n{_defaultRailingStyle(){return new i}blockClass(){return s}_classForPost(e,t){return a}_classForKickplate(){return o}includeKickplate(){return!0}beginPost(){return this.railingPosts().first()}endPost(){return this.railingPosts().last()}shouldHavePostAtBegin(){return!0}sectionConnectedToBegin(){}sectionConnectedToEnd(){}defaultAnnotations(){return[]}_isSelectable(){return!1}}},36761:e=>{e.exports={SECTION_LENGTH_ANNOTATIONS:"Section Lengths",FITTING_ANNOTATIONS:"Fittings"}},56711:(e,t,r)=>{const{RailingLayoutInsetHelper:n}=r(8423),i=r(63768);e.exports=class KwikclampPostLayoutInsetHelper extends n{rightAngleInset(e,t){return this._insetForCornerBlock(e,t)||super.rightAngleInset(e,t)}_insetForCornerBlock(e,t){const r=e.sectionConnectedToBegin()===t;if(r&&e.shouldHaveCornerBlockAtBegin()||!r&&e.shouldHaveCornerBlockAtEnd())return e.doublePostInsetLength()}obliqueInset(e,t){return this._insetForCornerBlock(e,t)||super.obliqueInset(e,t)}slopedInset(e,t,r){return e.isPerpendicularToSection(t)?this.rightAngleInset(e,t):e.isParallelToSection(t)?e.postMountStyle().isFasciaMount()||r===e.edge().end()?i.unit(0,"mm"):i.multiply(e.postCenterOffsetFromEdge(),2):this.obliqueInset(e,t)}parallelSlopeTransitionInset(e,t,r){return e.postMountStyle().isFasciaMount()||e.sloped()?i.unit(0,"mm"):e.postCenterOffsetFromEdge()}}},24846:(e,t,r)=>{const n=r(56711);e.exports=class KwikclampWallMountPostLayoutInsetHelper extends n{}},64840:(e,t,r)=>{const n=r(63768),{MaterialSpecifier:i}=r(93613),s=r(42947),o=(e,t)=>new i(`FITTING${e}_D48`,`KC-${e}`,t),a=[101,104,116,119,124,125,127,128,129,130,133,139,146,148,151,152,153,155,156,180,181,182,183,184,185,186,187,198,199,232,233,242,252,253,255,256,725,746,755,756,757,758,764].map((e=>o(e))),l=(e,t=n.unit(0,"mm"))=>({heightAboveTopOfPost:e,offsetFromCenterOfPost:t}),c={751:l(n.unit(55,"mm")),752:l(n.unit(63,"mm"),n.unit(31,"mm"))};Object.entries(c).forEach((([e,t])=>a.push(o(e,t))));const u=[new i("post","Post"),new i("bikewayPost","Bikeway Post"),new i("rail","Pipe Rail (2 m)",{radius:n.unit(25,"mm"),materialName:"metallic-grey-low-gloss"}),new i("customRail","Pipe Rail (Custom Lengths)",{radius:n.unit(25,"mm"),materialName:"metallic-grey-low-gloss"}),new i("barrierPanel","Barrier Panel"),new i("ETD","D End Termination"),new i("ETJ","J End Termination"),new i("barrierPanelCorner","Barrier Panel 90° Corner"),new i("picket","Picket",{radius:n.unit(6,"mm"),materialName:"metallic-grey-low-gloss",editable:!1}),new i("kickplateInsideCorner","Kickplate Inside Corner"),new i("kickplateOutsideCorner","Kickplate Outside Corner"),new i("kickplateFastenerBolt","Kickplate Fastener Bolt"),new i("kickplateEndCap","Kickplate End Cap"),new i("kickplateRampTransition","KP-Ramp"),new i("kickplate","Kickplate",{width:n.unit(13,"mm"),depth:n.unit(100,"mm"),thickness:n.unit(3,"mm"),materialName:"metallic-grey-low-gloss",purchaseLengthSpecifiers:[new i("kickplate_2m","Kickplate x 2 m",{length:n.unit(2,"m"),pricingIdentifier:"kickplate"}),new i("kickplate_6m","Kickplate x 6 m",{length:n.unit(6,"m"),pricingIdentifier:"kickplate"})]}),...a,new i("Tax","Tax"),new i("TEK-Screw30","TEK Screw 30")],d={materialName:"metallic-white-low-gloss"},h=new i("slidingGate","Sliding Gate",d);u.push(h),["post","rail","kickplate"].forEach((e=>{const t=u.find((t=>t.identifier()===e)),r=e.charAt(0).toUpperCase()+e.slice(1),n=h.identifier()+r,s=`${h.name()} ${r}`,o={...t.details(),...d};u.push(new i(n,s,o))})),u.push(new i("mezzanineGate","Mezzanine Gate",d));const p={};u.forEach((e=>{p[e.identifier()]=e})),p.lookupName=(e,t)=>{const r=p[e];return t?.[e]?.[s.item]??r.name()};const m=e=>({identifier:e.identifier(),displayValue:e.name(),[s.item]:e.name()});p.defaultMaterialDefinitions=()=>u.flatMap((e=>!1===e.details().editable?[]:e.details().purchaseLengthSpecifiers?e.details().purchaseLengthSpecifiers.map((e=>m(e))):m(e)));const f={"155-ETJ":["FITTING155_D48","ETJ"],"180-ETJ":["FITTING180_D48","ETJ"],"181-ETJ":["FITTING181_D48","ETJ"],"DDA-ETJ":["FITTING151_D48","ETJ"],"256-ETD":["FITTING256_D48","ETD"],"104-ETD":["FITTING104_D48","ETD"],"104-ETJ":["FITTING104_D48","ETJ"],"148_d48-with-cap":["FITTING148_D48","FITTING133_D48"]};p.screwCountMap={FITTING151_D48:{count:2,identifier:"TEK-Screw30"},FITTING725_D48:{count:2,identifier:"TEK-Screw30"},FITTING751_D48:{count:2,identifier:"TEK-Screw30"},FITTING752_D48:{count:2,identifier:"TEK-Screw30"},FITTING755_D48:{count:2,identifier:"TEK-Screw30"},FITTING756_D48:{count:2,identifier:"TEK-Screw30"},FITTING757_D48:{count:2,identifier:"TEK-Screw30"},FITTING758_D48:{count:2,identifier:"TEK-Screw30"},FITTING764_D48:{count:2,identifier:"TEK-Screw30"}},p.assemblyMaterials=e=>(f[e]||[]).map((e=>p[e])),e.exports=p},35504:(e,t,r)=>{const n=r(83741);class KwikClampPostMountStyle extends n{static MOUNT_STYLE_IDENTIFIERS={...super.MOUNT_STYLE_IDENTIFIERS,inGround:"In Ground"};isInGroundMount(){return this.styleIdentifier()===this.constructor.MOUNT_STYLE_IDENTIFIERS.inGround}}e.exports=KwikClampPostMountStyle},93961:(e,t,r)=>{const n=r(63768),{extend:i}=r(50988),{PostFasciaMountStyleMixin:s}=r(8423),o=r(9217);class KwikclampPostFasciaMountStyle extends o{postZOffset(){return n.unit(250,"mm")}offsetFromEdgeOfPlatform(){return n.unit(8,"mm")}}i(KwikclampPostFasciaMountStyle,s),e.exports=KwikclampPostFasciaMountStyle},7940:(e,t,r)=>{const n=r(63768),i=r(9217);e.exports=class KwikclampPostInGroundMountStyle extends i{static styleIdentifier(){return this.MOUNT_STYLE_IDENTIFIERS.inGround}postZOffset(){return n.unit(600,"mm")}}},9217:(e,t,r)=>{const n=r(63768),i=r(35504);e.exports=class KwikclampPostSurfaceMountStyle extends i{postZOffset(){return n.unit(0,"mm")}offsetFromEdgeOfPlatform(){return n.unit(25,"mm")}_baseComponentLayoutEdge(e){if(this.isFasciaMount()||e.isLevel())return super._baseComponentLayoutEdge(e);const t=e.edge(),r=t.xy().direction(),n=e.postCenterOffsetFromEdge().toNumeric(e.unit()),i=r.multipliedBy(n),s=t.begin().add(i),o=t.end().subtract(i);return s.to(o).relativeToEdge(t)}componentLayoutEdgeIntersectionOverride(e,t,r,n,i){return e.isLevel()?super.componentLayoutEdgeIntersectionOverride(e,t,r,n,i):n||void 0}}},7237:(e,t,r)=>{const n=r(63768),i=r(88412),s=r(65898),o=r(53878),a=r(64815);class KwikclampBarrierEndPost extends i{static dTerminationDescriptorMap=new s(a.barrierEndPostDTerminationLowerRailSleeves);_dTerminationLowerHeight(){return n.unit(500,"mm")}_dTerminationLowerLocator(){return this.locatorForHeight(this._dTerminationLowerHeight())}_dTerminationSleeveHelper(){if(this._hasDEndTerminator())return new o(this,this.constructor.dTerminationDescriptorMap,this._dTerminationLowerLocator())}lowerRailSleeveHelpers(){return[...super.lowerRailSleeveHelpers(),this._dTerminationSleeveHelper()].filter(Boolean)}}e.exports=KwikclampBarrierEndPost},77360:(e,t,r)=>{const n=r(63768),{three:i}=r(37732),{PolarCoordinate:s}=r(62048),o=r(24697),a=r(57473),l=r(34142),c=r(64840);e.exports=class KwikclampBikewayEndPost extends o{hasJTerminator(){return!1}dTerminatorModelHeight(){return n.unit(600,"mm")}dTerminatorAngle(){const e=this.locator().xy().distanceTo(this.dTerminatorLocator().xy()),t=this.dTerminatorModelHeight().toNumeric(this.unit());return Math.asin(e/t)*this.structureDirection()}dTerminatorLocator(){return this.topLocator().add(this._railOffset()).relatedTo(this.topLocator())}_railOffset(){const e=this.railOffsetFromCenterOfPost().toNumeric(this.unit()),t=this.section().ddaCompliant()?l.defaultRadius():n.unit(0,"mm"),r=n.add(this.railHeightAboveTopOfPost(),t).toNumeric(this.unit()),i=new s(r,-(Math.PI_2+this.slantAngle())),o=new s(e,Math.PI-this.slantAngle()),a=i.add(o);return this.edge().normal().multipliedBy(a.x()).addZ(a.y())}dTerminator(){return this._dTerminator??=this._defaultDTerminator()}_defaultDTerminator(){if(!this.isTerminalPost())return;const e=this.section().topRailEdge(),t=this.isBeginPost(),r=e.xy().theta(),n=t?0:Math.PI,s=(new i.Quaternion).setFromAxisAngle(new i.Vector3(0,0,1),r),o=(new i.Quaternion).setFromAxisAngle(new i.Vector3(0,0,1),n),l=(new i.Quaternion).setFromAxisAngle(new i.Vector3(1,0,0),this.dTerminatorAngle()),c=s.clone().multiply(l).multiply(o),u=new a(this.dTerminatorLocator(),"kwikclamp-ETD",c,void 0,["metallic-grey-low-gloss"]);return u.setComponentOf(this),u}dTerminatorBaseSleeve(){return this._dTerminatorBaseSleeve??=this._defaultDTerminatorBaseSleeve()}_defaultDTerminatorBaseSleeve(){if(!this.isTerminalPost())return;const e=this.section().topRailEdge(),t=this.isBeginPost(),r=e.xy().theta(),n=t?Math.PI:0,o=(new i.Quaternion).setFromAxisAngle(new i.Vector3(0,0,1),r),l=(new i.Quaternion).setFromAxisAngle(new i.Vector3(0,0,1),n),c=o.clone().multiply(l),u=Math.PI_2-this.dTerminatorAngle(),d=new s(this.dTerminatorModelHeight().toNumeric(this.unit()),u),h=e.normal().multipliedBy(d.x()).addZ(d.y()),p=this.dTerminatorLocator().add(h).relatedTo(this.topLocator()),m=new a(p,"kwikclamp-101_d48",c);return m.setComponentOf(this),m}_dTerminatorMaterials(){return this.isTerminalPost()?[c.ETD,c.FITTING101_D48]:[]}fittingMaterials(){return[...super.fittingMaterials(),...this._dTerminatorMaterials()]}components(){return[...super.components(),this.dTerminator(),this.dTerminatorBaseSleeve()].filter(Boolean)}}},24697:(e,t,r)=>{const n=r(63768),{three:i}=r(37732),{PolarCoordinate:s,$P:o}=r(62048),a=r(48511),l=r(6556),c=r(65898),u=r(82437),d=r(46748),h=r(64840),p=r(64815);e.exports=class KwikclampBikewayPost extends u{static _defaultTopRailSleeveDescriptorMap(){return new c(p.bikewayTopRailSleeves)}static topRailDdaSleeveDescriptorMap(){return this._topRailDdaSleeveDescriptorMap??=this._defaultTopRailDdaSleeveDescriptorMap()}static _defaultTopRailDdaSleeveDescriptorMap(){return new c(p.ddaBikewayTopRailSleeves)}railOffsetFromCenterOfPost(){return this.topFittingMaterialSpecifier().details().offsetFromCenterOfPost??n.unit(0,"mm")}railHeightAboveTopOfPost(){return this.topFittingMaterialSpecifier().details().heightAboveTopOfPost??n.unit(0,"mm")}topRailSleeveDescriptorMap(){return this.section().ddaCompliant()?this.constructor.topRailDdaSleeveDescriptorMap():this.constructor.topRailSleeveDescriptorMap()}slantAngle(){return 36..degreesToRadians()*this.structureDirection()}topRailRotation(){return(new i.Quaternion).setFromAxisAngle(new i.Vector3(1,0,0),this.slantAngle())}slantedSectionLength(){return d`abs(${5/6} * ${this.normalOffset()} / sin(${this.slantAngle()}))`}normalOffset(){return n.multiply(this.railingStyle().topRailNormalOffset(),-this.structureDirection())}verticalOffset(){return n.subtract(this.height(),this.railingStyle().midRailHeight())}beginLocator(){return this.topOfVerticalSectionLocator()}topOfVerticalSectionLocator(){const e=this.slantedSectionLength().toNumeric(this.unit())*n.cos(this.slantAngle())+this.verticalOffset().toNumeric(this.unit())/4,t=this.height().toNumeric(this.unit());return this.locator().addZ(-t+e).relatedTo(this.locator())}_controlPointMultiplier(){return 1.2}controlPoint1(){const e=this.bottomOfSlantedSectionLocator().subtract(this.topLocator()).normalized();return this.bottomOfSlantedSectionLocator().add(e.multipliedBy(this._controlPointMultiplier())).relatedTo(this.locator())}controlPoint2(){return this.topOfVerticalSectionLocator().addZ(-this._controlPointMultiplier()).relatedTo(this.locator())}topLocator(){const e=this.height().toNumeric(this.unit()),t=this.normalOffset().toNumeric(this.unit()),r=this.edge().normal().multipliedBy(t);return this.locator().movedBy(r.x(),r.y(),-e).relatedTo(this.locator())}bottomOfSlantedSectionLocator(){const e=Math.PI_2-this.slantAngle(),t=new s(this.slantedSectionLength().toNumeric(this.unit()),e),r=this.edge().normal().multipliedBy(t.x()).addZ(t.y());return this.topLocator().add(r).relatedTo(this.locator())}legMaterialLineItem(){return new l(1,h.bikewayPost)}usesDdaFittings(){return this.section().ddaCompliant()}topOfRailDirection(){return this.edge().normal().multipliedBy(-this.structureDirection()).rotatedBy(o(0,0),0,Math.PI_2-this.slantAngle())}topOfRailNormal(){return this.edge().normal().multipliedBy(this.structureDirection()).rotatedBy(o(0,0),0,this.slantAngle())}components(){return[...super.components(),this.curvedExtrusion(),this.slantedExtrusion()]}curvedExtrusion(){return this._curvedExtrusion??=this._defaultCurvedExtrusion()}_defaultCurvedExtrusion(){const e=a.builder(this).beginLocator(this.bottomOfSlantedSectionLocator()).controlPoint1(this.controlPoint1()).controlPoint2(this.controlPoint2()).endLocator(this.topOfVerticalSectionLocator()).crossSection(this.crossSection()).planarNormal(this.planarNormal()).materialSpecifier(this.extrusionMaterialSpecifier()).beginMiterDirection(this.beginMiterDirection()).endMiterDirection(this.endMiterDirection()).color(this.color()).build();return e.setComponentOf(this),e}slantedExtrusion(){return this._slantedExtrusion??=this._defaultSlantedExtrusion()}_defaultSlantedExtrusion(){const e=this.extrusionClass().builder(this).beginLocator(this.topLocator()).endLocator(this.bottomOfSlantedSectionLocator()).crossSection(this.crossSection()).planarNormal(this.planarNormal()).materialSpecifier(this.extrusionMaterialSpecifier()).beginMiterDirection(this.beginMiterDirection()).endMiterDirection(this.endMiterDirection()).color(this.color()).build();return e.setComponentOf(this),e}}},15166:(e,t,r)=>{const n=r(63768),{three:i}=r(37732),s=r(82437),o=r(65898),a=r(57473),l=r(64815);e.exports=class KwikclampDdaPost extends s{static topRailDdaSleeveDescriptorMapForSection(e){return e.includeKickplate()?this.topRailDdaKickplateSleeveDescriptorMap():this.topRailDdaSleeveDescriptorMap()}static topRailDdaSleeveDescriptorMap(){return this._topRailDdaSleeveDescriptorMap??=new o(l.ddaTopRailSleeves)}static topRailDdaKickplateSleeveDescriptorMap(){return this._topRailDdaKickplateSleeveDescriptorMap??=new o(l.ddaWithKickplateTopRailSleeves)}static _defaultLowerRailSleeveDescriptorMap(){return new o(l.ddaLowerRailSleeves)}topRailRotation(){const e=this.structureAlongNormal()?Math.PI:0;return(new i.Quaternion).setFromAxisAngle(new i.Vector3(0,0,1),e)}railOffsetFromCenterOfPost(){return this.topFittingMaterialSpecifier().details().offsetFromCenterOfPost??n.unit(0,"mm")}railHeightAboveTopOfPost(){return this.topFittingMaterialSpecifier().details().heightAboveTopOfPost??n.unit(0,"mm")}topRailSleeveDescriptorMap(){return this.constructor.topRailDdaSleeveDescriptorMapForSection(this.section())}_fittingModelIdentifiers(){return[...super._fittingModelIdentifiers(),...this._additionalFittingsForDdaCompliance()].filter(Boolean)}_additionalFittingsForDdaCompliance(){return this.hasJTerminator()?["kwikclamp-DDA-ETJ"]:this.isCornerPost()?["kwikclamp-151_d48"]:[]}hasJTerminator(){return this.isTerminalPost()}jTerminator(){return this._jTerminator??=this._defaultJTerminator()}_defaultJTerminator(){if(!this.hasJTerminator())return;const e=this.section().topRailEdge(),t=this.isBeginPost(),r=e.xy().theta()+(t?0:Math.PI),n=(new i.Quaternion).setFromAxisAngle(new i.Vector3(0,0,1),r),s=new a(e[t?"begin":"end"](),"kwikclamp-ETJ",n);return s.setComponentOf(this),s}usesDdaFittings(){return!0}components(){return[...super.components(),this.jTerminator()].filter(Boolean)}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_jTerminator"]}}},88412:(e,t,r)=>{const n=r(82437),i=r(65898),s=r(83071),o=r(31651),a=r(64815);class KwikclampEndPost extends n{static dTerminatedTopRailDescriptorMap=new i([new s(o.terminal,"kwikclamp-104-ETD",{materialNames:["aluminum","metallic-grey-low-gloss"]})]);static jTerminatedTopRailDescriptorMap=new i([new s(o.terminal,"kwikclamp-104-ETJ",{materialNames:["aluminum","metallic-grey-low-gloss","black-plastic"]})]);static defaultTopRailDescriptorMap=new i(a.topRailTerminalSleeves);attachedRailDirections(){return this._adjacentToCornerBlock()?[this.section().edge().direction(),this.section().edge().direction()]:super.attachedRailDirections()}topRailSleeveDescriptorMap(){return this.isTerminalPost()?this._hasJEndTerminator()?this.constructor.jTerminatedTopRailDescriptorMap:this._hasDEndTerminator()?this.constructor.dTerminatedTopRailDescriptorMap:this.constructor.defaultTopRailDescriptorMap:super.topRailSleeveDescriptorMap()}_adjacentToCornerBlock(){return!(!this.isEndPost()||!this.section().shouldHaveCornerBlockAtEnd())||!(!this.isBeginPost()||!this.previousSection()?.shouldHaveCornerBlockAtEnd())}_hasJEndTerminator(){return this.section().requiresJEndTerminationForPost(this)}_hasDEndTerminator(){return this.section().requiresDEndTerminationForPost(this)}}e.exports=KwikclampEndPost},82437:(e,t,r)=>{const n=r(63768),{three:i}=r(37732),{$P:s}=r(62048),{extend:o}=r(50988),a=r(20901),l=r(18475),c=r(88646),u=r(10712),d=r(18729),h=r(65898),p=r(57473),m=r(6556),f=r(34732),g=r(67065),y=r(46748),b=r(36761),v=r(64840),_=r(64815);class KwikclampPost extends l{static defaultRadius(){return v.rail.details().radius}static defaultWidth(){return n.multiply(this.defaultRadius(),2)}static defaultLength(){return n.multiply(this.defaultRadius(),2)}static topRailSleeveDescriptorMap(){return this.hasOwnProperty("_topRailSleeveDescriptorMap")?this._topRailSleeveDescriptorMap:this._topRailSleeveDescriptorMap=this._defaultTopRailSleeveDescriptorMap()}static _defaultTopRailSleeveDescriptorMap(){return new h(_.topRailSleeves)}static lowerRailSleeveDescriptorMap(){return this.hasOwnProperty("_lowerRailSleeveDescriptorMap")?this._lowerRailSleeveDescriptorMap:this._lowerRailSleeveDescriptorMap=this._defaultLowerRailSleeveDescriptorMap()}static _defaultLowerRailSleeveDescriptorMap(){return new h(_.lowerRailSleeves)}static materialsForFittingModel(e,t){if(!e||!t)return[];const r=e.replace("kwikclamp-",""),n=t[`FITTING${r.toUpperCase()}`];return n?[n]:t.assemblyMaterials(r)}materialSpecifier(){return this.materials.rail}legMaterialLineItem(){if(this.leg())return new m(1,v.post)}selfMaterialLineItems(){const e=this._selfMaterialLineItemsWithoutScrews();return[...e,...g.screwLineItems(e)]}_selfMaterialLineItemsWithoutScrews(){const e=this.fittingMaterials().map((e=>new m(this._countForMaterial(e),e))),t=this._kickplateBoltCount()>0?new m(this._kickplateBoltCount(),this.materials.kickplateFastenerBolt):void 0;return[...e,this.legMaterialLineItem(),t].filter(Boolean)}_countForMaterial(e){return e===v.FITTING148_D48?2:1}fittingMaterials(){return this._fittingModelIdentifiers().flatMap((e=>this.materialsForFittingModel(e)))}_fittingModelIdentifiers(){return[...this.sleeves().map((e=>e.modelIdentifier())),this.baseplate()?this.baseplateModelIdentifier():void 0,this.kickplateMountingBracket()?this.kickplateMountingBracketIdentifier():void 0].filter(Boolean)}materialsForFittingModel(e){return this.constructor.materialsForFittingModel(e,this.materials)}topFittingMaterialSpecifier(){const e=this.topRailSleeve();return this.fittingMaterials(e.modelIdentifier()).first()}radius(){return this.constructor.defaultRadius()}width(){return n.multiply(this.radius(),2)}length(){return n.multiply(this.radius(),2)}crossSection(){return new c([new a(s(0,0).expandedByRadius(this.radius().toNumeric(this.unit())))])}topRailSleeveDescriptorMap(){return this.constructor.topRailSleeveDescriptorMap()}lowerRailSleeveDescriptorMap(){return this.constructor.lowerRailSleeveDescriptorMap()}defaultBaseplate(){if(this.mountStyle().isInGroundMount())return;const e=new p(this.bottomLocator(),this.baseplateModelIdentifier(),this.baseplateRotation(),void 0,["aluminum"]);return e.setComponentOf(this),e}baseplateModelIdentifier(){if(this.mountStyle().isFasciaMount())return"kwikclamp-146_d48";if(this._useKickplateMountingBaseplate())return"kwikclamp-242_d48";const e=this.section();if(e.isLevel()||e.isStairs()||this.connectedSection()?.isLevel())return"kwikclamp-232_d48";const t=e.slope().toNumeric("deg");return t>=-11&&t<=11?"kwikclamp-152_d48":t>=-29&&t<=29?"kwikclamp-252_d48":"kwikclamp-232_d48"}kickplateMountingBracket(){if(this.section().includeKickplate()&&!this._useKickplateMountingBaseplate())return this._kickplateMountingBracket??this._defaultKickplateMountingBracket()}_defaultKickplateMountingBracket(){const e=this.locator().addZ(-this.kickplateMountingHeight().toNumeric(this.unit())),t=this.kickplateMountingBracketIdentifier(),r=this._kickplateMountingBracketRotation(),n=new p(e,t,r);return n.setComponentOf(this),n}kickplateMountingBracketIdentifier(){return this._useTerminalKickplateBracket()?"kwikclamp-199_d48":"kwikclamp-198_d48"}_kickplateBoltCount(){return this.section().includeKickplate()?this._useKickplateMountingBaseplate()?4:this._useTerminalKickplateBracket()?1:2:0}_kickplateMountingBracketRotation(){const e=this.section().structureDirection();if(!this._useTerminalKickplateBracket()){const t=this.edge().direction().multipliedBy(e).theta();return(new i.Quaternion).setFromAxisAngle(new i.Vector3(0,0,1),t)}const t=this.edge().xy().direction(),r=this.isBeginPost()?t:t.negated(),n=this.edge().normal().multipliedBy(-e),s=r.cross(n),o=(new i.Matrix4).makeBasis(r.toThreeJS(),n.toThreeJS(),s.toThreeJS());return(new i.Quaternion).setFromRotationMatrix(o)}_useTerminalKickplateBracket(){const e=this.section(),t=this.connectedSection();return this.isTerminalPost()||t&&e.includeKickplate()&&!t.includeKickplate()}_useKickplateMountingBaseplate(){const e=this.section();if(!e.includeKickplate()||this.mountStyle().isFasciaMount())return!1;const t=e.sectionConnectedToBegin(),r=e.sectionConnectedToEnd();return e.isLevel()&&!(t&&t.includeKickplate()&&t.sloped())&&!(r&&r.includeKickplate()&&r.sloped())}usesDdaFittings(){return!1}topOfRailDirection(){return s(0,0,-1)}topOfRailNormal(){return this.edge().normal()}isSinglePostCorner(){return 2===this.attachedSections().length&&!this.isDoublePostCorner()}isSlopeTransitionPost(){return!1}kickplateMountingHeight(){const e=this.section();if(!e.includeKickplate())return n.unit(0,"mm");const t=e.kickplate().materialSpecifier().details().depth,r=e.kickplate().height();return y`${r} + ${t} / 2`}components(){return[...super.components(),this.kickplateMountingBracket()].filter(Boolean)}fittingsAnnotation(){return this._fittingsAnnotation??=this._defaultFittingsAnnotation()}fittingCombination(){return this.fittingMaterials().map((e=>e.identifier())).join()}_defaultFittingsAnnotation(){const e=this.project().fittingCombinationNumberForPost(this),t=new f(e,this.locator());return t.setLayer(b.FITTING_ANNOTATIONS),t}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_kickplateMountingBracket","_fittingsAnnotation"]}}o(KwikclampPost,u),o(KwikclampPost,d),e.exports=KwikclampPost},71867:(e,t,r)=>{const n=r(88412),i=r(65898),s=r(64815);class KwikclampStandardEndPost extends n{static terminatedLowerRailDescriptorMap=new i(s.standardEndPostDTerminationLowerRailSleeves);static defaultLowerRailDescriptorMap=new i(s.lowerRailTerminalSleeves);lowerRailSleeveDescriptorMap(){return this.isTerminalPost()?this._hasDEndTerminator()?this.constructor.terminatedLowerRailDescriptorMap:this.constructor.defaultLowerRailDescriptorMap:super.lowerRailSleeveDescriptorMap()}}e.exports=KwikclampStandardEndPost},78648:(e,t,r)=>{const n=r(57473),i=r(15166),s=r(6556);e.exports=class KwikclampWallMountPost extends i{defaultSleeves(){return[]}defaultBaseplate(){const e=new n(this.topLocator(),this.baseplateModelIdentifier(),this.baseplateRotation(),void 0,["aluminum"]);return e.setComponentOf(this),e}baseplateModelIdentifier(){return"kwikclamp-746_d48"}_additionalFittingsForDdaCompliance(){return this.hasJTerminator()?["kwikclamp-DDA-ETJ"]:[]}topFittingMaterialSpecifier(){}_selfMaterialLineItemsWithoutScrews(){const e=this._shouldHaveTwoWallBrackets()?2:1;return[new s(e,this.materials.FITTING746_D48)]}components(){return[this.baseplate(),this.jTerminator()].filter(Boolean)}_shouldHaveTwoWallBrackets(){if(this.hasJTerminator())return!0;if(this.isTerminalPost()||this.isLinePost())return!1;if(!this.isSlopeTransitionPost())return!1;const e=this.previousSection().edge().xy(),t=this.nextSection().edge().xy();return e.isParallelTo(t)}isSlopeTransitionPost(){if(this.isTerminalPost()||this.isLinePost())return!1;const e=this.section().slope().toNumeric("rad"),t=this.connectedSection().slope().toNumeric("rad");return!e.isNearTo(t)}}},89105:(e,t,r)=>{const n=r(63768),{RailLengthHelper:i}=r(8423),s=r(85976),o=r(7237),a=r(79191);e.exports=class KwikclampBarrierRailingStyle extends a{get styleId(){return"BarrierPanel"}get label(){return"Barrier Panel"}get icon(){return"picket-rail"}lowerRailHeights(){return[n.unit(150,"mm")]}blockClass(){return s}postSpacingMode(){return i.mode.MAX_LENGTH}includeRailLineItems(){return!1}miterRailsAtKickplateCorner(){return!0}endPostClass(e){return e.sloped()?e.primaryPostClass():o}supportsDEndTermination(e){return e.isLevel()}supportsJEndTermination(e){return e.isLevel()}cornerRailInset(){return n.unit(0,"mm")}}},81056:(e,t,r)=>{const n=r(63768),{RailLengthHelper:i}=r(8423),s=r(58684),o=r(82437),a=r(81304),l=r(15166),c=r(56711);e.exports=class KwikclampBasicRailingStyle extends s{static idealMaxRailLength(){return n.unit(2,"m")}static maxCertifiedRailLength(){return n.unit(2.4,"m")}get styleId(){return"TopRailOnly"}get label(){return"Top Rail Only"}get icon(){return"top-rail-only"}railingHeight(){return n.unit(1e3,"mm")}topRailNormalOffset(){return n.unit(0,"mm")}lowerRailHeights(){return[]}blockClass(){return a}postLayoutEdgeInsetHelperClass(){return c}defaultRailLength(){return this.constructor.idealMaxRailLength()}maxRailLength(){return this.constructor.maxCertifiedRailLength()}maxPostSpacing(){return this.maxRailLength()}postSpacingMode(){return i.mode.EVEN}includeRailLineItems(){return!0}miterRailsAtKickplateCorner(){return!1}ddaEndPostClass(){return l}endPostClass(e){return e.primaryPostClass()}supportsWallTermination(e){return e.isLevel()}supportsDEndTermination(e){return!1}supportsJEndTermination(e){return!1}cornerRailInset(){return n.divide(o.defaultWidth(),2)}}},77642:(e,t,r)=>{const n=r(63768),i=r(64489),s=r(77360),o=r(24697),a=r(81056);e.exports=class KwikclampBikewayRailingStyle extends a{get styleId(){return"BikewayRail"}get label(){return"Bikeway Rail"}get icon(){return"bikeway-rail"}railingHeight(){return n.unit(1376,"mm")}midRailHeight(){return n.unit(1075,"mm")}topRailNormalOffset(){return n.unit(150.85,"mm")}blockClass(){return i}lowerRailHeights(){return[this.midRailHeight(),n.unit(125,"mm")]}ddaEndPostClass(){return this.endPostClass()}primaryPostClass(){return o}endPostClass(){return s}}},79191:(e,t,r)=>{const n=r(63768),i=r(81056),s=r(71867);e.exports=class KwikclampStandardRailingStyle extends i{get styleId(){return"TopAndMidRail"}get label(){return"Top & Mid Rail"}get icon(){return"mid-rail"}lowerRailHeights(){return[n.unit(500,"mm")]}endPostClass(e){return e.sloped()?e.primaryPostClass():s}supportsDEndTermination(e){return e.isLevel()}supportsJEndTermination(e){return e.isLevel()}}},17326:(e,t,r)=>{const n=r(63768),i=r(81056);e.exports=class KwikclampThreeRailRailingStyle extends i{get styleId(){return"ThreeRail"}get label(){return"Three Rail"}get icon(){return"three-rail"}lowerRailHeights(){return[n.unit(2e3/3,"mm"),n.unit(1e3/3,"mm")]}}},39971:(e,t,r)=>{const n=r(81056),i=r(78648),s=r(24846);e.exports=class KwikclampWallMountRailingStyle extends n{get styleId(){return"WallMountRail"}get label(){return"Wall-Mount Rail"}get icon(){return"hand-grab-rail"}primaryPostClass(){return i}endPostClass(){return this.primaryPostClass()}ddaEndPostClass(){return this.primaryPostClass()}supportsJEndTermination(e){return e.isLevel()}forceDDA(){return!0}postLayoutEdgeInsetHelperClass(){return s}}},95766:(e,t,r)=>{const n=r(63768),i=r(6556),s=r(78913);class KwikclampCustomRail extends s{static maxCustomRailJoinDistance(){return n.unit(5,"m")}static railEdgeFromSection(e){const t=n.add(e.defaultInsetForRailCornerEdge(),e.doublePostInsetLength());let r=e.beginPost().topLocator().to(e.endPost().topLocator());return r=e.adjustedEdgeForRailCornerAtBegin(r,t),r=e.adjustedEdgeForRailCornerAtEnd(r,t),r}constructor(e,t=KwikclampCustomRail.railEdgeFromSection){super(t(e).relativeToEdge(e.edge()),e.beginRailMiterDirection(),e.endRailMiterDirection()),this.setComponentOf(e),this._section=e}section(){return this._section}materialSpecifier(){return this.materials.customRail}materialLineItems(){const e=[];if(this._includeRailLineItems()){e.push(new i(this.pricingLength(),this.materialSpecifier()));const t=Math.floor(this.edge().length()/this.constructor.maxCustomRailJoinDistance().toNumeric(this.unit()));t>0&&e.push(new i(t,this.materials.FITTING151_D48))}return e}pricingLength(){const e=super.pricingLength().toNumeric("mm").rounded();return n.unit(e,"mm")}}e.exports=KwikclampCustomRail},81785:(e,t,r)=>{const n=r(6556),i=r(78913);e.exports=class KwikclampCutRail extends i{materialSpecifier(){return this.materials.rail}materialLineItems(){return this._includeRailLineItems()?[new n(1,this.materialSpecifier())]:[]}}},34142:(e,t,r)=>{const n=r(63768),i=r(95766);class KwikclampDdaRail extends i{static railInsetForJTerminator(){return n.unit(75,"mm")}static railExtensionLengthFromJTerminator(){return n.unit(300,"mm")}static railEdgeFromSection(e){const t=i.railEdgeFromSection(e),r=KwikclampDdaRail._railEdgeAdjustmentVector(e);return t.movedByDelta(r)}static _railEdgeAdjustmentVector(e){const t=e.railingPosts().find((e=>e.usesDdaFittings())),r=t?.topFittingMaterialSpecifier()?.details()||{},i=r.offsetFromCenterOfPost||n.unit(0,"mm"),s=n.add(r.heightAboveTopOfPost||n.unit(0,"mm"),this.defaultRadius()),o=t??e.railingPosts().first(),a=o.topOfRailNormal().multipliedBy(e.structureDirection()),[l,c]=[i,s].map((t=>t.toNumeric(e.unit())));return a.multipliedBy(-l).add(o.topOfRailDirection().multipliedBy(c))}constructor(e,t=KwikclampDdaRail.railEdgeFromSection){super(e,t)}hasJTerminatorAtBegin(){return this.section().beginPost().hasJTerminator()}hasJTerminatorAtEnd(){return this.section().endPost().hasJTerminator()}defaultGeometry(){const e=this.edge().begin(),t=this.edge().end(),r=this.constructor.railExtensionLengthFromJTerminator(),n=this.hasJTerminatorAtBegin()?this._endpointAdjustedForJTerminator(e,r,!1):e,i=this.hasJTerminatorAtEnd()?this._endpointAdjustedForJTerminator(t,r,!0):t,s=n.to(i).relativeToEdge(this.edge());return this._defaultGeometryForEdge(s)}beginLocator(){const e=this.edge().begin(),t=this.constructor.railInsetForJTerminator();return this.hasJTerminatorAtBegin()?this._endpointAdjustedForJTerminator(e,t,!0):e}endLocator(){const e=this.edge().end(),t=this.constructor.railInsetForJTerminator();return this.hasJTerminatorAtEnd()?this._endpointAdjustedForJTerminator(e,t,!1):e}_endpointAdjustedForJTerminator(e,t,r=!0){const n=t.toNumeric(this.unit()),i=this.edge().xy().direction().multipliedBy(n);return e[r?"add":"subtract"](i)}}e.exports=KwikclampDdaRail},78913:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),{MissingOverride:s}=r(50988),o=r(74215),a=r(88646),l=r(20901),c=r(64840);e.exports=class KwikclampRail extends o{static defaultRadius(){return c.rail.details().radius}static defaultWidth(){return n.multiply(this.defaultRadius(),2)}static defaultDepth(){return n.multiply(this.defaultRadius(),2)}constructor(e,t,r){super(e),this._beginMiterDirection=t,this._endMiterDirection=r}beginMiterDirection(){return this._beginMiterDirection}endMiterDirection(){return this._endMiterDirection}materialSpecifier(){throw new s(this,"materialSpecifier")}materialLineItems(){throw new s(this,"materialLineItems")}_includeRailLineItems(){return this.componentOf().railingStyle().includeRailLineItems()}radius(){return this.constructor.defaultRadius()}width(){return n.multiply(this.radius(),2)}depth(){return n.multiply(this.radius(),2)}crossSection(){return new a([new l(i(0,0).expandedByRadius(this.radius().toNumeric(this.unit())))])}}},64815:(e,t,r)=>{const{three:n}=r(37732),i=r(83071),s=r(31651),o=i.defineSlopes,a=i.xyProcessor,l=i.identityProcessor,c=i.structureDirections.unflipped,u=i.structureDirections.flipped,d=(new n.Quaternion).setFromAxisAngle(new n.Vector3(0,0,1),Math.PI),h=(new n.Quaternion).setFromAxisAngle(new n.Vector3(1,0,0),Math.PI),p=[new i(s.line,"kwikclamp-119_d48"),new i(s.line,"kwikclamp-156_d48",{slopes:o(-11,0)}),new i(s.line,"kwikclamp-156_d48",{slopes:o(0,11),modelRotation:d}),new i(s.line,"kwikclamp-130_d48",{slopes:o(-60,-30)}),new i(s.line,"kwikclamp-130_d48",{slopes:o(30,60),modelRotation:d}),new i(s.line,"kwikclamp-255_d48",{slopes:o(-29,-12)}),new i(s.line,"kwikclamp-255_d48",{slopes:o(12,29),modelRotation:d})],m=[new i(180,"kwikclamp-119_d48"),new i(180,"kwikclamp-156_d48",{slopes:o(-11,0)}),new i(180,"kwikclamp-156_d48",{slopes:o(0,11),modelRotation:d}),new i(180,"kwikclamp-182_d48",{slopes:o(-45,-30,0,0)}),new i(180,"kwikclamp-182_d48",{slopes:o(30,45,0,0),modelRotation:h}),new i(180,"kwikclamp-130_d48",{slopes:o(-60,-30)}),new i(180,"kwikclamp-130_d48",{slopes:o(30,60),modelRotation:d}),new i(180,"kwikclamp-255_d48",{slopes:o(-29,-12)}),new i(180,"kwikclamp-255_d48",{slopes:o(12,29),modelRotation:d})],f=[new i(s.line,"kwikclamp-119_d48"),new i(s.line,"kwikclamp-187_d48",{slopes:o(-11,0)}),new i(s.line,"kwikclamp-187_d48",{slopes:o(0,11),modelRotation:d}),new i(s.line,"kwikclamp-130_d48",{slopes:o(-60,-30)}),new i(s.line,"kwikclamp-130_d48",{slopes:o(30,60),modelRotation:d}),new i(s.line,"kwikclamp-255_d48",{slopes:o(-29,-12)}),new i(s.line,"kwikclamp-255_d48",{slopes:o(12,29),modelRotation:d})],g=[new i(180,"kwikclamp-119_d48"),new i(180,"kwikclamp-187_d48",{slopes:o(-11,0)}),new i(180,"kwikclamp-187_d48",{slopes:o(0,11),modelRotation:d}),new i(180,"kwikclamp-182_d48",{slopes:o(-45,-30,0,0)}),new i(180,"kwikclamp-182_d48",{slopes:o(30,45,0,0),modelRotation:h}),new i(180,"kwikclamp-130_d48",{slopes:o(-60,-30)}),new i(180,"kwikclamp-130_d48",{slopes:o(30,60),modelRotation:d}),new i(180,"kwikclamp-255_d48",{slopes:o(-29,-12)}),new i(180,"kwikclamp-255_d48",{slopes:o(12,29),modelRotation:d})],y=[new i(90,"kwikclamp-116_d48",{isRightCorner:!0}),new i(90,"kwikclamp-185_d48",{slopes:o(-45,-30,0,0)})],b=[new i(270,"kwikclamp-116_d48",{isRightCorner:!0}),new i(270,"kwikclamp-186_d48",{slopes:o(-45,-30,0,0)})],v=[new i(s.terminal,"kwikclamp-101_d48"),new i(s.terminal,"kwikclamp-153_d48",{slopes:o(-11,11),directionProcessor:a}),new i(s.terminal,"kwikclamp-253_d48",{slopes:o(12,29)}),new i(s.terminal,"kwikclamp-253_d48",{slopes:o(-29,-12)}),new i(s.terminal,"kwikclamp-129_d48",{slopes:o(30,60),directionProcessor:a}),new i(s.terminal,"kwikclamp-129_d48",{slopes:o(-60,-30),modelRotation:h,directionProcessor:a})],_=[new i(s.adjustable,"kwikclamp-148_d48")],x=new i(s.adjustable,"adjustable-corner-sleeve-placeholder",{slopes:o(-90,90,-90,90)}),w=[new i(s.line,"kwikclamp-104_d48"),new i(s.line,"kwikclamp-127_d48",{slopes:o(30,45)}),new i(s.line,"kwikclamp-127_d48",{slopes:o(-45,-30),modelRotation:d}),new i(s.line,"kwikclamp-256_d48",{slopes:o(12,29)}),new i(s.line,"kwikclamp-256_d48",{slopes:o(-29,-12),modelRotation:d}),new i(s.line,"kwikclamp-155_d48",{slopes:o(-11,11)})],R=[new i(180,"kwikclamp-104_d48"),new i(180,"kwikclamp-155_d48",{slopes:o(-11,11)}),new i(180,"kwikclamp-180_d48",{slopes:o(-45,-30,0,0)}),new i(180,"kwikclamp-181_d48",{slopes:o(30,45,0,0)}),new i(180,"kwikclamp-127_d48",{slopes:o(-40,-30)}),new i(180,"kwikclamp-127_d48",{slopes:o(30,45),modelRotation:d}),new i(180,"kwikclamp-256_d48",{slopes:o(-29,-12)}),new i(180,"kwikclamp-256_d48",{slopes:o(12,29),modelRotation:d})],k=[new i(90,"kwikclamp-128_d48",{isRightCorner:!0}),new i(90,"kwikclamp-183_d48",{slopes:o(-45,-30,0,0)})],j=[new i(270,"kwikclamp-128_d48",{isRightCorner:!0}),new i(270,"kwikclamp-184_d48",{slopes:o(-45,-30,0,0)})],z=[new i(s.terminal,"kwikclamp-125_d48"),new i(s.terminal,"kwikclamp-155-ETJ",{slopes:o(-11,11),directionProcessor:a,materialNames:["black-plastic","metallic-grey-low-gloss","aluminum"]}),new i(s.terminal,"kwikclamp-181-ETJ",{slopes:o(30,45),directionProcessor:a,materialNames:["black-plastic","metallic-grey-low-gloss","aluminum"]}),new i(s.terminal,"kwikclamp-180-ETJ",{slopes:o(-45,-30),directionProcessor:a,materialNames:["black-plastic","metallic-grey-low-gloss","aluminum"]}),new i(s.terminal,"kwikclamp-256-ETD",{slopes:o(12,29)}),new i(s.terminal,"kwikclamp-256-ETD",{slopes:o(-29,-12)})],q=[new i(s.adjustable,"kwikclamp-148_d48-with-cap",{materialNames:["aluminum","black-plastic"]})],$=new i(s.adjustable,"adjustable-corner-sleeve-placeholder",{slopes:o(-90,90,-90,90)}),Z=[new i(s.line,"kwikclamp-752_d48",{slopes:o(-60,60),slopeAdjustable:!0})],X=[new i(180,"kwikclamp-752_d48",{slopes:o(-60,-12,0,0),slopeAdjustable:!0,structureDirection:c,previousLevel:!0,nextLevel:!1,modelRotation:d}),new i(180,"kwikclamp-752_d48",{slopes:o(-60,-12,0,0),slopeAdjustable:!0,structureDirection:c,previousLevel:!1,nextLevel:!0}),new i(180,"kwikclamp-752_d48",{slopes:o(-60,-12,0,0),slopeAdjustable:!0,structureDirection:u,previousLevel:!0,nextLevel:!1,modelRotation:d}),new i(180,"kwikclamp-752_d48",{slopes:o(-60,-12,0,0),slopeAdjustable:!0,structureDirection:u,previousLevel:!1,nextLevel:!0}),new i(180,"kwikclamp-756_d48",{slopes:o(-11,0),slopeAdjustable:!0,structureDirection:c,previousLevel:!0,nextLevel:!1}),new i(180,"kwikclamp-758_d48",{slopes:o(-11,0),slopeAdjustable:!0,structureDirection:c,previousLevel:!1,nextLevel:!0,modelRotation:d}),new i(180,"kwikclamp-758_d48",{slopes:o(-11,0),slopeAdjustable:!0,structureDirection:u,previousLevel:!0,nextLevel:!1}),new i(180,"kwikclamp-756_d48",{slopes:o(-11,0),slopeAdjustable:!0,structureDirection:u,previousLevel:!1,nextLevel:!0,modelRotation:d}),new i(180,"kwikclamp-757_d48",{slopes:o(0,11),slopeAdjustable:!0,structureDirection:c,previousLevel:!0,nextLevel:!1,modelRotation:d}),new i(180,"kwikclamp-755_d48",{slopes:o(0,11),slopeAdjustable:!0,structureDirection:c,previousLevel:!1,nextLevel:!0}),new i(180,"kwikclamp-755_d48",{slopes:o(0,11),slopeAdjustable:!0,structureDirection:u,previousLevel:!0,nextLevel:!1,modelRotation:d}),new i(180,"kwikclamp-757_d48",{slopes:o(0,11),slopeAdjustable:!0,structureDirection:u,previousLevel:!1,nextLevel:!0}),new i(180,"kwikclamp-752_d48",{slopes:o(12,60),slopeAdjustable:!0,structureDirection:c,previousLevel:!0,nextLevel:!1,modelRotation:d}),new i(180,"kwikclamp-752_d48",{slopes:o(12,60),slopeAdjustable:!0,structureDirection:c,previousLevel:!1,nextLevel:!0}),new i(180,"kwikclamp-752_d48",{slopes:o(12,60),slopeAdjustable:!0,structureDirection:u,previousLevel:!0,nextLevel:!1,modelRotation:d}),new i(180,"kwikclamp-752_d48",{slopes:o(12,60),slopeAdjustable:!0,structureDirection:u,previousLevel:!1,nextLevel:!0})],Y=[new i(s.terminal,"kwikclamp-752_d48",{slopes:o(-60,69),slopeAdjustable:!0,directionProcessor:a})],ee={lowerRailSleeves:[...p,...m,...y,...b,...v,..._,x],lowerRailTerminalSleeves:v,ddaLowerRailSleeves:[...f,...g,...y,...b,...v,..._,x],topRailSleeves:[...w,...R,...k,...j,...z,...q,$],topRailTerminalSleeves:z,ddaTopRailSleeves:[new i(s.line,"kwikclamp-751_d48",{slopes:o(-60,60),slopeAdjustable:!0,directionProcessor:l}),new i(180,"kwikclamp-751_d48",{slopes:o(-60,60),slopeAdjustable:!0,identityProcessor:l}),new i(s.terminal,"kwikclamp-751_d48",{slopes:o(-60,69),slopeAdjustable:!0,directionProcessor:a})],ddaWithKickplateTopRailSleeves:[...Z,...X,...Y],bikewayTopRailSleeves:[new i(s.terminal,"kwikclamp-104_d48"),new i(s.line,"kwikclamp-104_d48"),new i(s.adjustable,"kwikclamp-148_d48-with-cap",{materialNames:["aluminum","black-plastic"]})],ddaBikewayTopRailSleeves:[new i(s.line,"kwikclamp-751_d48",{slopeAdjustable:!0}),new i(s.terminal,"kwikclamp-751_d48",{slopeAdjustable:!0}),new i(s.adjustable,"kwikclamp-148_d48")],standardEndPostDTerminationLowerRailSleeves:[new i(s.terminal,"kwikclamp-119_d48")],barrierEndPostDTerminationLowerRailSleeves:[new i(s.terminal,"kwikclamp-101_d48",{modelRotation:d})]};e.exports=ee},67065:(e,t,r)=>{const n=r(6556),i=r(64840);e.exports=class KwikclampScrewLineItemsHelper{static screwLineItems(e){const t=this._screwCounts(e);return Object.keys(t).map((e=>new n(t[e],i[e])))}static _screwCounts(e){const t=i.screwCountMap;return e.reduce(((e,r)=>{const n=r.specifier().identifier(),i=t[n];if(!i)return e;const{count:s,identifier:o}=i;e[o]||(e[o]=0);const a=r.quantity();return e[o]+=s*a,e}),{})}}},85257:(e,t,r)=>{const{Rectangle:n,Circle:i,$P:s}=r(62048),{EditableProperty:o,DisplayProperties:a}=r(7340),{extend:l}=r(50988),c=r(54798),u=r(56214),d=r(20901),h=r(88646),p=r(67603),m={rectangle:"Rectangle",circle:"Circle",custom:"Custom"};class LightningBoltCrossSection extends c{constructor(e,t=!0,r=3,n=2){super(),this._label=e,this._generateFallback=t,this._fallbackWidth=r,this._fallbackHeight=n}defaultDisplayProperties(){return new p(this,[new o(this,"Cross Section Type",{type:"select",choices:this.typeChoices()}),new o(this,"Cross Section",{type:"cross-section"}),new o(this,"Width",{type:"number"}),new o(this,"Depth",{type:"number"}),new o(this,"Radius",{type:"number"})].map((e=>e.namespace(this.label()))))}showCrossSectionProperty(){return this.crossSectionType()===m.custom}showWidthProperty(){return this.crossSectionType()===m.rectangle}showDepthProperty(){return this.crossSectionType()===m.rectangle}showRadiusProperty(){return this.crossSectionType()===m.circle}crossSectionType(){return this._crossSectionType??=this.typeChoices().first().value}setCrossSectionType(e){this._crossSectionType=e,this.notifyDisplayPropertiesChangedObservers()}typeChoices(){return Object.values(m).map((e=>({value:e,label:e})))}width(){return this._width??=this.fallbackWidth()}setWidth(e){this._width=e}depth(){return this._depth??=this.fallbackHeight()}setDepth(e){this._depth=e}radius(){return this._radius??=this.fallbackWidth()}setRadius(e){this._radius=e}label(){return this._label}generateFallback(){return this._generateFallback}fallbackWidth(){return this._fallbackWidth}fallbackHeight(){return this._fallbackHeight}crossSection(){return this._crossSection??=new h}finalizedCrossSection(){if(this.crossSectionType()===m.rectangle){const e=this.width(),t=this.depth();return new h([new u(new n(-e/2,-t/2,e,t))])}if(this.crossSectionType()===m.circle){const e=this.radius();return new h([new d(new i(s(0,0),e))])}if(0===this.crossSection().pathSegments().length){if(!this.generateFallback())return;const e=this.fallbackWidth(),t=this.fallbackHeight();return new h([new u(new n(-e/2,-t/2,e,t))])}return this.crossSection()}designerSettings(e){return`new CrossSection([\n${this.finalizedCrossSection().pathSegments().map((t=>t.designerSettings(e))).join(",\n")}\n])`}designerSettingFunctions(e,t,r=!0){const n=this.finalizedCrossSection();return n&&r?[...n.pathSegments().flatMap((e=>e.designerSettingsDependentFunctions(t))),{dependencies:[{type:"lcad",name:"$P",packageName:"geometry"},{type:"class",name:"CrossSection"},...n.pathSegments().map((e=>({type:"class",name:e.constructor.name})))],name:e,type:"get",value:this.designerSettings(t)}]:[]}}LightningBoltCrossSection.TYPES=m,l(LightningBoltCrossSection,a),e.exports=LightningBoltCrossSection},21455:(e,t,r)=>{const{EditableProperty:n,DisplayProperties:i}=r(7340),{extend:s}=r(50988),{PostFasciaMountStyle:o}=r(8423),a=r(67603),l={surface:new(r(83741)),fascia:new o};class LightningBoltPostMountStyleConfigurator{constructor(e,t="in"){this._style=e,this._unit=t}style(){return this._style}unit(){return this._unit}label(){return`${this.style().label} Post Mount Style`}displayProperties(){return new a(this,[new n(this,"Offset From Edge Of Platform",{type:"unit",defaultUnit:this.unit()}),new n(this,"Post Base Offset Below Platform Surface",{type:"unit",defaultUnit:this.unit()})].map((e=>e.namespace(this.label()))))}offsetFromEdgeOfPlatform(){return this._offsetFromEdgeOfPlatform??=this.defaultOffsetFromEdgeOfPlatform()}setOffsetFromEdgeOfPlatform(e){this._offsetFromEdgeOfPlatform=e}showOffsetFromEdgeOfPlatformProperty(){return this.style()===l.surface}defaultOffsetFromEdgeOfPlatform(){return this.style().insetFromEdgeOfPlatform()}postBaseOffsetBelowPlatformSurface(){return this._postBaseOffsetBelowPlatformSurface??=this.defaultPostBaseOffsetBelowPlatformSurface()}setPostBaseOffsetBelowPlatformSurface(e){this._postBaseOffsetBelowPlatformSurface=e}showPostBaseOffsetBelowPlatformSurfaceProperty(){return this.style()===l.fascia}defaultPostBaseOffsetBelowPlatformSurface(){return this.style().postZOffset()}}s(LightningBoltPostMountStyleConfigurator,i),LightningBoltPostMountStyleConfigurator.STYLES=l,e.exports=LightningBoltPostMountStyleConfigurator},10232:(e,t,r)=>{const{Migration:n}=r(57075),i=r(52494),s=r(16856);e.exports=class UpdateWatersideRunPlacementStrategy extends n{static version(){return"20240105140659"}static classType(){return s}change(){const e=this.currentObject();"HybridSurfaceRailingPlacementStrategy"===e._placementStrategy.constructor.name&&(e._placementStrategy=new i(e))}}},76044:(e,t,r)=>{const{Migration:n}=r(57075),i=r(56858),s=r(60261);e.exports=class ConvertFalconADACompliantHandrailToADAHandrailType extends n{static version(){return"20240301152723"}static classType(){return s}change(){const e=this.currentObject();e._adaCompliantHandrails?e._adaHandrailType=i.horizontal:e._adaHandrailType=i.none,this.removeProperty("_adaCompliantHandrails")}}},84700:(e,t,r)=>{const{Migration:n}=r(57075),i=r(34330);e.exports=class UpdateDockDesignerAppProjectDeckingOption extends n{static version(){return"20240321132120"}static classType(){return i}change(){const e=this.currentObject(),t=e._deckingOption;t&&"Pressure Treated"===t.label&&(e._deckingOption=void 0)}}},37846:(e,t,r)=>{const{Migration:n}=r(57075),i=r(41456);e.exports=class ConvertHollaenderProjectColorToDataDriven extends n{static version(){return"20240712135519"}static classType(){return i}change(){const e=this.currentObject();e._railColor&&(e.colors.defaultColor=e._railColor,this.removeProperty("_railColor"))}}},95752:(e,t,r)=>{const{Migration:n}=r(57075),i=r(97477);e.exports=class RailingCollectionLegacyMigration extends n{static version(){return"00000000000001"}static classType(){return i}sourceVersion(e){return e._classVersion||1}change(){const e=this.currentObject();this.sourceVersion(e)<9&&this.migrateOppositeRailingRuns(e)}migrateOppositeRailingRuns(e){let t=e.railingRuns().slice();if(t.length<2)return;t.forEach((e=>e._oppositeRailingRun=void 0));const r=t.first(),n=e.continuousRailingRunsFor(r);if(n.length!==t.length)for(t=t.slice(n.length);t.length>0;){const r=t.first(),n=e.continuousRailingRunsFor(r),i=new e.constructor;i.applyRestorablePropertiesFromObject(e),n.forEach((t=>{e.removeRun(t),i.addRun(t)})),e.project().add(i),t=t.slice(n.length)}}}},19890:(e,t,r)=>{const{Migration:n}=r(57075),i=r(55038);e.exports=class AMPipeHoldLegacyMigration extends n{static version(){return"00000000000002"}static classType(){return i}sourceVersion(e){return e._classVersion||1}change(){const e=this.currentObject();if(this.sourceVersion(e)<2){const t=e._type;e._type=t.replace("am-docks-","").toUpperCase()}}}},56431:(e,t,r)=>{const{Migration:n}=r(57075),i=r(46618);e.exports=class AMSteelTrussDockLegacyMigration extends n{static version(){return"00000000000003"}static classType(){return i}sourceVersion(e){return e._classVersion||1}change(){const e=this.currentObject();if(this.sourceVersion(e)<2){const t=-e._defaultHeight().toNumeric(e.unit())-e.locator().z();e.geometry().moveBy(0,0,t)}}}},56545:(e,t,r)=>{const{Migration:n}=r(57075),i=r(33735);e.exports=class AMSteelTrussDockSectionLegacyMigration extends n{static version(){return"00000000000004"}static classType(){return i}sourceVersion(e){return e._classVersion||1}change(){const e=this.currentObject();if(this.sourceVersion(e)<2){const t=-e._defaultHeight().toNumeric(e.unit())-e.locator().z();e.geometry().moveBy(0,0,t)}}}},21680:(e,t,r)=>{const{Migration:n}=r(57075),i=r(9649);e.exports=class AMWoodDockLegacyMigration extends n{static version(){return"00000000000005"}static classType(){return i}sourceVersion(e){return e._classVersion||1}change(){const e=this.currentObject();this.sourceVersion(e)<9&&e.updateConnections()}}},86370:(e,t,r)=>{const{Migration:n}=r(57075),i=r(19820);e.exports=class CoastalPierBoathouseLegacyMigration extends n{static version(){return"00000000000006"}static classType(){return i}sourceVersion(e){return e._classVersion||1}change(){const e=this.currentObject();this.sourceVersion(e)<9&&(e._snappedDocks=[e._snappedDock].filter((e=>e)),this.removeProperty("_snappedDock"))}}},9131:(e,t,r)=>{const{Migration:n}=r(57075),i=r(28564);e.exports=class RoofMaterialLegacyMigration extends n{static version(){return"00000000000007"}static classType(){return i}sourceVersion(e){return e._classVersion||1}change(){const e=this.currentObject();this.sourceVersion(e)<2&&this.renameProperty("_specifier","_materialSpecifier")}}},98595:(e,t,r)=>{const{Migration:n}=r(57075),i=r(79851);e.exports=class AbstractGangwayLegacyMigration extends n{static version(){return"00000000000008"}static classType(){return i}sourceVersion(e){return e._classVersion||1}change(){const e=this.currentObject();this.sourceVersion(e)<2&&this.renameProperty("_anchorPlatform","_attachedFrame"),this.sourceVersion(e)<3&&this.renameProperty("_attachedFrame","_upperFrame")}}},37426:(e,t,r)=>{const{Migration:n}=r(57075),i=r(21373);e.exports=class DeckingOptionLegacyMigration extends n{static version(){return"00000000000009"}static classType(){return i}sourceVersion(e){return e._classVersion||1}change(){const e=this.currentObject();this.sourceVersion(e)<2&&this.renameProperty("_price","_unitPrice")}}},743:(e,t,r)=>{const{Migration:n}=r(57075),i=r(37528);e.exports=class DefaultDockFramerLegacyMigration extends n{static version(){return"00000000000010"}static classType(){return i}sourceVersion(e){return e._classVersion||1}change(){const e=this.currentObject();this.sourceVersion(e)<2&&this.renameProperty("_dock","_frame")}}},15048:(e,t,r)=>{const{Migration:n}=r(57075),i=r(91211),s=r(7524);e.exports=class DockDesignerProjectLegacyMigration extends n{static version(){return"00000000000011"}static classType(){return s}sourceVersion(e){return e._classVersion||1}change(){const e=this.currentObject();this.sourceVersion(e)<2&&this.migrateToV2(e),this.sourceVersion(e)<3&&this.migrateToV3(e)}migrateToV2(e){const t=e.bank();if("Fixed Dock"===t.type()){t._fixedDocks.forEach((t=>{e.add(t),t._posts=void 0})),t.setType("Steep Entry"),t._fixedDocks=void 0}}migrateToV3(e){const t=e.systemStrategy();e.docks().filter((t=>!e.existingDocks().includes(t))).slice().forEach((r=>{let n;if(r._strategy){n=r._strategy.dockClass()}else n=t.dockClass();const s=n.builder(e).referencePoint(r.referencePoint()).build();if(s.setAngle(r.angle()),!(r instanceof i)){const e=r.geometry().snapshot().relatedTo(s.referencePoint());s.setGeometry(e)}e.remove(r),e.add(s)}))}}},92098:(e,t,r)=>{const{Migration:n}=r(57075),i=r(83102);e.exports=class ThunderCloudComponentLegacyMigration extends n{static version(){return"00000000000012"}static classType(){return i}sourceVersion(e){return e._classVersion||1}change(){const e=this.currentObject();this.sourceVersion(e)<8&&this.removeProperty("_systemStrategy")}}},76747:(e,t,r)=>{const{Migration:n}=r(57075),i=r(73164);e.exports=class ThunderCloudProjectLegacyMigration extends n{static version(){return"00000000000013"}static classType(){return i}sourceVersion(e){return e._classVersion||1}change(){const e=this.currentObject();this.sourceVersion(e)<4&&this.removeProperty("_systemStrategy"),this.sourceVersion(e)<7&&this.removeProperty("_priceList")}}},27455:(e,t,r)=>{const{Migration:n}=r(57075),i=r(36941);e.exports=class FalconFramedGlassRailingStyleLegacyMigration extends n{static version(){return"00000000000014"}static classType(){return i}sourceVersion(e){return e._classVersion||1}change(){const e=this.currentObject();this.sourceVersion(e)<4&&this.removeProperty("_supportedGlassThicknesses")}}},92341:(e,t,r)=>{const{Migration:n}=r(57075),i=r(97807);e.exports=class FalconGlassRailingSectionLegacyMigration extends n{static version(){return"00000000000015"}static classType(){return i}sourceVersion(e){return e._classVersion||1}change(){const e=this.currentObject();this.sourceVersion(e)<2&&e._glassThicknessOption&&(e._glassThicknessOption=e._glassThicknessOption.identifier().replace("Glass",""))}}},13018:(e,t,r)=>{const{Migration:n}=r(57075),i=r(78924);e.exports=class FalconGlassRailingStyleLegacyMigration extends n{static version(){return"00000000000016"}static classType(){return i}sourceVersion(e){return e._classVersion||1}change(){const e=this.currentObject();this.sourceVersion(e)<4&&this.removeProperty("_supportedGlassThicknesses")}}},44670:(e,t,r)=>{const n=r(63768),{Migration:i}=r(57075),s=r(43320),o=r(46651),a=r(60261),l=r(46748);e.exports=class FalconRailingCollectionLegacyMigration extends i{static version(){return"00000000000017"}static classType(){return a}sourceVersion(e){return e._classVersion||1}change(){const e=this.currentObject();this.sourceVersion(e)<2&&this.migrateToV2(e),this.sourceVersion(e)<3&&this.migrateToV3(e),this.sourceVersion(e)<4&&this.migrateToV4(e),this.sourceVersion(e)<5&&this.migrateToV5(e),this.sourceVersion(e)<6&&this.migrateToV6(e),this.sourceVersion(e)<7&&this.migrateToV7(e)}migrateToV2(e){switch(e._railingStyle){case"PostToTopOfGlass":e._railingStyle={_styleId:"post-to-top"};break;case"PostBelowTopOfglass":e._railingStyle={_styleId:"post-below-top"};break;case"Infinity":e._railingStyle=e.railingStyles().infinity}}migrateToV3(e){const t=[n.unit(30,"in"),n.unit(33,"in"),n.unit(36,"in"),n.unit(42,"in")],r=e._railingHeight;switch(e._railingStyle._styleId){case"post-to-top":e._railingStyle=e.railingStyles().standardGlass,e._postHeight=t.reduce(((e,t)=>n.abs(l`${t} - ${r}`)<n.abs(l`${e} - ${r}`)?t:e));break;case"post-below-top":e._railingStyle=e.railingStyles().standardGlass,e._postHeight=r.equals(n.unit(36,"in"))?n.unit(30,"in"):n.unit(36,"in");break;case"infinity":e._railingStyle=e.railingStyles().infinity,e._postHeight=n.unit(24,"in")}}migrateToV4(e){const t=e=>{if(e)return new s(e._colorName,e._materialName,e._fillStyle,e._strokeStyle)};e._postColor=t(e._postColor),e._handrailColor=t(e._handrailColor)}migrateToV5(e){e._fasciaMounted&&e.setPostMountStyle(new o),this.removeProperty("_fasciaMounted")}migrateToV6(e){const t=e._railingStyle._styleId.replace(/-([a-z])/gi,(e=>e[1].toUpperCase())),r=e.railingStyles()[t];r.copyPropertiesFromStyle(e._railingStyle),e._railingStyle=r;const n=e._glassThickness.identifier?e._glassThickness.identifier().replace("Glass",""):e._glassThickness;r.setGlassThickness(n),this.removeProperty("_glassThickness"),r.setHasTopGuard(e._hasTopGuard),this.removeProperty("_hasTopGuard"),r.setHasSecondGuard(e._hasSecondGuard),this.removeProperty("_hasSecondGuard")}migrateToV7(e){e._useMixedWidthPosts=!1}}},25794:(e,t,r)=>{const n=r(63768),{Migration:i}=r(57075),s=r(28184),o=r(39662),a=r(68401);e.exports=class FalconRailingRunLegacyMigration extends i{static version(){return"00000000000018"}static classType(){return s}sourceVersion(e){return e._classVersion||1}change(){const e=this.currentObject();this.sourceVersion(e)<2&&this.migrateToV2(e),this.sourceVersion(e)<3&&this.migrateToV3(e),this.sourceVersion(e)<9&&this.migrateToV9(e),this.sourceVersion(e)<10&&this.migrateToV10(e)}migrateToV2(e){const t=o.capitalized(e._handrail);e._handrailStyle=a[t],this.removeProperty("_handrail")}migrateToV3(e){this.removeProperty("_sections")}migrateToV9(e){const t=e._handrailStyle;e.sections().forEach((e=>e.setHandrailStyle(t)))}migrateToV10(e){e.sections().forEach((t=>{if(t.sloped())return;const r=t.edge().length(),i=r+(r-t.componentLayoutEdge().length()),s=n.unit(i,t.unit());e.setSectionLength(t,s)}))}}},49677:(e,t,r)=>{const{Migration:n}=r(57075),i=r(43449);e.exports=class FalconRailingSectionLegacyMigration extends n{static version(){return"00000000000019"}static classType(){return i}sourceVersion(e){return e._classVersion||1}change(){const e=this.currentObject();this.sourceVersion(e)<9&&this.removeProperty("_heightAnnotations")}}},22150:(e,t,r)=>{const{Migration:n}=r(57075),i=r(88367),s=r(56768);e.exports=class FalconRailingsProjectLegacyMigration extends n{static version(){return"00000000000020"}static classType(){return i}sourceVersion(e){return e._classVersion||1}change(){const e=this.currentObject();this.sourceVersion(e)<5&&this.migrateToV5(e),this.sourceVersion(e)<6&&this.migrateToV6(e)}migrateToV5(e){const t="FreeFloatingDimensionAnnotation",r=e.parts().filter((e=>e.constructor.name===t)),n=e.parts().filter((e=>e.constructor.name!==t)),i=r.map((t=>{const r=t.edge(),n=new s(r.begin(),"in",{formatWithFeet:!0,fractionDenominator:8});return n.setEnd(r.end()),n.setComponentOf(e),n}));e._parts=[...n,...i]}migrateToV6(e){const t=e._miscInvoiceAmount;if(this.removeProperty("_miscInvoiceAmount"),0!==t){e.addAdditionalLineItem();const r=e.additionalLineItemComponents().last();r.setName("Miscellaneous"),r.setAmount(t)}}}},75970:(e,t,r)=>{const{Migration:n}=r(57075),i=r(27424);e.exports=class FalconRailingStyleLegacyMigration extends n{static version(){return"00000000000021"}static classType(){return i}sourceVersion(e){return e._classVersion||1}change(){const e=this.currentObject();this.sourceVersion(e)<2&&this.removeProperty("_postHeightStrategy"),this.sourceVersion(e)<3&&(this.removeProperty("_supportedRailingHeights"),this.removeProperty("_supportedPostStyles"),this.removeProperty("_supportedPostHeights"),this.removeProperty("_supportedPostWidths"))}}},59560:(e,t,r)=>{const n=r(63768),{Migration:i}=r(57075),s=r(58773);e.exports=class KandSRailingPlacementStrategyLegacyMigration extends i{static version(){return"00000000000022"}static classType(){return s}sourceVersion(e){return e._classVersion||1}change(){const e=this.currentObject();if(this.sourceVersion(e)<2){const t=e.railingRun().edge(),r=n.unit(Math.abs(t.begin().z()-t.end().z()),e.unit()),i=n.unit(t.xy().length(),e.unit()),s=n.divide(r,i),o=n.atan(s),a=n.round(o.radiansToDegrees(),2);e._slope=n.unit(a,"deg"),this.removeProperty("_stairRiserCount")}}}},71598:(e,t,r)=>{const{Migration:n}=r(57075),i=r(38313);e.exports=class OasisBoatDocksProjectLegacyMigration extends n{static version(){return"00000000000023"}static classType(){return i}sourceVersion(e){return e._classVersion||1}change(){const e=this.currentObject();this.sourceVersion(e)<8&&(this.renameProperty("_flashingColor","_roofFlashingColor"),this.renameProperty("_roofingColor","_roofSurfaceColor"))}}},67709:(e,t,r)=>{const{Migration:n}=r(57075),i=r(12379);e.exports=class OasisDockSlipLegacyMigration extends n{static version(){return"00000000000024"}static classType(){return i}sourceVersion(e){return e._classVersion||1}change(){const e=this.currentObject();this.sourceVersion(e)<9&&(e._parallelLiftShaft??=!0)}}},4880:(e,t,r)=>{const{Migration:n}=r(57075),i=r(45708);e.exports=class StairSurfaceRailingPlacementStrategyLegacyMigration extends n{static version(){return"00000000000025"}static classType(){return i}sourceVersion(e){return e._classVersion||1}change(){const e=this.currentObject();this.sourceVersion(e)<2&&(this.renameProperty("_rise","_stepRise"),this.renameProperty("_run","_stepRun"))}}},84402:(e,t,r)=>{const{Migration:n}=r(57075),i=r(27878);e.exports=class CityPostCollectionLegacyMigration extends n{static version(){return"00000000000026"}static classType(){return i}sourceVersion(e){return e._classVersion||1}change(){const e=this.currentObject();this.sourceVersion(e)<9&&this.migrateToV9(e),this.sourceVersion(e)<10&&this.migrateToV10(e),this.sourceVersion(e)<11&&this.migrateToV11(e)}migrateToV9(e){const t=e._railingRuns;this.removeProperty("_railingRuns"),t.forEach((t=>{const r=e.createRun(t.edge(),t.placementStrategy());e.addRun(r)}))}migrateToV10(e){this.renameProperty("_isADACompliant","_isIRCCompliant")}migrateToV11(e){e._railingMaterial&&(e._railingMaterial.includes("Zinc")?e._railingMaterial="Zinc":e._railingMaterial="Stainless Steel")}}},67637:(e,t,r)=>{const{Migration:n}=r(57075),i=r(32487);e.exports=class OmegaGuardrailSectionLegacyMigration extends n{static version(){return"00000000000027"}static classType(){return i}sourceVersion(e){return e._classVersion||1}change(){const e=this.currentObject();this.sourceVersion(e)<10&&this.removeProperty("_wrapAroundFlairs")}}},79423:(e,t,r)=>{const{Migration:n}=r(57075),i=r(44246);e.exports=class OmegaProjectLegacyMigration extends n{static version(){return"00000000000028"}static classType(){return i}sourceVersion(e){return e._classVersion||1}change(){const e=this.currentObject();this.sourceVersion(e)<5&&this.removeProperty("_displayedAnnotations")}}},75786:(e,t,r)=>{const{Migration:n}=r(57075),i=r(17163);e.exports=class OmegaRailingCollectionLegacyMigration extends n{static version(){return"00000000000029"}static classType(){return i}sourceVersion(e){return e._classVersion||1}change(){const e=this.currentObject();this.sourceVersion(e)<2&&this.migrateToV2(e),this.sourceVersion(e)<9&&this.migrateToV9(e),this.sourceVersion(e)<10&&this.migrateToV10(e)}migrateToV2(e){const t=e.postDescriptorOptions(),r=e._postDescriptor.postHeight();e._postDescriptor=t.find((e=>e.value.postHeight().equals(r))).value}migrateToV9(e){const t=e._railColor,r=e.railColorOptions().find((e=>e.equals(t)));e._railColor=r}migrateToV10(e){this.renameProperty("_wrapAroundFlairs","_wrapAroundFlares")}}},27356:(e,t,r)=>{const{Migration:n}=r(57075),i=r(57674);e.exports=class RogueFabricatorsRailingCollectionLegacyMigration extends n{static version(){return"00000000000030"}static classType(){return i}sourceVersion(e){return e._classVersion||1}change(){const e=this.currentObject();if(this.sourceVersion(e)<10){const t=e._railingColor;e._railingColor=e.railingColorChoices().find((e=>e.equals(t)))}}}},67474:(e,t,r)=>{const{Migration:n}=r(57075),i=r(46353);e.exports=class RogueFabricatorsColosseumRailingStyleLegacyMigration extends n{static version(){return"00000000000031"}static classType(){return i}sourceVersion(e){return e._classVersion||1}change(){const e=this.currentObject();this.sourceVersion(e)<2&&(e._styleId="colosseum")}}},44606:(e,t,r)=>{const{Migration:n}=r(57075),i=r(46353);e.exports=class RogueFabricatorsOrionRailingStyleLegacyMigration extends n{static version(){return"00000000000032"}static classType(){return i}sourceVersion(e){return e._classVersion||1}change(){const e=this.currentObject();this.sourceVersion(e)<2&&(e._styleId="orion")}}},19150:(e,t,r)=>{const{Migration:n}=r(57075),i=r(72768);e.exports=class RogueFabricatorsRailingSectionLegacyMigration extends n{static version(){return"00000000000033"}static classType(){return i}sourceVersion(e){return e._classVersion||1}change(){const e=this.currentObject();this.sourceVersion(e)<9&&this.removeProperty("_wallReturns")}}},98723:(e,t,r)=>{const n=r(1776),i=r(12379),s=r(13303);class OasisDockSlipBuilder{constructor(e){this._unitProvider=e,this._width=i.defaultWidth(),this._length=i.defaultLength()}newGeometryStrategy(){const e=this._unitProvider.unit(),t=this._width.toNumeric(e),r=this._length.toNumeric(e);return new n(t,r)}build(){const e=this.newGeometryStrategy();return new i(e,this._referencePoint)}}s(OasisDockSlipBuilder,["width","length","referencePoint"]),e.exports=OasisDockSlipBuilder},33530:(e,t,r)=>{const n=r(45492),i=r(13303);class OasisFlashingBuilder{constructor(e){this._unitProvider=e}build(){return new n(this._beginLocator,this._endLocator,this._materialSpecifier,this._offsetFromCenter,this._planarNormal,this._angle)}}i(OasisFlashingBuilder,["beginLocator","endLocator","materialSpecifier","offsetFromCenter","planarNormal","materialName","angle"]),e.exports=OasisFlashingBuilder},38313:(e,t,r)=>{const n=r(63768),{EditableProperty:i}=r(7340),{extend:s}=r(50988),o=r(87960),a=r(7524),l=r(25830),c=r(60998),u=r(94263),d=r(8519),h=r(26686),p=r(67603),m=r(55093),f=r(42947),g=r(83265);class OasisBoatDocksProject extends a{includeDeckingBand(){return this._includeDeckingBand??=!1}toggleIncludeDeckingBand(){this.setIncludeDeckingBand(!this.includeDeckingBand())}setIncludeDeckingBand(e){this._includeDeckingBand=e,this._explicitBandDeckingOption=void 0,this.resetDecking(),this.notifyDisplayPropertiesChangedObservers()}explicitBandDeckingOption(){return this._explicitBandDeckingOption}setExplicitBandDeckingOption(e){this._explicitBandDeckingOption=e,this.resetDecking()}showExplicitBandDeckingOptionProperty(){return this.includeDeckingBand()}deckingBandOptionChoices(){return[{label:"Same as Decking",value:void 0},...this.deckingOptions()]}bandDeckingOption(){return this.explicitBandDeckingOption()??this.deckingOption()}resetDecking(){this.docks().forEach((e=>{e.surface().resetComponents()}))}defaultDisplayProperties(){return new p(this,[...super.defaultDisplayProperties(),...this.roofColorProperties(),new i(this,"Steel Color",{type:"color"}),new i(this,"Paint Fascia Boards",{type:"boolean"}),new i(this,"Dock Fascia Color",{type:"color"}),new i(this,"Include Decking Band",{type:"boolean"}),new i(this,"Explicit Band Decking Option",{type:"select",label:"Band Decking Option",choices:this.deckingBandOptionChoices()})])}get materials(){return g}_defaultRoofFlashingColor(){return"#aaaaaa"}_defaultRoofSurfaceColor(){return this.materials.RPANEL.details().color}steelColor(){return this._steelColor??=this._defaultSteelColor()}_defaultSteelColor(){return"#aaaaaa"}setSteelColor(e){this._steelColor=e}paintFasciaBoards(){return this._paintFasciaBoards??=!1}togglePaintFasciaBoards(){this.setPaintFasciaBoards(!this.paintFasciaBoards())}setPaintFasciaBoards(e){this._paintFasciaBoards=e,this.notifyDisplayPropertiesChangedObservers()}dockFasciaColor(){return this.paintFasciaBoards()?this._dockFasciaColor??=this._defaultDockFasciaColor():void 0}_defaultDockFasciaColor(){return"#000000"}setDockFasciaColor(e){this._dockFasciaColor=e}showDockFasciaColorProperty(){return this.paintFasciaBoards()}_materialLineItemProcessors(){return[new m("in"),new m("sqft"),new o([this.materials.LIFT_CABLE14,this.materials.LIFT_CABLE316,this.materials.RAILING_CABLE]),new d]}pileLaborPriceProperty(){return this._pileLaborPriceProperty??=new i(this,"Pile Labor Price",{type:"number"})}pileLaborPrice(){return this._pileLaborPrice??this.priceForMaterial(this._pileLaborMaterial())}setPileLaborPrice(e){this._pileLaborPrice=e}_pileLaborMaterial(){return this.materials.PILE_LABOR}cradleLaborPriceProperty(){return this._cradleLaborPriceProperty??=new i(this,"Cradle Labor Price",{type:"number"})}cradleLaborPrice(){return this._cradleLaborPrice??this.priceForMaterial(this._cradleLaborMaterial())}setCradleLaborPrice(e){this._cradleLaborPrice=e}_cradleLaborMaterial(){return this.materials.CRADLE_LABOR}deckingLaborPriceProperty(){return this._deckingLaborPriceProperty??=new i(this,"Decking Labor Price",{type:"number"})}deckingLaborPrice(){return this._deckingLaborPrice??this.priceForMaterial(this._deckingLaborMaterial())}setDeckingLaborPrice(e){this._deckingLaborPrice=e}_deckingLaborMaterial(){return this.materials.DECKING_LABOR}roofingLaborPriceProperty(){return this._roofingLaborPriceProperty??=new i(this,"Roofing Labor Price",{type:"number"})}roofingLaborPrice(){return this._roofingLaborPrice??this.priceForMaterial(this._roofingLaborMaterial())}setRoofingLaborPrice(e){this._roofingLaborPrice=e}_roofingLaborMaterial(){return this.materials.ROOFING_LABOR}quotableDocks(){return this.docks().filter((e=>!e.isExisting()))}editableMaterialLineItems(){const e=this.quotableDocks().flatMap((e=>e.slips().filter((e=>e.includeInLaborCosts())))).length;return[u.builder(this._pileLaborMaterial()).propertiesCollection({[f.unitPrice]:this.pileLaborPriceProperty()}).quantity(this.quotableDocks().sum((e=>e.posts().length))).build(),u.builder(this._cradleLaborMaterial()).propertiesCollection({[f.unitPrice]:this.cradleLaborPriceProperty()}).quantity(e).build(),u.builder(this._deckingLaborMaterial()).propertiesCollection({[f.unitPrice]:this.deckingLaborPriceProperty()}).quantity(this._totalDeckingSQFT()).unit("sqft").build(),u.builder(this._roofingLaborMaterial()).propertiesCollection({[f.unitPrice]:this.roofingLaborPriceProperty()}).quantity(this._totalRoofingSQFT()).unit("sqft").build(),...super.editableMaterialLineItems()]}measurementSnapEdges(){return[...this.parts().flatMap((e=>e.edges?.()??[])),...this.docks().flatMap((e=>e.slips().flatMap((e=>e.edges())))),...this.docks().flatMap((e=>e.framingLevels().flatMap((e=>e.edges()))))]}_totalDeckingSQFT(){return n.unit(this.quotableDocks().sum((e=>e.deckingShape().area())),`${this.unit()}^2`).toNumeric("sqft").rounded()}_totalRoofingSQFT(){return n.unit(this.quotableDocks().sum((e=>e.framingLevels().sum((e=>e.area())))),`${this.unit()}^2`).toNumeric("sqft").rounded()}railingCollectionClass(){return h}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_pileLaborPriceProperty","_cradleLaborPriceProperty","_deckingLaborPriceProperty","_roofingLaborPriceProperty"]}logo(){return"oasis-boat-docks-logo.png"}watermarkLogo(){return"oasis-boat-docks-watermark.png"}pdfDocumentClass(){return OasisPDFDocument}}s(OasisBoatDocksProject,c),s(OasisBoatDocksProject,l),e.exports=OasisBoatDocksProject},48089:(e,t,r)=>{const n=r(81925),i=r(13998),s=r(94828);e.exports=class OasisBoatLift extends n{static type(){return"Ski/Wake Boat"}_defaultFramer(){return new s(this)}_defaultFramingDescriptor(){return new i(this)}components(){return[...super.components(),...this.bunks()]}}},94828:(e,t,r)=>{const n=r(75672),i=r(20160);e.exports=class OasisBoatLiftFramer extends i{bunkOffset(){return this.framingDescriptor().bunkOffset()}spanBetweenBunks(){return this.framingDescriptor().spanBetweenBunks()}makeBunks(){const e=this._supportEdges(),t=this.spanBetweenBunks().toNumeric(this._unit()),r=[this.spanAcrossEdgesProportionallyAt(.5,e).shiftedAlongNormalBy(-t/2),this.spanAcrossEdgesProportionallyAt(.5,e).reversed().shiftedAlongNormalBy(-t/2)],i=this.bunkOffset();return this.offsetHelper().applyOffsetToEdges(r,i).map((e=>{const t=new n(e.begin(),e.end());return t.setComponentOf(this.frame()),t}))}}},74916:(e,t,r)=>{const n=r(57473),i=r(18734);e.exports=class OasisBoatLiftMotor extends n{constructor(e,t){super(e,void 0,t)}_modelIdentifier(){return"oasis-lift-motor"}defaultFigure(){return new i(this)}}},32847:(e,t,r)=>{const n=r(63768),i=r(18427),s=r(70801),o=r(82526);e.exports=class OasisBoxCradleLift extends i{_defaultFramer(){return new s(this)}_defaultFramingDescriptor(){return new o(this)}cradleInsetForEnds(){return n.unit(2,"ft")}cradleInsetForSides(){return n.unit(1,"ft")}perimeterFraming(){return this._perimeterFraming??=this.framer.makePerimeterFraming()}crossFraming(){return this._crossFraming??=this.framer.makeCrossFraming()}attachmentGeometry(){return this.framer.attachmentGeometry()}components(){return[...this.perimeterFraming(),...this.crossFraming()]}attachmentPoints(){return this.framer.attachmentPoints()}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_perimeterFraming","_crossFraming","_framer","_framingDescriptor"]}}},75672:(e,t,r)=>{const{CompositeFigure:n}=r(7340),{Composite3DFigure:i}=r(37732),{$P:s}=r(62048),o=r(83465),a=r(83102);e.exports=class OasisBunk extends a{constructor(e,t){super(),this._begin=e,this._end=t}begin(){return this._begin}end(){return this._end}edge(){return this.begin().to(this.end())}supportSpecifier(){return this.materials.PT2x8}boatRestSpecifier(){return this.deckingOption().materialSpecifier()}deckingOptionProvider(){return this.componentOf()?.deckingOptionProvider()}deckingOption(){return this.deckingOptionProvider()?.deckingOption()}supports(){return this._supports??=this._defaultSupports()}_defaultSupports(){const e=this.supportSpecifier().details().width.toNumeric(this.unit())/2,t=this.supportSpecifier().details().depth.toNumeric(this.unit())/2,r=this.edge(),n=this.supportSpecifier();return[this._createBoard(r,n,r.normal(),s(-t,e),"pressure-treated"),this._createBoard(r,n,r.normal(),s(-t,-e),"pressure-treated")]}boatRest(){return this._boatRest??=this._defaultBoatRest()}_defaultBoatRest(){const e=this.supportSpecifier().details().depth.toNumeric(this.unit()),t=this.edge().addZ(-e),r=t.normal().rotatedBy(s(0,0),0,Math.PI/3);return this._createBoard(t,this.boatRestSpecifier(),r)}_createBoard(e,t,r,n=s(0,0),i=void 0){const a=o.builder(this).beginLocator(e.begin()).endLocator(e.end()).materialSpecifier(t).offsetFromCenter(n).planarNormal(r).materialName(i).build();return a.setComponentOf(this),a}components(){return[this.boatRest(),...this.supports()]}defaultFigure(){return n.withModel(this)}threeFigure(){return i.withModel(this)}}},82526:(e,t,r)=>{const n=r(63768),i=r(13998);e.exports=class OasisCradleFramingDescriptor extends i{attachmentPointsOffset(){const e=this.materialWidth(this.framingSpecifier()),t=n.unit(1,"ft").toNumeric(this.unit());return this.framingOffset().add(-t,-e/2)}framingEndInset(){return this.frame().cradleInsetForEnds().toNumeric(this.unit())}}},70801:(e,t,r)=>{const{$P:n}=r(62048),i=r(73399),s=r(11464);e.exports=class OasisCradleLiftFramer extends i{framingSpecifier(){return this.framingDescriptor().framingSpecifier()}framingOffset(){return this.framingDescriptor().framingOffset()}attachmentPointsOffset(){return this.framingDescriptor().attachmentPointsOffset()}makePerimeterFraming(){const e=this.frame(),t=this.framingSpecifier(),r=this.offsetHelper().applyOffsetToGeometry(e.slip().geometry(),this.framingOffset()).edges(),i=this.materialWidth(t),o=this.materialDepth(t);return r.map((e=>this._createMaterial(s,e,t,n(-o/2,i/2),e.normal().negated())))}makeCrossFraming(){const e=this.frame(),t=this.framingSpecifier(),r=this.offsetHelper().applyOffsetToEdges(e.slip().sideEdges(),this.framingOffset()),i=this.materialDepth(t);return this.proportionallySpaceAlongEdges(r,1/3,!1).map((e=>this._createMaterial(s,e,t,n(-i/2,0),e.normal().negated())))}attachmentPoints(){return this.attachmentGeometry().vertices()}attachmentGeometry(){const e=this.frame().slip().geometry(),t=this.attachmentPointsOffset();return this.offsetHelper().applyOffsetToGeometry(e,t)}}},79752:(e,t,r)=>{const{$P:n,Polygon:i,Angle:s}=r(62048),o=r(10493),a=r(83465),l=r(30691),c=r(76133);e.exports=class OasisDeckingSurface extends o{deckingShape(){const e=super.deckingShape();if(this.includeSkirtBoards()){const t=this.materialSpecifier().details().depth.toNumeric(this.unit());let r=c.stretchedBy(e,-2*t);return this.frame().edges().flatMap((e=>this.frame().connectionEdgesOn(e).map((e=>{const r=e.stretchedBy(-2*t),n=r.shiftedAlongNormalBy(-t);return new i([r.begin(),r.end(),n.end(),n.begin()])})))).forEach((e=>{r=r.union(e).first()})),r}return e}includeSkirtBoards(){return this.frame().includeDeckingBand()}defaultSkirtBoards(){if(!this.includeSkirtBoards())return[];const e=this._skirtBoardSpecifier(),t=e.details().width.toNumeric(this.unit()),r=e.details().depth.toNumeric(this.unit()),s=this.frame().geometry().normal(),o=this._skirtBoardEdges();return o.map((e=>{const a=e.stretchedBy(2*r).relativeTo(this.frame().referencePoint()),l=this._createSkirtBoard(a,n(r/2,t/2),s),c=new i([e.begin(),this._miterLocatorFor(e.begin(),o),this._miterLocatorFor(e.end(),o),e.end()]);return l.setShape(c),l}))}_skirtBoardEdges(){const e=this._skirtBoardSpecifier().details().depth.toNumeric(this.unit());return this.frame().deckingShape().edges().flatMap((t=>{const r=this.frame().connectionEdgesOn(t);if(r.some((e=>e.equals(t))))return[];const n=r.map((t=>t.stretchedBy(-2*e)));return l.subtractSegmentsFromEdge(t,n)}))}_createSkirtBoard(e,t,r){const n=a.builder(this).beginLocator(e.begin()).endLocator(e.end()).materialSpecifier(this._skirtBoardSpecifier()).offsetFromCenter(t).planarNormal(r).deckingOption(this.frame().bandDeckingOption()).build();return n.setComponentOf(this),n}_miterLocatorFor(e,t){const r=this._skirtBoardSpecifier().details().depth.toNumeric(this.unit()),[i,o]=t.filter((t=>t.containsPoint(e))),a=o?i.normal().add(o.normal()).normalized():i.normal(),l=o?new s(n(0,0),i.normal(),o.normal()).smallestDeltaRadians()/2:0,c=r/Math.cos(l),u=a.multipliedBy(-c);return e.add(u)}_skirtBoardSpecifier(){return this.frame().bandDeckingOption().materialSpecifier()}}},53405:(e,t,r)=>{const n=r(63768),{EditableProperty:i}=r(7340),{extend:s}=r(50988),o=r(43775),a=r(87991),l=r(26716),c=r(32398),u=r(6364),d=r(16461),h=r(30691),p=r(57129),m=r(79752),f=r(46801),g=r(65115),y=r(74411),b=r(76133),v=r(17043),_=r(81620),x=r(83724),w=r(23981);class OasisDock extends l{static defaultWidth(){return n.unit(30,"ft")}static defaultLength(){return n.unit(30,"ft")}static minimumSize(){return n.unit(2,"ft")}static iconName(){return"standard-dock"}static minimumWalkwayWidth(){return this.minimumSize()}minimumSpan(){return this.constructor.minimumSize().toNumeric(this.unit())}_defaultHeight(){return n.unit(2,"ft")}defaultDisplayProperties(){return[...super.defaultDisplayProperties(),new i(this,"Width",{type:"unit",defaultUnit:"ft"}),new i(this,"Length",{type:"unit",defaultUnit:"ft"}),this.railingEdgeMapProperty(),new i(this,"Is Existing",{type:"boolean",label:"Preexisting?"})]}railingEdgeShape(){return this.deckingShape()}validateWidth(e,t){if(!e)return;const r=this.constructor.minimumSize();return n.smaller(t,r)?`must be larger than ${r.toString()}`:void 0}validateLength(e,t){if(!e)return;const r=this.constructor.minimumSize();return n.smaller(t,r)?`must be larger than ${r.toString()}`:void 0}includeDeckingBand(){return this.componentOf().includeDeckingBand()}bandDeckingOption(){return this.componentOf().bandDeckingOption()}deckingOptionChanged(){this.surface().resetComponents(),this.slips().forEach((e=>e.resetComponents()))}_defaultFramingDescriptor(){return new y(this)}_defaultFramer(){return new g(this)}posts(){return this._posts??=this.dockFramer().makePosts()}joists(){return this._joists??=this.dockFramer().makeJoists()}channel(){return this._channel??=this.dockFramer().makeSplitPileCaps()}postHeaders(){return this._postHeaders??=this.dockFramer().makePostHeaders()}joistHeaders(){return this._joistHeaders??=this.dockFramer().makeHeaders()}slipPerimeterBoards(){return this._slipPerimeterBoards??=this.dockFramer().makeSlipPerimeterBoards()}crossHeaders(){return this._crossHeaders??=this.dockFramer().makeCrossHeaders()}blocking(){return this._blocking??=this.dockFramer().makeBlocking()}resetComponents(){super.resetComponents(),this._posts=void 0,this._joists=void 0,this._channel=void 0,this._postHeaders=void 0,this._joistHeaders=void 0,this._slipPerimeterBoards=void 0,this._crossHeaders=void 0,this._blocking=void 0,this._channelPlateLineItems=void 0,this.slips().forEach((e=>e.resetComponents())),this._annotations=void 0,this.project()?.recalculateRailings(),this.updateRailingMapProperty(),this.updateOverriddenPostRows()}updateOverriddenPostRows(){this.dockFramer().adjustablePostEdges().map((e=>{const t=this.overriddenPostRows().find((t=>t.edge().overlapsBySignificantDistance(e)));t?.setEdge(e)}))}frameResized({fromSetter:e=!1}={}){e?(super.frameResized({fromSetter:e}),this.updateConnections()):this.updateDisplayProperties()}resizingFinished(){this.frameResized({fromSetter:!0})}angleChanged(e,t){super.angleChanged(e,t),this.updateFramingLevelAngles(e,t),this.slips().forEach((r=>r.angleChanged(e,t))),this.updateConnections(),this.resetComponents(),this.accessories().forEach((e=>e.locatorSourceChanged()))}delete(){const e=this.componentOf();this.connections().forEach((e=>e.delete())),super.delete(),e.recalculateRailings()}supportPosts(){return this.posts().filter((e=>this.framingLevels().some((t=>t.roof().geometry().containsPoint(e.locator())))&&e.isRoofSupport()))}_afterFramingLevelAdded(e){this.slips().forEach((e=>e.updateCradle()))}isExisting(){return this._isExisting??=!1}setIsExisting(e){this._isExisting=e}toggleIsExisting(){this.setIsExisting(!this.isExisting())}slips(){return this._slips??=[]}addSlip(e){e.setComponentOf(this),this.slips().push(e),this.resetComponents()}removeSlip(e){e.setComponentOf(void 0),this.slips().remove(e),this.resetComponents()}deckingShape(e=n.unit(0,"in")){const t=e.toNumeric(this.unit());let r=this.geometry();return this.slips().forEach((e=>{const n=b.stretchedBy(e.cutoutShape(),2*t),i=r.zLevel()-n.zLevel();r=r.difference(n.movedBy(0,0,i)).first()})),r}_defaultSurface(){return new m(this)}setSupplementalAnnotations(e){this._supplementalAnnotations=e,this._annotations=void 0}supplementalAnnotations(){return this._supplementalAnnotations??=[]}defaultAnnotations(){const e=this.geometryStrategy().buildAnnotations(this.geometry(),this.unit(),60);return e.forEach((e=>e.setLayer(x.DOCK_ANNOTATIONS))),[...e,...this._postDimensions(),...this._channelDimensions(),...this._headerDimensions(),...this.supplementalAnnotations()]}_postDimensions(){const e=this.sideEdges().first(),t=this.endEdges().first(),r=[...h.pointArrayToEdges(this.postRows(this.posts(),this.mainAxis()).map((t=>e.closestRelativePointTo(t.first().locator())))),...h.pointArrayToEdges(this.postRows(this.posts(),this.crossAxis()).map((e=>t.closestRelativePointTo(e.first().locator()))))],n=this.systemStrategy().annotationType(),i=r.map((e=>new n(e,30,this.unit())));return i.forEach((e=>e.setLayer(x.POST_ANNOTATIONS))),i}_channelDimensions(){const e=this.uniqueLengthEdges(this.channel().map((e=>e.centerEdge()))).filter((e=>!e.length().isNearTo(this.width().toNumeric(this.unit())))),t=this.systemStrategy().annotationType(),r=e.map((e=>new t(e,30,this.unit())));return r.forEach((e=>e.setLayer(x.CHANNEL_ANNOTATIONS))),r}_headerDimensions(){const e=this.uniqueLengthEdges([...this.postHeaders(),...this.crossHeaders()].map((e=>e.centerEdge()))),t=this.systemStrategy().annotationType(),r=e.map((e=>new t(e,30,this.unit())));return r.forEach((e=>e.setLayer(x.HEADER_ANNOTATIONS))),r}uniqueLengthEdges(e){return e.reduce(((e,t)=>(e.some((e=>e.length().isNearTo(t.length())))||e.push(t),e)),[])}overriddenPostRows(){return this._overriddenPostRows??=[]}addOverriddenPostRow(e){this.overriddenPostRows().push(e),this.resetComponents()}removeOverriddenPostRow(e){this.overriddenPostRows().remove(e),this.resetComponents()}resetOverriddenPostRows(){this._overriddenPostRows=void 0,this.resetComponents()}components(){return[...super.components(),this.surface(),...this.posts(),...this.joists(),...this.channel(),...this.postHeaders(),...this.joistHeaders(),...this.slipPerimeterBoards(),...this.slips(),...this.crossHeaders(),...this.blocking()]}connectionClass(){return f}connectionZLevel(){return this.zLevel()}snappableEdgesForFrame(e){return this.alongMainAxis(e.mainAxis())?this.endEdges():[]}cornerSnappingTolerance(){return n.unit(12,"in")}channelPlateHelper(){return this._channelPlateHelper??=new w(this)}channelPlateLineItems(){return this._channelPlateLineItems??=this.channelPlateHelper().plateLineItems()}materialLineItems(){return this.isExisting()?[]:super.materialLineItems()}selfMaterialLineItems(){return[...super.selfMaterialLineItems(),...this.channelPlateLineItems()]}railingSubtractionEdgesFor(e){return[...this.connectionEdgesOn(e),...this._slipEdgesOn(e)]}_slipEdgesOn(e){return this.slips().filter((t=>e.xy().containsPoint(t.referencePoint().xy()))).map((e=>e.sternEdge()))}cleanUp(){this.connections().slice().forEach((e=>e.delete()))}defaultFigure(){return new c(this)}figureSubModels(){return[...this.framingLevels(),...this.slips(),...this.accessories()]}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_posts","_joists","_channel","_postHeaders","_joistHeaders","_slipPerimeterBoards","_crossHeaders","_blocking","_supplementalAnnotations","_channelPlateLineItems","_channelPlateHelper"]}}s(OasisDock,p),s(OasisDock,_),s(OasisDock,o),s(OasisDock,a),s(OasisDock,u),s(OasisDock,d),s(OasisDock,v),e.exports=OasisDock},46801:(e,t,r)=>{const n=r(57100);e.exports=class OasisDockConnection extends n{}},75518:(e,t,r)=>{const n=r(43023),i=r(83465);e.exports=class OasisDockFasciaBoard extends i{static builder(e){return new n(this,e)}setComponentOf(e){super.setComponentOf(e),this._fasciaColorProvider=e.componentOf()}getColorProvider(){return this._fasciaColorProvider}color(){return this.getColorProvider()?.dockFasciaColor()}color2D(){return this.getColorProvider()?.dockFasciaColor()}materialName(){return this.color()?"painted-pressure-treated":"pressure-treated"}}},65115:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),s=r(11464),o=r(37528),a=r(72596),l=r(2734),c=r(30691),u=r(76133),d=r(75518),h=r(76905),p=r(27817);class OasisDockFramer extends o{channelSpecifier(){return this.splitPileCapSpecifier()}heavyDutyPostSpecifier(){return this.framingDescriptor().heavyDutyPostSpecifier()}postHeaderSpecifier(){return this.framingDescriptor().postHeaderSpecifier()}fullPostOffset(){return this.framingDescriptor().fullPostOffset()}adjustablePostEdges(){return this.postLayoutHelper().adjustablePostEdges()}makePosts(){return this.postLayoutHelper().makePosts()}postLayoutHelper(){return new l(this.dock())}mainPostHeaderDirection(){return this.dock().hasFlippedFramingLevels()?this.dock().crossAxis().negated():this.dock().mainAxis()}crossPostHeaderDirection(){return this.dock().hasFlippedFramingLevels()?this.dock().mainAxis():this.dock().crossAxis()}makePostHeaders(){const e=this.dock(),t=e.supportPosts(),r=e.postRows(t,this.crossPostHeaderDirection()),n=this.dock().framingLevels().filter((e=>t.some((t=>e.roof().geometry().containsPoint(t.locator()))))).flatMap((e=>e.framing().splits())),s=this.postLayoutHelper().roofSupportBaseShapes().filter((e=>t.some((t=>e.containsPoint(t.locator())))));let o=s.flatMap((e=>r.map((t=>t.filter((t=>e.containsPoint(t.locator())))))));if(n.length>0){const e=[-1,1];o=n.flatMap((t=>e.flatMap((e=>o.map((r=>r.filter((r=>Math.sign(r.locator().subtract(t.center()).dot(t.normal()))===e))))))))}const l=this.postHeaderSpecifier(),c=i(this.materialDepth(l)/2,0),u=o.map((e=>{if(e.length<2)return;const t=e.first().topLocator(),r=e.last().topLocator(),n=t.to(r),i=s.find((e=>e.containsEdge(n))),[o,u]=i.edges().flatMap((e=>n.intersectionsWithLineIn2D(e))).sort(((e,t)=>e.dot(n.direction())-t.dot(n.direction()))),d=o.to(u);return this._createMaterial(a,d,l,c)})).filter((e=>e));return[...u,...this._slipPostHeaders(u)]}_slipPostHeaders(e){const t=this.dock().slips().filter((e=>e.parallelLiftShaft())).flatMap((e=>e.sideEdges().filter((e=>Math.abs(this.mainPostHeaderDirection().dot(e.direction())).isNearTo(1))))),r=e.map((e=>e.centerEdge().xy())),s=this.postHeaderSpecifier(),o=this.materialWidth(s),l=n.unit(2,"ft").toNumeric(this._unit()),u=t.map((e=>e.shiftedAlongNormalBy(-this.fullPostOffset().y()))).filter((e=>!r.some((t=>t.overlapsBySignificantDistance(e.xy(),l))))),d=this.mainPostHeaderDirection();return u.flatMap((e=>{const t=this.dock().crossHeaders().flatMap((t=>e.intersectionsWithLineIn2D(t.centerEdge()).filter((e=>t.centerEdge().containsPoint(e))))).sort(((e,t)=>e.dot(d)-t.dot(d)));return c.pointArrayToEdges(t).map((e=>e.stretchedBy(-o))).filter((t=>e.xy().overlaps(t.xy()))).map((e=>this._createMaterial(a,e,s,i(0,0))))}))}_makeEdgesForPostSupports(e,t,r,n){const i=this.materialWidth(n)/2+this.materialWidth(t)/2,s=this.dock().slips().filter((e=>this.dock().alongCrossAxis(e.mainAxis()))).flatMap((e=>e.sideEdges().map((e=>e.xy().shiftedAlongNormalBy(-this.fullPostOffset().y()))))),[o,a]=this.dock().sideEdges();let l=a.closestPointTo(e.begin(),!0).to(o.closestPointTo(e.end(),!0));const c=s.find((t=>t.containsEdge(e.xy())));c&&(l=l.closestPointTo(c.begin(),!0).to(l.closestPointTo(c.end()),!0)),e.direction().dot(l.direction()).isNearTo(-1)&&(l=l.reversed());return l.shiftedAlongNormalBy(i).addZ(r.z()).segmentsInsidePolygon(this.dock().deckingShape())}_channelSpecifierForEdge(e){const t=n.unit(8,"ft").toNumeric(this._unit());return e.length()>t?this.framingDescriptor().heavyDutyChannelSpecifier():this.framingDescriptor().channelSpecifier()}_makeSplitPileCap(e,t,r){const n=this._channelSpecifierForEdge(e),o=this.materialDepth(n),a=i(o/2,0);return this._createMaterial(s,e,n,a,r)}makeJoists(){const e=this.frame(),t=this.headerSpecifier().details().width,r=super.makeJoists(),i=this.dock().deckingShape(t),s=r.flatMap((e=>e.crosscutBoardFor(i)));return s.forEach((e=>e.setComponentOf(this.dock()))),s.forEach((t=>{const r=t.edge();r.endpoints().forEach((t=>{if(e.connections().find((r=>r.isMinorDock(e)&&r.geometry().containsPoint(t)))){const e=t.subtract(r.center()).normalized().multipliedBy(n.unit(12,"in").toNumeric(this._unit()));t.moveBy(e.x(),e.y())}}))})),s}_makeJoists(e,t,r,n){const i=(n?this._makeFasciaBoard:this._makeJoist).bind(this);return this._makeJoistsWithMaker(i,...arguments)}makeHeaders(){const e=this.headerSpecifier().details().width,t=super.makeHeaders();let r=this.dock().deckingShape(e);this.dock().connections().forEach((e=>{r=r.difference(e.geometry()).first()}));const n=t.flatMap((e=>e.crosscutBoardFor(r)));return n.forEach((e=>e.setComponentOf(this.dock()))),n}_makeHeader(e,t,r,n){return this._makeFasciaBoard(e,t,r,n)}_makeFasciaBoard(e,t,r,n){return this._createMaterial(d,e,t,r,n,this.boardMaterialName())}makeSlipPerimeterBoards(){const e=this.headerSpecifier(),t=this.materialWidth(e)/2,r=this.materialDepth(e)/2,n=this.dock(),s=n.edges(),o=n.zLevel()+this.headerOffset().z(),a=this.offsetHelper().applyOffsetToEdges(n.endEdges(),this.joistOffset()).map((e=>e.xy())),l=this.headerSpecifier().details().width,c=this.dock().deckingShape(),d=u.stretchedBy(c,-2*l.toNumeric(this.unit()));return n.slips().flatMap((e=>{const r=e.cutoutShape().edges().filter((e=>s.every((t=>!t.xy().overlaps(e.xy()))))).map((e=>e.shiftedAlongNormalBy(t))),i=r.filter((t=>e.alongCrossAxis(t.vector())&&n.alongMainAxis(t.vector())));i.map((e=>r.remove(e)));const o=i.flatMap((e=>{const t=a.first().closestPointTo(e.begin()).to(a.last().closestPointTo(e.end())).segmentsInsidePolygon(c).findSmallest((t=>t.shortestLineFrom(e.center()))),r=d.edges().findSmallest((e=>e.shortestLineFrom(t.begin()).length())).closestPointTo(t.begin()),n=d.edges().findSmallest((e=>e.shortestLineFrom(t.end()).length())).closestPointTo(t.end());return r.to(n)}));return[...r,...o]})).map((e=>e.xy().addZ(o))).map((t=>this._makeFasciaBoard(t,e,i(-r,0))))}makeCrossHeaders(){const e=this.dock(),t=this.crossPostHeaderDirection(),r=e.supportPosts(),s=e.postRows(r,t).filter((e=>e.length>1)).map((e=>e.first().topLocator().to(e.last().topLocator()))),o=this.postHeaderSpecifier(),l=this.materialWidth(o),u=i(-this.materialDepth(o)/2,0),d=e.slips(),h=n.unit(2,"ft").toNumeric(this._unit());return d.filter((t=>e.framingLevels().some((e=>e.geometry().containsShape(t.geometry(),h))))).flatMap((e=>e.headerLocationEdges().filter((e=>Math.abs(t.dot(e.direction())).isNearTo(1))))).flatMap((e=>{const r=s.flatMap((t=>e.intersectionsWithLineIn2D(t).map((e=>t.closestPointTo(e,!0))))),n=e.begin().findClosestPoint(r),i=e.end().findClosestPoint(r);if(!n||!i||n.equals(i))return[];const d=n.to(i),h=r.filter((e=>d.containsPoint(e)));return c.pointArrayToEdges(h).map((e=>{let r=e.stretchedBy(-l);return e.direction().dot(t).isNearTo(-1)&&(r=r.reversed()),this._createMaterial(a,r,o,u)}))}))}makeBlocking(){const e=this.blockingLayoutEdges();return e.flatMap(((t,r)=>{const n=e.slice(r+1,r+3);return 0===n.length?[]:this._makeBlockingForJoistEdge(t,n)}))}_makeBlockingForJoistEdge(e,t){const r=e.length().roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES),n=this.maxBlockingSpacing().toNumeric(this._unit()),i=Math.ceil(r/n)-1,s=c.locatorsAlongEdge(e,i),o=[];return s.forEach((e=>{const r=this._makeBlockingEdge(e,t);r&&o.push(this._makeBoard(r,this.joistSpecifier()))})),o}_makeBlockingEdge(e,t){const r=t.map((t=>t.closestPointTo(e))),n=t.first().normal(),i=r.find((t=>this._blockingEdgeHasCorrectDirection(e,t,n)));if(!i)return;const s=this.joistSpecifier().details().width.toNumeric(this._unit());return e.to(i).stretchedBy(-s)}blockingLayoutEdges(){const e=this.dock(),t=e.joists(),r=t.map((e=>e.edge())),n=t.first().edge(),i=e.slipPerimeterBoards().map((e=>e.edge())).filter((e=>e.isParallelTo(n))),s=e.edges().find((e=>e.isPerpendicularTo(n))),o=n.begin().z();return[...r,...i].map((e=>c.flattenedAtZ(e,o))).sort(((e,t)=>{const r=s.closestRelativePointTo(e.begin()),n=s.closestRelativePointTo(t.begin());return r.fraction()<n.fraction()?-1:1}))}_blockingEdgeHasCorrectDirection(e,t,r){const n=h.directionTo(e,t).normalized();return n.equals(r)||n.negated().equals(r)}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_postLayoutHelper"]}}p(OasisDockFramer,"framingDescriptor",["maxBlockingSpacing"]),e.exports=OasisDockFramer},12379:(e,t,r)=>{const n=r(63768),{EditableProperty:i}=r(7340),{Composite3DFigure:s,three:o}=r(37732),{$P:a,RelativeLocator:l,Polygon:c,NormalToEdgeLocator:u,Circle:d}=r(62048),{supply:h}=r(50988),p=r(30691),m=r(76133),f=r(20901),g=r(88646),y=r(30202),b=r(6556),v=r(67603),_=r(55848),x=r(57473),w=r(48089),R=r(74916),k=r(21431),j=r(46834),z=r(85230),q=r(52791),$=r(10460),Z=r(80365);let X;class OasisDockSlip extends _{static types(){return{[z.type()]:z,[q.type()]:q,[$.type()]:$,[w.type()]:w,[j.type()]:j}}static iconName(){return"boat-slip"}static displayName(){return"Boat Slip"}static builder(e){return X||(X=r(98723)),new X(e)}static defaultWidth(){return n.unit(11,"ft")}static defaultLength(){return n.unit(25,"ft")}constructor(e,t=new l(a(1,0).to(a(-1,0)).center())){super(e,t)}clone(){}includeInLaborCosts(){return this.cradle().includeInLaborCosts()}deckingOptionProvider(){return this.componentOf()?.deckingOptionProvider()}type(){return this._type??=this.typeChoices().first().value}setType(e){this._type=e,this.componentOf()?.resetComponents(),this.updateCradle(),this.resetDisplayProperties()}updateCradle(){this._cradle=void 0,this.cradle().updateDimensions()}typeChoices(){const e=this.constructor.types();return Object.keys(e).map((e=>({value:e,label:e,disabled:this.isOnDockSideEdge()&&e!==q.type()})))}isOnDockSideEdge(){return this.dock()?.alongCrossAxis(this.mainAxis())}maxCrossHeaderSpacing(){return n.unit(12,"ft")}ensureTypeIsValid(){const e=this.typeChoices().filter((e=>!e.disabled)).map((e=>e.value));e.includes(this.type())||this.setType(e.first()),this.resetDisplayProperties()}zLevel(){return 0}mainAxis(){return this.referencePoint().edge().normal()}crossAxis(){return this.referencePoint().edge().direction()}angle(){return this.mainAxis().theta()}angleChanged(){this.resetComponents()}resetComponents(){this._boatLiftMotor=void 0,this._boatLiftShaft=void 0,this._shaftMountingBrackets=void 0,this._cradle=void 0,this._liftCables=void 0,this.resetDisplayProperties()}innerWidth(){return this._innerWidth??=n.unit(2,"ft")}innerAngle(){return this._innerAngle??=n.unit(45,"deg")}formatInnerAngle(){return this.innerAngle().toNumeric("deg").roundedTo(1).toString()}setWidth(e){const t=e.toNumeric(this.unit());this.sideEdges().forEach(((e,r)=>{const n=t*(0===r?1:-1)/2;e.endpoints().forEach((e=>{e.setOffsetAlongEdge(n)}))})),this.frameResized({fromSetter:!0})}setLength(e){const t=e.toNumeric(this.unit());this.bowEdge().endpoints().forEach((e=>{e.setDistance(-t)})),this.frameResized({fromSetter:!0})}sternEdge(){return this.endEdges().first()}bowEdge(){return this.endEdges().last()}headerLocationEdges(){if(!this.parallelLiftShaft())return this._perpendicularHeaderLocationEdges();const e=this.componentOf(),t=-e.dockFramer().fullPostOffset().y(),r=-n.unit(1,"ft").toNumeric(this.unit()),i=e.alongCrossAxis(this.mainAxis())?r:t;return[...this._crossAxisHeaderLocations(),...this.sideEdges().map((e=>e.shiftedAlongNormalBy(i)))]}_crossAxisHeaderLocations(){const e=n.unit(1,"ft").toNumeric(this.unit()),t=n.unit(-2,"ft").toNumeric(this.unit()),r=this.sideEdges().map(((e,t)=>0===t?e:e.reversed())).map((r=>p.stretchedEdgeBy(r,t,e)));return this.equallySpaceAlongEdges(r,this.maxCrossHeaderSpacing())}_perpendicularHeaderLocationEdges(){return this.cradle().attachmentGeometry?this.cradle().attachmentGeometry().edges():[]}setInnerWidth(e){this._innerWidth=e,this.frameResized({fromSetter:!0})}setInnerAngle(e){this._innerAngle=e,this.frameResized({fromSetter:!0})}validateWidth(e,t){return this.cradle().validateWidth(e,t)}validateLength(e,t){return this.cradle().validateLength(e,t)}validateInnerWidth(e,t){if(!e)return;const r=n.unit(0,"ft"),i=n.divide(this.width(),2);return n.larger(t,i)?`must be smaller than ${i.toString()}`:n.smaller(t,r)?`must be larger than ${r.toString()}`:void 0}validateInnerAngle(e,t){if(!e)return;const r=this.innerWidth(),i=this.length(),s=n.unit(n.atan(n.divide(r,i)),"rad"),o=n.unit(90,"deg");return n.larger(t,o)?`must be smaller than ${o.toNumeric("deg").roundedTo(1)}`:n.smaller(t,s)?`must be larger than ${s.toNumeric("deg").roundedTo(1)}`:void 0}frameResized(e){super.frameResized(e),this.componentOf()?.resetComponents()}cutoutShape(){const[e,t]=this.endEdges(),r=(this.cradle()?.innerWidth?.()??this.innerWidth()).toNumeric(this.unit()),i=this.cradle()?.innerAngle?.()??this.innerAngle(),s=r/n.tan(i);if(r.isNearTo(0)||s.isNearTo(0))return this.geometry();const o=t.shiftedAlongNormalBy(-s),a=t.stretchedBy(2*-r);return new c([...e.endpoints(),o.begin(),...a.endpoints(),o.end()])}showParallelLiftShaftProperty(){return!this.requiresParallelLiftShaft()}parallelLiftShaft(){return this.requiresParallelLiftShaft()||(this._parallelLiftShaft??=!1)}requiresParallelLiftShaft(){return this.cradle()?.requiresParallelLiftShaft()}toggleParallelLiftShaft(){this.setParallelLiftShaft(!this.parallelLiftShaft())}setParallelLiftShaft(e){this._parallelLiftShaft=e,this.dock().resetComponents()}liftShaftMainAxis(){return this.parallelLiftShaft()?this.mainAxis():this.crossAxis().negated()}liftShaftCrossAxis(){return this.parallelLiftShaft()?this.crossAxis():this.mainAxis()}boatLiftMotor(){return this._boatLiftMotor??=this._defaultBoatLiftMotor()}_defaultBoatLiftMotor(){if(!this.cradle()?.hasBoatLiftMotor())return;const e=this.bowEdge(),t=this.liftShaftMainAxis(),r=this.cradle().attachmentGeometry?.()&&this.sideEdges(this.cradle().attachmentGeometry()).first().center(),i=this.parallelLiftShaft()?e.center():this.sideEdges().first().closestRelativePointTo(r),s=this._findClosestHeaderTo(i,this.liftShaftCrossAxis());if(!s)return;const o=s.materialSpecifier().details().width.toNumeric(this.unit()),a=s.materialSpecifier().details().depth.toNumeric(this.unit()),c=n.subtract(n.unit(4.5,"in"),n.unit(2,"in")).toNumeric(this.unit()),u=s.centerEdge().closestPointTo(i,!0).add(t.multipliedBy(-o/2)).addZ(a/2+c),d=l.makeRelativeTo(u,i),h=this._rotationFor3DModels();return new R(d,h)}boatLiftShaft(){return this._boatLiftShaft??=this._defaultBoatLiftShaft()}_defaultBoatLiftShaft(){if(!this.boatLiftMotor())return;const e=this._shaftSpecifier(),t=n.unit(6,"in").toNumeric(this.unit()),r=this.boatLiftMotor().locator(),i=new u(r,t),s=this.parallelLiftShaft()?this.sternEdge().begin():this.sideEdges().last().begin(),o=this._findClosestHeaderTo(s,this.liftShaftCrossAxis()),c=o.materialSpecifier().details().width.toNumeric(this.unit()),h=o.centerEdge(),p=n.unit(4,"in").toNumeric(this.unit()),m=h.closestPointTo(r,!0).addZ(r.z()-h.begin().z()).add(this.liftShaftMainAxis().multipliedBy(c/2+p)),b=l.makeRelativeTo(m,r),v=new g([new f(new d(a(0,0),e.details().radius.toNumeric(this.unit())))]);return new y(i,b,v,e,this.geometry().normal())}_shaftSpecifier(){return this.materials.LIFT_SHAFT}shaftMountingBrackets(){return this._shaftMountingBrackets??=this._defaultShaftMountingBrackets()}_defaultShaftMountingBrackets(){if(!this.boatLiftMotor())return[];const e=this.componentOf(),t=this.liftShaftMainAxis(),r=this._dockHeadersAlong(this.liftShaftCrossAxis()),n=t.multipliedBy(-e.dockFramer().postHeaderSpecifier().details().width.toNumeric(this.unit())/2),i=this.boatLiftShaft().edge(),s=this.referencePoint(),o=this.boatLiftMotor().locator().xy(),a=this._rotationFor3DModels();return r.flatMap((e=>e.centerEdge().intersectionsWithEdgeIn2D(i))).map((e=>l.makeRelativeTo(e.add(n),s))).filter((e=>!e.xy().equals(o))).map((e=>new x(e,"oasis-shaft-bracket",a)))}_rotationFor3DModels(){return(new o.Quaternion).setFromAxisAngle(new o.Vector3(0,0,1),this.liftShaftMainAxis().theta())}_dockHeadersAlong(e){return[...this.dock().postHeaders(),...this.dock().crossHeaders()].filter((t=>Math.abs(t.edge().direction().dot(e)).isNearTo(1))).filter((t=>{const r=t.centerEdge(),n=t=>a(t.dot(e),0,0),i=n(r.begin()).to(n(r.end())),s=this.edges().find((t=>t.direction().equals(e))),o=n(s.begin()).to(n(s.end()));return i.xy().overlaps(o.xy())}))}_findClosestHeaderTo(e,t){const r=t.rotatedBy(a(0,0),Math.PI_2);return this._dockHeadersAlong(t).findSmallest((t=>Math.abs(t.centerEdge().begin().subtract(e).dot(r))))}async load(){return Promise.all(this.components().map((e=>e.load?.())))}defaultFigure(){return new k(this)}threeFigure(){return s.withModel(this)}components(){return[this.boatLiftMotor(),this.boatLiftShaft(),...this.shaftMountingBrackets(),this.cradle(),...this.liftCables()].filter((e=>e))}delete(){this.componentOf()?.removeSlip(this)}dock(){return this.componentOf()}cradle(){return this._cradle??=this._defaultCradle()}_defaultCradle(){let e=this.constructor.types()[this.type()];this.hasRoof()||(e=j);const t=new e;return t.setComponentOf(this),t}liftCables(){return this._liftCables??=this._defaultLiftCables()}_defaultLiftCables(){const e=this._dockHeadersAlong(this.liftShaftMainAxis()),t=this._cableSpecifier(),r=t.details().radius.toNumeric(this.unit()),n=new g([new f(new d(a(0,0),r))]);return this.cradle().attachmentPoints().map((r=>{const i=r.findClosestPoint(e.map((e=>e.centerEdge().closestPointTo(r,!0))));if(!i)return;const s=r.to(i).relativeTo(this.referencePoint()),o=new y(s.begin(),s.end(),n,t);return o.setComponentOf(this),o})).filter((e=>e))}_cableSpecifier(){return this.cradle().cableSpecifier()}hasRoof(){const e=this.dock().dockFramer().heavyDutyPostSpecifier().details().width.toNumeric(this.unit());return this.dock().framingLevels().some((t=>m.containsShapeWithTolerance(t.geometry(),this.geometry(),e)))}selfMaterialLineItems(){if(!this.boatLiftMotor())return[];const e=n.unit(120,"ft"),t=n.unit(this.boatLiftShaft().edge().length(),this.unit());return[new b(1,this.materials.LIFT_MOTOR_ASSEMBLY),new b(e,this._cableSpecifier()),new b(t,this._shaftSpecifier()),new b(8,this.materials.LIFT_PULLEY)]}defaultDisplayProperties(){return new v(this,[...this.hasRoof()?[new i(this,"Type",{type:"select",choices:this.typeChoices()})]:[],new i(this,"Width",{type:"unit",defaultUnit:"ft",ignoreIntermediateEdits:!0}),new i(this,"Length",{type:"unit",defaultUnit:"ft",ignoreIntermediateEdits:!0}),new i(this,"Parallel Lift Shaft",{type:"boolean",label:"Parallel Drive Pipe"}),...this.cradle().defaultDisplayProperties()])}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_boatLiftMotor","_boatLiftShaft","_shaftMountingBrackets","_cradle","_liftCables"]}}h(OasisDockSlip,Z),e.exports=OasisDockSlip},45492:(e,t,r)=>{const{Polygon:n,$P:i,PolarCoordinate:s}=r(62048),o=r(88646),a=r(86755),l=r(72596);let c;e.exports=class OasisFlashing extends l{static builder(e){return c||(c=r(33530)),new c(e)}constructor(e,t,r,n,i,s){super(e,t,r,n,i),this._angle=s}angle(){return this._angle??=0}_defaultCrossSection(){const e=this.materialSpecifier(),t=e.details().width.toNumeric(this.unit()),r=e.details().depth.toNumeric(this.unit()),l=e.details().thickness.toNumeric(this.unit()),c=e=>new s(e.x(),-this.angle()).add(new s(e.y(),Math.PI_2-this.angle()));return new o([new a(new n([c(i(0,t)),i(0,0),i(-r,0),i(-r,-l),i(l,-l),c(i(l,t))]))])}color(){return this.project().roofFlashingColor()}}},67751:(e,t,r)=>{const n=r(3751),i=r(12852);e.exports=class OasisFlatRoof extends i{static framingType(){return"Flat roof"}sideEdges(){return this.framingLevel().sideEdges()}endEdges(){return this.framingLevel().endEdges()}roofingSurface(){return this.roofing().first()}_defaultFramer(){return new n(this)}}},74411:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),s=r(95369);e.exports=class OasisFramingDescriptor extends s{shouldDoubleEndJoists(){return!1}postOffset(){return super.postOffset().add(-this.materialWidth(this.headerSpecifier()),0)}fullPostOffset(){const e=this.materialWidth(this.heavyDutyPostSpecifier())/2;return this.postOffset().add(-e,-e)}_postCornerInsetFromEdge(){return this.materialWidth(this.joistSpecifier())}offsetForPostRowEdge(){return i(0,-this.postOffset().y()+this.materialWidth(this.heavyDutyPostSpecifier())/2,-this.postOffset().z())}maxPostSpacing(){return n.unit(12,"ft")}maxCantileverSpan(){return n.unit(4,"ft")}maxBlockingSpacing(){return n.unit(12,"ft")}_splitPileCapZOffset(){return this.joistOffset().z()}_splitPileCapLateralOffset(){return 0}postSpecifier(){return this.materials.PILE278}heavyDutyPostSpecifier(){return this.materials.PILE45}framingLevelSupportPostSpecifier(){return this.heavyDutyPostSpecifier()}splitPileCapSpecifier(){return this.channelSpecifier()}channelSpecifier(){return this.materials.CHANNEL4}heavyDutyChannelSpecifier(){return this.materials.CHANNEL5}postHeaderSpecifier(){return this.materials.STEEL4x4}joistSpecifier(){return this.materials.PT2x8}headerSpecifier(){return this.materials.PT2x8}}},27247:(e,t,r)=>{const{EditableProperty:n}=r(7340),i=r(5389),s=r(46873);e.exports=class OasisGableRoof extends s{static framingType(){return"Gable roof"}_defaultFramer(){return new i(this)}defaultDisplayProperties(){return[...super.defaultDisplayProperties(),new n(this,"Flip Orientation",{type:"action",perform:()=>this.flip()})]}}},6107:(e,t,r)=>{const{extend:n}=r(50988),i=r(55521),s=r(46873),o=r(76360);class OasisHipRoof extends s{static framingType(){return"Hip roof"}_defaultFramer(){return new i(this)}}n(OasisHipRoof,o),e.exports=OasisHipRoof},24394:(e,t,r)=>{const n=r(63768),i=r(87558),s=r(6529),o=r(73835),a=r(83465);e.exports=class OasisHipRoofWoodenFramingDescriptor extends s{maxPitchedRoofJoistSpacing(){return n.unit(24,"in")}rafterSpacing(){return this.maxPitchedRoofJoistSpacing()}overhang(){return n.unit(12,"in")}minimumRidgeLength(){return n.unit(12,"in")}defaultMaterialSpecifier(){return this.materials.PT2x6}defaultMaterialClass(){return a}collarTieSpecifier(){return this.defaultMaterialSpecifier()}collarTieMaterialClass(){return i}joistSpecifier(){return this.defaultMaterialSpecifier()}joistMaterialClass(){return this.defaultMaterialClass()}rafterSpecifier(){return this.defaultMaterialSpecifier()}rafterMaterialClass(){return o}ridgeSpecifier(){return this.defaultMaterialSpecifier()}ridgeMaterialClass(){return this.defaultMaterialClass()}roofingMaterialChoices(){return[this._makeRoofingMaterialChoice("Shingles",this.roofingSpecifier())]}}},42894:(e,t,r)=>{const n=r(63348),i=r(6556);e.exports=class OasisLadderAccessory extends n{static displayName(){return"Ladder"}static iconName(){return"ladder"}modelIdentifier(){return"generic-dock-ladder"}selfMaterialLineItems(){return[new i(1,this.materials.LADDER_ACCESSORY)]}}},18427:(e,t,r)=>{const n=r(63768),{CompositeFigure:i,EditableProperty:s}=r(7340),{Composite3DFigure:o}=r(37732),{MissingOverride:a,extend:l}=r(50988),c=r(20632),u=r(36887),d=r(83102);class OasisLift extends d{static type(){throw new a(this,"type")}get descriptor(){return this.framingDescriptor()}get framer(){return this.componentFramer()}type(){return this.constructor.type()}cableSpecifier(){return this.materials.LIFT_CABLE14}deckingOptionProvider(){return this.componentOf().deckingOptionProvider()}requiresParallelLiftShaft(){return!1}slip(){return this.componentOf()}mainAxis(){return this.slip().mainAxis()}crossAxis(){return this.slip().crossAxis()}referencePoint(){return this.slip().referencePoint()}bunks(){return this._bunks??=this.framer.makeBunks()}components(){return[]}defaultFigure(){return i.withModel(this)}threeFigure(){return o.withModel(this)}nonEssentialProperties(){return[...super.nonEssentialProperties(),...this.accumulatedNonEssentialProperties(),"_bunks"]}updateDimensions(){const e=this.slip();e.setWidth(e.constructor.defaultWidth()),n.smaller(e.length(),n.unit(15,"ft"))&&e.setLength(e.constructor.defaultLength())}validateWidth(e,t){if(!e)return;const r=n.unit(8,"ft"),i=n.unit(11,"ft");return n.larger(t,i)?`must be smaller than ${i.toString()}`:n.smaller(t,r)?`must be larger than ${r.toString()}`:void 0}validateLength(e,t){if(!e)return;const r=n.unit(12,"ft");return n.smaller(t,r)?`must be larger than ${r.toString()}`:void 0}defaultDisplayProperties(){return[new s(this.slip(),"Inner Width",{type:"unit",defaultUnit:"ft",ignoreIntermediateEdits:!0}),new s(this.slip(),"Inner Angle",{type:"unit",defaultUnit:"deg",ignoreIntermediateEdits:!0})]}hasBoatLiftMotor(){return!0}includeInLaborCosts(){return!0}}l(OasisLift,u),l(OasisLift,c),e.exports=OasisLift},46834:(e,t,r)=>{const n=r(18427);e.exports=class OasisNullLift extends n{static type(){return"None"}attachmentPoints(){return[]}hasBoatLiftMotor(){return!1}includeInLaborCosts(){return!1}}},52791:(e,t,r)=>{const n=r(63768),i=r(32847),s=r(75086);e.exports=class OasisPWCLift extends i{static type(){return"PWC"}cableSpecifier(){return this.materials.LIFT_CABLE316}cradleInsetForEnds(){return n.unit(1,"ft")}cradleInsetForSides(){return n.unit(1,"ft")}surfaceSpecifier(){return this.materials.PWC_GRATE}surface(){return this._surface??=this._defaultSurface()}_defaultSurface(){const e=this.surfaceSpecifier(),t=this.framer.materialDepth(e),r=this.framer.framingOffset().addZ(-t),n=this.slip().geometry(),i=this.framer.offsetHelper().applyOffsetToGeometry(n,r),o=new s(i,e,this.crossAxis());return o.setComponentOf(this),o}components(){return[...super.components(),this.surface()]}updateDimensions(){this.slip().setWidth(n.unit(10,"ft")),this.slip().setLength(n.unit(12,"ft"))}innerWidth(){return n.unit(0,"ft")}innerAngle(){return n.unit(0,"deg")}validateLength(e,t){if(!e)return;const r=super.validateLength(e,t);if(r)return r;const i=n.unit(15,"ft");return n.larger(t,i)?`must be smaller than ${i.toString()}`:void 0}defaultDisplayProperties(){return[]}}},13614:(e,t,r)=>{const n=r(63768),i=r(30580),s=r(6556),o=r(45566);e.exports=class OasisPile extends i{get materials(){return this.componentOf().materials}isRoofSupport(){return n.smaller(this.verticalOffset(),n.unit(0,"ft"))}lengthInGround(){return n.unit(8,"ft")}lengthInWater(){return n.unit(8,"ft")}galvanizedLengthAboveWater(){return n.unit(5,"ft")}nonGalvanizedLength(){return n.unit(8,"ft")}selfMaterialLineItems(){const e=n.add(this.lengthInGround(),this.lengthInWater(),this.galvanizedLengthAboveWater()),t=[new s(e,this.materialSpecifier())];return this.isRoofSupport()&&t.push(new s(this.nonGalvanizedLength(),this.materialSpecifier().details().nonGalvanized)),t}color(){return this.componentOf().project().steelColor()}defaultFigure(){return new o(this)}}},46873:(e,t,r)=>{const{extend:n}=r(50988),i=r(12852),s=r(18934);class OasisPitchedRoof extends i{pitchBaseGeometry(){return this.overhangEdgeGeometry()}trusses(){return this._trusses??=this.framer.makeTrusses()}components(){return[...this.trusses(),...super.components()]}resetComponents(){super.resetComponents(),this._trusses=void 0}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_trusses"]}}n(OasisPitchedRoof,s),e.exports=OasisPitchedRoof},85230:(e,t,r)=>{const n=r(81925),i=r(86099),s=r(90643);e.exports=class OasisPontoonBoatLift extends n{static type(){return"Pontoon"}_defaultFramer(){return new i(this)}_defaultFramingDescriptor(){return new s(this)}components(){return[...super.components(),...this.bunks()]}}},86099:(e,t,r)=>{const n=r(75672),i=r(20160);e.exports=class OasisPontoonBoatLiftFramer extends i{bunkOffset(){return this.framingDescriptor().bunkOffset()}spanBetweenBunks(){return this.framingDescriptor().spanBetweenBunks()}makeBunks(){const e=this._supportEdges(),t=[this.spanAcrossEdgesProportionallyAt(0,e).reversed(),this.spanAcrossEdgesProportionallyAt(1,e)],r=this.spanBetweenBunks().toNumeric(this._unit()),i=this.bunkOffset();return this.offsetHelper().applyOffsetToEdges(t,i).flatMap((e=>[e,e.shiftedAlongNormalBy(r).reversed()])).map((e=>{const t=new n(e.begin(),e.end());return t.setComponentOf(this.frame()),t}))}}},90643:(e,t,r)=>{const n=r(63768),i=r(13998);e.exports=class OasisPontoonBoatLiftFramingDescriptor extends i{spanBetweenBunks(){return n.unit(1,"ft")}_bunkInsetFromEdgeOfFraming(){return n.unit(1,"ft").toNumeric(this.unit())}}},2734:(e,t,r)=>{const n=r(63768),{FixedEdgeLocator:i,NormalToEdgeLocator:s}=r(62048),{extend:o}=r(50988),a=r(80365),l=r(87763),c=r(13614),u=r(46748),d=r(27817);class OasisPostLayoutHelper{constructor(e){this._dock=e}dock(){return this._dock}framingDescriptor(){return this.dock().framingDescriptor()}_unit(){return this.dock().unit()}_maxCantileverSpanNumeric(){return this.maxCantileverSpan().toNumeric(this._unit())}offsetHelper(){return this._offsetHelper??=new l(this.dock())}makePosts(){const e=this.dock(),t=this.postEdges(),r=e.slips().filter((t=>e.alongCrossAxis(t.mainAxis()))),n=[],s=t.flatMap((r=>this._postDistancesAlong(r).map((s=>{const o=new i(r,s),{locator:a,couldBeRoofSupport:l}=this._adjustedLocatorForSlips(o,r,t,n);if(!a)return;const c=this.postHeight(),u=this._makePost(a,c,l);return u.setComponentOf(e),u})).filter((e=>e)))),o=this._slipPiles(s,r,t);return[...s,...o]}_adjustedLocatorForSlips(e,t,r,n){const i=this.maxCantileverSpan().toNumeric(this._unit()),o=this.dock().slips().filter((e=>this.dock().alongCrossAxis(e.mainAxis()))).find((t=>t.containsPoint(e)));let a=e,l=!0;if(o){a=void 0;const c=o.bowEdge(),u=Math.min(...r.map((e=>this._distanceBetweenEdges(c,e))).filter((e=>e>0))),d=c.shiftedAlongNormalBy(-this.fullPostOffset().y()),h=new s(e,this._distanceBetweenEdges(t,d));!n.some((e=>e.equals(h)))&&u>i&&(n.push(h),l=!1,a=h)}return{locator:a,couldBeRoofSupport:l}}_postDistancesAlong(e){const t=this.dock().mainAxis(),r=this.dock().slips().filter((e=>this.dock().alongMainAxis(e.mainAxis()))).findSmallest((e=>e.bowEdge().begin().dot(t))),n=r=>r.begin().subtract(e.begin()).dot(t),i=this.dock().slips().filter((e=>this.dock().alongCrossAxis(e.mainAxis())&&this.dock().hasFlippedFramingLevels())).flatMap((e=>e.sideEdges().map((e=>e.shiftedAlongNormalBy(-this.fullPostOffset().y()))))).map((e=>({distance:n(e),isPreferred:!1}))),s=this.dock().overriddenPostRows().filter((e=>1===Math.abs(e.edge().direction().dot(this.dock().crossAxis())))).map((e=>({distance:n(e.edge()),isPreferred:!0}))),o=this._maxCantileverSpanNumeric(),a=r?[{distance:n(r.bowEdge()),frame:r,isPreferred:!1}]:[];a.push(...i),a.slice().forEach((e=>{s.some((t=>Math.abs(t.distance-e.distance)<o))&&a.remove(e)})),a.push(...s);const l=[{distance:0,isPreferred:!1},...a,{distance:e.length(),isPreferred:!1}];l.sort(((e,t)=>e.distance-t.distance));const c=[];l.forEach(((e,t)=>{const r=l[t+1];r&&c.push([e,r])}));const u=this._spansBetweenStopGroups(c).uniqueValues(),d=Math.abs(this.fullPostOffset().x()),h=this.dock().connectionFor(e.begin(),d);h?.isMinorDock(this.dock())&&u.pop();const p=this.dock().connectionFor(e.end(),d);return p?.isMinorDock(this.dock())&&u.shift(),u}adjustablePostEdges(){const e=this.dock();return[...e.postRows(e.posts(),e.mainAxis()),...e.postRows(e.posts(),e.crossAxis())].map((e=>e.first().locator().to(e.last().locator()).snapshot()))}postEdges(){const e=this.dock().sideEdges(),t=this.fullPostOffset(),r=this.offsetHelper().applyOffsetToEdges(e,t);return this._postRowDistances(r,t.y()).map((e=>r.first().shiftedAlongNormalBy(e)))}_postRowDistances(e,t){return this._spansBetweenStopGroups(this._postSpanGroups(e,t)).uniqueValues()}_spansBetweenStopGroups(e){const t=this._maxCantileverSpanNumeric();return e.flatMap((e=>{const[{distance:r},{distance:n}]=e;if(Math.abs(r-n)<=t){const t=e.find((e=>e.isPreferred));if(void 0!==t)return t.distance;const i=e.find((e=>e.frame));return void 0!==i?i.distance:[r,n]}return this._distancesForStops(r,n)}))}_postSpanGroups(e,t){const r=this._postSpanStops(e,t),n=[];for(let e=0;e<r.length;e++){const t=r[e],i=r[e+1];!i||this._isAroundSlip(t,i)||this._isAroundSplit(t,i)||n.push([t,i])}return n}_isAroundSlip(e,t){const r=e.edge.begin().to(t.edge.begin()).center();return e.frame&&t.frame&&this.dock().slips().filter((e=>this.dock().alongMainAxis(e.mainAxis()))).some((e=>e.sternEdge().containsPoint(e.sternEdge().closestPointTo(r,!0))))}_isAroundSplit(e,t){return e.split&&t.split}_postSpanStops(e,t){const r=this.dock().slips().filter((e=>this.dock().alongMainAxis(e.mainAxis()))),n=[...this.dock().overriddenPostRows().filter((e=>1===Math.abs(e.edge().direction().dot(this.dock().mainAxis())))).flatMap((e=>[{edge:e.edge(),isPreferred:!0},{edge:e.edge(),isPreferred:!0}])),...e.map((e=>({edge:e,isPreferred:!1}))),...r.flatMap((e=>this._postEdgesFrom(e,t))),...this._splitStops()];return n.forEach((t=>{t.distance=this._distanceBetweenEdges(e.first(),t.edge)})),n.sort((({distance:e},{distance:t})=>e-t)),n}_splitStops(){return this.dock().framingLevels().flatMap((e=>{const t=e.framing();if(0===t.splits().length)return[];const r=t.overhang().toNumeric(this._unit())-t.splitOverhang().toNumeric(this._unit())/2;return t.splits().flatMap((e=>[{edge:e.shiftedAlongNormalBy(-r),split:e,isPreferred:!1},{edge:e.shiftedAlongNormalBy(r),split:e,isPreferred:!1}]))}))}_slipPiles(e,t,r){const n=this.dock().postRows(e),i=this.fullPostOffset().y();return t.flatMap((e=>this._postEdgesFrom(e,i))).flatMap((({edge:e,frame:t})=>{const i=t.edges().find((t=>e.direction().dot(t.direction()).isNearTo(1)));return n.find((e=>{const t=e.first().locator().subtract(i.begin()).dot(i.normal());return t>=0&&t<this._maxCantileverSpanNumeric()}))?[]:r.flatMap((t=>e.intersectionsWithEdgeIn2D(t).map((e=>t.closestRelativePointTo(e)))))})).map((e=>{const t=this.postHeight(),r=this._makePost(e,t,!0);return r.setComponentOf(this.dock()),r}))}_makePost(e,t,r){const i=this.dock().framingLevels(),s=this.roofSupportBaseShapes().find((t=>t.containsPoint(e)));let o,a=this.postSpecifier();if(i.length>0&&(a=this.heavyDutyPostSpecifier()),s&&r){const r=e=>[e.x(),e.y(),e.z()],i=n.intersect(r(e),r(e.addZ(-1)),[...r(s.normal()),s.normal().dot(s.vertices().first())])[2],a=n.unit(this.dock().geometry().zLevel()-i,this._unit());t=n.add(t,a);const l=n.unit(this.deckThickness(),this._unit()),c=this.postHeaderSpecifier().details().depth;o=u`-(${a} + ${l}) + ${c}`}return new c(e,t,a,o)}roofSupportBaseShapes(){return this._roofSupportBaseShapes??=this.dock().framingLevels().flatMap((e=>e.roof().supportBaseShapes()))}_postEdgesFrom(e,t){return e.sideEdges().map((r=>({edge:r.shiftedAlongNormalBy(-t),frame:e,isPreferred:!1})))}_distanceBetweenEdges(e,t){const r=e.begin(),n=e.normal();return t.begin().subtract(r).dot(n)}_distancesForStops(e,t){const r=Math.abs(e-t);return this.equallySpacedDistances(r,this.maxPostSpacing()).map((t=>t+e))}}d(OasisPostLayoutHelper,"framingDescriptor",["postSpecifier","heavyDutyPostSpecifier","postHeaderSpecifier","postHeight","maxPostSpacing","maxCantileverSpan","postOffset","fullPostOffset","materialWidth","materialDepth","deckThickness"]),o(OasisPostLayoutHelper,a),e.exports=OasisPostLayoutHelper},66462:(e,t,r)=>{const{RelativeLocator:n,NormalToEdgeLocator:i}=r(62048),s=r(83102);e.exports=class OasisPostRow extends s{constructor(e){super(),e&&this.setEdge(e)}isDeleteable(){return this.isOverridden()}edge(){return this._edge}setEdge(e){this._edge=new n(e.begin()).to(new n(e.end())),this._updateEdgeSource()}dock(){return this.componentOf()}isOverridden(){return this.dock().overriddenPostRows().some((e=>e.equals(this)))}moveBy(e,t){const r=this.edge().moveBy(e,t);return r&&(this._updateEdgeSource(),this.isOverridden()||this.dock().addOverriddenPostRow(this),this.dock().resetComponents()),r}delete(){this.dock().removeOverriddenPostRow(this)}equals(e){return this===e||e?.edge().equals(this.edge())}_updateEdgeSource(){this.dock()&&this.edge().endpoints().forEach((e=>{const t=e.findClosestPoint(this.dock().edges().map((t=>t.closestRelativePointTo(e)))),r=-e.distanceTo(t);return e.setSource(new i(t,r))}))}}},12852:(e,t,r)=>{const n=r(65773),i=r(6529);e.exports=class OasisRoof extends n{_defaultFramingDescriptor(){return new i(this)}isMetalRoof(){return this.roofingMaterial().equals(this.materials.RPANEL)}splits(){return[]}supportBaseShapes(){return[this.geometry()]}}},6529:(e,t,r)=>{const n=r(63768),i=r(48151),s=r(45492),o=r(72596);e.exports=class OasisRoofFramingDescriptor extends i{overhang(){return n.unit(2,"ft")}maxFlatRoofJoistSpacing(){return n.unit(2,"ft")}maxPitchedRoofJoistSpacing(){return n.unit(4,"ft")}maxTrussSpacing(){return n.unit(8,"ft")}joistSpecifier(){return this.materials.STEEL2x3}flashingSpecifier(){return this.materials.ROOF_FLASHING}roofingSpecifier(){return this.roof().roofingMaterial()}sheathingSpecifier(){return this.materials.PW4x8}hasFlashing(){return this.roof().isMetalRoof()}hasSheathing(){return!this.roof().isMetalRoof()}joistMaterialClass(){return o}flashingMaterialClass(){return s}trussBraceAngle(){return Math.PI_4}roofingMaterialChoices(){return[this._makeRoofingMaterialChoice("Metal",this.materials.RPANEL),this._makeRoofingMaterialChoice("Shingles",this.materials.SHINGLES)]}}},50698:(e,t,r)=>{const n=r(88548),i=r(67751),s=r(27247),o=r(6107),a=r(49030),l=r(66608);e.exports=class OasisRoofingLevel extends n{_framingClasses(){return[i,s,o,l,a]}}},81925:(e,t,r)=>{const n=r(63768),i=r(18427),s=r(20160),o=r(13998);e.exports=class OasisSimpleLift extends i{_defaultFramer(){return new s(this)}_defaultFramingDescriptor(){return new o(this)}cradleInsetForSides(){return n.unit(1,"ft")}framing(){return this._framing??=this.framer.makeFraming()}components(){return this.framing()}attachmentPoints(){return this.framer.attachmentPoints()}attachmentGeometry(){return this.framer.attachmentGeometry()}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_framing"]}}},20160:(e,t,r)=>{const{$P:n,Polygon:i}=r(62048),s=r(73399),o=r(11464);e.exports=class OasisSimpleLiftFramer extends s{framingSpecifier(){return this.framingDescriptor().framingSpecifier()}framingOffset(){return this.framingDescriptor().framingOffset()}framingDistanceFromStern(){return this.framingDescriptor().framingDistanceFromStern()}framingSpan(){return this.framingDescriptor().framingSpan()}attachmentPointsOffset(){return this.framingDescriptor().attachmentPointsOffset()}_supportEdges(){const e=this.frame(),t=this.offsetHelper().applyOffsetToEdges(e.slip().sideEdges(),this.framingOffset()),r=this.framingDistanceFromStern().toNumeric(this._unit()),n=this.framingSpan().toNumeric(this._unit());return[this.spanAcrossEdgesAt(r,t),this.spanAcrossEdgesAt(r+n,t)]}attachmentGeometry(){const e=this._supportEdges();return new i([e.first().begin(),e.first().end(),e.last().end(),e.last().begin()])}makeFraming(){const e=this.framingSpecifier(),t=this.materialDepth(e),r=this.materialWidth(e)/2;return this._supportEdges().flatMap((e=>[e.shiftedAlongNormalBy(r),e.shiftedAlongNormalBy(-r).reversed()])).map((r=>this._createMaterial(o,r,e,n(-t/2,0),r.normal().negated())))}attachmentPoints(){return this._supportEdges().flatMap((e=>e.endpoints()))}}},13998:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),s=r(61447);e.exports=class OasisSimpleLiftFramingDescriptor extends s{framingSpecifier(){return this.materials.CHANNEL5}baseZ(){return this.frame().slip().dock().zLevel()}framingDistanceFromStern(){return n.unit(2,"ft")}framingSpan(){return n.unit(10,"ft")}framingOffset(){return i(-this.framingEndInset(),-this.framingLateralInset(),this.baseZ()+this._framingZOffset())}framingEndInset(){return 0}framingLateralInset(){return this.frame().cradleInsetForSides().toNumeric(this.unit())}_framingZOffset(){return n.unit(1,"ft").toNumeric(this.unit())}bunkOffset(){return i(this._bunkEndOffsetFromFraming(),-this._bunkInsetFromEdgeOfFraming())}_bunkInsetFromEdgeOfFraming(){return 0}_bunkEndOffsetFromFraming(){return n.unit(1,"ft").toNumeric(this.unit())}spanBetweenBunks(){return n.unit(4,"ft")}}},72241:(e,t,r)=>{const{Rectangle:n}=r(62048),i=r(88646),s=r(56214),o=r(30202),a=r(6556),l=r(74716);e.exports=class OasisSling extends o{constructor(e,t,r,n,i){super(e,n,void 0,i),this._controlPoint1=t,this._controlPoint2=r}controlPoint1(){return this._controlPoint1}controlPoint2(){return this._controlPoint2}_defaultCrossSection(){const e=this.materialSpecifier(),t=e.details().width.toNumeric(this.unit()),r=e.details().depth.toNumeric(this.unit());return new i([new s(new n(-t/2,0,t,r))])}selfMaterialLineItems(){return[new a(1,this.materialSpecifier())]}threeFigure(){return new l(this)}}},10460:(e,t,r)=>{const n=r(63768),{supply:i}=r(50988),{ProportionalEdgeLocator:s}=r(62048),o=r(80365),a=r(18427),l=r(72241);class OasisSlingLift extends a{static type(){return"Sling"}requiresParallelLiftShaft(){return!0}includeInLaborCosts(){return!1}slingSpecifier(){return this.materials.SLING}slings(){return this._slings??=this._defaultSlings()}slingInsetForSides(){return n.unit(1,"ft")}_defaultSlings(){const e=this.slingInsetForSides().toNumeric(this.unit()),t=this.slip().dock().zLevel(),r=n.unit(1,"ft").toNumeric(this.unit()),i=this.slip().sideEdges().map((n=>n.shiftedAlongNormalBy(-e).addZ(t+r)));return this.proportionallySpaceAlongEdges(i,1/3,!1).map((e=>this._createSling(e)))}_createSling(e){const t=this.slingSpecifier(),r=n.unit(2,"ft").toNumeric(this.unit()),i=new s(e,1/4).addZ(r),o=new s(e,3/4).addZ(r),a=new l(e.begin(),i,o,e.end(),t);return a.setComponentOf(this),a}components(){return this.slings()}attachmentPoints(){return this.slings().flatMap((e=>[e.locator(),e.endLocator()]))}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_slings"]}}i(OasisSlingLift,o),e.exports=OasisSlingLift},49030:(e,t,r)=>{const n=r(77588),i=r(46873),s=r(7787);e.exports=class OasisSplitRoof extends i{static framingType(){return"Split roof"}_defaultFramer(){return new n(this)}_defaultFramingDescriptor(){return new s(this)}flipped(){return!0}splits(){return[this.framer.splitEdge()]}splitOverhang(){return this.descriptor.splitOverhang()}setPitch(e){super.setPitch(e),this.framingLevel().resetDock()}trusses(){return[]}supportBaseShapes(){return this.framer.roofingShapes()}}},7787:(e,t,r)=>{const n=r(63768),i=r(6529);e.exports=class OasisSplitRoofFramingDescriptor extends i{splitOverhang(){return n.unit(16,"in")}_pitchRises(){return[1,2,3,4]}defaultPitchChoiceIndex(){return 1}}},74783:(e,t,r)=>{const n=r(63768),{ExtrudedPolygon:i}=r(62048),s=r(85438),o=r(6556),a=r(59663),l=r(22093),c=r(55848),u=r(15004),d=r(47910),h=r(5834);e.exports=class OasisStorageUnit extends c{static iconName(){return"rectangle"}static defaultWidth(){return n.unit(4,"ft")}static defaultLength(){return n.unit(8,"ft")}static builder(e){return new l(e,this)}_defaultAngle(){return 0}zLevel(){return-n.unit(2,"ft").toNumeric(this.unit())}height(){return n.unit(8,"ft")}shape3D(){return this._shape3D??=new i(this.geometry(),-this.height().toNumeric(this.unit()),void 0,!1)}components(){return[]}selfMaterialLineItems(){return[new o(1,this.materials.STORAGE_UNIT)]}defaultFigure(){const e=new a(this,h(this.materialNames().first()));return e.setSelfHandle(new d(e)),e.setOtherHandles(this.vertices().map((e=>new s(this,e)))),e}threeFigure(){return new u(this)}materialNames(){return["white-plastic"]}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_shape3D"]}}},66608:(e,t,r)=>{const{extend:n}=r(50988),i=r(36882),s=r(24394),o=r(6107),a=r(31908);class OasisWoodenFrameHipRoof extends o{static framingType(){return"Hip roof (wooden frame)"}_defaultFramer(){return new i(this)}_defaultFramingDescriptor(){return new s(this)}trusses(){return[]}roofingMaterial(){return this.materials.SHINGLES}memento(){return{roofingMaterial:this._roofingMaterial||this.roofingMaterial()}}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_roofingMaterial"]}}n(OasisWoodenFrameHipRoof,a),e.exports=OasisWoodenFrameHipRoof},3751:(e,t,r)=>{const{$P:n}=r(62048),i=r(61836);e.exports=class OasisFlatRoofFramer extends i{maxJoistSpacing(){return this.descriptor.maxFlatRoofJoistSpacing()}framingEdgePairs(){return[{edges:this.roof().sideEdges(),includeEnds:!0,doubleOnEnd:!1,doubleOnMiddle:!1}]}_makeJoist(e,t,r,i){const s=this.descriptor.joistSpecifier(),o=this.materialDepth(s),a=this.framingDescriptor().joistMaterialClass();return this._createMaterial(a,e,s,n(o/2,0),i)}roofingShape(){return this.roof().geometry().movedBy(0,0,this.joistOffset().z())}roofingShapes(){return[this.roofingShape()]}area(){return this.roofingShape().area()}}},5389:(e,t,r)=>{const{PolarCoordinate:n}=r(62048),{$P:i}=r(62048),s=r(89927);e.exports=class OasisGableRoofFramer extends s{_includeEndTrusses(){return!0}_hasAngledTrussBraces(){return!0}ridgeEdge(){return this.roof().endEdges().map((e=>this._ridgeLocatorFor(e))).reduce(((e,t)=>e.to(t)))}_trussBaseEdges(){const e=this.roof().endEdges();return[...e.map((e=>({edge:e,normalOffset:-this.beamWidth()/2}))),...this._spacedTrussEdges(e,!1).map((e=>({edge:e})))]}framingEdgePairs(){const e=i(this.joistOffsetFromRidge().toNumeric(this._unit()),0,-this.beamDepth()),t=i(0,0,-this.beamDepth());return this.roof().sideEdges().map((r=>({edges:this._pitchedEdgesFromSideEdge(r,e,t),includeEnds:!0,doubleOnEnd:!1,doubleOnMiddle:!1})))}roofingShapes(){const e=this.beamDepth(),t=this._adjustedRidgeEdge();return this.roof().sideEdges().map((r=>this._clockwisePolygonFromEdgePair(t,r.shiftedAlongNormalBy(e).addZ(2*-e))))}_flashingSegmentDescriptors(){const e=this.roof(),t=this._adjustedRidgeEdge(),r=t.direction(),s=e.crossAxis(),o=e.mainAxis().cross(s),a=e.pitchBaseGeometry().xy();return this.roofingShapes().flatMap((l=>l.edges().map((l=>{if((t.begin().equals(l.begin())||t.begin().equals(l.end()))&&(t.end().equals(l.begin())||t.end().equals(l.end())))return;const c=new n(1,e.pitchAngle()),u=l.xy().center().subtract(a.centroid()).normalized().dot(s),d=Math.abs(l.xy().direction().dot(s)).isNearTo(1)?l.normal():s.multipliedBy(c.x()).add(o.multipliedBy(c.y()*u)).multipliedBy(l.direction().dot(r));return this._createFlashingSegmentDescriptor(l,i(0,0),d)})).filter((e=>e))))}_adjustedRidgeEdge(){return this.ridgeEdge().addZ(-this.beamDepth()/Math.cos(this.roof().pitchAngle())*2)}_pitchedEdgesFromSideEdge(e,t=i(0,0),r=i(0,0)){return this.roof().endEdges().map((n=>{const i=this._ridgeLocatorFor(n),s=e.endpoints().find((e=>n.containsPoint(e))),o=i.to(s);return this.offsetHelper().applyOffsetToEdge(o,t,r)}))}}},55521:(e,t,r)=>{const{$P:n}=r(62048),{PolarCoordinate:i}=r(62048),s=r(89927);e.exports=class OasisHipRoofFramer extends s{_includeEndTrusses(){return!1}_hasAngledTrussBraces(){return!1}_endTrussInset(){return 0}ridgeInset(){return this.roof().geometryWidth()/2}ridgeEdge(){return this.endEdges().map((e=>this._ridgeLocatorFor(e))).reduce(((e,t)=>this.offsetHelper().applyOffsetToEdge(e.to(t),n(this.ridgeInset(),0))))}_extraHipTrussEdges(){return this.endEdges().flatMap((e=>{const t=e.center().subtract(e.normal().multipliedBy(this.ridgeInset()));return[...e.endpoints(),e.center()].map((e=>t.to(e)))}))}_trussBaseEdges(){const e=this.endEdges().map((e=>e.shiftedAlongNormalBy(-this.ridgeInset())));return[...this._spacedTrussEdges(e).map((e=>({edge:e}))),...this._extraHipTrussEdges().map((e=>({edge:e,baseOfRidgeLocator:e.begin(),includeRidgeBrace:!1})))]}framingEdgePairs(){const e=n(this.joistOffsetFromRidge().toNumeric(this._unit()),0),t=n(0,0),r=this.hipEdges(e,t);return r.map(((e,t)=>({edges:[e,r[(t+1)%r.length]],includeEnds:!0,doubleOnEnd:!1,doubleOnMiddle:!1})))}roofingShapes(){const e=e=>{const t=e.direction().cross(e.normal()).multipliedBy(this.roofingOffset());return e.movedByDelta(t).relativeTo(this.frame().referencePoint())},t=this.hipEdges(n(-this.beamDepth()*this.roofPitch()/Math.SQRT2,0));return t.map(((r,n)=>{const i=[r,t[(n+1)%t.length]].map((t=>e(t)));return this._clockwisePolygonFromEdgePair(...i)})).filter((e=>e))}_flashingSegmentDescriptors(){const e=this.roof(),t=e.pitchAngle(),r=new i(1,t);return super._flashingSegmentDescriptors().map((i=>{const s=i.edge,o=s.normal().multipliedBy(r.x()).addZ(r.y()).cross(s.direction()).multipliedBy(-this.beamDepth()-this.materialDepth(this.descriptor.roofingSpecifier())),a=n(2*-this.beamWidth(),this.beamDepth()),l=this.offsetHelper().applyOffsetToEdge(s.movedByDelta(o),a).relativeTo(e.referencePoint());return i.edge=l,i.angle=t,i}))}_makeFlashingSegment(e){return this._createAngledFlashing(e.edge,e.angle)}hipEdges(e=n(0,0),t=n(0,0)){return this.endEdges().flatMap((r=>{const n=r.normal().multipliedBy(-this.ridgeInset()),i=r.center().movedBy(n.x(),n.y(),-this.ridgeHeight());return r.endpoints().map((r=>this.offsetHelper().applyOffsetToEdge(i.to(r),e,t)))}))}roofingOffset(){const e=this.beamDepth(),t=this.roof().pitchAngle();return Math.sqrt((e*Math.cos(t))**2+2*(e*Math.sin(t))**2)}_createAngledFlashing(e,t,r=n(0,0),i=e.normal()){const s=this.frame(),o=this.descriptor.flashingMaterialClass().builder(s).beginLocator(e.begin()).endLocator(e.end()).materialSpecifier(this.descriptor.flashingSpecifier()).offsetFromCenter(r).planarNormal(i).angle(t).build();return o.setComponentOf(s),o}_pitchedEdgesFromBaseEdge(e,t){return e.endpoints().map((e=>{const r=this.ridgeEdge().endpoints().some((e=>e.equals(t)))?n(this.beamWidth()/2,0):n(0,0);return this.offsetHelper().applyOffsetToEdge(t.to(e),r,n(0,0))}))}}},89927:(e,t,r)=>{const n=r(63768),{$P:i,PolarCoordinate:s}=r(62048),{supply:o}=r(50988),a=r(61836),l=r(76133),c=r(42903),u=r(27817);class OasisPitchedRoofFramer extends a{_makeJoist(e,t,r,n){const o=this.joistSpecifier(),a=this.materialDepth(o),l=new s(1,this.roof().pitchAngle()),c=this.roof().pitchBaseGeometry().xy(),u=e.xy().center().subtract(c.centroid()).normalized().dot(e.normal().negated()),d=e.normal().multipliedBy(l.x()).add(e.direction().cross(e.normal()).multipliedBy(l.y()*u)),h=this.framingDescriptor().joistMaterialClass();return this._createMaterial(h,e,o,i(-a/2,0),n??d)}_clockwisePolygonFromEdgePair(...e){return l.clockwisePolygonFromEdgePair(...e)}joistOffsetFromRidge(){return n.unit(6,"in")}_ridgeLocatorFor(e){return e.center().addZ(-this.ridgeHeight())}maxJoistSpacing(){return this.descriptor.maxPitchedRoofJoistSpacing()}_applyOffsetToJoistEdges(e,t){return e}roofPitch(){return this.roof().pitch()}ridgeHeight(){return this.roofPitch()*this.roof().geometryWidth()/2}}u(OasisPitchedRoofFramer,"framingDescriptor",["trussBraceAngle","maxTrussSpacing"]),u(OasisPitchedRoofFramer,"roof",["endEdges"]),o(OasisPitchedRoofFramer,c),e.exports=OasisPitchedRoofFramer},61836:(e,t,r)=>{const n=r(69639);e.exports=class OasisRoofFramer extends n{get descriptor(){return this.framingDescriptor()}}},77588:(e,t,r)=>{const{Polygon:n,Edge:i,$P:s}=r(62048),o=r(89927);e.exports=class OasisSplitRoofFramer extends o{joistEdgeGroups(){const e=this.roof().crossAxis(),t=this.descriptor.materialWidth(this.descriptor.joistSpecifier());return this.roofingShapes().map((r=>r.edges().filter((t=>t.xy().direction().dot(e).isNearTo(0))).map((e=>e.stretchedBy(-t)))))}framingEdgePairs(){return this.joistEdgeGroups().map((e=>({edges:e,includeEnds:!0,doubleOnEnd:!1,doubleOnMiddle:!1})))}_makeJoist(e,t,r,o){const a=this.joistSpecifier(),l=this.materialDepth(a),c=e.direction().cross(e.normal()),u=t=>s(t.dot(c),t.dot(e.direction())),d=new i(...e.endpoints().map(u)),h=this.roofingShapes().find((t=>{const r=new n(t.vertices().map(u));return t.containsEdge(e)&&r.containsEdge(d)}));o=e.direction().cross(h.normal());const p=this.framingDescriptor().joistMaterialClass();return this._createMaterial(p,e,a,s(l/2,0),o)}roofingShapes(){const e=this.roof().pitchBaseGeometry().edges(),[t,r]=e.flatMap((e=>this.splitEdge().intersectionsWithLineIn2D(e))).filter((e=>e)),n=t.to(r),i=this.ridgeHeight();return e.filter((e=>Math.abs(e.direction().dot(n.direction())).isNearTo(1))).map(((e,t)=>{const r=n.direction().dot(e.direction())>0?n.reversed():n,s=this.descriptor.splitOverhang().toNumeric(this._unit())/2,o=r.shiftedAlongNormalBy(s*Math.sign(r.center().subtract(e.center()).dot(r.normal())));return this._clockwisePolygonFromEdgePair(e.addZ(-i*t),o.addZ(-i*(t+1))).relatedTo(this.frame().referencePoint())}))}splitEdge(){const e=this.roof().sideEdges();return e.first().center().to(e.last().center())}_flashingSegmentDescriptors(){return this.roof().roofing().flatMap((e=>{const t=e.geometry();return t.edges().map((e=>{const r=e.direction().cross(t.normal());return this._createFlashingSegmentDescriptor(e,s(0,0),r)}))}))}}},1776:(e,t,r)=>{const{Polygon:n,NormalToEdgeLocator:i}=r(62048),s=r(38222);e.exports=class OasisDockSlipGeometryStrategy extends s{constructor(e,t){super(),this._defaultWidth=e,this._defaultLength=t}defaultWidth(){return this._defaultWidth}defaultLength(){return this._defaultLength}buildGeometry(e,t,r){const s=this.defaultWidth(),o=this.defaultLength(),a=e.addZ(r);return new n([new i(a,0,-s/2),new i(a,0,s/2),new i(a,-o,s/2),new i(a,-o,-s/2)])}}},23981:(e,t,r)=>{const{$P:n}=r(62048),i=r(6556),s=r(30691);e.exports=class OasisChannelPlateHelper{constructor(e){this._dock=e}dock(){return this._dock}channels(){return this.dock().channel()}get materials(){return this.dock().materials}plateLineItems(){const e=this.materials.FOUR_HOLE_PLATE,t=this.materials.TWO_HOLE_PLATE,r=this.materials.CARRIAGE_BOLT_35x12,n=this.materials.WASHER_12,s=this.materials.NUT_12,o=this.channels().reduce(((r,n)=>{const i=this.isChannelTerminal(n),s=i?t:e;return r[i?"terminalPlates":"plates"]+=2,r.holes+=2*s.details().holes,r}),{plates:0,terminalPlates:0,holes:0});return[new i(o.plates,e),new i(o.terminalPlates,t),new i(o.holes,r),new i(o.holes,s),new i(2*o.holes,n)]}isChannelTerminal(e){const t=this.channels();if(t.first()===e||t.last()===e)return!0;const r=this.channelsInSameColumn(e);return r.first()===e||r.last()===e}channelsInSameColumn(e){const t=this.channels(),r=e.edge().direction(),i=n(0,0,-1),o=s.axisAlign(e.edge(),r,i);return t.filter((t=>{if(t===e)return!0;return s.axisAlign(t.edge(),r,i).overlapsBySignificantDistance(o)}))}}},83265:(e,t,r)=>{const n=r(63768),{MaterialSpecifier:i,lumber:s}=r(93613),{material:o}=r(71181),a=r(42947),l=(e,t)=>new i(e,t,{width:s.PT2x6.details().width,depth:s.PT2x6.details().depth,lumberSpecifier:s.PT2x6,purchaseLengthSpecifiers:[new i(`${e}x8`,`2" x 8" x 8' ${t}`,{length:n.unit(8,"ft"),pricingIdentifier:e}),new i(`${e}x12`,`2" x 8" x 12' ${t}`,{length:n.unit(12,"ft"),pricingIdentifier:e}),new i(`${e}x16`,`2" x 8" x 16' ${t}`,{length:n.unit(16,"ft"),pricingIdentifier:e})]}),c=[l("TREX-BD","Trex Beach Dune"),l("TREX-CS","Trex Clam Shell"),l("TREX-S","Trex Saddle"),l("TREX-CB","Trex Coastal Bluff"),l("TREX-FW","Trex Foggy Wharf"),l("TREX-RH","Trex Rocky Harbor"),l("TREX-TS","Trex Toasted Sand"),l("CDEK-BHG","Choice Dek Beach House Grey"),l("CDEK-HB","Choice Dek Harvest Brown"),l("CDEK-CR","Choice Dek Coastal Redwood")],u=new i("PILE45NG",'4 1/2" PILE Non galv',{diameter:n.unit(4.5,"in"),width:n.unit(4.5,"in"),purchaseLengthSpecifiers:[new i("PILE45NGx21","4 1/2\" x 21' PILE NON GALV",{length:n.unit(21,"ft"),pricingIdentifier:"PILE45NG"}),new i("PILE45NGx32","4 1/2\" x 32' PILE NON GALV",{length:n.unit(32,"ft"),pricingIdentifier:"PILE45NG"})]}),d=[new i("PILE278",'2 7/8" PILE',{diameter:n.unit(1.875,"in"),width:n.unit(1.875,"in"),purchaseLengthSpecifiers:[new i("PILE278x21","2 7/8\" x 21' PILE",{length:n.unit(21,"ft"),pricingIdentifier:"PILE278"})]}),new i("PILE45",'4 1/2" PILE',{diameter:n.unit(4.5,"in"),width:n.unit(4.5,"in"),nonGalvanized:u,purchaseLengthSpecifiers:[new i("PILE45x21","4 1/2\" x 21' PILE",{length:n.unit(21,"ft"),pricingIdentifier:"PILE45"})]}),u,new i("CHANNEL5",'1 x 5" CHANNEL',{width:n.unit(1,"in"),depth:n.unit(5,"in"),thickness:n.unit(.125,"in"),purchaseLengthSpecifiers:[new i("CHANNEL5x20","5\" x 20' CHANNEL",{length:n.unit(20,"ft"),pricingIdentifier:"CHANNEL5"})]}),new i("CHANNEL4",'1 x 4" CHANNEL',{width:n.unit(1,"in"),depth:n.unit(4,"in"),thickness:n.unit(.1,"in"),purchaseLengthSpecifiers:[new i("CHANNEL4x20","4\" x 20' CHANNEL",{length:n.unit(20,"ft"),pricingIdentifier:"CHANNEL4"})]}),new i("STEEL2x3",'2 x 3" STEEL',{width:n.unit(2,"in"),depth:n.unit(3,"in"),purchaseLengthSpecifiers:[new i("STEEL2x3x20",'2" x 3" x 20\' STEEL',{length:n.unit(20,"ft"),pricingIdentifier:"STEEL2x3"}),new i("STEEL2x3x24",'2" x 3" x 24\' STEEL',{length:n.unit(24,"ft"),pricingIdentifier:"STEEL2x3"})]}),new i("RPANEL","R PANEL",{depth:n.unit(.25,"in"),materialName:"metal-roof",color:"#aaaaaa",pricingUnit:"sqft"}),o.SHINGLES,o.PW4x8,new i("ROOF_FLASHING","ROOF FLASHING",{width:n.unit(4,"in"),depth:n.unit(4,"in"),thickness:n.unit(3/8,"in"),purchaseLengthSpecifiers:[new i("ROOF_FLASHINGx12","12' ROOF FLASHING",{length:n.unit(12,"ft"),pricingIdentifier:"ROOF_FLASHING"})]}),new i("STEEL3x3",'3" x 3" STEEL',{width:n.unit(3,"in"),depth:n.unit(3,"in"),purchaseLengthSpecifiers:[new i("STEEL3x3x20",'3" x 3" x 20\' STEEL',{length:n.unit(20,"ft"),pricingIdentifier:"STEEL3x3"}),new i("STEEL3x3x24",'3" x 3" x 24\' STEEL',{length:n.unit(24,"ft"),pricingIdentifier:"STEEL3x3"}),new i("STEEL3x3x30",'3" x 3" x 30\' STEEL',{length:n.unit(30,"ft"),pricingIdentifier:"STEEL3x3"})]}),new i("STEEL4x4",'4" x 4" STEEL',{width:n.unit(4,"in"),depth:n.unit(4,"in"),purchaseLengthSpecifiers:[new i("STEEL4x4x20",'4" x 4" x 20\' STEEL',{length:n.unit(20,"ft"),pricingIdentifier:"STEEL4x4"}),new i("STEEL4x4x24",'4" x 4" x 24\' STEEL',{length:n.unit(24,"ft"),pricingIdentifier:"STEEL4x4"}),new i("STEEL4x4x30",'4" x 4" x 30\' STEEL',{length:n.unit(30,"ft"),pricingIdentifier:"STEEL4x4"})]}),new i("STEEL2x4",'2" x 4" STEEL',{width:n.unit(2,"in"),depth:n.unit(4,"in"),purchaseLengthSpecifiers:[new i("STEEL2x4x24",'2" x 4" x 24\' STEEL',{length:n.unit(24,"ft"),pricingIdentifier:"STEEL2x4"})]}),new i("LIFT_SHAFT","LIFT SHAFT",{radius:n.unit(.75,"in"),materialName:"steel",strokeStyle:"#5c5c5c",fillStyle:"#aaaaaa",purchaseLengthSpecifiers:[new i("LIFT_SHAFTx24","24' LIFT SHAFT",{length:n.unit(24,"ft"),pricingIdentifier:"LIFT_SHAFT"})]}),new i("PWC_GRATE","PWC GRATE",{depth:n.unit(.25,"in"),materialName:"aluminum-walkway-mesh",color:"#aaaaaa"}),new i("SLING","SLING",{depth:n.unit(.25,"in"),width:n.unit(6,"in"),materialName:"white-plastic",fillStyle:"#eeeeee",strokeStyle:"transparent"}),new i("LIFT_CABLE14",'1/4" LIFT CABLE',{radius:n.unit(.25,"in"),materialName:"steel",strokeStyle:"#5c5c5c",fillStyle:"#aaaaaa",purchaseLengthSpecifiers:[new i("LIFT_CABLE_14x25","1/4\" x 250' LIFT CABLE",{length:n.unit(250,"ft"),pricingIdentifier:"LIFT_CABLE14"}),new i("LIFT_CABLE_14x50","1/4\" x 500' LIFT CABLE",{length:n.unit(500,"ft"),pricingIdentifier:"LIFT_CABLE14"})]}),new i("LIFT_CABLE316",'3/16" LIFT CABLE',{radius:n.unit(.1875,"in"),materialName:"steel",strokeStyle:"#5c5c5c",fillStyle:"#aaaaaa",purchaseLengthSpecifiers:[new i("LIFT_CABLE_316x25","3/16\" x 250' LIFT CABLE",{length:n.unit(250,"ft"),pricingIdentifier:"LIFT_CABLE316"}),new i("LIFT_CABLE_316x50","3/16\" x 500' LIFT CABLE",{length:n.unit(500,"ft"),pricingIdentifier:"LIFT_CABLE316"})]}),new i("RAILING_CABLE","RAILING CABLE",{radius:n.unit(.1875,"in"),materialName:"steel",strokeStyle:"#5c5c5c",fillStyle:"#aaaaaa",purchaseLengthSpecifiers:[new i("RAILING_CABLEx25","250' RAILING CABLE",{length:n.unit(250,"ft"),pricingIdentifier:"RAILING_CABLE"}),new i("RAILING_CABLEx50","500' RAILING CABLE",{length:n.unit(500,"ft"),pricingIdentifier:"RAILING_CABLE"})]}),new i("LIFT_MOTOR_ASSEMBLY","LIFT MOTOR ASSEMBLY"),new i("LIFT_PULLEY","LIFT PULLEY"),new i("STORAGE_UNIT","STORAGE UNIT"),new i("LADDER_ACCESSORY","LADDER ACCESSORY"),new i("PILE_LABOR","PILE LABOR"),new i("CRADLE_LABOR","CRADLE LABOR"),new i("ROOFING_LABOR","ROOFING LABOR"),new i("DECKING_LABOR","DECKING LABOR"),...c,new i("PT2x6",'Lumber 2" x 6"',{...s.PT2x6.details(),lcadSpecifier:s.PT2x6,purchaseLengthSpecifiers:[new i("PT2x6x8",'2" x 6" x 8\' Lumber',{length:n.unit(8,"ft"),pricingIdentifier:"PT2x6"}),new i("PT2x6x12",'2" x 6" x 12\' Lumber',{length:n.unit(12,"ft"),pricingIdentifier:"PT2x6"}),new i("PT2x6x16",'2" x 6" x 16\' Lumber',{length:n.unit(16,"ft"),pricingIdentifier:"PT2x6"})]}),new i("PT2x8",'Lumber 2" x 8"',{...s.PT2x8.details(),lcadSpecifier:s.PT2x8,purchaseLengthSpecifiers:[new i("PT2x8x12",'2" x 8" x 12\' Lumber',{length:n.unit(12,"ft"),pricingIdentifier:"PT2x8"}),new i("PT2x8x16",'2" x 8" x 16\' Lumber',{length:n.unit(16,"ft"),pricingIdentifier:"PT2x8"})]}),new i("TWO_HOLE_PLATE","2-HOLE PLATE",{holes:2}),new i("FOUR_HOLE_PLATE","4-HOLE PLATE",{holes:4}),new i("CARRIAGE_BOLT_35x12",'3.5" x 1/2" GALVANIZED CARRIAGE BOLT'),new i("WASHER_12",'1/2" WASHER'),new i("NUT_12",'1/2" NUT')],h={};d.forEach((e=>h[e.identifier()]=e)),h.lookupName=(e,t)=>{const r=h[e];return t?.[e]?.[a.item]??r.name()};const p=e=>({identifier:e.identifier(),displayValue:e.name(),[a.item]:e.name(),[a.description]:e.description()});h.defaultMaterialDefinitions=()=>d.flatMap((e=>e.details().purchaseLengthSpecifiers?e.details().purchaseLengthSpecifiers.map((e=>p(e))):p(e))),e.exports=h},83724:(e,t,r)=>{const n=r(10066);e.exports={...n,POST_ANNOTATIONS:"Post Annotations",CHANNEL_ANNOTATIONS:"Channel Annotations",HEADER_ANNOTATIONS:"Header Annotations",DOCK_ANNOTATIONS:"Dock Dimensions"}},71968:(e,t,r)=>{const n=r(83741),i=r(27688);e.exports=class OasisPostMountStyle extends n{postClass(){return i}}},28729:(e,t,r)=>{const n=r(63768),{CompositeFigure:i}=r(7340),{Composite3DFigure:s}=r(37732),{$P:o,Polygon:a,Circle:l}=r(62048),{supply:c}=r(50988),u=r(72596),d=r(83102),h=r(80365),p=r(20901),m=r(88646),f=r(30202),g=r(6556);class OasisRailingBlock extends d{constructor(e){super(),this._edge=e}edge(){return this._edge}geometry(){return new a([this.edge().begin(),this.edge().end()])}bottomRailHeightNumeric(){return this.componentOf().bottomRailHeight().toNumeric(this.unit())}_bottomRailDepthNumeric(){return this.bottomRailSpecifier().details().width.toNumeric(this.unit())}_infillHeightNumeric(){return this.postHeight().toNumeric(this.unit())-this._bottomRailDepthNumeric()-this.bottomRailHeightNumeric()}postHeight(){return this.componentOf().postProvider().postHeight()}postSpecifier(){return this.componentOf().railingPosts().first().legMaterialSpecifier()}postWidth(){return this.postSpecifier().details().width}bottomRailSpecifier(){return this.materials.STEEL3x3}cableSpecifier(){return this.materials.RAILING_CABLE}cables(){return this._cables??=this._defaultCables()}bottomRail(){return this._bottomRail??=this._createRail(this.bottomRailHeightNumeric())}_defaultCables(){const e=this.bottomRail().edge(),t=e.addZ(-this._infillHeightNumeric()),r=t.begin().to(e.begin()),i=t.end().to(e.end()),s=n.unit(6,"in"),a=this.equallySpaceAlongEdges([r,i],s,!1).map((e=>e.relativeToEdge(this.edge()))),c=this.cableSpecifier(),u=c.details().radius.toNumeric(this.unit()),d=new m([new p(new l(o(0,0),u))]);return a.map((e=>{const t=new f(e.begin(),e.end(),d,c);return t.setComponentOf(this),t}))}_createRail(e){const t=this._bottomRailDepthNumeric(),r=t,n=this.postWidth().toNumeric(this.unit()),i=this.edge().stretchedBy(-n).addZ(-(e+t)).relativeToEdge(this.edge()),s=o(0,-r/2),a=new u(i.begin(),i.end(),this.bottomRailSpecifier(),s,o(0,0,-1));return a.setComponentOf(this),a}components(){return[this.bottomRail(),...this.cables()]}selfMaterialLineItems(){const e=this.cables().sum((e=>e.edge().length()));return[new g(n.unit(e,this.unit()),this.cableSpecifier())]}defaultFigure(){return i.withModel(this)}threeFigure(){return s.withModel(this)}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_bottomRail","_cables"]}}c(OasisRailingBlock,h),e.exports=OasisRailingBlock},26686:(e,t,r)=>{const n=r(16152),i=r(86580),s=r(71968),o=r(56677);e.exports=class OasisRailingCollection extends i{sectionClass(){return this.railingStyle().sectionClass()}runClass(){return this.railingStyle().runClass()}railingHeight(){return this.railingStyle().railingHeight()}bottomRailHeight(){return this.railingStyle().bottomRailHeight()}postHeight(){return this.railingStyle().postHeight()}postMountStyle(){return this._postMountStyle??=new s}railingStyle(){return this._railingStyle??=new o("cable","Cable","cable-rail")}zLevel(){return this.boundingCube().high()}defaultFigure(){return new n(this)}}},27688:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),{CompositeFigure:s}=r(7340),{Composite3DFigure:o}=r(37732),a=r(72596),l=r(80371),c=r(83265);e.exports=class OasisRailingPost extends l{static basePlateMaterialSpecifier(){return c.STEEL4x4}static defaultWidth(){return this.basePlateMaterialSpecifier().details().width}mountStyle(){return this.postProvider().postMountStyle()}height(){return this.postProvider().postHeight()}legMaterialSpecifier(){return this.materials.STEEL3x3}basePlateMaterialSpecifier(){return this.constructor.basePlateMaterialSpecifier()}length(){return this.legMaterialSpecifier().details().depth}width(){return this.legMaterialSpecifier().details().width}basePlateThickness(){return n.unit(.25,"in")}leg(){return this._leg??=this._defaultLeg()}basePlate(){return this._basePlate??=this._defaultBasePlate()}_defaultLeg(){const e=this.legMaterialSpecifier(),t=this.componentOf().edge().direction(),r=new a(this.topLocator(),this.bottomLocator(),e,i(0,0),t);return r.setComponentOf(this),r}_defaultBasePlate(){const e=this.basePlateThickness().toNumeric(this.unit()),t=this.basePlateMaterialSpecifier(),r=this.componentOf().edge().direction(),n=new a(this.bottomLocator().addZ(-e),this.bottomLocator(),t,i(0,0),r);return n.setComponentOf(this),n}components(){return[this.leg(),this.basePlate()]}componentsMaterialLineItems(){return this.leg().materialLineItems()}defaultFigure(){return s.withModel(this)}threeFigure(){return o.withModel(this)}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_leg","_basePlate"]}}},83073:(e,t,r)=>{const n=r(59503);e.exports=class OasisRailingRun extends n{}},24148:(e,t,r)=>{const n=r(63768),{$P:i,FixedEdgeLocator:s}=r(62048),{RailLengthHelper:o}=r(8423),a=r(72596),l=r(10590),c=r(28729),u=r(30691);e.exports=class OasisRailingSection extends l{minRailLength(){return this.minLength()}maxRailLength(){return n.unit(8,"ft")}_defaultRails(){const e=this.componentLayoutEdge().addZ(-this.railingHeight().toNumeric(this.unit())),t=this.materials.STEEL2x4,r=i(0,-t.details().width.toNumeric(this.unit())/2),n=new a(e.begin(),e.end(),t,r,i(0,0,-1));return n.setComponentOf(this),[n]}railingHeight(){return this.postProvider().railingHeight()}bottomRailHeight(){return this.postProvider().bottomRailHeight()}postLayoutEdge(){const e=this.componentLayoutEdge(),t=this.postWidth().toNumeric(this.unit()),r=this.sectionConnectedToBegin()?0:-t/2,n=this.sectionConnectedToEnd()?0:-t/2;return u.stretchedEdgeBy(e,r,n).relativeToEdge(e)}postLocations(){const e=this.postLayoutEdge(),t=n.unit(e.length().roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES),this.unit());if(n.smaller(t,this.minRailLength()))return[];const r=new o(this.minRailLength(),this.maxRailLength(),this.unit());r.setMode(this.postProvider().railLengthMode?.());const i=r.railLengths(e),a=[new s(e,0)];return i.reduce(((t,r)=>{const n=new s(e,t+r);return a.push(n),t+r}),0),a}postWidth(){return this.postMountStyle().postClass().defaultWidth()}makePost(e,t,r){return new(this.postMountStyle().postClass())(e)}blockClass(){return c}isParallelToSection(e){return e.edge().isParallelTo(this.edge())}postMountStyle(){return this.postProvider().postMountStyle()}_isSelectable(){return!1}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_blocks"]}}},56677:(e,t,r)=>{const n=r(63768),i=r(58684),s=r(24148),o=r(83073),a=r(83265);e.exports=class OasisRailingStyle extends i{sectionClass(){return s}runClass(){return o}railingHeight(){return n.unit(40,"in")}bottomRailHeight(){return n.unit(6,"in")}postHeight(){const e=a.STEEL2x4.details().width;return n.subtract(this.railingHeight(),e)}}},21431:(e,t,r)=>{const n=r(48909),i=r(89689),s=r(46960);e.exports=class OasisDockSlipFigure extends n{constructor(e){super(),this.setModel(e)}selfHandle(){return new i(this)}_draw(e,t){if(!t.shapeOnly)if(this.model().componentOf())super._draw(e,t);else{e.strokeStyle="red",e.fillStyle="transparent",e.lineWidth=3;const t=this.model().geometry();e._drawPolygon(t),s(e,t,10,[Math.PI_4+this.model().angle()])}}boundingBox(){return this.model().boundingBox()}zLevel(){return(this.model().componentOf()?.zLevel()??0)-1}defaultHandles(){return[this.selfHandle()]}contains(e,t,r){return this.model().geometry().contains(e,t)}}},45566:(e,t,r)=>{const n=r(11987);e.exports=class OasisPileFigure extends n{_draw(e,t){e.fillStyle=this.model().color(),e.strokeStyle=this._contrastHexColor(this.model().color()),super._draw(e,t)}}},16152:(e,t,r)=>{const n=r(19418);e.exports=class OasisRailingCollectionFigure extends n{handlesAt(e,t,r){return[]}}},89689:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),s=r(47910),o=r(76905),a=r(53405),l=r(46748);e.exports=class OasisDockSlipHandle extends s{moveFromTo(e,t,r,n){const s=this.model();this._offset||(this._offset=i(e,t).subtract(s.referencePoint()));const o=i(r,n).subtract(this._offset),a=this.snappingLocation(o);this._frame=a?.frame;const l=a?.locator();this.tool().setIsComponentInValidPosition?.(Boolean(this._frame));const c=l??o.add(1,0).to(o.subtract(1,0)).center();s.referencePoint().setSource(c);const u=c.subtract(s.referencePoint()),d=s.referencePoint().moveBy(u.x(),u.y());return this._didMove||=d,d}activate(e){this._tool=e}deactivate(){this._frame&&(this.model().componentOf()?.removeSlip(this.model()),this._frame.addSlip(this.model())),this._didMove&&this.model().ensureTypeIsValid(),this._offset=void 0,this._tool=void 0,this._didMove=void 0}tool(){return this._tool}snappingLocation(e){if(0!==this._snappableFrames().length)return this._findSnappingLocation(e)}_snappableFrames(){return this.tool().project().docks()}model(){return this.object().model()}_findSnappingLocation(e){const t=l`${this.model().width()} + 2 * ${a.minimumWalkwayWidth()}`.toNumeric(this.model().unit()),r=this._snappableFrames().flatMap((e=>e.edges().map((t=>({edge:t,frame:e}))))).map((({edge:r,frame:n})=>{const i=r.stretchedBy(-t).closestPointTo(e,!1),s=r.closestRelativePointTo(i,!1);return{locator:()=>s,frame:n}})),{locatable:n,distance:i}=o.findClosest(e,r);return this.tool().shouldApplySnappingTolerance?.()?n.frame.geometry().containsPoint(e)||i<this.snappingTolerance().toNumeric(this.model().unit())?n:void 0:n}snappingTolerance(){return n.unit(5,"ft")}}},45292:(e,t,r)=>{const{Handle:n,PolygonFigure:i}=r(7340),{Polygon:s,$P:o}=r(62048);e.exports=class OasisPostRowHandle extends n{postRow(){return this.object()}selectableComponent(){return this.postRow()}deactivate(){this._offset=void 0}contains(e,t,r){return this.shape().contains(e,t)}moveFromTo(e,t,r,n){const i=this.postRow().edge().begin();this._offset||(this._offset=o(e,t).subtract(i));const s=o(r,n).subtract(this._offset),a=this.constrainedDeltaForTarget(s);return this.postRow().moveBy(a.x(),a.y())}constrainedDeltaForTarget(e){const t=this.postRow().edge(),r=this.postBoundaryEdges().filter((e=>e.isParallelToIn3D(t))).map((e=>t.normal().dot(e.begin()))),n=t.normal().dot(e).constrained(Math.min(...r),Math.max(...r)),i=t.normal().multipliedBy(n),s=this.postRow().edge().closestPointTo(i,!0);return i.subtract(s)}shape(){const e=this.postRow().edge().shiftedAlongNormalBy(5),t=this.postRow().edge().reversed().shiftedAlongNormalBy(5);return new s([...e.endpoints(),...t.endpoints()])}postBoundaryEdges(){const e=this.postRow().dock(),t=e.edges(),r=e.dockFramer().fullPostOffset();return e.dockFramer().offsetHelper().applyOffsetToEdges(t,r)}draw(e,t){const r=this.postRow().isOverridden()?this._overriddenProperties():this.indicatorProperties();this.drawHandle(e,r,t)}drawSelected(e,t){this.drawHandle(e,this._selectedProperties(),t)}drawHandle(e,t,r){const n=new i(this.shape().vertices());n.updateProperties(t),n.draw(e,r)}_selectedProperties(){return{fillStyle:"rgba(31, 160, 246, 0.3)",strokeStyle:"#1FA0F6",_pixelLineWidth:3}}_overriddenProperties(){return{fillStyle:"rgba(255, 120, 0, 0.3)",strokeStyle:"#ff7800",_pixelLineWidth:3}}}},34603:(e,t,r)=>{const n=r(89929);e.exports=class OasisSlipPlacementTool extends n{activate(){super.activate(),this._controller().setShapeOnly(!1)}deactivate(){super.deactivate(),this._controller().setDefaultCursor()}shouldApplySnappingTolerance(){return!0}isPlacementNotAllowed(){return 0===this.project().docks().length}draw(e,t){this.isPlacementNotAllowed()||super.draw(e,t)}resetTool(){const e=this.unplacedComponent();this.isComponentInValidPosition()&&(this._unplacedComponent=void 0,this._unplacedComponentFigure=this.unplacedComponent().defaultFigure(),this._unplacedComponentHandle=this.unplacedComponentFigure().selfHandle()),this.unplacedComponentHandle().activate(this),this._move(this.unplacedComponent(),e.referencePoint().x(),e.referencePoint().y()),this._controller().draw()}setCursor(e){e?this._controller().setCursor(e):this._controller().setDefaultCursor()}isComponentInValidPosition(){return this._isComponentInValidPosition??=!1}setIsComponentInValidPosition(e){this._isComponentInValidPosition=e,this.setCursor(e?void 0:"not-allowed")}_createComponent(){return this.builder().build()}_afterAssetPlaced(){this.resetTool()}_place(e,t,r){this.isPlacementNotAllowed()||(this._move(e,t,r),this.unplacedComponentHandle().deactivate(this),e.componentOf()&&(this._controller().snapshotProjectAndRedraw(),this._controller().select(e)))}_move(e,t,r){const n=e.referencePoint();return this.unplacedComponentHandle().moveFromTo(n.x(),n.y(),t,r)}}},53022:(e,t,r)=>{const n=r(22093),i=r(12154);e.exports=class AccessPlatformBuilder extends n{constructor(e,t){super(e,i,t),this._platformStrategy=t}build(){const e=this.newGeometryStrategy();return new i(e,this._referencePoint,this._angle,this._platformStrategy)}}},12154:(e,t,r)=>{const n=r(63768),{EditableProperty:i}=r(7340),{Composite3DFigure:s}=r(37732),o=r(8297),a=r(14098),l=r(14025),c=r(67162);let u;e.exports=class AccessPlatform extends o{static defaultHeight(){return n.unit(3,"ft")}static builder(e,t=new c){return u||(u=r(53022)),new u(e,t)}constructor(e,t,r,n){super(e,t,r),this._platformStrategy=n}platformStrategy(){return this._platformStrategy}allowableWidths(){return this._allowableWidths||(this._allowableWidths=this.platformStrategy().allowableWidths()),this._allowableWidths}allowableLengths(){return this._allowableLengths||(this._allowableLengths=this.platformStrategy().allowableLengths()),this._allowableLengths}maximumHeight(){return n.unit(12,"ft")}widthOptions(){return this.allowableWidths().toOptionList()}lengthOptions(){return this.allowableLengths().toOptionList()}setWidth(e){const t=this.allowableWidths().getNearest(e);super.setWidth(t)}setLength(e){const t=this.allowableLengths().getNearest(e);super.setLength(t)}roundedWidth(){return this.allowableWidths().getNearest(this.width())}roundedLength(){return this.allowableLengths().getNearest(this.length())}constrainWidthAdjustment(e){return this.allowableWidths().getNearestDelta(this.width(),this.unit(),e)}constrainLengthAdjustment(e){return this.allowableLengths().getNearestDelta(this.length(),this.unit(),e)}defaultWidthProperty(){const e=this.allowableWidths().unit();return new i(this,"Width",{type:"select",choices:this.widthOptions(),label:`Width (${e})`,get:this.roundedWidth.bind(this)})}defaultLengthProperty(){const e=this.allowableLengths().unit();return new i(this,"Length",{type:"select",choices:this.lengthOptions(),label:`Length (${e})`,get:this.roundedLength.bind(this)})}frameResized(){super.frameResized(),this.railingCollection().frameResized(),this.supportModuleCollection().frameResized()}angleChanged(){this.frameResized()}heightChanged(){super.heightChanged(),this.supportModuleCollection().heightChanged()}snapToFramesFilter(){return e=>!1}surfaceMeshThickness(){return n.unit(.25,"in")}surfaceFrameDepth(){return n.unit(6,"in")}surfaceFrameThickness(){return n.unit(.25,"in")}surfaceFrameEdges(){return this.platformStrategy().surfaceFrameEdges(this)}surface(){return this._surface||(this._surface=new a(this)),this._surface}_edgeProjection(e){const{nearestEdge:t}=this.edges().filter((t=>Math.abs(t.normal().dot(e.normal())).isNearTo(1))).reduce((({nearestEdge:t,distance:r},n)=>{const i=n.center().distanceTo(e.center());return i<r&&(r=i,t=n),{nearestEdge:t,distance:r}}),{nearestEdge:void 0,distance:1/0}),r=t.closestPointTo(e.begin()),n=t.closestPointTo(e.end());return r.to(n)}railingOpenings(){return[...this.connectorsGoingDown().map((e=>{const t=this._edgeProjection(e.upperEdge());return new l(t)})),...this.connectorsGoingUp().map((e=>{const t=this._edgeProjection(e.lowerEdge());return new l(t)}))]}resetRailings(){this.railingCollection().reset()}_startObservingConnectorGoingUp(e){e.addFrameResizedObserver(this,this.resetRailings),this.resetRailings()}_stopObservingConnectorGoingUp(e){e.removeFrameResizedObserver(this,this.resetRailings),this.resetRailings()}_startObservingConnectorGoingDown(e){e.addFrameResizedObserver(this,this.resetRailings),this.resetRailings()}_stopObservingConnectorGoingDown(e){e.removeFrameResizedObserver(this,this.resetRailings),this.resetRailings()}railingCollection(){return this._railingCollection??=this.link(this.platformStrategy().railingCollection(this))}sectionClass(){return this.platformStrategy().sectionClass()}createSection(e,t){return this.platformStrategy().createSection(e,t,this)}supportModuleCollection(){return this._supportModuleCollection||(this._supportModuleCollection=this.platformStrategy().supportModuleCollection(this)),this._supportModuleCollection}components(){return[this.surface(),this.railingCollection(),this.supportModuleCollection()]}allLocatedMaterials(){return[...this.railingCollection().allLocatedMaterials(),...this.supportModuleCollection().allLocatedMaterials()]}boundingCube(){return this.components().map((e=>e.boundingCube())).reduce(((e,t)=>e.merge(t)))}boundingBox(){return this.components().map((e=>e.boundingBox())).reduce(((e,t)=>e.merge(t)))}threeFigure(){return s.withModel(this)}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_surface","_railingCollection","_supportModuleCollection","_allowableWidths","_allowableLengths"]}}},15336:(e,t,r)=>{const n=r(63768),i=r(97477),s=r(72339);e.exports=class AccessPlatformRailingCollection extends i{constructor(e){super(),this._platform=e}platform(){return this._platform}_defaultRailingRuns(){const e=this.platform().edges().map((e=>{const t=this.createRun(e);return t.setComponentOf(this),t.setGeometryChangedCallback((()=>this.onGeometryChanged())),t}));return this.platform().railingOpenings().forEach((t=>{const r=e.find((e=>e.edge().overlaps(t.edge())));r&&r.addOpening(t)})),e}sectionClass(){return this.platform().sectionClass()}createSection(e){return this.platform().createSection(e,this)}createRun(e){return new s(e,this)}frameResized(){this.reset()}boundingCube(){return this.components().map((e=>e.boundingCube())).filter((e=>e)).reduce(((e,t)=>e.merge(t)))}allLocatedMaterials(){return this.railingRuns().flatMap((e=>e.allLocatedMaterials()))}railingHeight(){return n.unit(42,"in")}zLevel(){return this.platform().edges().first().begin().z()-this.railingHeight().toNumeric(this.unit())}}},72339:(e,t,r)=>{const{FixedEdgeLocator:n}=r(62048),i=r(33496);e.exports=class AccessPlatformRailingRun extends i{createSection(e){const t=this.componentOf().createSection(e);return t.setComponentOf(this),t}_sectionEdges(e){const t=super._sectionEdges(e),r=this.sectionClass().minLength().toNumeric(this.unit()),i=this.sectionClass().maxLength().toNumeric(this.unit());return t.flatMap((e=>{if(r-e.length()>Math.DEFAULT_TOLERANCE)return[];if(e.length()<=i)return[e];const t=e.length(),s=Math.ceil(t/i),o=t%i,a=Math.max(r,o),l=i-Math.max(0,r-o),c=Array(s).fill(i);c[c.length-1]=a,c[c.length-2]=l;const u=[];return c.forEach(((t,r)=>{const i=u.last(),s=(i?.end().distance()??0)+t,o=i?.end()??e.begin(),a=r===c.length-1?e.end():new n(e,s);u.push(o.to(a))})),u}))}_nearestValidOpeningEdge(e){return e}boundingCube(){if(0!==this.components().length)return this.components().map((e=>e.boundingCube())).filter((e=>e)).reduce(((e,t)=>e.merge(t)))}allLocatedMaterials(){return this.sections()}}},33775:e=>{e.exports=class AccessPlatformStrategy{surfaceFrameEdges(e){}defaultWidth(){}defaultLength(){}allowableWidths(){}allowableLengths(){}railingCollection(e){}sectionClass(){}createSection(e,t){}supportModuleCollection(e){}}},67162:(e,t,r)=>{const n=r(63768),i=r(99105),s=r(99831),o=r(24575),a=r(15336),l=r(16403),c=n.unit;class PlatformRailingDelegate extends s{constructor(e){super(),this._postLocatorZOffset=e}postLocatorZOffset(){return this._postLocatorZOffset}railingMaterial(){return"safety-red"}handRailOverhang(){return c(2,"in")}postInset(){return c(4,"in")}}e.exports=class DefaultAccessPlatformStrategy{surfaceFrameEdges(e){return e.edges()}defaultWidth(){return this.allowableWidths().minimum()}defaultLength(){return this.allowableLengths().minimum()}allowableWidths(){return new o(36,48,"in",12)}allowableLengths(){return new o(3,20,"ft")}railingCollection(e){return new a(e)}sectionClass(){return i}createSection(e,t,r){const n=r.surfaceFrameDepth();return new i(e,new PlatformRailingDelegate(n))}supportModuleCollection(e){return new l(e)}}},37697:(e,t,r)=>{const{CompositeFigure:n}=r(7340),{Composite3DFigure:i}=r(37732),s=r(83102);e.exports=class PlatformSupport extends s{constructor(e){super(),this._edge=e}edge(){return this._edge}components(){return[]}boundingCube(){return this.components().map((e=>e.boundingCube())).reduce(((e,t)=>e.merge(t)))}boundingBox(){return this.components().map((e=>e.boundingBox())).reduce(((e,t)=>e.merge(t)))}defaultFigure(){return n.withModel(this)}threeFigure(){return i.withModel(this)}}},32273:(e,t,r)=>{const{CompositeFigure:n}=r(7340),{Composite3DFigure:i}=r(37732);e.exports=class PlatformSupportCollection{constructor(e){this._platform=e}platform(){return this._platform}supports(){return this._supports||(this._supports=this._defaultSupports()),this._supports}_defaultSupports(){return[]}frameResized(){}heightChanged(){}components(){return this.supports()}allLocatedMaterials(){return this.components()}boundingCube(){return this.components().map((e=>e.boundingCube())).reduce(((e,t)=>e.merge(t)))}boundingBox(){return this.components().map((e=>e.boundingBox())).reduce(((e,t)=>e.merge(t)))}defaultFigure(){return n.withModel(this)}threeFigure(){return i.withModel(this)}}},46458:(e,t,r)=>{const n=r(63768),{MaterialSpecifier:i}=r(93613),{CompositeFigure:s}=r(7340),{Composite3DFigure:o}=r(37732),{NormalToEdgeLocator:a,$P:l,FixedZLocator:c}=r(62048),u=r(26852);e.exports=class AdaptaStepAdjustableFoot{constructor(e,t){this._edgeLocator=e,this._platformSupport=t}edgeLocator(){return this._edgeLocator}platformSupport(){return this._platformSupport}unit(){return this.platformSupport().unit()}basePlateMaterialSpecifier(){return new i("AluminumFrame","Aluminum Frame Section",{width:n.unit(4,"in"),depth:n.unit(.25,"in"),materialName:"aluminum"})}legMaterialSpecifier(){return new i("AluminumFrame","Aluminum Frame Section",{width:n.unit(1.5,"in"),depth:n.unit(1.5,"in"),materialName:"aluminum"})}basePlate(){if(!this._basePlate){const e=this.basePlateMaterialSpecifier(),t=e.details().width.toNumeric(this.unit()),r=new c(new a(this.edgeLocator(),t/2),0),n=new c(new a(this.edgeLocator(),-t/2),0);this._basePlate=new u(r,n,e,0,l(0,0,-1))}return this._basePlate}leg(){if(!this._leg){const e=this.legMaterialSpecifier(),t=e.details().width.toNumeric(this.unit()),r=this.legHeight().toNumeric(this.unit()),n=new a(this.edgeLocator(),-t/2),i=new c(n,0),s=new c(n,-r);this._leg=new u(i,s,e,0,this.edgeLocator().edge().normal())}return this._leg}legHeight(){return n.unit(1.5,"ft")}components(){return[this.basePlate(),this.leg()]}boundingCube(){return this.components().map((e=>e.boundingCube())).reduce(((e,t)=>e.merge(t)))}boundingBox(){return this.components().map((e=>e.boundingBox())).reduce(((e,t)=>e.merge(t)))}defaultFigure(){return s.withModel(this)}threeFigure(){return o.withModel(this)}}},74541:(e,t,r)=>{const n=r(63768),{MaterialSpecifier:i}=r(93613),{three:s}=r(37732),{FixedEdgeLocator:o,Polygon:a}=r(62048),l=r(32509),c=r(57473),u=r(10590),d=r(6556);e.exports=class AdaptaStepPlatformRailingSection extends u{static minLength(){return n.unit(3,"planks")}static maxLength(){return n.unit(10,"planks")}componentLayoutEdge(){return this.edge()}componentLayoutLine(){return this.edge()}minLength(){return this.constructor.minLength()}maxLength(){return this.constructor.maxLength()}components(){return this._components||(this._components=this._defaultComponents()),this._components}_defaultComponents(){const e=this.edge(),t=n.unit(1,"plank").toNumeric(this.unit()),r=Math.round(e.length()/t),i=[],a=(new s.Quaternion).setFromAxisAngle(new s.Vector3(0,0,1),e.theta());for(let n=0;n<r;n++){let s,l=new o(e,t*n);0===n?s="safesmart-platform-rail-start":n===r-1?(this.is36InchSection()&&(l=new o(e,-t)),s="safesmart-platform-rail-end"):(this.is36InchSection()&&n===r-2&&(l=new o(e,2*-t)),s="safesmart-platform-rail-middle"),i.push(new c(l,s,a))}return i}is36InchSection(){return this.edge().length().isNearTo(n.unit(3,"ft").toNumeric(this.unit()))}width(){return n.unit(1.5,"in")}boundingBox(){return this.geometry().boundingBox()}sideEdges(){return[this.innerEdge(),this.outerEdge()]}endEdges(){return[this.edge().begin().to(this.outerEdge().begin()),this.edge().end().to(this.outerEdge().end())]}outerEdge(){const e=this.width().toNumeric(this.unit());return this.edge().shiftedAlongNormalBy(e)}innerEdge(){return this.edge().reversed()}geometry(){return this._geometry||(this._geometry=new a([this.innerEdge().begin(),this.innerEdge().end(),this.outerEdge().begin(),this.outerEdge().end()])),this._geometry}defaultFigure(){return new l(this)}boundingCube(){if(0!==this.components().length)return this.components().map((e=>e.boundingCube())).reduce(((e,t)=>e.merge(t)))}materialCodeLength(){const e=10*Math.round(10*n.unit(this.edge().length(),this.unit()).toNumeric("in"));return 3600===e||4800===e?e-50:e}materialLineItems(){const e=`15MHR${this.materialCodeLength()}`;return[new d(1,new i(e,this.description(e),{unitPrice:this.price(e)}))]}price(e){return{"15MHR2850":288.46,"15MHR3550":323.99,"15MHR3800":336.68,"15MHR4750":384.9,"15MHR5700":433.13,"15MHR6650":481.35,"15MHR7600":529.57,"15MHR8550":577.79,"15MHR9500":626.02}[e]}description(e){return{"15MHR2850":"3 Plank Handrail Panel","15MHR3550":"3 Ft Wide Platform End Panel","15MHR3800":"4 Plank Handrail Panel","15MHR4750":"5 Plank Handrail Panel / 4 Ft Wide End Panel","15MHR5700":"6 Plank Handrail Panel","15MHR6650":"7 Plank Handrail Panel","15MHR7600":"8 Plank Handrail Panel","15MHR8550":"9 Plank Handrail Panel","15MHR9500":"10 Plank Handrail Panel"}[e]}}},86427:(e,t,r)=>{const n=r(24575),i=r(15336),s=r(74541),o=r(16403);e.exports=class AdaptaStepPlatformStrategy{surfaceFrameEdges(e){return e.sideEdges()}defaultWidth(){return this.allowableWidths().minimum()}defaultLength(){return this.allowableLengths().minimum()}allowableWidths(){return new n(36,48,"in",12)}allowableLengths(){return new n(3,25,"planks")}railingCollection(e){return new i(e)}sectionClass(){return s}createSection(e,t,r){return new s(e,t)}supportModuleCollection(e){return new o(e)}}},67847:(e,t,r)=>{const n=r(63768),{ProportionalEdgeLocator:i,RelativeLocator:s}=r(62048),{MaterialSpecifier:o}=r(93613),a=r(37697),l=r(46458),c=r(79485);e.exports=class AdaptaStepPlatformSupport extends a{static width(){return c.materialSpecifier().details().width}components(){return[...this.adjustableFeet(),this.weldedSupportLeg()]}insetEdge(){if(!this._insetEdge){const e=c.materialSpecifier().details().width.toNumeric(this.unit()),t=this.edge().stretchedBy(-e).shiftedAlongNormalBy(-e/2);this._insetEdge=s.makeRelativeTo(t.begin(),this.edge().begin()).to(s.makeRelativeTo(t.end(),this.edge().end()))}return this._insetEdge}weldedSupportLeg(){return this._weldedSupportLeg||(this._weldedSupportLeg=new c(this.insetEdge(),this)),this._weldedSupportLeg}adjustableFeet(){return this._adjustableFeet||(this._adjustableFeet=[new l(new i(this.insetEdge(),0),this),new l(new i(this.insetEdge(),1),this)]),this._adjustableFeet}zLevel(){return this.edge().begin().z()}materialWidth(){return n.unit(Math.round(this.edge().length()),this.unit())}steps(){const e=this.weldedSupportLeg().height();return Math.round(n.divide(e,n.unit(1,"plank")))}materialLineItems(){const e=this.steps(),t=`15MSL${e}${this.materialWidth().toNumeric("in")}`;return[new MaterialPricingLineItem(1,new o(t,this.description(e),{unitPrice:this.price(e)}))]}basePrice(e){return{2:269.55,3:280.59,4:288.72,5:291.62,6:302.66,7:313.69,8:324.73,9:335.76,10:346.8,11:357.83,12:368.87,13:379.9,14:390.94,15:401.97,16:413.01}[e]}additionalPriceFor4FootWide(){return 13.94}price(e){let t=this.basePrice(e);return this.is48InchSection()&&(t+=this.additionalPriceFor4FootWide()),t}is48InchSection(){return this.edge().length().isNearTo(n.unit(4,"ft").toNumeric(this.unit()))}description(e){return`${e} Step Height Support Leg W/Adj Base Plate`}}},16403:(e,t,r)=>{const n=r(63768),{FixedEdgeLocator:i}=r(62048),s=r(32273),o=r(67847);e.exports=class AdaptaStepPlatformSupportCollection extends s{_defaultSupports(){const e=this.supportSpacing().toNumeric(this.unit()),t=this.platform().length().toNumeric(this.unit()),r=o.width().toNumeric(this.unit()),n=Math.floor((t-r)/e)+1,s=this.platform().sideEdges().first(),a=this.platform().sideEdges().last().reversed(),l=[];for(let c=0;c<=n;c++){const n=Math.min(r+c*e,t),u=new i(s,n).to(new i(a,n));l.push(new o(u))}return l}supportSpacing(){return n.unit(10,"planks")}unit(){return this.platform().unit()}frameResized(){this._supports=void 0}heightChanged(){this._supports=void 0}zLevel(){return 0}}},79485:(e,t,r)=>{const n=r(63768),{MaterialSpecifier:i}=r(93613),{CompositeFigure:s}=r(7340),{Composite3DFigure:o}=r(37732),{$P:a,RelativeLocator:l,NormalToEdgeLocator:c,ProportionalEdgeLocator:u,RelativeZLocator:d,FixedEdgeLocator:h}=r(62048),p=r(26852),m=r(24575);e.exports=class AdaptaStepWeldedSupportLeg{static materialSpecifier(){return new i("AluminumFrame","Aluminum Frame Section",{width:n.unit(2,"in"),depth:n.unit(2,"in"),materialName:"aluminum"})}constructor(e,t){this._edge=e,this._platformSupport=t}edge(){return this._edge}materialSpecifier(){return this.constructor.materialSpecifier()}platformSupport(){return this._platformSupport}unit(){return this.platformSupport().unit()}crossSupport(){if(!this._crossSupport){const e=this.materialSpecifier(),t=this.edge().stretchedBy(-e.details().width.toNumeric(this.unit())).addZ(this.crossSupportOffsetFromPlatform().toNumeric(this.unit())),r=l.makeRelativeTo(t.begin(),this.edge().begin()),n=l.makeRelativeTo(t.end(),this.edge().end());this._crossSupport=new p(r,n,e,0,a(0,0,1))}return this._crossSupport}crossSupportOffsetFromPlatform(){return n.unit(5,"in")}legs(){if(!this._legs){const e=this.materialSpecifier(),t=e.details().width.toNumeric(this.unit()),r=[new u(this.edge(),0),new u(this.edge(),1)];this._legs=r.map((r=>{const n=new c(r,-t/2),i=new d(n,this.nearestLegHeight());return new p(n,i,e,0,r.edge().normal())}))}return this._legs}height(){return n.unit(this.legs().first().edge().length(),this.unit())}nearestLegHeight(){const e=this.edge().begin().z();return this.legHeightOptions().getRoundDownNearestNumeric(-e,this.unit())}legHeightOptions(){return this._legHeightOptions||(this._legHeightOptions=new m(19,142.5,"in",9.5)),this._legHeightOptions}angledSupports(){if(!this._angledSupports){const e=this.materialSpecifier(),t=this.crossSupport().edge(),r=n.unit(1,"ft").toNumeric(this.unit()),i=e.details().width.toNumeric(this.unit()),s=(e,t)=>{const r=e.to(t);return r.vector().normalized().cross(r.normal())},o=new h(t,r).addZ(i),a=t.begin().addZ(r+i),l=new h(t,-r).addZ(i),c=t.end().addZ(r+i);this._angledSupports=[new p(o,a,e,0,s(o,a)),new p(l,c,e,0,s(l,c))]}return this._angledSupports}components(){return[this.crossSupport(),...this.angledSupports(),...this.legs()]}_boundingComponents(){return[this.crossSupport(),...this.legs()]}boundingCube(){return this._boundingComponents().map((e=>e.boundingCube())).reduce(((e,t)=>e.merge(t)))}boundingBox(){return this._boundingComponents().map((e=>e.boundingBox())).reduce(((e,t)=>e.merge(t)))}defaultFigure(){return s.withModel(this)}threeFigure(){return o.withModel(this)}}},32509:(e,t,r)=>{const{Drawable:n}=r(7340);e.exports=class AdaptaStepPlatformRailingSectionFigure extends n{constructor(e){super(),this.setModel(e)}boundingBox(){return this.model().boundingBox()}_draw(e,t){e._drawPolygon(this.model().geometry())}defaultProperties(){return{fillStyle:"#EA3323",strokeStyle:"transparent"}}}},52364:(e,t,r)=>{const{EditableProperty:n}=r(7340),{CompositeEditableProperty:i}=r(7340),s=r(97477),o=r(67603),a=r(98503),l=r(78175);e.exports=class RailingDepotCollection extends s{defaultDisplayProperties(){return new o(this,[new i("Railing Style","segment",this.sections().map((e=>e.railingStyleProperty()))),new n(this,"Flip Platform",{type:"action",perform:()=>this.toggleStructureSide()}),this.baselineHeightProperty(),new i("Post Mount Style","select",this.sections().map((e=>e.postMountStyleProperty())))])}runClass(){return a}sectionClass(){return l}}},72285:(e,t,r)=>{const n=r(43320);e.exports=Object.freeze({black:new n("Black","metallic-black-low-gloss","#3c3d3e","#0d0d0d"),yellow:new n("Yellow","metallic-yellow-low-gloss","#f4cf00","#220800"),aluminum:new n("Aluminum","aluminum","#adaeb1","#242424")})},25278:(e,t,r)=>{const n=r(81996),i=r(6556);e.exports=class RailingDepotGlassPanel extends n{materialSpecifier(){return this.materials.Glass}selfMaterialLineItems(){return[new i(this.area(),this.materialSpecifier())]}}},35680:(e,t,r)=>{const n=r(30202),i=r(6556);e.exports=class RailingDepotPicket extends n{materialLineItems(){return[new i(1,this.materialSpecifier())]}}},93003:(e,t,r)=>{const n=r(43812),i=r(20834);e.exports=class RailingDepotProject extends n{get materials(){return i}}},78175:(e,t,r)=>{const n=r(63768),{EditableProperty:i}=r(7340),{RailLengthHelper:s}=r(8423),{FixedEdgeLocator:o}=r(62048),a=r(10590),l=r(83822),c=r(28396),u=r(95737),d=r(6314),h=r(27295),p=r(92257),m=r(44476),f=r(90202),g=r(30691),y=r(3262);e.exports=class RailingDepotRailingSection extends a{static postMountStyleClasses(){return[l,c]}static railingStyleClasses(){return[u,d,h,p,f]}_defaultRailingStyle(){return this.railingStyleChoices().first()}_selfDisplayProperties(){return[new i(this,"Flip Slope",{type:"action",perform:()=>this.flipSlope()}),new i(this,"Create Opposite Railing",{type:"action",perform:()=>this.createOppositeRailing()})]}showCreateOppositeRailingProperty(){return this.sloped()}blockClass(){return this.railingStyle().blockClass()}_classForPost(){return this.railingStyle().postClass()}maxRailLength(){return this.railingStyle().maxRailLength()}minLength(){return n.unit(12,"in")}postWidth(){return this._classForPost().defaultWidth()}railLayoutEdge(){const e=super.railLayoutEdge(),t=this.railLayoutEdgeInsetHelper(),r=t.insetFor(this,this.edge().begin()).toNumeric(this.unit()),n=t.insetFor(this,this.edge().end()).toNumeric(this.unit()),i=g.stretchedEdgeBy(e,r,n).relativeToEdge(this.edge());if(!this.railingStyle().faceMountRails())return i;const s=this.postWidth().toNumeric(this.unit())/2,o=this.structureDirection();return i.shiftedAlongNormalBy(s*o)}railLayoutEdgeInsetHelper(){return new(this.railingStyle().railLayoutEdgeInsetHelperClass())}_defaultRails(){return this.railingStyle().generateRails(this,this.railLayoutEdge())}bottomRailHeight(){return this.blockClass().bottomRailHeight()}lowerRailHeights(){return[this.bottomRailHeight()]}postSpacingMode(){return s.mode.EVEN}postLayoutEdgeInsetHelperClass(){return this.railingStyle().postLayoutEdgeInsetHelperClass()}postLocations(){return this.isTreadMountStairs()?this._treadMountPostLocations():super.postLocations()}_treadMountPostLocations(){const e=this.stairTreadPostLayoutEdges(),t=this.maxPostSpacing().toNumeric(this.unit()),r=this.postLength().toNumeric(this.unit()),n=this.isSlopeFlipped(),i=this.isBeginAtStairTop()?this.sectionConnectedToBegin():this.sectionConnectedToEnd(),s=i&&!this.isParallelToSection(i)&&this.isFasciaMount(),o=this.postLayoutEdge().begin(),a=this.edge().direction();return this.stairMountSurface().postLocations(e,{maxPostSpacing:t,postLength:r,isTopCornerConnection:s,isSlopeFlipped:n}).sort(((e,t)=>e.subtract(o).dot(a)-t.subtract(o).dot(a)))}postLocationsAlongSlope(){const e=this.postLayoutEdge(),t=e.length(),r=e.stretchedBy(t).relativeToEdge(e),n=e.begin().xy(),i=this.placementStrategy().slopeRadians(),s=t/2,a=e.xy().direction();return this.postLocations().map((e=>{const t=n.distanceTo(e.xy()),l=n.to(e.xy()).direction().equals(a)?1:-1,c=Math.tan(i)*t,u=s+Math.hypot(t,c)*l;return new o(r,u)}))}stairTreadPostLayoutEdges(){const e=this.placementStrategy().defaultStructureRepresentation(),t=-this.railingStyle().treadPostInset().toNumeric(this.unit()),r=this.componentLayoutEdge();return e.treadEdges().map((e=>{const n=e.normal().dot(r.begin().subtract(e.begin())),i=e.shiftedAlongNormalBy(n);return g.stretchedEdgeBy(i,t,t).relativeToEdge(this.edge())}))}blockEdges(){return g.pointArrayToEdges(this.postLocationsAlongSlope())}postLength(){return this.railingStyle().postLength()}isTreadMountStairs(){return this.isStairs()&&this.stairMountSurface().treadMountPosts()}stairMountSurface(){return this._stairMountSurface??=this._defaultStairMountSurface()}_defaultStairMountSurface(){return new y}sectionLengthAnnotation(){return new m(this.edge(),30*this.annotationDirection(),this.unit(),{formatter:this.lengthFormatter()})}restorableProperties(){return[...super.restorableProperties(),this.postMountStyleProperty(),this.railingStyleProperty()]}}},98503:(e,t,r)=>{const n=r(33496),i=r(52494);e.exports=class RailingDepotRun extends n{_defaultPlacementStrategy(){return new i(this)}_postWidth(){return this.sections().first().postLength()}}},24587:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),{extend:s}=r(50988),o=r(3679),a=r(88646),l=r(20901),c=r(22766),u=r(50449),d=r(97169);class RailingDepotCableBlock extends o{static bottomRailHeight(){return n.unit(3,"in")}bottomRailClass(){return u}bottomRailHeight(){return this.constructor.bottomRailHeight()}static defaultRadius(){return n.unit(.13,"in")}static defaultWidth(){return n.multiply(this.defaultRadius(),2)}static defaultLength(){return n.multiply(this.defaultRadius(),2)}radius(){return this.constructor.defaultRadius()}width(){return n.multiply(this.radius(),2)}length(){return n.multiply(this.radius(),2)}infillClass(){return d}infillCrossSection(){return new a([new l(i(0,0).expandedByRadius(this.radius().toNumeric(this.unit())))])}infillSpecifier(){const e=this.materials.Cable;return e.details().materialName="aluminum",e}infillSpacing(){return n.unit(3.5,"in")}}s(RailingDepotCableBlock,c),e.exports=RailingDepotCableBlock},73012:(e,t,r)=>{const n=r(63768),{extend:i}=r(50988),s=r(68384),o=r(50449),a=r(22766),l=r(25278);class RailingDepotGlassBlock extends s{static bottomRailHeight(){return n.unit(3,"in")}bottomRailClass(){return o}bottomRailHeight(){return this.constructor.bottomRailHeight()}infillThickness(){return n.unit(.25,"in")}horizontalPanelInset(){return n.unit(3,"in")}_defaultInfill(){const e=new l(this.infillBottomEdge(),this.panelHeight(),this.infillThickness());return e.setComponentOf(this),[e]}infillBottomEdge(){const e=this.panelBottomHeight().toNumeric(this.unit()),t=-this.horizontalPanelInset().toNumeric(this.unit()),r=this.componentOf().slope().toNumeric("rad"),n=t/Math.cos(r);return this.edge().stretchedBy(2*n).addZ(e).relativeToEdge(this.edge())}panelBottomHeight(){const e=n.multiply(this.infillBottomHeight(),-1);return n.subtract(e,this.verticalPanelInset())}panelHeight(){const e=n.subtract(this.infillTopHeight(),this.infillBottomHeight()),t=n.multiply(this.verticalPanelInset(),2);return n.subtract(e,t)}}i(RailingDepotGlassBlock,a),e.exports=RailingDepotGlassBlock},66144:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),{extend:s}=r(50988),o=r(73964),a=r(50449),l=r(88646),c=r(56214),u=r(22766),d=r(35680);class RailingDepotPicketBlock extends o{static bottomRailHeight(){return n.unit(3,"in")}bottomRailClass(){return a}bottomRailHeight(){return this.constructor.bottomRailHeight()}static defaultWidth(){return n.unit(.25,"in")}static defaultLength(){return n.unit(.25,"in")}width(){return this.constructor.defaultWidth()}length(){return this.constructor.defaultLength()}infillClass(){return d}infillCrossSection(){return new l([new c(i(0,0).expandedBy(this.width().toNumeric(this.unit())/2,this.length().toNumeric(this.unit())/2))])}infillSpacing(){return n.unit(3.5,"in")}infillSpecifier(){const e=this.materials.Picket;return e.details().materialName="aluminum",e}}s(RailingDepotPicketBlock,u),e.exports=RailingDepotPicketBlock},83220:(e,t,r)=>{const n=r(63768),{extend:i}=r(50988),s=r(84155),o=r(22766),a=r(46494);class RailingDepotPipeBlock extends s{static bottomRailHeight(){return n.unit(18,"in")}bottomRailClass(){return a}bottomRailHeight(){return this.constructor.bottomRailHeight()}}i(RailingDepotPipeBlock,o),e.exports=RailingDepotPipeBlock},65619:(e,t,r)=>{const n=r(63768),i=r(61681);e.exports=class RailingDepotGuardrailPostLayoutInsetHelper extends i{rightAngleInset(e,t){return e.postMountStyle().isFascia()||this._splitCornerPosts(e,t)?n.unit(-3,"in"):n.unit(0,"in")}_splitCornerPosts(e,t){const r=e.edge().begin().equals(t.edge().end()),n=e.structureAlongNormal(),i=r?e.angleAtBegin():e.angleAtEnd(),s=i.radiansToDegrees().isNearTo(90);return!(!i.radiansToDegrees().isNearTo(270)||n)||!(!s||!n)}}},61681:(e,t,r)=>{const{RailingLayoutInsetHelper:n}=r(8423),i=r(63768);e.exports=class RailingDepotPostLayoutInsetHelper extends n{terminalInset(e){const t=e.railingStyle().baseplateWidth();return i.divide(t,-2)}parallelSlopeTopTransitionInset(e,t){const r=e.railingStyle().slopeTopPostInset();return e.isSloped()?r:i.multiply(r,-1)}parallelSlopeBottomTransitionInset(e,t){const r=e.railingStyle().slopeBottomPostInset(),n=e.sloped(),s=t.isStairs();return n||s?r:i.multiply(r,-1)}}},39379:(e,t,r)=>{const n=r(63768),i=r(61681);e.exports=class RailingDepotRailLayoutInsetHelper extends i{terminalInset(e){const t=super.terminalInset(e),r=n.divide(e.postWidth(),2);return n.add(t,r)}parallelSlopeTopTransitionInset(e,t){return n.unit(0,"in")}parallelSlopeBottomTransitionInset(e,t){return n.unit(0,"in")}}},20834:(e,t,r)=>{const{MaterialSpecifier:n}=r(93613),i=[new n("Upper_Terminal_Sleeve","Fitting: Upper End"),new n("Upper_Slope_Terminal_Sleeve","Fitting: Upper Sloped End"),new n("Upper_Line_Sleeve","Fitting: Upper T"),new n("Upper_Slope_Line_Sleeve","Fitting: Upper Sloped T"),new n("Upper_Right_Corner_Sleeve","Fitting: Upper 90° Corner"),new n("Upper_Adjustable_Corner_Sleeve","Fitting: Upper Adjustable Corner"),new n("Upper_Slope_Transition_Sleeve","Fitting: Upper Slope Transition")],s=[new n("Lower_Terminal_Sleeve","Fitting: Lower End"),new n("Lower_Slope_Terminal_Sleeve","Fitting: Lower Sloped End"),new n("Lower_Line_Sleeve","Fitting: Lower T"),new n("Lower_Slope_Line_Sleeve","Fitting: Lower Sloped T"),new n("Lower_Right_Corner_Sleeve","Fitting: Lower 90° Corner"),new n("Lower_Adjustable_Corner_Sleeve","Fitting: Lower Adjustable Corner"),new n("Lower_Slope_Transition_Sleeve","Fitting: Lower Slope Transition")],o=[new n("Rail","Rail"),new n("Guardrail","Guardrail"),new n("Pipe","Pipe"),new n("Cable","Cable"),new n("Post","Post"),new n("FasciaPost","Fascia Post"),new n("Glass","Glass",{materialName:"glass"}),new n("Picket","Picket"),new n("Bolt","Bolt"),...i,...s],a={};o.forEach((e=>{a[e.identifier()]=e})),e.exports=a},28396:(e,t,r)=>{const n=r(63768),{extend:i}=r(50988),{PostFasciaMountStyleMixin:s}=r(8423),o=r(2933);class RailingDepotPostFasciaMountStyle extends o{postZOffset(){return n.unit(10,"in")}isFascia(){return!0}}i(RailingDepotPostFasciaMountStyle,s),e.exports=RailingDepotPostFasciaMountStyle},2933:(e,t,r)=>{const n=r(63768),i=r(83741);e.exports=class RailingDepotPostMountStyle extends i{postZOffset(){return n.unit(0,"in")}offsetFromEdgeOfPlatform(){return n.unit(0,"in")}isFascia(){return!1}}},83822:(e,t,r)=>{const n=r(63768),i=r(2933);e.exports=class RailingDepotPostSurfaceMountStyle extends i{offsetFromEdgeOfPlatform(){return n.unit(2,"in")}}},42298:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),{extend:s}=r(50988),o=r(20702),a=r(88646),l=r(20901),c=r(10712),u=r(6556),d=r(26511);class RailingDepotPipePost extends o{static defaultRadius(){return n.unit(1,"in")}static defaultWidth(){return n.multiply(this.defaultRadius(),2)}static defaultLength(){return n.multiply(this.defaultRadius(),2)}radius(){return this.railingStyle().pipeRadius()}width(){return n.multiply(this.radius(),2)}length(){return n.multiply(this.radius(),2)}crossSection(){return new a([new l(i(0,0).expandedByRadius(this.radius().toNumeric(this.unit())))])}includeBottomRailSleeves(){return!0}sleeveDescriptorDefinitions(){return d}selfMaterialLineItems(){return[...super.selfMaterialLineItems(),...this.sleeveLineItems()]}sleeveLineItems(){return this.sleeves().map((e=>e.descriptor.details().materialSpecifier)).filter(Boolean).flatMap((e=>this.materials[e])).map((e=>new u(1,e)))}}s(RailingDepotPipePost,c),e.exports=RailingDepotPipePost},20702:(e,t,r)=>{const n=r(18475),i=r(6556);e.exports=class RailingDepotPost extends n{isFascia(){return this.mountStyle().isFascia()}materialSpecifier(){const e=this.isFascia()?"FasciaPost":"Post";return this.materials[e]}selfMaterialLineItems(){return[new i(1,this.materialSpecifier()),new i(4,this.materials.Bolt)]}color(){return this.railingStyle().postColor()}}},54649:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),s=r(20702),o=r(88646),a=r(56214),l=r(30202);e.exports=class RailingDepotSquarePost extends s{static defaultWidth(){return n.unit(2,"in")}static defaultLength(){return n.unit(2,"in")}width(){return this.constructor.defaultWidth()}length(){return this.constructor.defaultLength()}baseplateWidth(){return this.railingStyle().baseplateWidth()}baseplateDepth(){return this.railingStyle().baseplateDepth()}direction(){return this.edge().direction()}normal(){return this.edge().normal()}crossSection(){return new o([new a(i(0,0).expandedBy(this.width().toNumeric(this.unit())/2,this.length().toNumeric(this.unit())/2))])}baseplate(){return this._baseplate??=this._defaultBaseplate()}_defaultBaseplate(){const e=this.bottomLocator(),t=this.baseplateStart(),r=this.baseplateEnd(),n=this._baseplateCrossSection(),i=l.builder(this).beginLocator(t.relatedTo(e)).endLocator(r.relatedTo(e)).crossSection(n).materialSpecifier(this.materialSpecifier()).color(this.color()).build();return i.setComponentOf(this),i}_baseplateExtrusionDirection(){const e=this.componentOf().isStairs(),t=!e&&this.componentOf().isSloped()&&!this.isLinePost();return e||t?this.direction().xy().normalized().cross(this.normal()):this.direction().cross(this.normal())}_fasciaBaseplateExtrusionDirection(){return this.normal()}_baseplateCrossSection(){const e=this.baseplateWidth().toNumeric(this.unit())/2;return new o([new a(i(0,0).expandedBy(e,e))])}baseplateStart(){const e=this.width().toNumeric(this.unit())/2,t=this.baseplateWidth().toNumeric(this.unit())/2,r=-1*this.componentOf().structureDirection(),n=this.normal().multipliedBy(e*r).addZ(-t),i=this.bottomLocator();return(this.isFascia()?i.add(n):i).add(this.baseplateOffset()).relatedTo(i)}baseplateEnd(){const e=this.baseplateDepth().toNumeric(this.unit()),t=this.isFascia()?this._fasciaBaseplateExtrusionDirection():this._baseplateExtrusionDirection(),r=this.baseplateStart(),n=this.bottomLocator();return r.add(t.multipliedBy(e)).relatedTo(n)}baseplateOffset(){if(this.isCornerPost())return i(0,0);const e=this.attachedSections();if(e.every((e=>e.isLevel()))&&!this.isLinePost())return i(0,0);if(this.section().isSloped()&&!this.section().isStairs()&&this.isLinePost())return i(0,0);const t=this.baseplateWidth().toNumeric(this.unit())/2-this.length().toNumeric(this.unit())/2,r=this.section().edge().xy().direction(),n=(e.find((e=>e.isSloped()))??this.section()).isSlopeFlipped()?1:-1;return r.multipliedBy(t*n)}components(){return[...super.components(),this.baseplate()]}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_baseplate"]}}},66864:(e,t,r)=>{const{extend:n}=r(50988),i=r(30301),s=r(54649);class RailingDepotSquarePostWithSleeves extends s{}n(RailingDepotSquarePostWithSleeves,i),e.exports=RailingDepotSquarePostWithSleeves},6314:(e,t,r)=>{const n=r(24587),i=r(98061);e.exports=class RailingDepotCableRailingStyle extends i{get styleId(){return"Cable"}get label(){return"Cable"}get icon(){return"cable-rail"}blockClass(){return n}}},27295:(e,t,r)=>{const n=r(63768),i=r(73012),s=r(98061);e.exports=class RailingDepotGlassRailingStyle extends s{get styleId(){return"Glass"}get label(){return"Glass"}get icon(){return"framed-glass"}blockClass(){return i}maxRailLength(){return n.unit(48,"in")}}},90202:(e,t,r)=>{const n=r(63768),i=r(84155),s=r(54649),o=r(36461),a=r(98061),l=r(72285),c=r(65619);e.exports=class RailingDepotGuardrailRailingStyle extends a{get styleId(){return"Guardrail"}get label(){return"Guardrail"}get icon(){return"guardrail-rail"}blockClass(){return i}postClass(){return s}postLayoutEdgeInsetHelperClass(){return c}railLayoutEdgeInsetHelperClass(){return this.postLayoutEdgeInsetHelperClass()}topRailClass(){return o}faceMountRails(){return!0}bottomRailHeight(){return n.unit(18,"in")}generateRails(e,t){const r=this.bottomRailHeight().toNumeric(e.unit()),n=[t,t.addZ(r).relativeToEdge(t)],i=this.topRailClass();return n.map((t=>{const r=new i(t);return r.setComponentOf(e),r}))}railColor(){return l.yellow}}},95737:(e,t,r)=>{const n=r(66144),i=r(98061);e.exports=class RailingPicketDepotRailingStyle extends i{get styleId(){return"Picket"}get label(){return"Picket"}get icon(){return"picket-rail"}blockClass(){return n}}},92257:(e,t,r)=>{const n=r(63768),i=r(98061),s=r(83220),o=r(46494),a=r(42298),l=r(72285);e.exports=class RailingDepotPipeRailingStyle extends i{get styleId(){return"Pipe"}get label(){return"Pipe"}get icon(){return"mid-rail"}blockClass(){return s}postClass(){return a}topRailClass(){return o}pipeRadius(){return n.unit(1,"in")}railColor(){return l.aluminum}railLayoutEdgeInsetHelperClass(){return this.postLayoutEdgeInsetHelperClass()}}},98061:(e,t,r)=>{const n=r(63768),{MissingOverride:i}=r(50988),s=r(58684),o=r(66864),a=r(3179),l=r(72285),c=r(61681),u=r(39379);e.exports=class RailingDepotRailingStyle extends s{blockClass(){throw new i(this,"blockClass")}postClass(){return o}postLayoutEdgeInsetHelperClass(){return c}railLayoutEdgeInsetHelperClass(){return u}topRailClass(){return a}maxRailLength(){return n.unit(72,"in")}maxPostSpacing(){this.maxRailLength()}baseplateWidth(){return n.unit(4,"in")}baseplateDepth(){return n.unit(.25,"in")}postWidth(){return this.postClass().defaultWidth()}postLength(){return this.postClass().defaultLength()}treadPostInset(){return n.divide(this.postWidth(),2)}slopeTopPostInset(){return n.divide(this.postWidth(),2)}slopeBottomPostInset(){return n.divide(this.baseplateWidth(),2)}faceMountRails(){return!1}generateRails(e,t){const r=new(this.topRailClass())(t);return r.setComponentOf(e),[r]}railColor(){return l.black}postColor(){return this.railColor()}}},50449:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),s=r(16610),o=r(88646),a=r(56214),l=r(6556);e.exports=class RailingDepotBottomRail extends s{static defaultWidth(){return n.unit(1.5,"in")}static defaultDepth(){return n.unit(1,"in")}width(){return this.constructor.defaultWidth()}depth(){return this.constructor.defaultDepth()}crossSection(){return new o([new a(i(0,0).expandedBy(this.width().toNumeric(this.unit())/2,this.depth().toNumeric(this.unit())/2))])}materialLineItems(){const e=n.unit(this.length(),this.unit()),t=n.unit(n.ceil(e.toNumeric("ft")),"ft");return[new l(t,this.materialSpecifier())]}}},97169:(e,t,r)=>{const n=r(63768),i=r(30202),s=r(6556);e.exports=class RailingDepotCable extends i{materialLineItems(){const e=n.unit(this.edge().length(),this.unit()),t=n.unit(n.ceil(e.toNumeric("ft")),"ft");return[new s(t,this.materialSpecifier())]}}},36461:(e,t,r)=>{const n=r(63768),{$P:i,Polygon:s}=r(62048),o=r(16610),a=r(88646),l=r(86755),c=r(6556);e.exports=class RailingDepotGuardrail extends o{crossSection(){const e=this.componentOf().structureDirection(),t=1.5*e,r=.125*e,n=12,o=1.5,c=3.5,u=[i(0,0),i(0,o),i(-t,2.5),i(-t,c),i(0,4.5),i(0,7.5),i(-t,8.5),i(-t,9.5),i(0,10.5),i(0,n)];return new a([new l(new s([...u,...u.slice().reverse().map((e=>e.movedBy(-r,0)))]))])}materialName(){return"Guardrail"}materialLineItems(){const e=n.unit(this.length(),this.unit()),t=n.unit(n.ceil(e.toNumeric("ft")),"ft");return[new c(t,this.materialSpecifier())]}defaultGeometry(){const e=this.width().toNumeric(this.unit()),t=this.componentOf().structureDirection(),r=this.edge().shiftedAlongNormalBy(e*t);return new s([...this.edge().endpoints(),...r.reversed().endpoints()])}}},46494:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),s=r(16610),o=r(88646),a=r(20901),l=r(6556);e.exports=class RailingDepotPipeRail extends s{static defaultRadius(){return n.unit(1,"in")}static defaultWidth(){return n.multiply(this.defaultRadius(),2)}static defaultDepth(){return n.multiply(this.defaultRadius(),2)}railingStyle(){return this.componentOf().railingStyle()}radius(){return this.railingStyle().pipeRadius()}width(){return n.multiply(this.radius(),2)}depth(){return n.multiply(this.radius(),2)}crossSection(){return new o([new a(i(0,0).expandedByRadius(this.radius().toNumeric(this.unit())))])}materialName(){return"Pipe"}materialLineItems(){const e=n.unit(this.length(),this.unit()),t=n.unit(n.ceil(e.toNumeric("ft")),"ft");return[new l(t,this.materialSpecifier())]}}},16610:(e,t,r)=>{const n=r(74215);e.exports=class RailingDepotRail extends n{railingStyle(){return this.componentOf().railingStyle()}color(){return this.railingStyle().railColor()}materialName(){return"Rail"}materialSpecifier(){const e=this.materials[this.materialName()];return e.details().fillStyle=this.color().fillStyle(),e.details().strokeStyle=this.color().strokeStyle(),e}}},3179:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),s=r(16610),o=r(88646),a=r(56214),l=r(6556);e.exports=class RailingDepotTopRail extends s{static defaultWidth(){return n.unit(2.5,"in")}static defaultDepth(){return n.unit(1,"in")}width(){return this.constructor.defaultWidth()}depth(){return this.constructor.defaultDepth()}crossSection(){return new o([new a(i(0,0).expandedBy(this.width().toNumeric(this.unit())/2,this.depth().toNumeric(this.unit())/2))])}materialLineItems(){const e=n.unit(this.length(),this.unit()),t=n.unit(n.ceil(e.toNumeric("ft")),"ft");return[new l(t,this.materialSpecifier())]}}},88338:(e,t,r)=>{const n=r(63768),i=r(38282);e.exports=i({railings:{base:{maxRailLength:n.unit(6,"ft")}}})},99813:(e,t,r)=>{const n=r(43812);e.exports=class RailingsPreviewProject extends n{configuration(){return this.systemStrategy().configuration()}}},64805:(e,t,r)=>{const n=r(83741),i=r(81428);e.exports=Object.freeze({...i,postMountingMode:n.MOUNT_STYLE_IDENTIFIERS,railOwner:{none:"none",section:"section",block:"block"},termination:{mode:"Mode",prefix:{begin:"Begin",end:"End"}}})},16749:(e,t,r)=>{const n=r(56124),i=r(5895);e.exports={defaultModelName:"Edges",layer:i.ANGLE_ANNOTATIONS,distance:36,minDistance:2,angleSignificantDecimalPlaces:n.significantDecimalPlaces.angles}},78911:(e,t,r)=>{const n=r(63768),i=r(56124);e.exports={width:n.unit(4,"ft"),thickness:n.unit(18,"in"),defaultFigure:{styleProperties:{fillStyle:"transparent",strokeStyle:i.colors.ultraBlack,lineWidth:.5},showSlopeArrow:!0}}},93009:(e,t,r)=>{const n=r(44476),i=r(56124);e.exports={defaultModelName:"Edges",layer:"Annotations",annotationClass:n,distance:30,unit:"in",options:{formatWithFeet:!0,fractionDenominator:1,fadeWithDistance:!1,color:i.colors.text,formatter:void 0,crampedTextAngle:void 0,textAtBegin:void 0},modelBasedAnnotations:void 0}},42051:(e,t,r)=>{const n=r(63768);const i=n.unit(0,"in"),s=n.unit(0,"in");e.exports={name:"Default Post Mount Style",id:"TC_DEFAULT",mountingMode:void 0,materialLineItemsHelperFunction:function(e,t,r){return[]},offsetFromEdgeOfPlatform:i,offsetBelowSurfaceOfPlatform:s}},91:e=>{e.exports={cornerAngleRanges:[{lowerBound:0,upperBound:180,rotation:0}]}},42126:(e,t,r)=>{const n=r(63768),i=r(43320),s=r(74215),o=r(80371),a=r(83741),l=r(58684),c=r(40858),u=r(83356),d=r(64805),h=r(86428),p=[new i("Black","metallic-black-low-gloss","#fff","#000"),new i("White","metallic-white-low-gloss","#fff","#000"),new i("Grey","metallic-grey-low-gloss","#fff","#000")];e.exports={styleId:"default",label:"Generic Rail",icon:"generic-rail",class:l,railingBlock:c,railingPost:u,displayProperties:{color:{show:!0,choices:p}},postMountStyles:{classes:[a],classInstanceConfigs:{}},postClasses:[o],postLayoutEdgeInsetHelper:h,topRail:{railOwner:d.railOwner.section,railClass:s},bottomRail:{railOwner:d.railOwner.none,railClass:s,height:n.unit(3,"in")},maxPostSpacing:void 0,cornerPostReuseTolerance:n.unit(.01,"in")}},49034:(e,t,r)=>{const n=r(9343),i=r(56124);e.exports={defaultModelName:void 0,layer:"Annotations",annotationClass:n,distance:40,options:{color:i.colors.error,orthogonalTextRendering:!1,adjustForZoomLevel:!0},modelBasedAnnotations:void 0}},86428:(e,t,r)=>{const n=r(63768),i=r(43357);e.exports={class:i,config:{fallbackInset:n.unit(0,"in"),parallelInset:n.unit(0,"in"),rightAngleInset:n.unit(0,"in"),terminalInset:n.unit(0,"in"),obliqueInset:void 0,obliqueInsetRanges:void 0}}},25239:(e,t,r)=>{const n=r(63768),i=r(43320);e.exports={minLength:void 0,minRailLength:n.unit(6,"in"),maxRailLength:n.unit(10,"ft"),defaultColor:new i("Black","metallic-black-low-gloss","#000","#000"),defaultPostLength:n.unit(3,"in"),defaultPostWidth:n.unit(3,"in"),colors:void 0}},40858:(e,t,r)=>{const n=r(84155);e.exports={blockClass:n,beginRailInset:void 0,endRailInset:void 0,panelClass:void 0}},26706:(e,t,r)=>{const n=r(63768),{RailLengthHelper:i}=r(8423);e.exports={defaultRailingHeight:n.unit(36,"in"),displayProperties:{railLengthMode:{show:!0,choices:[i.mode.AUTO,i.mode.MAX_LENGTH,i.mode.SYMMETRIC]},railingStyle:{choices:[]},terminationProperties:[]}}},83356:(e,t,r)=>{const n=r(63768),i=r(59663),s=r(21416),o=r(56124),a=r(91);e.exports={defaultLength:n.unit(1.5,"in"),defaultWidth:n.unit(1.5,"in"),defaultFigure:{class:i,styleProperties:{strokeStyle:o.colors.contrast.high,fillStyle:o.colors.contrast.mediumHigh,lineWidth:.2}},orientationHelper:{class:s,config:a},materialNames:void 0,layer:void 0,parts:void 0}},15905:(e,t,r)=>{const n=r(16749),i=r(93009),s=r(49034),o=r(42051),a=r(91),l=r(42126),c=r(25239),u=r(26706),d=r(49477),h=r(70431);e.exports={base:c,railingCollection:u,railingRun:d,railingSection:h,railingStyles:{},defaults:{angleAnnotationHelper:n,linearDimensionAnnotationHelper:i,warningAnnotationHelper:s,postMountStyle:o,railingPostOrientationHelper:a,railingStyle:l}}},49477:(e,t,r)=>{const n=r(35080),i=r(33496),s=r(78911);e.exports={annotationHelpers:{angles:{class:n,config:{defaultModelName:"RailingRun"}}},runClass:i,generatedStructure:s}},70431:(e,t,r)=>{const n=r(63768),i=r(68289),s=r(10590);e.exports={sectionClass:s,displayProperties:{length:{show:!0,label:"Section Length",defaultUnit:"in"},maxPostSpacing:{show:!1,label:"Max Post Spacing",defaultUnit:"in"},postMountStyle:{show:!0}},pendingRailWidth:n.unit(2,"in"),postContextClass:i,annotationHelpers:{}}},93250:(e,t,r)=>{const n=r(63768),{Polygon:i}=r(62048),s=r(8297),o=r(15004),a=r(38222),l=r(89836),c=r(5660),u=r(30691),d=r(78911),h=r(5895);e.exports=class GeneratedPlatform extends s{constructor(e,t={}){super(new a),this._mountingEdge=e,this._details=c.mergeDeep({},{sources:[d,t]})}mountingEdge(){return this._mountingEdge}details(){return this._details}oppositeEdge(){const e=this.mountingEdge(),t=this.platformDirection(),r=-this.width().toNumeric(this.unit());return e.shiftedAlongNormalBy(t*r)}defaultGeometry(){const e=this.mountingEdge(),t=this.oppositeEdge(),r=[e.begin(),e.end(),t.end(),t.begin()];return-1===this.platformDirection()&&r.reverse(),new i(r)}platformDirection(){return this.componentOf().structureDirection()}width(){return this.details().width??n.unit(48,"in")}thickness(){return this.details().thickness??n.unit(18,"in")}showSlopeArrow(){return this.details().defaultFigure.showSlopeArrow??!0}allLocatedMaterials(){return[]}zLevel(){return this.geometry().vertices().first().z()}height(){return n.unit(-this.zLevel(),this.unit())}centerline(){const e=this.mountingEdge(),t=this.oppositeEdge();if(u.isLevel(e))return;const r=e.begin().to(t.begin()),n=e.end().to(t.end()),i=[r.center(),n.center()];return i.first().z()>i.last().z()&&i.reverse(),i.first().to(i.last())}setHeight(){}moveBy(){return!1}heightChanged(){}frameResized(){}defaultDisplayProperties(){return[]}defaultFigure(){const e=new l(this,this.details().defaultFigure.styleProperties);return e.setLayer(this.drawingLayer()),e}threeFigure(){const e=new o(this);return e.setLayer(this.drawingLayer()),e}drawingLayer(){return this._drawingLayer??=this._defaultDrawingLayer()}setDrawingLayer(e){this._drawingLayer=e}_defaultDrawingLayer(){return h.platformLayerFor(this.centerline())}}},53416:(e,t,r)=>{const n=r(63768),{CompositeFigure:i}=r(7340),{Composite3DFigure:s}=r(37732),o=r(93250);e.exports=class GeneratedPlatformWithDripEdge extends o{mainPlatformMountingEdge(){const e=this.mountingEdge(),t=-this.mountingEdgeOffset().toNumeric(this.unit())*this.platformDirection();return e.shiftedAlongNormalBy(t)}railingRun(){return this.componentOf()}mountingEdgeOffset(){return this.railingRun().structureMountingEdgeOffset()}postMountStyle(){return this.railingRun().postMountStyle()}hasDripEdge(){return this.postMountStyle().hasDripEdge()}dripEdgeWidth(){return this.postMountStyle().dripEdgeWidth()}dripEdgeOverhangThreshold(){return this.postMountStyle().dripEdgeOverhangThreshold()}dripEdgeShouldOverhang(){return n.larger(this.dripEdgeWidth(),this.dripEdgeOverhangThreshold())}mainPlatform(){return this._mainPlatform??=this._defaultMainPlatform()}_defaultMainPlatform(){const e={...this.details(),width:n.subtract(this.width(),this.mountingEdgeOffset()),thickness:this.thickness()},t=new o(this.mainPlatformMountingEdge(),e);return t.setComponentOf(this.railingRun()),t.setDrawingLayer(this.drawingLayer()),t}dripEdge(){return this._dripEdge??=this._defaultDripEdge()}_defaultDripEdge(){if(!this.hasDripEdge())return;const e={...this.details(),width:this.dripEdgeWidth(),thickness:this.dripEdgeThickness()};e.defaultFigure.showSlopeArrow=!1;const t=new o(this.dripEdgeMountingEdge(),e);return t.setComponentOf(this.railingRun()),t.setDrawingLayer(this.drawingLayer()),t}dripEdgeMountingEdge(){const e=this.dripEdgeWidth().toNumeric(this.unit()),t=this.mainPlatformMountingEdge(),r=this._dripEdgeZOffset(),n=this.platformDirection()*e;return t.addZ(r).shiftedAlongNormalBy(n).relativeToEdge(t)}_dripEdgeZOffset(){if(this.dripEdgeShouldOverhang())return 0;const e=this.postMountStyle().dripEdgeHeight().toNumeric(this.unit()),t=this.dripEdgeThickness().toNumeric(this.unit());return Math.max(e-t,t)}dripEdgeThickness(){return this.dripEdgeShouldOverhang()?this.postMountStyle().dripEdgeHeight():n.unit(.125,"in")}defaultFigure(){return i.withModel(this)}threeFigure(){return s.withModel(this)}components(){return[this.mainPlatform(),this.dripEdge()].filter(Boolean)}}},7491:(e,t,r)=>{const n=r(63768),{Polygon:i,FixedEdgeLocator:s,NormalToEdgeLocator:o,ProportionalEdgeLocator:a}=r(62048),l=r(28823),c=r(93250),u=r(44810),d=r(48661),h=r(66509),p=r(46748),m=r(5895);e.exports=class GeneratedStairs extends l{constructor(e,t,r,n,i){super(e,t),this._stepRise=r,this._stepRun=n,this._railingRun=i}allLocatedMaterials(){return[]}_defaultInclineAngle(){return n.atan(n.divide(this.stepRise(),this.stepRun()))}stepRise(){return this._stepRise}stepRun(){return this._stepRun}railingRun(){return this._railingRun}hasStringer(){return this.railingRun().hasStringer()}showLandings(){return this.railingRun().showStairLandings()}treadWidth(){return this.stepRun()}landingWidth(){return n.unit(this.topEdge().length(),this.unit())}_resetComponents(){this._frameEdgeAttachedTo=void 0,this._stringers=void 0,this._treads=void 0,this._landings=void 0}landings(){return this._landings??=this._defaultLandings()}components(){return[...super.components(),...this.landings()]}bottomEdge(){const e=this.totalRise().toNumeric(this.unit()),t=p`${e} * (${this.stepRun()} / ${this.stepRise()})`;return this.topEdge().shiftedAlongNormalBy(t).addZ(e)}geometry(){return new i([this.topEdge().begin(),this.topEdge().end(),this.bottomEdge().end(),this.bottomEdge().begin()])}sideEdges(){return[this.topEdge().begin().to(this.bottomEdge().begin()),this.topEdge().end().to(this.bottomEdge().end())]}platformDirection(){return this.componentOf()?.structureDirection()||1}_defaultTreads(){let e=this.nosingEdges();return this.showLandings()&&(e=e.slice(1,-1)),-1===this.platformDirection()&&(e=e.map((e=>e.reversed()))),e.map((e=>this._generateSurface(e,this.treadWidth())))}_defaultLandings(){if(!this.showLandings())return[];const e=this.landingWidth(),t=this.treadWidth().toNumeric(this.unit()),r=this.topEdge(),n=this.bottomEdge(),i=this.platformDirection();return[1===i?r:r.reversed(),1===i?n.reversed().shiftedAlongNormalBy(t):n.shiftedAlongNormalBy(-t)].map((t=>this._generateSurface(t,e)))}_generateSurface(e,t){const r=new c(e,{width:t});return r.setDrawingLayer(this.drawingLayer()),r.setComponentOf(this.railingRun()),r}nosingEdges(){const e=[],t=this.sideEdges(),r=p`round(${this.totalRise()} / ${this.stepRise()}) + 1`,n=p`sqrt(${this.stepRun()} * ${this.stepRun()} + ${this.stepRise()} * ${this.stepRise()})`.toNumeric(this.unit());for(let i=0;i<r;i++){const r=t.map((e=>new s(e,i*n))),o=r.first().to(r.last());e.push(o)}return e}treadEdges(){const e=this.nosingEdges(),t=this.stepRun().toNumeric(this.unit());return e.map((e=>{const r=new a(e,0);return new o(r,-t).to(r)}))}_defaultStringers(){if(!this.hasStringer())return[];const e=this.stringerDepth(),t=this.stringerWidth();return this._stringerEdges().map((r=>new h(r.begin(),r.end(),e,t)))}_stringerEdges(){const e=this.nosingEdges(),t=e.first(),r=this.extendStringerThroughLastStep()?e.last():e[e.length-2],n=this.stringerHeightAboveStairNose().toNumeric(this.unit());return[t.begin().to(r.begin()),r.end().to(t.end())].map((e=>e.addZ(-n)))}stringerHeightAboveStairNose(){return this.railingRun().stringerHeightAboveStairNose()}stringerWidth(){return h.defaultWidth()}stringerDepth(){return n.add(this.stepRise(),this.stringerHeightAboveStairNose())}extendStringerThroughLastStep(){return this.railingRun().extendStringerThroughLastStep()}zLevel(){return this.topEdge().begin().z()}defaultFigure(){const e=u.withModel(this);return e.setLayer(this.drawingLayer()),e}threeFigure(){const e=new d(this);return e.setLayer(this.drawingLayer()),e}drawingLayer(){return this._drawingLayer??=this._defaultDrawingLayer()}setDrawingLayer(e){this._drawingLayer=e}_defaultDrawingLayer(){return m.platformLayerFor(this.railingRun().edge())}}},35337:(e,t,r)=>{const{EdgeIntersectionHelper:n}=r(8423);e.exports=class LegacyEdgeIntersectionHelper extends n{edge(e,t,r=!0,n=this.overrideIntersection.bind(this)){const i=this.line();if(!r)return i;let[s,o]=i.endpoints();return e&&!i.isParallelTo(e)&&(s=this._lineIntersection(i,e,!0,n)),t&&!i.isParallelTo(t)&&(o=this._lineIntersection(i,t,!1,n)),s.to(o)}}},68689:(e,t,r)=>{const{$P:n}=r(62048),i=r(70971);e.exports=class LevelSurfaceRailingPlacementStrategy extends i{incrementOptional(){return!0}endpointMovedTo(e,t,{constrainToValidPosition:r,constrainToLengthIncrements:n}={}){const i=super.endpointMovedTo(e,t,{constrainToValidPosition:r,constrainToLengthIncrements:n}),s=-this.surfaceHeight().toNumeric(this.railingRun().unit());return i.addZ(s)}initialEdge(e,t,r){const i=-this.surfaceHeight().toNumeric(t),s=this.incrementSize(r).toNumeric(t),o=n(e.x(),e.y(),i),a=o.add(s,0);return o.to(a)}displayPropertiesExposedAfterDrawing(){return[]}}},68289:(e,t,r)=>{const n=r(38536),i=r(64805);e.exports=class PostContext{constructor(e,t,r){this._isFirstPosition=0===t,this._isLastPosition=t===r,this._section=e,this.isFirstPosition()&&(this._connectedSection=e.sectionConnectedToBegin()),this.isLastPosition()&&(this._connectedSection=e.sectionConnectedToEnd())}section(){return this._section}connectedSection(){return this._connectedSection}isFirstPosition(){return this._isFirstPosition}isLastPosition(){return this._isLastPosition}isEndpointPosition(){return this.isFirstPosition()||this.isLastPosition()}isInteriorPosition(){return!this.isEndpointPosition()}isLinePosition(){return this.isInteriorPosition()||this.sectionsAreParallelIn3D()}isSlopedPosition(){return this._isSlopedPosition??=this.section().sloped()}isLevelPosition(){return!this.isSlopedPosition()}isSlopeTransition(){return!!this.connectedSection()&&(!!this.isEndpointPosition()&&this.section().sloped()!==this.connectedSection().sloped())}sectionsAreParallelIn3D(){return this._sectionsAreParallel??=this.section().isParallelToSectionIn3D(this.connectedSection())}connectedAngleDegrees(e=1){const t=this.connectedSection();if(!t)return 0;return(this.section().edge().normalizedAngle()-t.edge().normalizedAngle()).normalizedAngle().radiansToDegrees().roundedTo(e)}__sectionsArePerpendicular(e){if(!this.connectedSection())return!1;const t=this.connectedAngleDegrees(e);return t.isNearTo(90)||t.isNearTo(270)}sectionsArePerpendicular(e=1){return this._sectionsArePerpendicular??=this.__sectionsArePerpendicular(e)}sectionsAreOblique(){return this.connectedSection()&&!this.sectionsAreParallelIn3D()&&!this.sectionsArePerpendicular()}terminationMode(){if(this.isInteriorPosition())return;if(this.section().collection().isClosedLoop())return;const e=this.section().run();return e.nextRun()||e.endSection()!==this.section()?e.previousRun()||e.beginSection()!==this.section()?void 0:this._beginTerminationMode():this._endTerminationMode()}_beginTerminationMode(){if(!this.isFirstPosition())return;const e=i.termination.prefix.begin;return this._terminationMode(e)}_endTerminationMode(){if(!this.isLastPosition())return;const e=i.termination.prefix.end;return this._terminationMode(e)}_terminationMode(e){const t=i.termination.mode,r=this.section().collection(),s=n.propertyKey(e,t),o=r.selectPropertyMap().get(s);return o?.representedObject()}toObject(){return{isFirstPosition:this.isFirstPosition(),isLastPosition:this.isLastPosition(),sectionEdge:this.section().edge().snapshot().toString(),connectedSectionEdge:this.connectedSection()?.edge().snapshot().toString()}}}},76281:e=>{e.exports=class PostDescriptor{constructor(e,t,r,{isDefault:n=!1,...i}={}){this._description=e,this._postHeight=t,this._railAttachmentLevels=r,this._isDefault=n,this._options=i}description(){return this._description}postHeight(){return this._postHeight}railAttachmentLevels(){return this._railAttachmentLevels}isDefault(){return this._isDefault}options(){return this._options}equals(e){if(!(e&&e.description&&e.postHeight&&e.railAttachmentLevels))return!1;const t=this.railAttachmentLevels().every(((t,r)=>t.equals(e.railAttachmentLevels()[r])));return this.description()===e.description()&&this.postHeight().equals(e.postHeight())&&t}}},43812:(e,t,r)=>{const n=r(64637),{extend:i}=r(50988),s=r(8297),o=r(28823),a=r(73164),l=r(33046),c=r(80317);class RailingDesignerProject extends a{static type(){return"railing"}railingCollections(){return this.componentsForRoles(c.RAILING_COLLECTION)}setColor(e,t){super.setColor(e,t),this.railingCollections().forEach((e=>e.resetSections()))}showStructures(){return this.systemStrategy().showsStructures?.()||!1}connectors(){return this.components().filter((e=>e instanceof o))}frames(){return this.components().filter((e=>e instanceof s))}measurementSnapEdges(){return this.railingCollections().flatMap((e=>e.sections())).map((e=>e.edge()))}xrOrigin(){const e=this.railingCollections().first();if(!e)return super.xrOrigin();return e.sections().first().beginPost().locator()}xrDirection(){const e=this.railingCollections().first();if(!e)return super.xrDirection();return e.railingRuns().first().edge().xy().direction()}pdfRoleExclusions(){return[c.BACKGROUND]}pdfDocumentClass(){return n}}i(RailingDesignerProject,l);const u=RailingDesignerProject;e.exports=u},66509:(e,t,r)=>{const n=r(63768),{ExtrudedPolygon:i}=r(62048),s=r(76816),o=r(15004),a=r(89836),l=r(5895);e.exports=class RailingMountStringer extends s{static defaultWidth(){return n.unit(6,"in")}geometry(){return this.shape()}_defaultShape3D(){const e=this.thickness().toNumeric(this.unit());return new i(this.shape(),e)}defaultFigure(){const e=new a(this);return e.setLayer(l.platformLayerFor(this.edge())),e}threeFigure(){return new o(this)}centerline(){}}},59214:(e,t,r)=>{const n=r(63768),{EditableProperty:i}=r(7340),{MaterialSpecifier:s}=r(93613),o=r(84374);e.exports=class ResizableGate extends o{static minimumPostHeight(){return n.unit(1,"in")}requiredOpeningWidth(e=this.width()){return n.max(e,this.minGateWidth())}paddingNeeded(){return n.unit(2,"in")}displayProperties(){return[new i(this,"Width",{type:"unit",defaultUnit:"in"})]}width(){return this._width||(this._width=this._defaultGateWidth()),this._width}_defaultGateWidth(){const e=this.opening().width(),t=this.absoluteMaxGateWidth();return n.larger(e,this.absoluteMaxGateWidth())?t:e}setWidth(e){this.componentOf().setWidth(e),this._width=e,this.resetComponents(),this.resetAnnotations(),this.delegate()?.gateWidthChanged(this)}validateWidth(e,t){if(!e)return;const r=this.minGateWidth(),i=this.absoluteMaxGateWidth(),s=this.maxGateWidth(),o=this.formatMeasurement(r),a=this.formatMeasurement(i),l=this.formatMeasurement(s);return n.smaller(t,r)?`Cannot be less than ${o}`:n.larger(t,i)?`Cannot be greater than ${a}`:n.larger(t,s)?`This rail cannot hold gates larger than ${l}`:void 0}formatWidth(){return this.formatMeasurement(this.width())}formatMeasurement(e){return e.toString()}minGateWidth(){return n.unit(2,"ft")}maxGateWidth(){const e=this.componentOf();return e.railingRun().maximumSizeForOpening(e)}absoluteMaxGateWidth(){return n.unit(10,"ft")}materialSpecifier(){return new s("Gate","Gate")}resetComponents(){}resetAnnotations(){}}},35961:(e,t,r)=>{const{Polygon:n}=r(62048),{MissingOverride:i}=r(50988),{EditableProperty:s}=r(7340),o=r(67603),a=r(59663),l=r(84374);e.exports=class SingleGate extends l{flipped(){return this._flipped}direction(){const e=this.opening().edge().direction();return this.flipped()?e.negated():e}flip(){this._flipped=!this.flipped(),this.reset()}displayProperties(){return new o(this,[...super.displayProperties(),new s(this,"Flip Gate",{type:"action",perform:()=>this.flip()})])}showFlipGateProperty(){return!0}reset(){super.reset(),this._geometry=void 0}thickness(){throw new i(this,"thickness")}geometry(){return this._geometry??=this._defaultGeometry()}_defaultGeometry(){const e=this.thickness().toNumeric(this.unit()),t=this.edge().shiftedAlongNormalBy(e/2),r=this.edge().shiftedAlongNormalBy(-e/2);return new n([t.begin(),t.end(),r.end(),r.begin()])}boundingBox(){return this.geometry().boundingBox()}defaultFigure(){return new a(this)}threeFigure(){throw new i(this,"threeFigure")}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_geometry"]}}},45708:(e,t,r)=>{const n=r(63768),{EditableProperty:i}=r(7340),{$P:s}=r(62048),o=r(70971),a=r(7491),l=r(97677);e.exports=class StairSurfaceRailingPlacementStrategy extends o{displayPropertiesExposedAfterDrawing(){return[new i(this,"Step Rise",{type:"unit",defaultUnit:"in",ignoreIntermediateEdits:!0}),new i(this,"Step Run",{type:"unit",defaultUnit:"in",ignoreIntermediateEdits:!0}),new i(this,"Slope",{type:"unit",defaultUnit:"deg",ignoreIntermediateEdits:!0})]}surfaceHeightPropertyLabel(){return"Starting Height"}isStairs(){return!0}_defaultShowSurfaceHeightProperty(){return!0}verticalClearanceOffset(e=n.unit(0,this.unit())){const t=n.add(this.postInsetFromEndOfStep(),n.divide(e,2));return n.multiply(t,this.pitch())}clone(){const e=super.clone();return e.setStepRise(this.stepRise()),e.setStepRun(this.stepRun()),e}_defaultSurfaceHeight(){return n.unit(12,"ft")}stepRise(){return this._stepRise??=n.unit(7,"in")}setStepRise(e){this._stepRise=l(e,this.fractionPrecisionDenominator()),this.updateSlope(),this.notifyPropertyChangedObservers()}formatRise(){return this.lengthFormatter().format(this.stepRise())}validateRise(e,t){if(!e)return;const r=n.unit(1/this.fractionPrecisionDenominator(),"in");if(n.smaller(t,r)){return`Must be ${this.lengthFormatter().format(r)} or more.`}}minLength(){return this.stepRun()}stepRun(){return this._stepRun??=n.unit(12,"in")}setStepRun(e){this._stepRun=l(e,this.fractionPrecisionDenominator()),this.updateSlope(),this.notifyPropertyChangedObservers()}formatRun(){return this.lengthFormatter().format(this.stepRun())}validateRun(e,t){if(!e)return;const r=this._minRun();if(n.smaller(t,r)){return`Must be ${this.lengthFormatter().format(r)} or more.`}}_minRun(){return n.unit(1/this.fractionPrecisionDenominator(),"in")}postInsetFromEndOfStep(){return this._postInsetFromEndOfStep||(this._postInsetFromEndOfStep=n.unit(2,"in")),this._postInsetFromEndOfStep}setPostInsetFromEndOfStep(e){this._postInsetFromEndOfStep=e}pitch(){return n.divide(this.stepRise(),this.stepRun())}slope(){const e=this._slopeInRadians(),t=n.round(e.radiansToDegrees(),2);return n.unit(t,"deg")}_slopeInRadians(){return n.atan(this.pitch())}setSlope(e){const t=e.toNumeric("rad"),r=n.divide(this.stepRise(),n.tan(t));this._stepRun=l(r,this.fractionPrecisionDenominator()),this.displayProperties().find((e=>"Step Run"===e.name())).update(),this.notifyPropertyChangedObservers()}formatSlope(){return`${n.round(this.slope().toNumeric("deg"),2)} deg`}validateSlope(e,t){if(!e)return;const r=n.unit(1,"deg"),i=n.divide(this.stepRise(),this._minRun()),s=n.unit(n.atan(i),"rad");if(n.smaller(t,r)){return`Must be ${`${Math.floor(r.toNumeric("deg")).rounded()}°`} or more.`}if(n.larger(t,s)){return`Must be ${`${Math.floor(s.toNumeric("deg"))}°`} or less.`}}updateSlope(){this.displayProperties().find((e=>"Slope"===e.name())).update()}incrementSize(){return this.stepRun()}stepSnapSize(){return n.unit(n.hypot(this.stepRun().toNumeric("in"),this.stepRise().toNumeric("in")),"in")}endpointMovedTo(e,t,{constrainToValidPosition:r,constrainToLengthIncrements:i}={}){const s=super.endpointMovedTo(e,t,{constrainToValidPosition:r,constrainToLengthIncrements:i}),o=this.railingRun().edge(),a=e===o.begin()?o.end():o.begin(),l=a.distanceTo(s);let c=Math.sign(e.z()-a.z());0===c&&(c=1);const u=c*l*n.divide(this.stepRise(),this.stepRun()),d=a.z()+u;return s.addZ(d)}initialEdge(e,t,r){const i=-this.surfaceHeight().toNumeric(t),o=this.incrementSize(r).toNumeric(t),a=o*n.divide(this.stepRise(),this.stepRun()),l=s(e.x(),e.y(),i),c=l.add(o,0,a);return l.to(c)}_generateStructureRepresentation(e,t,r,i){const s=e.end().z()>e.begin().z()?e.begin().to(t.begin()):t.end().to(e.end()),o=this.postInsetFromEndOfStep().toNumeric(this.unit())+i,l=s.shiftedAlongNormalBy(r*o),c=[l.begin(),l.end()];-1===r&&c.reverse();const u=this.railingRun().edge(),d=n.unit(Math.abs(u.end().z()-u.begin().z()),this.unit());return new a(c,d,this.stepRise(),this.stepRun(),this.railingRun())}_structureMountingEdge(e,t){return this.railingRun().edge().shiftedAlongNormalBy(e*t)}}},84374:(e,t,r)=>{const{Gate:n}=r(8423),i=r(6556);e.exports=class ThunderCloudGate extends n{materialLineItems(){return[new i(1,this.materialSpecifier())]}}},52494:(e,t,r)=>{const{extend:n}=r(50988),{HybridSurfaceRailingPlacementStrategy:i}=r(8423),s=r(7491),o=r(88317),a=r(93250);class ThunderCloudHybridSurfaceRailingPlacementStrategy extends i{_generateStructureRepresentation(e,t,r,n){return this.isStairs()?this._generateSteppedStructureRepresentation(e,t,r,n):new a(e,{thickness:this.defaultStructureRepresentationThickness()})}_generateSteppedStructureRepresentation(e,t,r){const n=(e.end().z()>e.begin().z()?e.begin().to(t.begin()):t.end().to(e.end())).endpoints().slice();return-1===r&&n.reverse(),new s(n,this.rise(),this.stepRise(),this.stepRun(),this.railingRun())}}n(ThunderCloudHybridSurfaceRailingPlacementStrategy,o),e.exports=ThunderCloudHybridSurfaceRailingPlacementStrategy},22391:(e,t,r)=>{const{three:n}=r(37732),{MaterialSpecifier:i}=r(93613),{Composite3DFigure:s}=r(37732),{CompositeFigure:o}=r(7340),a=r(88646),l=r(86755),c=r(80371),u=r(30202),d=r(57473),h=r(64805);e.exports=class ThunderCloudMultiPartRailingPost extends c{materialNames(){return this.config.materialNames||[this.color().materialName()]}planarNormal(){return(this.bottomLocator().edge?.()||this.locator().edge()).vector().xy().normalized()}baseplateDepth(){return this._activeBaseplateConfig().orthogonalDistance}_activeBaseplateConfig(){const e=this.mountStyle().mountingMode(),t=this.config.parts?.baseplate||{};return t[e]||t}baseplateTopLocator(){const e=this.baseplateDepth().toNumeric(this.unit());return this.locator().addZ(-e)}leg(){return this._leg??=this._defaultLeg()}_defaultLeg(){const e=this.bottomLocator(),t=this.topLocator(),r=this._defaultLegCrossSection(),n=this.legMaterialSpecifier(),i=this.planarNormal();return new u(e,t,r,n,i)}_defaultLegCrossSection(){const e=this.config.parts?.leg?.crossSection;if(e)return e;const t=this.bottomLocator(),r=this.geometry().movedBy(-t.x(),-t.y(),-t.z());return new a([new l(r)])}legMaterialSpecifier(){const e=this.config.parts?.leg||{};return e.materialSpecifier||new i("Post Leg","Post Leg",this._defaultFigureStylePropertiesWith({materialName:this.color().materialName(),fillStyle:this.color().fillStyle(),strokeStyle:this.color().strokeStyle(),...e.defaultFigure?.styleProperties||{}}))}baseplate(){return this._baseplate??=this._defaultBaseplate()}_defaultBaseplate(){const e=this._activeBaseplateConfig();if(!e.geometryType)return;return e.geometryType===h.geometryType.extrusion?this._defaultExtrusionBaseplate():this._default3DModelBaseplate()}_defaultExtrusionBaseplate(){const e=this.bottomLocator(),t=this.baseplateTopLocator(),r=this._activeBaseplateConfig().crossSection,n=this.baseplateMaterialSpecifier(),i=this.planarNormal();return new u(e,t,r,n,i)}_default3DModelBaseplate(){const e=this.bottomLocator(),t=this._activeBaseplateConfig().modelIdentifier,r=this.materialNames(),n=this.rotation();return new d(e,t,n,void 0,r)}rotation(){const e=this._sectionDirection();return this._getRotationForDirection(e)}_sectionDirection(){return(this.bottomLocator().edge?.()||this.componentOf().edge()).direction()}_getRotationForDirection(e){return(new n.Quaternion).setFromUnitVectors(new n.Vector3(0,-1),e.toThreeJS())}baseplateMaterialSpecifier(){const e=this._activeBaseplateConfig();return e.materialSpecifier||new i("Post Baseplate","Post Baseplate",this._defaultFigureStylePropertiesWith({materialName:this.color().materialName(),fillStyle:this.color().fillStyle(),strokeStyle:this.color().strokeStyle(),...e.defaultFigure?.styleProperties||{}}))}sleeves(){return this._sleeves??=this._defaultSleeves()}_defaultSleeves(){return[]}components(){return[this.baseplate(),this.leg(),...this.sleeves()].filter(Boolean)}_defaultFigure(){return o.withModel(this)}_defaultFigureStylePropertiesWith(e){return{...this.config.defaultFigure.styleProperties,...e}}_threeFigure(){return s.withModel(this)}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_leg","_baseplate","_sleeves"]}}},74134:(e,t,r)=>{const{NullDrawable:n}=r(7340),{NullDrawable3D:i}=r(37732),s=r(80371);e.exports=class ThunderCloudNullPost extends s{static fitsContext(e){const t=e.terminationMode();return!!t&&!t.includesPost()}defaultFigure(){return new n(this)}threeFigure(){return new i(this)}}},97477:(e,t,r)=>{const{extend:n,simpleObserver:i}=r(50988),{RailingCollection:s,RailLengthHelper:o}=r(8423),{PropertiesCollection:a,EditableProperty:l,CompositePropertiesCollection:c,OverlappingPropertiesCollection:u}=r(7340),d=r(26933),h=r(9500),p=r(74320),m=r(19418),f=r(38536),g=r(24360),y=r(30691),b=r(58684),v=r(95052),_=r(80317),x=r(51486),w=r(64805);class ThunderCloudRailingCollection extends s{static role(){return _.RAILING_COLLECTION}get railingsConfig(){return this.strategyProjectConfig().railings}get config(){return this.railingsConfig.railingCollection}sectionClass(){return this.railingsConfig.railingSection.sectionClass}runClass(){return this.railingsConfig.railingRun.runClass}_defaultRailingHeight(){return this.config.defaultRailingHeight}resetSections(){super.resetSections(),this.railingRuns().forEach((e=>{e.resetStructure()})),this.notifySectionsUpdatedObservers()}resetSectionComponents(){super.resetSectionComponents(),this.notifySectionsUpdatedObservers()}resetSectionAnnotations(){this.sections().forEach((e=>e.resetAnnotations()))}defaultDisplayProperties(){return new c(this,[new a(this,[new l(this,"Rail Length Mode",{type:"select",choices:this.railLengthModeOptions(),label:"Panel Size Mode"}),new l(this,"Railing Style",{type:"segment",choices:this.railingStyleChoices()}),...this._terminationProperties()]),new u(this.sections(),"showOnCollection")])}showRailLengthModeProperty(){const e=this.config.displayProperties.railLengthMode;return x(e)}showRailingStyleProperty(){const e=this.config.displayProperties.railingStyle,t=this.railingStyleChoices().length>1;return x(e,t)}_terminationProperties(){if(0===this.sections().length)return[];if(this.isClosedLoop())return[];const e=this.config.displayProperties.terminationProperties;if(0===e.length)return[];const t=()=>this.resetSections(),r=new f(this),n=n=>e.map((e=>r.buildEditableProperty(e,n,t)));return[new h("begin-termination",{label:"Termination",imageURL:this._beginLocatorImageURL()}),...n(w.termination.prefix.begin),new h("end-termination",{label:"Termination",imageURL:this._endLocatorImageURL()}),...n(w.termination.prefix.end),new h]}_beginLocatorImageURL(){const e=this.sections().first();return this._locatorImageURL(e.edge(),e.edge().begin())}_endLocatorImageURL(){const e=this.sections().last();return this._locatorImageURL(e.edge(),e.edge().end())}_locatorImageURL(e,t){const r=y.toPolygon(e);return new p(r,100).generateImage({highlightedElement:t,drawingStyles:{backgroundColor:"#EBEBEB",strokeColor:"#000"}})}railingStyle(){return this._railingStyle??=this.railingStyleChoices().first()}setRailingStyle(e){this._railingStyle=e}railingStyleChoices(){const e=this.config.displayProperties.railingStyle.choices,t=this.railingsConfig.railingStyles;return e.map((e=>{const{styleId:r,label:n,icon:i}=t[e];return new b(r,n,i)}))}_defaultToleranceForSharedPost(){return(this.railingStyle()?.cornerPostReuseTolerance()||this.railingsConfig.defaults.railingStyle.cornerPostReuseTolerance).toNumeric("in")}railLengthModeOptions(){const e={[o.mode.AUTO]:"Auto-select",[o.mode.EVEN]:"Even",[o.mode.MAX_LENGTH]:"Max length",[o.mode.SYMMETRIC]:"Symmetric"};return this.config.displayProperties.railLengthMode.choices.map((t=>({label:e[t],value:t})))}showStructures(){if(this.componentOf())return this.componentOf().showStructures?.()||!1}toggleStructureSide(){this._structureAlongNormal=!this.structureAlongNormal(),this.resetSections(),this.sections().forEach((e=>{e.resetAnnotations()}))}structureAlongNormal(){return void 0===this._structureAlongNormal&&(this._structureAlongNormal=!0),this._structureAlongNormal}createOppositeRailing(){const e=this.collectionForOppositeRailing();this.railingRuns().forEach((t=>{t.createOppositeRailing(e)}))}collectionForOppositeRailing(){const e=new this.constructor;return this.project().add(e),e.applyRestorablePropertiesFromObject(this),this.structureAlongNormal()&&e.toggleStructureSide(),e}vertices(){return this.railingRuns().map((e=>e.boundingBox({excludeStructure:!0}))).reduce(((e,t)=>e.merge(t))).vertices()}setComponentOf(e){super.setComponentOf(e),this.project()?.addComponentObservers(this)}defaultFigure(){return new m(this)}projectedViewFigure(e,t,r){return d.withModel(this,e,t,r)}nonEssentialProperties(){return[...super.nonEssentialProperties(),...this.accumulatedNonEssentialProperties(),"_sectionsUpdatedObservers"]}}n(ThunderCloudRailingCollection,v),n(ThunderCloudRailingCollection,g),i(ThunderCloudRailingCollection,"sectionsUpdated"),e.exports=ThunderCloudRailingCollection},14025:(e,t,r)=>{const{RailingOpening:n}=r(8423),i=r(12904);e.exports=class ThunderCloudRailingOpening extends n{static fromLocator(e,t,r){const n=new this(e.to(e)),i=r.toNumeric(n.unit())/2,s=e.add(t.multipliedBy(-i)),o=e.add(t.multipliedBy(i)),a=s.to(o);return n.setEdge(a),n}lengthFormatter(){return this.systemStrategy().lengthFormatter()}allLocatedMaterials(){return this.components().flatMap((e=>e.allLocatedMaterials()))}defaultFigure(){return new i(this)}defaultAnnotations(){const e=this.systemStrategy().annotationType(),t=this.lengthFormatter();return[new e(this.railingRun().directionFlipped()?this.edge().reversed():this.edge(),void 0,this.unit(),{formatter:t})]}}},70971:(e,t,r)=>{const{extend:n}=r(50988),{RailingPlacementStrategy:i}=r(8423),s=r(88317);class ThunderCloudRailingPlacementStrategy extends i{constructor(e,t){super(e),this._fractionPrecisionDenominator=t}fractionPrecisionDenominator(){return this._fractionPrecisionDenominator||16}}n(ThunderCloudRailingPlacementStrategy,s),e.exports=ThunderCloudRailingPlacementStrategy},80371:(e,t,r)=>{const n=r(63768),{ExtrudedPolygon:i,FixedEdgeLocator:s,RelativeLocator:o}=r(62048),{extend:a}=r(50988),{RailingPost:l}=r(8423),c=r(24360),u=r(15004),d=r(29531);class ThunderCloudRailingPost extends l{static _railingsBaseConfig(){return this.strategyProjectConfig().railings.base}static defaultLength(){return this._railingsBaseConfig().defaultPostLength}static defaultWidth(){return this._railingsBaseConfig().defaultPostWidth}static fitsContext(e){return!0}get railingStyleConfig(){return this.railingStyle().config}get config(){return this.railingStyleConfig.railingPost}color(){return this.colors.defaultColor}height(){return this.section().railingHeight()}heightAboveSurface(){return n.subtract(this.height(),this.heightBelowSurface())}topLocator(){return this._relativeLocator(this.height())}bottomLocator(){return this._bottomLocator??=this._defaultBottomLocator()}_defaultBottomLocator(){const e=this.locator().edge(),t=this._simpleBottomLocator();if(!e)return t;const r=this.heightBelowSurface().toNumeric(this.unit()),n=this.orientation().degreesToRadians(),i=e.addZ(r).relativeToEdge(e);n.isNearTo(0)||i.rotateBy(t,n);const o=this.locator().distance?.()||i.begin().distanceTo(t);return new s(i,o)}_simpleBottomLocator(){return super.bottomLocator()}orientation(){return this._postOrientationHelper().orientationFor(this)}_postOrientationHelper(){return this.__postOrientationHelper??=this._defaultPostOrientationHelper()}_defaultPostOrientationHelper(){return new(0,this.config.orientationHelper.class)(this.config.orientationHelper.config)}geometry(){return this._geometry??=this.defaultGeometry()}geometryStrategy(){return this._geometryStrategy??=new d}defaultGeometry(){return this.geometryStrategy().generateGeometry(this)}offsetFor(e){return n.unit(0,"in")}structureAlongNormal(){return this.section().structureAlongNormal()}structureDirection(){return this.section().structureDirection()}_defaultShape3D(){return new i(this._postBaseGeometry(),-this.thickness(),this._extrudeVertices.bind(this),!1)}_postBaseGeometry(){return this.geometry()}_extrudeVertices(e,t){const r=this.geometry().normal().multipliedBy(t);return e.map((e=>new o(e,r.x(),r.y(),r.z())))}isSlopeTransitionPost(){if(this.isTerminalPost()||this.isLinePost())return!1;const e=this.section().slope().toNumeric("rad"),t=this.connectedSection().slope().toNumeric("rad");return!e.isNearTo(t)}materialNames(){return this.config.materialNames||["aluminum"]}defaultFigure(){return this._figureOnLayer(this._defaultFigure())}_defaultFigure(){return new(0,this.config.defaultFigure.class)(this,this.config.defaultFigure.styleProperties)}threeFigure(){return this._figureOnLayer(this._threeFigure())}_threeFigure(){return new u(this)}layer(){return this.config.layer}_figureOnLayer(e){return this.layer()?(e.setLayer(this.layer()),e.figures?.().forEach((e=>this._figureOnLayer(e))),e):e}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_geometryStrategy","_bottomLocator","__postOrientationHelper"]}}a(ThunderCloudRailingPost,c),e.exports=ThunderCloudRailingPost},33496:(e,t,r)=>{const n=r(63768),{extend:i}=r(50988),{RailingRun:s}=r(8423),o=r(52613),a=r(30691),l=r(68689),c=r(26933),u=r(24360);class ThunderCloudRailingRun extends s{get config(){return this.strategyProjectConfig().railings.railingRun}defaultAnnotations(){return this.systemStrategy().annotationFactoryFor("RailingRun").makeAnnotationsFor(this)}structure(){if(this.componentOf().showStructures())return this._structure||(this._structure=this._defaultStructure()),this._structure}_defaultStructure(){const e=this.placementStrategy().defaultStructureRepresentation();return e&&e.setComponentOf(this),e}resetStructure(){this._structure=void 0}defaultStructureEdgeOffset(){const e=this._postWidth(),t=this.postProvider().postMountStyle?.(),r=this.postProvider().railingStyle?.(),i=t?.structureEdgeOffsetFromCenter?.(e)??n.unit(0,"in"),s=r?.structureEdgeOffsetFromCenter?.(e,this.unit())??n.unit(0,"in");return n.add(i,s)}structureAlongNormal(){return this.componentOf().structureAlongNormal()}structureDirection(){return this.structureAlongNormal()?1:-1}defaultStructureRepresentationWidth(){return this.config.generatedStructure.width}defaultStructureRepresentationThickness(){return this.config.generatedStructure.thickness}stringerHeightAboveStairNose(){return n.unit(0,"in")}hasStringer(){return!1}showStairLandings(){return!0}extendStringerThroughLastStep(){return!0}_defaultPlacementStrategy(){return new l(this)}components(){return[...super.components(),this.structure()].filter(Boolean)}sections(){return this._sections||(this._sections=this._generateSections(),this._sectionsHaveBeenGenerated()),this._sections}_generateSections(){const e=this.openings().map((e=>e.edge())),t=a.orderEdges(e,this.edge().begin()),r=this._sectionEdges(t).map((e=>this.createSection(e)));if(r)return this.restoreSectionProperties(r)}createOppositeRailing(e=this._defaultCollectionForOppositeRailing()){const t=this.componentOf().structureAlongNormal()?-1:1,r=this.defaultStructureRepresentationWidth().toNumeric(this.unit())*t,n=this.edge().shiftedAlongNormalBy(r).snapshot(),i=e.createRun(n,this.placementStrategy().clone());e.addRun(i),this.saveSectionProperties(),this.restoreSectionProperties(i.sections())}_defaultCollectionForOppositeRailing(){return this.componentOf().collectionForOppositeRailing()}showCreateOppositeRailingProperty(){return this.sloped()}sloped(){return this.isSloped()}onGeometryChanged(){super.onGeometryChanged(),this.resetStructure()}boundingBox({excludeStructure:e=!1}={}){const t=super.boundingBox();if(e)return t;const r=this.structure();return r?t.merge(r.boundingBox()):t}defaultFigure(){return new o(this)}projectedViewFigure(e,t,r){return c.withModel(this,e,t,r)}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_structure","__annotationHelpers"]}}i(ThunderCloudRailingRun,u),e.exports=ThunderCloudRailingRun},10590:(e,t,r)=>{const n=r(63768),{RailingSection:i}=r(8423),{PropertiesCollection:s,EditableProperty:o}=r(7340),{extend:a}=r(50988),l=r(63106),c=r(26933),u=r(26119),d=r(24360),h=r(51486);function p(e){return Object.values(e.strategyProjectConfig().railings.railingStyles)}class ThunderCloudRailingSection extends i{static railingStyleClasses(){}static railingStyleChoices(){if(this.railingStyleClasses())return super.railingStyleChoices();const e=e=>new(0,e.class)(e),t=p(this);return t.length<1?[e(this.strategyProjectConfig().railings.defaults.railingStyle)]:Object.values(t).map(e)}static postMountStyleClasses(){}get config(){return this.strategyProjectConfig().railings.railingSection}get railingsBaseConfig(){return this.strategyProjectConfig().railings.base}collection(){return this.run()?.componentOf()}minLength(){const e=this.railingsBaseConfig.minLength??this.constructor.minLength();return n.max(e,this.placementStrategy().minLength())}minRailLength(){return this.railingsBaseConfig.minRailLength}maxRailLength(){return this.railingsBaseConfig.maxRailLength}_defaultPostMountStyleChoices(){if(this.constructor.postMountStyleClasses())return super._defaultPostMountStyleChoices();const e=p(this);return e.length<1?[this._createFallbackPostMountStyle()]:e.flatMap((e=>{const{classes:t,classInstanceConfigs:r}=e.postMountStyles;return t.flatMap((e=>{const t=r?.[e.name]||[];return t.length<1?new e:t.map((t=>new e(t)))}))}))}_createFallbackPostMountStyle(){const e=this.strategyProjectConfig().railings.defaults;return new(e.railingStyle.postMountStyles.classes.at(0))(e.postMountStyle)}postMountStyleClasses(){return this.constructor.postMountStyleClasses()??this.railingStyle().postMountStyleClasses()}setPostMountStyle(e){super.setPostMountStyle(e),this.componentOf().resetStructure()}postLayoutEdgeInsetHelperClass(){return this.railingStyle()?.postLayoutEdgeInsetHelperClass()||super.postLayoutEdgeInsetHelperClass()}postRunEdge(){const e=this.postLocations();if(e&&!(e.length<2))return e.at(0).to(e.at(-1))}_defaultRails(){return[]}defaultStructureRepresentationWidth(){return this.run().defaultStructureRepresentationWidth()}createOppositeRailing(){this.run().createOppositeRailing()}postWidth(){return this._classForPost().defaultWidth()}sloped(){return this.isSloped()}isFasciaMount(){return this.postMountStyle().isFasciaMount()}_classForPost(e,t){const r=new(this._postContextClass())(this,e,t);let n=this._postClasses().find((e=>e.fitsContext(r)));return n||(clientLog({message:"No suitable post class found",component:this.constructor.name(),action:"_classForPost",context:{postContext:r.toObject()},fingerprint:"NoClassForPost"}),n=this._defaultPostClass()),n}_defaultBlocks(){return this.blockClass()?super._defaultBlocks():[]}blockClass(){return this.railingStyle().blockClass()}pendingRailWidth(){return this.config.pendingRailWidth}defaultAnnotations(){const e=this.systemStrategy().annotationFactoryFor("RailingSection");return e.isConfigured()?e.makeAnnotationsFor(this):[this.sectionLengthAnnotation(),this.stairHeightAnnotation()].filter((e=>e))}sectionLengthAnnotation(e=25,t=this.lengthFormatter()){const r=new(this.systemStrategy().annotationType())(this.edge(),e*this.annotationDirection(),this.unit(),{formatter:t});return r.setLayer(this.sectionLengthAnnotationLayer()),r}sectionLengthAnnotationLayer(){return this.config.sectionLengthAnnotationLayer}stairHeightAnnotation(e=35,t=this.lengthFormatter()){if(!this.isLevel())return new l(this.edge(),e*this.annotationDirection(),this.unit(),t)}annotationDirection(){return this.structureDirection()}structureAlongNormal(){return this.componentOf().structureAlongNormal()}boundingBoxFootprintWidth(){return 16}defaultFigure(){const e=new u(this);return e.setHandles(this.figureHandles()),e}projectedViewFigure(e,t,r){return c.withModel(this,e,t,r)}_selfDisplayProperties(){return new s(this,[this._lengthProperty(),this.postMountStyleProperty(),...this._maxPostSpacingProperties()])}_lengthProperty(){const e=this.config.displayProperties.length,t=e.label,r=e.defaultUnit;return new o(this,"Length",{label:t,defaultUnit:r,type:"unit",restorable:!1,ignoreIntermediateEdits:!0})}_maxPostSpacingProperties(){const e=this.config.displayProperties.maxPostSpacing,t=e.label,r=e.defaultUnit,n="Max Post Spacing";return[new o(this,n,{label:t,defaultUnit:r,type:"unit",restorable:!0,ignoreIntermediateEdits:!0,showOnCollection:!0}),new o(this,`Reset ${n}`,{label:`Reset ${t}`,type:"action",perform:()=>this.resetMaxPostSpacing(),showOnCollection:!0})]}maxPostSpacing(){return this._maxPostSpacing??=this.defaultMaxPostSpacing()}defaultMaxPostSpacing(){return this.railingStyle()?.maxPostSpacing()||super.maxPostSpacing()}setMaxPostSpacing(e){e&&this.maxPostSpacing().equals(e)||(this._maxPostSpacing=e,this.resetComponents())}resetMaxPostSpacing(){this.setMaxPostSpacing(void 0),this.resetDisplayProperties()}showLengthProperty(){return h(this.config.displayProperties.length)}showMaxPostSpacingProperty(){return h(this.config.displayProperties.maxPostSpacing)}showPostMountStyleProperty(){return h(this.config.displayProperties.postMountStyle)}showResetMaxPostSpacingProperty(){return this.showMaxPostSpacingProperty()}hasMaxPostSpacingOverride(){return!this.maxPostSpacing().equals(this.defaultMaxPostSpacing())}hasActualPostSpacingInExcessOfMaximum(){return this.postSpacingLengths().some((e=>n.compare(n.unit(e,this.unit()),this.defaultMaxPostSpacing())>0))}_postContextClass(){return this.config.postContextClass}_postClasses(){return this.railingStyle().postClasses()}_defaultPostClass(){return this._postClasses().first()}}a(ThunderCloudRailingSection,d),e.exports=ThunderCloudRailingSection},58684:(e,t,r)=>{const{EditableProperty:n,PropertiesCollection:i}=r(7340),{extend:s}=r(50988),{RailingStyle:o,RailingLayoutInsetHelper:a}=r(8423),l=r(24360),c=r(51486);class ThunderCloudRailingStyle extends o{constructor(e,t,r){if(void 0===e||"string"==typeof e)super(e,t,r);else{const{styleId:t,label:r,icon:n}=e;super(t,r,n),this._config=e}}get railingsConfig(){return this.strategyProjectConfig().railings}get config(){return this._config??=this._defaultConfig()}_defaultConfig(){const e=this.styleId??"default",t=this.railingsConfig.railingStyles[e]||this.railingsConfig.defaults.railingStyle;return t.maxPostSpacing??=this.railingsConfig.base.maxRailLength,t??this.railingsConfig.defaults.railingStyle}blockClass(){return this.config.railingBlock.blockClass}defaultDisplayProperties(){return new i(this,[new n(this,"Color",{type:"select",choices:this.colorChoices()})])}maxPostSpacing(){return this.config.maxPostSpacing}color(){return this._color??=this.colorChoices().first()}setColor(e){this._color=e}showColorProperty(){return c(this.config.displayProperties.color)}colorChoices(){return Object.values(this.config.displayProperties.color.choices)}postClasses(){return this.config.postClasses}postMountStyleClasses(){return this.config.postMountStyles.classes}postLayoutEdgeInsetHelperClass(){return this._postLayoutEdgeInsetHelperClass??=this._defaultPostLayoutEdgeInsetHelperClass()}cornerPostReuseTolerance(){return this.config.cornerPostReuseTolerance}_defaultPostLayoutEdgeInsetHelperClass(){const{class:e,config:t}=this.config.postLayoutEdgeInsetHelper||{};return e?e.preconfiguredClass(t):a}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_config"]}}s(ThunderCloudRailingStyle,l),e.exports=ThunderCloudRailingStyle},84692:e=>{e.exports=class ThunderCloudRailingTerminationMode{constructor({includesWallMount:e,includesPost:t}={}){this._includesWallMount=e,this._includesPost=t}includesWallMount(){return this._includesWallMount}includesPost(){return this._includesPost}}},63105:(e,t,r)=>{const n=r(63768),{CompositeFigure:i}=r(7340),{Composite3DFigure:s}=r(37732),{Polygon:o}=r(62048),a=r(83102),l=r(96846),c=r(28077),u=r(17588);e.exports=class CityPostBlock extends a{static cableSpacing(){return n.unit(3,"in")}constructor(e,t,r){super(),this._edge=e,this._railEdge=t,this._delegate=r}edge(){return this._edge}railEdge(){return this._railEdge}delegate(){return this._delegate}color(){return this.delegate().railColor()}cableSpacing(){return this.constructor.cableSpacing()}basePlateHeight(){return u.basePlateHeight().toNumeric(this.unit())}railHeightNumeric(){return this.delegate().railingHeight().toNumeric(this.unit())}railWidth(){return this.delegate().railWidth()}rail(){return this._rail||(this._rail=this._createRail()),this._rail}_createRail(){if(!1===this.delegate().hasTopRail?.())return;const e=this.railEdge().addZ(-this._railHeightOffset());return new l(e,this.color(),this.railWidth())}_railHeightOffset(){const e=l.depth().toNumeric(this.unit());return this.railHeightNumeric()+e}cables(){return this._cables||(this._cables=this._defaultCables()),this._cables}_defaultCables(){const e=this.basePlateHeight(),t=this.cableSpacing().toNumeric(this.unit()),r=Math.floor(this.railHeightNumeric()/t)-1,n=this.delegate().cableTerminatesAtBlockBegin(this),i=this.delegate().cableTerminatesAtBlockEnd(this),s=[];for(let o=0;o<r;o++){const r=this.edge().addZ(t*-(o+1)-e),a=[];n&&a.push(r.begin()),i&&a.push(r.end()),s.push(new c(r,a))}return s}geometry(){return new o([this.edge().begin(),this.edge().end()])}defaultFigure(){const e=[this.cables().last().defaultFigure(),this.rail()?.defaultFigure()].filter((e=>e)),t=i.withFigures(e);return t.setModel(this),t}threeFigure(){return s.withModel(this)}components(){return[this.rail(),...this.cables()].filter((e=>e))}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_rail","_cables"]}async load(){return Promise.all(this.components().map((e=>e.load?.())))}}},28077:(e,t,r)=>{const n=r(63768),{three:i,Composite3DFigure:s}=r(37732),{RelativeLocator:o}=r(62048),a=r(16180),l=r(69435),c=r(17588),u=r(57473),d=r(14545);e.exports=class CityPostCable extends l{constructor(e,t=[]){super(e),this._terminatingPoints=t}terminatingPoints(){return this._terminatingPoints}material(){return"steel"}radius(){return n.unit(.1,"in")}steps(){return 32}attachmentHardwareOffset(){return c.defaultWidth().toNumeric(this.unit())/2}attachmentHardwareMaterials(){return["steel"]}crimps(){return this._crimps||(this._crimps=this._defaultCrimps()),this._crimps}_defaultCrimps(){return this.terminatingPoints().map((e=>this._generateModel(e,"citypost-cable-crimp",!0,!0)))}nuts(){return this._nuts||(this._nuts=this._defaultNuts()),this._nuts}_defaultNuts(){return this.terminatingPoints().map((e=>this._generateModel(e,"citypost-cable-nuts",!1,!1)))}_generateModel(e,t,r,n){const s=e.equals(this.edge().begin())!==r,a=n?this.edge().direction():this.edge().xy().direction(),l=s?a.negated():a,c=l.multipliedBy(this.attachmentHardwareOffset()),d=this.attachmentHardwareMaterials(),h=l.xy().theta()+Math.THREE_PI_2,p=(new i.Quaternion).setFromAxisAngle(new i.Vector3(0,0,1),h),m=l.negated().phi()-Math.PI_2,f=(new i.Quaternion).setFromAxisAngle(new i.Vector3(1,0),m),g=n?f.premultiply(p):p,y=o.makeRelativeTo(e.add(c),e);return new u(y,t,g,void 0,d)}materialLineItems(){const e=n.unit(this.length(),this.unit()),t=n.ceil(e.toNumeric("ft")),r=n.unit(t,"ft");return[new a(r,d.Cable)]}threeFigure(){return s.withFigures([...this.components().map((e=>e.threeFigure())),super.threeFigure()])}components(){return[...this.crimps(),...this.nuts()]}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_crimps","_nuts"]}}},43988:(e,t,r)=>{const n=r(63768),i=r(58684);e.exports=class CityPostCableRailingStyle extends i{static supportedRailingHeights(){return[n.unit(36,"in"),n.unit(42,"in")]}static doubleCornerPostTerminalInset(){return n.unit(5,"in")}defaultTerminalPostInset(){return n.unit(3,"in")}doubleCornerPostTerminalInset(){return this.constructor.doubleCornerPostTerminalInset()}}},88e3:(e,t,r)=>{const n=r(63105);e.exports=class CityPostCableWrapBlock extends n{constructor(e,t){super(e,void 0,t)}zLevel(){return super.zLevel()+1}rail(){}components(){return[...this.cables()]}}},27878:(e,t,r)=>{const{EditableProperty:n,CompositeEditableProperty:i,ReadableProperty:s}=r(7340),{RailLengthHelper:o}=r(8423),a=r(97477),l=r(60943),c=r(43988),u=r(19535),d=r(99307),h=r(95208);e.exports=class CityPostCollection extends a{static noTopRailMaterialName="No Top Rail";noTopRailMaterialName(){return this.constructor.noTopRailMaterialName}sectionClass(){return l}runClass(){return d}railLengthMode(){return o.mode.EVEN}defaultDisplayProperties(){const e=(this.sections().first()?.slopedDisplayProperties()||[]).map((e=>e.name())),t=i.overlappingProperties(this.sections()).filter((t=>!e.includes(t.name())));return[new n(this,"Railing Height",{type:"select",choices:this.railingHeightChoices()}),new n(this,"Rail Color",{type:"select",choices:this.railColorOptions(),label:"Color"}),new n(this,"Railing Material",{type:"select",choices:this.railingMaterialOptions(),label:"Material"}),new n(this,"Has Top Rail",{type:"boolean",label:"Top Rail"}),new n(this,"Is IRC Compliant",{type:"boolean",label:"IRC Compliant Handrail"}),new n(this,"Has Double Corner Posts",{type:"boolean",label:"Double Corner Posts"}),...this.hasDoubleCornerPosts()?[new n(this,"Wrap Cable Around Corners",{type:"boolean"})]:[],...t,this.baselineHeightProperty(),new n(this,"Flip Platform",{type:"action",perform:()=>this.toggleStructureSide()}),...this.pricingNotes()]}pricingNotes(){const e=this.sectionsUnderMinimumPricingLength();if(0===e.length)return[];const t=e.first().minimumPricingLength(),r=1===e.length?"section is":"sections are",n=this.pricingNoteLabel(),i=[`${e.length} ${r} shorter than ${t} and will be billed as ${t} long`];return[new s(this,n,{type:"notice",get:()=>i,restorable:!1})]}pricingNoteLabel(){return this.componentOf().pricingNoteLabel()}sectionsUnderMinimumPricingLength(){return this.sections().filter((e=>e.isUnderMinimumPricingLength()))}existingPostAtBegin(e){const t=e.postLocations().first(),r=this.previousSectionFor(e),n=r?.endPost();if(n)return n.geometry().containsPoint(t,.01)?n:void 0}toggleHasTopRail(){this.setHasTopRail(!this.hasTopRail())}hasTopRail(){return void 0===this._hasTopRail&&(this._hasTopRail=!0),this._hasTopRail}setHasTopRail(e){this._hasTopRail=e,this.resetSections()}toggleIsIRCCompliant(){this.setIsIRCCompliant(!this.isIRCCompliant())}isIRCCompliant(){return void 0===this._isIRCCompliant&&(this._isIRCCompliant=!1),this._isIRCCompliant}setIsIRCCompliant(e){this._isIRCCompliant=e,this.resetSections()}toggleHasDoubleCornerPosts(){this.setHasDoubleCornerPosts(!this.hasDoubleCornerPosts())}hasDoubleCornerPosts(){return this._hasDoubleCornerPosts||(this._hasDoubleCornerPosts=!1),this._hasDoubleCornerPosts}setHasDoubleCornerPosts(e){this._hasDoubleCornerPosts=e,this.resetSections(),this.resetDisplayProperties()}toggleWrapCableAroundCorners(){this.setWrapCableAroundCorners(!this.wrapCableAroundCorners())}wrapCableAroundCorners(){return this._wrapCableAroundCorners||(this._wrapCableAroundCorners=!1),this._wrapCableAroundCorners}setWrapCableAroundCorners(e){this._wrapCableAroundCorners=e,this.sections().forEach((t=>{if(t.sloped())return;const r=e?l.wrapModes.WRAP:l.wrapModes.TERMINATE;t.setCableWrapMode(r)})),this.resetSections()}railingHeight(){return this._railingHeight||(this._railingHeight=this.railingStyle().supportedRailingHeights().first()),this._railingHeight}setRailingHeight(e){this._railingHeight=e,this.resetSections()}railingHeightChoices(){return this.railingStyle().supportedRailingHeights().map((e=>({label:`${Math.round(e.toNumeric("in"))}"`,value:e})))}railColor(){return this._railColor||(this._railColor=this.railColorOptions().first().value),this._railColor}setRailColor(e){this._railColor=e,this.resetSections()}railColorOptions(){return[u.black,u.bronze,u.grey,u.white]}railingMaterial(){return this._railingMaterial||=this.railingMaterialOptions().first().value,this._railingMaterial}setRailingMaterial(e){this._railingMaterial=e,this.resetSections()}railingMaterialOptions(){return[{label:"Zinc Plated Steel",value:"Zinc"},{label:"Powder Coated Stainless Steel",value:"Stainless Steel"}]}railingStyle(){return this._railingStyle||(this._railingStyle=new c("cable","Cable","cable-rail")),this._railingStyle}formatBaselineHeight(){return h(this.baselineHeight().toNumeric("in"),8,!0)}}},19535:(e,t,r)=>{const n=r(43320);e.exports=Object.freeze({black:new n("Black","metallic-black-low-gloss","#3c3d3e","#0d0d0d"),bronze:new n("Bronze","metallic-bronze-low-gloss","#755334","#242424"),grey:new n("Grey","metallic-grey-low-gloss","#99a0a1","#242424"),white:new n("White","metallic-white-low-gloss","#f7f9eF","#242424")})},16180:(e,t,r)=>{const n=r(67287),i=r(6556);e.exports=class CityPostMaterialPricingLineItem extends i{dollarBreakdownItemFor(e,t){return 0===t?n.forValue(e,"—"):super.dollarBreakdownItemFor(e,t)}}},11685:(e,t,r)=>{const n=r(37208),i=r(43812);e.exports=class CityPostProject extends i{pricingNoteStrings(){const e=this.railingCollections().flatMap((e=>e.sectionsUnderMinimumPricingLength()));if(0===e.length)return[];const t=1===e.length?"section is":"sections are",r=e.first().minimumPricingLength();return[`${e.length} ${t} shorter than ${r} and will be billed as ${r} long`]}sections(){return this.railingCollections().flatMap((e=>e.sections()))}postCounts(){const e=this.sections().flatMap((e=>e.railingPosts()));return this.countItems(e,(e=>e.postKey()),(e=>({description:e.postDescription()}))).sort(((e,t)=>parseInt(e.key.slice(1))-parseInt(t.key.slice(1))))}sleeveCounts(){const e=this.sections().flatMap((e=>e.railingPosts()));return this.countItems(e,(e=>e.sleeveKey()),(e=>({description:e.sleeveDescription()}))).sort(((e,t)=>parseInt(e.key.slice(1))-parseInt(t.key.slice(1))))}countItems(e,t,r){return e.reduce(((e,n)=>{if(!t(n))return e;const i=e.find((e=>t(e.item)===t(n)));return i?i.quantity+=1:e.push({item:n,key:t(n),quantity:1,...r(n)}),e}),[])}logo(){return"city-post-logo.png"}pdfDocumentClass(){return n}externalPersistenceJSON(e,t){return`{\n      "line_items": [${this.railingCollections().flatMap((e=>e.sections())).flatMap(((t,r)=>{const n=r+1;return t.externalPersistenceJSON(n,e)}))}]\n    }`}}},96846:(e,t,r)=>{const n=r(63768),{Rectangle:i}=r(62048),{extend:s}=r(50988),o=r(2198),a=r(88646),l=r(56214),c=r(16180),u=r(59663),d=r(28219),h=r(14545);class CityPostRail extends o{static depth(){return n.unit(1,"in")}constructor(e,t,r=n.unit(3,"in")){super(e),this._color=t,this._width=r}width(){return this._width}depth(){return this.constructor.depth()}color(){return this._color}crossSection(){const e=this.width().toNumeric(this.unit())/2,t=this.depth().toNumeric(this.unit());return new a([new l(new i(-e,0,2*e,t))])}materialSpecifier(){return h[`${this.color().label} Rail`]}materialLineItems(){return[new c(1,this.materialSpecifier())]}materialName(){return this.color().materialName()}defaultFigure(){return new u(this,{lineWidth:.1})}}s(CityPostRail,d),e.exports=CityPostRail},99307:(e,t,r)=>{const n=r(33496);e.exports=class CityPostRailingRun extends n{endpointMovedTo(e,t,r={}){const n=super.endpointMovedTo(e,t,r);return this.componentOf().resetSections(),n}}},60943:(e,t,r)=>{const n=r(63768),{EditableProperty:i,ReadableProperty:s}=r(7340),{RailLengthHelper:o,StairRailLengthHelper:a}=r(8423),l=r(10590),c=r(63105),u=r(88e3),d=r(16180),h=r(26039),p=r(17588),m=r(80725),f=r(74079),g=r(85727),y=r(60255),b=r(28288),v=r(84585),_=r(20485),x=r(9343),w=r(30691),R=r(87177),k=r(96846),j=r(31224),z=r(14545),q={AUTO:"AUTO",WRAP:"WRAP",TERMINATE:"TERMINATE"},$={SURFACE:f,FASCIA:g};e.exports=class CityPostSection extends l{static postMountStyleClasses(){return Object.values(this.postMountStyles)}static wrapModes=q;static postMountStyles=$;static minLength(){return n.unit(1,"ft")}defaultDisplayProperties(){return[new i(this,"Fascia Mounted",{type:"boolean",label:"Fascia Mount"}),new i(this,"Mounting Surface Type",{type:"select",label:"Mounting Surface",choices:this.mountingSurfaceTypeChoices()}),...this.sloped()?this.slopedDisplayProperties():[],...this.pricingNotes()]}slopedDisplayProperties(){return[new i(this,"Cable Wrap Mode",{type:"select",choices:this.cableWrapModeChoices()}),new i(this.run(),"Create Opposite Railing",{type:"action",perform:()=>this.createOppositeRailing()}),new i(this,"Flip Slope",{type:"action",perform:()=>this.flipSlope(),restorable:!1})]}pricingNotes(){if(!this.isUnderMinimumPricingLength())return[];const e=this.minimumPricingLength(),t=this.postProvider().pricingNoteLabel(),r=[`This section will be billed as ${e} long`];return[new s(this,t,{type:"notice",get:()=>r,restorable:!1})]}railingStyle(){return this.postProvider().railingStyle()}startObservingPostMountStyle(){}stopObservingPostMountStyle(){}railColor(){return this.postProvider().railColor()}railingHeight(){return this.postProvider().railingHeight()}railWidth(){return this.isIRCCompliant()&&this.sloped()?n.unit(2,"in"):n.unit(3,"in")}pendingRailWidth(){return this.railWidth()}minRailLength(){return this.minLength()}maxRailLength(){return n.unit(6,"ft")}maxPostSpacing(){return this.maxRailLength()}cableLength(){return n.unit(this.edge().length(),this.unit())}totalCableLength(){const e=this.cableLength(),t=this.cableLengthBefore(),r=this.cableLengthAfter();return n.add(e,t,r)}cableLengthBefore(e=this){const t=this.sectionConnectedToBegin();return this._doesSectionTerminateCable(e,t)?n.unit(0,"in"):n.add(t.cableLengthBefore(e),t.cableLength())}cableLengthAfter(e=this){const t=this.sectionConnectedToEnd();return this._doesSectionTerminateCable(e,t)?n.unit(0,"in"):n.add(t.cableLengthAfter(e),t.cableLength())}_doesSectionTerminateCable(e,t=e){if(e===t)return!0;const r=this.edge().isParallelTo(t.edge()),n=e.sloped(),i=t.sloped(),s=e.cableWrapMode()===q.TERMINATE,o=t.cableWrapMode()===q.TERMINATE;return!this.connectionAngleIsOblique(t)&&(r?n?s:!!i&&o:o)}stairDoublePostCableLengthThreshold(){return n.unit(20,"ft")}connectionAngleIsOblique(e){return!!e&&(!this._isParallelToSection(e)&&!this.isPerpendicularToSection(e))}useDoubleStairPosts(e){return!!this.connectionAngleIsOblique(e)||!!this.sloped()&&(!!this._isSlopeToSlopeCornerWith(e)||(this.cableWrapMode()===q.TERMINATE||this.cableWrapMode()!==q.WRAP&&(e&&n.larger(e.totalCableLength(),this.stairDoublePostCableLengthThreshold()))))}_isSlopeToSlopeCornerWith(e){return this.sloped()&&e?.sloped()&&!this._isParallelToSection(e)}isSlopeToSlopeCornerAtBegin(){return this._isSlopeToSlopeCornerWith(this.sectionConnectedToBegin())}isSlopeToSlopeCornerAtEnd(){return this._isSlopeToSlopeCornerWith(this.sectionConnectedToEnd())}isIRCCompliant(){return this.postProvider().isIRCCompliant()}hasTopRail(){return this.postProvider().hasTopRail()}postSpacingHelper(){const e=this.minPostSpacing(),t=n.subtract(this.maxPostSpacing(),this._postSpacingReduction());let r;return r=this.sloped()?new a(e,t,this.componentOf().placementStrategy(),this.unit()):new o(e,t,this.unit()),r.setMode(this.postProvider().railLengthMode?.()),r}_postSpacingReduction(){const e=this._postLayoutEdgeInsetForLocator(this.edge().begin()),t=this._postLayoutEdgeInsetForLocator(this.edge().end());return this.edge().length()<=this.maxPostSpacing().toNumeric(this.unit())+e+t?n.unit(e+t,this.unit()):n.unit(Math.max(e,t),this.unit())}_createPostLocation(e,t,r,n){const i=super._createPostLocation(e,t,r,n);if(r<n||!this.isSlopeToSlopeCornerAtEnd())return i;return e.end().xy().addZ(i.z()).relatedTo(i)}postWidth(){return p.defaultWidth()}postLayoutEdge(){const e=this.componentLayoutEdge(),t=this._postLayoutEdgeInsetForLocator(this.edge().begin()),r=this._postLayoutEdgeInsetForLocator(this.edge().end());return w.stretchedEdgeBy(e,-t,-r).relativeToEdge(this.edge())}postLayoutEdgeInset(){return this.railingStyle().terminalPostInset().toNumeric(this.unit())}doubleCornerPostTerminalInset(){return this.railingStyle().doubleCornerPostTerminalInset().toNumeric(this.unit())}_sectionConnectedToLocator(e){return e.equals(this.edge().begin())?this.sectionConnectedToBegin():e.equals(this.edge().end())?this.sectionConnectedToEnd():void 0}_postLayoutEdgeInsetForSlopedConnectedSection(e){if(!e.useDoubleStairPosts(this))return 0;const t=this.doubleCornerPostTerminalInset();if(!this._isSlopeToSlopeCornerWith(e))return t;return(this.run().lowestZ()<e.run().lowestZ()?1:0)*t}_needDoubleTerminatingBeginPostAtLocator(e){return e.equals(this.edge().begin())&&this.postProvider().hasDoubleCornerPosts()&&!this.postProvider().wrapCableAroundCorners()}_isParallelToSection(e){return e.edge().isParallelTo(this.edge())}_postLayoutEdgeInsetForLocator(e){const t=this._sectionConnectedToLocator(e);return t||this.sloped()?t?.sloped()?this._postLayoutEdgeInsetForSlopedConnectedSection(t):this._needDoubleTerminatingBeginPostAtLocator(e)||this.sloped()||this.isParallelToSectionIn3D(t)?0:this.postProvider().hasDoubleCornerPosts()&&!this.connectionAngleIsOblique(t)?this.doubleCornerPostTerminalInset():0:this.postLayoutEdgeInset()}_isNextSectionPerpendicularSlope(){const e=this.sectionConnectedToEnd();return!!e&&(e.sloped()&&this.isPerpendicularToSection(e))}_isPreviousSectionPerpendicularSlope(){const e=this.sectionConnectedToBegin();return!!e&&(e.sloped()&&this.isPerpendicularToSection(e))}_isSectionFasciaMounted(e){return!!e&&e.fasciaMounted()}_defaultBlocks(){const e=this.blockEdges();return e.map(((t,r)=>{const n=this._generateBlockRailEdge(t,r,e.length-1),i=new c(t,n,this);return i.setComponentOf(this),i}))}_railBegin(e,t){if(this._beginIsLevelToSlopeRightAngleCornerTransition()){const t=this.edge().xy().direction();return e.add(t.multipliedBy(this.railOffsetForLevelToSlopeRightAngleCorner()))}if(!t||this._beginIsLevelToSlopeTransition())return e;let r=e;if(!this.isSlopeToSlopeCornerAtBegin()&&(r.equals(this.componentLayoutEdge().begin())||(r=this.componentLayoutEdge().begin()),this._isPreviousSectionPerpendicularSlope()))return r.subtract(this._railExtensionOffset());const n=this.edge().direction().multipliedBy(this._slopedExtensionOffset()-this._railDepthShift());return this.sloped()?r.subtract(n):r}_railEnd(e,t){if(!t){const t=this.edge().xy().direction();return e.add(t.multipliedBy(this.railOffsetForLevelToSlopeRightAngleCorner()))}if(this._endIsSlopeToLevelTransition())return e;let r=e;if(!this.isSlopeToSlopeCornerAtEnd()&&(r.equals(this.componentLayoutEdge().end())||(r=this.componentLayoutEdge().end()),this._isNextSectionPerpendicularSlope()))return r.add(this._railExtensionOffset());const n=this.edge().direction().multipliedBy(this._slopedExtensionOffset()+this._railDepthShift());return this.sloped()?r.add(n):r}_railExtensionOffset(){return this.edge().direction().multipliedBy(n.unit(2,"in").toNumeric(this.unit()))}_slopedExtensionOffset(){return n.unit(1,"in").toNumeric(this.unit())+this.postWidth().toNumeric(this.unit())/2/n.cos(this.slope())}_railDepthShift(){const e=this.edge().begin().z()>this.edge().end().z()?-1:1;return k.depth().toNumeric(this.unit())*n.tan(this.slope())*e}_generateBlockRailEdge(e,t,r){const[n,i]=e.endpoints(),s=0===t,o=t===r,a=this._railBegin(n,s),l=this._railEnd(i,o),c=-p.basePlateHeight().toNumeric(this.unit());return a.to(l).addZ(c).relativeToEdge(e)}_beginIsLevelToSlopeTransition(){const e=this.sectionConnectedToBegin();return!!e&&(!e.sloped()&&this.sloped())}_endIsSlopeToLevelTransition(){const e=this.sectionConnectedToEnd();return!!e&&(!e.sloped()&&this.sloped())}_beginIsLevelToSlopeRightAngleCornerTransition(){const e=this.sectionConnectedToBegin();return!(!e||!this.isPerpendicularToSection(e))&&this._beginIsLevelToSlopeTransition()}railOffsetForLevelToSlopeRightAngleCorner(){const e=this.sectionConnectedToBegin();return e&&this._beginIsLevelToSlopeRightAngleCornerTransition()?e.railWidth().toNumeric(this.unit())/2:0}cableWrapBlock(){return this._cableWrapBlock||(this._cableWrapBlock=this._defaultCableWrapBlock()),this._cableWrapBlock}_defaultCableWrapBlock(){const e=this.sectionConnectedToEnd();if(!e)return;if(e.sloped())return;if(!this.postProvider().hasDoubleCornerPosts())return;if(this.cableWrapMode()!==q.WRAP)return;const t=new u(this._cableWrapEdge(),this);return t.setComponentOf(this),t}_cableWrapEdge(){const e=this.endPost().surfaceLocator(),t=this.sectionConnectedToEnd().beginPost().surfaceLocator(),r=this.endPost().width().toNumeric(this.unit())/2,n=this.edge().direction(),i=this.sectionConnectedToEnd().edge().direction().negated(),s=e.add(n.multipliedBy(r)),o=t.add(i.multipliedBy(r));return s.to(o).relativeToEdge(this.edge())}cableTerminatesAtBlockBegin(e){const t=this.sectionConnectedToBegin();return e===this.beginBlock()&&(!t||!!this.isPerpendicularToSection(t)&&(!this.postProvider().hasDoubleCornerPosts()||this.cableWrapMode()===q.TERMINATE))}cableTerminatesAtBlockEnd(e){const t=this.sectionConnectedToEnd();return e===this.endBlock()&&(!t||!!this.isPerpendicularToSection(t)&&(!this.postProvider().hasDoubleCornerPosts()||this.cableWrapMode()===q.TERMINATE))}beginBlock(){return this.blocks().first()}endBlock(){return this.blocks().last()}postBeforeBlock(e){const t=this.blocks().findIndex((t=>t===e));if(-1!==t)return this._findPostByIndex(t)}postAfterBlock(e){const t=this.blocks().findIndex((t=>t===e));if(-1!==t)return this._findPostByIndex(t+1)}_findPostByIndex(e){const t=this.beginPost(),r=this.endPost(),n=this.railingPosts(),i=n.includes(t)?n:[t,...n];return i.includes(r)||i.push(r),i[e]}shouldHavePostAtBegin(){const e=this.sectionConnectedToBegin();return(e?.sloped()||this.sloped())&&this.useDoubleStairPosts(e)||super.shouldHavePostAtBegin()}makePost(e,t,r){const n=new(this._classForPost(t,r))(e);return n.setComponentOf(this),n}_postClasses(){return[_,y,h,v,m,b,p]}requiresDoubleCornerPosts(){return this.postProvider().hasDoubleCornerPosts()}_classForPost(e,t){const r=new R(this,e,t);let n=this._postClasses().find((e=>e.fitsContext(r)));return n||(clientLog({message:"No suitable post class found",component:"CityPostSection",action:"_classForPost",context:{postContext:r.toObject()},fingerprint:"NoClassForPost"}),n=p),n}fasciaMounted(){return this.postMountStyle().constructor===$.FASCIA}setFasciaMounted(e){if(!1===e&&!1===this.fasciaMounted())return;const t=new(e?$.FASCIA:$.SURFACE);this.setPostMountStyle(t)}toggleFasciaMounted(){this.setFasciaMounted(!this.fasciaMounted())}mountingSurfaceType(){return this._mountingSurfaceType||(this._mountingSurfaceType=this.mountingSurfaceTypeChoices().last().value),this._mountingSurfaceType}setMountingSurfaceType(e){this._mountingSurfaceType=e}mountingSurfaceTypeChoices(){return[{label:"Concrete",value:"Concrete"},{label:"Wood",value:"Wood"}]}cableWrapMode(){return this._cableWrapMode||(this._cableWrapMode=this._defaultCableWrapMode()),this._cableWrapMode}_defaultCableWrapMode(){return this.sloped()?q.AUTO:this.postProvider().wrapCableAroundCorners()?q.WRAP:q.TERMINATE}setCableWrapMode(e){this._cableWrapMode=e,this.resetConnectedComponents()}cableWrapModeChoices(){return[{label:"Auto-select",value:q.AUTO},{label:"Wrap",value:q.WRAP},{label:"Terminate",value:q.TERMINATE}]}pricingLength(){const e=n.ceil(this.length().toNumeric("ft")),t=n.unit(e,"ft"),r=this.minimumPricingLength();return n.smaller(t,r)?r:n.unit(e,"ft")}minimumPricingLength(){return n.unit(4,"ft")}isUnderMinimumPricingLength(){return n.smaller(this.length(),this.minimumPricingLength())}_postDistanceAnnotations(e=25){const t=this.blockEdges(),r=this.systemStrategy().annotationType();return t.map((t=>{const n=new r(t,e*this.annotationDirection(),this.unit(),{fractionDenominator:8});return n.setLayer(j.POST_ANNOTATIONS),n}))}get _priceContributingMaterialIdentifiers(){const e={base:this._railHeightMaterialIdentifier(),material:this.postProvider().railingMaterial()};return this.hasTopRail()||(e.topRail=this.postProvider().noTopRailMaterialName()),e}selfMaterialLineItems(){const e=this.pricingLength();return Object.values(this._priceContributingMaterialIdentifiers).map((t=>new d(e,z[t])))}_railHeightMaterialIdentifier(){return`${this.railingHeight().toNumeric("in").rounded()}" Tall ${this.sloped()?"Stair ":""}Railing`}components(){return[...this.railingPosts(),...this.blocks(),this.cableWrapBlock()].filter((e=>e))}resetComponents(){super.resetComponents(),this._blocks=void 0,this._cableWrapBlock=void 0}defaultAnnotations(){return[this.sectionLengthAnnotation(50),this.stairHeightAnnotation(),...this._defaultPostLabelAnnotations(),...this._defaultSleeveLabelAnnotations(),...this._postDistanceAnnotations()].filter((e=>e))}sectionLengthAnnotation(e=25){const t=super.sectionLengthAnnotation(e);return t.setLayer(j.LENGTH_ANNOTATIONS),t}stairHeightAnnotation(...e){const t=super.stairHeightAnnotation(...e);return t?.setLayer(j.STAIR_ANNOTATIONS),t}_defaultPostLabelAnnotations(){return this.railingPosts().map((e=>{const t=e.locator(),r=(e.bisectingVector()??this.edge().normal()).multipliedBy(-25),n=t.add(r).relatedTo(t),i=new x(e.postKey(),n,t);return i.setLayer(j.POST_LABELS),i}))}_defaultSleeveLabelAnnotations(){return this.railingPosts().map((e=>{if(!e.canPlaceRailSleeves())return;const t=e.locator(),r=(e.bisectingVector()??this.edge().normal()).multipliedBy(25),n=t.add(r).relatedTo(t),i=new x(e.sleeveKey(),n,t);return i.setLayer(j.SLEEVE_LABELS),i})).filter((e=>e))}turnDegrees(){const e=this.angleAtEnd();if(!e)return;const t=e.normalizedAngle().radiansToDegrees().roundedTo(2);if(t%90==0)return 90;const r=90*Math.floor(t/90);return r?90-t%r:t}_railingMaterial(){return this.postProvider().railingMaterial()}externalPersistenceJSON(e,t){const r=this.sloped()?" (stairs)":"",n=this.pricingLength(),i=this._pricePerFoot("base",t),s=this._pricePerFoot("material",t),o=this._pricePerFoot("topRail",t),a=i+s+o,l="CityPost Deck Railing Segment - Selections",c=n.toNumeric("ft").roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES),u=`Segment ${e}${r}`,d=this._railingMaterial().toUpperCase(),h=this.sloped()?"STAIRS":"HORIZONTAL",p=this.railingHeight().toNumeric("in"),m=this.fasciaMounted()?"FASCIA":"BASE",f=this.postProvider().railColor().label.toUpperCase(),g=this.mountingSurfaceType().toUpperCase(),y=this.hasTopRail()?"INCLUDE":"DO NOT INCLUDE",b=this._beginSleeveType(),v=this._endSleeveType(),_=this._startPostType(),x=this._finishPostType(),w=this._makeSegmentJSONProperty;return`{\n      "title": "${l}",\n      "name": "${l}",\n      "quantity": ${c},\n      "properties": [\n        ${w("SEGMENT LENGTH IN FEET (ROUNDED UP)",c)},\n        ${w("DESCRIBE SEGMENT LOCATION",u)},\n        ${w("MATERIAL",d,s)},\n        ${w("SEGMENT ORIENTATION",h)},\n        ${w("SEGMENT HEIGHT",p,i)},\n        ${w("MOUNTING TYPE",m)},\n        ${w("COLOR",f)},\n        ${w("MOUNTING SURFACE",g)},\n        ${w("TOP RAIL",y,o)},\n        ${w("STARTING SLEEVE",b)},\n        ${w("ENDING SLEEVE",v)},\n        ${w("POST AT START",_)},\n        ${w("POST AT END",x)}\n      ],\n      "custom": true,\n      "price": "${a}"\n    }`}_pricePerFoot(e,t){const r=this.systemStrategy().retailPricing(t),n=this._priceContributingMaterialIdentifiers[e];return r[n]?.price||0}_makeSegmentJSONProperty(e,t,r){return`{\n      "name": "${e}",\n      "value": "${r?`${t} ($${r}/ft) | $${r}`:`${t}`}"\n    }`}_beginSleeveType(){return this.sectionConnectedToBegin()?"NONE (Continued from Previous Segment)":this._terminalSleeveType()}_endSleeveType(){const e=this.sectionConnectedToEnd();if(!e)return this._terminalSleeveType();const t=this._externalPersistenceTurnDegrees();return e.sloped()||this.sloped()?this._slopeTransitionEndSleeveType(t):this._levelEndSleeveType(t)}_levelEndSleeveType(e){return e||"STRAIGHT"}_slopeTransitionEndSleeveType(e){return e?`DECK-TO-STAIR ${e}`:"DECK-TO-STAIR"}_terminalSleeveType(){return"END CAP"}_externalPersistenceTurnDegrees(){if(!this.turnDegrees())return;const e=this.turnDegrees().roundedTo(2);return this.systemStrategy().standardSnapAnglesDegrees().includes(e)?`${e}°`:`${e}° (custom)`}_startPostType(){return!this.shouldHavePostAtBegin()?"NONE (Continued from Previous Segment)":this.beginPost().type()}_finishPostType(){return this.endPost().type()}}},17588:(e,t,r)=>{const n=r(63768),{PolarCoordinate:i,RelativeLocator:s,Polygon:o}=r(62048),{Composite3DFigure:a,three:l}=r(37732),{$P:c}=r(62048),u=r(16180),d=r(96846),h=r(80371),p=r(57473),m=r(14545);e.exports=class CityPostPost extends h{static fitsContext(e){return!e.isSlopedPosition()&&e.isLinePosition()}static defaultWidth(){return n.unit(2,"in")}static basePlateHeight(){return n.unit(.17,"in")}static basePlateWidth(){return n.unit(5,"in")}descriptor(){return this.postProvider().postDescriptor()}topLocator(){const e=this.basePlateHeight().toNumeric(this.unit()),t=-(this.height().toNumeric(this.unit())+e),r=this.locator().addZ(t);return s.makeRelativeTo(r,this.locator())}modelRotation(){const e=this.postProvider().structureAlongNormal()?1:-1,t=this.locator().edge().normalizedAngle()+Math.PI_2*e;return(new l.Quaternion).setFromAxisAngle(new l.Vector3(0,0,1),t)}color(){return this.postProvider().railColor()}mountStyle(){return this.componentOf().postMountStyle()}surfaceLocator(){return this.locator()}bottomLocator(){const e=this.heightBelowSurface().toNumeric(this.unit()),t=this.locator().addZ(e);return s.makeRelativeTo(t,this.locator())}materialNames(){return[this.color().materialName()]}basePlateHeight(){return this.constructor.basePlateHeight()}type(){return"STANDARD LINE POST"}defaultGeometry(){const e=this.bottomLocator(),t=this.locator().edge().direction(),r=new i(1,t.theta()+Math.PI_2),n=this.width().toNumber(this.unit())/2,a=t.multipliedBy(n),l=r.multipliedBy(n),c=[e.add(a).add(l),e.add(a.negated()).add(l),e.add(a.negated()).add(l.negated()),e.add(a).add(l.negated())].map((t=>s.makeRelativeTo(t,e)));return new o(c)}_modelHeightString(){return this.height().toNumeric("in").rounded()}modelIdentifier(){const e=this.fasciaMounted()?"-fascia":"";return`citypost-post-${this._modelHeightString()}${e}`}model(){return this._model||(this._model=this._defaultModel()),this._model}_defaultModel(){const e=this.locator(),t=this.modelIdentifier(),r=this.materialNames(),n=this.modelRotation();return new p(e,t,n,void 0,r)}railSleeves(){return this._railSleeves||(this._railSleeves=this._defaultRailSleeves()),this._railSleeves}_defaultRailSleeves(){if(!this.canPlaceRailSleeves()||!this.postProvider().hasTopRail())return[];const e=this.sleeveLocators(),t=this.sleeveRotations(),r=this.materialNames(),n=this.sleeveModelFile();return this.sleeveModelIdentifiers().map(((i,s)=>{const o=e[s],a=t[s];return new p(o,`${n}->${i}`,a,void 0,r)}))}canPlaceRailSleeves(){const e=!(!this.nextSection()||!this.previousSection()),t=!this.nextSection()&&!this.previousSection();return e||t}sleeveModelIdentifiers(){return["straight-3in"]}sleeveModelFile(){return"citypost-straight-sleeves"}sleeveOffsetZ(){return-d.depth().toNumeric(this.unit())}sleeveLocators(){const e=this.sleeveOffsetVector();return this.sleeveModelIdentifiers().map((()=>{const t=this.topLocator().add(e);return s.makeRelativeTo(t,this.topLocator())}))}sleeveOffsetVector(){return c(0,0,this.sleeveOffsetZ())}_railOffset(){const e=this.isEndPost()?this.componentOf().sectionConnectedToEnd():this.componentOf();return e?e.railOffsetForLevelToSlopeRightAngleCorner():0}_angleBetweenConnectedSections(){return this.previousSection().angleAtEnd().radiansToDegrees().roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES)}_smallestAngleBetweenConnectedSections(){const e=this._angleBetweenConnectedSections();return Math.min(e,360-e)}sleeveRotations(){const e=this._rotationForDirection(this._previousSectionDirection()),t=this._rotationForDirection(this._nextSectionDirection());return this.sleeveModelIdentifiers().length>1?[e,t]:this._alignSleeveToNextSection()?[t]:[e]}_previousSectionDirection(){if(!this.previousSection()&&!this.componentOf())return;return(this.previousSection()?this.previousSection().edge():this.componentOf().edge()).direction().negated()}_nextSectionDirection(){if(this.nextSection())return this.nextSection().edge().direction()}bisectingVector(){const e=this.nextSection()?.edge().normal(),t=(this.previousSection()??this.componentOf())?.edge().normal();return e&&t?e.add(t).normalized():[e,t].find((e=>e))}_rotationForDirection(e){if(!e)return;const t=e.xy().theta()+Math.THREE_PI_2,r=(new l.Quaternion).setFromAxisAngle(new l.Vector3(0,0,1),t),n=e.negated().phi()-Math.PI_2;return(new l.Quaternion).setFromAxisAngle(new l.Vector3(1,0),n).premultiply(r)}_alignSleeveToNextSection(){return!!this.nextSection()&&this._angleBetweenConnectedSections()===this._smallestAngleBetweenConnectedSections()}fasciaMounted(){return this.componentOf().fasciaMounted()}get postOptions(){const e=`${this.color().label} ${this.height().toNumeric("in")}"`;return this.fasciaMounted()?`${e} Fascia`:e}postKey(){return this.materialSpecifier().details().identifier}postDescription(){return this.materialSpecifier().description()}sleeveKey(){if(this.canPlaceRailSleeves())return this.sleeveSpecifier().details().identifier}sleeveDescription(){if(this.canPlaceRailSleeves())return this.sleeveSpecifier().description()}materialSpecifier(){return m[`${this.postOptions} Post`]}sleeveSpecifier(){return m[`${this.color().label}-${this.sleeveModelIdentifiers().first()}-sleeve`]}selfMaterialLineItems(){return[new u(1,this.materialSpecifier()),...this.canPlaceRailSleeves()?[new u(1,this.sleeveSpecifier())]:[]]}components(){return[this.model(),...this.railSleeves()]}threeFigure(){return a.withModel(this)}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_model","_railSleeves"]}}},87177:(e,t,r)=>{const n=r(68289);e.exports=class CityPostPostContext extends n{doubleCornerPosts(){if(this.section().requiresDoubleCornerPosts())return!0;const e=this.connectedSection();return!!e&&(this.isSlopedPosition()?this.section().useDoubleStairPosts(e):e.useDoubleStairPosts(this.section()))}}},84585:(e,t,r)=>{const n=r(17588),i=r(14545);e.exports=class CityPostSingleCornerPost extends n{static fitsContext(e){return!e.isSlopedPosition()&&(!e.isInteriorPosition()&&(!!e.connectedSection()&&(!e.isSlopeTransition()&&e.sectionsAreOblique())))}sleeveModelIdentifiers(){const e=this._smallestAngleBetweenConnectedSections();return[`corner-${this._standardSleeveAngles().reduce(((t,r)=>Math.abs(r-e)<Math.abs(t-e)?r:t)).toString().replace(".","_")}`]}sleeveModelFile(){return"citypost-corner-sleeves"}canPlaceRailSleeves(){return!(!this.nextSection()||!this.previousSection())}_standardSleeveAngles(){return this.__standardSleeveAngles||(this.__standardSleeveAngles=this._defaultstandardSleeveAngles()),this.__standardSleeveAngles}_defaultstandardSleeveAngles(){return this.systemStrategy().standardSnapAnglesDegrees().filter((e=>0!==e&&180!==e))}sleeveSpecifier(){return this._standardSleeveAngles().includes(this._smallestAngleBetweenConnectedSections())?super.sleeveSpecifier():i[`${this.color().label}-custom-sleeve`]}nonEssentialProperties(){return[...super.nonEssentialProperties(),"__standardSleeveAngles"]}}},20485:(e,t,r)=>{const n=r(60255);e.exports=class CityPostSingleLevelToStairTerminalCornerPost extends n{static fitsContext(e){return!!e.isLastPosition()&&(!!e.isSlopeTransition()&&(!e.doubleCornerPosts()&&e.sectionsArePerpendicular()))}type(){return"HORIZONTAL TO STAIR CORNER POST"}}},80725:(e,t,r)=>{const n=r(84585),i=r(14545);e.exports=class CityPostSingleTerminalCornerPost extends n{static fitsContext(e){return!e.isSlopedPosition()&&(!e.isInteriorPosition()&&(!!e.connectedSection()&&(!e.isSlopeTransition()&&(!e.doubleCornerPosts()&&!e.sectionsAreParallelIn3D()))))}modelIdentifier(){return this.componentOf().fasciaMounted()?`citypost-post-${this._modelHeightString()}-fascia`:`citypost-single-corner-post-${this._modelHeightString()}`}materialSpecifier(){return i[`${this.postOptions} Corner Post`]}type(){return"SINGLE CORNER POST"}}},26039:(e,t,r)=>{const{$P:n}=r(62048),i=r(17588),s=r(14545);e.exports=class CityPostStairPost extends i{static fitsContext(e){return!e.isLevelPosition()&&e.isLinePosition()}modelIdentifier(){const e=this.componentOf().fasciaMounted()?"-fascia":"";return`citypost-stair-post-${this._modelHeightString()}${e}`}sleeveModelFile(){return"citypost-straight-sleeves"}sleeveModelIdentifiers(){return this.postProvider().isIRCCompliant()?["straight-2in"]:["straight-3in"]}canPlaceRailSleeves(){return!this.nextSection()&&!this.previousSection()}sleeveOffsetVector(){const e=this.sleeveOffsetZ(),t=Math.PI_2-this.componentOf().edge().phi(),r=-this._railOffset()*Math.tan(t);return n(0,0,e+r)}materialSpecifier(){return s[`${this.postOptions} Stair Post`]}type(){return"STANDARD STAIR POST"}}},60255:(e,t,r)=>{const{RelativeLocator:n}=r(62048),{$P:i}=r(62048),s=r(26039),o=r(14545);e.exports=class CityPostStairTerminalPost extends s{static fitsContext(e){return!e.isLevelPosition()&&(!e.isInteriorPosition()&&(!e.connectedSection()||(!!e.doubleCornerPosts()||e.sectionsAreOblique())))}sleeveModelFile(){return"citypost-slope-transition-sleeves"}sleeveModelIdentifiers(){if(this.previousSection()?.isSlopeToSlopeCornerAtEnd())return[];const e=this.postProvider().isIRCCompliant(),t=this.nextSection()?.sloped()?"top":"bottom";if(!e&&!this._areSectionsPerpendicular())return[`straight-${t}`,`straight-${t}`];const r=this._areSectionsPerpendicular()?"corner":"straight",n=e?"-2in-transition":"",i=[`${r}-level${n}`,`${r}-sloped${n}`];return"top"===t?i:i.reverse()}canPlaceRailSleeves(){return!(!this.nextSection()||!this.previousSection())}sleeveLocators(){const e=this.sleeveOffsetVector();return this.sleeveModelIdentifiers().map(((t,r)=>{const s=0===r?i(0,0,this.sleeveOffsetZ()):e,o=this.topLocator().add(s);return n.makeRelativeTo(o,this.topLocator())}))}sleeveOffsetVector(){const e=this.componentOf().sectionConnectedToEnd();return(this.isEndPost()&&e?e:this.componentOf()).edge().xy().direction().multipliedBy(this._railOffset()).addZ(this.sleeveOffsetZ())}sleeveSpecifier(){let e=`${this.color().label}-${this._areSectionsPerpendicular()?"corner":"straight"}-${this.nextSection().sloped()?"top":"bottom"}`;return this.postProvider().isIRCCompliant()&&(e+="-2in"),o[`${e}-sleeve`]}materialSpecifier(){return o[`${this.postOptions} Stair Post`]}_areSectionsPerpendicular(){return this.previousSection()?.edge().isPerpendicularTo(this.nextSection()?.edge())}}},28288:(e,t,r)=>{const n=r(17588);e.exports=class CityPostTerminalPost extends n{static fitsContext(e){return!(!e.isSlopeTransition()||!e.doubleCornerPosts())||!e.isSlopedPosition()&&(!e.isInteriorPosition()&&!e.sectionsAreParallelIn3D())}sleeveModelIdentifiers(){return["corner-90"]}sleeveModelFile(){return"citypost-corner-sleeves"}sleeveOffsetVector(){const e=this.postProvider().wrapCableAroundCorners()?this.componentOf().doubleCornerPostTerminalInset():0;return this.componentOf().edge().direction().multipliedBy(-e).addZ(this.sleeveOffsetZ())}canPlaceRailSleeves(){return!!this.isBeginPost()&&(!!this.previousSection()&&this.previousSection().isLevel())}type(){return"STANDARD START/STOP POST"}}},31224:e=>{e.exports={LENGTH_ANNOTATIONS:"Length Annotations",STAIR_ANNOTATIONS:"Stair Annotations",POST_LABELS:"Post Labels",SLEEVE_LABELS:"Sleeve Labels",POST_ANNOTATIONS:"Post Annotations"}},14545:(e,t,r)=>{const{MaterialSpecifier:n}=r(93613),i=r(19535),s=e=>{const t=i[e];return{materialName:t.materialName(),fillStyle:t.fillStyle(),strokeStyle:t.strokeStyle()}},o=(e,t,r)=>Object.values(i).map((e=>e.label)).map((i=>{const o=`${i} ${e}`;return new n(t?`${i}-${t}`:o,o,{identifier:r,description:e,...s(i.toLowerCase())})}));let a=1;const l=e=>['36"','42"'].flatMap((t=>o(`${t} ${e}`,void 0,"P"+a++))),c=[new n("Cable","Cable"),new n('36" Tall Railing','36" Tall Railing'),new n('36" Tall Stair Railing','36" Tall Stair Railing'),new n('42" Tall Railing','42" Tall Railing'),new n('42" Tall Stair Railing','42" Tall Stair Railing'),new n("Zinc","Zinc Plated Steel"),new n("Stainless Steel","Powder Coated Stainless Steel"),new n("No Top Rail","No Top Rail"),...o("Rail"),...l("Post"),...l("Corner Post"),...l("Stair Post"),...l("Fascia Post"),...l("Fascia Corner Post"),...l("Fascia Stair Post"),...o('Straight 3" Sleeve',"straight-3in-sleeve","S1"),...o('Straight 2" Sleeve',"straight-2in-sleeve","S2"),...o("Corner 90° Sleeve","corner-90-sleeve","S3"),...o("Corner 45° Sleeve","corner-45-sleeve","S4"),...o("Corner 22.5° Sleeve","corner-22_5-sleeve","S5"),...o("Corner 11.25° Sleeve","corner-11_25-sleeve","S6"),...o("Straight Top Stair Transition Sleeve","straight-top-sleeve","S7"),...o('Straight Top 2" Stair Transition Sleeve',"straight-top-2in-sleeve","S8"),...o("Straight Bottom Stair Transition Sleeve","straight-bottom-sleeve","S9"),...o('Straight Bottom 2" Stair Transition Sleeve',"straight-bottom-2in-sleeve","S10"),...o("Corner Top Stair Transition Sleeve","corner-top-sleeve","S11"),...o("Corner Bottom Stair Transition Sleeve","corner-bottom-sleeve","S12"),...o('Corner Top 2" Stair Transition Sleeve',"corner-top-2in-sleeve","S13"),...o('Corner Bottom 2" Stair Transition Sleeve',"corner-bottom-2in-sleeve","S14"),...o("Custom Sleeve","custom-sleeve","S15")],u={};c.forEach((e=>{u[e.identifier()]=e})),e.exports=u},85727:(e,t,r)=>{const n=r(63768),{extend:i}=r(50988),{PostFasciaMountStyle:s}=r(8423),o=r(17588),a=r(35337),l=r(53627);class CityPostPostFasciaMountStyle extends s{structureEdgeOffsetFromCenter(e){return n.unit(0,"in")}sectionEdgeOffsetFromCenter(e){const t=n.multiply(e,.5),r=this.structureEdgeOffsetFromCenter();return n.add(r,t,o.basePlateHeight())}intersectionHelper(e){return new a(this._baseComponentLayoutEdge(e),this.componentLayoutEdgeOffset(e))}}i(CityPostPostFasciaMountStyle,l),e.exports=CityPostPostFasciaMountStyle},74079:(e,t,r)=>{const n=r(63768),i=r(83741),s=r(17588);e.exports=class CityPostPostSurfaceMountStyle extends i{structureEdgeOffsetFromCenter(e){return n.multiply(s.basePlateWidth(),.5)}sectionEdgeOffsetFromCenter(e){return n.unit(0,"in")}}},5895:(e,t,r)=>{const n=r(11511),i={ANGLE_ANNOTATIONS:"Angle Annotations",PLATFORMS:"Platforms",PLATFORMS_LEVEL:"Level Platforms",PLATFORMS_SLOPED:"Sloped Platforms",PROJECTED_EXTRUSION_ANNOTATION:"Projected Extrusion Annotation",platformLayerFor:e=>n.strategy()?.platformLayerFor?.(e)||i.PLATFORMS};e.exports=i},18475:(e,t,r)=>{const{MaterialSpecifier:n}=r(93613),{CompositeFigure:i}=r(7340),{Composite3DFigure:s}=r(37732),{Cube:o}=r(62048),{extend:a}=r(50988),l=r(28219),c=r(26933),u=r(20632),d=r(80371);class ExtrusionPost extends d{beginLocator(){return this.topLocator()}endLocator(){return this.bottomLocator()}materialSpecifier(){return new n("Rail","Rail",{materialName:"aluminum"})}planarNormal(){return this.edge().xy().direction()}leg(){return this.extrusion()}components(){return[this.leg(),...this.accumulatedComponents()]}boundingCube(){return o.mergedFiniteCubes(this.components())}boundingBox(){return this.components().map((e=>e.boundingBox())).reduce(((e,t)=>e.merge(t)))}defaultFigure(){return i.withModel(this)}threeFigure(){return s.withModel(this)}projectedViewFigure(e,t,r){return c.withModel(this,e,t,r)}nonEssentialProperties(){return[...super.nonEssentialProperties(),...this.accumulatedNonEssentialProperties()]}}a(ExtrusionPost,l),a(ExtrusionPost,u),e.exports=ExtrusionPost},28622:(e,t,r)=>{const{FixedEdgeLocator:n}=r(62048);e.exports=class InfillHelper{generateInfill(e,t){const r=[],i=Math.ceil(e.first().length()/t.infillSpacing().toNumeric(t.unit())),s=e.first().length()/i,o=t.infillSpecifier(),a=t.infillClass();for(let l=1;l<i;l++)r.push(new a(new n(e.first(),l*s),new n(e.last(),l*s),t.infillCrossSection(),o));return r.forEach((e=>{e.setComponentOf(t),e.setVisibleIn2D(t.showInfillIn2D?.())})),r}}},3679:(e,t,r)=>{const{extend:n}=r(50988),i=r(92214),s=r(84155);class HorizontalBarBlock extends s{}n(HorizontalBarBlock,i),e.exports=HorizontalBarBlock},73964:(e,t,r)=>{const{extend:n}=r(50988),i=r(99343),s=r(84155);class PicketBlock extends s{}n(PicketBlock,i),e.exports=PicketBlock},42632:(e,t,r)=>{const n=r(63768),i=r(30691);e.exports=class RailingBlockRailFactory{static createRail(e,t,r,n,...i){const s=new e(this._railEdge(t,r,n),...i);return s.setComponentOf(t),s}static _railEdge(e,t,r=n.unit(0,"in")){const s=-t.toNumeric(e.unit()),o=r.toNumeric(e.unit()),a=e.section().slope(),l=-this._baseBeginInset(e)/n.cos(a),c=-this._baseEndInset(e)/n.cos(a);return i.stretchedEdgeBy(e.railEdge(),l,c).addZ(s).shiftedAlongNormalBy(o).relativeToEdge(e.edge())}static _baseBeginInset(e){return(e.beginRailInset()??this._fallbackInset(e.beginPost())).toNumeric(e.unit())}static _baseEndInset(e){return(e.endRailInset()??this._fallbackInset(e.endPost())).toNumeric(e.unit())}static _fallbackInset(e){return e?n.divide(e.length(),2):n.unit(0,"in")}}},68384:(e,t,r)=>{const{extend:n}=r(50988),i=r(59556),s=r(84155);class ThunderCloudExtrusionPanelBlock extends s{}n(ThunderCloudExtrusionPanelBlock,i),e.exports=ThunderCloudExtrusionPanelBlock},43481:(e,t,r)=>{const n=r(84155);e.exports=class ThunderCloudPanelBlock extends n{panelClass(){return this.config.panelClass}panel(){return this._panel??=this._defaultPanel()}_defaultPanel(){const e=new(this.panelClass());return e.setComponentOf(this),e}components(){return[...super.components(),this.panel()]}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_panel"]}}},84155:(e,t,r)=>{const{extend:n}=r(50988),{RailingBlock:i}=r(8423),s=r(20632),o=r(26933),a=r(42632),l=r(64805);class ThunderCloudRailingBlock extends i{get railingStyleConfig(){return this.railingStyle().config}get config(){return this.railingStyleConfig.railingBlock}get bottomRailConfig(){return this.railingStyleConfig.bottomRail}get topRailConfig(){return this.railingStyleConfig.topRail}isCornerAtBegin(){return this.isFirstBlock()&&Boolean(this.section().sectionConnectedToBegin())}isCornerAtEnd(){return this.isLastBlock()&&Boolean(this.section().sectionConnectedToEnd())}topRailClass(){return this.topRailConfig.railClass}bottomRailClass(){return this.bottomRailConfig.railClass}topRailHeight(){return this.section().railingHeight()}bottomRailHeight(){return this.bottomRailConfig.height}beginRailInset(){return this.config.beginRailInset}endRailInset(){return this.config.endRailInset}shouldHaveTopRail(){return this.topRailConfig.railOwner===l.railOwner.block}shouldHaveBottomRail(){return this.bottomRailConfig.railOwner===l.railOwner.block}topRail(){if(this.shouldHaveTopRail())return this._topRail??=this._defaultTopRail()}_defaultTopRail(){const e=this.topRailClass(),t=this.topRailHeight();return this._createRail(e,t)}bottomRail(){if(this.shouldHaveBottomRail())return this._bottomRail??=this._defaultBottomRail()}_defaultBottomRail(){const e=this.bottomRailClass(),t=this.bottomRailHeight();return this._createRail(e,t)}_createRail(e,t){const r=a.createRail(e,this,t);return r.setComponentOf(this),r}projectedViewFigure(e,t,r){return o.withModel(this,e,t,r)}components(){return[...super.components(),...this.accumulatedComponents(),this.topRail(),this.bottomRail()].filter(Boolean)}nonEssentialProperties(){return[...super.nonEssentialProperties(),...this.accumulatedNonEssentialProperties(),"_topRail","_bottomRail"]}}n(ThunderCloudRailingBlock,s),e.exports=ThunderCloudRailingBlock},22766:(e,t,r)=>{const n=r(63768),i=r(74215),s=r(42632);e.exports=class RailingBlockBottomRailMixin{bottomRail(){return this._bottomRail??=this._defaultBottomRail()}_defaultBottomRail(){const e=this._createBottomRail();return e.setComponentOf(this),e}_createBottomRail(){const e=this.bottomRailClass();return s.createRail(e,this,this.bottomRailHeight())}bottomRailClass(){return i}bottomRailHeight(){return n.unit(3,"in")}infillBottomHeight(){return n.add(this.bottomRailHeight(),n.divide(this.bottomRailDepth(),2))}bottomRailDepth(){return this.bottomRail().depth?.()??n.unit(1,"in")}}},29876:(e,t,r)=>{const n=r(74215),i=r(42632);e.exports=class RailingBlockTopRailMixin{topRail(){return this._topRail??=this._defaultTopRail()}_defaultTopRail(){const e=this._createTopRail();return e.setComponentOf(this),e}_createTopRail(){const e=this.topRailClass();return i.createRail(e,this,this.topRailHeight())}topRailHeight(){return this.section().railingHeight()}topRailClass(){return n}}},35080:(e,t,r)=>{const{Angle:n}=r(62048),i=r(39463),s=r(37458);e.exports=class AngleAnnotationHelper extends s{static defaultConfig(){return this.strategyProjectConfig().railings.defaults.angleAnnotationHelper}annotationsForRailingRun(e){const t=e.previousRun();return t?this.annotationsForEdges([t,e].map((e=>e.edge()))):[]}annotationsForEdges(e){return!Array.isArray(e)||e.length<2?[]:e.reduce(((t,r,s)=>{if(0===s)return t;const o=e.at(s-1);if(!o.end().equals(r.begin()))return t;const a=new n(r.begin(),r.end(),o.begin());if(a.smallestDeltaDegrees()%180==0)return t;const l=new i(a,this.config.distance,this.config.minDistance);return l.setLayer(this.config.layer),l.setSignificantDecimalPlaces(this.config.angleSignificantDecimalPlaces),t.push(l),t}),[])}}},36363:e=>{e.exports=class AnnotationsFactory{constructor(e){this._annotationsHelperConfigs=e}get config(){return this._annotationsHelperConfigs}isConfigured(){return this.config&&Object.keys(this.config).length>0}makeAnnotationsFor(e){return this._annotationHelpers().flatMap((t=>t.annotationsFor(e)))}_annotationHelpers(){return this.__annotationHelpers??=Object.values(this.config).map((e=>new(0,e.class)(e.config)))}}},90348:(e,t,r)=>{const n=r(30691),i=r(37458);e.exports=class LinearDimensionAnnotationHelper extends i{static defaultConfig(){return this.strategyProjectConfig().railings.defaults.linearDimensionAnnotationHelper}annotationsForEdges(e,t=this.config){if(!Array.isArray(e)||e.length<1)return[];const r=t.annotationClass;return e.map((e=>{const n=new r(e,t.distance,t.unit,t.options);return n.setLayer(t.layer),n}))}annotationsForBetweenPoints(e,t){return!Array.isArray(e)||e.length<2?[]:this.annotationsForEdges(n.pointArrayToEdges(e),t)}annotationsForRailingSection(e){const t=this.config.modelBasedAnnotations;return t?[t.platform?this._annotationsForRailingSectionPlatform(e):[],t.postRun?this._annotationsForRailingSectionPostRun(e):[],t.postSpacing?this._annotationsForRailingSectionPostSpacing(e):[]].flat():this._annotationsForRailingSectionPlatform(e)}_annotationsForRailingSectionPlatform(e){return this._createAnnotationsForRailingSection(e,[e.edge()],this.config.modelBasedAnnotations?.platform)}_annotationsForRailingSectionPostRun(e){const t=e.postLocations();if(!t||t.length<2)return[];const r=t.at(0).to(t.at(-1));return this._createAnnotationsForRailingSection(e,[r],this.config.modelBasedAnnotations?.postRun)}_annotationsForRailingSectionPostSpacing(e){const t=n.pointArrayToEdges(e.postLocations());return this._createAnnotationsForRailingSection(e,t,this.config.modelBasedAnnotations?.postSpacing)}_createAnnotationsForRailingSection(e,t,r={}){const n={...this.config,...r},i=e.annotationDirection();n.distance*=i;const s=e.edge(),o=t.map((e=>e.relativeToEdge(s)));return this.annotationsForEdges(o,n)}}},21416:(e,t,r)=>{const n=r(5660),i=r(30691),s=r(91);e.exports=class RailingPostOrientationHelper{constructor(e={}){this._config=n.mergeDeep({},{sources:[s,e]})}get config(){return this._config}orientationFor(e){return e.isCornerPost()?this._orientationForCornerPost(e):0}_orientationForCornerPost(e){const t=i.angleBetween(e.section().edge(),e.connectedSection().edge()),r=t.smallestDeltaDegrees(),n=this.config.cornerAngleRanges.find((e=>e.lowerBound<r&&(e.upperBound>r||e.upperBound.isNearTo(r))));if(!n)return 0;const s=t.clockwise()?1:-1;return"bisect"===n.rotation?r/2*s:n.rotation*s}}},37458:(e,t,r)=>{const{extend:n,MissingOverride:i}=r(50988),s=r(5660),o=r(24360);class ThunderCloudAnnotationHelper{static defaultConfig(){return{defaultModelName:"NotConfigured"}}constructor(e={}){this._config=s.mergeDeep({},{sources:[this.constructor.defaultConfig(),e]})}get config(){return this._config}annotationsFor(e,...t){const r=`annotationsFor${this.config.defaultModelName}`;if("function"!=typeof this[r])throw new i(this,r);return this[r](e,...t)}}n(ThunderCloudAnnotationHelper,o),e.exports=ThunderCloudAnnotationHelper},43357:(e,t,r)=>{const n=r(63768),{RailingLayoutInsetHelper:i}=r(8423),s=r(30691);e.exports=class ThunderCloudPostLayoutEdgeInsetHelper extends i{static preconfiguredClass(e){return this.bind(null,e)}constructor(e={}){super(),this._config=e}get config(){return this._config}fallbackInset(e,t){return this._getInsetByType("fallback",e,t)}parallelInset(e,t){return this._getInsetByType("parallel",e,t)}rightAngleInset(e,t){return this._getInsetByType("rightAngle",e,t)}terminalInset(e,t){return this._getInsetByType("terminal",e,t)}obliqueInset(e,t){const r=s.angleBetween(e.edge(),t.edge()).smallestDeltaDegrees(),n=this._lookupConfigFor("obliqueInsetRanges",e),i=n?.find((e=>e.lowerBound<r&&(e.upperBound>r||e.upperBound.isNearTo(r))));return this._getInsetFromConfig(i,e,t)||this._getInsetByType("oblique",e,t)}_getInsetByType(e,t,r){const n=`${e}Inset`,i=this._lookupConfigFor(n,t);return this._getInsetFromConfig(i,t,r)||super[n]?.(t,r)}_lookupConfigFor(e,t){const r=t.postMountStyle().mountingMode();return this.config[r]?.[e]||this.config[e]}_getInsetFromConfig(e,t,r){if(!e||e instanceof n.Unit)return e;if(!e.insetAtBegin&&!e.insetAtEnd)return e.universalInset;let i;return t.sectionConnectedToBegin()===r?i=e.insetAtBegin:t.sectionConnectedToEnd()===r&&(i=e.insetAtEnd),i||e.universalInset}}},17171:(e,t,r)=>{const{NormalToEdgeLocator:n}=r(62048),i=r(39662),s=r(37458),o=r(5660);e.exports=class WarningAnnotationHelper extends s{static defaultConfig(){return this.strategyProjectConfig().railings.defaults.warningAnnotationHelper}annotationsForRailingSection(e){const t=this.config.modelBasedAnnotations;return t?Object.values(t).map((t=>{const r=o.mergeDeep({},{sources:[this.config,t]});if(!e[r.shouldWarn]())return;const i=e.postRunEdge().center(),s=new n(i,r.distance*e.annotationDirection()),a=this._messageFor(r.message,e);return this._createWarningAnnotationsWith(a,s,i,r)})).filter(Boolean):[]}_messageFor(e,t){const r=e.key?this.strategyProjectConfig().messages[e.key]:void 0,n=e.substitutionVars;return t&&n?.length>0?i.sprintf(r,...n.map((e=>t[e]()))):r||e.text}_createWarningAnnotationsWith(e,t,r,n){const i=new(0,n.annotationClass)(e,t,r,n.options);return i.setLayer(n.layer),i}}},83383:(e,t,r)=>{const n=r(63768),{three:i,Composite3DFigure:s}=r(37732),{MaterialSpecifier:o}=r(93613),{Polygon:a}=r(62048),{CompositeFigure:l}=r(7340),c=r(83102),u=r(57473),d=r(6556),h=r(9343),p=r(93491),m=[{min:n.unit(13,"in"),max:n.unit(20,"in"),assemblyKey:"A"},{min:n.unit(20,"in"),max:n.unit(27,"in"),assemblyKey:"B"},{min:n.unit(27,"in"),max:n.unit(34,"in"),assemblyKey:"C"},{min:n.unit(34,"in"),max:n.unit(41,"in"),assemblyKey:"D"},{min:n.unit(41,"in"),max:n.unit(48,"in"),assemblyKey:"E"}];e.exports=class HollaenderPanel extends c{static PANEL_SIZES=m;block(){return this.componentOf()}edge(){return this.block().edge()}color(){return this.colors.defaultColor}panelModel(){return this._panelModel??=this._defaultPanelModel()}_defaultPanelModel(){const e=this._panelLocator(),t=this._panelRotation(),r=this.panelModelIdentifier();return new u(e,r,t,void 0,[this.color().materialName()])}_panelLocator(){const e=(this.block().topRailHeight().toNumeric(this.unit())+this.block().bottomRailHeight().toNumeric(this.unit()))/2;return this.edge().center().addZ(-e)}_panelRotation(){const e=this.edge().normal();return(new i.Quaternion).setFromUnitVectors(new i.Vector3(0,-1),e.toThreeJS())}panelModelIdentifier(){return`hollaender-panel-${this._closestPanelSize()}`}panelAssemblyKey(){const e=this.constructor.PANEL_SIZES,t=n.unit(this._closestPanelSize(),"in");return e.find((e=>e.min.equals(t))).assemblyKey}_closestPanelSize(){const e=n.unit(this.edge().length(),this.unit()),t=this.constructor.PANEL_SIZES,r=t.reduce(((t,r)=>{const i=n.largerEq(e,r.min),s=n.smallerEq(e,r.max);return i&&s?r:t}),t.first());return Math.round(r.min.toNumeric("in"))}materialSpecifier(){return new o(this.panelSKU(),this.panelDescription())}panelSKU(e=this._closestPanelSize()){return[{sku:"19050",minSize:13},{sku:"19060",minSize:20},{sku:"19070",minSize:27},{sku:"19080",minSize:34},{sku:"19090",minSize:41}].find((t=>t.minSize===e))?.sku}panelDescription(e=this._closestPanelSize(),t=e+7){return`QC ${e}" - ${t}" Wire Mesh Infill Panel Assembly`}selfMaterialLineItems(){return[new d(1,this.materialSpecifier())]}geometry(){return new a([this.edge().begin(),this.edge().end()])}components(){return[this.panelModel()]}defaultAnnotations(){return[this.assemblyKeyAnnotation()]}assemblyKeyAnnotation(){const e=this.edge().center(),t=this.edge().normal().multipliedBy(-25),r=e.add(t).relatedTo(e),n=this.panelAssemblyKey(),i=new h(n,r,e);return i.setLayer(p.PANEL_LABELS),i}equals(e){return this.panelSKU()===e.panelSKU()}defaultFigure(){return l.withModel(this)}threeFigure(){return s.withModel(this)}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_panelModel"]}async load(){return Promise.all(this.components().map((e=>e.load?.())))}}},41456:(e,t,r)=>{const n=r(77871),i=r(63768),{MaterialSpecifier:s}=r(93613),o=r(6556),a=r(43812),l=r(80317),c=[0,50,200,1/0];e.exports=class HollaenderProject extends a{static POWDER_COAT_PRICE_THRESHOLDS=c;defaultDisplayProperties(){return[...super.defaultDisplayProperties()]}isRailColorDefault(){const e=this.config.railings.base.colors.first().palette.first();return this.colors.defaultColor.equals(e)}totalRailLength(){return this.railingCollections().reduce(((e,t)=>{const r=t.totalRailLength();return i.add(e,r)}),i.unit(0,"in"))}powderCoatMaterialSpecifier(){const e=Math.floor(this.totalRailLength().toNumeric("ft")),t=this.constructor.POWDER_COAT_PRICE_THRESHOLDS,r=t.slice(1).findIndex((t=>e<=t))+1,n=r-1,i=t[r],o=0===n?t[n]:t[n]+1;return new s(`Powder Coat ${i===1/0?`${o}+`:`${o}-${i}`} feet`,"Powder Coat")}powderCoatMaterialLineItem(){if(this.isRailColorDefault())return;const e=Math.round(this.totalRailLength().toNumeric("ft")),t=i.unit(e,"ft");return new o(t,this.powderCoatMaterialSpecifier())}blocks(){return this.railingCollections().flatMap((e=>e.sections())).flatMap((e=>e.blocks()))}panelCounts(){return this._panelCounts??=this._defaultPanelCounts()}_defaultPanelCounts(){return this.blocks().map((e=>e.panel())).reduce(((e,t)=>{const r=e.find((e=>e.referencePanel.equals(t)));return r?r.count+=1:e.push({referencePanel:t,count:1}),e}),[])}resetPanelCounts(){this._panelCounts=void 0,this.railingCollections().forEach((e=>e.resetSectionAnnotations()))}remove(e){super.remove(e),this.resetPanelCounts()}add(e){super.add(e),this.resetPanelCounts()}_materialLineItems(){return[...super._materialLineItems(),this.powderCoatMaterialLineItem()].filter((e=>e))}addComponentObservers(e){e.role()===l.RAILING_COLLECTION&&e.addSectionsUpdatedObserver(this,(()=>this.resetPanelCounts()))}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_panelCounts"]}logo(){return"hollaender-quik-connect-logo.png"}watermarkLogo(){return"hollaender-quik-connect-logo-watermark.png"}watermarkAlpha(){return.03}pdfDocumentClass(){return n}}},90161:(e,t,r)=>{const n=r(69435),i=r(59663);e.exports=class HollaenderRail extends n{color(){return this.colors.defaultColor}material(){return this.color().materialName()}radius(){return this.strategyProjectConfig().railings.base.pipeRadius}defaultFigure(){return new i(this,{strokeStyle:this.color().strokeStyle(),fillStyle:this.color().fillStyle(),lineWidth:.3})}materialLineItems(){return[]}}},93491:e=>{e.exports={ANGLE_ANNOTATIONS:"Angle Annotations",LENGTH_ANNOTATIONS:"Length Annotations",PANEL_LABELS:"Panel Labels"}},38578:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),s=r(27877),o=r(4777),a=r(13254),l=r(60392),c=r(1617),u=r(64805),d=r(90161),h=r(83383),p=r(43481),m=r(88646),f=r(20901),g=r(43320),y=r(38282),b=r(90462),v=r(93491),_=n.unit(.95,"in"),x=[new g("Standard","aluminum","#9e9e9e","#242424"),new g("White","hollaender-white","#f7f9eF","#242424"),new g("Black","hollaender-black","#3c3d3e","#0d0d0d"),new g("Bronze","hollaender-bronze","#755334","#242424"),new g("Safety Yellow","hollaender-safety-yellow","#eed202","#242424")],w={railings:{base:{minLength:n.unit(13,"in"),minRailLength:n.unit(13,"in"),maxRailLength:n.unit(48,"in"),defaultPostLength:_,defaultPostWidth:_,colors:[{label:"Rail Color",key:"defaultColor",palette:x}],pipeRadius:_},railingCollection:{defaultRailingHeight:n.unit(41.5,"in"),railingStyle:{choices:["default"]}},railingSection:{pendingRailWidth:_,sectionLengthAnnotationLayer:v.LENGTH_ANNOTATIONS,displayProperties:{postMountStyle:{show:!1}}},railingStyles:{default:b({styleId:"default",label:"Quik Connect",icon:"generic-rail",railingBlock:{blockClass:p,beginRailInset:_,endRailInset:_,panelClass:h},railingPost:{defaultLength:_,defaultWidth:_,parts:{baseplate:{geometryType:u.geometryType.model3D,modelIdentifier:"hollaender-post-baseplate",orthogonalDistance:n.unit(.25,"in")},leg:{geometryType:u.geometryType.extrusion,crossSection:new m([new f(i(0,0).expandedByRadius(_.toNumeric("in")))])}}},postMountStyles:{classes:[c]},postClasses:[o,a,l,s],topRail:{railOwner:u.railOwner.block,railClass:d},bottomRail:{railOwner:u.railOwner.block,railClass:d,height:n.add(n.unit(3.75,"in"),_)}})}}};e.exports=y(w)},27877:(e,t,r)=>{const{MaterialSpecifier:n}=r(93613),{$P:i}=r(62048),s=r(57473),o=r(80791);e.exports=class HollaenderAdjustableCornerPost extends o{_defaultSleeves(){return[new s(this.topLocator(),"hollaender-connector-cap-60-8",this.rotation(),void 0,this.materialNames()),...this._makeSleeves("hollaender-connector-30C-8-half","hollaender-connector-30C-8-half"),...this._makeSleeves("hollaender-connector-30C-8-half","hollaender-connector-30C-8-half",this.nextSectionPostRotation(),i(-1,1,-1))]}materialSpecifier(){return new n("19040",'QC Adj Angle Assembly 1.5" Schedule 80')}static fitsContext(e){return!e.isInteriorPosition()&&e.sectionsAreOblique()}}},13254:(e,t,r)=>{const{MaterialSpecifier:n}=r(93613),i=r(80791);e.exports=class HollaenderEndPost extends i{_defaultSleeves(){const e=this.componentOf().edge().begin(),t=this.locator().equals(e)?this.negatedRotation():this.rotation();return this._makeSleeves("hollaender-connector-3-8","hollaender-connector-5E-8",t)}negatedRotation(){const e=this._sectionDirection().negated();return this._getRotationForDirection(e)}materialSpecifier(){return new n("19010",'QC End Post Assembly 1.5" Schedule 80')}static fitsContext(e){return!e.isInteriorPosition()&&!e.connectedSection()}}},4777:(e,t,r)=>{const{MaterialSpecifier:n}=r(93613),i=r(80791);e.exports=class HollaenderLinePost extends i{_defaultSleeves(){return this._makeSleeves("hollaender-connector-5-8","hollaender-connector-7E-8")}materialSpecifier(){return new n("19020",'QC Line Post Assembly 1.5" Schedule 80')}static fitsContext(e){return e.isLinePosition()}}},80791:(e,t,r)=>{const{MaterialSpecifier:n}=r(93613),i=r(22391),s=r(57473),o=r(6556);e.exports=class HollaenderPost extends i{radius(){return this.project().config.railings.base.pipeRadius}length(){return this.radius()}bottomRailConnectorLocator(){const e=-this.railingStyleConfig.bottomRail.height.toNumeric(this.unit());return this.locator().addZ(e)}color(){return this.colors.defaultColor}nextSectionPostRotation(){const e=this.nextSection().edge().direction().negated();return this._getRotationForDirection(e)}_makeSleeves(e,t,r=this.rotation(),n=void 0){const i=this.topLocator(),o=this.bottomRailConnectorLocator(),a=this.materialNames();return[new s(i,e,r,n,a),new s(o,t,r,n,a)]}materialSpecifier(){return new n("Hollaender Post","Hollaender Post")}selfMaterialLineItems(){return[new o(1,this.materialSpecifier())]}}},60392:(e,t,r)=>{const{MaterialSpecifier:n}=r(93613),i=r(80791);e.exports=class HollaenderRightCornerPost extends i{_defaultSleeves(){const e=this.isAtInsideCorner()?this.nextSectionPostRotation():this.rotation();return this._makeSleeves("hollaender-connector-9-8","hollaender-connector-11E-8",e)}isAtInsideCorner(){const e=this.previousSection(),t=this.nextSection(),r=e.edge().theta().normalizedAngle();return(t.edge().theta().normalizedAngle()-r).normalizedAngle().radiansToDegrees().roundedTo(this.strategyProjectConfig().base.significantDecimalPlaces.angles).isNearTo(270)}materialSpecifier(){return new n("19030",'QC Corner 90° Assembly 1.5" Schedule 80')}static fitsContext(e){return!e.isInteriorPosition()&&e.sectionsArePerpendicular()}}},33046:(e,t,r)=>{const{EditableProperty:n}=r(7340);e.exports=class DataDrivenRailingsProjectMixin{colorProperties(){const e=this.config.railings.base.colors;return e?e.map((t=>{const r=t.label??"Unnamed Color",i=t.palette??[e.defaultColor],s=t.key;return new n(this,r,{type:"select",choices:i,get:()=>this.colors[s],set:e=>this.setColor(s,e)})})):[]}_defaultColors(){const e=this.config.railings.base,t={defaultColor:e.defaultColor};return e.colors?.forEach((e=>{const r=e.key;t[r]=e.default??e.palette.first()})),t}}},93969:(e,t,r)=>{const{three:n}=r(37732),i=r(57473);e.exports=class Model3DRightCornerSleeveMixin{materialNames(){return this._materialNames??=this._defaultMaterialNames()}modelIdentifier(){return this._modelIdentifier}_defaultMaterialNames(){return[this.materialSpecifier().details().materialName]}generatePart(e,t){return new i(this.locator(),e,t,void 0,this.materialNames())}rotationFor(e,t){const r=e.negated(),i=t.negated(),s=r.toThreeJS(),o=i.toThreeJS(),a=i.cross(r).toThreeJS(),l=(new n.Matrix4).makeBasis(s,a,o),c=(new n.Quaternion).setFromRotationMatrix(l);if((r.xy().theta().normalizedAngle()-i.xy().theta().normalizedAngle()).normalizedAngle().isNearTo(3*Math.PI_2))return c;const u=(new n.Quaternion).setFromAxisAngle(o,Math.PI),d=(new n.Quaternion).setFromAxisAngle(a,-Math.PI_2);return c.premultiply(u).premultiply(d)}async load(){return Promise.all(this.components().map((e=>e.load?.())))}}},1412:(e,t,r)=>{const{three:n}=r(37732),i=r(57473);e.exports=class Model3DSleeveMixin{materialNames(){return this._materialNames??=this._defaultMaterialNames()}modelIdentifier(){return this._modelIdentifier}modelRotation(){return this._modelRotation??=new n.Quaternion(0,0,0,1)}supplementalRotation(){return this._supplementalRotation??=new n.Quaternion(0,0,0,1)}_defaultMaterialNames(){return[this.materialSpecifier().details().materialName]}generatePart(e,t){return new i(this.locator(),e,t,void 0,this.materialNames())}rotationFor(e){const t=(new n.Quaternion).setFromAxisAngle(new n.Vector3(0,-1,0),Math.PI_2-e.phi()),r=(new n.Quaternion).setFromAxisAngle(new n.Vector3(0,0,1),e.theta());return t.clone().premultiply(r).multiply(this.modelRotation()).multiply(this.supplementalRotation())}async load(){return Promise.all(this.components().map((e=>e.load?.())))}}},18729:(e,t,r)=>{const{three:n}=r(37732),i=r(57473);e.exports=class RailingPostWith3DModelBaseplateMixin{static componentsFor(e){return[e.baseplate()]}static nonEssentialProperties(){return["_baseplate"]}baseplate(){return this._baseplate??=this.defaultBaseplate()}defaultBaseplate(){const e=new i(this.bottomLocator(),this.baseplateModelIdentifier(),this.baseplateRotation(),void 0,["aluminum"]);return e.setComponentOf(this),e}baseplateModelIdentifier(){return"baseplate-placeholder"}baseplateRotation(){const e=this.componentOf().structureDirection(),t=this.planarNormal().multipliedBy(e).theta(),r=this.section().isBeginAtSlopeBottom()?0:Math.PI;return(new n.Quaternion).setFromAxisAngle(new n.Vector3(0,0,1),t+r)}}},10712:(e,t,r)=>{const{three:n}=r(37732),i=r(53878),s=r(65898),o=r(71300);e.exports=class RailingPostWith3DModelSleeveMixin{static componentsFor(e){return e.sleeves()}static nonEssentialProperties(){return["_sleeves"]}sleeves(){return this._sleeves??=this.defaultSleeves()}defaultSleeves(){return[this.topRailSleeveHelper(),...this.lowerRailSleeveHelpers()].filter((e=>e)).map((e=>{const t=e.generateSleeve();return t?.setComponentOf(this),t})).filter((e=>e))}rotation(){return new n.Quaternion(0,0,0,1)}topRailRotation(){return this.rotation()}lowerRailRotation(){return this.rotation()}topRailSleeveHelper(){return new i(this,this.topRailSleeveDescriptorMap(),this.topLocator(),this.topRailRotation())}topRailSleeve(){return this.sleeves().first()}lowerRailSleeveHelpers(){return this.lowerRailSleeveLocators().map((e=>new i(this,this.lowerRailSleeveDescriptorMap(),e,this.lowerRailRotation())))}lowerRailSleeveLocators(){return this.componentOf().lowerRailHeights().map((e=>this.locatorForHeight(e)))}locatorForHeight(e){const t=e.toNumeric(this.unit());return this.locator().addZ(-t)}sleeveDescriptorDefinitions(){return o}topRailSleeveDescriptorMap(){return new s(this.sleeveDescriptorDefinitions().topRailSleeves)}lowerRailSleeveDescriptorMap(){return new s(this.sleeveDescriptorDefinitions().lowerRailSleeves)}connectedSlope(){const e=this.componentOf().edge().direction(),t=this.isBeginPost()?[e.negated()]:[e],r=this.attachedRailDirections();if(r.length>1){let[e,n]=[r.first(),r.last().negated()];n.phi()>e.phi()&&([e,n]=[n,e]),t.unshift(e,n)}const n=t.find((e=>e.phi()!==Math.PI_2));return n?(Math.PI_2-n.phi()).radiansToDegrees().rounded():0}}},30301:(e,t,r)=>{const n=r(2650);e.exports=class RailingPostWithExtrusionSleeveMixin{static componentsFor(e){return e.sleeves()}static nonEssentialProperties(){return["_sleeves"]}sleeves(){return this._sleeves??=this.defaultSleeves()}sleeveColor(){return this.color?.()}defaultSleeves(){const e=this._defaultSleeve();return e?(e?.setComponentOf(this),[e]):[]}_defaultSleeve(){const e=this.attachedSections();if(2!==e.length)return;const t=e.first().rails().first().crossSection().scaledBy(1.1);return new n(this.topLocator(),e.first().edge().direction().negated(),e.last().edge().direction(),t,{color:this.sleeveColor()})}}},88317:(e,t,r)=>{const{EditableProperty:n,PropertiesCollection:i}=r(7340),s=r(93250);e.exports=class ThunderCloudRailingPlacementStrategyMixin{displayPropertiesExposedAfterDrawing(){const e=this.lengthFormatter().baseUnit();return new i(this,[new n(this,"Slope",{type:"unit",defaultUnit:"deg",label:"Section Slope",ignoreIntermediateEdits:!0}),new n(this,"Hypotenuse",{type:"unit",defaultUnit:e,label:"Section Surface Length",ignoreIntermediateEdits:!0}),new n(this,"Rise",{type:"unit",defaultUnit:e,label:"Section Rise",ignoreIntermediateEdits:!0}),new n(this,"Run",{type:"unit",defaultUnit:e,label:"Section Run",ignoreIntermediateEdits:!0}),new n(this,"Stair Riser Count",{type:"number",label:"Nosings",ignoreIntermediateEdits:!0})])}defaultStructureRepresentationWidth(){return this.railingRun().defaultStructureRepresentationWidth()}defaultStructureRepresentationThickness(){return this.railingRun().defaultStructureRepresentationThickness()}defaultStructureRepresentationDefaultFigureConfig(){return this.railingRun().config.generatedStructure.defaultFigure}defaultStructureRepresentation(){if(!this.railingRun().isValid())return;const e=this.railingRun().defaultStructureEdgeOffset().toNumeric(this.unit()),t=this.defaultStructureRepresentationWidth().toNumeric(this.unit()),r=this.structureDirection(),n=this._structureMountingEdge(e,r),i=n.shiftedAlongNormalBy(r*-t);return this._generateStructureRepresentation(n,i,r,e)}_generateStructureRepresentation(e,t,r,n){return new s(e,this._detailsForGeneratedStructureRepresentation())}_detailsForGeneratedStructureRepresentation(){return{...this.railingRun().config.generatedStructure,width:this.defaultStructureRepresentationWidth(),thickness:this.defaultStructureRepresentationThickness(),defaultFigure:this.defaultStructureRepresentationDefaultFigureConfig()}}_structureMountingEdge(e,t){const r=e<0,n=this.railingRun(),i=n.edge(),s=i.shiftedAlongNormalBy(t*e);if(!r)return s.stretchedBy(2*e).relativeToEdge(i);const o=!n.previousRun()?0:e,a=!n.nextRun()?0:e,l=s.direction(),c=l.negated().multipliedBy(o),u=l.multipliedBy(a),d=s.begin().add(c),h=s.end().add(u);return d.to(h).relativeToEdge(i)}}},59556:(e,t,r)=>{const n=r(63768),{MaterialSpecifier:i}=r(93613),{$P:s}=r(62048),o=r(88646),a=r(56214),l=r(30202);e.exports=class ExtrusionPanelBlockMixin{infillThickness(){return n.unit(1,"in")}horizontalPanelInset(){return n.unit(4,"in")}verticalPanelInset(){return n.unit(0,"in")}infillSpecifier(){return new i("infill","infill",{materialName:"aluminum"})}_defaultInfill(){const e=this.infillEdges(),t=this.horizontalPanelInset().toNumeric(this.unit()),r=e.first().length()-2*t,n=this.infillThickness().toNumeric(this.unit()),i=new l(e.first().center(),e.last().center(),new o([new a(s(0,0).expandedBy(r/2,n/2))]),this.infillSpecifier(),this.edge().normal());return i.setComponentOf(this),[i]}infillEdges(){const e=this.verticalPanelInset().toNumeric(this.unit()),t=-this.infillBottomHeight().toNumeric(this.unit()),r=-this.infillTopHeight().toNumeric(this.unit());return[this.edge().addZ(r+e),this.edge().addZ(t-e)]}}},92214:(e,t,r)=>{const n=r(63768),{MaterialSpecifier:i}=r(93613),{$P:s}=r(62048),o=r(28622),a=r(88646),l=r(56214),c=r(30202);e.exports=class HorizontalBarBlockMixin{infillSpacing(){return n.unit(6,"in")}infillSpecifier(){return new i("infill","infill",{materialName:"aluminum"})}infillClass(){return c}_defaultInfill(){return(new o).generateInfill(this.infillEdges(),this)}infillCrossSection(){const e=n.unit(1,"in").toNumeric(this.unit());return new a([new l(s(0,0).expandedBy(e))])}infillEdges(){const e=this.infillBaseEdge(),t=-this.infillTopHeight().toNumeric(this.unit()),r=-this.infillBottomHeight().toNumeric(this.unit()),n=e.addZ(t),i=e.addZ(r);return[n.begin().to(i.begin()),n.end().to(i.end())]}}},99343:(e,t,r)=>{const n=r(63768),{MaterialSpecifier:i}=r(93613),{$P:s}=r(62048),o=r(28622),a=r(88646),l=r(56214),c=r(30202);e.exports=class PicketBlockMixin{infillSpacing(){return n.unit(6,"in")}infillSpecifier(){return new i("infill","infill",{materialName:"aluminum"})}infillClass(){return c}_defaultInfill(){return(new o).generateInfill(this.infillEdges(),this)}showInfillIn2D(){return!1}infillCrossSection(){const e=this.picketWidth().toNumeric(this.unit())/2,t=this.picketLength().toNumeric(this.unit())/2;return new a([new l(s(0,0).expandedBy(e,t))])}infillEdges(){const e=this.infillBaseEdge(),t=-this.infillBottomHeight().toNumeric(this.unit()),r=-this.infillTopHeight().toNumeric(this.unit());return[e.addZ(r),e.addZ(t)]}picketWidth(){return n.unit(1,"in")}picketLength(){return this.picketWidth()}}},53627:e=>{e.exports=class LegacyPostMountStyleMixin{componentLayoutEdgeIntersectionOverride(e,t,r,n,i){return n||(t&&e.isBeginAtStairBottom()?r.begin():!t&&e.isEndAtStairBottom()?r.end():void 0)}_baseComponentLayoutEdge(e){return e.edge()}}},6706:e=>{e.exports=class LegacyProjectMixin{allLocatedMaterials(){return this.parts().flatMap((e=>e.allLocatedMaterials()))}}},97209:(e,t,r)=>{const{MissingOverride:n}=r(50988);e.exports=class LegacyRailingCollectionMixin{postDescriptor(){return this._postDescriptor??=this._defaultPostDescriptor()}_defaultPostDescriptor(){const e=this.postDescriptorSource().descriptors().find((e=>e.isDefault()));return e||this.postDescriptorSource().descriptors().first()}setPostDescriptor(e){this.postDescriptorValid(e)&&(this._postDescriptor=e,this.railingRuns().forEach((e=>e.postDescriptorChanged())))}postDescriptorValid(e){return!0}postDescriptorSource(){return this._postDescriptorSource??=this.defaultPostDescriptorSource()}defaultPostDescriptorSource(){throw new n(this,"defaultPostDescriptorSource")}setPostDescriptorSource(e){this._postDescriptorSource=e}allLocatedMaterials(){return this.components().flatMap((e=>e.allLocatedMaterials()))}}},71096:e=>{e.exports=class LegacyRailingRunMixin{allLocatedMaterials(){return this.components().flatMap((e=>e.allLocatedMaterials()))}postDescriptorChanged(){this.resetSections(),this.resetOpeningDisplayProperties(),this.resetOpeningGates(),this.resetStructure()}}},26566:e=>{e.exports=class LegacyRailingSectionMixin{postDescriptor(){return this.postProvider().postDescriptor()}allLocatedMaterials(){return this.components().flatMap((e=>e.allLocatedMaterials()))}}},98430:(e,t,r)=>{const n=r(63768),i=r(46103),s=r(62623),o=r(74666),a=[Math.PI/6,Math.TWO_PI-Math.PI/6],l=[Math.PI_4,Math.TWO_PI-Math.PI_4],c=[Math.TWO_PI/6,Math.TWO_PI-Math.TWO_PI/6];class OmegaAngleBracket extends s{static ANGLES_30=a;static ANGLES_45=l;static ANGLES_60=c;static ALL_ANGLES=[...a,...l,...c];constructor(e,t,r=45){super(e,t),this._angle=r}angle(){return this._angle}railColor(){return this.componentOf().postColor()}_modelIdentifier(){return`omega-angle-bracket-${this.angle()}`}primaryRailOffset(){return n.unit(2,"in")}secondaryRailOffset(){return n.unit(2,"in")}materialSpecifier(){const e=this.angle(),t=`${this.skuColor()}-795A-${e}`;return o[t]||new i(`[NOT STOCK] Angle Bracket - ${e} Degree`)}}e.exports=OmegaAngleBracket},37264:e=>{e.exports=class OmegaCombinedPricingNote{constructor(e,t,r=0){this._message=e,this._sourceName=t,this._count=r}message(){return this._message}combinedMessage(){return`${this.count()} ${1===this.count()?this.sourceName():this.sourceNamePlural()}: ${this.message()}`}sourceName(){return this._sourceName}sourceNamePlural(){return`${this.sourceName()}s`}count(){return this._count}setCount(e){this._count=e}incrementCount(e=1){this.setCount(this.count()+e)}}},88024:(e,t,r)=>{const{three:n}=r(37732),i=r(41908),s=r(6556),o=r(74666);e.exports=class OmegaCornerCap extends i{constructor(e,t){super(),this._locator=e,this._direction=t}locator(){return this._locator}direction(){return this._direction}referencePoint(){return this.locator()}postColor(){return this.componentOf().postColor()}materialName(){return this.postColor().materialName()}skuColor(){return this.postColor().details().skuColor}rotation(){return(new n.Quaternion).setFromUnitVectors(new n.Vector3(0,-1),this.direction().toThreeJS())}materialIdentifiers(){return[this.materialName()]}_modelIdentifier(){return"omega-corner-cap"}price(){return 61}materialSpecifier(){return o[`${this.skuColor()}-795M-78`]}materialLineItems(){return[new s(1,this.materialSpecifier())]}}},24335:(e,t,r)=>{const n=r(6556),i=r(97368);e.exports=class OmegaDoubleInlineBracket extends i{_modelIdentifier(){return`omega-double-inline-bracket${this._flippedSuffix()}`}materialLineItems(){return[new n(2,this.materialSpecifier())]}}},32487:(e,t,r)=>{const n=r(63768),{RelativeLocator:i,Cube:s}=r(62048),{EditableProperty:o,ReadableProperty:a}=r(7340),{extend:l}=r(50988),c=r(10590),u=r(48028),d=r(28831),h=r(56267),p=r(97108),m=r(17222),f=r(281),g=r(85298),y=r(54758),b=r(25072),v=r(44476),_=r(26566),x=r(56780),w=r(28021),[R,k,j]=[0,1,2],z={BEGIN:R,INTERMEDIATE:k,END:j},[q,$]=["LIFT_OUT_RAILS","INLINE_MOUNT"];class OmegaGuardrailSection extends c{static incrementSize(){return d.incrementSize()}defaultDisplayProperties(){return[new o(this,"Length",{label:"Section Length",type:"unit",defaultUnit:"in",restorable:!1,ignoreIntermediateEdits:!0}),new o(this,"Use Lift Out Rails",{type:"boolean",label:"Lift Out Rails"}),...this.pricingNotes()]}componentLayoutEdge(){return this.edge()}componentLayoutLine(){return this.edge()}pricingNotes(){const e=this.postProvider().pricingNoteLabel(),t=this.pricingNoteMessages();return 0===t.length?[]:[new a(this,e,{type:"notice",get:()=>t,restorable:!1})]}pricingNoteMessages(){return[this.hasInvalidColors()?"Some parts don't support the selected color":void 0,this.hasRailShorterThanMinimumLength()?"Rail is too short":void 0].filter((e=>e))}hasInvalidColors(){if(this.isInline()&&this.railColor().equals(x.brightYellow))return!0}hasRailShorterThanMinimumLength(){return!n.equal(this.length(),this.postWidth())&&n.smaller(this.length(),n.unit(2,"ft"))}railMountOptions(){return this._railMountOptions||(this._railMountOptions={LIFT_OUT_RAILS:!0,INLINE_MOUNT:!0}),this._railMountOptions}updateRailMountOptions(){const e=this.railMountOptions();e[q]=this.canUseRailMountStrategy(y),e[$]=this.canUseRailMountStrategy(b),this.resetDisplayProperties()}railMountStrategy(){return this._railMountStrategy||(this._railMountStrategy=new g),this._railMountStrategy}setRailMountStrategy(e){const t=this._railMountStrategy;if(t?.constructor===e?.constructor)return;this._railMountStrategy=e,this.resetComponents(),this.resetDisplayProperties();const r=this.postProvider();setTimeout((()=>{r.updateDisplayProperties?.()}))}canUseRailMountStrategy(e){return e.minimumLengthForSection(this)<this.edge().length()}canUseLiftOutRails(){return this.railMountOptions()[q]}useLiftOutRails(){return this._railMountStrategy?.constructor===y}setUseLiftOutRails(e){if(e&&!this.canUseLiftOutRails())return;if(!1===e&&!1===this.useLiftOutRails())return;const t=e?new y:void 0;this.setRailMountStrategy(t)}toggleUseLiftOutRails(){this.setUseLiftOutRails(!this.useLiftOutRails()),this.postProvider().resetDisplayProperties()}canUseInlineMount(){return this.railMountOptions()[$]}useInlineMount(){return this._railMountStrategy?.constructor===b}setUseInlineMount(e){if(e&&!this.canUseInlineMount())return;if(!1===e&&!1===this.useInlineMount())return;const t=e?new b:void 0;this.setRailMountStrategy(t)}toggleUseInlineMount(){this.setUseInlineMount(!this.useInlineMount())}useSurfaceMount(){return this.railMountStrategy().constructor===g}_defaultRails(){return this.panels().flatMap((e=>e.rails()))}panels(){return this._panels||(this._panels=this._defaultPanels()),this._panels}_defaultPanels(){const e=this.railEdges(),t=[];return e.forEach((e=>{const r=new f(e,this.railZLevels(),this.railMountStrategy());r.setComponentOf(this),t.push(r)})),t}railEdges(){const e=this.railJunctionLocations(),t=[];return e.forEach(((r,n)=>{const s=e[n+1];if(!s)return;const o=r.snapshot().to(s.snapshot()),a=this._insetRailEdge(o,n,e.length-2),l=this._offsetRailEdge(a),c=i.makeRelativeTo(l.begin(),this.edge().center()),u=i.makeRelativeTo(l.end(),this.edge().center()),d=c.to(u);t.push(d)})),t}_offsetRailEdge(e){const t=e.normal(),r=this.railMountStrategy().railOffsetNumeric(this.unit()),n=t.multipliedBy(r);return e.begin().add(n).to(e.end().add(n))}_insetRailEdge(e,t,r){const i=0===t,s=t===r,o=this.railMountStrategy();let a=o.railInsetForIntermediatePost();i&&(a=n.unit(0,"in"));let l=o.railInsetForIntermediatePost();return s&&(l=n.unit(0,"in")),this._applyInsetToEdge(e,a,l)}_applyInsetToEdge(e,t,r){const n=t.toNumeric(this.unit()),i=r.toNumeric(this.unit()),s=e.direction(),o=e.begin().add(s.multipliedBy(n)),a=e.end().add(s.negated().multipliedBy(i));return o.to(a)}railWidth(){return d.width()}railWidthNumeric(){return this.railWidth().toNumeric(this.unit())}pendingRailWidth(){return this.railWidth()}railZLevels(){return this.postDescriptor().railAttachmentLevels().map((e=>-e.toNumeric(this.unit())))}railColor(){return this.postProvider().railColor()}maxRailLength(){return this.postProvider().maxRailLength()}minRailLength(){return this.postProvider().minRailLength()}minLength(){const e=this.componentOf().placementStrategy(),t=n.add(this.minRailLength(),this.beginInset(),this.endInset());return n.max(t,e.minLength())}postWidth(){return u.postWidth()}postWidthNumeric(){return this.postWidth().toNumeric(this.unit())}bracketWidth(){const e=this.railMountStrategy().railMountClass();return e?.railInset().toNumeric(this.unit())||0}minOpeningWidthForFlares(){return n.unit(30,"in")}validOpeningEdge(e){const t=this.railMountStrategy().railInsetForInlineTerminalPost(e?.gate()).toNumeric(this.unit()),r=this.minRailLength().toNumeric(this.unit());return this.railEdge().stretchedBy(2*-(r+t))}beginInset(e=this.railMountStrategy()){const t=this.postProvider().existingPostAtBegin(this)||this._generateBeginPost();return e.railInsetForTerminalPost(t,this,this.gateConnectedTo(this.edge().begin()))}endInset(e=this.railMountStrategy()){const t=this.generateEndPost();return e.railInsetForTerminalPost(t,this,this.gateConnectedTo(this.edge().end()))}railEdge(){const e=this.edge().direction(),t=this.beginInset().toNumeric(this.unit()),r=this.endInset().toNumeric(this.unit()),n=e.multipliedBy(t),s=e.negated().multipliedBy(r),o=this.edge().begin().add(n),a=this.edge().end().add(s),l=i.makeRelativeTo(o,this.edge().center()),c=i.makeRelativeTo(a,this.edge().center());return l.to(c)}postAttachmentsChanged(e){this.resetComponents()}railJunctionLocations(){return super.postLocations()}isSpaceForPosts(){const e=this.railEdge().length().roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES),t=n.unit(e,this.unit());if(n.larger(t,this.postWidth()))return[]}postLayoutEdge(){return this.railEdge()}postSpacingHelper(){const e=this.isInline()?this.postWidthNumeric():0,t=this.bracketWidth(),r=new h(this.minRailLength(),this.maxRailLength(),this.unit(),e,t);return r.setMode(this.postProvider().railLengthMode?.()),r}makePost(e,t){const r=this.edge().normal(),n=this.postWidthNumeric()/2,i=e.add(r.multipliedBy(-n)),s=this._adjustPostPosition(i,t),o=new u(s,r);return o.setComponentOf(this),o}postLocations(){const e=this.railJunctionLocations();return 0===e.length?[]:e.slice(1,-1)}_defaultRailingPosts(){if(this.isUnderMinimumLengthToHaveRail())return this._postForUnderMinimumLengthToHaveRail();const e=this.postLocations(),t=this.postProvider().existingPostAtBegin(this)?[]:[this._generateBeginPost()];e.forEach((e=>{const r=this.makePost(e,z.INTERMEDIATE);t.push(r)}));const r=this._nextSectionIsInline(),n=this.isInline();return this.angleAtEnd().isNearTo(Math.PI_2)&&!n&&r||t.push(this.generateEndPost()),t}_generateBeginPost(){return this.makePost(this.edge().begin(),z.BEGIN)}generateEndPost(){const e=this._nextSectionIsInline(),t=this.isInline(),r=this.angleAtEnd().isNearTo(Math.PI_2),n=this.edge().end(),i=r&&t&&e,s=0===this.angleAtEnd()?z.INTERMEDIATE:z.END;if(!i)return this.makePost(n,s);const o=this.edge().direction(),a=this.postWidthNumeric(),l=n.add(o.multipliedBy(a));return this.makePost(l,s)}_postForUnderMinimumLengthToHaveRail(){const e=this.postProvider().existingPostAtBegin(this),t=this.componentOf().sections().first()===this;if(t&&e)return[];return[t?this._generateBeginPost():this.generateEndPost()]}isUnderMinimumLengthToHaveRail(){return Math.round(this.edge().length())<=this.postWidthNumeric()}isInline(){return this.railMountStrategy().isInline()}_previousSectionIsInline(){const e=this.sectionConnectedToBegin();return!!e&&e.isInline()}_nextSectionIsInline(){const e=this.sectionConnectedToEnd();return!!e&&e.isInline()}_adjustPostPosition(e,t){const r=this.edge().direction(),n=this.postWidthNumeric()/2;let s=e;return t===z.BEGIN?s=s.add(r.multipliedBy(n)):t===z.END&&(s=s.add(r.multipliedBy(-n))),i.makeRelativeTo(s,this.edge().center())}wrapAroundFlares(){return this._wrapAroundFlares||(this._wrapAroundFlares=this._defaultWrapAroundFlares()),this._wrapAroundFlares}_defaultWrapAroundFlares(){if(!1===this.postProvider().wrapAroundFlares?.())return[];const e=d.height().toNumeric(this.unit())/2,t=d.thickness().toNumeric(this.unit()),r=this.railZLevels().map((t=>this.edge().snapshot().addZ(t+e))),n=this._canPlaceWrapAroundFlareAtBegin(),s=this._canPlaceWrapAroundFlareAtEnd(),o=this.edge(),a=o.normal(),l=[];return r.forEach((e=>{if(n){const r=e.begin().add(a.multipliedBy(t)),n=i.makeRelativeTo(r,o.begin()),s=this._makeWrapAroundFlare(n,e,!1);l.push(s)}if(s){const r=e.end().add(a.multipliedBy(t)),n=i.makeRelativeTo(r,o.end()),s=this._makeWrapAroundFlare(n,e,!0);l.push(s)}})),l}_canPlaceWrapAroundFlareAtBegin(){const e=this.sectionConnectedToBegin();return!(e&&!e.isUnderMinimumLengthToHaveRail())&&this._canPlaceWrapAroundFlareAt(this.edge().begin())}_canPlaceWrapAroundFlareAtEnd(){const e=this.sectionConnectedToEnd();return!(e&&!e.isUnderMinimumLengthToHaveRail())&&this._canPlaceWrapAroundFlareAt(this.edge().end())}_canPlaceWrapAroundFlareAt(e){if(this.isInline())return!1;const t=this.gateConnectedTo(e),r=this._canPlaceOpeningFlare(e);return!t&&r}_canPlaceOpeningFlare(e){const t=this.openingConnectedTo(e);if(!t)return!0;const r=n.largerEq(t.width(),this.minOpeningWidthForFlares()),i=!this.isUnderMinimumLengthToHaveRail();return r&&i}_makeWrapAroundFlare(e,t,r){const n=r?t.direction():t.direction().negated(),i=new p(e,n,r);return i.setComponentOf(this),i}resetWrapAroundFlares(){this._wrapAroundFlares=void 0}railMounts(){return this.panels().flatMap((e=>e.railMounts()))}resetComponents(){super.resetComponents(),this.resetWrapAroundFlares(),this._panels=void 0,this._sectionConnectedToBegin=void 0,this._sectionConnectedToEnd=void 0}blocks(){return[]}components(){return[...super.components(),...this.wrapAroundFlares(),...this.railMounts()]}boundingBox(){const e=this.isUnderMinimumLengthToHaveRail()?this.railingPosts():this.rails();if(0===e.length)return this.edge().begin().expandedBy(1);return e.map((e=>e.boundingBox())).reduce(((e,t)=>e.merge(t)))}boundingCube(){const e=this.railingPosts().map((e=>e.boundingCube())),t=this.edge().center();return 0===e.length?s.extrudeRectangleFromTo(this.boundingBox(),t.z()+.5,t.z()-.5):e.reduce(((e,t)=>e.merge(t)))}contains(e,t){return this.boundingBox().contains(e,t)}defaultFigure(){const e=super.defaultFigure();if(!this.isUnderMinimumLengthToHaveRail()){const t=new m(this);e.setHandles([t])}return e}handleEdge(){const e=this.rails().first().edge().begin(),t=this.rails().last().edge().end(),r=this.edge().normal().negated(),n=this.railWidthNumeric()/2,i=e.add(r.multipliedBy(n)),s=t.add(r.multipliedBy(n));return i.to(s)}_isSelectable(){return!1}defaultAnnotations(){return[this._fullLengthAnnotation(),...this._railLengthAnnotations()].filter((e=>e))}_railLengthAnnotations(){return this.panels().map((e=>e.railEdge())).map((e=>{const t=new v(e,v.defaultDistance,this.unit(),{fractionDenominator:8});return t.setLayer(w.RAIL_LENGTH_ANNOTATIONS),t}))}_fullLengthAnnotation(){if(0===this.panels().length)return;const e=this._sectionLengthAnnotationDistance(),t=new v(this.edge(),e,this.unit(),{fractionDenominator:8});return t.setLayer(w.SECTION_LENGTH_ANNOTATIONS),t}_sectionLengthAnnotationDistance(){return this.project().sectionLengthAnnotationDistance()}resetAnnotations(){this._annotations=void 0}isDeleteable(){return!1}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_railMountOptions","_useLiftOutRails","_useInlineMount","_panels","_wrapAroundFlares"]}}l(OmegaGuardrailSection,_),e.exports=OmegaGuardrailSection},97368:(e,t,r)=>{const n=r(63768),i=r(46103),s=r(62623),o=r(28831);e.exports=class OmegaInlineBracket extends s{static offset(){return n.subtract(n.divide(o.width(),-2),n.unit(0,"in"))}static railInset(){return n.unit(0,"in")}static railOffset(){return n.subtract(n.divide(o.width(),-2),n.unit(.25,"in"))}_modelIdentifier(){return`omega-inline-bracket${this._flippedSuffix()}`}materialSpecifier(){return new i("[NOT STOCK] Inline Bracket",{fillStyle:this.fillStyle(),strokeStyle:this.strokeStyle()})}}},28772:(e,t,r)=>{const n=r(63768),{three:i}=r(37732),s=r(62623),o=r(74666);e.exports=class OmegaInsideCornerBracket extends s{railColor(){return this.componentOf().postColor()}_modelIdentifier(){return"omega-inside-corner-bracket"}primaryRailOffset(){return n.unit(0,"in")}secondaryRailOffset(){return n.unit(2,"in")}materialSpecifier(){return o[`${this.skuColor()}-795A-12`]}length(){return n.unit(12,"in")}width(){return n.unit(8,"in")}thickness(){return n.unit(1/8,"in")}rotation(){const e=(new i.Quaternion).setFromUnitVectors(new i.Vector3(0,0,-1),new i.Vector3(1,0)),t=(new i.Quaternion).setFromUnitVectors(new i.Vector3(1,0),this.direction().toThreeJS());return e.premultiply(t)}}},46233:(e,t,r)=>{const n=r(63816);e.exports=class OmegaLiftOutDoubleRailAssembly extends n{_modelIdentifier(){return`omega-lift-out-double-rail-assembly${this._flippedSuffix()}`}quantity(){return 1}}},63816:(e,t,r)=>{const n=r(63768),i=r(62623),s=r(48028),o=r(74666);e.exports=class OmegaLiftOutRailAssembly extends i{static offset(){return n.unit(-.27,"in")}static railInset(){return n.unit(.5,"in")}static railOffset(){return n.add(n.divide(s.postWidth(),-2),n.unit(.25,"in"))}_modelIdentifier(){return`omega-lift-out-rail-assembly${this._flippedSuffix()}`}quantity(){return.5}materialSpecifier(){return o[`${this.skuColor()}-795A-11`]}}},44246:(e,t,r)=>{const n=r(84425),i=r(63768),{EditableProperty:s}=r(7340),{extend:o}=r(50988),a=r(43812),l=r(28831),c=r(37264),u=r(46103),d=r(6706),h=r(80317),p=r(74666);class OmegaProject extends a{defaultDisplayProperties(){return[...super.defaultDisplayProperties(),new s(this,"Max Guardrail Length",{type:"unit",defaultUnit:"in"})]}pricingNoteStrings(){return[...this.collectionPricingNoteStrings(),this.hasUnknownMaterials()?"Some parts are not supported":void 0].filter((e=>e))}collectionPricingNoteStrings(){return this.collectionCombinedPricingNotes().map((e=>e.combinedMessage()))}collectionCombinedPricingNotes(){const e=this.railingCollections().flatMap((e=>e.combinedPricingNotes())).reduce(((e,t)=>{const r=t.message(),n=t.sourceName(),i=`${n}${r}`;return e[i]||(e[i]=new c(r,n)),e[i].incrementCount(t.count()),e}),{});return Object.values(e)}hasUnknownMaterials(){const e=this._materialLineItems().map((e=>e.specifier())),t=u.unknownMaterialIdentifier;return e.some((e=>e.details().pricingIdentifier===t))}pricingNoteLabel(){return"Warning"}_materialLineItems(){return this.allLocatedMaterials().flatMap((e=>e.materialLineItems()))}maxGuardrailLength(){return this._maxGuardrailLength||(this._maxGuardrailLength=this._absoluteMaxGuardrailLength()),this._maxGuardrailLength}_absoluteMaxGuardrailLength(){return i.unit(10,"ft")}setMaxGuardrailLength(e){const t=l.incrementSize().toNumeric(this.unit()).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES),r=e.toNumeric(this.unit()).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES),n=Math.floor(r/t)*t;this._maxGuardrailLength=i.unit(n,this.unit()),this.railingCollections().forEach((e=>{e.resetSections()}))}validateMaxGuardrailLength(e,t){if(e)return i.smaller(t,this.minGuardrailLength())?`Cannot be less than ${this.minGuardrailLength()}`:i.larger(t,this._absoluteMaxGuardrailLength())?`Cannot be greater than ${this._absoluteMaxGuardrailLength()}`:void 0}minGuardrailLength(){return l.minLength()}pdfRoleExclusions(){return[h.BACKGROUND]}logo(){return"omega-is-gradient-logo.png"}watermarkLogo(){return"omega-is-watermark.png"}watermarkAlpha(){return.02}pdfDocumentClass(){return n}sectionLengthAnnotationDistance(){return this._sectionLengthAnnotationDistance??=55}setSectionLengthAnnotationDistance(e){this._sectionLengthAnnotationDistance=e}resetSectionLengthAnnotationDistance(){this._sectionLengthAnnotationDistance=void 0}resetAnnotations(){this.railingCollections().forEach((e=>e.resetAnnotations()))}get materials(){return p}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_sectionLengthAnnotationDistance"]}}o(OmegaProject,d),e.exports=OmegaProject},28831:(e,t,r)=>{const n=r(63768),{Polygon:i,$P:s}=r(62048),o=r(2198),a=r(59663),l=r(74666);e.exports=class OmegaRail extends o{static height(){return n.unit(12.2,"in")}static width(){return n.unit(1.65,"in")}static thickness(){return n.unit(.127,"in")}static minLength(){return n.unit(24,"in")}static incrementSize(){return n.unit(1,"in")}height(){return this.constructor.height()}width(){return this.constructor.width()}thickness(){return this.constructor.thickness()}railColor(){return this.componentOf().railColor()}materialName(){return this.railColor().materialName()}fillStyle(){return this.railColor().fillStyle()}strokeStyle(){return this.railColor().strokeStyle()}skuColor(){return this.railColor().details().skuColor}materialNames(){return[this.materialName()]}crossSection(){const e=this.width().toNumeric(this.unit())/2,t=this.thickness().toNumeric(this.unit()),r=this.height().toNumeric(this.unit())/2,n=[s(e,-r),s(e,1.51-r),s(-e,2.53-r),s(-e,3.55-r),s(e,4.57-r),s(e,r-4.57),s(-e,r-3.55),s(-e,r-2.53),s(e,r-1.51),s(e,r)];return new i([...n,...n.slice().reverse().map((e=>e.movedBy(-t,0)))])}defaultFigure(){return new a(this)}materialSpecifier(){const e=n.unit(this.length(),this.unit()),t=n.max(this.constructor.minLength(),e),r=this._railSKU(t);return l[r]}_railSKU(e){const t=e.toNumeric("in").roundedTo(1),r=Math.floor(t/12).toString().padStart(2,"0"),n=t%12==0,i=n?"795G":"795U",s=n?"":`-${t}`;return`${this.railColor().details().skuColor}-${i}-${r}${s}`}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_priceOptions"]}}},28096:(e,t,r)=>{const n=r(63768),i=r(28831);e.exports=class OmegaRailBaseMountStrategy{static strategyInstance=void 0;static minimumLengthForSection(e){if(!this.strategyInstance)throw new Error("static strategyInstance is undefined");const t=e.beginInset(this.strategyInstance),r=e.endInset(this.strategyInstance),s=i.minLength();return n.add(t,s,r).toNumeric(e.unit())}}},62623:(e,t,r)=>{const{three:n}=r(37732),{MissingOverride:i}=r(50988),s=r(41908),o=r(6556),a=r(46490);e.exports=class OmegaRailComponent extends s{constructor(e,t){super(),this._locator=e,this._direction=t}locator(){return this._locator}direction(){return this._direction}referencePoint(){return this.locator()}materialName(){return this.railColor().materialName()}skuColor(){return this.railColor().details().skuColor}fillStyle(){return this.railColor().fillStyle()}strokeStyle(){return this.railColor().strokeStyle()}quantity(){return 1}railColor(){const e=this.componentOf().railColor(),t=this.supportedColors();return!t||t.includes(e)?e:t.first()}supportedColors(){}rotation(){return(new n.Quaternion).setFromUnitVectors(new n.Vector3(0,-1),this.direction().toThreeJS())}flipped(){if(!this._flipped){const e=this.componentOf().edge();this._flipped=this.locator().distanceTo(e.begin())<this.locator().distanceTo(e.end())}return this._flipped}_flippedSuffix(){return this.flipped()?"-flipped":""}materialIdentifiers(){return[this.materialName()]}_modelIdentifier(){throw new i(this,"_modelIdentifier")}materialSpecifier(){throw new i(this,"materialSpecifier")}geometry(){return this._geometry||(this._geometry=this.defaultGeometry()),this._geometry}defaultGeometry(){return this.locator().expandedByRadius(1.25).toPolygon()}defaultFigure(){return new a(this)}materialLineItems(){return[new o(this.quantity(),this.materialSpecifier())]}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_flipped"]}}},25072:(e,t,r)=>{const n=r(63768),i=r(24335),s=r(97368),o=r(48028),a=r(28096),l=n.divide(o.postWidth(),2);class OmegaRailInlineMountStrategy extends a{static strategyInstance=new OmegaRailInlineMountStrategy;_layoutInsetForTerminalPost(e,t){const r=e.previousSection(),i=e.nextSection();if(i&&r){const e=r.edge().direction().normalized(),t=i.edge().direction().normalized();if(e.equals(t))return l}if(!e.isAtInsideCorner())return o.postWidth();const s=i===t;return r===t&&i.isInline()||s&&r.isInline()?n.unit(0,"in"):o.postWidth()}_railMountInset(){return this.railMountClass().railInset()}railInsetForTerminalPost(e,t,r){return n.add(this._layoutInsetForTerminalPost(e,t),this._railMountInset())}bracketClearanceInset(e){return n.unit(0,"in")}railInsetForInlineTerminalPost(e){return n.add(o.postWidth(),this.railMountClass().railInset())}railInsetForIntermediatePost(){return n.add(l,this._railMountInset())}railOffsetNumeric(e){return this.railMountClass().railOffset().toNumeric(e)}railMountClass(e=[]){return 2===e.length?i:s}isInline(){return!0}}e.exports=OmegaRailInlineMountStrategy},56267:(e,t,r)=>{const{RailLengthHelper:n}=r(8423),i=r(63768),s=r(28831);e.exports=class OmegaRailLengthHelper extends n{get railLengthPrecision(){return 4}constructor(e,t,r="in",n=0,i=0){super(e,t,r),this._postPaddingNumeric=n,this._bracketPaddingNumeric=i}minLengthNumeric(){const e=i.add(this.minLength(),this.halfPostPadding(),this.bracketPadding());return this._toNumeric(e)}maxLengthTerminal(){return i.add(this.maxLength(),this.halfPostPadding(),this.bracketPadding())}maxLengthInterior(){return i.add(this.maxLength(),this.postPadding(),this.doubleBracketPadding())}postPadding(){return i.unit(this.postPaddingNumeric(),this.unit())}halfPostPadding(){return i.divide(this.postPadding(),2)}postPaddingNumeric(){return this._postPaddingNumeric}bracketPadding(){return i.unit(this.bracketPaddingNumeric(),this.unit())}bracketPaddingNumeric(){return this._bracketPaddingNumeric}doubleBracketPadding(){return i.multiply(this.bracketPadding(),2)}_isTwoRailsLong(e){const t=e+this._toNumeric(this.postPadding());return super._isTwoRailsLong(t)}_maxLengthPrimaryRailCount(e,t){const r=e+this.postPaddingNumeric();return this._railCountFor(r,t,2)-2}_symmetricTotalLengthForRailCount(e){return e+this._toNumeric(i.add(this.postPadding(),this.doubleBracketPadding()))}_interiorRailLengthChunked(e,t){const r=this.postPadding(),n=i.multiply(this.bracketPadding(),2),s=i.add(r,n).toNumeric("ft");return Math.ceil(e/t)+s}_twoRailsMaxLength(){return super._twoRailsMaxLength()+this.postPaddingNumeric()}_lengthIncrementNumeric(){return this._toNumeric(s.incrementSize())}_twoLengthsSymmetric(e){const t=e.roundedTo(this.railLengthPrecision),r=t/2,n=this._lengthIncrementNumeric(),i=this.postPaddingNumeric()/2,s=this.bracketPaddingNumeric(),o=Math.ceil(r/n)*n,a=((o-s-i)%n).isNearTo(s)?o-s:o;return[a,t-a]}}},54758:(e,t,r)=>{const n=r(46233),i=r(63816),s=r(25072);class OmegaRailLiftOutMountStrategy extends s{static strategyInstance=new OmegaRailLiftOutMountStrategy;railMountClass(e=[]){return 2===e.length?n:i}}e.exports=OmegaRailLiftOutMountStrategy},281:(e,t,r)=>{const{Composite3DFigure:n}=r(37732),{RelativeLocator:i}=r(62048),s=r(83102),o=r(48909),a=r(28831);e.exports=class OmegaRailPanel extends s{constructor(e,t,r){super(),this._edge=e,this._railZLevels=t,this._railMountProvider=r}edge(){return this._edge}railZLevels(){return this._railZLevels}railMountProvider(){return this._railMountProvider}geometry(){return this.edge()}railColor(){return this.componentOf().railColor()}rails(){return this._rails||(this._rails=this.defaultRails()),this._rails}railEdge(){return this.edge()}defaultRails(){const e=a.height().toNumeric(this.unit())/2,t=this.railEdge(),r=[];return this.railZLevels().forEach((n=>{const i=t.addZ(n+e),s=new a(i);s.setComponentOf(this),r.push(s)})),r}_halfRailWidth(){return this.__halfRailWidth||(this.__halfRailWidth=a.width().toNumeric(this.unit())/2),this.__halfRailWidth}railMountClass(){return this.railMountProvider()?.railMountClass(this.railZLevels())}railMounts(){return this._railMounts||(this._railMounts=this.defaultRailMounts()),this._railMounts}defaultRailMounts(){if(!this.railMountClass())return[];const e=this.edge().direction(),t=this.edge().normal(),r=this.railZLevels().first(),n=this.railMountClass().railInset().toNumeric(this.unit()),s=this.edge().direction().multipliedBy(n),o=this.edge().begin().addZ(r).add(s.negated()),a=this.edge().end().addZ(r).add(s),l=this.railMountClass().offset().toNumeric(this.unit()),c=t.multipliedBy(l),u=o.add(c),d=a.add(c),h=i.makeRelativeTo(u,this.edge().center()),p=i.makeRelativeTo(d,this.edge().center());return[this._buildRailMount(h,e.negated()),this._buildRailMount(p,e)]}_buildRailMount(e,t){const r=new(this.railMountClass())(e,t);return r.setComponentOf(this),r}materialLineItems(){return this.components().flatMap((e=>e.materialLineItems()))}components(){return[...this.rails(),...this.railMounts()]}defaultFigure(){const e=o.withModel(this);return e.setHandles([]),e}threeFigure(){return n.withModel(this)}async load(){return Promise.all(this.components().map((e=>e.load?.())))}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_rails","_railMounts","__halfRailWidth"]}}},85298:(e,t,r)=>{const n=r(63768),i=r(48028),s=r(28831),o=r(28096),a=n.divide(i.postWidth(),2);class OmegaRailSurfaceMountStrategy extends o{static strategyInstance=new OmegaRailSurfaceMountStrategy;railInsetForTerminalPost(e,t,r){e.ensureCurrentSections();const n=this.bracketClearanceInset(r),i=e.brackets()?.first();return i?t===e.previousSection()?i?.primaryRailOffset():i?.secondaryRailOffset():n}bracketClearanceInset(e){return e?a:n.unit(.5,"in")}railInsetForInlineTerminalPost(e){return this.bracketClearanceInset(e)}railInsetForIntermediatePost(){return n.unit(0,"in")}railOffsetNumeric(e){return n.divide(s.width(),2).toNumeric(e)}railMountClass(e){}isInline(){return!1}}e.exports=OmegaRailSurfaceMountStrategy},17163:(e,t,r)=>{const n=r(63768),{EditableProperty:i,CompositeEditableProperty:s,ReadableProperty:o}=r(7340),{extend:a}=r(50988),l=r(97477),c=r(48028),u=r(32487),d=r(56267),h=r(79374),p=r(37264),m=r(97209),f=r(56780);class OmegaRailingCollection extends l{static displayName(){return"Guard Rail"}defaultPostDescriptorSource(){return c}sectionClass(){return u}runClass(){return h}angleAnnotationsEnabled(){return this.componentOf().angleAnnotationsEnabled()}openingWidthAnnotationsEnabled(){return this.componentOf().openingWidthAnnotationsEnabled()}railLengthAnnotationsEnabled(){return this.componentOf().railLengthAnnotationsEnabled()}postDescriptorValid(e){return this._postValidForGates(e)}_postValidForGates(e){const t=e.postHeight();return this.gates().every((e=>n.smallerEq(e.constructor.minimumPostHeight(),t)))}postDescriptorOptions(){return this.postDescriptorSource().descriptors().map((e=>({label:e.description(),value:e,disabled:!this._postValidForGates(e)})))}cornerCaps(){return void 0===this._cornerCaps&&(this._cornerCaps=!0),this._cornerCaps}setCornerCaps(e){this._cornerCaps=e,this.resetSections()}toggleCornerCaps(){this.setCornerCaps(!this.cornerCaps())}wrapAroundFlares(){return void 0===this._wrapAroundFlares&&(this._wrapAroundFlares=!1),this._wrapAroundFlares}setWrapAroundFlares(e){this._wrapAroundFlares=e,this.resetSections()}toggleWrapAroundFlares(){this.setWrapAroundFlares(!this.wrapAroundFlares())}maxRailLength(){return this.componentOf().maxGuardrailLength()}minRailLength(){return this.componentOf().minGuardrailLength()}displayedAnnotations(){return this.componentOf().displayedAnnotations()}railColor(){return this._railColor||(this._railColor=this.railColorOptions().first().value),this._railColor}setRailColor(e){this._railColor=e,this.resetSections(),this.railingRuns().forEach((e=>{e.resetOpeningDisplayProperties(),e.resetOpeningGates()}))}railColorOptions(){return[f.yellow,f.brightYellow]}railLengthMode(){return this._railLengthMode||(this._railLengthMode=d.mode.AUTO),this._railLengthMode}setRailLengthMode(e){this._railLengthMode=e,this.resetSections()}railLengthModeOptions(){return[{label:"Auto-select",value:d.mode.AUTO},{label:"Symmetric",value:d.mode.SYMMETRIC},{label:"Max length",value:d.mode.MAX_LENGTH}]}resetRailingRunAnnotations(){this.railingRuns().forEach((e=>e.resetAnnotations?.()))}defaultDisplayProperties(){const e=s.overlappingProperties(this.sections()).filter((e=>"Length"!==e.name()));return[new i(this,"Post Descriptor",{type:"select",choices:this.postDescriptorOptions(),label:"Post Type"}),new i(this,"Rail Length Mode",{type:"radio",choices:this.railLengthModeOptions()}),new i(this,"Corner Caps",{type:"boolean"}),new i(this,"Wrap Around Flares",{type:"boolean"}),new i(this,"Rail Color",{type:"select",choices:this.railColorOptions(),label:"Color"}),new i(this,"Flip Rails",{type:"action",perform:()=>this.flipRailings()}),...e,...this.pricingNotes()]}pricingNotes(){const e=this.combinedPricingNotes().map((e=>e.combinedMessage()));if(0===e.length)return[];const t=this.pricingNoteLabel();return[new o(this,t,{type:"notice",get:()=>e,restorable:!1})]}combinedPricingNotes(){return[...this.combinedPricingNotesFor(this.sections(),"section"),...this.combinedPricingNotesFor(this.openings(),"gate")]}combinedPricingNotesFor(e,t){const r=e.flatMap((e=>e.pricingNoteMessages())).reduce(((e,r)=>(e[r]||(e[r]=new p(r,t)),e[r].incrementCount(),e)),{});return Object.values(r)}pricingNoteLabel(){return this.componentOf().pricingNoteLabel()}runAdded(e){super.runAdded(e),e.directionFlipped()!==this.directionFlipped()&&e.flipDirection(),this.sections().forEach((e=>e.resetWrapAroundFlares())),this.resetDisplayProperties()}flipRailings(){super.flipRailings();const e=this.minRailLength().toNumeric(this.unit());this.sections().flatMap((e=>e.rails())).some((t=>t.length()<e))&&super.flipRailings()}existingPostAtBegin(e){const t=e.edge().begin(),r=this.previousSectionFor(e),n=r?.endPost();if(n)return n.geometry().containsPoint(t,.01)?n:void 0}existingPostAtEnd(e){const t=e.edge().end(),r=this.nextSectionFor(e),n=r?.beginPost();if(n)return n.geometry().containsPoint(t,.01)?n:void 0}}a(OmegaRailingCollection,m),e.exports=OmegaRailingCollection},46975:(e,t,r)=>{const{ReadableProperty:n}=r(7340),i=r(14025),s=r(44476),o=r(81362),a=r(28021);e.exports=class OmegaRailingOpening extends i{pricingNotes(){const e=this.postProvider().pricingNoteLabel(),t=this.pricingNoteMessages();return 0===t.length?[]:[new n(this,e,{type:"notice",get:()=>t,restorable:!1})]}pricingNoteMessages(){return[this.hasInvalidColors()?"Some parts don't support the selected color":void 0,this.gate()?.isUnderMinimumWidth?.()?"Rail is too short":void 0].filter((e=>e))}hasInvalidColors(){const e=this.gate();if(!e)return!1;if(!e.supportedColors())return!1;const t=e.railColor();return!e.supportedColors().find((e=>e.equals(t)))}defaultAnnotations(){const e=this.railingRun().directionFlipped()?this.edge().reversed():this.edge(),t=new s(e,void 0,this.unit());return t.setLayer(a.OPENING_WIDTH_ANNOTATIONS),[t]}gateTypes(){return o}beginPostFaceLocator(){return this._postFaceLocator(this.postBefore())}endPostFaceLocator(){return this._postFaceLocator(this.postAfter(),-1)}interiorEdge(){return this.beginPostFaceLocator().to(this.endPostFaceLocator())}_postFaceLocator(e,t=1){const r=e.width().toNumeric(e.unit())/2*t,n=this.edge().direction().multipliedBy(r);return e.locator().add(n).relatedTo(this.edge().center())}}},79374:(e,t,r)=>{const n=r(63768),{Angle:i,FixedEdgeLocator:s}=r(62048),{$P:o}=r(62048),{extend:a}=r(50988),l=r(33496),c=r(48028),u=r(30691),d=r(39463),h=r(71096),p=r(28021);class OmegaRailingRun extends l{defaultAnnotations(){return[this._angleAnnotation()].filter((e=>e))}_angleAnnotation(){const e=this.previousRun();if(!e)return;const t=this.edge().xy(),r=e.edge().xy(),n=new i(t.begin(),t.end(),r.begin());if(180===n.smallestDeltaDegrees())return;const s=new d(n,36,2);return s.setLayer(p.ANGLE_ANNOTATIONS),s}_sectionsHaveBeenGenerated(){this.sections().forEach((e=>e.updateRailMountOptions()))}moveOpening(e,t,r){const n=e.edge(),i=n.movedBy(t,r),s=this._snappableNearestValidOpeningEdge(i,e),o=this._isSpaceToMoveOpening(s,e);if(!s||!o||s.equals(n,.001))return!1;const a=s.center().subtract(n.center());return e.moveBy(a.x(),a.y()),this.resetSections(),this.nextRun()?.sections().first().resetComponents(),this.previousRun()?.sections().last().resetComponents(),!0}postWidth(){return c.postWidth().toNumeric(this.unit())}_snappableNearestValidOpeningEdge(e,t){const r=this._nearestValidOpeningEdge(e,t),n=this._openingEdgeSnappedToRunEndpoint(e);if(n)return n;const i=this._openingEdgeSnappedToOtherOpening(e,t);return i||r}_openingEdgeSnappedToRunEndpoint(e){const t=u.pointIsBeforeEdge(this.edge(),e.begin()),r=u.pointIsAfterEdge(this.edge(),e.end());if(!t&&!r)return;const n=t?1:-1;return this._snappedEdge(e,n)}_openingEdgeSnappedToOtherOpening(e,t){const r=e.begin(),n=e.end(),i=this.openings().filter((e=>e!==t)).find((e=>{const t=e.edge(),i=t.isLocatorBetweenEndpoints(r)||t.containsPoint(r),s=t.isLocatorBetweenEndpoints(n)||t.containsPoint(n);return i||s}));if(!i)return;const s=i.edge(),o=r.distanceTo(s.end())<n.distanceTo(s.begin()),a=this.edge().begin().distanceTo(s.end()),l=this.edge().end().distanceTo(s.begin()),c=o?a:l,u=o?1:-1;return this._snappedEdge(e,u,c)}_snappedEdge(e,t,r=0){const n=this.postWidth()+r,i=e.length()+n,o=new s(this.edge(),n*t),a=new s(this.edge(),i*t);return 1===t?o.to(a):a.to(o)}_isSpaceToMoveOpening(e,t){if(!e)return!1;const r=e.stretchedBy(2*this.postWidth()),n=this._findPlaceableSectionsFor(t),i=n.find((e=>e.edge().containsEdge(r)));if(!i)return!1;const s=i.edge(),o=s.length();if(o===r.length())return!0;const a=n.first().minLength().toNumeric(this.unit()),l=o>=e.stretchedBy(a+this.postWidth()).length(),c=e.begin().distanceTo(s.begin())<=this.postWidth(),u=e.end().distanceTo(s.end())<=this.postWidth();if(l&&c!==u)return!0;return o>=e.stretchedBy(2*a).length()}endpointMovedTo(e,t,{constrainToValidPosition:r=!0,constrainToLengthIncrements:n=!0}={}){const i=this.edge().direction(),s=e.equals(this.edge().begin()),o=this._endpointSnapLocator(t,s);if(!o)return super.endpointMovedTo(e,t,{constrainToValidPosition:r,constrainToLengthIncrements:n});const a=i.multipliedBy(this.postWidth()),l=s?a.negated():a;return o.add(l)}_endpointSnapLocator(e,t){const r=this.sections();if(r.length<=1)return;const n=[r.last().edge().begin(),r.first().edge().end()];t!==this.directionFlipped()&&n.reverse();const i=n.first(),s=[e,i];t&&s.reverse();const[o,a]=s,l=this.edge().direction();return o.to(a).direction().dot(l)>0?i:void 0}vertices(){const e=super.vertices();if(0===this.sections().length)return e;const t=e.flatMap((e=>[e.x(),e.y()])),r=t.includes(1/0)||t.includes(-1/0),n=this.sections().first(),i=this.sections().last(),s=n.isUnderMinimumLengthToHaveRail()||i.isUnderMinimumLengthToHaveRail();if(!r&&!s)return e;const o=this.edge().normal().multipliedBy(-this.postWidth()),a=this.edge().begin().add(o).to(this.edge().end().add(o));return[this.edge().begin(),this.edge().end(),a.end(),a.begin()]}moveBy(e,t){const r=this.edge().normal(),n=r.multipliedBy(o(e,t).dot(r));if(n.rho().isNearTo(0,.001))return!1;const i=[this.previousRun(),this.nextRun()].filter((e=>e)),s=i.every((e=>e.edge().isPerpendicularTo(this.edge(),.001)));if(i.length>1&&!s)return!1;const a=this._smallestMoveDelta(i,n);return!a.rho().isNearTo(0,.001)&&(i.forEach((e=>{const t=e.sharedEndpoint(this);e.moveEndpointTo(t,t.add(a),{constrainToValidPosition:!1})})),this.translateBy(a.x(),a.y()))}deleteSection(e){}postRestorationAction(){this.restoreSectionProperties(this.sections())}beforeSerialize(){this.saveSectionProperties()}sectionLengthAdjusterIncrement(){return n.unit(.5,"in")}}a(OmegaRailingRun,h),e.exports=OmegaRailingRun},55564:(e,t,r)=>{const n=r(32471),i=r(74666);e.exports=class OmegaRemovableDoubleRailHinge extends n{_modelIdentifier(){return"omega-removable-double-rail-hinge"}materialSpecifier(){return i[`${this.skuColor()}-795A-14`]}}},32471:(e,t,r)=>{const n=r(63768),i=r(62623),s=r(28831),o=r(74666);e.exports=class OmegaRemovableRailHinge extends i{static offset(){return n.add(n.divide(s.width(),-2),n.unit(-.1,"in"))}static railInset(){return n.unit(1,"in")}static railOffset(){return n.add(n.divide(s.width(),2),n.unit(.25,"in"))}quantity(){return.5}_modelIdentifier(){return"omega-removable-rail-hinge"}materialSpecifier(){return o[`${this.skuColor()}-795A-13`]}}},97108:(e,t,r)=>{const{three:n}=r(37732),i=r(41908),s=r(6556),o=r(46490),a=r(74666);e.exports=class OmegaWrapAroundFlare extends i{constructor(e,t,r){super(),this._locator=e,this._direction=t,this._flipped=r}locator(){return this._locator}direction(){return this._direction}flipped(){return this._flipped}referencePoint(){return this.locator()}rotation(){return(new n.Quaternion).setFromUnitVectors(new n.Vector3(0,-1),this.direction().toThreeJS())}geometry(){return this._geometry||(this._geometry=this.defaultGeometry()),this._geometry}defaultGeometry(){return this.locator().expandedByRadius(5).toPolygon()}railColor(){return this.componentOf().railColor()}materialName(){return this.railColor().materialName()}fillStyle(){return this.railColor().fillStyle()}strokeStyle(){return this.railColor().strokeStyle()}skuColor(){return this.railColor().details().skuColor}materialIdentifiers(){return[this.materialName()]}_modelIdentifier(){return`omega-wrap-around-flare${this.flipped()?"-flipped":""}`}price(){return 61}defaultFigure(){return new o(this)}materialSpecifier(){return a[`${this.skuColor()}-795M-79`]}materialLineItems(){return[new s(1,this.materialSpecifier())]}}},17222:(e,t,r)=>{const{ConstructionComponentHandle:n}=r(93613),{Polygon:i}=r(62048);e.exports=class OmegaSectionHandle extends n{selectableComponent(){return this.object()}drawSelected(e,t){this._drawHandle(e,this._selectedProperties(),t)}_drawHandle(e,t,r){const n=this.object().handleEdge(),s=this._shiftedEdge(n),o=new i([n.begin(),n.end(),s.end(),s.begin()]);e.updateProperties(t),e._drawPolygon(o)}_shiftedEdge(e){const t=e.normal(),r=e.begin(),n=e.end(),i=this.object().railWidthNumeric(),s=r.add(t.multipliedBy(i)),o=n.add(t.multipliedBy(i));return s.to(o)}moveFromTo(e,t,r,n){}validWhen(){return this.constructor.VALID_FOR_SELECTED}_selectedProperties(){return{fillStyle:"rgba(31, 160, 246, 0.3)",strokeStyle:"#1FA0F6",_pixelLineWidth:3}}}},82388:(e,t,r)=>{const{NullDrawable:n}=r(7340),i=r(62623);e.exports=class Omega3DRailComponent extends i{constructor(e,t,r){super(e,t),this.__modelIdentifier=r}_modelIdentifier(){return this.__modelIdentifier}defaultFigure(){return new n(this)}}},36843:(e,t,r)=>{const n=r(24740);e.exports=class OmegaDoubleSelfClosingGate extends n{showFlipGateProperty(){return!1}_quantity(){return 2}_armBaseEdges(){return[this.edge(),this.edge().reversed()]}}},28368:(e,t,r)=>{const n=r(63768),{CompositeFigure:i,EditableProperty:s}=r(7340),{Composite3DFigure:o}=r(37732),a=r(66135);e.exports=class OmegaDoubleSwingGate extends a{requiredOpeningWidth(e=this.armWidth()){return n.multiply(n.add(e,this.paddingNeeded()),2)}components(){return this._components||(this._components=this._defaultComponents()),this._components}_defaultComponents(){const e=a.makeGate(this.opening()),t=a.makeGate(this.opening());return t.flip(),[e,t]}displayProperties(){return[new s(this,"Arm Width",{type:"select",choices:this.armWidthOptions()})]}setArmWidth(e){super.setArmWidth(e),this.components().forEach((t=>t.setArmWidth(e)))}reset(){super.reset(),this.components().forEach((e=>e.reset()))}defaultFigure(){const e=i.withModel(this);return e.setHandles([]),e}threeFigure(){return o.withModel(this)}}},1519:(e,t,r)=>{const n=r(63768),i=r(35961);e.exports=class OmegaGate extends i{railColor(){return this.componentOf().postProvider().railColor()}fillStyle(){return this.railColor().fillStyle()}strokeStyle(){return this.railColor().strokeStyle()}skuColor(){return this.railColor().details().skuColor}materialNames(){return[this.railColor().materialName()]}static minimumPostHeight(){return n.unit(42,"in")}thickness(){return n.unit(1.5,"in")}_edgeBeginLocator(){return this.flipped()?this.opening().endPostFaceLocator():this.opening().beginPostFaceLocator()}paddingNeeded(){return n.unit(6,"in")}postDescriptor(){return this.railingRun().postProvider().postDescriptor()}railZLevels(){return this.postDescriptor().railAttachmentLevels().map((e=>-e.toNumeric(this.unit())))}railingRun(){return this.opening().railingRun()}supportedColors(){}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_priceOptions"]}}},81362:(e,t,r)=>{const{GateType:n}=r(8423),i=r(28368),s=r(64034),o=r(72840),a=r(66135),l=r(24740),c=r(36843);e.exports={DEFAULT:new n("None",void 0),SELF_CLOSING_GATE:new n("Self Closing Gate",l),DOUBLE_SELF_CLOSING_GATE:new n("Double Self Closing Gate",c),SWING_GATE:new n("Single Swing Gate",a),DOUBLE_SWING_GATE:new n("Double Swing Gate",i),REMOVABLE_RAIL:new n("Removable Rail",o),LIFT_OUT_RAIL:new n("Lift Out Rail",s)}},64034:(e,t,r)=>{const n=r(46233),i=r(63816),s=r(89007);e.exports=class OmegaLiftOutGate extends s{railMountClass(){return 1===this.railZLevels().length?i:n}_baseRailOffset(){return this._halfRailWidth()}}},89007:(e,t,r)=>{const n=r(63768),{RelativeLocator:i}=r(62048),{MissingOverride:s}=r(50988),o=r(281),a=r(28831),l=r(44476),c=r(29141),u=r(28021);e.exports=class OmegaRailGate extends c{static minimumPostHeight(){return n.unit(18,"in")}paddingNeeded(){const e=this.railMountClass().railInset();return n.multiply(e,2)}requiredOpeningWidth(e=this.width()){return n.max(e,this.minGateWidth())}reset(){super.reset(),this.resetComponents()}minGateWidth(){return n.add(a.minLength(),this.paddingNeeded())}absoluteMaxGateWidth(){return n.unit(10,"ft")}postDescriptor(){return this.railingRun().postProvider().postDescriptor()}railingRun(){return this.opening().railingRun()}railPanel(){return this._railPanel||(this._railPanel=this.defaultRailPanel()),this._railPanel}defaultRailPanel(){const e=this.baseRailEdge(),t=new o(e,this.railZLevels(),this);return t.setComponentOf(this),t}resetAnnotations(){this._annotations=void 0}defaultAnnotations(){const e=new l(this.railPanel().railEdge(),20,this.unit());return e.setLayer(u.RAIL_LENGTH_ANNOTATIONS),[e]}showFlipGateProperty(){return!1}baseRailEdge(){const e=this.edge().normal(),t=this.railMountClass().railInset().toNumeric(this.unit()),r=this.edge().direction().multipliedBy(t),n=this.edge().begin().add(r),s=this.edge().end().add(r.negated()),o=e.multipliedBy(this._railOffset()),a=n.add(o),l=s.add(o),c=i.makeRelativeTo(a,this.edge().center()),u=i.makeRelativeTo(l,this.edge().center());return c.to(u)}railZLevels(){return this.postDescriptor().railAttachmentLevels().map((e=>-e.toNumeric(this.unit())))}railMounts(){return this.railPanel().railMounts()}rails(){return this.railPanel().rails()}railMountClass(){throw new s(this,"railMountClass")}_defaultEdge(){const e=this.opening(),t=e.edge().begin(),r=e.edge().end(),n=i.makeRelativeTo(t,e.edge().center()),s=i.makeRelativeTo(r,e.edge().center()),o=n.to(s);return this.railingRun().directionFlipped()?o.reversed():o}_railOffset(){if(!this.__railOffset){const e=this.railMountClass().railOffset();this.__railOffset=e.toNumeric(this.unit())}return this.__railOffset}materialLineItems(){return this.components().flatMap((e=>e.materialLineItems()))}components(){return[this.railPanel()]}resetComponents(){this._railPanel=void 0}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_railPanel","__railOffset"]}}},72840:(e,t,r)=>{const n=r(32471),i=r(55564),s=r(89007);e.exports=class OmegaRemovableRailGate extends s{railMountClass(){return 1===this.railZLevels().length?n:i}}},24740:(e,t,r)=>{const n=r(63768),{EditableProperty:i}=r(7340),{Polygon:s}=r(62048),o=r(69435),a=r(30691),l=r(82388),c=r(29141),u=r(6556),d=r(59663);e.exports=class OmegaSelfClosingGate extends c{requiredOpeningWidth(e=this.armWidth()){const t=n.multiply(this._quantity(),e);return n.add(this._loopEndClearance(),t)}minArmWidth(){return n.unit(24,"in")}maxArmWidth(){return n.unit(44,"in")}minGateWidth(){return this.requiredOpeningWidth(this.minArmWidth())}absoluteMaxGateWidth(){return this.requiredOpeningWidth(this.maxArmWidth())}_loopEndClearance(){return n.unit(.5,"in")}_loopRadius(){return n.unit(4.5,"in")}_tubeRadius(){return n.unit(.65,"in")}_verticalSpan(){return n.unit(19.2,"in")}_tubeRelativeZLevels(){const e=this._verticalSpan().toNumeric(this.unit())/2;return[-e,e]}_zPosition(){const e=this._verticalSpan().toNumeric(this.unit());return this.railZLevels().first()+e/2}_endInset(e){return e.length()-this._loopRadius().toNumeric(this.unit())}_tubeInset(){return 5.5}_quantity(){return 1}armWidth(){return this._armWidth??=this._defaultArmWidth()}setArmWidth(e){this._armWidth=e,this.reset(),this.delegate()?.gateWidthChanged(this)}_defaultArmWidth(){const e=n.subtract(this.opening().width(),this._loopEndClearance()),t=n.divide(e,this._quantity()),r=this.maxArmWidth();if(n.larger(t,r))return r;const i=this.minArmWidth();return n.smaller(t,i)?i:t}validateArmWidth(e,t){if(!e)return;const r=this.requiredOpeningWidth(t);return n.smaller(t,this.minArmWidth())?`Cannot be less than ${this.minArmWidth()}`:n.larger(t,this.maxArmWidth())?`Cannot be greater than ${this.maxArmWidth()}`:n.larger(r,this.maxGateWidth())?`This rail cannot hold gates larger than ${this.maxGateWidth()}`:void 0}showWidthProperty(){return!1}displayProperties(){return[...super.displayProperties(),new i(this,"Arm Width",{type:"unit",defaultUnit:"in",ignoreIntermediateEdits:!0})]}_armBaseEdges(){return[this.edge()]}_armEdges(){const e=this._armBaseEdges(),t=this.armWidth().toNumeric(this.unit());return e.map((e=>{const r=e.direction().multipliedBy(t),n=e.begin().movedBy(r.x(),r.y(),r.z());return e.begin().to(n)}))}_armShape(e){const t=this._tubeRadius().toNumeric(this.unit()),r=e.normal().multipliedBy(t),n=e.movedBy(r.x(),r.y(),r.z()),i=e.movedBy(-r.x(),-r.y(),-r.z());return new s([...n.endpoints(),...i.endpoints().reverse()])}shapes2D(){return this._armEdges().map((e=>this._armShape(e)))}boundingBox(){return this._armShape(this.edge()).boundingBox()}_edgeCenter(){return this.edge().center()}_defaultEdge(){const e=this.opening().interiorEdge();return(this.flipped()?e.reversed():e).relativeTo(this._edgeBeginLocator())}_makeTube(e,t){const r=this._tubeInset(),n=this._loopRadius().toNumeric(this.unit()),i=a.stretchedEdgeBy(e,-r,-n).movedBy(0,0,t).relativeToEdge(this.edge());return new o(i,this._tubeRadius(),this.railColor().materialName())}_defaultTubes(e){return this._tubeRelativeZLevels().map((t=>{const r=this._zPosition()+t;return this._makeTube(e,r)}))}_makeEnd(e){const t=e.begin(),r=this._endInset(e),n=e.direction().multipliedBy(r),i=t.movedBy(n.x(),n.y(),this._zPosition());return new l(i.relatedTo(this._edgeCenter()),e.direction(),"omega-self-closing-gate-end")}_makeHinge(e){const t=e.begin().movedBy(0,0,this._zPosition());return new l(t.relatedTo(this._edgeCenter()),e.direction(),"omega-self-closing-gate-mount")}defaultHinges(){return this._armEdges().map(this._makeHinge.bind(this))}defaultTubes(){return this._armEdges().flatMap(this._defaultTubes.bind(this))}defaultEnds(){return this._armEdges().map(this._makeEnd.bind(this))}hinges(){return this._hinges??=this.link(this.defaultHinges())}ends(){return this._ends??=this.link(this.defaultEnds())}tubes(){return this._tubes??=this.link(this.defaultTubes())}components(){return[...this.hinges(),...this.ends(),...this.tubes()]}reset(){super.reset(),this._width=void 0,this.resetComponents()}resetComponents(){super.resetComponents(),this._hinges=void 0,this._ends=void 0,this._tubes=void 0}materialSpecifier(){const e=`${this.skuColor()}-795X-01`;return this.materials[e]}materialLineItems(){const e=this.materialSpecifier();return[new u(this._quantity(),e)]}defaultFigure(){return new d(this)}fillStyle(){return this.materialSpecifier().details().fillStyle}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_hinges","_ends","_tubes"]}}},66135:(e,t,r)=>{const n=r(63768),{RelativeLocator:i}=r(62048),{EditableProperty:s}=r(7340),{Composite3DFigure:o}=r(37732),a=r(1519),l=r(2123),c=r(48909),u=r(62844);e.exports=class OmegaSwingGate extends a{displayProperties(){return[...super.displayProperties(),new s(this,"Arm Width",{type:"select",choices:this.armWidthOptions()})]}reset(){super.reset(),this._gateAssembly=void 0}armWidth(){return this._armWidth||(this._armWidth=this.availableArmWidths().first()),this._armWidth}setArmWidth(e){this._armWidth=e,this.reset(),this.delegate()?.gateWidthChanged(this)}armWidthOptions(){const e=this.delegate();return this.availableArmWidths().map((t=>({label:n.format(t,Math.SIGNIFICANT_DECIMAL_PLACES),value:t,disabled:e&&!e.isGateArmWidthValid(this,t)})))}availableArmWidths(){return u}requiredOpeningWidth(e=this.armWidth()){return n.add(e,this.paddingNeeded())}holeHeightOffset(){return-n.unit(1/4,"in").toNumeric(this.unit())}_defaultEdge(){const e=this.opening(),t=this._edgeBeginLocator().addZ(this.railZLevels().first()+this.holeHeightOffset()),r=this.armWidth().toNumeric(this.unit()),n=i.makeRelativeTo(t,e.edge().center()),s=n.add(this.direction().multipliedBy(r)),o=i.makeRelativeTo(s,e.edge().center());return n.to(o)}gateAssembly(){if(!this._gateAssembly){const e=new l(this.armWidth());e.setComponentOf(this),this._gateAssembly=e}return this._gateAssembly}materialLineItems(){return this.components().flatMap((e=>e.materialLineItems()))}components(){return[this.gateAssembly()]}defaultFigure(){const e=c.withModel(this);return e.setHandles([]),e}threeFigure(){return o.withModel(this)}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_gateAssembly"]}}},2123:(e,t,r)=>{const n=r(63768),{three:i}=r(37732),{MaterialSpecifier:s}=r(93613),{Polygon:o}=r(62048),a=r(41908),l=r(6556),c=r(46490);e.exports=class OmegaSwingGateAssembly extends a{armWidth(){return this.componentOf().armWidth()}edge(){return this.componentOf().edge()}locator(){return this.edge().begin()}referencePoint(){return this.locator()}direction(){return this.edge().direction()}gateMaterialName(){return this.componentOf().materialNames().first()}fillStyle(){return this.componentOf().fillStyle()}strokeStyle(){return this.componentOf().strokeStyle()}skuColor(){return this.componentOf().skuColor()}rotation(){return(new i.Quaternion).setFromUnitVectors(new i.Vector3(0,-1),this.direction().toThreeJS())}materialIdentifiers(){return[this.gateMaterialName(),"steel"]}_modelIdentifier(){return`omega-swing-gate-${this.armWidth().toNumeric("in").rounded()}`}materialSpecifier(){const e=n.format(this.armWidth(),Math.SIGNIFICANT_DECIMAL_PLACES),t=`HR-GS-2-HD-GRP-${this.armWidth().toNumeric("in").rounded()}`;return new s(t+this.skuColor(),`Swing Gate (${e})`,{pricingIdentifier:t,fillStyle:this.fillStyle(),strokeStyle:this.strokeStyle()})}materialLineItems(){return[new l(1,this.materialSpecifier())]}geometry(){if(!this._geometry){const e=this.componentOf().thickness().toNumeric(this.unit()),t=this.edge().shiftedAlongNormalBy(e/2),r=this.edge().shiftedAlongNormalBy(-e/2);this._geometry=new o([t.begin(),t.end(),r.end(),r.begin()])}return this._geometry}defaultFigure(){return new c(this)}}},29141:(e,t,r)=>{const n=r(63768),{Composite3DFigure:i}=r(37732),{EditableProperty:s}=r(7340),{MissingOverride:o}=r(50988),a=r(48909),l=r(1519),c=r(67603);e.exports=class OmegaVariableWidthGate extends l{minGateWidth(){throw new o(this,"minGateWidth")}absoluteMaxGateWidth(){throw new o(this,"absoluteMaxGateWidth")}requiredOpeningWidth(e=this.width()){throw new o(this,"requiredOpeningWidth")}displayProperties(){return new c(this,[...super.displayProperties(),new s(this,"Width",{type:"unit",defaultUnit:"in",ignoreIntermediateEdits:!0})])}showWidthProperty(){return!0}width(){return this._width??=this._defaultGateWidth()}resetComponents(){}setWidth(e){this._width=e,this.resetComponents(),this.delegate()?.gateWidthChanged(this)}validateWidth(e,t){if(e)return n.smaller(t,this.minGateWidth())?`Cannot be less than ${this.minGateWidth()}`:n.larger(t,this.absoluteMaxGateWidth())?`Cannot be greater than ${this.absoluteMaxGateWidth()}`:n.larger(t,this.maxGateWidth())?`This rail cannot hold gates larger than ${this.maxGateWidth()}`:void 0}_defaultGateWidth(){const e=this.opening().width(),t=this.absoluteMaxGateWidth();return n.larger(e,this.absoluteMaxGateWidth())?t:e}isUnderMinimumWidth(){return n.smaller(this.width(),this.minGateWidth())}maxGateWidth(){const e=this.componentOf();return e.railingRun().maximumSizeForOpening(e)}defaultFigure(){const e=a.withModel(this);return e.setHandles([]),e}threeFigure(){return i.withModel(this)}}},62844:(e,t,r)=>{const n=r(63768);e.exports=[n.unit(36,"in"),n.unit(48,"in"),n.unit(60,"in")]},74666:(e,t,r)=>{const n=r(63768),{MaterialSpecifier:i}=r(93613),s=r(95208),o=r(56780);function a(e,t,{usePostFillStyle:r=!1,pricingSKU:n=e}={}){return Object.values(o).map((s=>{const o=`${s.details().skuColor}-${e}`,a=`${s.details().skuColor}-${n}`,l=`${t} - ${s.details().lineItemColor}`,c=r?s.details().postFillStyle:s.fillStyle();return new i(o,a,{description:l,materialName:s.materialName(),fillStyle:c,strokeStyle:s.strokeStyle(),pricingIdentifier:a})}))}function l(e){const t=12*Number(e.split("-")[1])+.5;return n.range(t,t+11.5,.5).toArray().flatMap((t=>a(`${e}-${t}`,`Traffic Shield Guardrail - ${s(t,16,!0)}`,{pricingSKU:e})))}const c=[...a("795G-10","Traffic Shield Guardrail - 10'"),...a("795U-09","Traffic Shield Guardrail - sub 10' cut"),...a("795G-09","Traffic Shield Guardrail - 9'"),...a("795U-08","Traffic Shield Guardrail - sub 9' cut"),...a("795G-08","Traffic Shield Guardrail - 8'"),...a("795U-07","Traffic Shield Guardrail - sub 8' cut"),...a("795G-07","Traffic Shield Guardrail - 7'"),...a("795U-06","Traffic Shield Guardrail - sub 7' cut"),...a("795G-06","Traffic Shield Guardrail - 6'"),...a("795U-05","Traffic Shield Guardrail - sub 6' cut"),...a("795G-05","Traffic Shield Guardrail - 5'"),...a("795U-04","Traffic Shield Guardrail - sub 5' cut"),...a("795G-04","Traffic Shield Guardrail - 4'"),...a("795U-03","Traffic Shield Guardrail - sub 4' cut"),...a("795G-03","Traffic Shield Guardrail - 3'"),...a("795U-02","Traffic Shield Guardrail - sub 3' cut"),...a("795G-02","Traffic Shield Guardrail - 2'"),...l("795U-09"),...l("795U-08"),...l("795U-07"),...l("795U-06"),...l("795U-05"),...l("795U-04"),...l("795U-03"),...l("795U-02"),...a("795A-45","Traffic Shield Angle Bracket - 45 Degree"),...a("795A-12","Traffic Shield Angle Bracket - 90 Degree"),...a("795A-11","Traffic Shield Liftout Bracket (2 brackets)"),...a("795A-13","Traffic Shield Gate Bracket - Single Rail (2 brackets)"),...a("795A-14","Traffic Shield Gate Bracket - Double Rail (4 brackets)"),...a("795X-01","Self-closing Gate"),...a("795S-18",'18" Mounting Post',{usePostFillStyle:!0}),...a("795S-44",'44" Mounting Post',{usePostFillStyle:!0}),...a("795M-78","Corner Cap"),...a("795M-79","Wrap-around Flare")],u={};c.forEach((e=>{u[e.identifier()]=e})),e.exports=u},56780:(e,t,r)=>{const n=r(43320);e.exports=Object.freeze({yellow:new n("Traffic Safety Yellow","omega-yellow","#FF9A00","#5C5C5C",{postFillStyle:"#FEB700",skuColor:"OOY",lineItemColor:"Omega Yellow"}),brightYellow:new n("Bright Safety Yellow","omega-bright-safety-yellow","#FCD408","#5C5C5C",{postFillStyle:"#FFEA61",skuColor:"OBY",lineItemColor:"Bright Yellow"})})},28021:e=>{e.exports={ANGLE_ANNOTATIONS:"Angles",OPENING_WIDTH_ANNOTATIONS:"Opening Widths",RAIL_LENGTH_ANNOTATIONS:"Rail Lengths",SECTION_LENGTH_ANNOTATIONS:"Section Length"}},48028:(e,t,r)=>{const n=r(63768),{Polygon:i,RelativeLocator:s,PolarCoordinate:o}=r(62048),{three:a,Composite3DFigure:l}=r(37732),c=r(46490),u=r(76281),d=r(88024),h=r(28831),p=r(28772),m=r(98430),f=r(6556),g=r(80371),y=r(57473),b=r(74666),v=new u('44" (Double Rail)',n.unit(44,"in"),[n.unit(42.9375,"in"),n.unit(17.25,"in")]),_=new u('18" (Single Rail)',n.unit(18,"in"),[n.unit(17.25,"in")]);e.exports=class OmegaGuardrailPost extends g{static descriptors(){return[v,_]}static postWidth(){return n.unit(4,"in")}constructor(e,t){super(e),this._orientation=t}descriptor(){return this.postProvider().postDescriptor()}orientation(){return this._orientation}width(){return this.constructor.postWidth()}height(){return this.descriptor().postHeight()}zLevel(){return this.locator().z()}basePlateThickness(){return n.unit(.5,"in")}basePlateWidth(){return n.unit(10,"in")}postColor(){return this.postProvider().railColor()}materialName(){return this.postColor().materialName()}fillStyle(){return this.postColor().details().postFillStyle}strokeStyle(){return this.postColor().strokeStyle()}skuColor(){return this.postColor().details().skuColor}moveBy(e,t,r){return this.locator().moveBy(e,t,r)}_defaultPreviousSection(){return this.postProvider().previousSectionForPost(this)}_defaultNextSection(){return this.postProvider().nextSectionForPost(this)}ensureCurrentSections(){this._ensurePreviousSectionCurrent(),this._ensureNextSectionCurrent()}_ensurePreviousSectionCurrent(){const e=this._previousSection;if(!e)return;const t=this.postProvider().previousSectionForPost(this);e!==t&&(this._previousSection=t,this.resetComponents(),this.nextSection()?.postAttachmentsChanged(this))}_ensureNextSectionCurrent(){const e=this._nextSection;if(!e)return;const t=this.postProvider().nextSectionForPost(this);e!==t&&(this._nextSection=t,this.resetComponents(),this.previousSection()?.postAttachmentsChanged(this))}async load(){return await super.load(),Promise.all(this.components().map((e=>e.load?.())))}brackets(){return this._brackets||(this._brackets=this._defaultBrackets()),this._brackets}_defaultBrackets(){this.ensureCurrentSections();const e=this.angleBetweenSections();return this._validAngleForAngleBracket(e)?this._generateAngleBrackets(e):this.isAtInsideCorner()?this._generateInsideCornerBrackets():[]}_validAngleForAngleBracket(e){return m.ALL_ANGLES.find((t=>e.isNearTo(t)))}_angleBracketModelSuffix(e){const t=m.ANGLES_30.find((t=>e.isNearTo(t))),r=m.ANGLES_45.find((t=>e.isNearTo(t)));return t?30:r?45:60}_generateAngleBrackets(e){const t=this._angleBracketModelSuffix(e),[r,n]=this.attachedSections(),i=r.edge().direction().negated(),s=n.edge().direction(),o=i.add(s).normalized(),a=r.edge().end(),l=h.height().toNumeric(this.unit())/2;return this.descriptor().railAttachmentLevels().map((e=>{const r=a.addZ(-e.toNumeric(this.unit())+l),n=new m(r,o,t);return n.setComponentOf(this),n}))}_generateInsideCornerBrackets(){const e=this.previousSection().isInline(),t=this.nextSection().isInline();if(e&&t)return[];const r=t?this.nextSection():this.previousSection(),n=t?r.edge().begin():r.edge().end(),i=r.edge().direction(),s=h.height().toNumeric(this.unit())/2;return this.descriptor().railAttachmentLevels().map((e=>{const t=n.addZ(-e.toNumeric(this.unit())+s),r=new p(t,i);return r.setComponentOf(this),r}))}cornerCaps(){return this._cornerCaps||(this._cornerCaps=this._defaultCornerCaps()),this._cornerCaps}setCornerCaps(e){this._cornerCaps=e}angleBetweenSections(){if(2!==this.attachedSections().length)return NaN;const[e,t]=this.attachedSections(),r=e.edge().theta().normalizedAngle();return(t.edge().theta().normalizedAngle()-r).normalizedAngle()}isAtInsideCorner(){return this.angleBetweenSections().isNearTo(Math.THREE_PI_2)}_defaultCornerCaps(){if(!1===this.postProvider().cornerCaps?.())return[];if(this.ensureCurrentSections(),!this.angleBetweenSections().isNearTo(Math.PI_2))return[];const[e,t]=this.attachedSections();if(e.isUnderMinimumLengthToHaveRail()||t.isUnderMinimumLengthToHaveRail())return[];if(e.isInline()||t.isInline())return[];const r=e.edge().direction(),n=t.edge().direction(),i=this._cornerLocator(n,r),s=this._cornerCapDirection(n,r),o=h.height().toNumeric(this.unit())/2;return this.descriptor().railAttachmentLevels().map((e=>{const t=i.addZ(-e.toNumeric(this.unit())+o),r=new d(t,s);return r.setComponentOf(this),r}))}_cornerLocator(e,t){const r=this.width().toNumeric(this.unit())/2+h.width().toNumeric(this.unit())+h.thickness().toNumeric(this.unit()),n=e.negated().multipliedBy(r),i=t.multipliedBy(r),o=s.makeRelativeTo(this.locator(),this.locator());return o.moveBy(i.x(),i.y()),o.moveBy(n.x(),n.y()),o}_cornerCapDirection(e,t){return t.add(e.negated()).normalized()}boundingBox(){return this.geometry().boundingBox()}materialIdentifiers(){return[this.materialName(),"omega-post-cap-black"]}rotation(){return(new a.Quaternion).setFromUnitVectors(new a.Vector3(0,-1),this.orientation().toThreeJS())}geometry(){return this._geometry||(this._geometry=this.defaultGeometry()),this._geometry}defaultGeometry(){const e=this.locator(),t=this.orientation(),r=new o(1,t.theta()+Math.PI_2),n=this.width().toNumber(this.unit())/2,a=t.multipliedBy(n),l=r.multipliedBy(n),c=[e.add(a).add(l),e.add(a.negated()).add(l),e.add(a.negated()).add(l.negated()),e.add(a).add(l.negated())].map((t=>s.makeRelativeTo(t,e)));return new i(c)}bottomLocator(){return this._simpleBottomLocator()}model(){return this._model||(this._model=this._defaultModel()),this._model}_defaultModel(){const e=this.locator(),t=this._modelIdentifier(),r=this.materialIdentifiers(),n=this.modelRotation();return new y(e,t,n,void 0,r)}_modelIdentifier(){return`omega-post-${this.height().toNumeric("in")}`}modelRotation(){const e=this.componentOf().edge().normalizedAngle()+Math.PI_2;return(new a.Quaternion).setFromAxisAngle(new a.Vector3(0,0,1),e)}defaultFigure(){return new c(this)}allLocatedMaterials(){return[...super.allLocatedMaterials(),...this.components().flatMap((e=>e.allLocatedMaterials()))]}components(){return[this.model(),...this.cornerCaps(),...this.brackets()]}resetComponents(){this._cornerCaps=void 0,this._brackets=void 0}materialSpecifier(){const e=this.height().toNumeric("in").rounded().toString(),t=`${this.skuColor()}-795S-${e}`;return b[t]}materialLineItems(){return[new f(1,this.materialSpecifier())]}threeFigure(){return l.withModel(this)}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_priceOptions","_cornerCaps","_brackets","_model"]}}},1617:(e,t,r)=>{const n=r(63768),i=r(83741);e.exports=class ThunderCloudNoPlatformPostMountStyle extends i{sectionEdgeOffsetFromCenter(e){return n.unit(0,"in")}componentLayoutEdgeIntersectionOverride(e,t,r,n,i){return t?r.begin():r.end()}}},83741:(e,t,r)=>{const n=r(63768),{extend:i,calculate:s}=r(50988),{PostMountStyle:o}=r(8423),a=r(24360),l=r(35337),c=r(53627);class ThunderCloudPostMountStyle extends o{static configuredStyles(){return Object.values(this.systemStrategy().postMountStyleConfigs?.()||[]).filter((e=>e._usageContext.postMountStyleClassName===this.name))}constructor(e){super(),this._config=e,this._configId=e?.id}get config(){return this._config}get label(){return this.config?.name||this.styleIdentifier()}materialLineItems(e,t){return this.config?.materialLineItemsHelperFunction(this,e,t)||[]}intersectionHelper(e){return new l(this._baseComponentLayoutEdge(e),this.componentLayoutEdgeOffset(e))}insetFromEdgeOfPlatform(){return this.offsetFromEdgeOfPlatform()}offsetFromEdgeOfPlatform(){return this.config?.offsetFromEdgeOfPlatform||n.unit(0,"in")}postZOffset(){return this.config?.offsetBelowSurfaceOfPlatform||n.unit(0,"in")}sectionEdgeOffsetFromCenter(e){const t=this.isFasciaMount()?1:-1;return s`${t} * (${e} / 2 + ${this.offsetFromEdgeOfPlatform()})`}styleIdentifier(){return this.mountingMode()}mountingMode(){return this.config?.mountingMode||super.styleIdentifier()}equals(e){return super.equals(e)&&this.config?.id===e.config?.id}postRestorationAction(){if(!this._configId)return;const e=this.constructor.configuredStyles().find((e=>e.id===this._configId));e&&(this._config=e)}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_config"]}}i(ThunderCloudPostMountStyle,a),i(ThunderCloudPostMountStyle,c),e.exports=ThunderCloudPostMountStyle},24212:(e,t,r)=>{const{extend:n}=r(50988),i=r(1412),s=r(56593);class AdjustableCorner3DModelSleeve extends s{constructor(e,t,r,n){super(e,t,r),this._descriptor=n,this._modelIdentifier=n.sleeveIdentifier(),this._materialNames=n.materialNames()}get descriptor(){return this._descriptor}_defaultParts(){return[this.direction(),this.endDirection()].map(((e,t)=>this.generatePart(this.modelIdentifierFor(t),this.rotationFor(e))))}modelIdentifierFor(e){const t=0===e?"begin":"end";return`${this.modelIdentifier()}->${t}`}}n(AdjustableCorner3DModelSleeve,i),e.exports=AdjustableCorner3DModelSleeve},29854:(e,t,r)=>{const n=r(66016);e.exports=class AdjustableSlope3DModelSleeve extends n{static partIdentifiers(){return["base","cradle"]}_defaultParts(){const e=this.modelIdentifiers();return this.directions().map(((t,r)=>this.generatePart(e[r],this.rotationFor(t))))}directions(){return[this.direction().xy(),this.direction()]}modelIdentifiers(){return this.constructor.partIdentifiers().map((e=>`${this.modelIdentifier()}->${e}`))}}},2650:(e,t,r)=>{const n=r(63768),i=r(30202),s=r(56593);e.exports=class CornerExtrusionSleeve extends s{constructor(e,t,r,n,i={}){super(e,t,r),this._crossSection=n,this._details=i}crossSection(){return this._crossSection}details(){return this._details}sleeveExtensionLength(){return n.unit(2,"in")}color(){return this.details().color}_defaultParts(){const e=this.sleeveExtensionLength().toNumeric(this.unit()),t=this.locator(),r=this.direction(),n=this.endDirection(),s=t.add(r.multipliedBy(e)).relatedTo(t),o=t.add(n.multipliedBy(e)).relatedTo(t),a=this.crossSection(),l=this.materialSpecifier();return[i.builder(this).beginLocator(t).endLocator(s).crossSection(a).materialSpecifier(l).beginMiterDirection(r.negated().add(n).normalized()).color(this.color()).build(),i.builder(this).beginLocator(t).endLocator(o).crossSection(a).materialSpecifier(l).beginMiterDirection(n.negated().add(r).normalized()).color(this.color()).build()]}}},56593:(e,t,r)=>{const n=r(94060);e.exports=class CornerSleeve extends n{constructor(e,t,r){super(e,t),this._endDirection=r}endDirection(){return this._endDirection}}},79041:(e,t,r)=>{const{extend:n}=r(50988),i=r(56593),s=r(93969);class Model3DRightCornerSleeve extends i{constructor(e,t,r,n){super(e,t,r),this._descriptor=n}get descriptor(){return this._descriptor}modelIdentifier(){return this.descriptor.sleeveIdentifier()}materialNames(){return this.descriptor.materialNames()||this._defaultMaterialNames()}_defaultParts(){const e=this.rotationFor(this.direction(),this.endDirection());return[this.generatePart(this.modelIdentifier(),e)]}}n(Model3DRightCornerSleeve,s),e.exports=Model3DRightCornerSleeve},66016:(e,t,r)=>{const{extend:n}=r(50988),i=r(1412),s=r(94060);class Model3DSleeve extends s{constructor(e,t,r,n){super(e,r.directionProcessor(t)),this._descriptor=r,this._supplementalRotation=n}get descriptor(){return this._descriptor}modelIdentifier(){return this.descriptor.sleeveIdentifier()}modelRotation(){return this.descriptor.modelRotation().clone()}materialNames(){return this.descriptor.materialNames()||this._defaultMaterialNames()}_defaultParts(){return[this.generatePart(this.modelIdentifier(),this.rotationFor(this.direction()))]}}n(Model3DSleeve,i),e.exports=Model3DSleeve},94060:(e,t,r)=>{const{MaterialSpecifier:n}=r(93613),{Cube:i}=r(62048),{CompositeFigure:s}=r(7340),{Composite3DFigure:o}=r(37732),a=r(26933),l=r(83102);e.exports=class Sleeve extends l{constructor(e,t){super(),this._locator=e,this._direction=t}locator(){return this._locator}direction(){return this._direction}materialSpecifier(){return new n("Sleeve","Sleeve",{materialName:"aluminum"})}parts(){return this._parts??=this.defaultParts()}defaultParts(){const e=this._defaultParts();return e.forEach((e=>e.setComponentOf(this))),e}_defaultParts(){}components(){return this.parts()}boundingCube(){return i.mergedFiniteCubes(this.components())}boundingBox(){return this.components().map((e=>e.boundingBox())).reduce(((e,t)=>e.merge(t)))}defaultFigure(){return s.withModel(this)}threeFigure(){return o.withModel(this)}projectedViewFigure(e,t,r){return a.withModel(this,e,t,r)}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_parts"]}}},31651:e=>{e.exports=Object.freeze({terminal:"terminal",line:"line",adjustable:"adjustable"})},71300:(e,t,r)=>{const n=r(83071),i=r(31651),s=n.defineSlopes(-90,90,-90,90),o="adjustable-corner-sleeve-placeholder",a=[new n(i.terminal,o,{slopes:s}),new n(i.line,o,{slopes:s}),new n(i.adjustable,o,{slopes:s})],l={lowerRailSleeves:a,topRailSleeves:a};e.exports=l},26511:(e,t,r)=>{const{three:n}=r(37732),i=r(83071),s=r(31651),o="generic-2-in-pipe-sleeve-lower-",a="generic-2-in-pipe-sleeve-upper-",l=i.defineSlopes(-90,90,-90,90),c=!0,u=(new n.Quaternion).setFromAxisAngle(new n.Vector3(0,0,1),Math.PI),d=[new i(s.adjustable,"adjustable-corner-sleeve-placeholder",{slopes:l,materialNames:["debug-red"]}),new i(s.terminal,"adjustable-corner-sleeve-placeholder",{slopes:l,materialNames:["debug-red"]}),new i(s.line,"adjustable-corner-sleeve-placeholder",{slopes:l,materialNames:["debug-red"]})],h=[new i(s.terminal,`${o}terminal`,{materialSpecifier:"Lower_Terminal_Sleeve"}),new i(s.terminal,`${o}slope-terminal`,{slopes:l,slopeAdjustable:c,nextLevel:!1,materialSpecifier:"Lower_Slope_Terminal_Sleeve"}),new i(s.terminal,`${o}slope-terminal`,{slopes:l,slopeAdjustable:c,previousLevel:!1,modelRotation:u,materialSpecifier:"Lower_Slope_Terminal_Sleeve"})],p=[new i(s.line,`${o}line`,{materialSpecifier:"Lower_Line_Sleeve"}),new i(s.line,`${o}slope-line`,{slopes:l,slopeAdjustable:c,materialSpecifier:"Lower_Slope_Line_Sleeve"})],m=[new i(90,`${o}corner-90`,{isRightCorner:!0,materialSpecifier:"Lower_Right_Corner_Sleeve"}),new i(s.adjustable,`${o}corner-adjustable`,{materialSpecifier:"Lower_Adjustable_Corner_Sleeve"})],f=[new i(s.adjustable,`${o}slope-transition`,{slopes:l,previousLevel:!0,materialSpecifier:"Lower_Slope_Transition_Sleeve"}),new i(s.adjustable,`${o}slope-transition`,{slopes:l,nextLevel:!0,materialSpecifier:"Lower_Slope_Transition_Sleeve"})],g=[new i(s.terminal,`${a}terminal`,{materialSpecifier:"Upper_Terminal_Sleeve"}),new i(s.terminal,`${a}slope-terminal`,{slopes:l,slopeAdjustable:c,nextLevel:!1,materialSpecifier:"Upper_Slope_Terminal_Sleeve"}),new i(s.terminal,`${a}slope-terminal`,{slopes:l,slopeAdjustable:c,previousLevel:!1,modelRotation:u,materialSpecifier:"Upper_Slope_Terminal_Sleeve"})],y=[new i(s.line,`${a}line`,{materialSpecifier:"Upper_Line_Sleeve"}),new i(s.line,`${a}slope-line`,{slopes:l,slopeAdjustable:c,materialSpecifier:"Upper_Slope_Line_Sleeve"})],b={topRailSleeves:[...g,...[new i(90,`${a}corner-90`,{isRightCorner:!0,materialSpecifier:"Upper_Right_Corner_Sleeve"}),new i(s.adjustable,`${a}corner-adjustable`,{materialSpecifier:"Upper_Adjustable_Corner_Sleeve"})],...[new i(s.adjustable,`${a}slope-transition`,{slopes:l,previousLevel:!0,materialSpecifier:"Upper_Slope_Transition_Sleeve"}),new i(s.adjustable,`${a}slope-transition`,{slopes:l,nextLevel:!0,materialSpecifier:"Upper_Slope_Transition_Sleeve"})],...y,...d],lowerRailSleeves:[...h,...m,...f,...p,...d]};e.exports=b},11496:(e,t,r)=>{const n=r(90218);e.exports=class StairMountSurface extends n{constructor(e){super(void 0,{disabled:e})}hasStringer(){return!1}treadMountPosts(){return!1}equals(e){return this.constructor===e.constructor}}},3262:(e,t,r)=>{const{ProportionalEdgeLocator:n}=r(62048),i=r(76427),s=r(76905);e.exports=class ThunderCloudStairMountTreadFixedDistanceSurface extends i{postLocations(e,t){const r=e.map((e=>new n(e,1)));if(r.first().xy().distanceTo(r[1].xy())>t.maxPostSpacing)return super.postLocations(e,t);const i=this._postLayoutEdgeXY(e,t.isTopCornerConnection);return this.fixedDistancePostLocations(i,r,t.maxPostSpacing)}fixedDistancePostLocations(e,t,r){const n=t.map((e=>e.xy()));let i=this._evenlySpacedFixedDistanceLocationsXY(e,n,r);return this._xyDistancesBetweenLocators(i).some((e=>e>r))&&(i=this._fallbackFixedDistanceLocationsXY(n,r)),i.map((e=>t.find((t=>t.xy().equals(e)))))}_evenlySpacedFixedDistanceLocationsXY(e,t,r){return this._baseEvenlySpacedPostLocations(e,r).map((e=>s.findClosestLocator(e,t).locator)).uniqueValues()}_fallbackFixedDistanceLocationsXY(e,t){const r=[e.first()];let n=e.slice(1).toReversed();for(;n.length>0;){const e=r.last(),i=n.findIndex((r=>e.distanceTo(r)<=t)),s=n[i];r.push(s),n=n.slice(0,i)}return r}_xyDistancesBetweenLocators(e){return e.reduce(((t,r,n)=>{const i=e[n+1];return i&&t.push(r.xy().distanceTo(i.xy())),t}),[])}}},76427:(e,t,r)=>{const{ProportionalEdgeLocator:n}=r(62048),i=r(11496);e.exports=class ThundercloudStairMountTreadSurface extends i{get label(){return"Tread"}treadMountPosts(){return!0}postLocations(e,t){return this._postLocationsXY(e,t).map((r=>{const n=this._containingEdgeForPoint(r,e,t.isSlopeFlipped);return n?n.closestRelativePointTo(r):r}))}_containingEdgeForPoint(e,t,r){const n=t.find((t=>t.xy().containsPoint(e)));return r?n.reversed():n}_postLocationsXY(e,{maxPostSpacing:t,isTopCornerConnection:r,postLengthExtent:n}){const i=this._postLayoutEdgeXY(e,r),s=i.snapshot(),o=this._baseEvenlySpacedPostLocations(s,t);return this._adjustLocatorsToFitSteps(o,e,s,t),this.locatorsWithLocatorAtEdgeEnd(o,i,t,n)}_baseEvenlySpacedPostLocations(e,t){const r=Math.ceil(e.length()/t)+1-1,i=[];for(let t=0;t<=r;t++){const s=t/r;i.push(new n(e,s))}return i}locatorsWithLocatorAtEdgeEnd(e,t,r,i){const s=e.last(),o=e[e.length-2];if(!!s.equals(t.end()))return e;const a=new n(t,1),l=s.distanceTo(a),c=o.distanceTo(a);return l<i&&c<=r&&e.pop(),e.push(a),e}_postLayoutEdgeXY(e,t=!1){const r=t?e[1].begin().xy():e.first().end().xy(),n=e.last().end().xy();return r.to(n).snapshot()}_adjustLocatorsToFitSteps(e,t,r,n){const i=r.direction().negated();let s=this._requiredReduction(t,e),o=0;for(;s>0&&o<n;){o+=s;const n=i.multipliedBy(s);r.end().moveBy(n.x(),n.y(),n.z()),s=this._requiredReduction(t,e)}}_requiredReduction(e,t){const r=this._firstInvalidLocator(e,t);return r?this._distanceToClosestValidPosition(e,r):0}_firstInvalidLocator(e,t){return t.find((t=>!e.find((e=>e.xy().containsPoint(t)))))}_distanceToClosestValidPosition(e,t){return e.reduce(((e,r)=>{const n=r.end().distanceTo(t);return Math.min(n,e)}),1/0)}}},89836:(e,t,r)=>{const{FixedEdgeLocator:n}=r(62048),i=r(59663);e.exports=class GeneratedPlatformFigure extends i{constructor(e,{fillStyle:t="transparent",strokeStyle:r="#000000",lineWidth:n=.5}={}){super(e,{fillStyle:t,strokeStyle:r,lineWidth:n})}_draw(e,t){e._drawPolygon(this.model().geometry()),this.drawArrow(e,t)}_skipDrawing(e,{bounds:t,layerManager:r}={}){return!this.layerVisible(r)||t&&!t.intersects(this.boundingBox())}drawArrow(e,t){if(!this.model().showSlopeArrow?.())return;const r=this.model().centerline();if(!r)return;e.fillStyle="#000000",e.strokeStyle="#000000",e.textAlign="center",e.textBaseline="middle";e.fontSize=12;const i=new n(r,12),s=r.end(),o=new n(r,6);e.lineWidth=1,e._drawArrow(i.to(s),4,3);const a=r.direction().theta().normalizedAngle(),l=(a<=Math.PI?a:a-Math.PI)-Math.PI_2;e.translate(o.x(),o.y()),e.rotate(l),e.fillText("Down",0,0)}zLevel(){return this.model().zLevel()}contains(){return!1}moveBy(){return!1}defaultHandles(){return[]}}},44810:(e,t,r)=>{const{CompositeFigure:n}=r(7340),{FixedEdgeLocator:i}=r(62048);e.exports=class GeneratedStairFigure extends n{zLevel(){return this.model().zLevel()}_draw(e,t){super._draw(e,t),this.drawArrow(e,t)}drawArrow(e,t){e.fillStyle="#000000",e.strokeStyle="#000000",e.textAlign="center",e.textBaseline="middle";e.fontSize=12;const r=this.model().topEdge().center().to(this.model().bottomEdge().center()),n=new i(r,6),s=r.end(),o=r.begin();e.lineWidth=1,e._drawArrow(n.to(s),4,3);const a=(this.model().angle()<=Math.PI?this.model().angle():this.model().angle()-Math.PI)-Math.PI_2;e.translate(o.x(),o.y()),e.rotate(a),e.fillText("Down",0,0)}_skipDrawing(e,{bounds:t,layerManager:r}={}){return!this.layerVisible(r)||t&&!t.intersects(this.boundingBox())}contains(){return!1}moveBy(){return!1}handlesAt(){return[]}}},46490:(e,t,r)=>{const{Drawable:n}=r(7340);e.exports=class OmegaComponentFigure extends n{constructor(e){super(),this.setModel(e)}boundingBox(){return this.model().boundingBox()}contains(e,t){return!1}moveBy(e,t){return!1}_draw(e,t){e.fillStyle=this.model().materialSpecifier().details().fillStyle||e.fillStyle,e.strokeStyle=this.model().materialSpecifier().details().strokeStyle||e.strokeStyle,e.lineWidth=.5,e._drawPolygon(this.model().geometry())}defaultProperties(){return{...super.defaultProperties(),fillStyle:"#feb700",strokeStyle:"#5c5c5c",lineWidth:.5}}}},19418:(e,t,r)=>{const{ConstructionComponentHandle:n}=r(93613),{CompositeFigure:i}=r(7340);e.exports=class RailingCollectionFigure extends i{constructor(e){super(),this.setModel(e)}selfHandle(){return new n(this.model())}contains(e,t){return this.model().contains(e,t)}}},12904:(e,t,r)=>{const{CompositeFigure:n}=r(7340),i=r(27250);e.exports=class RailingOpeningFigure extends n{constructor(e){super(),this.setModel(e)}railingOpening(){return this.model()}_draw(e,t={}){this._drawFigures(e,t);const{layerManager:r}=t;this.layerVisible(r)&&this._drawSelf(e,t)}_drawSelf(e,t){const r=this.selfHandle();r.drawGrabRegion(e,r.grabProperties(),t)}selfHandle(){return new i(this.railingOpening())}}},52613:(e,t,r)=>{const{CompositeFigure:n,Handle:i}=r(7340),s=r(16914),o=r(47619);e.exports=class RailingRunFigure extends n{constructor(e){super(),this.setModel(e)}railingRun(){return this.model()}contains(e,t){return this.model().contains(e,t)}moveBy(e,t){return this.model().moveBy(e,t)}handlesAt(e,t,r={}){const{scale:n,layerManager:s,validWhen:o=[i.VALID_FOR_HOVER]}=r,a=this.layerVisible(s);if(this._handles)return a?this._handles.fastFilter((r=>o.includes(r.validWhen())&&r.contains(e,t,n))):[];const l=[],c=this.figures();for(let n=c.length-1;n>=0;n--)l.fastMerge(c[n].handlesAt(e,t,r));if(a){const r=this.defaultHandles();l.fastMerge(r.fastFilter((r=>o.includes(r.validWhen())&&r.contains(e,t,n))))}return l}defaultHandles(){return[this.handleForBegin(),this.handleForEnd(),this.selfHandle()].filter((e=>e))}selfHandle(){return new o(this.railingRun())}handleForBegin(){if(this.railingRun().previousRun())return;const e=this.model().edge().begin();return new s(this,e)}handleForEnd(){if(this.railingRun().nextRun())return;const e=this.model().edge().end();return new s(this,e)}}},26119:(e,t,r)=>{const{CompositeFigure:n}=r(7340);e.exports=class RailingSectionFigure extends n{constructor(e){super(),this.setModel(e)}section(){return this.model()}isPending(){return this.section().isPending()}_draw(e,t){if(this.isPending()){const t=this.section().pendingFigureColorOptions();e.fillStyle=t.fillStyle,e.strokeStyle=t.strokeStyle,e._drawPolygon(this.section().pendingGeometry())}else super._draw(e,t)}}},27250:(e,t,r)=>{const{ConstructionComponentHandle:n}=r(93613),{Circle:i,RelativeLocator:s}=r(62048);e.exports=class RailingOpeningHandle extends n{activate(e){this._tool=e}deactivate(e){this._tool=void 0}indicatorProperties(){return{fillStyle:"#00000000",strokeStyle:this.indicatorColor(),lineWidth:.8}}indicatorColor(){return"#FFD45D"}_selectedProperties(){return{fillStyle:"#00000000",strokeStyle:"#5bb2e4",lineWidth:.8}}grabProperties(e="#5c5c5c"){return{fillStyle:e,strokeStyle:e,lineWidth:.1}}railingOpening(){return this.object()}railingRun(){return this.object().componentOf()}draw(e,t){this._drawHandle(e,this.indicatorProperties(),t),this.drawGrabRegion(e,this.grabProperties(this.indicatorColor()),t)}drawSelected(e,t){this._drawHandle(e,this._selectedProperties(),t),this.drawGrabRegion(e,this.grabProperties(),t)}drawGrabRegion(e,t,r){e._alterAndRestoreAfter((()=>{e.updateProperties(t);const r=this.railingOpening().grabRegion();r.vertices().forEach((t=>{const n=r.centroid().subtract(t).normalized().multipliedBy(2),o=new s(t,n.x(),n.y());e._drawCircle(new i(o,.8))}))}))}moveFromTo(e,t,r,n){const i=this.railingOpening().edge().center();return super.moveFromTo(i.x(),i.y(),r,n)}_moveBy(e,t){const r=this.railingRun().moveOpening(this.railingOpening(),e,t);return r&&this._tool.drawing().updateFigures(),r}}},16914:(e,t,r)=>{const{Handle:n,CircleFigure:i}=r(7340);e.exports=class RailingRunEndpointHandle extends n{static shapeSize(){return 5}constructor(e,t){super(e),this._endpoint=t}deactivate(...e){if(super.deactivate(...e),this.railingRun().stopEditing(),this._didMove){const e=this.railingRun().componentOf();e.resetSections(),e.resetAnnotations()}}activate(...e){super.activate(...e),this.railingRun().startEditing(),this._didMove=void 0}endpoint(){return this._endpoint}locator(){return this.endpoint()}validWhen(){return this.constructor.VALID_FOR_SELECTED}shape(){return this.endpoint().expandedByRadius(this.constructor.shapeSize())}contains(e,t){return this.shape().contains(e,t)}_moveBy(e,t){const r=this.endpoint().movedBy(e,t),n=this.railingRun().moveEndpointTo(this.endpoint(),r);return n&&this.object().updateFigures(),n}moveFromTo(e,t,r,n){const i=this.endpoint().x(),s=this.endpoint().y(),o=super.moveFromTo(i,s,r,n);return this._didMove=this._didMove||o,o}selectableComponent(){return this.railingRun().componentOf()}railingRun(){return this.object().railingRun()}draw(e,t){this.drawHandle(e,this.indicatorProperties(),t)}drawSelected(e,t){this.drawHandle(e,this._selectedProperties(),t)}drawHandle(e,t,r){const n=new i(this.shape());n.updateProperties(t),n.draw(e,r)}_selectedProperties(){return{fillStyle:"rgba(31, 160, 246, 0.3)",strokeStyle:"#1FA0F6",_pixelLineWidth:3}}}},47619:(e,t,r)=>{const{ConstructionComponentHandle:n}=r(93613),{Handle:i}=r(7340),{NormalToEdgeLocator:s,Polygon:o}=r(62048),{extend:a}=r(50988),l=r(29245),c=r(84434);class RailingRunHandle extends n{constructor(e){super(e,i.VALID_FOR_SELECTED)}railingRun(){return this.object()}selectableComponent(){return this.railingRun().componentOf()}_canActivate(){return this.railingRun().canMoveBy()}activate(e){this._tool=e,this._connectedRuns().forEach((e=>e.startEditing()))}deactivate(e){this._tool=void 0,this._connectedRuns().forEach((e=>e.stopEditing()))}_connectedRuns(){return[this.railingRun().previousRun(),this.railingRun().nextRun()].filter((e=>e))}locator(){return this._edge().center()}_edge(){let e=this.railingRun().edge();return this.railingRun().structureAlongNormal()&&(e=e.reversed()),e}_moveBy(e,t){const r=super._moveBy(e,t);return r&&this._tool.drawing().updateFigures(),r}moveFromTo(e,t,r,n){const i=this.locator();return super.moveFromTo(i.x(),i.y(),r,n)}indicatorProperties(){return c}_selectedProperties(){return{fillStyle:"rgba(31, 160, 246, 0.3)",strokeStyle:"rgba(31, 160, 246, 0.3)",_pixelLineWidth:3}}contains(e,t,r){if(!this._canActivate())return!1;this._setScale(r);const n=this._offsetFromEdge(),i=this.locator(),a=this._overallLength(),l=this._arrowWidth()/2;if(new s(i,n+a/2).distanceTo(e,t)>a)return!1;return new o([new s(i,n,l),new s(i,n,-l),new s(i,n+a,-l),new s(i,n+a,l)]).contains(e,t)}_drawHandle(e,t,r){this._canActivate()&&this._drawArrow(e,t)}_drawArrow(e,t){this._setScaleFromContext(e);const r=this.locator(),n=new s(r,this._overallLength()+this._offsetFromEdge()),i=new s(r,this._offsetFromEdge()),o=this._arrowLength(),a=this._arrowWidth(),l=new s(r,this._offsetFromEdge()+this._arrowLength()+this._lineLength()/2);e._alterAndRestoreAfter((()=>{Object.assign(e,t),e.lineWidth=this._lineWidth(),e._drawArrow(l.to(n),o,a),e._drawArrow(l.to(i),o,a)}))}_offsetFromEdge(){return Math.max(this._pixelsToDrawingUnits(6),14)}_baseLength(){return Math.max(this._pixelsToDrawingUnits(6),8)}_arrowLength(){return this._baseLength()}_arrowWidth(){return 1.5*this._baseLength()}_lineLength(){return this._baseLength()}_overallLength(){return 2*this._arrowLength()+this._lineLength()}_lineWidth(){return.75*this._baseLength()}}a(RailingRunHandle,l),e.exports=RailingRunHandle},5647:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),{ComponentSelectionTool:s}=r(7340),o=r(22184),a=r(59602),l="Plan Scale";e.exports=class PlanScaleTool extends s{static IDENTIFIER=l;category(){return a.default}displayName(){return l}identifier(){return this.constructor.IDENTIFIER}excludeFromToolPanel(){return!0}activate(){this.isActive()||(this._active=!0,this.panZoomTool().activate(),this._controller().setCursor("crosshair"))}deactivate(){this.isActive()&&(this._active=!1,this.panZoomTool().deactivate(),this.reset())}reset(){this._measurement=void 0,this._measurementFigure=void 0}measurement(){return this._measurement||(this._measurement=new o),this._measurement}pageDistance(){const e=this.measurement().edge();if(!e)return;const t=this._controller().project().planScale(),r=this._controller().project().unit(),i=t.worldToPage(n.unit(e.length(),r)),s=n.unit(Math.DEFAULT_TOLERANCE,r);return i.roundedToIncrement(s)}measurementFigure(){return this._measurementFigure||(this._measurementFigure=this.measurement().defaultFigure()),this._measurementFigure}draw(e,t){this.measurement()&&this.measurementFigure().draw(e,t)}mouseMove(e,t,r){super.mouseMove(e,t,r),this.measurement().hasUnplacedEndpoint()&&(this.measurement().updateUnplacedEndpoint(i(e,t)),this._controller().draw())}async mouseUp(e,t,r={}){let n=!1;if(this.isMouseButtonInUse(this.mouseButtonToActivate(),r)||this._isTouchEvent(r.event)){this.activeHandle()?(this._deactivateHandle(),this._controller().redraw(),n=!0):this.measurement().hasUnplacedEndpoint()&&!this.didPanOrZoom()&&(this.measurement().placeEndpoint(i(e,t)),this._controller().draw(),n=!0)}n||this.panZoomTool().mouseUp(e,t,r),this._multiSelectMode=!1,this._lastX=void 0,this._lastY=void 0,this._activeHandle=void 0}select(){}_updateHoveredHandle(){}_topHandleUnderCursor(e,t,r){const n=this._controller().layerManager();return this.measurementFigure().handlesAt(e,t,{scale:r,layerManager:n}).first()}_project(){return this._controller().project()}}},84616:(e,t,r)=>{const n=r(63768),{DisplayProperties:i,EditableProperty:s}=r(7340),{$P:o,PolarCoordinate:a,Angle:l,AngleAnnotation:c}=r(62048),{simpleObserver:u,extend:d}=r(50988),h=r(36305),p=r(76905),m=r(68689),f=r(97477),g=r(11511),y=r(19075),b=r(98305),v=r(38374),_=r(33603),x=r(59602),w=[-Math.PI_4,Math.PI_2,Math.PI_4,0].map((e=>new a(1,e))),R="Should Lock Angle",k="Locked Angle";class RailingCollectionTool extends h{static toolPanelClassName(){return"RailingCollectionToolPanel"}category(){return x.editorTool}iconName(){return this._iconName||"default-dock"}setIconName(e){this._iconName=e}unit(){return this._controller().project().unit()}cursor(){return this._cursor??"crosshair"}setCursor(e){this._cursor=e}displayName(){return this._displayName??"Railing Collection"}setDisplayName(e){this._displayName=e}fractionPrecisionDenominator(){return this._fractionPrecisionDenominator||16}setFractionPrecisionDenominator(e){this._fractionPrecisionDenominator=e}railingCollectionType(){return this._railingCollectionType??f}setRailingCollectionType(e){this._railingCollectionType=e}railingPlacementStrategyType(){return this._railingPlacementStrategyType??m}setRailingPlacementStrategyType(e){this._railingPlacementStrategyType=e}showSurfaceHeightProperty(){return this._showSurfaceHeightProperty??!1}setShowSurfaceHeightProperty(e){this._showSurfaceHeightProperty=Boolean(e)}defaultDisplayProperties(){const e=[];return this._settingAngleAllowed()&&e.push(new s(this,R,{type:"boolean",label:"Lock Angle",disabled:!this.pendingAngle()}),new s(this,k,{type:"unit",defaultUnit:"deg",disabled:!this.pendingAngle(),label:"Angle",get:()=>this.angleFromPrevious(),inputHTML:{autoComplete:"off"}})),this._unconnectedAngleSnappingToggleAllowed()&&e.push(new s(this,"Unconnected Rail Angle Snapping",{type:"boolean",label:"Unconnected Rail Angle Snapping"})),e}_angleProperty(){return this.displayProperties().find((e=>e.name()===k))}_angleLockedProperty(){return this.displayProperties().find((e=>e.name()===R))}angleFromPrevious(){const e=this.pendingAngle()?.smallestDeltaDegrees()??0;return this.lockedAngle()??n.unit(e,"deg")}validateLockedAngle(e,t){if(this._controller().draw(),!e)return;const r=this.pendingRun()?.minimumAngleBetweenRuns()??90,i=n.unit(180,"deg"),s=n.unit(r,"deg");return n.larger(t,i)?`must be smaller than ${i.toString()}`:n.smaller(t,s)?`must be larger than ${s.toString()}`:void 0}formatLockedAngle(){return`${this.angleFromPrevious().toNumeric("deg").roundedTo(1)} deg`}lockedAngle(){if(this.shouldLockAngle())return this._lockedAngle}setLockedAngle(e){this._lockedAngle=e,this._shouldLockAngle=!0,this._angleLockedProperty()?.update(),this.resetAngleSnappingLine()}resetAngleSnappingLine(){if(!this._previousRun()||!this.shouldLockAngle())return;const e=this.pendingRun().edge(),t=this._snapDirectionForLockedAngle(this._previousRun(),e.direction()),r=this._snapPointToDirection(e.end(),t),n=e.begin().to(r).direction().multipliedBy(e.length()),i=e.begin().add(n);this._lockedAngleSnappingLine=e.begin().to(i)}lockedAngleSnappingLine(){return this._lockedAngleSnappingLine}shouldLockAngle(){return void 0===this._shouldLockAngle&&(this._shouldLockAngle=!1),this._shouldLockAngle}toggleShouldLockAngle(){this.setShouldLockAngle(!this.shouldLockAngle())}setShouldLockAngle(e){this._shouldLockAngle=e,this.shouldLockAngle()?this._lockedAngle=this.angleFromPrevious():this._lockedAngle=void 0,this._angleProperty()?.update()}unconnectedRailAngleSnapping(){return this._unconnectedRailAngleSnapping??=!0}toggleUnconnectedRailAngleSnapping(){this._unconnectedRailAngleSnapping=!this.unconnectedRailAngleSnapping()}angleSnapping(){return this._controller().angleSnapping()}toggleAngleSnapping(){this._controller().toggleAngleSnapping(),this.notifyAngleSnapToggledObservers()}shouldSnapAngle(){if(!this._unconnectedAngleSnappingToggleAllowed())return this.angleSnapping();return this.existingCollection()??this.pendingRun()?.previousRun()?this.angleSnapping():this.unconnectedRailAngleSnapping()}pendingAngle(){return this._pendingAngle}resetPendingAngle(){if(!this.pendingRun())return;const e=this._connectedRunOnExisting();let t;if(this.railingCollection().railingRuns().length>1)t=this.pendingRun().previousRun().edge().begin();else if(e){t=this.connectedToExistingBegin()?e.edge().end():e.edge().begin()}if(t){const e=this.pendingRun().edge();this._pendingAngle=new l(e.begin().xy(),e.end().xy(),t.xy()),this._angleAnnotation=new c(this._pendingAngle,36,2),this._angleAnnotation.setSignificantDecimalPlaces(this.angleAnnotationSignificantDecimalPlaces()),this._lockedAngle=void 0,this._shouldLockAngle=void 0}}angleSnapDirections(){return this._angleSnapDirections??w}setAngleSnapDirections(e){this._angleSnapDirections=e}disconnectedAngleSnapDirections(){return this._disconnectedAngleSnapDirections??this.angleSnapDirections()}setDisconnectedAngleSnapDirections(e){this._disconnectedAngleSnapDirections=e}angleAnnotationSignificantDecimalPlaces(){return this._angleAnnotationSignificantDecimalPlaces}setAngleAnnotationSignificantDecimalPlaces(e){this._angleAnnotationSignificantDecimalPlaces=e}angleAnnotation(){return this._angleAnnotation}reset(){this._railingCollection=void 0,this._railingCollectionFigure=void 0,this._pendingRun=void 0,this._existingCollection=void 0,this._snapLocationOnExisting=void 0,this._angleAnnotation=void 0,this._pendingAngle=void 0,this._lockedAngle=void 0,this._lockedAngleSnappingLine=void 0,this._shouldLockAngle=void 0,this._controller().redraw(),this.resetDisplayProperties(),this.resetContextMessage()}terminate(){const e=this.railingCollection();e.removeRun(this.pendingRun()),e.railingRuns().length>0&&(this._existingCollection?(e.railingRuns().forEach((e=>{const t=this.connectedToExistingBegin();this._addRunToExistingCollection(e,t)})),this._existingCollection.resetBoundingBox(),this._controller().recordChange()):(this._controller().addComponent(e),this._controller().select(e))),this.cancelAction()}_addRunToExistingCollection(e,t){const r=this._existingCollection,n=r.createRun(t?e.edge().reversed():e.edge(),e.placementStrategy().clone());t?r.prependRun(n):r.appendRun(n)}cancelAction(){this.reset(),this.notifySelfDeactivationEventObservers()}activate(){super.activate(),this._controller().setCursor(this.cursor()),this._controller().project().addCurrentVersionReplacedObserver(this,this.reset)}deactivate(){super.deactivate(),this._controller().project().removeCurrentVersionReplacedObserver(this,this.reset),this.reset()}pendingRun(){return this._pendingRun}defaultPlacementStrategy(){return this._defaultPlacementStrategy||(this._defaultPlacementStrategy=this._createDefaultPlacementStrategy()),this._defaultPlacementStrategy}_createDefaultPlacementStrategy(){const e=new(this.railingPlacementStrategyType())(void 0,this.fractionPrecisionDenominator());return e.setShowSurfaceHeightProperty?.(this.showSurfaceHeightProperty()),e}_isDoubleClick(e){return!!e&&2===e.detail}mouseUp(e,t,r){if(!this._isDoubleClick(r.event)&&(super.mouseUp(e,t,r),!this.didPan())){if(this.pendingRun()){if(this._updatePendingRunEnd(e,t),!this.pendingRun().isValid())return;this.pendingRun().stopEditing()}this._createNewPendingRun(e,t),this._closeLoopLocation&&(this.terminate(),this._closeLoopLocation=void 0),this._controller().draw(),this.updateContextMessage()}}_createNewPendingRun(e,t){const r=this.currentEnd(e,t),n=this.railingCollection(),i=this.strategyForPendingRun(r);this._pendingRun=n.createRun(i.initialEdge(r.xy(),this.unit(),n.sectionClass()),i),this.pendingRun().startEditing(),n.addRun(this.pendingRun()),this.pendingRun().previousRun()?.resetAnnotations(),this.resetPendingAngle()}strategyForPendingRun(e){if(this.pendingRun())return this.pendingRun().placementStrategy().clone();if(this._existingCollection){return this.railingPlacementStrategyType().fromLocator(e,this.unit(),this.defaultPlacementStrategy())}return this.defaultPlacementStrategy().clone()}currentEnd(e,t){if(this.pendingRun())return this.pendingRun().edge().end();const r=o(e,t),n=this.snappableLocationNear(e,t);return n?(this._existingCollection=n.collection,this._snapLocationOnExisting=n.side,n.locator().snapshot()):r}snappableLocationNear(e,t){const r=o(e,t),n=this._controller().project().railingCollections().flatMap((e=>e.snappableEndProxies())),i=p.findClosest(r,n).locatable;if(this._shouldSnapLocators(i?.locator(),r))return i}snappingTolerance(){const e=this._controller().scale(),t=Math.min(Math.max(18/e,6),36);return n.unit(t,"in")}mouseMove(e,t){super.mouseMove(e,t),this._snappableLocation=void 0,this.pendingRun()?this._updatePendingRunEnd(e,t):this._snappableLocation=this.snappableLocationNear(e,t)?.locator(),this._controller().draw()}doubleClick(){this.terminate()}draw(e,t){this.railingCollectionFigure().draw(e,t),this.railingCollectionFigure().drawAnnotations(e,t),super.draw(e,t),e._alterAndRestoreAfter((()=>{if(this._isTypingInAngleInput()){e.fillStyle="#000000";const t=document.getElementById(this._angleProperty().key());e.fillText(t.value,this.pendingRun().edge().begin().x(),this.pendingRun().edge().begin().y())}}))}guideAnnotations(){return[this.angleAnnotation(),...this.snappingGuideLineAnnotations(),...this.snappingGuideCircleAnnotations(),this.firstClickAnnotation()].filter(Boolean)}snappingGuideLineAnnotations(){const e=[this.lockedAngleSnappingLine(),this._snappingGuideEdge].filter(Boolean),t={strokeStyle:"#FFD45D",dashLength:15,dashGapLength:15,lineWidth:3};return e.map((e=>new b(e,t)))}snappingGuideCircleAnnotations(){const e=[this._snappableLocation,this._closeLoopLocation].filter(Boolean),t={radius:this.snappingTolerance().toNumeric(this.unit()),strokeStyle:"#FFD45D",fillStyle:"#FFD45D99",lineWidth:3,markCenter:!1};return e.map((e=>new v(e,t)))}firstClickAnnotation(){if(!this.pendingRun())return;const e=this.pendingRun().edge().begin(),t="#1fa0f6",r=`${t}4d`;return new(this._previousRun()?_:v)(e,{radius:this.snappingTolerance().toNumeric(this.unit()),width:this.snappingTolerance().toNumeric(this.unit()),strokeStyle:t,fillStyle:r,lineWidth:3,markCenter:!0})}existingCollection(){return this._existingCollection}connectedToExistingBegin(){return this._snapLocationOnExisting===f.LOCATIONS.begin}railingCollection(){if(!this._railingCollection){const e=this.railingCollectionType();this._railingCollection=new e,this._railingCollection.setComponentOf(this._controller().project())}return this._railingCollection}railingCollectionFigure(){return this._railingCollectionFigure||(this._railingCollectionFigure=this.railingCollection().defaultFigure()),this._railingCollectionFigure}_updatePendingRunEnd(e,t){const r=this.pendingRun(),n=r.edge().end();let i=o(e,t);const s=this._previousRun();let a=!0;const l=()=>a=!1;i=this._snapToStartPoint(i,l),i=this._snapToAngle(s,i),i=this._snapInlineWithStartPoint(i,l),r.moveEndpointTo(n,i,{constrainToValidPosition:!1,constrainToLengthIncrements:a})&&(this._controller().autoScrollCanvas?.(i),this.railingCollectionFigure().updateFigures(),this.resetDisplayProperties(),this._lockedAngleSnappingLine=void 0,this.__isTypingInAngleInput=!1)}enableSnapIfPossible(e,t,{ignoreZ:r=!1}={}){const n=this.pendingRun(),i=n.incrementOptional();let s=n.endpointMovedTo(n.edge().end(),e,{constrainToValidPosition:!1,constrainToLengthIncrements:!i});return r&&(s=s.xy()),!!s.equals(e)&&(i&&t(),!0)}_snapToStartPoint(e,t){this._closeLoopLocation=void 0;const r=this._startRun();if(!r||this.pendingRun().previousRun()===r)return e;const n=this._startPoint(),i=n.to(this.pendingRun().edge().begin()),s=this._shouldSnapLocators(e,n);if(r.validAngleWithEdge(i)&&s){if(this.enableSnapIfPossible(n,t))return this._closeLoopLocation=n,n}return e}_snapToAngle(e,t){const r=this.pendingRun().edge().begin();let n=this._nearestSnappableDirection(e,r.to(t)),i=this._snapPointToDirection(t,n);n=this._snapDirectionForLockedAngle(e,n),i=this._snapPointToDirection(t,n);const s=this._validateDirection(e,r.to(i));return this._snapPointToDirection(i,s)}_snapPointToDirection(e,t){const r=this.pendingRun().edge().begin(),n=r.to(r.add(t)),i=n.closestPointTo(e,!0);return n.containsPoint(i)?n.end():i}_nearestSnappableDirection(e,t){const r=t.direction();if(!this.shouldSnapAngle())return r;return this._localizedSnappableDirections(e).reduce(((e,t)=>Math.abs(r.dot(t))>Math.abs(r.dot(e))?t:e))}_snapDirectionForLockedAngle(e,t){if(!this.lockedAngle()||!e)return t;const r=this.lockedAngle().toNumeric("rad"),n=r.isNearTo(Math.PI)?0:r,i=e.makeAnglesRelative([new a(1,n),new a(1,-n)]);return e.edge().normal().dot(t)>0?i.first():i.last()}_validateDirection(e,t){const r=t.direction();if(!this._shouldValidatingDirection(e))return r;if(e.validAngleWithEdge(t))return r;const n=e.minimumAngleBetweenRuns().degreesToRadians();return e.makeAngleRelative(new a(1,n))}_localizedSnappableDirections(e){const t=e?this.angleSnapDirections():this.disconnectedAngleSnapDirections();return e?.makeAnglesRelative?.(t,e)||t}_shouldValidatingDirection(e){return!!e&&(!!this.shouldSnapAngle()||g.strategy().limitAngleWhenNotSnapping?.())}_snapInlineWithStartPoint(e,t){this._snappingGuideEdge=void 0;const r=this._startRun(),n=this.pendingRun();if(!r||r===n)return e;const i=r.edge(),s=this._startPoint(),o=n.edge().begin().to(e);let a;if(this._localizedSnappableDirections(r).forEach((t=>{const r=s.to(s.add(t)).intersectionsWithLineIn2D(o).first();this._shouldSnapLocators(e,r)&&(a=r)})),a&&!i.xy().containsPoint(a.xy())){if(this.enableSnapIfPossible(a,t,{ignoreZ:!0}))return this._snappingGuideEdge=s.to(a),a}return e}_shouldSnapLocators(e,t){if(!e||!t)return!1;return e.distanceTo(t)<this.snappingTolerance().toNumeric(this.unit())}_startRun(){return this._existingStartRun()??this.railingCollection().railingRuns().first()}_startPoint(){const e=this._startRun().edge();return this.existingCollection()&&this.connectedToExistingBegin()?e.end():e.begin()}_connectedRunOnExisting(){const e=this.existingCollection();if(!e)return;const t=this.railingCollection().railingRuns().first();if(this.connectedToExistingBegin()){const r=this.railingCollection().createRun(t.edge().reversed(),t.placementStrategy().clone());return e.nextRunFor(r)}return e.previousRunFor(t)}_existingStartRun(){if(!this.existingCollection())return;const e=this.existingCollection().railingRuns();return[e.first(),e.last()].find((e=>e!==this._connectedRunOnExisting()))}_previousRun(){return this.pendingRun()?.previousRun()||this._connectedRunOnExisting()}_focusPendingRunAngleInput(){if(!this.pendingAngle())return;const e=document.getElementById(this._angleProperty().key());e.focus(),e.select(),this.__isTypingInAngleInput=!0,this._controller().draw()}_isTypingInAngleInput(){return this.__isTypingInAngleInput??!1}_toggleLockAngle(){this.pendingAngle()&&(this.toggleShouldLockAngle(),this._angleLockedProperty().update())}_angleSnappingAllowed(){return g.strategy().allowAngleSnapToggle()}_unconnectedAngleSnappingToggleAllowed(){return g.strategy().allowUnconnectedAngleSnapToggle()}_settingAngleAllowed(){return g.strategy().allowSettingPendingRunAngle()}_keyboardShortcuts(){const e={cancelAction:[{keys:"esc"}],terminate:[{keys:"enter"}]};return this._angleSnappingAllowed()&&(e.toggleAngleSnapping=[{keys:"s"}]),this._unconnectedAngleSnappingToggleAllowed()&&(e.toggleUnconnectedRailAngleSnapping=[{keys:"shift+s"}]),this._settingAngleAllowed()&&(e._focusPendingRunAngleInput=[{keys:"shift+a"}],e._toggleLockAngle=[{keys:"shift+l"}]),e}keyboardShortcutsSlot(){return"RailingCollectionTool"}keyboardShortcutsInfo(){const e=[{modifiers:[],key:y.specialKeys.RETURN,title:"Complete Railing Collection"},{modifiers:[],key:y.specialKeys.ESCAPE,title:"Cancel Railing Collection"}];return this._angleSnappingAllowed()&&e.push({modifiers:[],key:"S",title:"Toggle Railing Angle Snapping"}),this._unconnectedAngleSnappingToggleAllowed()&&e.push({modifiers:[y.modifierKeys.SHIFT],key:"S",title:"Toggle Angle Snapping for Unconnected Rails"}),this._settingAngleAllowed()&&e.push({modifiers:[y.modifierKeys.SHIFT],key:"L",title:"Lock Placement Angle"},{modifiers:[y.modifierKeys.SHIFT],key:"A",title:"Set Placement Angle"}),e}updateContextMessage(){const e=this._previousRun()?"connected rail":"rail";this.setContextMessage(`Click to place ${e} end`)}_defaultContextMessage(){return"Click to start placing a rail"}}u(RailingCollectionTool,"angleSnapToggled"),u(RailingCollectionTool,"selfDeactivationEvent"),d(RailingCollectionTool,i),e.exports=RailingCollectionTool},32073:(e,t,r)=>{const{three:n}=r(37732),{$P:i}=r(62048),s=r(79591);e.exports=class RailingsDrawing3DController extends s{_shadowPlane(e,t,r){const i=super._shadowPlane(e,t,r);return this.project().planBackground()||(i.material=new n.MeshStandardMaterial({color:"#919176",side:n.DoubleSide})),i}_initialCameraZoomAdjustment(){const{topBound:e,rightBound:t,bottomBound:r,leftBound:n}=this._boundingCubeViewPlaneExtremes(),i=t.distanceTo(n),s=e.distanceTo(r),o=Math.max(i,s),a=this._cameraFieldOfView().degreesToRadians();return Math.abs(o/2/Math.tan(a/2))+10}_boundingCubeViewPlaneExtremes(){const e=this.boundingCube(),t=e.topRight(),r=e.bottomRight(),n=e.bottomLeft().addZ(e.height()),s=e.topLeft(),o=this._initialCameraDirection(),a=i(o.x,o.y,o.z).normalized();return{topBound:t,rightBound:this._projectPointToPlane(r,t,a),bottomBound:this._projectPointToPlane(n,t,a),leftBound:this._projectPointToPlane(s,t,a)}}_projectPointToPlane(e,t,r){const n=r.dot(e.subtract(t)),i=r.multipliedBy(n);return e.subtract(i)}}},61345:(e,t,r)=>{const n=r(63768),{NullDrawable:i}=r(7340),s=r(6556),o=r(45208),a=r(93387);e.exports=class RogueFabricatorsPicket extends o{railingColor(){return this.componentOf().railingColor()}materialLineItems(){return[new s(1,this.materialSpecifier())]}materialSpecifier(){const e=n.unit(this.edge().length(),this.unit()),t=this.formatter().format(e),r=this.referenceMaterialSpecifier(),i=this.railingColor(),s=`${r.name()} - ${t}`;return r.specifierFor(s,{[a.length]:t,materialName:i.materialName(),fillStyle:i.fillStyle(),strokeStyle:i.strokeStyle()})}referenceMaterialSpecifier(){const e=this.componentOf().railingStyle().materialSpecifierStyleId();return this.materials[`InfillPicket${e}`]}formatter(){return this.componentOf().formatter()}defaultFigure(){return new i(this)}materialParts(){return[this]}}},77281:(e,t,r)=>{const n=r(43320);e.exports=Object.freeze({black:new n("Black","metallic-black-low-gloss","#fff","#000"),white:new n("White","metallic-white-low-gloss","#fff","#000"),grey:new n("Grey","metallic-grey-low-gloss","#fff","#000")})},28731:(e,t,r)=>{const{Cube:n}=r(62048),{extend:i}=r(50988),s=r(17043),o=r(83102),a=r(76905),l=r(78089);class RogueFabricatorsExtrusionHole extends o{constructor(e,t){super(),this._edge=e,this._radius=t}edge(){return this._edge}radius(){return this._radius}locator(){return this.edge().begin()}endLocator(){return this.edge().end()}boundingCube(){return new n(1/0,1/0,1/0,-1/0,-1/0,-1/0)}projectedViewFigure(e,t,r){return new l(this,e,t,r)}locationAnnotationEdges(e){const t=this.edge().begin(),r=-this.radius().toNumeric(this.unit());return this._adjacentGeometryEdges(e).map((e=>e.closestPointTo(t).to(t).shiftedAlongNormalBy(r)))}centerIntersectEdges(e){const t=this.edge().begin();return this._adjacentGeometryEdges(e).map((e=>{const r=e.closestPointTo(t),n=a.directionTo(t,r);return e.movedByDelta(n)}))}diameterAnnotationEdges(e){const t=this.edge().center(),r=this.radius().toNumeric(this.unit()),n=e.normalized().multipliedBy(r),i=t.add(n.negated()),s=t.add(n);return[i.to(s)]}_adjacentGeometryEdges(e){if(!e)return[];const t=e.vertices(),r=e.edges(),n=this.edge().begin(),i=t.findSmallest((e=>n.distanceTo3D(e)));return r.filter((e=>e.containsPoint(i)))}}i(RogueFabricatorsExtrusionHole,s),e.exports=RogueFabricatorsExtrusionHole},45208:(e,t,r)=>{const{Angle:n}=r(62048),i=r(30202),s=r(9343),o=r(30691),a=r(5895),l=r(15096);e.exports=class RogueFabricatorsExtrusionMaterial extends i{makeDimensionAnnotation(e,t=30){const r=new(this.componentOf().systemStrategy().annotationType())(e,t,this.componentOf().unit(),{formatter:this.project().unitFormatter(),color:l.dimensionColor});return r.setLayer(a.PROJECTED_EXTRUSION_ANNOTATION),r}projectedAngleAnnotations(e,t,r){const n=this.shape3D().faces().find((e=>e.normal().dot(r).isNearTo(1)));if(!n)return[];const i=n.edges().map((n=>o.projectedEdge(n,e,t,r)));return this._angleEdgePairs(i).map((e=>this._angleAnnotationForEdgePair(e))).filter(Boolean)}_angleAnnotationForEdgePair(e){const[t,r]=e,n=this._angleBetweenEdges(t,r);if(n.smallestDeltaDegrees().isNearTo(90))return;const i=t.normal().add(r.normal()).normalized().multipliedBy(30),o=new s(`${n.smallestDeltaDegrees().roundedTo(2)}°`,n.vertex().add(i),n.vertex(),{color:l.dimensionColor});return o.setLayer(a.PROJECTED_EXTRUSION_ANNOTATION),o}_angleBetweenEdges(e,t){const r=e.begin().equals(t.end())?e.begin():e.end(),i=[e,t].map((e=>e.begin().equals(r)?e.end():e.begin()));return new n(r,i.first(),i.last())}_angleEdgePairs(e){return e.flatMap((e=>[e.begin(),e.end()])).uniqueValues().map((t=>e.filter((e=>e.begin().equals(t)||e.end().equals(t)))))}_isTopView(e,t,r){const n=this.localXAxis(),i=this.localYAxis();return e.equals(n)&&t.equals(i)}}},97010:(e,t,r)=>{const n=r(45208),i=r(26933),s=r(30691),o=r(98305),a=r(5895),l=r(15096);e.exports=class RogueFabricatorsExtrusionWithHoles extends n{holes(){return this._holes}setHoles(e){this._holes=e,this._holes.forEach((e=>{e.edge().relativeTo(this.locator()),e.setComponentOf(this)}))}projectedViewFigure(e,t,r){const n=super.projectedViewFigure(e,t,r),s=this.holes().map((n=>n.projectedViewFigure(e,t,r)));return i.withFigures([n,...s],e,t,r)}async clone(){const e=await super.clone(),t=await Promise.all(this.holes().map((e=>e.clone())));return e.setHoles(t),e}projectedAnnotations(e,t,r){return this.componentOf()?[...super.projectedAnnotations(e,t,r),...this.holeAnnotations(e,t,r),...this.holePositionLineAnnotations(e,t,r)]:[]}_isSideView(e,t){const r=e.dot(t);return Math.abs(r).isNearTo(1)}holeAnnotations(e,t,r){const n=this.shape3D().faces().find((e=>e.normal().dot(this.localZAxis()).isNearTo(1)));return this.holes().flatMap((r=>{const i=r.edge().direction();return this._isSideView(i,t)?r.diameterAnnotationEdges(e):r.locationAnnotationEdges(n)})).map((n=>{const i=s.projectedEdge(n,e,t,r),o=new(this.componentOf().systemStrategy().annotationType())(i,15,this.componentOf().unit(),{formatter:this.project().unitFormatter(),color:l.dimensionColor});return o.setLayer(a.PROJECTED_EXTRUSION_ANNOTATION),o}))}holePositionLineAnnotations(e,t,r){const n=this.shape3D().faces().find((e=>e.normal().dot(this.localZAxis()).isNearTo(1)));return this.holes().flatMap((e=>{const r=e.edge().direction();return this._isSideView(r,t)?[]:e.centerIntersectEdges(n)})).map((n=>{const i=s.projectedEdge(n,e,t,r);return new o(i)}))}}},11381:(e,t,r)=>{const{CompositeFigure:n}=r(7340),{Composite3DFigure:i}=r(37732),{Polygon:s,Cube:o}=r(62048),a=r(83102),l=r(26933);e.exports=class RogueFabricatorsGeminiTerminalRailLoop extends a{constructor(e,t,r){super(),this._edge=e,this._diameter=t,this._loopHeight=r}edge(){return this._edge}diameter(){return this._diameter}loopHeight(){return this._loopHeight}railingStyle(){return this.componentOf().railingStyle()}railClass(){return this.railingStyle().topRailClass()}railingColor(){return this.componentOf().railingColor()}rails(){return this._rails??=this._defaultRails()}_defaultRails(){const e=this.railClass(),t=this.loopHeight().toNumeric(this.unit()),r=this.edge(),n=this.edge().reversed().addZ(t).relativeToEdge(this.edge()),i=r.end().to(n.begin());return[r,n,i].map((t=>{const r=new e(t,this.diameter());return r.setComponentOf(this),r}))}geometry(){return new s([this.edge().begin(),this.edge().end()])}boundingCube(){return 0===this.components().length?this.edge().boundingBox().extrudedFromTo(0,0):o.mergedFiniteCubes(this.components())}defaultFigure(){return n.withModel(this)}threeFigure(){return i.withModel(this)}projectedViewFigure(e,t,r){return l.withModel(this,e,t,r)}components(){return[...this.rails()]}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_rails"]}}},55507:(e,t,r)=>{const{NullDrawable:n}=r(7340),i=r(6556),s=r(18037);e.exports=class RogueFabricatorsHorizontalBar extends s{materialLineItems(){return[new i(1,this.materialSpecifier())]}referenceMaterialSpecifier(){const e=this.componentOf().railingStyle().materialSpecifierStyleId();return this.materials[`InfillPicket${e}`]}defaultFigure(){return new n(this)}}},89064:(e,t,r)=>{const{Polygon:n,ExtrudedPolygon:i}=r(62048),s=r(93250);e.exports=class RogueFabricatorsPonyWall extends s{constructor(e,t){super(),this._edge=e,this._width=t}edge(){return this._edge}width(){return this._width}defaultGeometry(){const e=this.width().toNumeric(this.unit())/2,t=this.edge(),r=t.shiftedAlongNormalBy(e),i=t.shiftedAlongNormalBy(-e);return new n([...r.endpoints(),...i.reversed().endpoints()])}thickness(){return this.componentOf().ponyWallHeight()}shape3D(){return new i(this.geometry(),-this.thickness().toNumeric(this.unit()),void 0,!1)}showSlopeArrow(){return!1}}},14661:(e,t,r)=>{const n=r(54400),i=r(21856),s=r(42947),o=r(32972);e.exports=class RogueFabricatorsPricingStrategy extends n{allLineItems(e){return[...super.allLineItems(e),this._profitLineItem(e),this._overheadLineItem(e)]}_profitLineItem(e){return i.builder(o.Profit,{subtotal:this.subtotal(e)}).propertiesCollection({[s.quantity]:e.profitRatioProperty()}).build()}_overheadLineItem(e){return i.builder(o.Administrative,{subtotal:this.subtotal(e)}).propertiesCollection({[s.quantity]:e.overheadRatioProperty()}).build()}breakdownElementFor(e,t){const r=super.breakdownElementFor(e,t);return this._dangerRowSpecifiers().includes(e.specifier())&&r.setClasses(["parts-breakdown-table__row--danger"]),r}_dangerRowSpecifiers(){return[o.Profit,o.Administrative]}}},61159:(e,t,r)=>{const n=r(41030),{EditableProperty:i,ImperialDecimalLengthFormatter:s,ImperialFractionLengthFormatter:o}=r(7340),a=r(43812),l=r(86446),c=r(93387),u=r(5090),d=r(32972);e.exports=class RogueFabricatorsProject extends a{static decimalFormatterDecimalPlaces(){return 4}static formatterBuilders={DECIMAL:e=>new s(4,e,l),FRACTION:e=>new o(16,e,l)};decimalFormatterDecimalPlaces(){return this.constructor.decimalFormatterDecimalPlaces()}additionalLineItemNameColumn(){return c.description}profitRatio(){return this._profitRatio??=.25}setProfitRatio(e){this._profitRatio=e}profitRatioProperty(){return this._profitRatioProperty??=new i(this,"Profit Ratio",{type:"number",label:"Profit"})}overheadRatio(){return this._overheadRatio??=.1}setOverheadRatio(e){this._overheadRatio=e}overheadRatioProperty(){return this._overheadRatioProperty??=new i(this,"Overhead Ratio",{type:"number",label:"Administrative Overhead"})}defaultDisplayProperties(){return[...super.defaultDisplayProperties(),new i(this,"Unit Formatter Type",{type:"select",label:"Unit Format",choices:this.unitFormatterTypeChoices()})]}unitFormatter(e){return this.constructor.formatterBuilders[this.unitFormatterType()](e)}unitFormatterType(){return this._unitFormatterType??="FRACTION"}setUnitFormatterType(e){this._unitFormatterType=e,this.resetSectionComponents()}measurementSnapEdges(){return this.railingCollections().flatMap((e=>e.sections())).map((e=>e.componentLayoutEdge().xy()))}unitFormatterTypeChoices(){return["Decimal","Fraction"].map((e=>({label:e,value:e.toUpperCase()})))}resetSectionComponents(){this.railingCollections().forEach((e=>{e.resetSectionComponents()}))}logo(){return"rogue-fabricators-logo.png"}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_profitRatioProperty","_overheadRatioProperty","_railingRunMap","_assemblyUsageMap"]}get materials(){return d}pdfDocumentClass(){return n}uniquePosts(){return this.railingCollections().flatMap((e=>e.sections())).flatMap((e=>e.railingPosts())).uniqueValues()}externalPersistenceJSON(e,t){const r=this.breakdownLineItems({priceList:e,materialDefinitions:t}).map((e=>{const t=e.valueMap();return{CartItemName:`${t.get(c.description)} ${t.get(c.length)}`,ItemType:"Miscellaneous",MaterialQuantity:t.get(c.quantity)??1}}));return JSON.stringify(r)}materialParts(){return this.components().flatMap((e=>e.materialParts?.()??[])).filter((e=>e))}partLineItems(){return this.materialList().lineItems().filter((e=>!e.specifier().details().abstractPart))}partLineItemIdentifierMap(){const e={};return this.partLineItems().forEach(((t,r)=>{e[t.specifier().identifier()]=`P${r+1}`})),e}railingRunMap(){return this._railingRunMap??=this._defaultRailingRunMap()}_defaultRailingRunMap(){const e=this.railingCollections().flatMap((e=>e.railingRuns())),t=e.map((e=>e.beginSection().railingStyle().label)).uniqueValues(),r={};return t.forEach((e=>r[e]=0)),new u(e.map((e=>{const t=e.beginSection().railingStyle().label,n=`${t} ${r[t]+1}`;return r[t]+=1,[e,n]})))}assemblyUsageMap(){return this._assemblyUsageMap??=this._defaultAssemblyUsageMap()}_defaultAssemblyUsageMap(){const e=this.uniquePosts(),t=this.railingCollections().flatMap((e=>e.sections())).flatMap((e=>e.railingPosts())),r=new u(e.map((e=>[e,{count:0,usedBy:[]}]))),n=this.railingRunMap();return new u(t.map((e=>{const t=r.get(e),i=e.section().run(),s=n.get(i);return t.count+=1,t.usedBy.includes(s)||t.usedBy.push(s),[e,t]})))}}},57674:(e,t,r)=>{const n=r(63768),{EditableProperty:i}=r(7340),s=r(97477),o=r(72768),a=r(17229),l=r(77281),c=r(67603),u=r(25630),d=r(84514);e.exports=class RogueFabricatorsRailingCollection extends s{sectionClass(){return o}runClass(){return a}defaultDisplayProperties(){return new d(this,[new u(this.sections(),"showOnCollection"),new c(this,[new i(this,"Railing Height",{type:"select",choices:this.railingHeightChoices()}),new i(this,"Railing Color",{type:"select",choices:this.railingColorChoices()}),this.baselineHeightProperty(),new i(this,"Flip Platform",{type:"action",perform:()=>this.toggleStructureSide()})])])}railingHeight(){return this._railingHeight??this.railingHeightChoices().first().value}setRailingHeight(e){this._railingHeight=e,this.resetSectionComponents()}railingHeightChoices(){return[n.unit(36,"in"),n.unit(42,"in")].map((e=>({label:`${e.toNumeric("in")}"`,value:e})))}railingColor(){return this._railingColor??=this.railingColorChoices().first().value}setRailingColor(e){this._railingColor=e,this.resetSectionComponents()}railingColorChoices(){return Object.values(l)}existingPostAtBegin(e){const t=this.previousSectionFor(e),r=t?.endPost();if(!r)return;const n=e.postLayoutEdge().xy(),i=r.locator().xy();return n.containsPoint(i)?r:void 0}existingPostAtEnd(e){const t=this.nextSectionFor(e),r=t?.beginPost();if(!r)return;const n=e.postLayoutEdge().xy(),i=r.locator().xy();return n.containsPoint(i)?r:void 0}materialParts(){return this.components().flatMap((e=>e.materialParts?.()??[]))}}},2902:(e,t,r)=>{const n=r(63768),{EditableProperty:i}=r(7340),{$P:s}=r(62048),o=r(70971),a=r(7491);e.exports=class RogueFabricatorsRailingPlacementStrategy extends o{defaultDisplayProperties(){return this.baseDisplayProperties()}displayPropertiesExposedAfterDrawing(){return[new i(this,"Run",{type:"unit",defaultUnit:"in",label:"Section Run",ignoreIntermediateEdits:!0}),new i(this,"Landing To Landing Rise",{type:"unit",defaultUnit:"in",label:"Section Rise",ignoreIntermediateEdits:!0}),new i(this,"Stair Riser Count",{type:"number",label:"Nosings",ignoreIntermediateEdits:!0})]}landingToLandingRise(){return this._landingToLandingRise??=n.unit(0,"in")}setLandingToLandingRise(e){this._landingToLandingRise=e,this.updateRailingRun(this.rise())}validateLandingToLandingRise(e,t){if(!e)return;const r=n.unit(0,"in");if(n.smaller(t,r)){return`Must be ${this.lengthFormatter().format(r)} or more.`}}rise(){return this.isStairs()?n.subtract(this.landingToLandingRise(),this.stepRise()):this.landingToLandingRise()}run(){return this.railingRun()?n.unit(this.railingRun().edge().xy().length(),this.unit()):n.unit(0,"in")}setRun(e){this.updateRailingRun(void 0,e)}unitFormatter(){return this.railingRun().project().unitFormatter()}formatRun(){return this.unitFormatter().format(this.run())}validateRun(e,t){if(!e)return;const r=this.railingRun().sections().first().minLength();if(n.smaller(t,r)){return`Must be ${this.lengthFormatter().format(r)} or more.`}}clone(){const e=super.clone();return e.setStairRiserCount(this.stairRiserCount()),e.setLandingToLandingRise(this.landingToLandingRise()),e}stairRiserCount(){return this._stairRiserCount??=this._defaultStairRiserCount()}setStairRiserCount(e){const t=e<0?0:Math.floor(e);this._stairRiserCount=t,this.updateRailingRun()}_defaultStairRiserCount(){const e=this.run().toNumeric(this.unit()),t=n.unit(11,"in").toNumeric(this.unit());return Math.round(e/t)}nosingOverhang(){return n.unit(1,"in")}updateRailingRun(e=this.rise(),t=this.run()){this.railingRun()?.updateEdge(e,t)}stepRise(){return 0===this.stairRiserCount()?this.landingToLandingRise():n.divide(this.landingToLandingRise(),this.stairRiserCount())}stepRun(){return 0===this.stairRiserCount()?this.run():n.divide(this.run(),this.stairRiserCount()-1)}initialEdge(e,t,r){const n=this.incrementSize(r).toNumeric(t),i=-this.surfaceHeight().toNumeric(t),o=s(e.x(),e.y(),i),a=o.add(n);return o.to(a)}isRamp(){return!this.isLevel()&&0===this.stairRiserCount()}isLevel(){return this.rise().equals(n.unit(0,"in"))}isStairs(){return this.stairRiserCount()>0&&n.larger(this.landingToLandingRise(),n.unit(0,"in"))}minLength(){const e=this.railingRun().sections().first().minLength(),t=this.slopeRadians();return n.divide(e,Math.cos(t))}endpointMovedTo(e,t,{constrainToValidPosition:r,constrainToLengthIncrements:n}={}){const i=super.endpointMovedTo(e,t,{constrainToValidPosition:r,constrainToLengthIncrements:n}),s=this.railingRun().edge(),o=e===s.begin()?s.begin().z():s.end().z();return i.addZ(o)}_generateStructureRepresentation(...e){return this.isStairs()?this._generateSteppedStructureRepresentation(...e):super._generateStructureRepresentation(...e)}_generateSteppedStructureRepresentation(e,t,r){const n=e.end().z()>e.begin().z()?e.begin().to(t.begin()):t.end().to(e.end()),i=[n.begin(),n.end()];return-1===r&&i.reverse(),new a(i,this.rise(),this.stepRise(),this.stepRun(),this.railingRun())}_structureMountingEdge(e,t){const r=super._structureMountingEdge(e,t),n=this.railingRun().platformLayoutEdgeOffset();return n?r.movedBy(n.x(),n.y(),n.z()).relativeToEdge(this.railingRun().edge()):r}postInsetFromEndOfStep(){return this._postInsetFromEndOfStep??=n.unit(0,"in")}setPostInsetFromEndOfStep(e){this._postInsetFromEndOfStep=e}pitch(){return n.divide(this.rise(),this.run())}slope(){const e=this.slopeRadians(),t=n.round(e.radiansToDegrees(),2);return n.unit(t,"deg")}slopeRadians(){return n.atan(this.pitch())}}},17229:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),{NormalToEdgeLocator:s}=r(62048),o=r(33496),a=r(2902),l=r(9343),c=r(37766);e.exports=class RogueFabricatorsRailingRun extends o{incrementSize(){return n.unit(1/16,this.unit())}placementStrategy(){return this._placementStrategy??=new a(this)}platformLayoutEdgeOffset(){const e=this.platformLayoutEdgeOffsetForBegin(),t=this.platformLayoutEdgeOffsetForEnd(),r=this.platformLayoutEdgeZOffset(this.postProvider().continuousRailingRunsFor(this).first());return e?e.addZ(r):(t??i(0,0,0)).addZ(r)}platformLayoutEdgeZOffset(e){const t=this.previousRun();if(this===e||!t)return 0;const r=this.placementStrategy().isStairs(),n=this.sections().first().isBeginAtStairBottom(),i=this.placementStrategy().stepRise().toNumeric(this.unit());let s=0;r&&n&&(s+=-i);const o=t.sections().last(),a=o.edge().end(),l=o.isSlopeBottomAt(a)&&o.isStairs(),c=t.placementStrategy().stepRise().toNumeric(this.unit());return s+=l?c:0,this.previousRun().platformLayoutEdgeZOffset(e)+s}platformLayoutEdgeOffsetForBegin(){const e=this.previousRun();if(e)return this.beginSection().isEndAtSlopeBottom()||this.edge().isParallelTo(e.edge())?e.platformLayoutEdgeOffsetForBegin():void 0}platformLayoutEdgeOffsetForEnd(){const e=this.nextRun();if(e)return this.endSection().isBeginAtSlopeBottom()||this.edge().isParallelTo(e.edge())?e.platformLayoutEdgeOffsetForEnd():void 0}updateEdge(e,t){super.updateEdge(e,t),this.sections().forEach((e=>e.coerceStairMountSurface()))}hasStringer(){return this.sections().first().hasStringer()}showStairLandings(){return!1}_postWidth(){return this.sections().first().postLength()}materialParts(){return this.components().flatMap((e=>e.materialParts?.()??[]))}lowestZ(){return super.lowestZ()+this.platformLayoutEdgeZOffset(this.postProvider().continuousRailingRunsFor(this).first())}buildDetails(){return this.sections().first().buildDetails()}defaultAnnotations(){return[...super.defaultAnnotations(),this.runLabelAnnotation()]}runLabelAnnotation(){const e=this.project().railingRunMap().get(this),t=this.structureAlongNormal()?-1:1,r=this.sections().first().componentLayoutLine().begin(),n=this.sections().last().componentLayoutLine().end(),i=r.to(n).center(),o=new s(i,30*t),a=new l(e,o,i,{orthogonalTextRendering:!0});return a.setLayer(c.RUN_LABELS),a}}},79256:e=>{e.exports=class RogueFabricatorsStairPostSpacingHelper{constructor(e,t){this._maxPostSpacing=e,this._unit=t}maxPostSpacing(){return this._maxPostSpacing}unit(){return this._unit}railLengths(e){const t=e.length(),r=this.maxPostSpacing().toNumeric(this.unit()),n=Math.ceil(t/r);return Array(n).fill(e.length()/n)}setMode(){}}},15096:e=>{e.exports={centerlineColor:"#ff0000",centerlineDashLength:3,centerlineDashGapLength:2,dimensionColor:"#0A02EA"}},34290:(e,t,r)=>{const n=r(44476);e.exports=class RogueFabricatorsDimensionAnnotation extends n{constructor(e,t,r,n,i){super(e,t,r,i),this._formatter=n}formatter(){return this._formatter}text(){return this.formatter().format(this.measurement())}}},44041:(e,t,r)=>{const n=r(63768),i=r(42492);e.exports=class RogueFabricatorsGeminiBlock extends i{railDiameter(){return this.railingStyle().bottomRailWidth()}railHeight(){return n.unit(3.25,"in")}railClass(){return this.railingStyle().topRailClass()}railingColor(){return this.componentOf().railingColor()}_defaultInfill(){const e=this.railClass(),t=this.edge().xy().direction(),r=new e(this.railEdge(),this.railDiameter());return r.setComponentOf(this),r.setBeginMiterDirection(t),r.setEndMiterDirection(t),[r]}railEdge(){const e=this.interiorEdge(),t=-this.railHeight().toNumeric(this.unit());return e.addZ(t).relativeToEdge(this.edge())}}},96823:(e,t,r)=>{const{Unit:n,ProportionalEdgeLocator:i}=r(62048),s=r(55507),o=r(42492),a=r(44476),l=r(30691),c=r(20149),u=r(52832),d=r(15096);e.exports=class RogueFabricatorsHorizontalBarBlock extends o{railingColor(){return this.componentOf().railingColor()}barGap(){return this.railingStyle().barGap()}infill(){const e=this.interiorEdge(),t=this.componentOf().railingHeight().toNumeric(this.unit()),r=e.snapshot().addZ(-t);return this._barHeights().map((e=>r.movedBy(0,0,e).relativeToEdge(this.edge()))).map((e=>this.makeBar(e)))}_barHeights(){const e=this.componentOf().railingHeight(),t=this.railingStyle().barCountForHeight(e),r=this.railingStyle().barDepth().toNumeric(this.unit()),n=this.barGap().toNumeric(this.unit())+r,i=[n+this.railingStyle().railDepth().toNumeric(this.unit())],s=t-1;for(let e=0;e<s;e++){const e=i.last();i.push(e+n)}return i}makeBar(e){const t=this.railingStyle().barWidth(),r=this.railingStyle().barDepth(),n=this.edge().xy().direction(),i=new s(e,t,r);return i.setComponentOf(this),i.setBeginMiterDirection(n),i.setEndMiterDirection(n),i}projectedAnnotations(e,t,r){return[...super.projectedAnnotations(e,t,r),this._projectedTopRailToTopBarAnnotation(e,t,r),this._projectedBlockLengthAnnotation(e,t,r)].filter((e=>e))}_projectedTopRailToTopBarAnnotation(e,t,r){const i=this.infill().first(),s=this.componentOf().rails().first(),o=this.componentOf().railingHeight().toNumeric(this.unit()),a=this.railingStyle().barDepth().toNumeric(this.unit())/2,u=i.centerlineEdge().addZ(-a).center(),h=u.to(u.addZ(-o)),p=this.railingStyle().railDepth().toNumeric(this.unit())/2,m=s.centerlineEdge().addZ(p).intersectionsWithEdge(h).first(),f=l.projectedEdge(u.to(m),e,t,r),g=this.project().unitFormatter(),y=new n(f.length(),this.unit()),b=g.format(y);return new c(f,`${b} TYP`,0,{color:d.dimensionColor,crampedTextAngle:this._projectedCrampedTextAngle(e,t,r)})}_projectedBlockLengthAnnotation(e,t,r){const n=-this.componentOf().railingHeight().toNumeric(this.unit()),i=this.interiorEdge().addZ(n).reversed(),s=l.projectedEdge(i,e,t,r);return new a(s,15,this.unit(),{formatter:this.project().unitFormatter(),color:d.dimensionColor})}projectedBottomRailHeightAnnotation(e,t,r){const n=this.infill().last().edge().begin().z();if(!this.isFirstBlock())return;const s=new i(this.edge(),.25),o=s.addZ(n),a=l.projectedEdge(s.to(o),e,t,r);return new u(a,0,this.unit(),{formatter:this.project().unitFormatter(),color:d.dimensionColor})}_projectedCrampedTextAngle(e,t,r){return l.projectedEdge(this.edge().reversed(),e,t,r).angle()}}},38252:(e,t,r)=>{const n=r(63768),{extend:i}=r(50988),{Unit:s,ProportionalEdgeLocator:o}=r(62048),a=r(42492),l=r(18037),c=r(99343),u=r(61345),d=r(20149),h=r(30691),p=r(34290),m=r(44476),f=r(34662),g=r(15096);class RogueFabricatorsPicketRailingBlock extends a{static middleToTopRailGap(){return n.unit(3.75,"in")}railingHeight(){return this.componentOf().railingHeight()}bottomRailWidth(){return this.railingStyle().bottomRailWidth()}bottomRailDepth(){return this.railingStyle().bottomRailDepth()}bottomRailHeight(){return n.unit(1.5,"in")}middleRailWidth(){return this.bottomRailWidth()}middleRailDepth(){return this.bottomRailDepth()}middleRailHeight(){const e=this.constructor.middleToTopRailGap(),t=this.middleRailDepth(),r=this.railingStyle().railDepth(),i=n.add(e,t,r);return n.subtract(this.railingHeight(),i)}infillSpacing(){return n.unit(4.2955,"in")}infillBottomHeight(){return n.add(this.bottomRailHeight(),this.bottomRailDepth())}infillTopHeight(){return this.middleRailHeight()}infillClass(){return u}picketWidth(){return n.unit(.75,"in")}railingColor(){return this.componentOf().railingColor()}bottomRail(){return this._bottomRail??=this._defaultBottomRail()}_defaultBottomRail(){const e=-this.bottomRailHeight().toNumeric(this.unit());return this._makeRail(this._railEdgeAtHeight(e),this.bottomRailWidth(),this.bottomRailDepth(),"Bottom")}middleRail(){return this._middleRail??=this._defaultMiddleRail()}_defaultMiddleRail(){const e=-this.middleRailHeight().toNumeric(this.unit());return this._makeRail(this._railEdgeAtHeight(e),this.middleRailWidth(),this.middleRailDepth(),"Middle")}extensionRails(){return this._extensionRails??=this._defaultExtensionRails()}_defaultExtensionRails(){if(this.componentOf().isFasciaMount())return[];const e=this.componentOf().postMountStyle().anchorOffset(),t=n.divide(this.componentOf().railingStyle().postLength(),2),r=n.subtract(e,t).toNumeric(this.unit()),i=[],s=[];if(this._shouldExtendRailAtBegin()){const e=this.bottomRail().edge().begin(),t=this.middleRail().edge().begin(),n=e.add(this.edge().xy().direction().negated().multipliedBy(r)).relatedTo(e),o=t.add(this.edge().xy().direction().negated().multipliedBy(r)).relatedTo(t);i.push(n.to(e)),s.push(o.to(t))}if(this._shouldExtendRailAtEnd()){const e=this.bottomRail().edge().end(),t=this.middleRail().edge().end(),n=e.add(this.edge().xy().direction().multipliedBy(r)).relatedTo(e),o=t.add(this.edge().xy().direction().multipliedBy(r)).relatedTo(t);i.push(e.to(n)),s.push(t.to(o))}return[...i.map((e=>this._makeRail(e,this.bottomRailWidth(),this.bottomRailDepth(),"Bottom"))),...s.map((e=>this._makeRail(e,this.middleRailWidth(),this.middleRailDepth(),"Middle")))]}_shouldExtendRailAtBegin(){const e=this.componentOf();return this.isFirstBlock()&&e.isCornerAtBegin()&&e.isBeginAtSlopeTop()}_shouldExtendRailAtEnd(){const e=this.componentOf();return this.isLastBlock()&&e.isCornerAtEnd()&&e.isEndAtSlopeTop()}_railEdgeAtHeight(e){const t=this._shouldInsetRailEdgeBegin(),r=this._shouldInsetRailEdgeEnd(),n=t?this._railEdgeInset():0,i=r?this._railEdgeInset():0,s=this.interiorEdge();return h.stretchedEdgeBy(s,n,i).addZ(e).relativeToEdge(this.edge())}_railEdgeInset(){const e=this.componentOf(),t=this.railingStyle(),r=e.isFasciaMount()?t.fasciaLayoutEdgeOffset():e.postMountStyle().anchorOffset(),i=n.divide(t.postLength(),2),s=n.subtract(r,i),o=e.slope();return-n.divide(s,n.cos(o)).toNumeric(this.unit())}_shouldInsetRailEdgeBegin(){const e=this.componentOf();if(e.isTreadMountStairs())return!1;const t=e.isCornerAtBegin()&&e.isBeginAtSlopeTop();return this.isFirstBlock()&&t}_shouldInsetRailEdgeEnd(){const e=this.componentOf();if(e.isTreadMountStairs())return!1;const t=e.isCornerAtEnd()&&e.isEndAtSlopeTop();return this.isLastBlock()&&t}rails(){return this._rails??=this._defaultRails()}_defaultRails(){const e=[this.bottomRail(),this.middleRail(),...this.extensionRails()];return this.connectedExtrusionsMiterHelper().miterExtrusions(e),e}_makeRail(e,t,r,n){const i=new l(e,t,r,n);return i.setComponentOf(this),i}connectedExtrusionsMiterHelper(){return this._connectedExtrusionsMiterHelper??new f(this._defaultMiterDirection())}_defaultMiterDirection(){return this.edge().xy().direction()}projectedAnnotations(e,t,r){return[...super.projectedAnnotations(e,t,r),this.projectedPostToPicketSpacingAnnotation(e,t,r),this.projectedPicketSpacingAnnotation(e,t,r),this.projectedBlockInteriorWidthAnnotation(e,t,r),this.projectedMiddleRailToTopRailAnnotation(e,t,r),this.projectedBlockLengthAnnotation(e,t,r)].filter(Boolean)}projectedPostToPicketSpacingAnnotation(e,t,r){const n=this.beginPost();if(!n)return;const i=this.infill().first(),s=n.width().toNumeric(this.unit())/2,o=this.picketWidth().toNumeric(this.unit())/2,a=this.edge().direction(),l=i.edge().center(),c=l.z(),u=n.locator().add(a.multipliedBy(s)).xy().addZ(c),d=l.subtract(a.multipliedBy(o)),m=h.projectedEdge(u.to(d),e,t,r);return new p(m,0,this.unit(),this.project().unitFormatter(),{color:g.dimensionColor})}projectedPicketSpacingAnnotation(e,t,r){if(this.infill().length<2)return;const[n,i]=this.infill().slice(0,2),a=new o(n.edge(),.25),l=i.edge().begin().xy().addZ(a.z()),c=this.picketWidth().toNumeric(this.unit()),u=a.to(l).stretchedBy(-c),p=h.projectedEdge(u,e,t,r),m=this.project().unitFormatter(),f=new s(p.length(),this.unit()),y=m.format(f);return new d(p,`${y} TYP`,0,{color:g.dimensionColor})}projectedBlockInteriorWidthAnnotation(e,t,r){const n=-this.bottomRailHeight().toNumeric(this.unit())-5*this.bottomRailDepth().toNumeric(this.unit()),i=this.interiorEdge().addZ(n),s=h.projectedEdge(i,e,t,r);return new p(s,0,this.unit(),this.project().unitFormatter(),{color:g.dimensionColor})}projectedMiddleRailToTopRailAnnotation(e,t,r){const n=this.middleRail(),i=this.componentOf().railingHeight().toNumeric(this.unit())-this.middleRailHeight().toNumeric(this.unit()),s=new o(n.edge(),.25),a=s.addZ(-i).to(s),l=this.middleRailDepth().toNumeric(this.unit()),c=this.railingStyle().railDepth().toNumeric(this.unit()),u=h.stretchedEdgeBy(a,-l,-c),d=h.projectedEdge(u,e,t,r);return new m(d,0,this.unit(),{formatter:this.project().unitFormatter(),color:g.dimensionColor,crampedTextAngle:0})}projectedBlockLengthAnnotation(e,t,r){const n=this.componentOf().railingHeight().toNumeric(this.unit()),i=this.edge().reversed().addZ(-n),s=h.projectedEdge(i,e,t,r);return new m(s,15,this.unit(),{formatter:this.project().unitFormatter(),color:g.dimensionColor})}components(){return[...super.components(),...this.rails()]}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_connectedExtrusionsMiterHelper"]}}i(RogueFabricatorsPicketRailingBlock,c),e.exports=RogueFabricatorsPicketRailingBlock},42492:(e,t,r)=>{const n=r(63768),{ProportionalEdgeLocator:i}=r(62048),s=r(84155),o=r(30691),a=r(52832),l=r(15096);e.exports=class RogueFabricatorsRailingBlock extends s{materialParts(){return this.components().flatMap((e=>e.materialParts?.()??[]))}interiorEdge(){const e=-n.divide(this.railingStyle().postLength(),n.cos(this.componentOf().slope())).toNumeric(this.unit());return this.edge().stretchedBy(e).relativeToEdge(this.edge())}formatter(){return this.project().unitFormatter(!0)}projectedAnnotations(e,t,r){return[this.projectedBottomRailHeightAnnotation(e,t,r)].filter(Boolean)}projectedBottomRailHeightAnnotation(e,t,r){const n=-this.bottomRailHeight().toNumeric(this.unit());if(!this.isFirstBlock()||n.isNearTo(0))return;const s=new i(this.edge(),.25),c=s.addZ(n),u=o.projectedEdge(s.to(c),e,t,r);return new a(u,0,this.unit(),{formatter:this.project().unitFormatter(),color:l.dimensionColor})}bottomRailHeight(){return n.unit(0,"in")}}},35730:(e,t,r)=>{const n=r(63768),i=r(84726);e.exports=class RogueFabricatorsColosseumPostLayoutEdgeInsetHelper extends i{parallelSlopeTopTransitionInset(e,t){const r=e.isLevel(),i=t.isTreadMountStairs();return r&&i?n.multiply(this.terminalInset(e),3):this.terminalInset(e)}cornerSlopeTopTransitionInset(e,t){const r=t.isLevel(),i=e.isLevel(),s=e.postMountStyle().isFasciaMount();return e.edge().isPerpendicularTo(t.edge())&&r&&!s?e.terminalPostInset():i?n.multiply(e.terminalPostInsetWithGap(),-1):this.terminalInset(e)}parallelSlopeBottomTransitionInset(e,t){return this.terminalInset(e)}}},41455:(e,t,r)=>{const{RailingLayoutInsetHelper:n}=r(8423),i=r(63768);e.exports=class RogueFabricatorsComponentLayoutEdgeInsetHelper extends n{levelInset(e,t,r){return i.unit(0,"in")}slopedInset(e,t,r){return i.unit(0,"in")}parallelSlopeTransitionInset(e,t,r){return!r&&t.isStairs()?e.placementStrategy().nosingOverhang():i.unit(0,"in")}cornerSlopeTopTransitionInset(e,t){if(e.sloped())return i.unit(0,"in");return i.divide(e.postWidth(),2)}cornerSlopeBottomTransitionInset(e,t){if(e.sloped())return i.unit(0,"in");const r=i.divide(e.postWidth(),2);return i.multiply(r,-1)}}},34662:e=>{e.exports=class RogueFabricatorsConnectedExtrusionsMiterHelper{constructor(e){this._defaultMiterDirection=e}defaultMiterDirection(){return this._defaultMiterDirection}miterExtrusions(e,t=[]){const r=[...e,...t];e.forEach((e=>{const t=e.edge(),n=this.extrusionAtEndpoint(t.begin(),e,r),i=this.extrusionAtEndpoint(t.end(),e,r),s=this.miterDirectionFor(e,n)??e.beginMiterDirection(),o=this.miterDirectionFor(e,i)??e.endMiterDirection();e.setBeginMiterDirection(s),e.setEndMiterDirection(o)}))}extrusionAtEndpoint(e,t,r){const n=t.edge(),i=e.equals(n.begin());return r.find((r=>{if(r===t)return!1;const n=r.edge(),s=i?n.end():n.begin();return e.equals(s)}))}miterDirectionFor(e,t){return e&&t?this._miterDirectionBetweenEdges(e.edge(),t.edge()):this.defaultMiterDirection()}_miterDirectionBetweenEdges(e,t){if(e.isParallelToIn3D(t))return;const r=e.direction(),n=t.direction();return r.add(n).normalized()}}},36964:(e,t,r)=>{const{RailingLayoutInsetHelper:n}=r(8423),i=r(63768);e.exports=class RogueFabricatorsCoreMountPostLayoutEdgeInsetHelper extends n{insetFor(e,t){return i.unit(0,"in")}}},97691:(e,t,r)=>{const n=r(84726);e.exports=class RogueFabricatorsHandGrabPostLayoutEdgeInsetHelper extends n{insetFor(e,t){if(!this._isLocatorSectionEdgeEndpoint(e,t))return this.fallbackInset(e);const r=e.sectionConnectedAt(t);if(!r)return this.terminalInset(e);const n=e.isLevel()&&r.isLevel(),i=e.isParallelToSection(r);return n&&i?this.parallelInset(e,r):this.terminalInset(e)}}},43506:(e,t,r)=>{const n=r(63768),i=r(41455);e.exports=class RogueFabricatorsJavelinComponentLayoutEdgeInsetHelper extends i{cornerSlopeTopTransitionInset(e,t){return n.unit(0,"in")}cornerSlopeBottomTransitionInset(e,t){if(e.isLevel()||!e.isStairs())return n.unit(0,"in");const r=e.slope(),i=n.multiply(e.railingStyle().layoutEdgeOffset(),-1);return n.divide(i,n.cos(r))}}},84726:(e,t,r)=>{const{RailingLayoutInsetHelper:n}=r(8423),i=r(63768);e.exports=class RogueFabricatorsPostLayoutEdgeInsetHelper extends n{terminalInset(e){return i.multiply(e.terminalPostInset(),-1)}rightAngleInset(e,t){return i.multiply(e.rightAngleCornerPostInset(),-1)}obliqueInset(e,t){const r=e.sectionConnectedToBegin()===t?e.angleAtBegin():e.angleAtEnd();return i.multiply(e.obliqueCornerPostInset(r),-1)}parallelSlopeTopTransitionInset(e,t){return e.isLevel()?this.terminalInset(e):e.terminalPostInset()}parallelSlopeBottomTransitionInset(e,t){const r=e.sloped(),n=t.isStairs();if(r||n)return this.terminalInset(e);const s=e.terminalPostInset(),o=e.placementStrategy().nosingOverhang(),a=i.add(s,o);return i.multiply(a,-1)}cornerSlopeTopTransitionInset(e,t){const r=t.isLevel(),n=e.isLevel(),s=e.postMountStyle().isFasciaMount(),o=e.edge().isPerpendicularTo(t.edge());if(n)return e.terminalPostInset();if(o&&r&&!s){const t=e.postMountStyle().anchorOffset(),r=e.slope();return i.divide(t,i.cos(r))}return this.terminalInset(e)}cornerSlopeBottomTransitionInset(e,t){return this.terminalInset(e)}}},93387:e=>{e.exports={item:"Item",description:"Description",quantity:"Quantity",unit:"Unit",unitPrice:"Unit Price",amount:"Amount",invoice:"Invoice",partNumber:"Individual Part #",materialGrade:"Material Grade",length:"Length"}},86446:e=>{e.exports={feetInchesSeparator:"–"}},32972:(e,t,r)=>{const{MaterialSpecifier:n}=r(93613),i=r(57418),s=[new n("LinearFeetOfRailingColosseum","Linear Feet Of Railing: Colosseum",{hideInPDF:!0,abstractPart:!0}),new n("LinearFeetOfRailingOrion","Linear Feet Of Railing: Orion",{hideInPDF:!0,abstractPart:!0}),new n("LinearFeetOfRailingTriton","Linear Feet Of Railing: Triton",{hideInPDF:!0,abstractPart:!0}),new n("LinearFeetOfRailingPantheon","Linear Feet Of Railing: Pantheon",{hideInPDF:!0,abstractPart:!0}),new n("LinearFeetOfRailingAchilles","Linear Feet Of Railing: Achilles",{hideInPDF:!0,abstractPart:!0}),new n("LinearFeetOfRailingViking","Linear Feet Of Railing: Viking",{hideInPDF:!0,abstractPart:!0}),new n("LinearFeetOfRailingJavelin","Linear Feet Of Railing: Javelin",{hideInPDF:!0,abstractPart:!0}),new n("LinearFeetOfRailingEva","Linear Feet Of Railing: Eva",{hideInPDF:!0,abstractPart:!0}),new n("LinearFeetOfRailingGemini","Linear Feet Of Railing: Gemini",{hideInPDF:!0,abstractPart:!0}),new i("TopRailColosseum","Top Rail Colosseum"),new i("TopRailOrion","Top Rail Orion"),new i("TopRailTriton","Top Rail Triton"),new i("TopRailPantheon","Top Rail Pantheon"),new i("TopRailAchilles","Top Rail Achilles"),new i("TopRailViking","Top Rail Viking"),new i("TopRailJavelin","Top Rail Javelin"),new i("TopRailEva","Top Rail Eva"),new i("TopRailGemini","Top Rail Gemini"),new i("MiddleRailTriton","Middle Rail Triton"),new i("BottomRailTriton","Bottom Rail Triton"),new i("BaseplateColosseum","Baseplate Colosseum"),new i("BaseplateOrion","Baseplate Orion"),new i("BaseplateTriton","Baseplate Triton"),new i("BaseplatePantheon","Baseplate Pantheon"),new i("BaseplateEva","Baseplate Eva"),new i("BaseplateGemini","Baseplate Gemini"),new i("HandGrabMountPlate","Hand Grab Mount Plate"),new i("BaseplateStringerColosseum","Stringer Baseplate Colosseum"),new i("BaseplateTreadColosseum","Tread Baseplate Colosseum"),new i("BaseplateStringerOrion","Stringer Baseplate Orion"),new i("BaseplateStringerTriton","Stringer Baseplate Triton"),new i("BaseplateStringerPantheon","Stringer Baseplate Pantheon"),new i("BaseplateStringerEva","Stringer Baseplate Eva"),new i("BaseplateStringerGemini","Stringer Baseplate Gemini"),new i("PostColosseum","Post Colosseum"),new i("TaperedPostColosseum","Tapered Post"),new i("EndPostColosseum","End Post"),new i("PostOrion","Post Orion"),new i("PostTriton","Post Triton"),new i("PostPantheon","Post Pantheon"),new i("PostEva","Post Eva"),new i("PostGemini","Post Gemini"),new i("HandGrabMountStem","Hand Grab Mount Stem"),new i("InfillPicketColosseum","Infill Picket Colosseum"),new i("InfillPicketTriton","Infill Picket Triton"),new i("InfillPicketPantheon","Infill Picket Pantheon"),new n("BaseplateFastener","Baseplate Fastener",{abstractPart:!0}),new n("ChicagoStyleScrew","Chicago Style Screw",{abstractPart:!0}),new n("Profit","Profit",{abstractPart:!0}),new n("Administrative","Administrative Overhead",{abstractPart:!0})],o={};s.forEach((e=>{o[e.identifier()]=e})),e.exports=o},72821:(e,t,r)=>{const n=r(63768),i=r(63139);e.exports=class RogueFabricatorsCoreMountStyle extends i{static styleIdentifier(){return"Core"}hasBaseplate(){return!1}postZOffset(){return n.unit(4,"in")}}},34571:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),s=r(10736);e.exports=class RogueFabricatorsFasciaMountStyle extends s{get label(){return"Fascia"}hasBaseplateFastenerBrackets(){return!1}baseplateWidth(){return n.unit(4,"in")}baseplateOffset(e){const t=e.width().toNumeric(e.unit())/2,r=e.baseplateWidth().toNumeric(e.unit())/2,s=e.fasciaBaseplateNormalOffset().toNumeric(e.unit()),o=e.componentOf().edge(),a=e.componentOf().isTreadMountStairs(),l=o.begin().z()>o.end().z()?1:-1,c=e.structureDirection(),u=e.componentOf().slope(),d=a?0:r*n.tan(u)*l*c;return i(d,r,-(t+s)).add(this._baseplateTerminalOffset(e))}_baseplateTerminalOffset(e){if(!e.isBeginPost()&&!e.isEndPost())return i(0,0);const t=e.railingStyle().terminalBaseplateOffset().toNumeric(e.unit()),r=this._terminalBaseplateOffsetSign(e);return i(t*r,0)}_terminalBaseplateOffsetSign(e){const t=e.isBeginPost()?e.structureDirection():-1*e.structureDirection();return e.reverseTerminalBaseplateOffsetDirection()?-1*t:t}baseplateEdgeDirection(e){const t=super.baseplateEdgeDirection(e),r=e.structureDirection();return t.multipliedBy(r)}baseplatePlanarNormal(e){const t=e.normal(),r=e.structureDirection();return t.multipliedBy(r)}baseplateMiterDirection(e){return e.directionXY()}postZOffset(){return console.warn("Use fasciaPostExtension on the railing style for fascia-mount postZOffset"),super.postZOffset()}sectionEdgeOffsetFromCenter(e){return e.fasciaLayoutEdgeOffset()}isFasciaMount(){return!0}}},10736:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),s=r(83741),o=r(35337);e.exports=class RogueFabricatorsPostMountStyle extends s{hasBaseplateFastenerBrackets(){return!0}sectionEdgeOffsetFromCenter(e){return n.unit(0,"in")}baseplateWidth(){return n.unit(2,"in")}baseplateOffset(e){return i(0,0)}baseplateEdgeDirection(e){return e.direction()}baseplatePlanarNormal(e){return e.direction().cross(e.normal())}baseplateMiterDirection(e){return e.direction()}anchorOffset(){return n.unit(2,"in")}isFasciaMount(){return!1}_baseComponentLayoutEdge(e){return e.platformLayoutEdge()}componentLayoutEdgeInsetFor(e,t){return this.componentLayoutInsetHelper(t).insetFor(t,e).toNumeric(t.unit())}componentLayoutInsetHelper(e){if(!this._componentLayoutInsetHelper){const t=e.railingStyle().componentLayoutEdgeInsetHelperClass();this._componentLayoutInsetHelper=new t}return this._componentLayoutInsetHelper}componentLayoutEdgeIntersectionOverride(e,t,r,n,i){const s=t?r.begin():r.end();if(e.sloped())return s}_componentLayoutEdgeOffsetDelta(e){const t=e.railingStyle();return this.sectionEdgeOffsetFromCenter(t)}intersectionHelper(e){return new o(this._baseComponentLayoutEdge(e),this.componentLayoutEdgeOffset(e))}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_componentLayoutInsetHelper"]}}},63139:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),s=r(10736);e.exports=class RogueFabricatorsSurfaceMountStyle extends s{sectionEdgeOffsetFromCenter(e){return n.multiply(this.anchorOffset(),-1)}baseplateOffset(e){const t=e.componentOf().useSlopedBaseplate()?this._baseplateSlopeOffset(e):i(0,0),r=this._baseplateTerminalOffset(e);return t.add(r)}_baseplateSlopeOffset(e){const t=e.componentOf(),r=e.baseplateDepth().toNumeric(e.unit()),s=t.isBeginAtSlopeTop()?-1:1,o=t.slope(),a=r*n.tan(o)*s;return i(a,0)}_baseplateTerminalOffset(e){if(!e.isBeginPost()&&!e.isEndPost())return i(0,0);const t=e.componentOf(),r=e.railingStyle(),n=(t.useSlopedBaseplate()?r.slopedTerminalBaseplateOffset(e):r.terminalBaseplateOffset(e)).toNumeric(e.unit()),s=this._terminalBaseplateOffsetSign(e);return i(n*s,0)}_terminalBaseplateOffsetSign(e){const t=e.componentOf(),r=e.reverseTerminalBaseplateOffsetDirection(),n=e.isEndPost()||t.isTreadMountStairs()?-1:1;return r?-1*n:n}}},76234:(e,t,r)=>{const n=r(63768),i=r(10736);e.exports=class RogueFabricatorsWallMountStyle extends i{get label(){return"Wall"}sectionEdgeOffsetFromCenter(e){const t=e.layoutEdgeOffset();return n.multiply(t,-1)}}},66780:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),s=r(61872),o=r(88646),a=r(20901);e.exports=class RogueFabricatorsCoreMountPipePost extends s{legRadius(){return n.divide(this.legWidth(),2)}legBottomLocator(){return this.bottomLocator()}legCrossSection(){const e=this.legRadius().toNumeric(this.unit());return new o([new a(i(0,0).expandedByRadius(e))])}topMiterDirection(){}bottomMiterDirection(){}}},33806:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),{Polygon:s}=r(62048),{NullDrawable:o}=r(7340),a=r(61872),l=r(45208),c=r(88646),u=r(6556),d=r(56214),h=r(35621),p=r(28731),m=r(76133),f=r(35668),g=r(46748),y=r(32972);e.exports=class RogueFabricatorsDoubleBarPost extends a{length(){return n.divide(super.length(),n.cos(this.componentOf().slope()))}legLength(){return n.divide(this.legMaterialLength(),n.cos(this.componentOf().slope()))}baseplateLength(){if(this.componentOf().useSlopedBaseplate())return this.length();const e=n.multiply(this.legLength(),2);return n.subtract(this.length(),e)}baseplateWidth(){return this.mountStyle().isFasciaMount()?this.mountStyle().baseplateWidth():super.baseplateWidth()}fasciaBaseplateNormalOffset(){return n.unit(0,"in")}_defaultLegs(){return[this._makeLeg(!0,this.beginLegExtrusionMaterialSpecifier()),this._makeLeg(!1,this.endLegExtrusionMaterialSpecifier())]}legMaterialClass(e){const t=this.isBeginPost(),r=this.isEndPost();return t&&e||r&&!e?super.legMaterialClass():h}_legOffset(e=!0){const t=this.length().toNumeric(this.unit())/2-this.legLength().toNumeric(this.unit())/2,r=this.direction();return(e?r.negated():r).multipliedBy(t)}legBottomLocatorZOffset(){return this.isSlopedBaseplate()?super.legBottomLocatorZOffset():0}isSlopedBaseplate(){return!this._baseplateSlope().equals(n.unit(0,"deg"))&&!this.mountStyle().isFasciaMount()}beginLegMaterialSpecifier(){const e=this.legs().first().longestEdgeLine(),t=this._formattedLengthForEdge(e);return this._materialSpecifierForLeg(this.isBeginPost(),t)}endLegMaterialSpecifier(){const e=this.legs().last().longestEdgeLine(),t=this._formattedLengthForEdge(e);return this._materialSpecifierForLeg(this.isEndPost(),t)}beginLegExtrusionMaterialSpecifier(){return this._materialSpecifierForLeg(this.isBeginPost(),this._formattedHeight())}endLegExtrusionMaterialSpecifier(){return this._materialSpecifierForLeg(this.isEndPost(),this._formattedHeight())}_materialSpecifierForLeg(e,t){const r=e?y.EndPostColosseum:y.TaperedPostColosseum;return this._legSpecifierForHeight(t,r)}legLineItems(){return[this.beginLegMaterialSpecifier(),this.endLegMaterialSpecifier()].map((e=>new u(1,e)))}fastenerBracketLength(){return n.unit(2,"in")}baseplateFastenerBrackets(){return this._baseplateFastenerBrackets??=this._defaultBaseplateFastenerBrackets()}_defaultBaseplateFastenerBrackets(){if(!this.mountStyle().hasBaseplateFastenerBrackets())return[];if(!this.isOnSlope())return[];const e=this.fastenerBracketLength().toNumeric(this.unit()),t=this.baseplateDepth(),r=g`${this.length()} / 2 - ${this.legLength()} - ${t} / 2 / cos(${this._baseplateSlope()})`.toNumeric(this.unit()),i=this.direction().multipliedBy(r);return[this.bottomLocator().subtract(i),this.bottomLocator().add(i)].map((e=>e.addZ(-t.toNumeric(this.unit())/n.cos(this._baseplateSlope())).relatedTo(this.locator()))).map((t=>{const r=t.to(t.addZ(-e)),n=l.builder(this).beginLocator(r.begin()).endLocator(r.end()).crossSection(this._fastenerBracketCrossSection()).materialSpecifier(this.baseplateMaterialSpecifier()).planarNormal(this.directionXY()).beginMiterDirection(this.bottomMiterDirection()).build();return n.setComponentOf(this),n}))}_fastenerBracketCrossSection(){const e=this.legWidth().toNumeric(this.unit()),t=this.baseplateDepth().toNumeric(this.unit()),r=i(0,0).expandedBy(e/2,t/2);return new c([new d(r)])}_defaultBaseplateHolesFor(e){const t=e.localXAxis(),r=e.localYAxis(),i=e.localZAxis(),o=n.unit(.5,"in").toNumeric(this.unit()),a=e.shape3D().faces().find((e=>e.normal().dot(i).isNearTo(1))),l=new s(a.vertices().map((e=>new f(e,t,r,i))));l.isCounterClockwise()&&l.reverseVertices();const c=e.shape3D().faces().find((e=>e.normal().dot(i).isNearTo(-1))).vertices().map((e=>new f(e,t,r,i))),u=new s(l.vertices().map((e=>c.find((t=>e.xy().equals(t.xy())))))),d=m.stretchedBy(l,2*-o),h=m.stretchedBy(u,2*-o),g=n.unit(5/32,"in");return d.vertices().map(((e,t)=>e.to(h.vertices()[t]))).map((e=>f.unproject(e.begin(),t,r,i).to(f.unproject(e.end(),t,r,i)))).map((e=>new p(e,g)))}baseplateSpacer(){}projectedAnnotations(e,t,r){return[...super.projectedAnnotations(e,t,r),this._projectedInnerPostDimensionAnnotation(e,t,r),this._projectedOuterPostDimensionAnnotation(e,t,r)]}_projectedInnerPostDimensionAnnotation(e,t,r){const n=.75*this.height().toNumeric(this.unit()),i=this.legLength().toNumeric(this.unit()),s=this.legBottomLocator().z()-n,o=this.legBottomLocator().xy().addZ(s),a=this.legBottomLocator(!1).xy().addZ(s),l=o.to(a).stretchedBy(-i);return this._projectedDimensionAnnotation(l,0,e,t,r)}_projectedOuterPostDimensionAnnotation(e,t,r){const n=.25*this.height().toNumeric(this.unit()),i=this.legLength().toNumeric(this.unit()),s=this.legBottomLocator().z()-n,o=this.legBottomLocator().xy().addZ(s),a=this.legBottomLocator(!1).xy().addZ(s),l=o.to(a).stretchedBy(i);return this._projectedDimensionAnnotation(l,0,e,t,r)}defaultFigure(){return new o(this)}components(){return[...super.components(),...this.baseplateFastenerBrackets()]}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_baseplateFastenerBrackets"]}}},95537:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),{three:s}=r(37732),{PolygonFigure:o}=r(7340),a=r(61872),l=r(88646),c=r(76385),u=r(1487),d=r(97010),h=r(28731),p=r(44421);e.exports=class RogueFabricatorsHandGrabPost extends a{locator(){if(!this._repositionedLocator){const e=this.postProvider().structureAlongNormal()?this.normal():this.normal().negated(),t=this._locator.add(e.multipliedBy(this.locatorNormalOffset()));this._repositionedLocator=t.relatedTo(this._locator)}return this._repositionedLocator}locatorNormalOffset(){return this.railingStyle().layoutEdgeOffset().toNumeric(this.unit())}bottomLocator(){const e=n.unit(1.9375,"in").toNumeric(this.unit());return this.topLocator().addZ(e)}postWidth(){return this.componentOf().railingStyle().postWidth()}baseplateDepth(){return n.unit(.25,"in")}baseplateWidth(){return n.unit(1.5,"in")}baseplateLength(){return n.unit(3.5,"in")}baseplateCornerRadius(){return n.unit(.4375,"in").toNumeric(this.unit())}legRadius(){return this.railingStyle().postLegRadius()}_defaultBaseplate(){if(!this.railingStyle().hasBaseplate())return;const e=this.normal().negated().xy(),t=this.direction().xy().cross(e),r=this.bottomLocator(),n=this.baseplateDepth().toNumeric(this.unit()),i=r,s=r.add(e.multipliedBy(n)),o=this._baseplateCrossSection(),a=d.builder(this).beginLocator(i.relatedTo(r)).endLocator(s.relatedTo(r)).crossSection(o).materialSpecifier(this.baseplateMaterialSpecifier()).planarNormal(t).beginMiterDirection(e).endMiterDirection(e).build();return a.setComponentOf(this),a.setHoles(this._defaultBaseplateHolesFor(a)),a}_baseplateCrossSection(){const e=this.baseplateLength().toNumeric(this.unit())/2,t=this.baseplateWidth().toNumeric(this.unit())/2,r=this.baseplateCornerRadius(),n=[i(-t,-e).to(i(t,-e)),i(t,-e).to(i(t,e)),i(t,e).to(i(-t,e)),i(-t,e).to(i(-t,-e))].map((e=>e.stretchedBy(2*-r))),s=n.map((e=>new u(e.begin(),e.end()))),o=n.map((e=>{const t=e.normal().negated(),n=e.begin().add(t.multipliedBy(r));return new c(n,r,e.normalizedAngle()+Math.PI,e.normalAngle().normalizedAngle())}));return new l([o[0],s[0],o[1],s[1],o[2],s[2],o[3],s[3]])}_defaultBaseplateHolesFor(e){const t=e.edge(),r=n.unit(.5,"in").toNumeric(this.unit()),i=this.baseplateLength().toNumeric(this.unit())/2-r,s=t.addZ(-i),o=t.addZ(i),a=n.unit(5/32,"in");return[new h(s,a),new h(o,a)]}_baseplateEdgeDirection(){return this.edge().normal()}_baseplateMiterDirection(){return this.edge().normal()}legs(){const e=new p(this.legLocator(),this.legRotation(),{materialNames:[this.materialSpecifier().details().materialName],defaultFigureFillStyle:[this.materialSpecifier().details().fillStyle],defaultFigureStrokeStyle:[this.materialSpecifier().details().strokeStyle]});return e.setComponentOf(this),[e]}legLocator(){const e=this.normal().negated(),t=this.baseplateDepth().toNumeric(this.unit());return this.bottomLocator().add(e.multipliedBy(t)).relatedTo(this.locator())}legRotation(){const e=this.postProvider().structureAlongNormal()?this.locator().edge():this.locator().edge().reversed(),t=e.normalizedAngle(),r=e.phi()-Math.PI_2,n=(new s.Quaternion).setFromAxisAngle(new s.Vector3(0,0,1),t);return(new s.Quaternion).setFromAxisAngle(new s.Vector3(0,1),r).premultiply(n)}_isFasciaMount(){return!1}materialSpecifier(){const e=this.componentOf().railingColor(),t=this.referenceMaterialSpecifier();return t.specifierFor(t.name(),{materialName:e.materialName(),fillStyle:e.fillStyle(),strokeStyle:e.strokeStyle()})}referenceMaterialSpecifier(){return this.materials.HandGrabMountStem}baseplateMaterialSpecifier(){const e=this.componentOf().railingColor(),t=this.baseplateReferenceMaterialSpecifier();return t.specifierFor(t.name(),{materialName:e.materialName(),fillStyle:e.fillStyle(),strokeStyle:e.strokeStyle()})}baseplateReferenceMaterialSpecifier(){return this.materials.HandGrabMountPlate}defaultFigure(){const e=this.locator();return new o([e,this.edge().closestPointTo(e).relatedTo(e)])}}},44421:(e,t,r)=>{const n=r(57473),i=r(18734),s=r(97528);e.exports=class RogueFabricatorsHandGrabPostLeg extends n{constructor(e,t,{materialNames:r=[],defaultFigureFillStyle:n="#000",defaultFigureStrokeStyle:i="#000"}){super(e,"rogue-fabricators-hand-grab-stem",t,void 0,r),this._defaultFigureFillStyle=n,this._defaultFigureStrokeStyle=i}defaultFigureFillStyle(){return this._defaultFigureFillStyle}defaultFigureStrokeStyle(){return this._defaultFigureStrokeStyle}edge(){return this.componentOf().edge()}localZAxis(){return this.localYAxis().cross(this.localXAxis())}localYAxis(){return this.edge().normal()}localXAxis(){return this.edge().direction()}dimensionAlongAxis(e){const t=this.boundingCube().vertices().map((t=>t.dot(e))),r=Math.min(...t),n=Math.max(...t);return Math.abs(n-r)}equals(e){return this.constructor===e.constructor}projectedViewFigure(e,t,r){const n=new s(this,e,t,r);return n.updateProperties({fillStyle:"#00000000",strokeStyle:"#000",lineWidth:.01}),n}defaultFigure(){const e=new i(this);return e.updateProperties({fillStyle:this.defaultFigureFillStyle(),strokeStyle:this.defaultFigureStrokeStyle(),lineWidth:.01}),e}}},2662:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),s=r(27585);e.exports=class RogueFabricatorsPerpendicularSlopeTopDoubleBarPost extends s{locator(){if(!this._repositionedLocator){const e=this._locator.edge().xy(),t=this._isBeginSlopeTop()?e.direction():e.direction().negated();this._repositionedLocator=this._locator.add(t.multipliedBy(this._horizontalOffset())).addZ(this._verticalOffset()).relatedTo(this._locator)}return this._repositionedLocator}_isBeginSlopeTop(){const e=this.componentOf();return e.isSlopeTopAt(e.edge().begin())}_verticalOffset(){return this._isTreadMount()?0:n.multiply(this._commonPostLength(),n.tan(this.componentOf().slope())).toNumeric(this.unit())/2}_horizontalOffset(){return n.subtract(this._commonPostLength(),this.length()).toNumeric(this.unit())/2}length(){return this.railingStyle().perpendicularStairTopPostLength(this.mountStyle().isFasciaMount())}_commonPostLength(){return this.railingStyle().postLength()}baseplateWidth(){return this._isTreadMount()?super.baseplateWidth():this.railingStyle().baseplateWidth()}baseplateOffset(){return this._isTreadMount()?super.baseplateOffset():i(0,0)}bottomMiterDirection(){}topMiterDirection(){}_baseplateEdgeDirection(){return this.mountStyle().baseplateEdgeDirection(this)}_baseplatePlanarNormal(){return this.mountStyle().baseplatePlanarNormal(this)}_defaultBaseplateFastenerBrackets(){return[]}_isTreadMount(){return this.componentOf().stairMountSurface().treadMountPosts()}}},61872:(e,t,r)=>{const n=r(63768),{CompositeFigure:i}=r(7340),{Composite3DFigure:s}=r(37732),{$P:o}=r(62048),{RelativeLocator:a,Rectangle:l,Cube:c}=r(62048),u=r(88646),d=r(56214),h=r(45208),p=r(80371),m=r(6556),f=r(26933),g=r(30691),y=r(97010),b=r(9343),v=r(35668),_=r(32972),x=r(93387),w=r(37766),R=r(15096);e.exports=class RogueFabricatorsRailingPost extends p{length(){return this.railingStyle().postLength()}width(){return this.railingStyle().postWidth()}height(){return n.add(this.componentOf().postHeight(),this.heightBelowSurface())}legWidth(){return this.railingStyle().postLegWidth()}legLength(){return this.legMaterialLength()}legMaterialLength(){return this.railingStyle().postLegLength()}baseplateDepth(){return this.railingStyle().baseplateDepth()}baseplateWidth(){return this.railingStyle().baseplateWidth()}fasciaBaseplateNormalOffset(){return n.add(this.baseplateDepth(),this.baseplateSpacerLength())}baseplateLength(){return this.railingStyle().baseplateLength()}hasBaseplate(){return this.railingStyle().hasBaseplate()}isFasciaPost(){return this.mountStyle().isFasciaMount()}isCornerSlopeTransitionPost(){if(!this.isCornerPost())return!1;const e=this.previousSection(),t=this.nextSection(),r=!e.isParallelToSection(t),n=e.sloped()!==t.sloped();return r&&n}baseplateSpacerWidth(){return this.railingStyle().baseplateSpacerWidth()}baseplateSpacerLength(){return this.railingStyle().baseplateSpacerLength()}baseplateSpacerDepth(){return this.railingStyle().baseplateSpacerDepth()}heightBelowSurface(){return this.isFasciaPost()?this.railingStyle().fasciaPostExtension():super.heightBelowSurface()}structureDirection(){return this.componentOf().structureDirection()}edge(){return this.componentOf().componentLayoutEdge()}railingStyle(){return this.componentOf().railingStyle()}direction(){return this.edge().direction()}directionXY(){return this.edge().xy().direction()}normal(){return this.edge().normal()}planarNormal(){return this.directionXY()}formatter(){return this.project().unitFormatter()}specifierMiterDecimalPlaces(){return this.project().decimalFormatterDecimalPlaces()}legs(){return this._legs??=this._defaultLegs()}_defaultLegs(){return[this._makeLeg()]}_makeLeg(e,t=this.legExtrusionMaterialSpecifier()){const r=this.legBottomLocator(e),n=this.legTopLocator(e),i=this.legMaterialClass(e).builder(this).beginLocator(r).endLocator(n).crossSection(this.legCrossSection()).materialSpecifier(t).planarNormal(this.planarNormal()).beginMiterDirection(this.bottomMiterDirection()).endMiterDirection(this.topMiterDirection()).build();return i.setComponentOf(this),i}legMaterialClass(e){return h}bottomMiterDirection(){const e=this.locator().edge();return e.direction().cross(e.normal())}topMiterDirection(){if(!this._shouldMiterTop())return;const e=this.componentOf().edge();return e.direction().cross(e.normal())}_shouldMiterTop(){return!0}mountStyle(){return this.componentOf().postMountStyle()}topLocator(){return this._relativeLocator(this.heightAboveSurface())}legBottomLocator(e){const t=this._legOffset(e),r=this.legBottomLocatorZOffset(),n=t.addZ(r);return this.bottomLocator().add(n).relatedTo(this.locator())}legBottomLocatorZOffset(){if(this.isFasciaPost())return 0;const e=this.baseplateDepth().toNumeric(this.unit()),t=this._baseplateSlope();return-e/n.cos(t)}_baseplateSlope(){return this.componentOf().slope()}legTopLocator(e){const t=this._legOffset(e),r=this.topLocator();return a.makeRelativeTo(r.add(t),this.locator())}_legOffset(e){return o(0,0)}legCrossSection(){const e=this.legWidth().toNumeric(this.unit())/2,t=this.legMaterialLength().toNumeric(this.unit())/2;return new u([new d(o(0,0).expandedBy(e,t))])}baseplate(){return this._baseplate??=this._defaultBaseplate()}baseplateOffset(){return this.mountStyle().baseplateOffset(this)}_baseplateEdgeDirection(){return this.mountStyle().baseplateEdgeDirection(this)}_baseplatePlanarNormal(){return this.mountStyle().baseplatePlanarNormal(this)}_baseplateMiterDirection(){return this.mountStyle().baseplateMiterDirection(this)}_defaultBaseplate(){if(!this.hasBaseplate())return;const e=this._baseplatePlanarNormal(),t=this.bottomLocator(),r=this._baseplateStart(),n=this._baseplateEnd(),i=this._baseplateCrossSection(),s=this._baseplateMiterDirection(),o=y.builder(this).beginLocator(r.relatedTo(t)).endLocator(n.relatedTo(t)).crossSection(i).materialSpecifier(this.baseplateExtrusionMaterialSpecifier()).planarNormal(e).beginMiterDirection(s).endMiterDirection(s).build();return o.setComponentOf(this),o.setHoles(this._defaultBaseplateHolesFor(o)),o}_baseplateStart(){return this._baseplateEndpoint(-1)}_baseplateEnd(){return this._baseplateEndpoint(1)}_baseplateEndpoint(e){const t=this._baseplateCenter(),r=this.direction(),n=this.baseplateLength().toNumeric(this.unit())/2,i=r.multipliedBy(n*e);return t.add(i)}_baseplateCenter(){const e=this.baseplateOffset(),t=this._baseplatePlanarNormal(),r=this._baseplateEdgeDirection(),n=r.multipliedBy(e.x()).add(r.cross(t).multipliedBy(e.y())).add(t.multipliedBy(e.z()));return this.bottomLocator().add(n)}_defaultBaseplateHolesFor(e){return[]}_baseplateCrossSection(){const e=-this.baseplateDepth().toNumeric(this.unit()),t=this.baseplateWidth().toNumeric(this.unit())/2,r=new l(-t,0,2*t,e);return new u([new d(r)])}baseplateSpacer(){return this._baseplateSpacer??=this._defaultBaseplateSpacer()}_defaultBaseplateSpacer(){if(!this.isFasciaPost())return;const e=this.bottomLocator(),t=this._baseplateSpacerStart(),r=this._baseplateSpacerEnd(),n=this._baseplateSpacerCrossSection();return h.builder(this).beginLocator(t.relatedTo(e)).endLocator(r.relatedTo(e)).crossSection(n).materialSpecifier(this.baseplateExtrusionMaterialSpecifier()).build()}_spacerDirection(){return-1===this.structureDirection()?this.normal():this.normal().negated()}_baseplateSpacerStart(){const e=this._spacerDirection(),t=this.legWidth().toNumeric(this.unit())/2,r=-this.baseplateSpacerDepth().toNumeric(this.unit())/2;return this.bottomLocator().add(e.multipliedBy(t)).addZ(r)}_baseplateSpacerEnd(){const e=this._spacerDirection(),t=this.baseplateSpacerLength().toNumeric(this.unit());return this._baseplateSpacerStart().add(e.multipliedBy(t))}_baseplateSpacerCrossSection(){const e=this.baseplateSpacerDepth().toNumeric(this.unit())/2,t=this.baseplateSpacerWidth().toNumeric(this.unit())/2,r=new l(-t,-e,2*t,2*e);return new u([new d(r)])}equals(e){return!!this._dimensionsMatchOtherPost(e)&&(!!this.mountStyle().equals(e.mountStyle())&&(!!this._legsMatchOtherPostLegs(e)&&this._baseplateMatchesOtherPostBaseplate(e)))}_dimensionsMatchOtherPost(e){const t=this._unitValuesMatch(this.height(),e.height()),r=this._unitValuesMatch(this.width(),e.width()),n=this._unitValuesMatch(this.length(),e.length());return t&&r&&n}_unitValuesMatch(e,t){return e.toNumeric(this.unit()).isNearTo(t.toNumeric(this.unit()))}_legsMatchOtherPostLegs(e){if(this.legs().length!==e.legs().length)return!1;if(this.legs().every(((t,r)=>t.equals(e.legs()[r]))))return!0;const t=[...e.legs()].reverse();return this.legs().every(((e,r)=>e.equals(t[r])))}_baseplateMatchesOtherPostBaseplate(e){const t=this.baseplate().equals(e.baseplate()),r=this.baseplateOffset(),n=e.baseplateOffset(),i=r.equals(n)||r.negated().equals(n);return t&&i}legLineItems(){return[new m(1,this.materialSpecifier())]}baseplateLineItems(){if(!this.hasBaseplate())return[];const e=this.isOnSlope()&&new m(4,_.ChicagoStyleScrew),t=this.mountStyle().hasBaseplateFastenerBrackets()&&new m(4,_.BaseplateFastener);return[new m(1,this.baseplateMaterialSpecifier()),t,e].filter((e=>e))}materialLineItems(){return[...this.legLineItems(),...this.baseplateLineItems()]}referenceMaterialSpecifier(){const e=this.railingStyle().materialSpecifierStyleId();return _[`Post${e}`]}_formattedHeight(){return this.formatter().format(this.height())}_formattedLengthForEdge(e){const t=n.unit(e.length(),this.unit());return this.formatter().format(t)}materialSpecifier(){const e=this.legs().first().longestEdgeLine(),t=this._formattedLengthForEdge(e);return this._legSpecifierForHeight(t)}legExtrusionMaterialSpecifier(){const e=this._formattedHeight();return this._legSpecifierForHeight(e)}_legSpecifierForHeight(e,t=this.referenceMaterialSpecifier()){const r=this._formattedHeight(),n=this.specifierMiterDecimalPlaces(),i=this.bottomMiterDirection()?.roundedTo(n)??o(0,0,0),s=this.topMiterDirection()?.roundedTo(n)??o(0,0,0),a=`${t.name()} - ${r} - start miter (${i.x()},${i.y()},${i.z()}) - end miter (${s.x()},${s.y()},${s.z()})`;return t.specifierFor(a,{[x.length]:e,...this._specifierColorDetails()})}baseplateMaterialSpecifier(){const e=this.baseplate().longestEdgeLine(),t=this._formattedLengthForEdge(e);return this._baseplateSpecifierForLength(t)}baseplateExtrusionMaterialSpecifier(){const e=this.formatter().format(this.baseplateLength());return this._baseplateSpecifierForLength(e)}_specifierColorDetails(){const e=this.railingColor();return{materialName:e.materialName(),fillStyle:e.fillStyle(),strokeStyle:e.strokeStyle()}}railingColor(){return this.componentOf().railingColor()}referenceBaseplateMaterialSpecifier(){const e=this.railingStyle().materialSpecifierStyleId(),t=this.isOnSlope()?this.stairBaseplateMaterialPrefix():"";return _[`Baseplate${t}${e}`]}_baseplateSpecifierForLength(e){const t=this.formatter(),r=t.format(this.baseplateLength()),n=t.format(this.baseplateWidth()),i=t.format(this.baseplateDepth()),s=this.specifierMiterDecimalPlaces(),a=this._baseplateMiterDirection()?.roundedTo(s)??o(0,0,0),l=this.referenceBaseplateMaterialSpecifier(),c=`${l.name()} - length ${r} - width ${n} - depth ${i} - miter (${a.x()},${a.y()},${a.z()})`;return l.specifierFor(c,{[x.length]:e,...this._specifierColorDetails()})}stairBaseplateMaterialPrefix(){return"Stringer"}isOnStairs(){return this.componentOf().isStairs()}isOnSlope(){return this.componentOf().sloped()}isStairTopPost(){const e=this.isBeginPost(),t=this.section();return e?t.isBeginAtStairTop():t.isEndAtStairTop()}edgeToPostBeginIntersectionXY(){const e=this.length().toNumeric(this.unit())/2,t=this.edge().xy().direction().negated().multipliedBy(e);return this.locator().add(t).relatedTo(this.locator())}edgeToPostEndIntersectionXY(){const e=this.length().toNumeric(this.unit())/2,t=this.edge().xy().direction().multipliedBy(e);return this.locator().add(t).relatedTo(this.locator())}projectedAnnotations(e,t,r){return[...this.projectedLegAnnotations(e,t,r),this.projectedBaseplateAnnotation(e,t,r),this.projectedSlopeAnnotation(e,t,r)].filter((e=>e))}projectedLegAnnotations(e,t,r){const n=this.legs(),i=(n.length-1)/2;return n.map(((e,t)=>{const r=t<i,n=e.longestEdgeLine?.();if(n)return r?n.reversed():n})).filter(Boolean).map((n=>this._projectedDimensionAnnotation(n,30,e,t,r)))}projectedBaseplateAnnotation(e,t,r){if(!this.baseplate())return;const n=this.baseplate().furthestEdgeAlongAxis(o(0,0,1));return this._projectedDimensionAnnotation(n,30,e,t,r)}projectedSlopeAnnotation(e,t,r){if(!this.baseplate())return;const n=this.componentOf().slope().toNumeric("deg").roundedTo(2);if(n.isNearTo(0))return;const i=1.5*this.baseplateLength().toNumeric(this.unit()),s=new v(this._baseplateCenter(),e,t,r).movedBy(i,0),o=new b(`${n}°`,s,s);return o.setLayer(w.POST_ANNOTATIONS),o}_projectedDimensionAnnotation(e,t,r,n,i){const s=new(this.systemStrategy().annotationType())(g.projectedEdge(e,r,n,i),t,this.unit(),{formatter:this.project().unitFormatter(),color:R.dimensionColor});return s.setLayer(w.POST_ANNOTATIONS),s}buildDetails(){return this.componentOf().buildDetails()}reverseTerminalBaseplateOffsetDirection(){return!1}components(){return[...this.legs(),this.baseplate(),this.baseplateSpacer()].filter((e=>e))}materialParts(){return this.components()}boundingCube(){return c.mergedFiniteCubes(this.components())}defaultFigure(){return i.withModel(this)}threeFigure(){return s.withModel(this)}projectedViewFigure(e,t,r){return f.withModel(this,e,t,r)}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_legs","_baseplate","_baseplateSpacer"]}}},79445:(e,t,r)=>{const n=r(33806);e.exports=class RogueFabricatorsStringerMountDoubleBarPost extends n{direction(){return this.edge().direction()}}},35621:(e,t,r)=>{const n=r(63768),{CompositeFigure:i}=r(7340),{Composite3DFigure:s}=r(37732),{Cube:o,$P:a,Polygon:l,RelativeLocator:c}=r(62048),{extend:u}=r(50988),d=r(88646),h=r(86755),p=r(56214),m=r(45208),f=r(17043),g=r(91229),y=r(87032);class RogueFabricatorsTaperedLeg extends m{topOfTaperLocator(){return c.makeRelativeTo(this.endLocator().add(this.edge().direction().negated().multipliedBy(this._heightOfTopSection())),this.locator())}bottomOfTaperLocator(){return c.makeRelativeTo(this.locator().add(this.edge().direction().multipliedBy(this._heightOfBottomSection())),this.locator())}edge(){return this.locator().to(this.endLocator())}extrusionEdge(){return this.edge()}taperedLegTopWidth(){return n.unit(1,"in")}taperedLegTopDepth(){return n.unit(.5,"in")}taperedLegTaperDepth(){return n.unit(.5,"in")}boundingCube(){return o.mergedFiniteCubes(this.components())}boundingBox(){return this.components().map((e=>e.boundingBox())).reduce(((e,t)=>e.merge(t)))}components(){return this._components??=this._defaultsComponents()}_defaultsComponents(){return[this._defaultBottomSection(),this._defaultTaperedSection(),this._defaultTopSection()]}_defaultBottomSection(){const e=this.locator(),t=this.bottomOfTaperLocator(),r=m.builder(this).beginLocator(e).endLocator(t).crossSection(this.crossSection()).materialSpecifier(this.materialSpecifier()).planarNormal(this.planarNormal()).beginMiterDirection(this.beginMiterDirection()).build();return r.setComponentOf(this),r}_heightOfBottomSection(){const e=this.endLocator(),t=this.locator();return e.distanceTo3D(t)-this._heightOfTopSection()-this._heightOfTaperedSection()}_defaultTopSection(){const e=this.topOfTaperLocator(),t=this.endLocator(),r=m.builder(this).beginLocator(e).endLocator(t).crossSection(this._topCrossSection()).materialSpecifier(this.materialSpecifier()).planarNormal(this.planarNormal()).endMiterDirection(this.endMiterDirection()).build();return r.setComponentOf(this),r}_heightOfTopSection(){return this.taperedLegTopDepth().toNumeric(this.unit())}_topCrossSection(){const e=this.post().legMaterialLength().toNumeric(this.unit())/2,t=this.taperedLegTopWidth().toNumeric(this.unit())/2;return new d([new p(a(0,0).expandedBy(t,e))])}_defaultTaperedSection(){const e=this.planarNormal(),t=this.post().legMaterialLength().toNumeric(this.unit()),r=e.negated().multipliedBy(t/2),n=e.multipliedBy(t/2),i=this.bottomOfTaperLocator(),s=c.makeRelativeTo(i.add(r),this.locator()),o=c.makeRelativeTo(i.add(n),this.locator()),l=m.builder(this).beginLocator(s).endLocator(o).crossSection(this._taperedCrossSection()).materialSpecifier(this.materialSpecifier()).planarNormal(a(0,0,1)).build();return l.setComponentOf(this),l}_heightOfTaperedSection(){return this.taperedLegTaperDepth().toNumeric(this.unit())}_taperedCrossSection(){const e=this.post().legWidth().toNumeric(this.unit())/2,t=this.taperedLegTopWidth().toNumeric(this.unit())/2,r=this.taperedLegTaperDepth().toNumeric(this.unit()),n=new l([a(-e,0),a(-t,r),a(t,r),a(e,0)]);return new d([new h(n)])}beginMiterDirection(){return this._beginMiterDirection??this.edge().direction()}endMiterDirection(){return this._endMiterDirection??this.edge().direction()}defaultFigure(){return i.withModel(this)}threeFigure(){return s.withModel(this)}projectedViewFigure(e,t,r){return g.withModel(this,e,t,r)}post(){return this.componentOf()}identifyingValues(){return{taperedLeg:!0}}projectedAngleAnnotations(e,t,r){return[]}canBeEqualTo(e){return this.constructor===e.constructor}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_components"]}}u(RogueFabricatorsTaperedLeg,y),u(RogueFabricatorsTaperedLeg,f),e.exports=RogueFabricatorsTaperedLeg},27585:(e,t,r)=>{const n=r(63768),i=r(33806);e.exports=class RogueFabricatorsTreadMountDoubleBarPost extends i{length(){return this.railingStyle().postLength()}legLength(){return this.legMaterialLength()}edge(){return this.locator().edge()}direction(){return this.directionXY()}legTopLocator(e){const t=super.legTopLocator(e),r=this.componentOf().railLayoutEdge();if(!r.xy().containsPoint(t.xy()))return t;const n=this.componentOf().slopeRadians(),i=r.begin().distanceTo(t),s=i*Math.tan(n),o=Math.hypot(i,s),a=r.direction().multipliedBy(o);return r.begin().add(a).relatedTo(this.locator())}_legOffset(e=!0){const t=super._legOffset(e),r=this.componentOf().isBeginAtStairBottom(),n=this.isFasciaPost()&&this.componentOf().isTreadMountStairs(),i=this.componentOf().isSlopeFlipped();return r&&!n&&!i?t.negated():t}levelTopRailEdge(){const e=this.legTopLocator(!0),t=this.legTopLocator(!1),r=this.legLength().toNumeric(this.unit());return e.to(t).stretchedBy(r).relativeToEdge(this.edge())}stairBaseplateMaterialPrefix(){return"Tread"}_baseplateSlope(){return n.unit(0,"deg")}}},42039:(e,t,r)=>{const n=r(63768),i=r(61872);e.exports=class RogueFabricatorsTreadMountRailingPost extends i{edge(){return this.locator().edge()}legTopLocator(e){const t=super.legTopLocator(e),r=this.componentOf().railLayoutEdge();if(!r.xy().containsPoint(t.xy()))return t;const n=this.componentOf().slopeRadians(),i=r.begin().distanceTo(t),s=i*Math.tan(n),o=Math.hypot(i,s),a=r.direction().multipliedBy(o);return r.begin().add(a).relatedTo(this.locator())}_baseplateSlope(){return n.unit(0,"deg")}_shouldMiterTop(){return!this.isStairTopPost()||this.isLinePost()}levelTopRailEdge(){const e=this.edge().direction(),t=this.isBeginPost()?e:e.negated(),r=this.legTopLocator(),n=this.legLength().toNumeric(this.unit())/2,i=r.add(t.multipliedBy(-n)),s=r.add(t.multipliedBy(n));return(this.componentOf().isSlopeFlipped()?s.to(i):i.to(s)).relativeTo(this.locator())}reverseTerminalBaseplateOffsetDirection(){return!(!this.isFasciaPost()||!this.isStairTopPost())||!(this.isFasciaPost()||!this.componentOf().isSlopeFlipped())}}},47648:(e,t,r)=>{const n=r(27585);e.exports=class RogueFabricatorsTreadMountTopDoubleBarPost extends n{topMiterDirection(){const e=this.edge();return e.direction().cross(e.normal())}}},72834:(e,t,r)=>{const n=r(63768),i=r(45618);e.exports=class RogueFabricatorsAchillesRailingStyle extends i{linearFootPricingMaterialSpecifier(){return this.materials.LinearFeetOfRailingAchilles}railDepth(){return n.unit(.375,"in")}}},46353:(e,t,r)=>{const n=r(63768),i=r(76905),s=r(35730),o=r(33806),a=r(2662),l=r(79445),c=r(27585),u=r(47648),d=r(66262);e.exports=class RogueFabricatorsColosseumRailingStyle extends d{linearFootPricingMaterialSpecifier(){return this.materials.LinearFeetOfRailingColosseum}postWidth(){return n.unit(2,"in")}perpendicularStairTopPostLength(e=!1){return e?this.postLength():n.unit(3,"in")}postLength(){return n.unit(4.5,"in")}postLegLength(){return n.unit(.375,"in")}baseplateWidth(){return n.unit(4,"in")}baseplateDepth(){return n.unit(.25,"in")}postLengthExtent(){return this.postLength()}terminalBaseplateOffset(){return n.unit(0,"in")}slopedTerminalBaseplateOffset(e){return this.terminalBaseplateOffset()}cornerPostGap(){return n.unit(0,"in")}fasciaPostExtension(){return n.unit(6,"in")}fasciaLayoutEdgeOffset(){return n.divide(this.postWidth(),2)}shouldHavePostAtEnd(e){const t=e.sectionConnectedToEnd();if(!t)return!0;const r=e.isParallelToSection(t),n=e.isLevel()&&t.isLevel();return!(r&&n)}shouldHavePostAtBegin(e){return!0}railLayoutEdge(e){const t=-e.postHeight().toNumeric(e.unit());return e.componentLayoutEdge().addZ(t).relativeToEdge(e.edge())}railingHeightForSection(e){return n.subtract(e.postProvider().railingHeight(),e.ponyWallHeight())}shouldHaveBeginExtension(e,t){if(!this.extendRailToPosts())return!1;const r=e.railLayoutEdge().xy(),n=r.direction();return i.directionTo(r.begin(),t).normalized().equals(n)}shouldHaveEndExtension(e,t){if(!this.extendRailToPosts())return!1;const r=e.railLayoutEdge().xy(),n=r.reversed().direction();return i.directionTo(r.end(),t).normalized().equals(n)}postClass(){return o}treadMountPostClass(){return c}treadMountTopPostClass(){return u}stringerMountPostClass(){return l}perpendicularStairTopPostClass(){return a}_fasciaMountRightAngleCornerPostInset(){return this._surfaceMountRightAngleCornerPostInset()}postLayoutEdgeInsetHelperClass(){return s}extendRailToPosts(){return!1}}},64817:(e,t,r)=>{const n=r(63768),i=r(82631);e.exports=class RogueFabricatorsEvaRailingStyle extends i{linearFootPricingMaterialSpecifier(){return this.materials.LinearFeetOfRailingEva}maxPostSpacing(){return n.unit(6,"ft")}railLayoutEdge(e){const t=super.railLayoutEdge(e),r=e.isBeginAtSlopeTop()?e.endPost():e.beginPost();let n=t;if(r){const i=e.isBeginAtSlopeTop()?t.begin():t.end(),s=e.isBeginAtSlopeTop()?i:r.topLocator(),o=e.isBeginAtSlopeTop()?r.topLocator():i;n=s.to(o)}return n.relativeToEdge(e.edge())}}},19502:(e,t,r)=>{const n=r(63768),i=r(82631),s=r(11381),o=r(44041);e.exports=class RogueFabricatorsGeminiRailingStyle extends i{blockClass(){return o}linearFootPricingMaterialSpecifier(){return this.materials.LinearFeetOfRailingGemini}slopeEndpostOffset(){return n.unit(4,"in")}terminalRailLoopClass(){return s}terminalRailLoopLength(){return n.subtract(n.unit(12,"in"),this.slopeEndpostOffset())}terminalRailLoopHeight(){return n.unit(10,"in")}}},45618:(e,t,r)=>{const n=r(63768),i=r(95537),s=r(26917),o=r(76234),a=r(97691),l=r(93512);e.exports=class RogueFabricatorsHandGrabRailingStyle extends s{postWidth(){return n.unit(2.9375,"in")}postLegRadius(){return n.unit(.1875,"in")}postLengthExtent(){return this.postLength()}maxPostSpacing(){return n.unit(16,"in")}terminalPostInsetForSlope(e){const t=n.unit(6.5,"in");return n.divide(t,n.cos(e))}cornerPostInset(){return this.terminalPostInsetForSlope(0)}layoutEdgeOffset(){return n.subtract(this.postWidth(),this.postLegRadius())}postClass(){return i}postLayoutEdgeInsetHelperClass(){return a}supportedPostMountStyles(){return[new o]}supportedStairMountSurfaces(){return[new l]}ponyWallAllowed(){return!1}hasWallReturns(){return!0}extendRailToPosts(){return!1}shouldHaveBeginExtension(e,t){return this.extendRailToPosts()}shouldHaveEndExtension(e,t){return this.extendRailToPosts()}centerCornerSlopeTransitionBaseplate(){return!1}}},66262:(e,t,r)=>{const n=r(63768),i=r(96823),s=r(16864);e.exports=class RogueFabricatorsHorizontalBarRailingStyle extends s{blockClass(){return i}barWidth(){return n.unit(1,"in")}barDepth(){return n.unit(.375,"in")}maxBottomBarHeight(){return n.unit(4,"in")}barGap(){return n.unit(3.875,"in")}centerToCenterBarGap(){return n.add(this.barGap(),this.barDepth())}barCountForHeight(e){const t=this._availableInfillHeight(e),r=this.maxBottomBarHeight(),i=n.add(this.barGap(),this.barDepth()),s=Math.floor(n.divide(t,i)),o=n.multiply(i,s),a=n.subtract(t,o);return n.larger(a,r)?s+1:s}_availableInfillHeight(e){const t=this.railDepth(),r=this.barDepth(),i=n.add(r,t);return n.subtract(e,i)}buildDetails(){return{tubesASTM:"A500",holeSize:"5/16",bolts:'1/4" Headlok fastener',surfacePrep:"40/70 WR Inhibitor"}}linearFootPricingMaterialSpecifier(){return this.materials.LinearFeetOfRailingColosseum}}},19456:(e,t,r)=>{const n=r(63768),i=r(57174),s=r(45618),o=r(43506);e.exports=class RogueFabricatorsJavelinRailingStyle extends s{railRadius(){return n.unit(1.25,"in")}railWidth(){return n.multiply(this.railRadius(),2)}railDepth(){return this.railWidth()}topRailClass(){return i}linearFootPricingMaterialSpecifier(){return this.materials.LinearFeetOfRailingJavelin}continuousRail(){return!0}componentLayoutEdgeInsetHelperClass(){return o}}},82631:(e,t,r)=>{const n=r(63768),i=r(72821),s=r(78321),o=r(26917),a=r(57174),l=r(66780),c=r(36964);e.exports=class RogueFabricatorsLineRailingStyle extends o{supportedPostMountStyles(){return[new i]}supportedStairMountSurfaces(){return[new s]}pipeRadius(){return n.unit(1.5,"in")}postWidth(){return this.pipeRadius()}postLengthExtent(){return this.postLength()}railWidth(){return this.pipeRadius()}railDepth(){return this.railWidth()}topRailClass(){return a}postClass(){return l}treadMountPostClass(){return this.postClass()}postLayoutEdgeInsetHelperClass(){return c}slopedPostEndpointOffset(){return n.unit(12,"in")}extendRailToPosts(){return!0}ponyWallAllowed(){return!1}centerCornerSlopeTransitionBaseplate(){return!0}}},83550:(e,t,r)=>{const n=r(16864);e.exports=class RogueFabricatorsOrionRailingStyle extends n{linearFootPricingMaterialSpecifier(){return this.materials.LinearFeetOfRailingOrion}}},94814:(e,t,r)=>{const n=r(63768),i=r(66262);e.exports=class RogueFabricatorsPantheonRailingStyle extends i{railDepth(){return n.unit(.25,"in")}linearFootPricingMaterialSpecifier(){return this.materials.LinearFeetOfRailingPantheon}}},26917:(e,t,r)=>{const n=r(63768),{MissingOverride:i}=r(50988),s=r(18037),o=r(61872),a=r(42492),l=r(58684),c=r(63139),u=r(34571),d=r(84726),h=r(93512),p=r(80006),m=r(42039),f=r(41455),g=r(39662),y=r(76905),b=r(46748),v=r(32972);e.exports=class RogueFabricatorsRailingStyle extends l{blockClass(){return a}supportedPostMountStyles(){return[new c,new u]}supportedStairMountSurfaces(){return[new h,new p]}ponyWallAllowed(){return!0}maxPostSpacing(){return n.unit(48,"in")}railWidth(){return n.unit(2,"in")}railDepth(){return n.unit(1,"in")}bottomRailWidth(){return this.railWidth()}bottomRailDepth(){return this.railDepth()}postLength(){return this.postWidth()}postWidth(){return n.unit(1.5,"in")}hasBaseplate(){return!0}baseplateLength(){return this.baseplateWidth()}baseplateWidth(){return n.unit(3.5,"in")}baseplateDepth(){return n.unit(.375,"in")}postLengthExtent(){return n.max(this.postLength(),this.baseplateLength())}terminalBaseplateOffset(e){const t=this.centerCornerSlopeTransitionBaseplate(),r=e?.isCornerSlopeTransitionPost();if(t&&r)return n.unit(0,"in");const i=n.divide(this.baseplateLength(),2),s=n.divide(this.postLength(),2);return n.subtract(i,s)}slopedTerminalBaseplateOffset(e){const t=e.componentOf().slope(),r=n.divide(e.length(),n.cos(t)),i=e.baseplateLength();return b`(${i} - ${r}) / 2`}centerCornerSlopeTransitionBaseplate(){return!0}baseplateSpacerWidth(){return n.unit(.75,"in")}baseplateSpacerLength(){return this.baseplateSpacerWidth()}baseplateSpacerDepth(){return this.baseplateWidth()}postLegLength(){return this.postLength()}perpendicularStairTopPostLength(e){return this.postLength()}postLegWidth(){return this.postWidth()}terminalPostInsetForSlope(e){const t=n.divide(this.postLength(),2);return n.divide(t,n.cos(e))}rightAngleCornerPostInset(e){return e?this._fasciaMountRightAngleCornerPostInset():this._surfaceMountRightAngleCornerPostInset()}_surfaceMountRightAngleCornerPostInset(){const e=n.divide(this.postLength(),2),t=n.divide(this.postWidth(),2),r=n.divide(this.cornerPostGap(),2);return n.add(e,t,r)}_fasciaMountRightAngleCornerPostInset(){const e=this.fasciaLayoutEdgeOffset(),t=n.divide(this.baseplateLength(),2),r=this.terminalBaseplateOffset(),i=n.subtract(t,r);return n.add(e,i)}obliqueCornerPostInset(e,t){const r=n.divide(this.postLength(),2),i=e/2,s=n.divide(this.postWidth(),2),o=n.multiply(s,-Math.tan(i)),a=n.add(r,o),l=Math.abs(e-180..degreesToRadians()),c=n.divide(this.cornerPostGap(),2),u=n.divide(c,Math.sin(l/2));return n.max(a,u)}cornerPostGap(){return n.unit(3.75,"in")}makeRail(e){return new(this.topRailClass())(e,this.railWidth(),this.railDepth())}topRailClass(){return s}hasWallReturns(){return!1}continuousRail(){return!1}extendRailToPosts(){return!0}shouldHaveBeginExtension(e,t){if(!this.extendRailToPosts())return!1;const r=e.railLayoutEdge().xy(),n=r.direction();return y.directionTo(r.begin(),t).normalized().equals(n)}shouldHaveEndExtension(e,t){if(!this.extendRailToPosts())return!1;const r=e.railLayoutEdge().xy(),n=r.reversed().direction();return y.directionTo(r.end(),t).normalized().equals(n)}shouldHavePostAtEnd(e){return!e.sectionConnectedToEnd()||!e.sloped()||e.isEndAtSlopeBottom()}shouldHavePostAtBegin(e){return!e.sectionConnectedToBegin()||!e.sloped()||!e.isEndAtSlopeBottom()}postClass(){return o}treadMountPostClass(){return m}treadMountTopPostClass(){return this.treadMountPostClass()}stringerMountPostClass(){return this.postClass()}perpendicularStairTopPostClass(){return this.treadMountPostClass()}postLayoutEdgeInsetHelperClass(){return d}componentLayoutEdgeInsetHelperClass(){return f}buildDetails(){return{structuralSteel:"",tubesASTM:"",welds:"",holeSize:"",bolts:"",surfacePrep:""}}linearFootPricingMaterialSpecifier(){throw new i(this,"linearFootPricingMaterialSpecifier")}get materials(){return v}slopedPostEndpointOffset(){return n.unit(0,"in")}terminalRailLoopClass(){}terminalRailLoopLength(){return n.unit(0,"in")}terminalRailLoopHeight(){return n.unit(0,"in")}materialSpecifierStyleId(){return g.capitalized(this.styleId)}fasciaPostExtension(){return n.unit(5,"in")}fasciaLayoutEdgeOffset(){const e=n.divide(this.postWidth(),2),t=this.baseplateDepth(),r=this.baseplateSpacerLength();return n.add(e,t,r)}railLayoutEdge(e){const t=-e.postHeight().toNumeric(e.unit());return e.componentLayoutEdge().addZ(t).relativeToEdge(e.edge())}railingHeightForSection(e){return n.subtract(e.postProvider().railingHeight(),e.ponyWallHeight())}}},16864:(e,t,r)=>{const n=r(63768),i=r(30691),s=r(26917),o=r(46748);e.exports=class RogueFabricatorsStandardRailingStyle extends s{railLayoutEdge(e){const t=this._isSectionFasciaLevelAtToSlopeTopCorner(e);return this._isSectionFasciaSlopeWithTopCorner(e)?this._railLayoutEdgeForFasciaSlopeWithTopCorner(e):t?this._railLayoutEdgeForFasciaLevelAtTopCorner(e):super.railLayoutEdge(e)}railingHeightForSection(e){const t=super.railingHeightForSection(e);if(!this._isSectionFasciaSlopeWithTopCorner(e))return t;const r=e.componentLayoutEdge(),i=this._baseRailLayoutEdgeForFasciaSlopeWithTopCorner(e),s=e.isBeginAtSlopeTop(),o=s?r.begin():r.end(),a=(s?i.begin():i.end()).z()-o.z(),l=n.unit(a,e.unit());return n.add(t,l)}_railLayoutEdgeForFasciaSlopeWithTopCorner(e){const t=this._baseRailLayoutEdgeForFasciaSlopeWithTopCorner(e);return this._layoutEdgeAtRailingHeight(t,e)}_baseRailLayoutEdgeForFasciaSlopeWithTopCorner(e){const t=e.componentLayoutEdge(),r=e.slopeRadians(),s=n.divide(this.railWidth(),2),o=this.fasciaLayoutEdgeOffset(),a=n.add(s,o),l=n.divide(a,Math.cos(r)).toNumeric(e.unit()),c=e.isBeginAtSlopeTop(),u=c?-l:0,d=c?0:-l;return i.stretchedEdgeBy(t,u,d)}_railLayoutEdgeForFasciaLevelAtTopCorner(e){const t=e.isCornerAtBegin(),r=e.isCornerAtEnd(),s=e.sectionConnectedToBegin()?.isEndAtSlopeTop(),a=e.sectionConnectedToEnd()?.isBeginAtSlopeTop(),l=t&&s,c=r&&a,u=this.postLength(),d=this.railWidth(),h=o`(${d} - ${u}) / 2`,p=n.subtract(d,h).toNumeric(e.unit()),m=l?p:0,f=c?p:0,g=i.stretchedEdgeBy(e.componentLayoutEdge(),m,f);return this._layoutEdgeAtRailingHeight(g,e)}_isSectionFasciaSlopeWithTopCorner(e){const t=e.sectionConnectedToTop(),r=e.isFasciaMount(),n=e.isBeginAtSlopeTop()?e.isCornerAtBegin():e.isCornerAtEnd();return t&&r&&n}_isSectionFasciaLevelAtToSlopeTopCorner(e){const t=e.isLevel(),r=e.isFasciaMount();if(!t||!r)return!1;const n=e.isCornerAtBegin(),i=e.isCornerAtEnd(),s=e.sectionConnectedToBegin()?.isEndAtSlopeTop(),o=e.sectionConnectedToEnd()?.isBeginAtSlopeTop();return n&&s||i&&o}_layoutEdgeAtRailingHeight(e,t){const r=-t.postHeight().toNumeric(t.unit());return e.addZ(r).relativeToEdge(t.edge())}shouldHaveBeginExtension(e,t){return(!!e.sectionConnectedToBegin()||!e.isBeginAtSlopeTop())&&(!!e.isCornerAtBegin()&&super.shouldHaveBeginExtension(e,t))}shouldHaveEndExtension(e,t){return(!!e.sectionConnectedToEnd()||!e.isEndAtSlopeTop())&&(!!e.isCornerAtEnd()&&super.shouldHaveEndExtension(e,t))}}},27927:(e,t,r)=>{const n=r(63768),i=r(38252),s=r(16864);e.exports=class RogueFabricatorsTritonRailingStyle extends s{linearFootPricingMaterialSpecifier(){return this.materials.LinearFeetOfRailingTriton}blockClass(){return i}bottomRailWidth(){return n.unit(1,"in")}bottomRailDepth(){return this.bottomRailWidth()}}},34419:(e,t,r)=>{const n=r(45618);e.exports=class RogueFabricatorsVikingRailingStyle extends n{linearFootPricingMaterialSpecifier(){return this.materials.LinearFeetOfRailingViking}}},39632:(e,t,r)=>{const n=r(83550),i=r(46353),s=r(94814),o=r(27927),a=r(72834),l=r(34419),c=r(19456),u=r(64817),d=r(19502),h="colosseum",p="orion",m="triton",f="pantheon",g="achilles",y="viking",b="javelin",v="eva",_="gemini";e.exports=function(){return{colosseum:new i(h,"Colosseum","colosseum-rail"),orion:new n(p,"Orion","cable-rail"),triton:new o(m,"Triton","triton-rail"),pantheon:new s(f,"Pantheon","generic-rail"),achilles:new a(g,"Achilles","hand-grab-flat-rail"),viking:new l(y,"Viking","hand-grab-rail"),javelin:new c(b,"Javelin","hand-grab-rail"),eva:new u(v,"Eva","top-rail-only"),gemini:new d(_,"Gemini","ada-rail")}}},57174:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),s=r(20901),o=r(88646),a=r(6338),l=r(30202);e.exports=class RogueFabricatorsCircleRail extends a{diameter(){return this.width()}radius(){return n.divide(this.width(),2)}depth(){return this.diameter()}crossSection(){const e=this.radius().toNumeric(this.unit());return new o([new s(i(0,-e).expandedByRadius(e))])}extrusionClass(){return l}}},6338:(e,t,r)=>{const n=r(63768),{extend:i}=r(50988),{$P:s}=r(62048),o=r(28219),a=r(2198),l=r(45208),c=r(93387);class RogueFabricatorsRail extends a{constructor(e,t,r,n="Top"){super(e),this._width=t,this._depth=r,this._railPositionString=n}width(){return this._width}depth(){return this._depth}railPositionString(){return this._railPositionString}color(){return this.componentOf().railingColor()}formatter(){return this.componentOf().project().unitFormatter()}beginMiterDirection(){return this._beginMiterDirection}endMiterDirection(){return this._endMiterDirection}setBeginMiterDirection(e){this._beginMiterDirection=e}setEndMiterDirection(e){this._endMiterDirection=e}specifierMiterDecimalPlaces(){return this.project().decimalFormatterDecimalPlaces()}referenceMaterialSpecifier(){const e=this.componentOf().railingStyle().materialSpecifierStyleId(),t=this.railPositionString();return this.materials[`${t}Rail${e}`]}materialSpecifier(){const e=this.extrusion().longestEdgeLine(),t=this._formattedLengthForEdge(e);return this._specifierForLength(t)}extrusionMaterialSpecifier(){const e=this._formattedLengthForEdge(this.edge());return this._specifierForLength(e)}_specifierForLength(e){const t=this.referenceMaterialSpecifier(),r=this.color(),n=this.specifierMiterDecimalPlaces(),i=this.beginMiterDirection()?.roundedTo(n)??s(0,0,0),o=this.endMiterDirection()?.roundedTo(n)??s(0,0,0),a=this._formattedLengthForEdge(this.edge()),l=`${t.name()} - ${a} - start miter (${i.x()},${i.y()},${i.z()}) - end miter (${o.x()},${o.y()},${o.z()})`;return t.specifierFor(l,{[c.length]:e,materialName:r.materialName(),fillStyle:r.fillStyle(),strokeStyle:r.strokeStyle()})}_formattedLengthForEdge(e){const t=n.unit(e.length(),this.unit());return this.formatter().format(t)}centerlineEdge(){const e=this.depth().toNumeric(this.unit())/2;return this.edge().addZ(-e)}materialParts(){return[this.extrusion()]}extrusionClass(){return l}}i(RogueFabricatorsRail,o),e.exports=RogueFabricatorsRail},18037:(e,t,r)=>{const{Rectangle:n}=r(62048),i=r(6338),s=r(88646),o=r(56214);e.exports=class RogueFabricatorsRectangleRail extends i{crossSection(){const e=this.width().toNumeric(this.unit())/2,t=this.depth().toNumeric(this.unit());return new s([new o(new n(-e,0,2*e,-t))])}}},37766:e=>{e.exports={SECTION_LENGTH_ANNOTATIONS:"Section Lengths",PLATFORM_LENGTH_ANNOTATIONS:"Platform Lengths",POST_HEIGHT_ANNOTATIONS:"Post Height",POST_ANNOTATIONS:"Post Dimensions",RUN_LABELS:"Run Labels"}},72768:(e,t,r)=>{const n=r(63768),{EditableProperty:i}=r(7340),{FixedEdgeLocator:s}=r(62048),{RailLengthHelper:o}=r(8423),a=r(10590),l=r(30691),c=r(79256),u=r(89064),d=r(67603),h=r(84514),p=r(72539),m=r(63106),f=r(6556),g=r(52832),y=r(34662),b=r(5895),v=r(39632),_=r(15096),x=r(37766);e.exports=class RogueFabricatorsRailingSection extends a{defaultDisplayProperties(){const e=this.postMountStyle().displayProperties(),t=this.componentOf().placementStrategyProperties();return new h(this,[new d(this,[this.railingStyleProperty(),this.postMountStyleProperty(),new i(this,"Stair Mount Surface",{type:"select",choices:this.stairMountSurfaceOptions(),showOnCollection:!0}),new i(this,"Pony Wall Height",{type:"unit",defaultUnit:"in",showOnCollection:!0,ignoreIntermediateEdits:!0}),new i(this,"Flip Slope",{type:"action",perform:()=>this.flipSlope(),restorable:!1}),new i(this.run(),"Create Opposite Railing",{type:"action",perform:()=>this.createOppositeRailing()})]),e,t])}_railingStylePropertyType(){return"trayselect"}showFlipSlopeProperty(){return!this.isLevel()}setRailingStyle(e){super.setRailingStyle(e),this._coercePostMountStyle(),this.coerceStairMountSurface(),this.resetComponents()}railingStyleChoices(){return[v().colosseum,v().orion,v().triton,v().pantheon,v().achilles,v().viking,v().javelin,v().eva,v().gemini]}_coercePostMountStyle(){this.railingStyle().supportedPostMountStyles().some((e=>e.equals(this.postMountStyle())))||this.resetPostMountStyle()}_defaultPostMountStyleChoices(){return this.railingStyle().supportedPostMountStyles()}resetPostMountStyle(){this._postMountStyle=void 0,this._postMountStyleChoices=void 0}stairMountSurface(){return this._stairMountSurface??=this.stairMountSurfaceOptions().first()}stairMountSurfaceOptions(){const e=this.railingStyle().supportedStairMountSurfaces();return this.isStairs()?e:[e.first()]}coerceStairMountSurface(){this.railingStyle().supportedStairMountSurfaces().some((e=>e.equals(this.stairMountSurface())))&&this.isStairs()||this.resetStairMountSurface()}resetStairMountSurface(){this._stairMountSurface=void 0}showStairMountSurfaceProperty(){return this.isStairs()}setStairMountSurface(e){this._stairMountSurface=e,this.componentOf().resetStructure(),this.resetComponents()}placementStrategy(){return this.componentOf().placementStrategy()}slopeRadians(){return this.placementStrategy().slopeRadians()}railingHeight(){return this.railingStyle().railingHeightForSection(this)}railingColor(){return this.postProvider().railingColor()}postHeight(){const e=this.railingHeight(),t=this.railingStyle().railDepth();return n.subtract(e,t)}makePost(e,t,r){const n=new(this._classForPost(e,t,r))(e);return n.setComponentOf(this),n}shouldHavePostAtEnd(){return this.railingStyle().shouldHavePostAtEnd(this)}shouldHavePostAtBegin(){return this.railingStyle().shouldHavePostAtBegin(this)}_classForPost(e,t,r){const n=this.railingStyle(),i=t===r,s=0===t&&this.isBeginAtStairTop()||i&&this.isEndAtStairTop();return this._perpendicularSlopeTopConnection(e)?n.perpendicularStairTopPostClass():this.isTreadMountStairs()&&s?n.treadMountTopPostClass():this.isTreadMountStairs()?n.treadMountPostClass():this._usingStringerMountPosts()?n.stringerMountPostClass():n.postClass()}_perpendicularSlopeTopConnection(e){if(this.stairMountSurface().hasStringer()&&this.isFasciaMount())return!1;const t=this.postLayoutEdge(),r=t.xy().closestPointTo(e),n=t.begin().xy().equals(r),i=t.end().xy().equals(r);if(!n&&!i)return!1;const s=n?this.sectionConnectedToBegin():this.sectionConnectedToEnd();if(!s)return!1;const o=n?this.edge().begin():this.edge().end(),a=this.sloped()!==s.sloped();return this.isPerpendicularToSection(s)&&a&&s.isLevel()&&this.isSlopeTopAt(o)}maxPostSpacing(){return this.railingStyle().maxPostSpacing()}minLength(){return this.constructor.minLength()}_makeRail(e){const t=this.railingStyle().makeRail(e);return t.setComponentOf(this),t}rails(){return this._rails||(this._rails=this._defaultRails(),this.connectedExtrusionsMiterHelper().miterExtrusions(this._rails,this.connectedSections().flatMap((e=>e.rails())))),this._rails}_defaultRails(){return[this.topRail(),...this.railExtensions()]}topRail(){const e=this.railLayoutEdge(),t=this._makeRail(e);if(this.sloped()){const r=e.xy().direction();t.setBeginMiterDirection(r),t.setEndMiterDirection(r)}return t}connectedExtrusionsMiterHelper(){return this._connectedExtrusionsMiterHelper??new y}slopeTopPostLevelRail(){if(this.isLevel())return;const e=this.isBeginAtSlopeBottom()?this.endPost():this.beginPost(),t=this.isBeginAtSlopeBottom()?this.sectionConnectedToEnd():this.sectionConnectedToBegin();if(!e.isTerminalPost()&&this.isParallelToSection(t))return;const r=e.levelTopRailEdge?.();return r?this._makeRail(r):void 0}blockClass(){return this.railingStyle().blockClass()}blockEdges(){return l.pointArrayToEdges(this.postLocationsAlongSlope())}beginBlock(){return this.blocks().first()}endBlock(){return this.blocks().last()}isStairs(){return this.placementStrategy().isStairs()}_usingStringerMountPosts(){return this.sloped()&&this.stairMountSurface().hasStringer()}isStringerMountStairs(){return this.isStairs()&&this.stairMountSurface().hasStringer()}isTreadMountStairs(){return this.isStairs()&&this.stairMountSurface().treadMountPosts()}isFasciaMount(){return this.postMountStyle().isFasciaMount()}ponyWall(){if(this._ponyWallAllowed())return this._ponyWall??=this._defaultPonyWall()}_ponyWallAllowed(){return!!this.railingStyle().ponyWallAllowed()&&(this.stairMountSurface().hasStringer()||this.isLevel())}_defaultPonyWall(){const e=new u(this.ponyWallLayoutEdge(),this.ponyWallWidth());return e.setComponentOf(this),e.setDrawingLayer(b.platformLayerFor(this.edge())),e}ponyWallHeight(){return this._ponyWallHeight??=n.unit(0,"in")}ponyWallWidth(){return n.unit(6,"in")}setPonyWallHeight(e){this._ponyWallHeight=e,this.resetComponents()}validatePonyWallHeight(e,t){if(e)return n.smaller(t,n.unit(0,"in"))?'Must be equal to or greater than 0"':n.larger(t,n.unit(24,"in"))?'Must be equal to or smaller than 24"':void 0}showPonyWallHeightProperty(){return this._ponyWallAllowed()}hasWallReturns(){return this.railingStyle().hasWallReturns()}railExtensions(){return[this.continuousRailExtension(),...this.wallReturns(),...this.railToPostExtensions(),this.slopeTopPostLevelRail()].filter((e=>e))}wallReturns(){if(!this.hasWallReturns())return[];const e=this.railLayoutEdge(),t=e.normal().negated(),r=this.postMountStyle().componentLayoutEdgeOffset(this),n=t.multipliedBy(r),i=[];if(this._shouldHaveWallReturn(!0)){const t=e.begin().snapshot(),r=t.add(n).to(t).relativeToEdge(this.edge());i.push(r)}if(this._shouldHaveWallReturn(!1)){const t=e.end().snapshot(),r=t.add(n),s=t.to(r).relativeToEdge(this.edge());i.push(s)}return i.map((e=>this._makeRail(e)))}_shouldHaveWallReturn(e){const t=e?this.sectionConnectedToBegin():this.sectionConnectedToEnd();if(!t)return!0;if(this.railingStyle().continuousRail())return!1;const r=e?this.railLayoutEdge().begin():this.railLayoutEdge().end(),n=e?t.railLayoutEdge().end():t.railLayoutEdge().begin();return!r.equals(n)}continuousRailExtension(){if(!this.railingStyle().continuousRail())return;const e=this.sectionConnectedToEnd();if(!e)return;const t=this.railLayoutEdge().end(),r=e.railLayoutEdge().begin();return t.equals(r)?void 0:this._makeRail(t.to(r))}railToPostExtensions(){const e=this._shouldHaveBeginExtension(),t=this._shouldHaveEndExtension();if(!e&&!t)return[];const r=[],n=this.railLayoutEdge(),i=this.beginPost().topLocator(),s=this.endPost().topLocator(),o=i.to(n.begin()).relativeToEdge(this.edge()),a=n.end().to(s).relativeToEdge(this.edge());return e&&!o.length().isNearTo(0)&&r.push(o),t&&!a.length().isNearTo(0)&&r.push(a),r.map((e=>this._makeRail(e)))}_shouldHaveBeginExtension(){const e=this.beginPost();if(!e)return!1;const t=e.topLocator().xy();return this.railingStyle().shouldHaveBeginExtension(this,t)}_shouldHaveEndExtension(){const e=this.endPost();if(!e)return!1;const t=e.topLocator().xy();return this.railingStyle().shouldHaveEndExtension(this,t)}terminalRailLoops(){return this._terminalRailLoops??=this._defaultTerminalRailLoops()}_defaultTerminalRailLoops(){const e=this.railingStyle().terminalRailLoopClass(),t=[];if(!e)return t;const r=this.edge().xy().direction(),n=this.railingStyle().terminalRailLoopLength().toNumeric(this.unit()),i=this.railingStyle().railWidth(),s=this.railingStyle().terminalRailLoopHeight();if(!this.sectionConnectedToBegin()){const o=this.beginPost().topLocator(),a=r.negated().multipliedBy(n),l=o.to(o.add(a));t.push(new e(l,i,s))}if(!this.sectionConnectedToEnd()){const o=this.endPost().topLocator(),a=r.multipliedBy(n),l=o.to(o.add(a));t.push(new e(l,i,s))}return t.forEach((e=>e.setComponentOf(this))),t}isCornerAtBegin(){const e=this.sectionConnectedToBegin();return!!e&&!this.isParallelToSection(e)}isCornerAtEnd(){const e=this.sectionConnectedToEnd();return!!e&&!this.isParallelToSection(e)}postLocations(){const e=this.isTreadMountStairs()?this._treadMountPostLocations():super.postLocations();if(this.isLevel())return e;const t=this._slopedPostLocationForEndpoint(this.postLayoutEdge().begin(),e),r=this._slopedPostLocationForEndpoint(this.postLayoutEdge().end(),e);return[t,...e.slice(1,-1),r]}_slopedPostLocationForEndpoint(e,t){const r=this.postLayoutEdge(),n=e.equals(r.begin()),i=n?t.first():t.last(),o=this.railingStyle().slopedPostEndpointOffset().toNumeric(this.unit());if(o.isNearTo(0))return i;const a=this.postLength().toNumeric(this.unit())/2,l=this.isStairs()?o:o+a,c=n?this.isBeginAtSlopeTop():this.isEndAtSlopeTop(),u=this.edge().xy(),d=this.isBeginAtSlopeTop()?u.direction():u.direction().negated(),h=(c?d.negated():d).multipliedBy(l),p=i.to(i.add(h)).relativeToEdge(this.edge());return new s(p,p.length())}_treadMountPostLocations(){const e=this.stairTreadPostLayoutEdges(),t=this.maxPostSpacing().toNumeric(this.unit()),r=this.postLengthExtent().toNumeric(this.unit()),n=this.isSlopeFlipped(),i=this.isBeginAtStairTop()?this.sectionConnectedToBegin():this.sectionConnectedToEnd(),s=i&&!this.isParallelToSection(i)&&this.isFasciaMount(),o=this.postLayoutEdge().begin(),a=this.edge().direction();return this.stairMountSurface().postLocations(e,{maxPostSpacing:t,postLengthExtent:r,isTopCornerConnection:s,isSlopeFlipped:n}).sort(((e,t)=>e.subtract(o).dot(a)-t.subtract(o).dot(a)))}postLocationsAlongSlope(){const e=this.postLayoutEdge(),t=e.length(),r=e.stretchedBy(t).relativeToEdge(e),n=e.begin().xy(),i=this.slopeRadians(),o=t/2,a=e.xy().direction();return this.postLocations().map((e=>{const t=n.distanceTo(e.xy()),l=n.to(e.xy()).direction().equals(a)?1:-1,c=Math.tan(i)*t,u=o+Math.hypot(t,c)*l;return new s(r,u)}))}postLayoutEdgeInsetHelperClass(){return this.railingStyle().postLayoutEdgeInsetHelperClass()}stairTreadPostLayoutEdges(){const e=this.placementStrategy().defaultStructureRepresentation(),t=this.postLengthExtent().toNumeric(this.unit())/2,r=this.railingStyle().postLength().toNumeric(this.unit())/2,n=this.componentLayoutEdge(),i=e.treadEdges(),s=i.length-1;return i.map(((e,i)=>{const o=e.normal().dot(n.begin().subtract(e.begin())),a=e.shiftedAlongNormalBy(o),c=-t,u=0===i||i===s?-r:-t;return l.stretchedEdgeBy(a,c,u).relativeToEdge(this.edge())}))}useSlopedBaseplate(){return this.sloped()&&this.hasStringer()&&!this.isFasciaMount()}rightAngleCornerPostInset(){return this.railingStyle().rightAngleCornerPostInset(this.isFasciaMount())}obliqueCornerPostInset(e){return this.railingStyle().obliqueCornerPostInset(e,this.isFasciaMount())}terminalPostInset(){return this.railingStyle().terminalPostInsetForSlope(this.slope())}terminalPostInsetWithGap(){const e=n.unit(.25,"in");return n.add(e,this.terminalPostInset())}railLayoutEdge(){return this.railingStyle().railLayoutEdge(this)}componentLayoutEdge(){const e=super.componentLayoutEdge(),t=this._ponyWallAllowed()?-this.ponyWallHeight().toNumeric(this.unit()):0;return e.addZ(t).relativeToEdge(this.edge())}ponyWallLayoutEdge(){return this.platformLayoutEdge().shiftedAlongNormalBy(-this.structureDirection()*this.ponyWallWidth().toNumeric(this.unit())/2)}platformLayoutEdge(){const e=this.componentOf().platformLayoutEdgeOffset(this);return e?this.edge().movedBy(e.x(),e.y(),e.z()).relativeToEdge(this.edge()):this.edge()}postLength(){return this.railingStyle().postLength()}postLengthExtent(){return this.railingStyle().postLengthExtent()}postWidth(){return this.railingStyle().postWidth()}postSpacingMode(){return o.mode.EVEN}_defaultStairPostSpacingHelper(){return new c(this.maxPostSpacing(),this.unit())}hasStringer(){return this.stairMountSurface().hasStringer()}buildDetails(){return this.railingStyle().buildDetails()}components(){return[...super.components(),this.ponyWall(),...this.terminalRailLoops()].filter((e=>e))}resetComponents(){super.resetComponents(),this._blocks=void 0,this._ponyWall=void 0,this._terminalRailLoops=void 0,this.resetDisplayProperties()}selfMaterialLineItems(){const e=this.rails().reduce(((e,t)=>e+t.edge().length()),0)+this.terminalRailLoops().reduce(((e,t)=>e+t.edge().length()),0),t=n.unit(e,this.unit()),r=n.unit(n.ceil(t.toNumeric("ft")),"ft"),i=this.railingStyle().linearFootPricingMaterialSpecifier();return[new f(r,i)]}defaultAnnotations(){return[...super.defaultAnnotations(),this.platformLengthAnnotation()].filter((e=>e))}sectionLengthAnnotation(){const e=new(this.systemStrategy().annotationType())(this.railLayoutEdge(),30*this.annotationDirection(),this.unit(),{formatter:this.project().unitFormatter()});return e.setLayer(x.SECTION_LENGTH_ANNOTATIONS),e}platformLengthAnnotation(){const e=new(this.systemStrategy().annotationType())(this.edge(),50*this.annotationDirection(),this.unit(),{formatter:this.project().unitFormatter()});return e.setLayer(x.PLATFORM_LENGTH_ANNOTATIONS),e}stairHeightAnnotation(e=35,t){if(!this.isStairs())return super.stairHeightAnnotation(e,t);const r=this.platformLayoutEdge().begin(),n=this.platformLayoutEdge().end(),i=r.z()>n.z()?n:r,s=i===r?n:r,o=this.placementStrategy().stepRise().toNumeric(this.unit()),a=s.addZ(o),l=i.to(a).relativeToEdge(this.platformLayoutEdge());return new m(l,e*this.annotationDirection(),this.unit(),t)}projectedAnnotations(e,t,r){return[this._projectedSectionLengthAnnotation(e,t,r),this._projectedBaseplateToTopRailTopAnnotation(e,t,r),this._projectedBaseplateToTopRailBottomAnnotation(e,t,r),this._projectedGradientAnnotation(e,t,r),...this._projectedRailOverhangAnnotations(e,t,r)].filter((e=>e))}_projectedSectionLengthAnnotation(e,t,r){return this._projectedDimensionAnnotation(this.rails().first().extrusion().longestEdgeLine().reversed(),30,x.SECTION_LENGTH_ANNOTATIONS,e,t,r)}_projectedBaseplateToTopRailTopAnnotation(e,t,r){const i=this.beginPost(),s=-n.add(this.railingHeight(),i.heightBelowSurface()).toNumeric(this.unit()),o=i.legBottomLocator().addZ(-i.legBottomLocatorZOffset()),a=o.addZ(s);return this._projectedDimensionAnnotation(o.to(a),20,x.POST_HEIGHT_ANNOTATIONS,e,t,r)}_projectedBaseplateToTopRailBottomAnnotation(e,t,r){const n=this.endPost(),i=n.legBottomLocator(!1).addZ(-n.legBottomLocatorZOffset()),s=n.legTopLocator(!1);return this._projectedDimensionAnnotation(i.to(s),-20,x.POST_HEIGHT_ANNOTATIONS,e,t,r)}_projectedGradientAnnotation(e,t,r){if(this.isLevel())return;const i=-this.railingHeight().toNumeric(this.unit()),s=this.edge().addZ(i),o=l.projectedEdge(s,e,t,r),a=this.project().unitFormatter(!1),c=Math.abs(this.edge().begin().z()-this.edge().end().z()),u=this.edge().xy().length(),d=n.unit(c,this.unit()),h=n.unit(u,this.unit()),m=this.slopeRadians().radiansToDegrees().roundedTo(2),f=.0625*(u+c);return new p(o,-100,{riseText:a.format(d),runText:a.format(h),hypotenuseText:`${m}°`,magnification:f})}_projectedRailOverhangAnnotations(e,t,r){if(this.sloped())return[];const n=this.rails().first().extrusion().longestEdgeLine();return[this.railBeginOverhangEdge(),this.railEndOverhangEdge()].filter((e=>!e.length().isNearTo(0))).map((i=>new g(l.projectedEdge(i,e,t,r),15,this.unit(),{textAtBegin:!i.end().xy().equals(n.begin().xy(),Math.SIGNIFICANT_DECIMAL_PLACES),formatter:this.project().unitFormatter(),color:_.dimensionColor})))}railBeginOverhangEdge(){return this._railOverhangEdge(!0)}railEndOverhangEdge(){return this._railOverhangEdge(!1)}_railOverhangEdge(e){const t=this.rails().first(),r=t.extrusion().longestEdgeLine(),n=e?this.beginPost().edgeToPostBeginIntersectionXY():this.endPost().edgeToPostEndIntersectionXY(),i=e?n.to(r.begin()):r.end().to(n),s=t.boundingCube().high();return l.flattenedAtZ(i,s)}_projectedDimensionAnnotation(e,t,r,n,i,s){const o=new(this.systemStrategy().annotationType())(l.projectedEdge(e,n,i,s),t,this.unit(),{formatter:this.project().unitFormatter(),color:_.dimensionColor});return o.setLayer(r),o}materialParts(){return this.components().flatMap((e=>e.materialParts?.()??[]))}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_blocks","_ponyWall","_terminalRailLoops","_connectedExtrusionsMiterHelper"]}}},78321:(e,t,r)=>{const n=r(80006);e.exports=class RogueFabricatorsCoreTreadStairMountSurface extends n{postLocations(e,t){return e.push(this._bottomLandingEdge(e)),super.postLocations(e,t)}_bottomLandingEdge(e){const t=e.last(),r=e[e.length-2],n=t.direction(),i=t.length(),s=t.begin().subtract(r.end()).z(),o=t.begin().xy().distanceTo(r.end().xy()),a=t.end().add(n.multipliedBy(o)),l=a.add(n.multipliedBy(i));return a.to(l).addZ(s).relativeToEdge(t)}_postLayoutEdgeXY(e,t){const r=e.first().end().xy(),n=e.last().begin().xy();return r.to(n).snapshot()}}},93512:(e,t,r)=>{const n=r(11496);e.exports=class RogueFabricatorsStringerStairMountSurface extends n{get label(){return"Stringer"}hasStringer(){return!0}}},80006:(e,t,r)=>{const{ProportionalEdgeLocator:n}=r(62048),i=r(11496);e.exports=class RogueFabricatorsTreadStairMountSurface extends i{get label(){return"Tread"}treadMountPosts(){return!0}postLocations(e,t){return this._postLocationsXY(e,t).map((r=>{const n=this._containingEdgeForPoint(r,e,t.isSlopeFlipped);return n?n.closestRelativePointTo(r):r}))}_containingEdgeForPoint(e,t,r){const n=t.find((t=>t.xy().containsPoint(e)));return r?n.reversed():n}_postLocationsXY(e,{maxPostSpacing:t,isTopCornerConnection:r,postLengthExtent:i}){const s=this._postLayoutEdgeXY(e,r),o=s.snapshot(),a=Math.ceil(s.length()/t)+1-1,l=[];for(let e=0;e<=a;e++){const t=e/a;l.push(new n(o,t))}return this._adjustLocatorsToFitSteps(l,e,o,t),this.locatorsWithLocatorAtEdgeEnd(l,s,t,i)}locatorsWithLocatorAtEdgeEnd(e,t,r,i){const s=e.last(),o=e[e.length-2];if(!!s.equals(t.end()))return e;const a=new n(t,1),l=s.distanceTo(a),c=o.distanceTo(a);return l<i&&c<=r&&e.pop(),e.push(a),e}_postLayoutEdgeXY(e,t=!1){const r=t?e[1].begin().xy():e.first().end().xy(),n=e.last().end().xy();return r.to(n).snapshot()}_adjustLocatorsToFitSteps(e,t,r,n){const i=r.direction().negated();let s=this._requiredReduction(t,e),o=0;for(;s>0&&o<n;){o+=s;const n=i.multipliedBy(s);r.end().moveBy(n.x(),n.y(),n.z()),s=this._requiredReduction(t,e)}}_requiredReduction(e,t){const r=this._firstInvalidLocator(e,t);return r?this._distanceToClosestValidPosition(e,r):0}_firstInvalidLocator(e,t){return t.find((t=>!e.find((e=>e.xy().containsPoint(t)))))}_distanceToClosestValidPosition(e,t){return e.reduce(((e,r)=>{const n=r.end().distanceTo(t);return Math.min(n,e)}),1/0)}}},78089:(e,t,r)=>{const{Drawable:n}=r(7340),i=r(35668);e.exports=class RogueFabricatorsExtrusionHoleProjectedFigure extends n{constructor(e,t,r,n){super(),this.setModel(e),this._xAxis=t,this._yAxis=r,this._zAxis=n}xAxis(){return this._xAxis}yAxis(){return this._yAxis}zAxis(){return this._zAxis}edge(){return new i(this.model().edge().begin(),this.xAxis(),this.yAxis(),this.zAxis()).to(new i(this.model().edge().end(),this.xAxis(),this.yAxis(),this.zAxis()))}_radiusNumeric(){return this.model().radius().toNumeric(this.model().unit())}_skipDrawing(){return!1}_draw(e,t){const r=this.edge(),n=e.getTransform().a;e.lineWidth=.5/n,e.strokeStyle="#000000",e._alterAndRestoreAfter((()=>{e.setLineDash([.05,.05]),this.sideEdges().forEach((t=>{e._drawLine(t.begin(),t.end())}))})),this._drawEllipse(e,r.begin()),this._drawEllipse(e,r.end())}sideEdges(){const e=this._radiusNumeric(),t=this.edge();return[t.shiftedAlongNormalBy(e),t.shiftedAlongNormalBy(-e)]}_drawEllipse(e,t){const r=this.edge(),n=this._radiusNumeric(),i=this.distanceBeyondEdge();e.beginPath(),e.ellipse(t.x(),t.y(),n,i,r.theta()+Math.PI_2,0,Math.TWO_PI),e.stroke()}distanceBeyondEdge(){const e=this._radiusNumeric(),t=this.edge().phi();return Math.abs(Math.cos(t)*e)}}},64524:(e,t,r)=>{const n=r(79591);e.exports=class RogueFabricatorsDrawing3DController extends n{_shadowPlane(e,t,r){const n=super._shadowPlane(e,t,r);return this.project().planBackground()&&(n.receiveShadow=!1),n}}},59865:(e,t,r)=>{const n=r(50636),i=r(79591),s=r(98272),o=r(43812),a=r(89929),l=r(82188),c=r(12154);e.exports=class AccessPlatformSystemStrategy extends n{defaultEditTools(e,t){return[new a(c,e,t),new a(l,e,t)]}drawingControllerClass(){return s}drawing3DControllerClass(){return i}projectClass(){return o}}},16971:(e,t,r)=>{const n=r(63768),{lumber:i}=r(93613),{ImperialDecimalLengthFormatter:s}=r(7340),o=r(50636),a=r(73531),l=r(94652),c=r(89929),u=r(9649),d=r(46618),h=r(79009),p=r(85309),m=r(21373),f=r(87046),g=r(68500),y=r(55038),b=r(86402),v=r(38670),_=r(68475),x=r(37751),w=r(63197),R=r(98609),k=r(15838),j=r(44476),z=r(42947),q=r(47347);e.exports=class AmericanMuscleDocksStrategy extends o{defaultEditTools(e,t){const r=new w(e,t),n=new s(2);r.setFormatter(n);const i=new b(g,e,t);return i.setAddToProject(!0),[r,new c(u,e,t),new c(d,e,t),new c(p,e,t),new c(R,e,t),new c(h,e,t),i,new v(y,e,t),new x(_,e,t)]}drawingControllerClass(){return l}drawing3DControllerClass(){return a}deckingOptions(){const e={wearDeckGrey:{colors3D:["#b5b5b3"]},wearDeckSaddle:{colors3D:["#593725"],colors2D:["#a3806f"]}};return[new m("Pressure Treated",{description:"",unitPrice:n.unit(3.25,"1/ft^2"),materialSpecifier:i.PT2x6,material:"pressure-treated"}),new m("WearDeck Cool Grey",{description:"",unitPrice:n.unit(8.7,"1/ft^2"),materialSpecifier:q.c54x6,material:"weardeck",colors:e.wearDeckGrey.colors3D}),new m("WearDeck Saddle",{description:"",unitPrice:n.unit(8.7,"1/ft^2"),materialSpecifier:q.c54x6,material:"weardeck",colors:e.wearDeckSaddle.colors3D,colors2D:e.wearDeckSaddle.colors2D})]}projectClass(){return f}alwaysVisibleLayers(){return this.isAdmin()?[]:["Decking"]}partsBreakdownColumns(){return[...this.materialListPropertyNames(),z.quantity,z.unit,z.unitPrice,z.amount]}defaultRetailPricing(){return this._defaultRetailPricing??=this.pricingForMarket("retail")}defaultIndustryPricing(){return this._defaultIndustryPricing??=this.pricingForMarket("industry")}defaultPricingMap(){return{"C-10-M":{retailPrice:15,industryPrice:11},"C-12-M":{retailPrice:22,industryPrice:16},"E-2312":{retailPrice:95,industryPrice:83},"E-2412":{retailPrice:112,industryPrice:99},"E-304812T":{retailPrice:130,industryPrice:114},"E-3312":{retailPrice:128,industryPrice:112},"E-3412T":{retailPrice:158,industryPrice:137},"E-3512T":{retailPrice:194,industryPrice:169},"E-3612T":{retailPrice:228,industryPrice:200},"E-3812T":{retailPrice:293,industryPrice:256},"E-4412T":{retailPrice:217,industryPrice:176},"E-4512T":{retailPrice:234,industryPrice:206},"E-4612T":{retailPrice:289,industryPrice:244},"E-4812T":{retailPrice:389,industryPrice:313},"E-2316":{retailPrice:124,industryPrice:95},"E-2416":{retailPrice:129,industryPrice:113},"E-3316":{retailPrice:145,industryPrice:126},"E-3416T":{retailPrice:178,industryPrice:154},"E-3516T":{retailPrice:217,industryPrice:189},"E-3616T":{retailPrice:255,industryPrice:223},"E-3816T":{retailPrice:346,industryPrice:301},"E-4416T":{retailPrice:244,industryPrice:200},"E-4516T":{retailPrice:289,industryPrice:249},"E-4616T":{retailPrice:342,industryPrice:282},"E-4816T":{retailPrice:421,industryPrice:356},"F-CB53":{retailPrice:1.4,industryPrice:1.05},"F-CB545":{retailPrice:1.65,industryPrice:1.4},"F-CB383":{retailPrice:.8,industryPrice:.65},"F-CB383FB":{retailPrice:1.15,industryPrice:1},"F-CB3825":{retailPrice:.7,industryPrice:.65},"F-CB25225":{retailPrice:.4,industryPrice:.35},"F-CB515":{retailPrice:1.2,industryPrice:1},"F-HB515":{retailPrice:1.3,industryPrice:1},"F-HB3845":{retailPrice:1.3,industryPrice:1},"F-HB386":{retailPrice:1.55,industryPrice:1.3},"F-DSWW":{retailPrice:.5,industryPrice:.4},"F-DSCW":{retailPrice:.55,industryPrice:.5},"F-LB4H":{retailPrice:1,industryPrice:.8},"F-PIN34":{retailPrice:7.7,industryPrice:5.5},"F-RNB":{retailPrice:8.05,industryPrice:6.4},"F-SSB":{retailPrice:13.75,industryPrice:10.45},"L-245":{retailPrice:7.2,industryPrice:7.2},"L-2410":{retailPrice:14.4,industryPrice:14.4},"L-26":{retailPrice:2,industryPrice:2,perUnit:"ft"},"L-28":{retailPrice:2.65,industryPrice:2.65,perUnit:"ft"},"LC-546":{retailPrice:5.5,industryPrice:5.5,perUnit:"ft"},"LC-28":{retailPrice:8.5,industryPrice:8.5,perUnit:"ft"},"LC-235":{retailPrice:13.75,industryPrice:13.75},"LC-2310":{retailPrice:27.5,industryPrice:27.5},"VRR-B01":{retailPrice:21,industryPrice:17.75},"VRR-W01":{retailPrice:26.5,industryPrice:21},"VRR-B02":{retailPrice:28.75,industryPrice:24.25},"VRR-W02":{retailPrice:36.5,industryPrice:29.75},"VRR-B08":{retailPrice:38.5,industryPrice:31},"VRR-W08":{retailPrice:44,industryPrice:35.25},"VRR-CB":{retailPrice:16.5,industryPrice:13.25},"VRR-CW":{retailPrice:16.5,industryPrice:13.25},"WD-A":{retailPrice:4.25,industryPrice:3.75},"WD-CA":{retailPrice:6,industryPrice:4.75},"WD-E":{retailPrice:16,industryPrice:12.5},"WD-F":{retailPrice:27,industryPrice:21.75},"WD-NAFD":{retailPrice:37.4,industryPrice:27.75},"WD-IN":{retailPrice:17.5,industryPrice:13.75},"WD-M":{retailPrice:23.5,industryPrice:18.75},"WD-NAMD":{retailPrice:30.8,industryPrice:21.75},"WD-W":{retailPrice:1.75,industryPrice:1.5},"WD-SF":{retailPrice:42.25,industryPrice:34.75},"WD-SM":{retailPrice:36.25,industryPrice:29.75},"WD-SMF":{retailPrice:36.25,industryPrice:29.75},"WD-TM":{retailPrice:13.75,industryPrice:11},"WD-TF":{retailPrice:16.5,industryPrice:13.75},"WD-TFD":{retailPrice:21.75,industryPrice:17},"WD-TMD":{retailPrice:15.5,industryPrice:12.75},"STF-TM":{retailPrice:23.25,industryPrice:18.75},"STF-TF":{retailPrice:27.5,industryPrice:23.25},"STF-DTM":{retailPrice:28.75,industryPrice:23.25},"STF-DTF":{retailPrice:36.5,industryPrice:29.75},"STF-310T":{retailPrice:512,industryPrice:446},"STF-410T":{retailPrice:593,industryPrice:516},"STF-510T":{retailPrice:660,industryPrice:565},"STF-610T":{retailPrice:708,industryPrice:604},"STF-810T":{retailPrice:840,industryPrice:728},"STF-35T":{retailPrice:332.8,industryPrice:289.9},"STF-45T":{retailPrice:385.45,industryPrice:335.4},"STF-55T":{retailPrice:429,industryPrice:367.25},"STF-65T":{retailPrice:460.2,industryPrice:392.6},"STF-85T":{retailPrice:546,industryPrice:473.2},"STF-310FT":{retailPrice:482,industryPrice:416},"STF-410FT":{retailPrice:559,industryPrice:482},"STF-510FT":{retailPrice:631,industryPrice:541},"STF-610FT":{retailPrice:678,industryPrice:583},"S3-F3C":{retailPrice:784,industryPrice:686},"S3-F3CK":{retailPrice:1120,industryPrice:980},"S3-F3W":{retailPrice:707,industryPrice:619},"S3-F3WK":{retailPrice:868,industryPrice:760},"S3-F4":{retailPrice:966,industryPrice:846},"S3-F4CK":{retailPrice:1414,industryPrice:1238},"S3-F4WK":{retailPrice:1183,industryPrice:1035},"S3-F6":{retailPrice:1190,industryPrice:1042},"S3-F6CK":{retailPrice:1863,industryPrice:1630},"S3-F6WK":{retailPrice:1516,industryPrice:1326},"S3-F8":{retailPrice:1932,industryPrice:1692},"S3-F8CK":{retailPrice:2828,industryPrice:2476},"S3-F8WK":{retailPrice:2366,industryPrice:2070},"S3-F35C":{retailPrice:479.05,industryPrice:419.1},"S3-F35CK":{retailPrice:684.2,industryPrice:598.4},"S3-F35W":{retailPrice:479.05,industryPrice:419.1},"S3-F35WK":{retailPrice:530.2,industryPrice:464.2},"S3-F45":{retailPrice:590.15,industryPrice:517},"S3-F45CK":{retailPrice:863.5,industryPrice:756.25},"S3-F45WK":{retailPrice:722.7,industryPrice:631.95},"S3-F65":{retailPrice:726.55,industryPrice:636.35},"S3-F65CK":{retailPrice:1137.4,industryPrice:995.5},"S3-F65WK":{retailPrice:925.65,industryPrice:809.6},"S3-F85":{retailPrice:1062.6,industryPrice:930.6},"S3-F85CK":{retailPrice:1555.4,industryPrice:1361.8},"S3-F85WK":{retailPrice:1301.3,industryPrice:1138.5},"WD-INPH3":{retailPrice:31.25,industryPrice:25.75},"WD-PH3S":{retailPrice:40.5,industryPrice:33.25},"WD-PH3SB":{retailPrice:7.25,industryPrice:6},"WD-HOPH3":{retailPrice:20.5,industryPrice:17.25},"WD-HOPH3B":{retailPrice:5.25,industryPrice:4.5},"WD-PHE3E":{retailPrice:30,industryPrice:24.75},"WD-PHE3EB":{retailPrice:7.75,industryPrice:6.5},"WD-PHE3S":{retailPrice:36.75,industryPrice:30.25},"WD-PHE3SB":{retailPrice:9.25,industryPrice:7.75},"WD-PH5":{retailPrice:41.75,industryPrice:34.25},"WD-PH5B":{retailPrice:10.75,industryPrice:8.75},"WD-PH5S":{retailPrice:57.25,industryPrice:47},"WD-PH27":{retailPrice:21,industryPrice:17.25},"STF-PH3S":{retailPrice:61.75,industryPrice:51.75},"STF-PH5S":{retailPrice:72.75,industryPrice:59.5},"STF-PH31":{retailPrice:23.25,industryPrice:18.75},"STF-PH29":{retailPrice:26.5,industryPrice:22},"WD-B":{retailPrice:4.25,industryPrice:3.5},"WD-44B":{retailPrice:32.5,industryPrice:26.75},"PH-L6":{retailPrice:55,industryPrice:41},"PH-L8":{retailPrice:59,industryPrice:43},"PH-L10":{retailPrice:60,industryPrice:43},"PH-L12":{retailPrice:64,industryPrice:47},"PH-L14":{retailPrice:70,industryPrice:50},"PH-L16":{retailPrice:71,industryPrice:52},"PH-L18":{retailPrice:74,industryPrice:55},"PH-H10":{retailPrice:93,industryPrice:74},"PH-H12":{retailPrice:98,industryPrice:79},"PH-H14":{retailPrice:104,industryPrice:83},"PH-H16":{retailPrice:107,industryPrice:85},"PH-H18":{retailPrice:114,industryPrice:90},"PH-H10R":{retailPrice:149,industryPrice:118},"PH-H12R":{retailPrice:154,industryPrice:124},"PH-H14R":{retailPrice:159,industryPrice:127},"PH-H16R":{retailPrice:163,industryPrice:130},"PH-H18R":{retailPrice:174,industryPrice:139},"PH-H10RP":{retailPrice:154,industryPrice:124},"PH-H12RP":{retailPrice:160,industryPrice:127},"PH-H14RP":{retailPrice:164,industryPrice:131},"PH-H16RP":{retailPrice:170,industryPrice:135},"PH-H18RP":{retailPrice:181,industryPrice:145},"PH-HSR14":{retailPrice:307,industryPrice:244},"PH-HSR16":{retailPrice:323,industryPrice:257},"PH-HSRP14":{retailPrice:344,industryPrice:273},"PH-HSRP16":{retailPrice:345,industryPrice:275},"PH-C":{retailPrice:93,industryPrice:74},"AMD-AR310T":{retailPrice:2971,industryPrice:2089},"AMD-AR315T":{retailPrice:4400,industryPrice:3097},"AMD-AR320T":{retailPrice:5385,industryPrice:3791},"AMD-AR325T":{retailPrice:6298,industryPrice:4433},"AMD-AR330T":{retailPrice:7196,industryPrice:5064},"AMD-AR335T":{retailPrice:8836,industryPrice:6255},"AMD-AR340T":{retailPrice:9940,industryPrice:7033},"AMD-ARTP3":{retailPrice:403,industryPrice:368},"AMD-ARDP3":{retailPrice:190,industryPrice:173},"AMD-AR410T":{retailPrice:3085,industryPrice:2172},"AMD-AR415T":{retailPrice:4591,industryPrice:3231},"AMD-AR420T":{retailPrice:5800,industryPrice:4081},"AMD-AR425T":{retailPrice:6845,industryPrice:4816},"AMD-AR430T":{retailPrice:8145,industryPrice:5731},"AMD-AR435T":{retailPrice:9963,industryPrice:7048},"AMD-AR440T":{retailPrice:11183,industryPrice:7906},"AMD-ARTP4":{retailPrice:546,industryPrice:426},"AMD-ARDP4":{retailPrice:230,industryPrice:207},"AMD-AR410ADA":{retailPrice:3585,industryPrice:2672},"AMD-AR415ADA":{retailPrice:5341,industryPrice:3981},"AMD-AR420ADA":{retailPrice:6800,industryPrice:5081},"AMD-AR425ADA":{retailPrice:8095,industryPrice:6066},"AMD-AR430ADA":{retailPrice:9645,industryPrice:7231},"AMD-AR435ADA":{retailPrice:11713,industryPrice:8798},"AMD-AR440ADA":{retailPrice:13183,industryPrice:9906},Factory_Assembly:{retailPrice:8,industryPrice:6.5}}}materialName(e,t){return q.lookupName(e,t)}defaultMaterialDefinitions(){return q.defaultMaterialDefinitions()}onlyShowPriceDisclaimer(){return!this.isAdmin()}drawingLayers(){const e={Annotations:!0};return this.isAdmin()&&(e.Decking=!0),e}watermarkClassNames(){return"watermark watermark--am-docks"}materialListProperties(){return k.propertiesFromNames([z.item,"QuickBooks #",z.description])}annotationType(){return j}}},32083:(e,t,r)=>{const{MissingOverride:n}=r(50988),i=r(95944),s=r(89929),o=r(50636),a=r(10066);e.exports=class BaseDockStrategy extends o{static defaultBankOffsetY(){return 144}defaultEditTools(e,t){return[new s(this.dockClass(),e,t)]}dockClass(){throw new n(this,"dockClass")}_deckingOptionKeys(){return[Object.keys(i).first()]}deckingOptions(){return this._deckingOptionKeys().map((e=>i[e]))}drawingLayers(){return{...super.drawingLayers(),[a.DECKING]:!0}}railingsLayer(){return a.RAILINGS}bankOffsetY(){return this.constructor.defaultBankOffsetY()}}},86176:(e,t,r)=>{const{extend:n}=r(50988),i=r(79591),s=r(98272),o=r(30691),a=r(43812),l=r(10607),c=r(50636),u=r(5895);class BaseRailingStrategy extends c{drawingLayers(){const e=super.drawingLayers();return this.showsStructures()&&(e[u.PLATFORMS]=!0),e}alwaysVisibleLayers(){return["Annotations",...this._configuredAlwaysVisibleLayers()]}drawingControllerClass(){return s}drawing3DControllerClass(){return i}projectClass(){return a}platformLayerFor(e){const t=this.drawingLayers(),r=this._drawingLayerConfig();return t&&!t[r.PLATFORMS]&&t[r.PLATFORMS_LEVEL]&&t[r.PLATFORMS_SLOPED]?e?o.isLevel(e)?r.PLATFORMS_LEVEL:r.PLATFORMS_SLOPED:r.PLATFORMS_LEVEL:r.PLATFORMS}_drawingLayerConfig(){return u}}n(BaseRailingStrategy,l),e.exports=BaseRailingStrategy},72126:(e,t,r)=>{const{ImperialFractionLengthFormatter:n}=r(7340),i=r(63283),s=r(21437),o=r(63197),a=r(87166),l=r(92856),c=r(73645),u=r(68689),d=r(45708),h=r(84616),p=r(86176),m=r(42947),f=r(15327);e.exports=class BearRidgeStrategy extends p{defaultEditTools(e,t){const n=new o(e,t);n.setFormatter(this.lengthFormatter());const i=new h(e,t),a=this.railingCollectionClass();i.setDisplayName("Level Rail"),i.setRailingCollectionType(a),i.setRailingPlacementStrategyType(u),i.setShowSurfaceHeightProperty(!0),i.setIconName("glass-rail");const l=new h(e,t);l.setDisplayName("Stair Rail"),l.setRailingCollectionType(a),l.setRailingPlacementStrategyType(d),l.setIconName("glass-rail-stair"),l.setFractionPrecisionDenominator(8);const c=new s(e,t),p=this.railingOpeningClass();return c.setOpeningType(p),i.setCursor(`url(${r(81562).url}) 16 29, crosshair`),l.setCursor(`url(${r(57769).url}) 17 30, crosshair`),[n,i,l,c]}railingCollectionClass(){return a}railingOpeningClass(){return l}projectClass(){return i}defaultRetailPricing(){return{InlinePost:{price:140},CornerPost:{price:140},TerminalPost:{price:140},StairInlinePost:{price:140},StairCornerPost:{price:140},StairTerminalPost:{price:140},StairTransitionPost:{price:140},StairTransitionCornerPost:{price:140},FasciaMount:{price:35},GlassGate:{price:1300},FramedGlassGate:{price:1300},PicketGate:{price:1300},Glass3_16:{price:16.25,perUnit:"sqft"},Glass1_4:{price:16.25,perUnit:"sqft"},Glass3_8:{price:16.25,perUnit:"sqft"},Glass1_2:{price:19.8,perUnit:"sqft"},NonRectangularGlass:{price:100},GlassGuard:{price:20,perUnit:"ft"},GlassHole:{price:25},GlassHandrailBracket:{price:50},Handrail:{price:35,perUnit:"ft"},CapRail:{price:25,perUnit:"ft"},PicketRail:{price:55,perUnit:"ft"},PicketRail48:{price:65,perUnit:"ft"},Rail:{price:45,perUnit:"ft"},Labor:{price:150},ConcreteScrew:{price:3},PinLatch:{price:500},DoorKnob:{price:750},GlassMountDoorKnob:{price:2250}}}materialName(e,t){return t?.[e]?.[m.item]||f[e]?.name()}defaultMaterialDefinitions(){return Object.values(f).map((e=>({identifier:e.identifier(),displayValue:e.name(),[m.item]:e.name()})))}pricingStrategyClass(){return c}partsBreakdownColumns(){return[...super.partsBreakdownColumns(),m.invoice]}_defaultLengthFormatter(){return new n(8)}watermarkClassNames(){return"watermark watermark--bear-ridge"}alwaysVisibleLayers(){return[]}}},44400:(e,t,r)=>{const{PolarCoordinate:n}=r(62048),i=r(86176),s=r(84616),o=r(68689),a=r(27878),l=r(11685),c=r(45708),u=r(19535),d=r(15838),h=r(14545),p=r(42947),m=r(31224);e.exports=class CityPostStrategy extends i{defaultEditTools(e,t){const r=new s(e,t);r.setDisplayName("Level Rail"),r.setRailingCollectionType(a),r.setRailingPlacementStrategyType(o),r.setShowSurfaceHeightProperty(!0),r.setIconName("cable-rail"),r.setAngleSnapDirections(this._angleSnapDirections()),r.setDisconnectedAngleSnapDirections(this._disconnectedAngleSnapDirections());const n=new s(e,t);return n.setDisplayName("Stair Rail"),n.setRailingCollectionType(a),n.setRailingPlacementStrategyType(c),n.setIconName("cable-rail-stair"),n.setAngleSnapDirections(this._angleSnapDirections()),n.setDisconnectedAngleSnapDirections(this._disconnectedAngleSnapDirections()),[r,n]}projectClass(){return l}defaultRetailPricing(){return{'36" Tall Railing':{price:75,perUnit:"ft"},'36" Tall Stair Railing':{price:85,perUnit:"ft"},'42" Tall Railing':{price:85,perUnit:"ft"},'42" Tall Stair Railing':{price:95,perUnit:"ft"},[a.noTopRailMaterialName]:{price:-5,perUnit:"ft"},Cable:{price:0,perUnit:"ft"},Zinc:{price:0,perUnit:"ft"},"Stainless Steel":{price:30,perUnit:"ft"},...this._colorPricingFor("-custom-sleeve",{price:50})}}_colorPricingFor(e,t){const r=Object.values(u).map((e=>e.label)).map((r=>[`${r}${e}`,t]));return Object.fromEntries(r)}standardSnapAnglesDegrees(){return[11.25,22.5,45,90,0]}_angleSnapDirections(){return this.standardSnapAnglesDegrees().flatMap((e=>[e.degreesToRadians(),(-e).degreesToRadians()])).map((e=>new n(1,e)))}_disconnectedAngleSnapDirections(){return[(-45).degreesToRadians(),90..degreesToRadians(),45..degreesToRadians(),0].map((e=>new n(1,e)))}defaultMaterialDefinitions(){return Object.values(h).map((e=>({identifier:e.identifier(),displayValue:e.name(),[p.item]:e.name()})))}materialListProperties(){return d.propertiesFromNames([p.item,"Part #",p.description])}externalEditorRedirectDefault(e,t){return t.draft_order.invoice_url}drawingLayers(){return{...super.drawingLayers(),[m.POST_ANNOTATIONS]:!0,[m.LENGTH_ANNOTATIONS]:!0,[m.STAIR_ANNOTATIONS]:!0,[m.POST_LABELS]:!1,[m.SLEEVE_LABELS]:!1}}alwaysVisibleLayers(){return[]}}},98006:(e,t,r)=>{const n=r(63768),i=r(89929),s=r(13191),o=r(16831),a=r(19820),l=r(94073),c=r(84517),u=r(21373),d=r(73531),h=r(94652),p=r(77030),m=r(89088),f=r(50636),{lumber:g,lookupName:y}=r(71181),b=r(42947),v=r(10066);e.exports=class CoastalPierAndDockStrategy extends f{registerSmartObjectClassMappings(e){e.classes.addClass(o,"DockDesignerProject")}defaultEditTools(e,t){return[new i(m,e,t),new i(s,e,t),new i(a,e,t)]}deckingOptions(){return[new u("Pressure Treated",{description:"",unitPrice:n.unit(0,"1/ft^2"),materialSpecifier:g.PT2x8,material:"pressure-treated"})]}alwaysVisibleLayers(){return[v.DECKING]}materialList(e){const t=(new p).aggregateLumberForPurchase(e.allLocatedMaterials());return e.editableMaterialLineItems().forEach((e=>t.add(e))),t}pricingStrategyClass(){return c}partsBreakdownColumns(){return[b.item,...this.materialListPropertyNames(),b.quantity,b.unitPrice,b.amount]}defaultRetailPricing(){return{PILE6x16:{price:80.07},PILE6x18:{price:90.53},PILE6x20:{price:112.8},PILE8x16:{price:133.28},PILE8x18:{price:155.31},PILE8x20:{price:177.33},PILE10x30:{price:245.2},PILE10x35:{price:252.84},PILE12x30:{price:357},PILE12x35:{price:385.64},PT2x4x8:{price:5.69},PT2x4x10:{price:7.25},PT2x4x12:{price:8.65},PT2x4x14:{price:10.52},PT2x4x16:{price:10.88},PT2x6x8:{price:7.47},PT2x6x10:{price:9.28},PT2x6x12:{price:10.92},PT2x6x14:{price:12.27},PT2x6x16:{price:14.4},PT2x8x8:{price:9.51},PT2x8x10:{price:11.52},PT2x8x12:{price:13.56},PT2x8x14:{price:15.36},PT2x8x16:{price:17.6},PT2x10x8:{price:12.33},PT2x10x10:{price:14.53},PT2x10x12:{price:17.58},PT2x10x14:{price:19.91},PT2x10x16:{price:22},PT2x10x18:{price:24.89},PT2x10x20:{price:27.53},PT2x12x8:{price:15.47},PT2x12x10:{price:19.84},PT2x12x12:{price:23.71},PT2x12x14:{price:27.31},PT2x12x16:{price:30.24},PT3x8x8:{price:21.71},PT3x8x10:{price:33.4},PT3x8x12:{price:49.33},PT3x8x16:{price:85.8},BOLT_HD_34_16:{price:20},NUT_HD_34:{price:1},PW4x8:{price:31.87},RIBBED_METAL:{price:30},SHINGLES:{price:28},AA_LABOR_PILE6:{price:300},AA_LABOR_PILE8:{price:300},AA_LABOR_PILE10:{price:600},AA_LABOR_PILE12:{price:600},AA_LABOR_BOATHOUSE:{price:15},AA_LABOR_DOCK:{price:15},AA_LABOR_PIER:{price:15}}}materialName(e,t){return y(e,t)}annotationType(){return l}drawingControllerClass(){return h}drawing3DControllerClass(){return d}projectClass(){return o}shouldRenderJumpToLocationControls(){return!0}}},37154:(e,t,r)=>{const n=r(63768),{lumber:i}=r(93613),s=r(21373),o=r(89929),a=r(5163),l=r(49053),c=r(7734),u=r(54558),d=r(32019),h=r(95348);e.exports=class DIYDockStrategy extends d{priceBreakdown(e){const t={Decking:0,Structure:0,Ramps:0};return e.parts().forEach((e=>{const r=e.priceBreakdown();Object.keys(r).forEach((e=>t[e]+=r[e]))})),Object.keys(t).forEach((e=>t[e]=t[e].roundedTo(2))),t}pricingStrategy(e,t){return new h}deckingOptions(){const e={fiberonGrey:["#bfb4a6"],fiberonBrown:["#725534"],lumberRockGrey:["#999aa0"],lumberRockTan:["#8d6e53"]};return[new s("Pressure Treated",{description:"",unitPrice:n.unit(3.25,"1/ft^2"),materialSpecifier:i.PT2x6,material:"pressure-treated"}),new s("Fiberon Composite Grey",{description:"Description",unitPrice:n.unit(6.1,"1/ft^2"),materialSpecifier:i.PT2x6,material:"fiberon",colors:e.fiberonGrey}),new s("Fiberon Composite Brown",{description:"Description",unitPrice:n.unit(6.1,"1/ft^2"),materialSpecifier:i.PT2x6,material:"fiberon",colors:e.fiberonBrown}),new s("LumberRock Grey",{description:"Description",unitPrice:n.unit(6.6,"1/ft^2"),materialSpecifier:i.PT2x6,material:"lumberrock",colors:e.lumberRockGrey}),new s("LumberRock Tan",{description:"Description",unitPrice:n.unit(6.6,"1/ft^2"),materialSpecifier:i.PT2x6,material:"lumberrock",colors:e.lumberRockTan})]}dockClass(){return a}priceForDecking(e){return n.multiply(e.area(),e.deckingOption().unitPrice()).roundedTo(2)}anchorPlatformPriceBreakdown(e){const t=e.posts(),r=t.reduce(((e,t)=>n.add(e,t.length())),n.unit(0,"ft")),i=t.first().materialSpecifier().identifier();return{Structure:n.multiply(r,this.lumberPricing()[i]).roundedTo(2),Decking:e.surface().price()}}aluminumPricePerSqFt(){return n.unit(47,"1/ft^2")}aluminumGangwayPriceBreakdown(e){return{Ramps:n.multiply(e.area(),this.aluminumPricePerSqFt()).roundedTo(2)}}woodenRampPriceBreakdown(e){return{Ramps:e.surface().price()}}lumberPricing(){return{[i.PT6x6.identifier()]:n.unit(4.7,"1/ft"),[i.PT2x4.identifier()]:n.unit(1.06,"1/ft"),[i.PT2x6.identifier()]:n.unit(1.69,"1/ft"),[i.PT2x8.identifier()]:n.unit(2.06,"1/ft")}}_preconfiguredDockTools(e,t){return[new o(l,e,t),new o(c,e,t),new o(u,e,t)]}identifier(){return"DIY"}}},23154:(e,t,r)=>{const n=r(37154);e.exports=class DemoStrategy extends n{identifier(){return"Demo"}}},33430:(e,t,r)=>{const{ImperialFractionLengthFormatter:n}=r(7340),{lumber:i}=r(93613),s=r(89929),o=r(32083),a=r(86402),l=r(87675),c=r(24625),u=r(34330),d=r(32097),h=r(4748),p=r(98870),m=r(63197),f=r(11393),g=r(46317),y=r(90227),b=r(21373),v=r(10066),_=r(4103);e.exports=class DockDesignerAppStrategy extends o{static defaultFormatterClass(){return n}defaultEditTools(e,t){const r=new m(e,t);return r.setFormatter(this.lengthFormatter()),[r,...this.toolsForSubscription(e,t)]}toolsForSubscription(e,t){const r=[];return this.allowTimberDocks()&&r.push(new s(h,e,t)),this.allowFloatingDocks()&&r.push(new s(d,e,t)),this.allowTriangularDocks()&&r.push(new s(p,e,t)),this.allowGangways()&&r.push(new s(f,e,t)),this.allowBoatLifts()&&r.push(new s(g,e,t)),this.allowRoofs()&&r.push(new s(y,e,t)),this.allowCleats()&&r.push(new a(l,e,t)),this.allowLadders()&&r.push(new a(c,e,t)),this.allowGenericObjects()&&r.push(new s(_,e,t)),r}projectClass(){return u}defaultRetailPricing(){const e="guest"===this.editorMode()?"guest":"retail";return this._defaultRetailPricing??=this.pricingForMarket(e)}defaultPricingMap(){return{DockSurfaceArea:{retailPrice:0,guestPrice:25,perUnit:"sqft"},DockTriangleSurfaceArea:{retailPrice:0,guestPrice:25,perUnit:"sqft"},FloatingDockSurfaceArea:{retailPrice:0,guestPrice:16.25,perUnit:"sqft"},Cleat:{retailPrice:0,guestPrice:14.35},Ladder:{retailPrice:0,guestPrice:194},Lift:{retailPrice:0,guestPrice:2971},MetalRoofing:{retailPrice:0,guestPrice:13,perUnit:"sqft"},Shingles:{retailPrice:0,guestPrice:8.26,perUnit:"sqft"}}}drawingLayers(){return{...super.drawingLayers(),[v.RAILINGS]:!0,[v.ROOFING]:!0}}allowTimberDocks(){return this.featureFlag("allow_timber_docks")}allowFloatingDocks(){return this.featureFlag("allow_floating_docks")}allowTriangularDocks(){return this.featureFlag("allow_triangular_docks")}allowGangways(){return this.featureFlag("allow_gangways")}allowBoatLifts(){return this.featureFlag("allow_boat_lifts")}allowRoofs(){return this.featureFlag("allow_roofs")}allowCleats(){return this.featureFlag("allow_cleats")}allowLadders(){return this.featureFlag("allow_ladders")}allowGenericObjects(){return this.featureFlag("allow_generic_objects")}deckingOptions(){return[new b("Boards",{materialSpecifier:i.PT2x6,material:"painted-pressure-treated"}),new b("Grate",{materialSpecifier:i.PT2x6,material:"painted-aluminum-walkway-mesh",skirtBoardMaterial:"painted-pressure-treated",includeSkirtBoards:!0})]}guestWatermarkClassNames(){return"watermark watermark--dock-designer-app"}}},5633:(e,t,r)=>{const n=r(32083),i=r(15963),s=r(12234);e.exports=class DocksPreviewStrategy extends n{configuration(){return this._configuration}setConfiguration(e){this._configuration=e,this._previewClasses=this.configuration().designer_type_properties.model_classes.map((e=>s(e)))}previewClasses(){return this._previewClasses}dockClass(){return this.previewClasses().find((e=>e.name.endsWith("Dock")))}projectClass(){return i}_deckingOptionKeys(){return this.configuration().designer_type_properties.strategy_config.decking_options}showsPublicDesignYourOwnButton(){return this.configuration().feature_toggles.showsPublicDesignYourOwnButton}showsPublicPrice(){return this.configuration().feature_toggles.showsPublicPrice}showPublicPricingDisclaimer(){return this.configuration().feature_toggles.showPublicPricingDisclaimer}showsPublicLayerToggle(){return this.configuration().feature_toggles.showsPublicLayerToggle}showsPriceBreakdownDownloadButton(){return this.configuration().feature_toggles.showsPriceBreakdownDownloadButton}allowAddingAdditionalLineItems(){return this.configuration().feature_toggles.allowAddingAdditionalLineItems}allowAddingPlanBackground(){return this.configuration().feature_toggles.allowAddingPlanBackground}allowAngleSnapToggle(){return this.configuration().feature_toggles.allowAngleSnapToggle}}},89489:(e,t,r)=>{const n=r(89929),i=r(50636),s=r(84308),o=r(37793),a=r(94652),l=r(73531),c=r(37648),u=r(35156),d=r(28887),h=r(61483),p=r(83087),m=r(86402),f=r(48302),g=r(97342),y=r(27678),b=r(16961),v=r(42947),_=r(72655);e.exports=class EZDockStrategy extends i{defaultEditTools(e,t){return[new n(o,e,t),new n(u,e,t),new n(c,e,t),new n(d,e,t),new n(h,e,t),new n(p,e,t),...this._accessoryEditTools(e,t)]}_accessoryEditTools(e,t){const r=[new m(g,e,t),new m(f,e,t)];return r.forEach((e=>e.setAddToProject(!0))),r}deckingOptions(){return[]}drawingControllerClass(){return a}drawing3DControllerClass(){return l}projectClass(){return s}defaultMaterialDefinitions(){return Object.values(_).map((e=>({identifier:e.identifier(),displayValue:e.name(),[v.item]:e.name()})))}partsBreakdownColumns(){return[v.item,v.quantity]}analyticsStrategies(){return[new y({[b.login]:b.login,[b.signUp]:b.signUp,[b.shareLinkVisited]:b.shareLinkVisited,[b.quoteSubmitted]:b.quoteSubmitted})]}}},10809:(e,t,r)=>{const n=r(88367),i=r(72126),s=r(60261),o=r(13353),a=r(95580),l=r(42947);e.exports=class FalconRailingsStrategy extends i{projectClass(){return n}railingCollectionClass(){return s}railingOpeningClass(){return o}usePricingMultiplierForAdditionalLineItems(){return!1}defaultRetailPricing(){return{InlinePost:{price:140},TerminalPost:{price:140},CornerPost:{price:140},StairInlinePost:{price:140},StairTerminalPost:{price:140},StairCornerPost:{price:140},StairTransitionPost:{price:140},StairTransitionCornerPost:{price:140},StairStringerMountPost:{price:175},FasciaMount:{price:35},GlassGate:{price:1300},PicketGate:{price:1300},Glass1_4:{price:16.25,perUnit:"sqft"},Glass3_8:{price:16.25,perUnit:"sqft"},Glass1_2:{price:19.8,perUnit:"sqft"},Glass7_16:{price:19.8,perUnit:"sqft"},Glass9_16:{price:19.8,perUnit:"sqft"},NonRectangularGlass:{price:100},ScallopedGlass:{price:100},GlassGuard:{price:20,perUnit:"ft"},GlassHole:{price:25},GlassHandrailBracket:{price:50},Handrail:{price:35,perUnit:"ft"},SecondGuard:{price:25,perUnit:"ft"},TopGuard:{price:25,perUnit:"ft"},PicketRail:{price:55,perUnit:"ft"},PicketRail48:{price:65,perUnit:"ft"},BaseShoeRail36:{price:0,perUnit:"ft"},BaseShoeRail42:{price:0,perUnit:"ft"},BaseShoeRail48:{price:0,perUnit:"ft"},StandoffRail36:{price:0,perUnit:"ft"},StandoffRail39:{price:0,perUnit:"ft"},StandoffRail42:{price:0,perUnit:"ft"},Rail:{price:45,perUnit:"ft"},StandoffButton:{price:0},Labor:{price:150},ConcreteScrew:{price:3}}}materialName(e,t){return t?.[e]?.[l.item]||a[e]?.name()}defaultMaterialDefinitions(){return Object.values(a).map((e=>({identifier:e.identifier(),displayValue:e.name(),[l.item]:e.name()})))}watermarkClassNames(){}}},50400:(e,t,r)=>{const n=r(86176),i=r(41456),s=r(84616),o=r(97477),a=r(93491),l=r(42947),c=r(38578);e.exports=class HollaenderStrategy extends n{defaultEditTools(e,t){const r=new s(e,t);return r.setDisplayName("Rail"),r.setRailingCollectionType(o),r.setIconName("generic-rail"),r.setAngleAnnotationSignificantDecimalPlaces(this.projectConfig().base.significantDecimalPlaces.angles),[r]}defaultRetailPricing(){return{19010:{price:175,description:'QC End Post Assembly 1.5" Schedule 80'},19020:{price:175,description:'QC Line Post Assembly 1.5" Schedule 80'},19030:{price:175,description:'QC Corner 90° Assembly 1.5" Schedule 80'},19040:{price:220,description:'QC Adj Angle Assembly 1.5" Schedule 80'},19050:{price:660,description:'QC 13" - 20" Wire Mesh Infill Panel Assembly'},19060:{price:660,description:'QC 20" - 27" Wire Mesh Infill Panel Assembly'},19070:{price:720,description:'QC 27" - 34" Wire Mesh Infill Panel Assembly'},19080:{price:720,description:'QC 34" - 41" Wire Mesh Infill Panel Assembly'},19090:{price:730,description:'QC 41" - 48" Wire Mesh Infill Panel Assembly'},92361:{price:828,description:'QC Pipe 1.5" 6063 T6  Schedule 40 Anodized Aluminum 8ft (6-pcs/48 LF)'},98121:{price:2484,description:'QC Pipe 1.5" 6063 T6  Schedule 40 Anodized Aluminum 24ft (6-pcs/144 LF)'},"Powder Coat 0-50 feet":{price:40,perUnit:"ft",description:"Powder Coat",useInternalIdentifier:!0},"Powder Coat 51-200 feet":{price:30,perUnit:"ft",description:"Powder Coat",useInternalIdentifier:!0},"Powder Coat 201+ feet":{price:22,perUnit:"ft",description:"Powder Coat",useInternalIdentifier:!0}}}materialName(e,t){const r=this.defaultRetailPricing()[e];return r.useInternalIdentifier?e:t?.[e]?.[l.item]||r.description}defaultMaterialDefinitions(){const e=this.defaultRetailPricing();return Object.keys(e).map((t=>({identifier:t,displayValue:t,[l.item]:e[t].description})))}drawingLayers(){return{[a.ANGLE_ANNOTATIONS]:!0,[a.LENGTH_ANNOTATIONS]:!0,[a.PANEL_LABELS]:!1}}projectClass(){return i}projectConfig(){return c}}},8792:(e,t,r)=>{const{ImperialFractionLengthFormatter:n}=r(7340),i=r(86176),s=r(26885),o=r(84616),a=r(63197),l=r(97477),c=r(45708),u=r(55201),d=r(97529),h=r(43793),p={...d,...u};e.exports=class InnovativeAluminumStrategy extends i{defaultEditTools(e,t){const r=new o(e,t);r.setDisplayName("Railing"),r.setRailingCollectionType(l),r.setIconName("generic-rail");const n=new o(e,t);n.setDisplayName("Stair Rail"),n.setRailingCollectionType(l),n.setRailingPlacementStrategyType(c),n.setIconName("generic-rail-stair"),n.setFractionPrecisionDenominator(8);const i=new a(e,t);return i.setFormatter(this.lengthFormatter()),[r,n,i]}projectClass(){return s}projectConfig(){return h}_defaultLengthFormatter(){return new n(16)}drawingLayers(){return Object.values(p).reduce(((e,t)=>(e[t]=!0,e)),{})}_drawingLayerConfig(){return p}}},9536:(e,t,r)=>{const{ImperialFractionLengthFormatter:n}=r(7340),i=r(86176),s=r(98198),o=r(84616),a=r(58773),l=r(91659),c=r(21437),u=r(33839),d=r(89929),h=r(79574),p=r(63197),m=r(60115),f=r(15189),g=r(5895),y=r(93050),b=r(93050),v=r(42947);e.exports=class KAndSStrategy extends i{defaultEditTools(e,t){const r=new o(e,t);r.setDisplayName("Rail"),r.setRailingCollectionType(l),r.setRailingPlacementStrategyType(a),r.setShowSurfaceHeightProperty(!0),r.setIconName("generic-rail");const n=new c(e,t);n.setOpeningType(u);const i=new p(e,t);i.setFormatter(this.lengthFormatter());return[i,r,n,new d(h,e,t)]}_defaultLengthFormatter(){return new n(s.fractionPrecisionDenominator(),!1)}defaultRetailPricing(){return this._defaultRetailPricing??=this.pricingForMarket("retail")}defaultIndustryPricing(){return this._defaultIndustryPricing??=this.pricingForMarket("industry")}defaultPricingMap(){return{[y.Picket_Extra_Height.identifier()]:{retailPrice:15,industryPrice:15,perUnit:"ft"},[y.Framed_Glass_Extra_Height.identifier()]:{retailPrice:15,industryPrice:15,perUnit:"ft"},[y.Frameless_Glass_Extra_Height.identifier()]:{retailPrice:15,industryPrice:15,perUnit:"ft"},[y.Picket_Gate_Extra_Height.identifier()]:{retailPrice:15,industryPrice:15},[y.Picket_Gate_180_Extra_Height.identifier()]:{retailPrice:15,industryPrice:15},[y.Framed_Glass_Gate_Extra_Height.identifier()]:{retailPrice:15,industryPrice:15},[y.Framed_Glass_Gate_180_Extra_Height.identifier()]:{retailPrice:15,industryPrice:15},[y.Picket_Railing.identifier()]:{retailPrice:5.75,industryPrice:5.75,perUnit:"ft"},[y.Glass_5mm_Railing.identifier()]:{retailPrice:9.75,industryPrice:9.75,perUnit:"ft"},[y.Glass_12mm_Railing.identifier()]:{retailPrice:9.75,industryPrice:9.75,perUnit:"ft"},[y.Sloped_Framed_Glass_Panel.identifier()]:{retailPrice:60,industryPrice:60},[y.Sloped_Frameless_Glass_Panel.identifier()]:{retailPrice:100,industryPrice:100},[y.Picket_Gate.identifier()]:{retailPrice:250,industryPrice:250},[y.Picket_Gate_180.identifier()]:{retailPrice:250,industryPrice:250},[y.Framed_Glass_Gate.identifier()]:{retailPrice:250,industryPrice:250},[y.Framed_Glass_Gate_180.identifier()]:{retailPrice:250,industryPrice:250}}}pricingSource(e,t){return new m(this.pricing(e,t),e)}pricing(e,t){return e.industryPricing()?this.industryPricing(t):this.retailPricing(t)}projectClass(){return s}lowercaseIdentifier(){return"k_and_s"}watermarkClassNames(){return"watermark watermark--k-and-s"}drawingLayers(){return{[g.PLATFORMS]:!0,[f.PLATFORM_LENGTH_ANNOTATIONS]:!0,[f.TOP_RAIL_LENGTH_ANNOTATIONS]:!0,[f.POST_SPACING_ANNOTATIONS]:!0,[f.ANGLE_ANNOTATIONS]:!0,[f.CUT_ANGLE_ANNOTATIONS]:!0,[f.STAIR_HEIGHT_ANNOTATIONS]:!0,[f.GLASS_PANEL_NUMBER_ANNOTATIONS]:!1}}publicDrawingLayers(){return{[g.PLATFORMS]:!0,[f.PLATFORM_LENGTH_ANNOTATIONS]:!0,[f.ANGLE_ANNOTATIONS]:!0,[f.STAIR_HEIGHT_ANNOTATIONS]:!0}}defaultMaterialDefinitions(){return Object.values(b).map((e=>({identifier:e.identifier(),displayValue:e.name(),[v.item]:e.name()})))}}},70726:(e,t,r)=>{const n=r(63768),{lumber:i}=r(93613),s=r(21373),o=r(89929),a=r(86230),l=r(71283),c=r(43530),u=r(8389),d=r(31756),h=r(32019),p=r(95348);e.exports=class KonaDocksStrategy extends h{priceBreakdown(e){const t={"Premium Dock":0,"Std Floating Dock":0,Decking:0,Anchoring:0};e.parts().forEach((e=>{const r=e.priceBreakdown();Object.keys(r).forEach((e=>t[e]+=r[e]))})),Object.keys(t).forEach((e=>t[e]=t[e].roundedTo(2)));const r=Object.values(t).sum();return t["Delivery/Install"]=r>7500?(.095*r).roundedTo(2):650,t}pricingStrategy(e,t){return new p}deckingOptions(){const e={wearDeckSand:["#c1b2a4"],wearDeckGrey:["#b5b5b3"],wearDeckSaddle:["#a3806f"],ipe:["#a37781","#473b4a","#634c66","#734f52","#9f6264"]},t=i.PT2x6;return[new s("Naked",{description:"You can use our floating docks with textured walkways as is",unitPrice:n.unit(0,"1/ft^2")}),new s("Pressure Treated",{description:"Build your deck with high quality pressure treated lumber - 10 yr Warranty",unitPrice:n.unit(5.1,"1/ft^2"),materialSpecifier:t,material:"pressure-treated"}),new s("WearDeck Sand",{description:"Description",unitPrice:n.unit(8.7,"1/ft^2"),materialSpecifier:t,material:"weardeck",colors:e.wearDeckSand}),new s("WearDeck Cool Grey",{description:"Description",unitPrice:n.unit(8.7,"1/ft^2"),materialSpecifier:t,material:"weardeck",colors:e.wearDeckGrey}),new s("WearDeck Saddle",{description:"Description",unitPrice:n.unit(8.7,"1/ft^2"),materialSpecifier:t,material:"weardeck",colors:e.wearDeckSaddle}),new s("Ipe",{description:"Description",unitPrice:n.unit(12.9,"1/ft^2"),materialSpecifier:t,material:"ipe",colors:e.ipe})]}dockClass(){return d}annotationType(){return a}priceForCubes(e){return n.multiply(e,this.cubePrice()).roundedTo(2)}priceForAnchors(e){return(e*this.pricePerAnchor()).roundedTo(2)}cubePrice(){return n.unit(35.31,"1/ft^2")}pricePerAnchor(){return 269}deckingPriceMargin(){return 1.15}anchorPlatformPriceBreakdown(e){let t;return e.width().equals(n.unit(5,"ft"))?t=2199:e.width().equals(n.unit(6.5,"ft"))&&(t=2599),{Anchoring:t,Decking:e.surface().price()}}aluminumPricePerSqFt(){return n.unit(83.3125,"1/ft^2")}aluminumGangwayPriceBreakdown(e){return{Anchoring:n.multiply(e.length(),e.width(),this.aluminumPricePerSqFt()).roundedTo(2)}}woodenRampPriceBreakdown(e){return{Anchoring:1699,Decking:e.surface().price()}}_preconfiguredDockTools(e,t){return[new o(l,e,t),new o(c,e,t),new o(u,e,t)]}identifier(){return"Kona"}}},95422:(e,t,r)=>{const n=r(63768),i=r(86176),s=r(84616),o=r(62423),a=r(82417),l=r(54474),c=r(45615),u=r(52320),d=r(21437),h=r(90675),p=r(64840),m=r(5895),f=r(36761);e.exports=class KwikclampStrategy extends i{static defaultFormatterClass(){return c}defaultEditTools(e,t){const r=new s(e,t);r.setDisplayName("Rail"),r.setRailingCollectionType(o),r.setRailingPlacementStrategyType(a),r.setIconName("generic-rail");const n=new d(e,t);return n.setOpeningType(h),[r,n]}projectClass(){return l}pricingStrategyClass(){return u}defaultBackgroundGridMeasurement(){return n.unit(1,"m")}materialName(e,t){return p.lookupName(e,t)}defaultMaterialDefinitions(){return p.defaultMaterialDefinitions()}defaultRetailPricing(){return{post:{price:0},bikewayPost:{price:0},rail:{price:0},customRail:{price:0,perUnit:"m"},ETD:{price:0},ETJ:{price:0},barrierPanel:{price:0},barrierPanelCorner:{price:0},kickplate:{price:0,perUnit:"m"},kickplateInsideCorner:{price:0},kickplateOutsideCorner:{price:0},kickplateFastenerBolt:{price:0},kickplateEndCap:{price:0},kickplateRampTransition:{price:0},...this.fittings({price:0}),mezzanineGate:{price:0},slidingGate:{price:0},"TEK-Screw30":{price:0}}}fittings(e){const t=this.defaultMaterialDefinitions().map((e=>e.identifier)).filter((e=>e.startsWith("FITTING"))).map((t=>[t,{...e}]));return Object.fromEntries(t)}watermarkClassNames(){return"watermark watermark--kwikclamp"}drawingLayers(){return{[m.PLATFORMS]:!0,[f.SECTION_LENGTH_ANNOTATIONS]:!0,[f.FITTING_ANNOTATIONS]:!1}}}},32019:(e,t,r)=>{const{MissingOverride:n}=r(50988),i=r(61820),s=r(81625),o=r(55421),a=r(33225),l=r(89929),c=r(32083);e.exports=class LegacyBaseDockStrategy extends c{defaultEditTools(e,t){return[...super.defaultEditTools(e,t),new l(s,e,t),new l(i,e,t),new l(a,e,t),new l(o,e,t),...this._preconfiguredDockTools(e,t)]}_preconfiguredDockTools(){throw new n(this,"_preconfiguredDockTools")}drawingLayers(){return{Annotations:!0}}alwaysVisibleLayers(){return["Decking"]}}},60332:(e,t,r)=>{const n=r(63768),{ImperialFractionLengthFormatter:i}=r(7340),s=r(89929),o=r(53405),a=r(21373),l=r(38313),c=r(50636),u=r(50698),d=r(19575),h=r(34603),p=r(12379),m=r(92504),f=r(63197),g=r(44476),y=r(74783),b=r(86402),v=r(42894),_=r(898),x=r(83265),w=r(83724),R=r(10066);e.exports=class OasisBoatDocksStrategy extends c{defaultEditTools(e,t){const r=new f(e,t),a=new i;r.setFormatter(a);const l=o.builder(e.project()).width(n.unit(4,"ft")).length(n.unit(12,"ft")),c=s.withBuilder(l,o,e,t);return c.setDisplayName("Walkway"),[r,new _(e,t),new m(e,t),new s(o,e,t),c,new d(u,e,t),new h(p,e,t),new s(y,e,t),new b(v,e,t)]}projectClass(){return l}annotationType(){return g}deckingOptions(){return[new a("Trex Beach Dune",{description:"",unitPrice:n.unit(0,"1/ft^2"),materialSpecifier:x["TREX-BD"],material:"weardeck",colors:["#875f42"]}),new a("Trex Clam Shell",{description:"",unitPrice:n.unit(0,"1/ft^2"),materialSpecifier:x["TREX-CS"],material:"weardeck",colors:["#6c6863"]}),new a("Trex Saddle",{description:"",unitPrice:n.unit(0,"1/ft^2"),materialSpecifier:x["TREX-S"],material:"weardeck",colors:["#7c6049"]}),new a("Trex Coastal Bluff",{description:"",unitPrice:n.unit(0,"1/ft^2"),materialSpecifier:x["TREX-CB"],material:"weardeck",colors:["#837464"]}),new a("Trex Foggy Wharf",{description:"",unitPrice:n.unit(0,"1/ft^2"),materialSpecifier:x["TREX-FW"],material:"weardeck",colors:["#a4a8a7"]}),new a("Trex Rocky Harbor",{description:"",unitPrice:n.unit(0,"1/ft^2"),materialSpecifier:x["TREX-RH"],material:"weardeck",colors:["#9f9688"]}),new a("Trex Toasted Sand",{description:"",unitPrice:n.unit(0,"1/ft^2"),materialSpecifier:x["TREX-TS"],material:"weardeck",colors:["#8c7056"]}),new a("Choice Dek Beach House Grey",{description:"",unitPrice:n.unit(0,"1/ft^2"),materialSpecifier:x["CDEK-BHG"],material:"weardeck",colors:["#a99e99"]}),new a("Choice Dek Harvest Brown",{description:"",unitPrice:n.unit(0,"1/ft^2"),materialSpecifier:x["CDEK-HB"],material:"weardeck",colors:["#83674f"]}),new a("Choice Dek Coastal Redwood",{description:"",unitPrice:n.unit(0,"1/ft^2"),materialSpecifier:x["CDEK-CR"],material:"weardeck",colors:["#7c564e"]})]}drawingLayers(){return{...super.drawingLayers(),[w.ROOFING]:!0,[w.DECKING]:!0,[w.DOCK_ANNOTATIONS]:!0,[w.POST_ANNOTATIONS]:!1,[w.CHANNEL_ANNOTATIONS]:!1,[w.HEADER_ANNOTATIONS]:!1}}railingsLayer(){return w.DECKING}alwaysVisibleLayers(){return[R.ROOFING_MATERIAL]}defaultRetailPricing(){return{PILE278:{price:9.48,perUnit:"ft"},PILE45:{price:14.38,perUnit:"ft"},PILE45NG:{price:8.85,perUnit:"ft"},PT2x6:{price:.97,perUnit:"ft"},PT2x8:{price:1.37,perUnit:"ft"},PW4x8:{price:53.47,perUnit:"sheet"},"CDEK-BHG":{price:2.17,perUnit:"ft"},"CDEK-HB":{price:2.17,perUnit:"ft"},"CDEK-CR":{price:2.17,perUnit:"ft"},"TREX-RH":{price:2.17,perUnit:"ft"},"TREX-BD":{price:2.17,perUnit:"ft"},"TREX-CS":{price:2.17,perUnit:"ft"},"TREX-S":{price:2.17,perUnit:"ft"},"TREX-CB":{price:2.17,perUnit:"ft"},"TREX-FW":{price:2.17,perUnit:"ft"},"TREX-TS":{price:2.17,perUnit:"ft"},RPANEL:{price:1.41,perUnit:"sqft"},SHINGLES:{price:6.59,perUnit:"sqft"},PWC_GRATE:{price:6.25,perUnit:"sqft"},CHANNEL4:{price:7.31,perUnit:"ft"},CHANNEL5:{price:9.15,perUnit:"ft"},STEEL2x3:{price:3.41,perUnit:"ft"},STEEL2x4:{price:2.92,perUnit:"ft"},STEEL3x3:{price:2.59,perUnit:"ft"},STEEL4x4:{price:3.68,perUnit:"ft"},ROOF_FLASHING:{price:2.71,perUnit:"ft"},LIFT_CABLE14:{price:.49,perUnit:"ft"},LIFT_CABLE316:{price:.31,perUnit:"ft"},RAILING_CABLE:{price:.15,perUnit:"ft"},SLING:{price:184.03},LIFT_SHAFT:{price:2.75,perUnit:"ft"},LIFT_MOTOR_ASSEMBLY:{price:907.14},LIFT_PULLEY:{price:36.81},STORAGE_UNIT:{price:4e3},LADDER_ACCESSORY:{price:600},TWO_HOLE_PLATE:{price:0},FOUR_HOLE_PLATE:{price:0},CARRIAGE_BOLT_35x12:{price:0},WASHER_12:{price:0},NUT_12:{price:0},PILE_LABOR:{price:500},CRADLE_LABOR:{price:2500},DECKING_LABOR:{price:10},ROOFING_LABOR:{price:8}}}materialName(e,t){return x.lookupName(e,t)}defaultMaterialDefinitions(){return x.defaultMaterialDefinitions()}customMenuItemPaths(){return this.isAdmin()?["DownloadsButton"]:[]}}},91164:(e,t,r)=>{const n=r(32073),i=r(17163),s=r(21437),o=r(84616),a=r(44246),l=r(86176),c=r(46975),u=r(15838),d=r(42947),h=r(74666),p=r(28021);e.exports=class OmegaRailingStrategy extends l{defaultEditTools(e,t){const r=new o(e,t);r.setDisplayName("Guard Rail"),r.setRailingCollectionType(i);const n=new s(e,t);return n.setOpeningType(c),[r,n]}drawing3DControllerClass(){return n}projectClass(){return a}drawingLayers(){return{[p.ANGLE_ANNOTATIONS]:!0,[p.OPENING_WIDTH_ANNOTATIONS]:!0,[p.SECTION_LENGTH_ANNOTATIONS]:!0,[p.RAIL_LENGTH_ANNOTATIONS]:!0}}defaultRetailPricing(){return{"OOY-795G-10":{price:329},"OBY-795G-10":{price:329},"OOY-795U-09":{price:344},"OBY-795U-09":{price:344},"OOY-795G-09":{price:289},"OBY-795G-09":{price:289},"OOY-795U-08":{price:304},"OBY-795U-08":{price:304},"OOY-795G-08":{price:269},"OBY-795G-08":{price:269},"OOY-795U-07":{price:284},"OBY-795U-07":{price:284},"OOY-795G-07":{price:254},"OBY-795G-07":{price:254},"OOY-795U-06":{price:269},"OBY-795U-06":{price:269},"OOY-795G-06":{price:208},"OBY-795G-06":{price:208},"OOY-795U-05":{price:223},"OBY-795U-05":{price:223},"OOY-795G-05":{price:179},"OBY-795G-05":{price:179},"OOY-795U-04":{price:194},"OBY-795U-04":{price:194},"OOY-795G-04":{price:153},"OBY-795G-04":{price:153},"OOY-795U-03":{price:168},"OBY-795U-03":{price:168},"OOY-795G-03":{price:130},"OBY-795G-03":{price:130},"OOY-795U-02":{price:145},"OBY-795U-02":{price:145},"OOY-795G-02":{price:79},"OBY-795G-02":{price:79},"OOY-795A-45":{price:63},"OBY-795A-45":{price:63},"OOY-795A-12":{price:63},"OBY-795A-12":{price:63},"OOY-795A-11":{price:87},"OBY-795A-11":{price:87},"OOY-795A-13":{price:115},"OBY-795A-13":{price:115},"OOY-795A-14":{price:230},"OBY-795A-14":{price:230},"OOY-795S-18":{price:153},"OBY-795S-18":{price:153},"OOY-795S-44":{price:220},"OBY-795S-44":{price:220},"OOY-795M-78":{price:68},"OBY-795M-78":{price:68},"OOY-795M-79":{price:66},"OBY-795M-79":{price:66},"OBY-795X-01":{price:989},"OOY-795X-01":{price:989}}}defaultMaterialDefinitions(){return Object.values(h).map((e=>({identifier:e.identifier(),displayValue:e.name(),[d.item]:e.name(),[d.description]:e.description()})))}materialName(e,t={}){const r=this.defaultMaterialDefinitions().find((t=>t.identifier===e)),n=t[e],i=r?.[d.description],s=n?.[d.item]||r?.[d.item];return i&&s?`${s} (${i})`:e}materialListProperties(){return u.propertiesFromObjects([{name:d.item,editable:!0},{name:d.description,editable:!1}])}identifier(){return"Omega"}watermarkClassNames(){return"watermark watermark--omega"}}},4167:(e,t,r)=>{const{ImperialFractionLengthFormatter:n}=r(7340),i=r(86176),s=r(84616),o=r(52364),a=r(52494),l=r(93003),c=r(63197);e.exports=class RailingDepotStrategy extends i{defaultEditTools(e,t){const r=new s(e,t);r.setDisplayName("Railing"),r.setRailingCollectionType(o),r.setRailingPlacementStrategyType(a),r.setIconName("generic-rail");const n=new c(e,t);return n.setFormatter(this.lengthFormatter()),[r,n]}projectClass(){return l}_defaultLengthFormatter(){return new n(16)}defaultRetailPricing(){return{Rail:{price:12.25,perUnit:"ft"},Guardrail:{price:50,perUnit:"ft"},Pipe:{price:5.25,perUnit:"ft"},Cable:{price:4,perUnit:"ft"},Post:{price:30},FasciaPost:{price:75},Glass:{price:22.5,perUnit:"sqft"},Picket:{price:3},Bolt:{price:.08},Upper_Terminal_Sleeve:{price:5.15},Upper_Slope_Terminal_Sleeve:{price:7.25},Upper_Line_Sleeve:{price:4},Upper_Slope_Line_Sleeve:{price:5},Upper_Right_Corner_Sleeve:{price:6},Upper_Adjustable_Corner_Sleeve:{price:8.12},Upper_Slope_Transition_Straight_Sleeve:{price:5},Upper_Slope_Transition_Corner_Sleeve:{price:7},Lower_Terminal_Sleeve:{price:4.75},Lower_Slope_Terminal_Sleeve:{price:6.25},Lower_Line_Sleeve:{price:5.15},Lower_Slope_Line_Sleeve:{price:5.35},Lower_Right_Corner_Sleeve:{price:4},Lower_Adjustable_Corner_Sleeve:{price:8},Lower_Slope_Transition_Straight_Sleeve:{price:4},Lower_Slope_Transition_Corner_Sleeve:{price:5.15}}}alwaysVisibleLayers(){return[]}allowAR(){return super.allowAR()&&this.isAdmin()}allowVR(){return super.allowVR()&&this.isAdmin()}}},51752:(e,t,r)=>{const n=r(86176),i=r(84616),s=r(99813),o=r(12234),a=r(88338);e.exports=class RailingsPreviewStrategy extends n{defaultEditTools(e,t){const r=new i(e,t);return r.setDisplayName("Level Rail"),r.setRailingCollectionType(this.railingCollectionClass()),r.setRailingPlacementStrategyType(this.placementStrategyClass()),r.setIconName("generic-rail"),[r]}projectClass(){return s}projectConfig(){return a}configuration(){return this._configuration}setConfiguration(e){this._configuration=e,this._previewClasses=this.configuration().designer_type_properties.model_classes.map((e=>o(e)))}previewClasses(){return this._previewClasses}railingCollectionClass(){return this.previewClasses().find((e=>e.name.endsWith("Collection")))}placementStrategyClass(){return this.previewClasses().find((e=>e.name.endsWith("PlacementStrategy")))}showsPublicDesignYourOwnButton(){return this.configuration().feature_toggles.showsPublicDesignYourOwnButton}showsPublicPrice(){return this.configuration().feature_toggles.showsPublicPrice}showPublicPricingDisclaimer(){return this.configuration().feature_toggles.showPublicPricingDisclaimer}showsPublicLayerToggle(){return this.configuration().feature_toggles.showsPublicLayerToggle}showsPriceBreakdownDownloadButton(){return this.configuration().feature_toggles.showsPriceBreakdownDownloadButton}allowAddingAdditionalLineItems(){return this.configuration().feature_toggles.allowAddingAdditionalLineItems}allowAddingPlanBackground(){return this.configuration().feature_toggles.allowAddingPlanBackground}allowAngleSnapToggle(){return this.configuration().feature_toggles.allowAngleSnapToggle}showsStructures(){return this.configuration().feature_toggles.showsStructures}alwaysVisibleLayers(){return[]}}},45089:(e,t,r)=>{const{ImperialDecimalLengthFormatter:n}=r(7340),i=r(86176),s=r(61159),o=r(84616),a=r(57674),l=r(2902),c=r(63197),u=r(44476),d=r(14661),h=r(15838),p=r(64524),m=r(32972),f=r(93387),g=r(5895),y=r(37766),b=r(86446);e.exports=class RogueFabricatorsStrategy extends i{defaultEditTools(e,t){const r=new o(e,t);r.setDisplayName("Rail"),r.setRailingCollectionType(a),r.setRailingPlacementStrategyType(l),r.setShowSurfaceHeightProperty(!0),r.setIconName("generic-rail");const n=new c(e,t);return n.setFormatter(this.lengthFormatter()),[n,r]}drawingLayers(){return{[g.PLATFORMS_LEVEL]:!0,[g.PLATFORMS_SLOPED]:!0,[y.PLATFORM_LENGTH_ANNOTATIONS]:!0,[y.SECTION_LENGTH_ANNOTATIONS]:!0}}annotationType(){return u}_defaultLengthFormatter(){const e=s.decimalFormatterDecimalPlaces();return new n(e,!0,b)}projectClass(){return s}drawing3DControllerClass(){return p}watermarkClassNames(){return"watermark watermark--rogue-fabricators"}pricingStrategyClass(){return d}defaultRetailPricing(){return{LinearFeetOfRailingColosseum:{price:0,perUnit:"ft"},LinearFeetOfRailingOrion:{price:0,perUnit:"ft"},LinearFeetOfRailingTriton:{price:0,perUnit:"ft"},LinearFeetOfRailingPantheon:{price:0,perUnit:"ft"},LinearFeetOfRailingAchilles:{price:0,perUnit:"ft"},LinearFeetOfRailingViking:{price:0,perUnit:"ft"},LinearFeetOfRailingJavelin:{price:0,perUnit:"ft"},LinearFeetOfRailingEva:{price:0,perUnit:"ft"},LinearFeetOfRailingGemini:{price:0,perUnit:"ft"}}}defaultMaterialDefinitions(){return Object.values(m).map((e=>({identifier:e.identifier(),displayValue:e.name(),[f.description]:e.name()})))}materialListProperties(){return h.propertiesFromNames([f.description,f.materialGrade])}partsBreakdownColumns(){return[f.quantity,f.description,f.length,f.materialGrade,f.amount]}}},44275:(e,t,r)=>{const n=r(50636),i=r(79591),s=r(98272),o=r(43812),a=r(89929),l=r(82188),c=r(86427),u=r(12154);e.exports=class SafesmartAccessStrategy extends n{defaultEditTools(e,t){const r=e.project(),n=u.builder(r,new c);return[a.withBuilder(n,u,e,t),new a(l,e,t)]}drawingControllerClass(){return s}drawing3DControllerClass(){return i}projectClass(){return o}}},50636:(e,t,r)=>{const n=r(63768),i=r(85530),{MissingOverride:s}=r(50988),{ImperialDecimalLengthFormatter:o}=r(7340),a=r(33577),l=r(36363),c=r(94652),u=r(73531),d=r(7524),h=r(5647),p=r(60115),m=r(54400),f=r(19075),g=r(15838),y=r(44476),b=r(42947),v=r(22809);e.exports=class SystemStrategy{static defaultBundleIdentifier(){return"default"}static defaultFormatterClass(){return o}constructor(e=this.constructor.defaultBundleIdentifier()){this._bundleIdentifier=e}projectType(){return this.projectClass().type()}projectConfig(){return v}annotationFactoryFor(e){return this._emptyAnnotationsFactory??=new l({})}analyticsStrategies(){return[]}defaultAnalytics(){return new a(this.analyticsStrategies())}analytics(){return this._analytics??=this.defaultAnalytics()}postAnalyticsEvent(e){this.analytics().postEvent(e)}watermarkClassNames(){}guestWatermarkClassNames(){}priceBreakdown(e){return{}}drawingControllerClass(){return c}drawing3DControllerClass(){return u}annotationType(){return y}projectClass(){return d}registerSmartObjectClassMappings(e){}alwaysVisibleLayers(){return this._configuredAlwaysVisibleLayers()}_configuredAlwaysVisibleLayers(){const e=this.projectConfig().base.alwaysVisibleLayers;return e?Object.values(e):[]}customMenuItemPaths(){return this.allowPDFDownload()?["DownloadsButton"]:[]}defaultDisplayProperties(e){return[]}defaultRetailPricing(){return{}}defaultIndustryPricing(){return{}}retailPricing({retail:e={},industry:t={}}={}){return this._mergePriceLists(this.defaultRetailPricing(),e)}industryPricing({retail:e={},industry:t={}}={}){return this._mergePriceLists(this.defaultIndustryPricing(),t)}_mergePriceLists(e,t){const r=Object.keys(e),n={...e};return r.forEach((e=>{let r=t[e];if("string"==typeof r&&(r=r.trim(),0===r.length))return;const i=Number(t[e]);Number.isFinite(i)&&(n[e].price=i)})),n}materialName(e,t){return t?.[e]?.[b.item]||e}defaultMaterialDefinitions(){return Object.keys(this.defaultRetailPricing()).map((e=>({identifier:e,displayValue:this.materialName(e)??e,[b.item]:this.materialName(e)??e})))}materialList(e){}pricingSource(e,t){const r=this._priceListForProject(e,t),n=e.industryPricing?.()?this.industryPricing(r):this.retailPricing(r);return new p(n,e)}pricingForMarket(e){const t=`${e}Price`,r=this.defaultPricingMap();return Object.keys(r).reduce(((e,n)=>{const i=r[n],s=i[t]??i.price??0;return e[n]={price:s,perUnit:i.perUnit},e}),{})}defaultPricingMap(){return this.defaultRetailPricing()}_priceListForProject(e,t){const r=e.priceList();if(r)return r;const n={retail:{...this._combinedPriceListForPricing(this.retailPricing(t))},industry:{...this._combinedPriceListForPricing(this.industryPricing(t))}};return e.setTemporaryPriceList(n),this.shouldCacheProjectPricing()?(e.setPriceList(n),n):t}_combinedPriceListForPricing(e){return Object.keys(e).forEach((t=>e[t]=e[t].price)),e}pricingStrategy(e,t,r=this._defaultPricingColumns()){const n=this.pricingSource(e,t);return new(this.pricingStrategyClass())(n,e,r)}_defaultPricingColumns(){return[...new Set(this.partsBreakdownColumns())]}pricingStrategyClass(){return m}partsBreakdownColumns(){const e=this.hidePricing()?[]:[b.unitPrice,b.amount];return[b.item,...this.materialListPropertyNames(),b.quantity,b.unit,...e]}totalPrice(e,t){return this.pricingStrategy(e,t).totalPrice(e)}breakdownLineItems(e,t,r,n){return this.pricingStrategy(e,t,n).breakdownLineItems(e,r)}editTools(e){const t=e.drawingController(),r=e.zoomPalette();return[...this.defaultEditTools(t,r),this.planScaleTool(t,r)].filter((e=>e))}defaultEditTools(e,t){throw new s(this,"defaultEditTools")}planScaleTool(e,t){if(this.allowAddingPlanBackground())return new h(e,t)}drawingLayers(){return{Annotations:!0}}publicDrawingLayers(){return this.drawingLayers()}requestQuoteSuccessMessage(){return"Your quote was successfully submitted. It is currently waiting for a representative to review it."}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_pricingStrategy"]}identifier(){const e=this.constructor.name;return e.slice(0,e.lastIndexOf("Strategy"))}lowercaseIdentifier(){return this.identifier().replace(/([a-z])([A-Z])/g,"$1_$2").toLocaleLowerCase()}bundleIdentifier(){return this._bundleIdentifier}setBundleIdentifier(e){this._bundleIdentifier=e}keyboardShortcutsDescriptor(e){return[{title:"Edit Actions",shortcuts:[{modifiers:[f.modifierKeys.PRIMARY],key:"C",title:"Copy"},{modifiers:[f.modifierKeys.PRIMARY],key:"V",title:"Paste"},{modifiers:[f.modifierKeys.PRIMARY],key:"Z",title:"Undo"},{modifiers:[f.modifierKeys.SHIFT,f.modifierKeys.PRIMARY],key:"Z",title:"Redo",os:f.operatingSystems.MACOS},{modifiers:[f.modifierKeys.PRIMARY],key:"Y",title:"Redo",os:[f.operatingSystems.LINUX,f.operatingSystems.WINDOWS]},{modifiers:[],key:f.specialKeys.DELETE,title:"Delete"}]},{title:"Select Actions",shortcuts:[{modifiers:[f.modifierKeys.PRIMARY],key:"A",title:"Select All"},{modifiers:[],key:f.specialKeys.ESCAPE,title:"Reset Selection"}]},{title:"Tools",shortcuts:this.toolKeyboardShortcuts(e)}]}toolKeyboardShortcuts(e){if(!e)return[];const t=[],r=this.editTools(e).flatMap((e=>{const r=e.keyboardShortcutsSlot?.();if(void 0!==r&&!t.includes(r))return t.push(r),e.keyboardShortcutsInfo()})).filter((e=>e));return[{modifiers:[],key:f.specialKeys.SPACE,title:"Activate Panning"},...r]}isAdmin(){return void 0===this._isAdmin&&(this._isAdmin=!1),this._isAdmin}setIsAdmin(e){this._isAdmin=e}editorMode(){return this._editorMode}setEditorMode(e){this._editorMode=e}materialListProperties(){return g.propertiesFromNames([b.item])}materialListPropertyNames(){return this.materialListProperties().map((e=>e.name()))}externalEditorRedirectDefault(e,t){return"/"}translate(e,{fallback:t,...r}={}){const n=`${this.bundleIdentifier()}.${e}`,s=[{scope:`${this.lowercaseIdentifier()}.${e}`},{scope:`strategy.${e}`}];return t&&s.push(t),i.t(n,{...r,defaults:s})}t(e,t){return this.translate(e,t)}featureFlag(e){return this.translate(`feature_flags.javascript.${e}`,{fallback:{message:!1}})}showsPDFPublicQR(){return this.featureFlag("shows_pdf_public_qr")}showsPublicDesignYourOwnButton(){return this.featureFlag("shows_public_design_your_own_button")}showsExternalEditorPrice(){return this.featureFlag("shows_external_editor_price")}showsPublicPrice(){return this.featureFlag("shows_public_price")}showsPriceBreakdownDownloadButton(){return this.featureFlag("shows_price_breakdown_download_button")}onlyShowPriceDisclaimer(){return this.featureFlag("only_show_price_disclaimer")}allowAddingAdditionalLineItems(){return this.featureFlag("allow_adding_additional_line_items")}showPublicPricingDisclaimer(){return this.featureFlag("show_public_pricing_disclaimer")}showsActionBarIconLabels(){return this.featureFlag("shows_action_bar_icon_labels")}allowAddingPlanBackground(){return this.featureFlag("allow_adding_plan_background")}showsGuestSaveButton(){return this.featureFlag("shows_guest_save_button")}startOverButtonText(){return this.featureFlag("start_over_button_text")}showsRequestQuoteButton(){return this.featureFlag("shows_request_quote_button")}showsGuestRequestQuoteButton(){return this.featureFlag("shows_guest_request_quote_button")}allowSettingPendingRunAngle(){return this.featureFlag("allow_setting_pending_run_angle")}showsGuestLayerToggle(){return this.featureFlag("shows_guest_layer_toggle")}showsPublicLayerToggle(){return this.featureFlag("shows_public_layer_toggle")}shouldRenderJumpToLocationControls(){return this.featureFlag("should_render_jump_to_location_controls")}allowAngleSnapToggle(){return this.featureFlag("allow_angle_snap_toggle")}allowUnconnectedAngleSnapToggle(){return this.featureFlag("allow_unconnected_angle_snap_toggle")}showsStructures(){return this.featureFlag("shows_structures")}limitAngleWhenNotSnapping(){return this.featureFlag("limit_angle_when_not_snapping")}allowsPublicDownloads(){return this.featureFlag("allows_public_downloads")}allowsExternalEditorDownloads(){return this.featureFlag("allows_external_editor_downloads")}shows3DShadows(){return this.featureFlag("shows_3d_shadows")}shouldCacheProjectPricing(){return this.featureFlag("cache_project_pricing")}hidePricing(){return this.featureFlag("hide_pricing")}allowPDFDownload(){return this.featureFlag("allow_pdf_download")}allowAR(){return this.featureFlag("allow_ar")}allowVR(){return this.featureFlag("allow_vr")}showGuestCustomLinkButton(){return this.featureFlag("show_guest_custom_link_button")}lengthFormatter(){return this._lengthFormatter??=this._defaultLengthFormatter()}_defaultLengthFormatter(){return new(this.constructor.defaultFormatterClass())}usePricingMultiplierForAdditionalLineItems(){return!0}defaultBackgroundGridMeasurement(){return n.unit(12,"in")}}},37076:(e,t,r)=>{const n=r(50636),i=r(79591),s=r(98272);e.exports=class UltraloxStrategy extends n{defaultEditTools(e,t){return[]}drawingControllerClass(){return s}drawing3DControllerClass(){return i}}},61193:(e,t,r)=>{const{ImperialFractionLengthFormatter:n}=r(7340),i=r(89929),s=r(32083),o=r(21373),a=r(26659),l=r(42482),c=r(19575),u=r(63197),d=r(72148),h=r(44548),p=r(74168),m=r(59170),f=r(30915),g=r(17232),y=r(90639),b=r(29642),v=r(2029),_=r(61847),x=r(69399),w=r(10066),R=r(22373),k=r(8125);e.exports=class WatersideDocksStrategy extends s{static defaultFormatterClass(){return n}defaultEditTools(e,t){const r=new u(e,t);return r.setFormatter(this.lengthFormatter()),[...super.defaultEditTools(e,t),r,new i(_,e,t),new d(f,e,t),new i(v,e,t),...this._floatingDockTools(e,t),new c(x,e,t),new a(l,e,t)]}_floatingDockTools(e,t){return[new i(b,e,t),new d(y,e,t),new g(e,t)]}projectClass(){return m}dockClass(){return h}deckingOptions(){return[new o("Pressure Treated",{description:"Description",materialSpecifier:R.PT2x6,material:"pressure-treated"}),new o("Harbor Grey",{description:"Description",materialSpecifier:R.WOLF_SEASIDE,material:"composite-decking",colors:["#9ca593"],colors2D:["#b2b2a8"]}),new o("Sand Castle",{description:"Description",materialSpecifier:R.WOLF_SEASIDE,material:"composite-decking",colors:["#a38f75"],colors2D:["#beb19d"]}),new o("Silver Teak",{description:"Description",materialSpecifier:R.WOLF_TROPICAL,material:"composite-decking",colors:["#807a6f"],colors2D:["#999389"]}),new o("Amberwood",{description:"Description",materialSpecifier:R.WOLF_TROPICAL,material:"composite-decking",colors:["#856347"],colors2D:["#957860"]}),new o("Olivewood",{description:"Description",materialSpecifier:R.ENDECK_WOODLAND,material:"composite-decking",colors:["#8b7b74"],colors2D:["#a39690"]}),new o("Beechwood",{description:"Description",materialSpecifier:R.ENDECK_WOODLAND,material:"composite-decking",colors:["#a68759"],colors2D:["#d2c0a6"]}),new o("Ashwood",{description:"Description",materialSpecifier:R.ENDECK_WOODLAND,material:"composite-decking",colors:["#828282"],colors2D:["#b3b2b7"]})]}pricingStrategyClass(){return p}defaultRetailPricing(){return{WOLF_SEASIDEx12:{price:0},WOLF_SEASIDEx16:{price:0},WOLF_SEASIDEx20:{price:0},WOLF_TROPICALx12:{price:0},WOLF_TROPICALx16:{price:0},WOLF_TROPICALx20:{price:0},ENDECK_WOODLANDx12:{price:0},ENDECK_WOODLANDx16:{price:0},ENDECK_WOODLANDx20:{price:0},LVL:{price:0,perUnit:"ft"},SYP2x6x8:{price:0},SYP2x6x10:{price:0},SYP2x6x12:{price:0},SYP2x6x14:{price:0},SYP2x6x16:{price:0},SYP2x6x20:{price:0},SYP2x8x8:{price:0},SYP2x8x10:{price:0},SYP2x8x12:{price:0},SYP2x8x14:{price:0},SYP2x8x16:{price:0},SYP2x8x18:{price:0},SYP2x8x20:{price:0},SYP2x8x24:{price:0},PT2x4x8:{price:0},PT2x4x10:{price:0},PT2x4x12:{price:0},PT2x4x14:{price:0},PT2x4x16:{price:0},PT2x6x8:{price:0},PT2x6x10:{price:0},PT2x6x12:{price:0},PT2x6x14:{price:0},PT2x6x16:{price:0},PT2x6x20:{price:0},PT2x8x8:{price:0},PT2x8x10:{price:0},PT2x8x12:{price:0},PT2x8x14:{price:0},PT2x8x16:{price:0},PT2x8x18:{price:0},PT2x8x20:{price:0},PT2x8x24:{price:0},PT2x10x10:{price:0},PT2x10x12:{price:0},PT2x10x14:{price:0},PT2x10x16:{price:0},PT2x10x20:{price:0},PT2x10x24:{price:0},PT8x8x14:{price:0},PT8x8x16:{price:0},PT8x8x18:{price:0},PT8x8x20:{price:0},PT8x8x22:{price:0},PT8x8x24:{price:0},PT8x8x26:{price:0},PT8x8x28:{price:0},PT8x8x30:{price:0},PT8x8x36:{price:0},PT6x6x12:{price:0},PT6x6x14:{price:0},PT6x6x16:{price:0},PT6x6x18:{price:0},PT6x6x20:{price:0},PT6x6x22:{price:0},PT6x6x24:{price:0},WIND_BRACING_8x8x16:{price:0},WIND_BRACING_6x6x12:{price:0},PILE_CAP:{price:0},GALVANIZED_CARRIAGE_BOLTx10:{price:0},GALVANIZED_CARRIAGE_BOLTx12:{price:0},GALVANIZED_CARRIAGE_BOLTx14:{price:0},GALVANIZED_FLAT_WASHER:{price:0},GALVANIZED_HEX_NUT:{price:0},GALVANIZED_LAG_BOLT:{price:0},FLOAT2x4x18:{price:0},FLOAT3x4x18:{price:0},FLOAT4x4x18:{price:0},FLOAT6x4x18:{price:0},FLOAT2x4x24:{price:0},FLOAT3x4x24:{price:0},FLOAT4x4x24:{price:0},FLOAT6x4x24:{price:0},CARRIAGE_BOLTx4:{price:0},LAG_SCREW38:{price:0},PIPE_RAIL:{price:0,perUnit:"ft"},PIPE_FLANGE:{price:0},CABLE:{price:0,perUnit:"ft"},ROPE1_5:{price:0,perUnit:"ft"},ROPE2:{price:0,perUnit:"ft"},WESTBURY_PICKET_RAILING_KITx5:{price:0},WESTBURY_PICKET_RAILING_KITx6:{price:0},WESTBURY_PICKET_RAILING_KITx8:{price:0},WESTBURY_POST:{price:0},FASCIA_BOARDx8:{price:0},FASCIA_BOARDx10:{price:0},FASCIA_BOARDx12:{price:0},FASCIA_BOARDx14:{price:0},FASCIA_BOARDx16:{price:0},T_AND_G_SHEATHING:{price:0,perUnit:"wallboard"},TUFF_RIB_METAL_ROOFING:{price:0,perUnit:"ft"},DRIP_EDGE:{price:0},RIDGE_CAP:{price:0},ROOF_SCREW_FASTENERS:{price:0},GANGWAY_LOWER_DOCK_CONNECTION_KIT:{price:0},GANGWAY_UPPER_DOCK_CONNECTION_KIT:{price:0},GANGWAY_UPPER_SHORE_CONNECTION_KIT:{price:0},CLEAT:{price:0},RUB_RAIL:{price:0},BOATHOUSE_LIFT:{price:0},PILE_LIFT:{price:0},PWC_LIFT:{price:0},MOORING_PILES:{price:0},ANCHOR_PILES_AND_GUIDES:{price:0},LADDERS:{price:0},FUEL:{price:0},DECKING_SCREWS:{price:0},LABOR:{price:0},WORKERS_COMP:{price:0},HEALTH_INSURANCE:{price:0}}}materialName(e,t){return R.lookupName(e,t)}defaultMaterialDefinitions(){return R.defaultMaterialDefinitions()}drawingLayers(){return{...super.drawingLayers(),[k.RAILING_COLLECTION]:!0,[w.ROOFING]:!0,[w.ROOFING_MATERIAL]:!0,[w.WATER_DEPTH]:!0}}railingsLayer(){return k.RAILING_COLLECTION}}},10607:(e,t,r)=>{const n=r(36363);e.exports=class StrategyWithConfigurableRailingsMixin{annotationFactoryFor(e){switch(this._railingsAnnotationFactories??={},e){case"RailingRun":return this._railingsAnnotationFactories.railingRun??=new n(this.projectConfig().railings.railingRun.annotationHelpers);case"RailingSection":return this._railingsAnnotationFactories.railingSection??=new n(this.projectConfig().railings.railingSection.annotationHelpers);default:return super.annotationFactoryFor(e)}}postMountStyleConfigs(){return this._postMountStyleConfigs??=this._defaultPostMountStyleConfigs()}_defaultPostMountStyleConfigs(){const e=this.projectConfig().railings.railingStyles,t={};return Object.entries(e).forEach((([e,r])=>{Object.entries(r.postMountStyles.classInstanceConfigs).forEach((([r,n])=>{n.forEach((n=>{const i=n.id;t[i]&&this._warnOfDuplicatePostMountStyleIds(i,e,r,t[i]),t[i]={_usageContext:{railingStyleId:e,postMountStyleClassName:r},...n}}))}))})),t}_warnOfDuplicatePostMountStyleIds(e,t,r,n){const{railingStyleId:i,postMountStyleClassName:s}=n._usageContext;console.warn(`Duplicate post mount style config entries for id "${e}" - the previous config will be replaced.\n        The previous config was for the ${i} railing style and the ${s} class.\n        The current config is for the ${t} railing style and the ${r} class.\n      `)}}},32216:e=>{e.exports=class WatersideBaseDockStrategy{snappableEdgesForFrame(e,t){return this._dockEdges(e).flatMap((r=>e.subtractConnectionEdgesFrom(r,t)))}_dockEdges(e){return e.edges()}}},12781:(e,t,r)=>{const n=r(63768),{Composite3DFigure:i}=r(37732),{EditableProperty:s}=r(7340),{$P:o,FixedEdgeLocator:a,PolarCoordinate:l,Polygon:c}=r(62048),{extend:u,MissingOverride:d}=r(50988),h=r(84514),p=r(87991),m=r(61061),f=r(25630),g=r(67603),y=r(57129),b=r(98045),v=r(97613),_=r(37129),x=r(46748),w="PORT",R="STARBOARD";class WatersideBerthDock extends _{static role(){throw new d(this,"role")}static displayName(){return"Berth Dock"}static iconName(){return"boat-slip"}static defaultBerthWidth(){return n.unit(12,"ft")}static defaultBerthLength(){return n.unit(26,"ft")}static defaultFingerWidth(){return n.unit(4,"ft")}static defaultCrossWidth(){return n.unit(4,"ft")}static builder(e){return new b(e,this)}constructor(e=o(0,0),t){super(),this._referencePoint=e,this._angle=t}isSelectable(){return!0}referencePoint(){return this._referencePoint}locator(){return this.referencePoint()}angle(){return this._angle??=Math.THREE_PI_2}setAngle(e){const t=e-this.angle();this._angle=e,this.docks().forEach((e=>{e.rotateBy(this.locator(),t)})),this.angleChanged(e,t,this.locator())}angleChanged(e,t,r){t.isNearTo(0)||(this.detachAllGangways(),this.resetOuterGeometry(),this.resetAnnotations(),this.framingLevels().forEach((e=>e.geometry().rotateBy(r,t))),this.resetFramingLevelComponents())}snapToUnit(){return this.unit()}snappableAngles(){const e=Math.PI_4;return Array.from({length:8},((t,r)=>r*e))}deckingOptionProvider(){return this.project().deckingOptionProvider()}mainAxis(){return new l(1,this.angle())}crossAxis(){return new l(1,this.angle()+Math.PI_2)}moveBy(e,t){return this.referencePoint().moveBy(e,t)}boundingShape(){return this._boundingShape??=this._defaultBoundingShape()}_defaultBoundingShape(){const e=this.mainAxis(),t=this.crossAxis(),r=this.docks().flatMap((e=>e.vertices())),n=r.map((t=>e.dot(t))),i=r.map((e=>t.dot(e))),s=e.multipliedBy(Math.min(...n)),o=e.multipliedBy(Math.max(...n)),a=t.multipliedBy(Math.min(...i)),l=t.multipliedBy(Math.max(...i)),u=[s.add(a),o.add(a),o.add(l),s.add(l)].map((e=>e.addZ(this.crossDock().zLevel()).relatedTo(this.referencePoint())));return new c(u)}edges(){return this._edges??=this._defaultEdges()}_defaultEdges(){const e=this.boundingShape().edges();return this.docks().flatMap((e=>e.edges())).filter((t=>e.some((e=>e.overlapsBySignificantDistance(t)))))}defaultDisplayProperties(){return new h(this,[new g(this,this._selfDisplayProperties()),new f(this.docks(),"showOnBerthDock")])}_selfDisplayProperties(){return[new s(this,"Berth Width",{type:"unit",defaultUnit:"ft",ignoreIntermediateEdits:!0}),new s(this,"Berth Length",{type:"unit",defaultUnit:"ft",ignoreIntermediateEdits:!0}),new s(this,"Cross Width",{type:"unit",defaultUnit:"ft",ignoreIntermediateEdits:!0}),new s(this,"Starboard Finger Width",{type:"unit",defaultUnit:"ft",ignoreIntermediateEdits:!0}),new s(this,"Port Finger Width",{type:"unit",defaultUnit:"ft",ignoreIntermediateEdits:!0}),new s(this,"Width",{type:"unit",defaultUnit:"ft",label:"Overall Width",ignoreIntermediateEdits:!0}),new s(this,"Length",{type:"unit",defaultUnit:"ft",label:"Overall Length",ignoreIntermediateEdits:!0})]}berthWidth(){return this._berthWidth??=this.constructor.defaultBerthWidth()}setBerthWidth(e){this._berthWidth=n.max(e,this.minBerthWidth()),this.updateDocks(),this.updateDisplayProperties()}minBerthWidth(){return n.unit(8,"ft")}formatBerthWidth(){return this.lengthFormatter().format(this.berthWidth())}validateBerthWidth(e,t){if(!e)return;const r=this.minBerthWidth();return n.smaller(t,r)?`must be larger than ${this.lengthFormatter().format(r)}`:void 0}berthLength(){return this._berthLength??=this.constructor.defaultBerthLength()}setBerthLength(e){this._berthLength=n.max(e,this.minBerthLength()),this.updateDocks(),this.updateDisplayProperties()}minBerthLength(){return n.unit(10,"ft")}formatBerthLength(){return this.lengthFormatter().format(this.berthLength())}validateBerthLength(e,t){if(!e)return;const r=this.minBerthLength();return n.smaller(t,r)?`must be larger than ${this.lengthFormatter().format(r)}`:void 0}length(){return x`${this.berthLength()} + ${this.crossWidth()}`}setLength(e){this.setBerthLength(x`${e} - ${this.crossWidth()}`)}formatLength(){return this.lengthFormatter().format(this.length())}validateLength(e,t){if(!e)return;const r=n.add(this.crossWidth(),this.minBerthLength());return n.smaller(t,r)?`must be larger than ${this.lengthFormatter().format(r)}`:void 0}width(){return x`${this.berthWidth()} + ${this.portFingerWidth()} + ${this.starboardFingerWidth()}`}setWidth(e){this.setBerthWidth(x`${e} - (${this.portFingerWidth()} + ${this.starboardFingerWidth()})`)}formatWidth(){return this.lengthFormatter().format(this.width())}validateWidth(e,t){if(!e)return;const r=n.add(this.portFingerWidth(),this.starboardFingerWidth(),this.minBerthWidth());return n.smaller(t,r)?`must be larger than ${this.lengthFormatter().format(r)}`:void 0}starboardFingerWidth(){return this.starboardFingerDock().width()}setStarboardFingerWidth(e){this._setFingerDockWidth(this.starboardFingerDock(),e)}validateStarboardFingerWidth(e,t){return this.validateWalkwayWidth(e,t)}formatStarboardFingerWidth(){return this.lengthFormatter().format(this.starboardFingerWidth())}portFingerWidth(){return this.portFingerDock().width()}setPortFingerWidth(e){this._setFingerDockWidth(this.portFingerDock(),e)}validatePortFingerWidth(e,t){return this.validateWalkwayWidth(e,t)}formatPortFingerWidth(){return this.lengthFormatter().format(this.portFingerWidth())}_setFingerDockWidth(e,t){e.setWidth(n.max(t,this.minWalkwayWidth())),this.updateDocks(),this.updateDisplayProperties()}fingerLength(){return this.length()}crossWidth(){return this._crossWidth??=this.constructor.defaultCrossWidth()}setCrossWidth(e){this._crossWidth=n.max(e,this.minWalkwayWidth()),this.updateDocks(),this.updateDisplayProperties()}minWalkwayWidth(){return n.unit(3,"ft")}validateCrossWidth(e,t){return this.validateWalkwayWidth(e,t)}formatCrossWidth(){return this.lengthFormatter().format(this.crossWidth())}validateWalkwayWidth(e,t){if(!e)return;const r=this.minWalkwayWidth();return n.smaller(t,r)?`must be larger than ${this.lengthFormatter().format(r)}`:void 0}snapToIncrement(){return n.unit(1,"ft")}crossLength(){return this.berthWidth()}docks(){return[this.crossDock(),...this.fingerDocks()]}crossDock(){return this._crossDock??=this._defaultCrossDock()}_defaultCrossDock(){return this._createDock(this._crossDockLocation(),this.crossLength(),this.crossWidth())}_crossDockLocation(){const e=this.referencePoint(),t=x`${this.berthLength()} / 2`.toNumeric(this.unit());return e.add(this.mainAxis().multipliedBy(-t)).relatedTo(e)}fingerDocks(){return[this.starboardFingerDock(),this.portFingerDock()]}starboardFingerDock(){return this._starboardFingerDock??=this._defaultFingerDock(R)}portFingerDock(){return this._portFingerDock??=this._defaultFingerDock(w)}_defaultFingerDock(e){const t=this.constructor.defaultFingerWidth(),r=this._fingerDockLocationFor(e,t);return this._createDock(r,t,this.fingerLength())}_fingerDockLocationFor(e,t=void 0){t??=e===R?this.starboardFingerWidth():this.portFingerWidth();const r=this.referencePoint(),n=x`(${this.berthWidth()} + ${t}) / 2`.toNumeric(this.unit()),i=e===R?-1:1;return r.add(this.crossAxis().multipliedBy(i*n)).relatedTo(this.referencePoint())}_createDock(e,t,r){const n=this._dockClass().builder(this).referencePoint(e).angle(this.angle()).length(r).width(t).build();return n.setComponentOf(this),n}_dockClass(){throw new d(this,"_dockClass")}updateDocks(){const e=this.starboardFingerDock(),t=this._fingerDockLocationFor(R);this._updateDock(e,t,void 0,this.fingerLength());const r=this.portFingerDock(),n=this._fingerDockLocationFor(w);this._updateDock(r,n,void 0,this.fingerLength()),this._updateDock(this.crossDock(),this._crossDockLocation(),this.crossLength(),this.crossWidth()),this.resetOuterGeometry(),this.resetAnnotations(),this.updateConnections(),this.resetFramingLevelComponents()}resetOuterGeometry(){this._boundingShape=void 0,this._edges=void 0}_updateDock(e,t,r=void 0,n=void 0){const i=t.subtract(e.locator());e.moveBy(i.x(),i.y()),r&&e.setWidth(r),n&&e.setLength(n)}delete(){this.detachAllGangways(),this.docks().forEach((e=>e.delete())),super.delete()}_afterFramingLevelAdded(e){this.crossDock().updateDockGroup()}_afterFramingLevelRemoved(e){this.crossDock().updateDockGroup()}resetComponents(){super.resetComponents(),this.resetFramingLevelComponents()}alongMainAxis(e){const t=e.normalized();return Math.abs(t.dot(this.mainAxis())).isNearTo(1)}alongCrossAxis(e){const t=e.normalized();return Math.abs(t.dot(this.crossAxis())).isNearTo(1)}attachedConnectors(){return[]}snapToFramesFilter(){throw new d(this,"snapToFramesFilter")}snapToConnectorsFilter(){return e=>!1}movingFinished(){this.updateConnections()}surfaceOverhang(){return this.crossDock().surfaceOverhang()}height(){return this.crossDock().height()}snappableEdgesForComponent(e){return e.edges().filter((e=>this.edges().some((t=>t.overlapsBySignificantDistance(e)))))}cornerSnappingTolerance(){return n.unit(1,"ft")}dockStrategy(){throw new d(this,"dockStrategy")}defaultAnnotations(){const e=[this._crossWidthAnnotationEdge(),...this._fingerWidthAnnotationEdges(),this._berthWidthAnnotationEdge(),this._berthLengthAnnotationEdge()],t=[this._widthAnnotationEdge(),this._lengthAnnotationEdge()],r=this.systemStrategy().annotationType();return[...e.map((e=>new r(e))),...t.map((e=>new r(e,2*r.defaultDistance)))]}_lengthAnnotationEdge(){return this.boundingShape().edges().find((e=>this.alongMainAxis(e.vector())))}_crossWidthAnnotationEdge(){const e=this._lengthAnnotationEdge(),t=this.crossWidth().toNumeric(this.unit());return e.begin().to(new a(e,t))}_berthLengthAnnotationEdge(){const e=this._lengthAnnotationEdge(),t=this.crossWidth().toNumeric(this.unit());return new a(e,t).to(e.end())}_widthAnnotationEdge(){return this.boundingShape().edges().find((e=>this.alongCrossAxis(e.vector())))}_fingerWidthAnnotationEdges(){const e=this._widthAnnotationEdge(),t=this._berthWidthAnnotationEdge();return[e.begin().to(t.begin()),t.end().to(e.end())]}_berthWidthAnnotationEdge(){const e=this._widthAnnotationEdge(),t=this.portFingerWidth().toNumeric(this.unit()),r=this.starboardFingerWidth().toNumeric(this.unit());return new a(e,r).to(new a(e,-t))}resetAnnotations(){this._annotations=void 0}components(){return[...this.docks(),...this.framingLevels()]}_defaultSharedPosts(){return[]}selfMaterialLineItems(){return[]}frameResized(){this.resetComponents()}defaultFigure(){return new v(this)}threeFigure(){return i.withModel(this)}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_boundingShape","_edges"]}deckingOptionChanged(e){this.docks().forEach((t=>t.deckingOptionChanged(e)))}}u(WatersideBerthDock,p),u(WatersideBerthDock,y),u(WatersideBerthDock,m),e.exports=WatersideBerthDock},61476:(e,t,r)=>{const n=r(45100);e.exports=class WatersideBerthFixedDockStrategy extends n{constructor(e){super(),this.__berthDock=e}_berthDock(){return this.__berthDock}_dockEdges(e){return this._berthDock().snappableEdgesForComponent(e)}framingLevelsOverhead(e){return this._berthDock().framingLevels()}proposedPileDistancesFor(e,t){if(!this._isFingerDock(e))return super.proposedPileDistancesFor(e,t);const r=this._otherFingerDock(e),n=e.alongMainAxis(t.first().vector())?r.sideEdges():r.endEdges();return[...e.connectedDockBreakDistances(t),...r.connectedDockBreakDistances(n)]}connectionsChanged(e){super.connectionsChanged(e),this._otherFingerDock(e)?.resetComponents()}roofRoleRequiredForPileAt(e,t){return this._isFingerDock(t)&&t.framingLevelsOverhead().some((t=>t.roof().geometry().containsPoint(e)))}interiorRoleRequiredForPileAt(e,t){if(this._isFingerDock(t))return!1;return t.endEdges().first().xy().containsPoint(e.xy())}_otherFingerDock(e){if(this._isFingerDock(e))return this._fingerDocks().find((t=>t!==e))}_isFingerDock(e){return this._fingerDocks().includes(e)}_fingerDocks(){return this._berthDock().fingerDocks()}}},26554:(e,t,r)=>{const n=r(7423);e.exports=class WatersideBerthFloatingDockStrategy extends n{constructor(e){super(),this.__berthDock=e}_berthDock(){return this.__berthDock}_dockEdges(e){return this._berthDock().snappableEdgesForComponent(e)}explicitExtendFloatBoardsFor(e){return this._berthDock().crossDock()===e}}},45100:(e,t,r)=>{const n=r(32216);e.exports=class WatersideDefaultFixedDockStrategy extends n{framingLevelsOverhead(e){return e.framingLevels()}proposedPileDistancesFor(e,t){return e.connectedDockBreakDistances(t)}connectionsChanged(e){e.resetComponents()}roofRoleRequiredForPileAt(e,t){const r=t.framingDescriptor().postSpecifier().details().width.toNumeric(t.unit());return t.framingLevelsOverhead().some((n=>{const i=n.roof().overhang().toNumeric(t.unit())+r;return n.roof().geometry().intersects(e.x(),e.y(),i)}))}interiorRoleRequiredForPileAt(e,t){return!1}}},44548:(e,t,r)=>{const n=r(63768),{EditableProperty:i}=r(7340),{extend:s}=r(50988),o=r(87991),a=r(32398),l=r(18313),c=r(16461),u=r(30691),d=r(35668),h=r(67603),p=r(57129),m=r(5163),f=r(45100),g=r(16436),y=r(12992),b=r(92526),v=r(87548),_=r(56099),x=r(80317);class WatersideDock extends m{static iconName(){return"stick-dock"}static defaultLength(){return n.unit(30,"ft")}static defaultWidth(){return n.unit(20,"ft")}static defaultHeightAboveFullPond(){return n.unit(1,"ft")}static defaultPostSpacing(){return n.unit(8,"ft")}static postSpacingRange(){return[n.unit(1,"ft"),n.unit(16,"ft")]}materialCategory(){return this.materials.categories.FIXED_DOCK}snapToIncrement(){return n.unit(1,"ft")}minimumSpan(){return n.unit(2,"ft").toNumeric(this.unit())}slipHandleLocators(){return[]}_defaultHeight(){return n.add(this.constructor.defaultHeightAboveFullPond(),this.project().waterHeightBelowFullPond())}deckingBoardGap(){return n.unit(.125,"in")}_defaultFramer(){return new y(this)}_defaultFramingDescriptor(){return new b(this)}includeSkirtBoards(){return!1}shouldShowSubstructure(){return!0}defaultDisplayProperties(){return new h(this,[new i(this,"Width",{type:"unit",defaultUnit:"ft",ignoreIntermediateEdits:!0}),new i(this,"Length",{type:"unit",defaultUnit:"ft",ignoreIntermediateEdits:!0}),new i(this,"Include Cross Bracing",{type:"boolean",label:"Cross Bracing",showOnBerthDock:!0}),new i(this,"Max Post Spacing",{type:"unit",defaultUnit:"ft",label:"Max Pile Spacing",ignoreIntermediateEdits:!0,showOnBerthDock:!0}),this.railingEdgeMapProperty()])}railingEdgeShape(){return this.geometry()}railingSubtractionEdgesFor(e){return[...this.connectionEdgesOn(e),...this._gangwayRailBreakEdgesFor(e)]}_gangwayRailBreakEdgesFor(e){if(!this.hasAttachedGangways())return[];const t=e.xy(),r=this.dockFramer().postLayoutHelper().postLocations().map((e=>e.xy())).filter((e=>t.containsPoint(e))),n=this.gangwayOverlappingEdgesFor(e),i=this.framingDescriptor().halfPostWidth(),s=e=>r.find((t=>t.distanceTo(e)<=i));return n.map((e=>{const t=e.xy(),[n,i]=e.endpoints();let o=s(n);if(!o){const e=r.filter((e=>u.pointIsBeforeEdge(t,e)));o=e.length>0?n.findClosestPoint(e):n}let a=s(i);if(!a){const e=r.filter((e=>u.pointIsAfterEdge(t,e)));a=e.length>0?i.findClosestPoint(e):i}return o.to(a)}))}setRailingEdgeMap(e,t){this.railingEdgeMap().set(e,t),this.resetComponents();const r=this.edges().find((t=>t.overlapsBySignificantDistance(e)));this.connectedDocksAlong(r).forEach((e=>e.resetComponents())),this.recalculateRailings()}formatLength(){return this.project().lengthFormatter().format(this.length())}formatWidth(){return this.project().lengthFormatter().format(this.width())}formatHeight(){return this.project().lengthFormatter().format(this.height())}maxPostSpacing(){return this._maxPostSpacing??=this.constructor.defaultPostSpacing()}setMaxPostSpacing(e){this._maxPostSpacing=e,this.resetComponents(),this.recalculateRailings()}validateMaxPostSpacing(e,t){if(!e)return;const[r,i]=this.constructor.postSpacingRange(),s=this.project().lengthFormatter();return n.larger(t,i)?`must be smaller than ${s.format(i)}`:n.smaller(t,r)?`must be larger than ${s.format(r)}`:void 0}includeCrossBracing(){return this._includeCrossBracing??=!1}toggleIncludeCrossBracing(){this.setIncludeCrossBracing(!this.includeCrossBracing())}setIncludeCrossBracing(e){this._includeCrossBracing=e}outsideJoists(){return this._outsideJoists??=this.dockFramer().makeOutsideJoists()}crossBracing(){return this.includeCrossBracing()?super.crossBracing():[]}resetComponents(){this._outsideJoists=void 0,super.resetComponents(),this.updateRailingMapProperty()}connectionsChanged(){this.dockStrategy().connectionsChanged(this)}framingLevelsOverhead(){return this.dockStrategy().framingLevelsOverhead(this)}recalculateRailings(){this.project().recalculateRailings(),this.updateDockGroup()}components(){return[...super.components(),...this.outsideJoists()]}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_outsideJoists"]}boundingShape(){return this.geometry()}framingEndEdgePairs(){const e=this.postRows().map((e=>e.first().locator().xy().to(e.last().locator().xy()).addZ(this.zLevel())));return e.reduce(((t,r,n)=>{const i=e[n+1];return i?(t.push({edges:[r,i.reversed()],includeEnds:!0,doubleOnEnd:!1,doubleOnMiddle:!1}),t):t}),[])}cornerSnappingTolerance(){return n.unit(1,"ft")}connectionClass(){return g}connectionZLevel(){return this.zLevel()}frameResized({fromSetter:e=!1}={}){e?(super.frameResized({fromSetter:e}),this.updateConnections()):this.updateDisplayProperties()}resizingFinished(){this.frameResized({fromSetter:!0})}angleChanged(e,t){super.angleChanged(e,t),this.updateFramingLevelAngles(e,t),this.updateConnections()}delete(){const e=this.project();this.connections().forEach((e=>e.delete())),super.delete(),e.recalculateRailings()}_afterConnectionsUpdated(e){e&&this.recalculateRailings()}_afterFramingLevelAdded(e){this.updateDockGroup()}_afterFramingLevelRemoved(e){this.updateDockGroup()}uniquePosts(){return this.posts().filter((e=>!e.isExisting()))}existingPosts(){return this.posts().filter((e=>e.isExisting()))}proposedPileDistancesFor(e){return this.dockStrategy().proposedPileDistancesFor(this,e)}connectedDockBreakDistances(e){const t=e.first().begin(),r=e.first().direction();return e.flatMap((e=>this.connectionEdgesOn(e).flatMap((e=>e.endpoints())).map((e=>(e=>e.subtract(t).dot(r).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES))(e))))).sort(((e,t)=>e-t))}snappableEdgesForFrame(e){return this.dockStrategy().snappableEdgesForFrame(this,e)}subtractConnectionEdgesFrom(e,t){const r=this.connections().filter((e=>e.otherDock(this)!==t)),n=this.connectionEdgesOn(e,r);return u.subtractSegmentsFromEdge(e,n)}componentsMaterialLineItems(){return this.components().filter(this._materialLineItemComponentFilter.bind(this)).flatMap((e=>e.materialLineItems?.()??[]))}_materialLineItemComponentFilter(e){if(!this.dockGroup())return!0;return!this._dockGroupSharedMaterialComponents().includes(e)}_dockGroupSharedMaterialComponents(){return[...this.dockGroupShareableMaterials(),this.surface()]}dockGroupShareableMaterials(){return this.splitPileCaps()}dockStrategy(){return this.componentOf()?.dockStrategy?.()||new f}projectedAnnotations(e,t,r){const n=this.endEdges().first().begin(),i=n.to(n.addZ(this.height().toNumeric(this.unit()))),s=new d(i.begin(),e,t,r).to(new d(i.end(),e,t,r));return[new(this.systemStrategy().annotationType())(s,30,this.unit(),{formatter:this.lengthFormatter(),crampedTextAngle:0})]}deckingOptionChanged(e){this.resetComponents()}defaultFigure(){return new a(this)}figureSubModels(){return[...this.framingLevels()]}railingEdgeMapPropertyType(){return"edge-multi-state-map"}defaultRailingToggleValue(e){return new v(this,e)}railingEdges(){return this.updateRailingEdgeMap(),this.baseRailingEdges().filter((e=>{const t=this.railingEdgeMap().get(e);return t.hasRailings?.()??t}))}postMountStyleClassFor(e){return _}railingStyleFor(e){const t=this.railingEdgeMap().get(e);return t?.railingStyle()||this.project().railingStyle()}snapToFramesFilter(){return e=>e.role()===x.DOCK||e.role()===x.FIXED_BERTH_DOCK}_gangwayAttachmentsChanged(){this.resetComponents(),this.recalculateRailings()}}s(WatersideDock,o),s(WatersideDock,l),s(WatersideDock,c),s(WatersideDock,p),e.exports=WatersideDock},16436:(e,t,r)=>{const n=r(57100);e.exports=class WatersideDockConnection extends n{}},37129:(e,t,r)=>{const n=r(63768),{Composite3DFigure:i}=r(37732),{$P:s}=r(62048),o=r(26933),a=r(30691),l=r(6556),c=r(5090),u=r(54798),d=r(88846),h=r(11521),p=r(86606),m=r(80317);e.exports=class WatersideDockGroup extends u{static role(){return m.DOCK_GROUP}materialCategory(){return this.docks().first().materialCategory()}referencePoint(){return this._referencePoint??=s(0,0)}isSelectable(){return!1}docks(){return this._docks??=[]}add(e){this.docks().push(e),this.docksChanged()}remove(e){this.docks().remove(e),this.docksChanged()}geometry(){const e=this.docks().map((e=>e.geometry()));return e.pop().union(...e).first().relatedTo(this.referencePoint())}vertices(){return this.geometry().vertices()}edges(){return this.geometry().edges()}updateConnections(){this.docks().forEach((e=>e.updateConnections()))}resetComponents(){this.docks().forEach((e=>e.resetComponents()))}posts(){const e=this.sharedPosts().slice();return this.docks().forEach((t=>e.fastMerge(t.uniquePosts()))),e}postMountStyleClassFor(e){return this._dockForRailingEdge(e).postMountStyleClassFor(e)}railingStyleFor(e){return this._dockForRailingEdge(e).railingStyleFor(e)}_dockForRailingEdge(e){return this.docks().find((t=>t.railingEdges().find((t=>t.equals(e)))))}sharedPosts(){return this._sharedPosts??=this._defaultSharedPosts()}_defaultSharedPosts(){return this._sharedPostGroups().map((e=>{const t=e.first(),r=t.edgeLocator(),n=t.materialSpecifier(),i=new p(r,n,e);return i.setComponentOf(this),i}))}_sharedPostGroups(){const e=this.docks().flatMap((e=>e.existingPosts())),t=new c;return e.forEach((e=>{t.has(e.locator().xy())?t.get(e.locator().xy()).push(e):t.set(e.locator().xy(),[e])})),t.values()}docksChanged(){this._sharedPosts=void 0}selfMaterialLineItems(){return[...this._sharedFramingMaterials(),...this._deckingMaterials()]}_sharedFramingMaterials(){const e=this.docks().flatMap((e=>e.dockGroupShareableMaterials()));return this._groupMaterialsByDirectionAndSpecifier(e).flatMap((({materials:e,specifier:t})=>a.mergeOverlappingEdges(e.map((e=>e.centerEdge()))).map((e=>({edge:e,specifier:t}))))).map((({edge:e,specifier:t})=>new l(n.unit(e.length(),this.unit()),t)))}_deckingMaterials(){return d.lineItemsFor(...this.docks())}_groupMaterialsByDirectionAndSpecifier(e){const t=[];return e.forEach((e=>{const r=t.find((({direction:t,specifier:r})=>Math.abs(t.dot(e.edge().direction())).isNearTo(1)&&r.identifier()===e.materialSpecifier().identifier()));r?r.materials.push(e):t.push({direction:e.edge().direction(),specifier:e.materialSpecifier(),materials:[e]})})),t}resetFloatBoards(){this.docks().forEach((e=>e.resetFloatBoards()))}components(){return[...this.sharedPosts()]}defaultFigure(){return h.withModel(this)}threeFigure(){return i.withModel(this)}projectedViewFigure(e,t,r){return o.withModel(this,e,t,r)}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_sharedPosts"]}}},74168:(e,t,r)=>{const n=r(81813),i=r(5393),s=r(68720),o=r(92096),a=r(54400),l=r(69979),c=r(22373);e.exports=class WatersideDocksPricingStrategy extends a{allLineItems(e){return[...this.projectLineItems(e),...this.materialLineItems(e),...this.laborLineItems(e),...this.marginLineItems(e)]}materialLineItems(e){const t=this.subtotal(e),r=new l("Materials Subtotal",t),n=this._percentMultiplierLineItem(c.MATERIAL_TAX,t,e),i=n.materialCost(this.pricingSource());return[r,n,new l("Material Costs",t+i,{isCategoryTotal:!0})]}laborLineItems(e){const t=s.builder(c.LABOR,{project:e}).unit("hours").build(),r=t.materialCost(this.pricingSource()),n=o.builder(c.WORKERS_COMP,{project:e,pricingSource:this.pricingSource()}).quantity(r/100).unit("labor/100").build(),i=o.builder(c.HEALTH_INSURANCE,{project:e,pricingSource:this.pricingSource()}).quantity(t.quantity()).unit("hours").build(),a=r+i.materialCost(this.pricingSource())+n.materialCost(this.pricingSource()),u=this._percentMultiplierLineItem(c.LABOR_TAX,a,e),d=u.materialCost(this.pricingSource());return[t,n,i,u,new l("Labor Costs",a+d,{isCategoryTotal:!0})]}marginLineItems(e){const t=this._totalWithoutMargin(e);return[new l("Total Costs",t,{isSectionTotal:!0}),n.builder(c.MARGIN,{subtotal:t,project:e}).build()]}_breakdownLineItemsSortFunction(e,t){return(0,new Intl.Collator("us",{numeric:!0}).compare)(e.sortKey(),t.sortKey())}_percentMultiplierLineItem(e,t,r){return i.builder(e,{subtotal:t,project:r,type:"unit",propertyOptions:{defaultUnit:"percent"}}).build()}_laborCost(e){return this.laborLineItem(e).materialCost(this.pricingSource())}_totalWithoutMargin(e){return this._totalForLineItems([...this.projectLineItems(e),...this.materialLineItems(e),...this.laborLineItems(e)])}}},59170:(e,t,r)=>{const n=r(63768),{EditableProperty:i}=r(7340),{extend:s,simpleObserver:o}=r(50988),a=r(29906),l=r(84514),c=r(87960),u=r(7524),d=r(25830),h=r(60998),p=r(94263),m=r(68720),f=r(8519),g=r(10962),y=r(32723),b=r(67603),v=r(18371),_=r(23696),x=r(55093),w=r(90019),R=r(58757),k=r(37129),j=r(31206),z=r(42947),q=r(80317),$=r(22373);class WatersideDocksProject extends u{static defaultWaterHeightBelowFullPond(){return n.unit(3,"ft")}get materials(){return $}waterHeightBelowFullPond(){return this._waterHeightBelowFullPond??=this.constructor.defaultWaterHeightBelowFullPond()}defaultDisplayProperties(){return new l(this,[new b(this,[...super.defaultDisplayProperties(),new i(this,"Pile Penetration",{type:"unit",defaultUnit:"ft"}),new i(this,"Include Pile Caps",{type:"boolean"}),new i(this,"Roof Surface Color",{type:"select",choices:this.roofSurfaceColorChoices()}),new i(this,"Railing Style",{type:"segment",choices:this.railingStyleChoices()})]),this.railingStyle().displayProperties()])}_defaultRoofSurfaceColor(){return this.materials.TUFF_RIB_METAL_ROOFING.details().color}roofSurfaceColorChoices(){return[{label:"Galvalume",value:"#aaaaaa"},{label:"Black",value:"#000000"},{label:"Bronze",value:"#44362e"},{label:"Forest Green",value:"#0c3422"},{label:"Gallery Blue",value:"#2f4467"},{label:"Barn Red",value:"#8c3121"}]}pilePenetration(){return this._pilePenetration??=n.unit(5,"ft")}setPilePenetration(e){this._pilePenetration=e}includePileCaps(){return this._includePileCaps??=!0}toggleIncludePileCaps(){this.setIncludePileCaps(!this.includePileCaps())}setIncludePileCaps(e){this._includePileCaps=e}anchorPilesAssembliesPrice(){return this._anchorPileAssembliesPrice??=0}setAnchorPilesAssembliesPrice(e){this._anchorPileAssembliesPrice=e}anchorPilesAssembliesPriceProperty(){return this._anchorPileAssembliesPriceProperty??=new i(this,"Anchor Piles Assemblies Price",{label:"Anchor Piles and Guides",type:"number"})}boathouseLiftPrice(){return this._boathouseLiftPrice??=0}setBoathouseLiftPrice(e){this._boathouseLiftPrice=e}boathouseLiftPriceProperty(){return this._boathouseLiftPriceProperty??=new i(this,"Boathouse Lift Price",{type:"number"})}pileLiftPrice(){return this._pileLiftPrice??=0}setPileLiftPrice(e){this._pileLiftPrice=e}pileLiftPriceProperty(){return this._pileLiftPriceProperty??=new i(this,"Pile Lift Price",{type:"number"})}pwcLiftPrice(){return this._pwcLiftPrice??=0}setPwcLiftPrice(e){this._pwcLiftPrice=e}pwcLiftPriceProperty(){return this._pwcLiftPriceProperty??=new i(this,"Pwc Lift Price",{type:"number"})}mooringPilesPrice(){return this._mooringPilesPrice??=0}setMooringPilesPrice(e){this._mooringPilesPrice=e}mooringPilesPriceProperty(){return this._mooringPilesPriceProperty??=new i(this,"Mooring Piles Price",{type:"number"})}laddersPrice(){return this._laddersPrice??=0}setLaddersPrice(e){this._laddersPrice=e}laddersPriceProperty(){return this._laddersPriceProperty??=new i(this,"Ladders Price",{type:"number"})}fuelPrice(){return this._fuelPrice??=0}setFuelPrice(e){this._fuelPrice=e}fuelPriceProperty(){return this._fuelPriceProperty??=new i(this,"Fuel Price",{type:"number"})}deckingScrewPrice(){return this._deckingScrewPrice??=0}setDeckingScrewPrice(e){this._deckingScrewPrice=e}deckingScrewPriceProperty(){return this._deckingScrewPriceProperty??=new i(this,"Decking Screw Price",{type:"number"})}editableMaterialLineItems(){return[m.builder(this.materials.CLEAT,{project:this}).build(),m.builder(this.materials.RUB_RAIL,{project:this}).build(),...this._priceEditableMaterialLineItems(),...super.editableMaterialLineItems()]}_priceEditableMaterialLineItems(){const e=(e,t)=>p.builder(this.materials[e]).propertiesCollection({[z.amount]:this[`${t}PriceProperty`]()}).build();return[e("BOATHOUSE_LIFT","boathouseLift"),e("PILE_LIFT","pileLift"),e("PWC_LIFT","pwcLift"),e("MOORING_PILES","mooringPiles"),e("ANCHOR_PILES_AND_GUIDES","anchorPilesAssemblies"),e("LADDERS","ladders"),e("FUEL","fuel"),e("DECKING_SCREWS","deckingScrew")]}_defaultEditableLineItemValueMap(){return{[this.materials.CLEAT.identifier()]:8,[this.materials.RUB_RAIL.identifier()]:20,[this.materials.MATERIAL_TAX.identifier()]:n.unit(7,"percent"),[this.materials.LABOR.identifier()]:0,[this.materials.LABOR_TAX.identifier()]:n.unit(5,"percent"),[this.materials.MARGIN.identifier()]:n.unit(34,"percent")}}materialList(){return new _(this._materialLineItems())}_materialLineItems(){const e=this.components().flatMap((e=>e.materialLineItems?.()??[]));return this._processMaterialLineItems([...e,...this.editableMaterialLineItems()])}_materialLineItemProcessors(){return[new a([new v,new c([this.materials.CABLE,this.materials.ROPE1_5,this.materials.ROPE2]),new x("ft",[this.materials.CABLE,this.materials.ROPE1_5,this.materials.ROPE2]),new f,new x("in"),new c])]}_defaultWaterGradientBreaklines(){const e=(e,t)=>new w(n.unit(e,"ft"),n.unit(t,"ft"));return[e(0,0),e(50,5),e(70,8),e(120,18)]}docks(){return[...this.componentsForRoles(...this._dockRoles()),...this.berthDocks().flatMap((e=>e.docks()))]}piles(){return[...this.docks().flatMap((e=>e.uniquePosts())),...this.dockGroups().flatMap((e=>e.sharedPosts()))]}frames(){return[...this.componentsForRoles(...this._frameRoles()),...this.berthDocks().flatMap((e=>e.docks()))]}framingLevelFoundations(){return[...this.componentsForRoles(...this._frameRoles()),...this.berthDocks()]}berthDocks(){return this.componentsForRoles(q.FIXED_BERTH_DOCK,q.FLOATING_BERTH_DOCK)}enclosablePlatforms(){return this.componentsForRoles(...this._railingPlatformRoles())}_frameRoles(){return[...this._dockRoles(),q.ANCHOR_PLATFORM]}_dockRoles(){return[q.DOCK,q.EXISTING_DOCK,q.FLOATING_DOCK]}_railingPlatformRoles(){return[q.FIXED_BERTH_DOCK,q.DOCK,q.GANGWAY]}_boundingBoxComponents(){return super._boundingBoxComponents().filter((e=>e!==this.waterGradient()))}_dockGroupClass(){return k}measurementSnapEdges(){return this.frames().flatMap((e=>e.edges()))}railingCollectionClass(){return R}railingStyle(){return this._railingStyle??=this._defaultRailingStyle()}_defaultRailingStyle(){return this.railingStyleChoices().first()}setRailingStyle(e){e?.copyPropertiesFromStyle(this.railingStyle()),this._railingStyle=e,this.recalculateRailings(),this.resetDisplayProperties(),this.notifyRailingStyleChangedObservers()}railingStyleChoices(){return j.railingStyleChoices()}_createRunFor(e,t){return e.createRunOn(t.structure,t.edge)}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_anchorPileAssembliesPriceProperty","_boathouseLiftPriceProperty","_pileLiftPriceProperty","_pwcLiftPriceProperty","_mooringPilesPriceProperty","_laddersPriceProperty","_fuelPriceProperty","_deckingScrewPriceProperty","_waterHeightBelowFullPond","_railingStyleChangedObservers"]}logo(){return"waterside-logo.png"}watermarkAlpha(){return.03}pdfDocumentClass(){return WatersidePDFDocument}}s(WatersideDocksProject,h),s(WatersideDocksProject,y),s(WatersideDocksProject,g),s(WatersideDocksProject,d),o(WatersideDocksProject,"railingStyleChanged"),e.exports=WatersideDocksProject},30326:(e,t,r)=>{const{NullDrawable:n}=r(7340),{NullDrawable3D:i}=r(37732),s=r(62887);e.exports=class WatersideExistingPile extends s{isExisting(){return!0}materialLineItems(){return[]}defaultFigure(){return new n(this)}threeFigure(){return new i(this)}}},30915:(e,t,r)=>{const{extend:n}=r(50988),i=r(67603),s=r(81620),o=r(12781),a=r(61476),l=r(44548),c=r(56099),u=r(80317);class WatersideFixedBerthDock extends o{static role(){return u.FIXED_BERTH_DOCK}static displayName(){return"Fixed Berth Dock"}materialCategory(){return this.materials.categories.FIXED_DOCK}defaultDisplayProperties(){const e=super.defaultDisplayProperties();return e.append(new i(this,this.railingMapProperties())),e}railingMapProperties(){const e=this.starboardFingerDock().railingEdgeMapProperty();this._namespaceProperty("Starboard Dock",e);const t=this.crossDock().railingEdgeMapProperty();this._namespaceProperty("Cross Dock",t);const r=this.portFingerDock().railingEdgeMapProperty();return this._namespaceProperty("Port Dock",r),[e,t,r]}maxPostSpacing(){return this.crossDock().maxPostSpacing()}postMountStyleClassFor(e){return c}railingStyleFor(e){return this._dockForRailingEdge(e).railingStyleFor(e)}railingEdges(){return this.docks().flatMap((e=>e.railingEdges()))}_namespaceProperty(e,t){t.label().includes(e)||t.namespace(e)}_dockClass(){return l}delete(){const e=this.project();super.delete(),e.recalculateRailings()}snapToFramesFilter(){return e=>[u.DOCK,u.EXISTING_DOCK].includes(e.role())}dockStrategy(){return new a(this)}dockFramer(){return this.crossDock().dockFramer()}framingDescriptor(){return this.crossDock().framingDescriptor()}posts(){return this.docks().flatMap((e=>e.posts()))}}n(WatersideFixedBerthDock,s),e.exports=WatersideFixedBerthDock},61782:(e,t,r)=>{const{extend:n}=r(50988),i=r(83924),s=r(81620),o=r(81664);let a;class WatersideFixedDockToRoofSubstructure extends i{_defaultFramingDescriptor(){return new o(this)}posts(){return a||(a=r(62887)),this.foundation().posts().filter((e=>e.role()===a.roles.ROOF))}}n(WatersideFixedDockToRoofSubstructure,s),e.exports=WatersideFixedDockToRoofSubstructure},1997:(e,t,r)=>{const n=r(63768),{EditableProperty:i,DisplayProperties:s}=r(7340),{extend:o}=r(50988),{PolarCoordinate:a}=r(62048),l=r(6556),c=r(59663),u=r(76133),d=r(25737),h=r(58223);class WatersideFloat extends d{_geometryWidth(){return n.subtract(this.width(),this._insetForGeometry()).toNumeric(this.unit())}_geometryLength(){return n.subtract(this.length(),this._insetForGeometry()).toNumeric(this.unit())}_insetForGeometry(){return n.unit(3,"in")}floatBoardLinesAlong(e){return this.geometry().edges().filter((t=>Math.abs(t.direction().dot(e)).isNearTo(1)))}defaultDisplayProperties(){return[new i(this,"Material Specifier",{type:"select",choices:this._materialSpecifierChoices(),label:"Size"}),new i(this,"Rotate",{type:"action",perform:()=>this._rotate()})]}_materialSpecifierChoices(){return this.materials.floats.map((e=>({label:e.name(),value:e})))}_rotate(){this.setAngle(this.angle()+Math.PI_2)}setMaterialSpecifier(e){this._materialSpecifier=e,this.reset()}reset(){super.reset(),this.floatChanged()}floatChanged(){this.componentOf().floatsChanged()}delete(){this.componentOf().removeFloat(this)}selfMaterialLineItems(){return[new l(4,this.materials.LAG_SCREW38),new l(1,this.materialSpecifier())]}defaultFigure(){const e=new c(this);return e.setSelfHandle(new h(e)),e}coerceToValidPosition({snapToGrid:e=!0}={}){e&&this.snapToGrid();const t=this.componentOf().floatConstraintGeometryFor(this),r=u.constrainLocatorTo(t,this.locator()).subtract(this.locator());this.locator().moveBy(r.x(),r.y())}snapToGrid(){const e=this.componentOf().locator(),t=this._snapIncrement().toNumeric(this.unit()),r=this.locator().subtract(e),n=Math.round(r.x()/t)*t,i=Math.round(r.y()/t)*t,s=e.add(n,i).subtract(this.locator());this.locator().moveBy(s.x(),s.y())}_snapIncrement(){return n.unit(1,"in")}dimensionAlong(e){return Math.abs(e.dot(new a(1,this.angle()))).isNearTo(1)?this.length().toNumeric(this.unit()):this.width().toNumeric(this.unit())}nonEssentialProperties(){return[...super.nonEssentialProperties(),...s.nonEssentialProperties()]}}o(WatersideFloat,s),e.exports=WatersideFloat},58405:(e,t,r)=>{const{extend:n}=r(50988),i=r(83924),s=r(81620),o=r(33855),a=r(84475);class WatersideFloatToRoofSubstructure extends i{_defaultFramer(){return new a(this)}_defaultFramingDescriptor(){return new o(this)}posts(){return this._posts??=this.componentFramer().makePosts()}components(){return this.posts()}resetComponents(){super.resetComponents(),this._posts=void 0}}n(WatersideFloatToRoofSubstructure,s),e.exports=WatersideFloatToRoofSubstructure},90639:(e,t,r)=>{const{Polygon:n}=r(62048),i=r(12781),s=r(26554),o=r(29642),a=r(80317);e.exports=class WatersideFloatingBerthDock extends i{static role(){return a.FLOATING_BERTH_DOCK}static displayName(){return"Floating Berth Dock"}_dockClass(){return o}snapToFramesFilter(){return e=>[a.FLOATING_DOCK,a.EXISTING_DOCK].includes(e.role())}snapToConnectorsFilter(){return e=>e.role()===a.GANGWAY}dockStrategy(){return new s(this)}zLevel(){return this.crossDock().zLevel()}floatZLevel(){return this.crossDock().floatZLevel()}defaultFramingLevelGeometry(){const e=this.boundingShape();return new n(e.vertices().map((e=>e.relatedTo(e))))}snappingLines(){return this.docks().flatMap((e=>e.snappingLines()))}framingDescriptor(){return this.crossDock().framingDescriptor()}materialCategory(){return this.materials.categories.FLOATING_DOCK}}},29642:(e,t,r)=>{const n=r(63768),{$P:i,Polygon:s,Edge:o}=r(62048),{EditableProperty:a}=r(7340),{extend:l}=r(50988),c=r(87991),u=r(32398),d=r(18313),h=r(30691),p=r(6556),m=r(87763),f=r(57129),g=r(16436),y=r(39690),b=r(80892),v=r(7423),_=r(91296);class WatersideFloatingDock extends _{static defaultLength(){return n.unit(30,"ft")}static defaultWidth(){return n.unit(20,"ft")}snapToIncrement(){return n.unit(1,"ft")}minimumSpan(){return n.unit(2,"ft").toNumeric(this.unit())}_defaultFramer(){return new y(this)}_defaultFramingDescriptor(){return new b(this)}defaultDisplayProperties(){return[...super.defaultDisplayProperties(),new a(this,"Extend Float Boards",{type:"boolean"})]}extendFloatBoards(){return this._extendFloatBoards??=!1}toggleExtendFloatBoards(){this.setExtendFloatBoards(!this.extendFloatBoards())}setExtendFloatBoards(e){this._extendFloatBoards=Boolean(e),this.resetFloatBoards()}materialCategory(){return this.materials.categories.FLOATING_DOCK}formatHeight(){return this.project().lengthFormatter().format(this.height())}floatBoards(){return this._floatBoards??=this.dockFramer().makeFloatBoards()}resetFloatBoards(){this._floatBoards=void 0}floatConstraintGeometryFor(e){const t=new m(this),r=i(-e.dimensionAlong(this.mainAxis())/2,-e.dimensionAlong(this.crossAxis())/2);return t.applyOffsetToGeometry(this.geometry(),r)}defaultFramingLevelGeometry(){const e=this.geometry();return new s(e.vertices().map((e=>e.relatedTo(e))))}components(){return[...super.components(),...this.floatBoards()]}resetComponents(){super.resetComponents(),this._floatBoards=void 0}angleChanged(e,t,r){super.angleChanged(e,t,r),this.updateFramingLevelAngles(e,t)}_afterFramingLevelAdded(e){this.updateDockGroup()}_afterFramingLevelRemoved(e){this.updateDockGroup()}componentsMaterialLineItems(){return this.components().filter(this._materialLineItemComponentFilter.bind(this)).flatMap((e=>e.materialLineItems?.()??[]))}_materialLineItemComponentFilter(e){if(!this.dockGroup())return!0;return!this._dockGroupSharedMaterialComponents().includes(e)}_dockGroupSharedMaterialComponents(){return[...this.dockGroupShareableMaterials(),this.surface()]}dockGroupShareableMaterials(){return[...this.floatBoards(),...this.banding()]}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_floatBoards"]}selfMaterialLineItems(){return[new p(this._bandingFastenerQuantity(),this.materials.CARRIAGE_BOLTx4),...this._scabBoardMaterials()]}_bandingFastenerQuantity(){const e=this.banding().sum((e=>e.materialLength().toNumeric(this.unit()))),t=n.unit(2,"ft").toNumeric(this.unit());return 2*(Math.ceil(e/t)+1)}_scabBoardMaterials(){const e=this.materials.purchaseable.PT2x8x24.details().length,t=this.joists().sum((t=>Math.ceil(n.divide(t.materialLength(),e))-1));return p.quantityOfCutLength(t,n.unit(4,"ft"),this.materials.PT2x8)}defaultFigure(){return new u(this)}figureSubModels(){return[...this.framingLevels()]}cornerSnappingTolerance(){return n.unit(1,"ft")}connectionClass(){return g}connectionZLevel(){return this.zLevel()}snappableEdgesForFrame(e){return this.dockStrategy().snappableEdgesForFrame(this,e)}dockStrategy(){return this.componentOf()?.dockStrategy?.()||new v}suggestedFloatBoardEdges(){const e=this.zLevel(),t=this.crossAxis(),r=this.framingDescriptor().floatBoardSpecifier(),n=this.framingDescriptor().materialDepth(r);return this.floats().flatMap((r=>r.floatBoardLinesAlong(t).map((i=>i.stretchedBy(r.dimensionAlong(t)-i.length()).shiftedAlongNormalBy(-n/2).xy().addZ(e)))))}floatBoardEdges(){return h.mergeOverlappingEdges([...this._floatBoardEdgesAcrossDock(),...this._floatBoardEdgesAcrossConnections()])}_floatBoardEdgesAcrossDock(){const e=this.suggestedFloatBoardEdges();if(!(this.dockStrategy().explicitExtendFloatBoardsFor(this)||this.extendFloatBoards()))return e;const t=e.map((e=>this._floatBoardEdgeFor(e)));return h.mergeOverlappingEdges(t)}_floatBoardEdgesAcrossConnections(){const e=this.zLevel(),t=this.framingDescriptor().bandingSpecifier().details().width.toNumeric(this.unit()),r=this.framingDescriptor().floatBoardSpecifier().details().depth.toNumeric(this.unit()),n=[];for(const i of this.sideEdges()){this.connectedDocksAlong(i).filter((e=>this.connectionWith(e).isConnectionSideToSide())).flatMap((e=>e.connectionEdgesOn(i))).forEach((i=>{i.stretchedBy(-(2*t+r)).endpoints().forEach((t=>{const r=t.to(t.add(this.crossAxis())),i=this._floatBoardEdgeFor(r).xy().addZ(e);n.push(i)}))}))}return n}_floatBoardEdgeFor(e){return new o(...this.sideEdges().flatMap((t=>e.intersectionsWithLineIn2D(t))))}floatsChanged(){this.resetFloatBoards(),this.connectedDocks().forEach((e=>e.resetFloatBoards()))}snappingLines(){return[...this._snappingLinesFor(this.sideEdges()),...this._snappingLinesFor(this.endEdges())]}_snappingLinesFor(e){const t=e.first(),r=n.unit(1,"ft").toNumeric(this.unit()),i=e.first().begin().distanceTo(e.last().end()),s=Math.ceil(i/r)+1,o=[];for(let e=0;e<s;e++)o.push(t.shiftedAlongNormalBy(-r*e));return o}}l(WatersideFloatingDock,c),l(WatersideFloatingDock,d),l(WatersideFloatingDock,f),e.exports=WatersideFloatingDock},7423:(e,t,r)=>{const n=r(32216);e.exports=class WatersideFloatingDockStrategy extends n{explicitExtendFloatBoardsFor(e){return!1}}},2029:(e,t,r)=>{const n=r(63768),{EditableProperty:i}=r(7340),{ProportionalEdgeLocator:s}=r(62048),{extend:o}=r(50988),a=r(79851),l=r(20632),c=r(36887),u=r(6556),d=r(67603),h=r(58757),p=r(83277),m=r(84559),f=r(18044),g=r(21890),y=r(18670),b=r(61847),v=r(21065),_=r(80317);class WatersideGangway extends a{static defaultLength(){return n.unit(20,"ft")}static defaultWidth(){return b.defaultWidth()}static lengthRange(){return[n.unit(16,"ft"),n.unit(20,"ft")]}static widthRange(){return[n.unit(3,"ft"),n.unit(8,"ft")]}get descriptor(){return this._defaultFramingDescriptor()}get framer(){return this.componentFramer()}materialCategory(){return this.materials.categories.GANGWAY}fallbackSideDockHeight(){return b.defaultHeightAboveFullPond()}surfaceType(){return v.Wooden}_defaultLength(){return this.constructor.defaultLength()}_defaultWidth(){return this.constructor.defaultWidth()}resetLength(){}resetWidth(){}setLength(e){const t=super.setLength(e);return t&&this.frameResized({fromSetter:!0}),t}minLength(){return this.constructor.lengthRange().first()}maxLength(){return this.constructor.lengthRange().last()}minWidth(){return this.constructor.widthRange().first()}maxWidth(){return this.constructor.widthRange().last()}minimumSpan(e){return this._limitForSpan(e,this.minWidth(),this.minLength())}maximumSpan(e){return this._limitForSpan(e,this.maxWidth(),this.maxLength())}_limitForSpan(e,t,r){return(this.alongMainAxis(e.vector())?t:r).toNumeric(this.unit())}formatLength(){return this.formatDimension(this.length())}formatWidth(){return this.formatDimension(this.width())}validateLength(e,t){return this._validateDimension(t,this.minLength(),this.maxLength(),e)}validateWidth(e,t){return this._validateDimension(t,this.minWidth(),this.maxWidth(),e)}_validateDimension(e,t,r,i){if(i&&(n.smaller(e,t)||n.larger(e,r)))return`Must be between ${this.formatDimension(t)} and ${this.formatDimension(r)}, inclusive.`}angleChanged(e){super.angleChanged(e),this.resetComponents()}includeRailings(){return this._includeRailings??=!1}toggleIncludeRailings(){this.setIncludeRailings(!this.includeRailings())}setIncludeRailings(e){this._includeRailings=Boolean(e),this._resetRailings()}_railingEdges(){if(!this.includeRailings())return[];const e=this.upperFrame()?2:1,t=n.divide(this.descriptor.railingPostInsetFromUpperEdge(),this.length())*e,r=n.divide(this.descriptor.railingPostInsetFromLowerEdge(),this.length());return this.sideEdges().map((e=>{this.mainAxis().dot(e.direction()).isNearTo(-1)&&(e=e.reversed());const n=new s(e,t),i=new s(e,1-r);return n.to(i)}))}railingCollections(){return this._railingCollections??=this._defaultRailingCollections()}_defaultRailingCollections(){return this._railingEdges().map((e=>{const t=new h;return t.setComponentOf(this),t.addRun(t.createRunOn(this,e)),t}))}maxPostSpacing(){return n.divide(this.length(),2)}postMountStyleClassFor(e){return y}railingStyleFor(e){return this.project().railingStyle()}dockHeight(){const e=super.dockHeight(),t=this.descriptor.floatingEndStepHeight();return n.add(e,t)}snapsToCenter(){return!1}snapToIncrement(e){return n.unit(1,"ft")}snapToFramesFilter(){return e=>[_.DOCK,_.EXISTING_DOCK,_.FIXED_BERTH_DOCK].includes(e.role())}offsetWithOverhang(e){return n.subtract(e,n.unit(2,"ft"))}defaultDisplayProperties(){return new d(this,[new i(this,"Length",{type:"unit",defaultUnit:"ft",ignoreIntermediateEdits:!0}),new i(this,"Width",{type:"unit",defaultUnit:"ft",ignoreIntermediateEdits:!0}),new i(this,"Include Railings",{type:"boolean"}),...this.accumulatedDisplayProperties()])}selfMaterialLineItems(){return[this._lowerConnectionKit(),this._upperConnectionKit()].filter(Boolean)}_lowerConnectionKit(){return this.lowerFrame()?new u(1,this.materials.GANGWAY_LOWER_DOCK_CONNECTION_KIT):void 0}_upperConnectionKit(){return this.upperFrame()?new u(1,this.materials.GANGWAY_UPPER_DOCK_CONNECTION_KIT):new u(1,this.materials.GANGWAY_UPPER_SHORE_CONNECTION_KIT)}components(){return[...this.accumulatedComponents(),this.surface(),...this.crossSupports(),...this.headers(),...this.joists(),...this.railingCollections()].filter(Boolean)}crossSupports(){return this._crossSupports??=this.framer.makeCrossSupports()}headers(){return this._headers??=this.framer.makeHeaders()}joists(){return this._joists??=this.framer.makeJoists()}frameResized({fromSetter:e=!1}={}){e?super.frameResized():this.updateDisplayProperties(),this._resetSubFrameComponents(),this._resetRailings()}resizingFinished(){this.frameResized({fromSetter:!0})}resetComponents(){this.resetAccumulatedComponents(),this.surface().resetComponents(),this._resetSubFrameComponents(),this._resetRailings()}_resetSubFrameComponents(){this._crossSupports=void 0,this._headers=void 0,this._joists=void 0}_resetRailings(){this._railingCollections=void 0}delete(){this._stopObserving(),super.delete()}setComponentOf(e){e||this._stopObserving(),super.setComponentOf(e),this._startObserving()}postRestorationAction(){super.postRestorationAction(),this._startObserving()}_startObserving(){this.addFrameAttachmentChangedObserver(this,this.onFrameAttachmentChanged),this.project()?.addRailingStyleChangedObserver(this,this.onRailingStyleChanged)}_stopObserving(){this.project()?.removeRailingStyleChangedObserver(this),this.removeFrameAttachmentChangedObserver(this)}onFrameAttachmentChanged(){this.resetComponents()}onRailingStyleChanged(){this._resetRailings()}nonEssentialProperties(){return[...super.nonEssentialProperties(),...this.accumulatedNonEssentialProperties(),"_crossSupports","_headers","_joists","_railingCollections"]}includeSkirtBoards(){return!1}surface(){return this._surface??=this._defaultSurface()}_defaultSurface(){return new g(this)}defaultFigure(){return new p(this)}deckingOptionProvider(){return this.project().deckingOptionProvider()}deckingOption(){return this.deckingOptionProvider().deckingOption()}deckingShape(){return this.geometry()}_defaultFramer(){return new m(this)}_defaultFramingDescriptor(){return new f(this)}}o(WatersideGangway,l),o(WatersideGangway,c),e.exports=WatersideGangway},21890:(e,t,r)=>{const{$P:n}=r(62048),i=r(96797),s=r(83465);e.exports=class WatersideGangwaySurface extends i{gangway(){return this.frame()}deckingEdges(){const e=this.gangway(),t=e.lowerEdge().movedByDelta(e.mainAxis().multipliedBy(this._floatingEndKickBoardWidth())),r=e.upperEdge();return[r.end().to(t.begin()),t.end().to(r.begin())].map((t=>t.relativeTo(e.referencePoint())))}_floatingEndKickBoardSpecifier(){return this.gangway().descriptor.floatingEndKickBoardSpecifier()}_floatingEndKickBoardDepth(){return this.gangway().descriptor.materialDepth(this._floatingEndKickBoardSpecifier())}_floatingEndKickBoardWidth(){return this.gangway().descriptor.materialWidth(this._floatingEndKickBoardSpecifier())}floatingEndKickBoard(){return this._floatingEndKickBoard??=this._defaultFloatingEndKickBoard()}_defaultFloatingEndKickBoard(){const e=this.gangway(),t=e.lowerEdge(),r=this._floatingEndKickBoardDepth()/2,i=this._floatingEndKickBoardWidth()/2,o=n(r+2*i,i),a=new s(t.begin(),t.end(),this._floatingEndKickBoardSpecifier(),o,e.mainAxis());return a.setComponentOf(this),a}components(){return[...super.components(),this.floatingEndKickBoard()]}resetComponents(){super.resetComponents(),this._floatingEndKickBoard=void 0}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_floatingEndKickBoard"]}}},10104:(e,t,r)=>{const n=r(63768),{extend:i}=r(50988),s=r(7568),o=r(65773),a=r(6556),l=r(18934),c=r(73835),u=r(76360),d=r(50948),h=r(62311),p=r(31908),m=r(46748);let f;class WatersideHipRoof extends o{static framingType(){return"Hip roof"}_defaultFramer(){return new h(this)}_defaultFramingDescriptor(){return new d(this)}pitchBaseGeometry(){return this.overhangEdgeGeometry()}crossTies(){return this._crossTies??=this.framer.makeCrossTies()}boatLiftSupports(){return this._boatLiftSupports??=this.framer.makeBoatLiftSupports()}components(){return[...super.components(),...this.crossTies(),...this.boatLiftSupports()]}resetComponents(){super.resetComponents(),this._crossTies=void 0,this._boatLiftSupports=void 0}selfMaterialLineItems(){return[...super.selfMaterialLineItems(),this._dripEdgeLineItem(),this._ridgeCapLineItem(),this._screwFastenerBagLineItem(),...this._windBracingHardwareLineItems(),...this._bandingHardware(),...this._roofingPanelLineItems(),...this._crossTieHardwareLineItems(),...this._boatLiftSupportHardwareLineItems()]}componentsMaterialLineItems(){return this.components().filter((e=>!this.roofing().includes(e))).flatMap((e=>e.materialLineItems?.()??[]))}_dripEdgeLineItem(){const e=this.materials.DRIP_EDGE,t=e.details().length.toNumeric(this.unit()),r=this.overhangEdgeGeometry().perimeter();return new a(Math.ceil(r/t),e)}_ridgeCapLineItem(){const e=this.rafters().find((e=>e.role()===c.roles.HIP)).materialLength(),t=this.ridge()?.length()||n.unit(0,"ft"),r=m`${t} + 4 * ${e}`,i=this.materials.RIDGE_CAP,s=i.details().length;return new a(Math.ceil(n.divide(r,s)),i)}_screwFastenerBagLineItem(){const e=this.materials.ROOF_SCREW_FASTENERS,t=n.unit(this.surfaceArea(),"in^2");return new a(Math.ceil(n.divide(t,this.descriptor.roofingAreaPerScrewFastenerBag())),e)}_windBracingHardwareLineItems(){const e=this.windBracing().length;if(0===e)return[];const t=this.materials.purchaseable,r=["GALVANIZED_CARRIAGE_BOLTx12","GALVANIZED_FLAT_WASHER","GALVANIZED_HEX_NUT"].map((r=>{const n=t[r];return new a(e,n)}));return r.push(new a(2*e,t.GALVANIZED_LAG_BOLT)),r}_bandingHardware(){f||(f=r(62887));const e=this.foundation(),t=e.posts().filter((e=>this.geometry().containsPoint(e.locator())&&e.role()===f.roles.ROOF));if(0===t.length)return[];const n=e.postRows(t,e.mainAxis()),i=e.postRows(t,e.crossAxis()),s=2*(n.first().length+n.last().length+i.first().length+i.last().length);return[new a(s,this.materials.purchaseable.GALVANIZED_CARRIAGE_BOLTx12),new a(s,this.materials.purchaseable.GALVANIZED_FLAT_WASHER),new a(s,this.materials.purchaseable.GALVANIZED_HEX_NUT)]}_roofingPanelLineItems(){return[...this._commonAreaRoofingPanelLineItems(),...this._sideJackAreaRoofingPanelLineItems(),...this._endJackAreaRoofingPanelLineItems()]}_commonAreaRoofingPanelLineItems(){const e=n.unit(this._pitchedWidthNumeric(),this.unit());return[this._roofingPanelLineItem(e,this._commonAreaPanelCount())]}_sideJackAreaRoofingPanelLineItems(){const e=this.geometryWidth(),t=this.geometryLength(),r=this._panelWidthNumeric(),n=(t-e)/2,i=this._commonAreaPanelCount()/4*r-n,s=this._pitchedWidthNumeric()-i;return this._jackAreaRoofingPanelLineItems(s)}_endJackAreaRoofingPanelLineItems(){return this._jackAreaRoofingPanelLineItems(this._pitchedWidthNumeric())}_commonAreaPanelCount(){const e=this.geometryWidth(),t=this.geometryLength()-e;return 2*(2*Math.ceil(t/2/this._panelWidthNumeric()))}_panelWidthNumeric(){return this.roofingMaterial().details().width.toNumeric(this.unit())}_pitchedWidthNumeric(){return this.geometryWidth()/2/Math.cos(this.pitchAngle())}_jackAreaRoofingPanelLineItems(e,t=4){const r=this._panelWidthNumeric(),i=Math.ceil(e/r),s=n.unit(r-1,this.unit()),o=[];for(let a=0;a<i;a++){const i=n.unit(e-r*a,this.unit());n.smaller(i,s)||o.push(this._roofingPanelLineItem(i,t))}return o}_roofingPanelLineItem(e,t=1){const r=this.roofingMaterial(),i=r.specifierFor(`${Math.ceil(e.toNumeric("in"))}" long x ${r.name()}`,{length:e}),o=n.unit(Math.ceil(e.toNumeric("ft")),"ft");return new s(t,i,e,{purchaseLength:o})}_crossTieHardwareLineItems(){if(0===this.crossTies().length)return[];const e=2*this.crossTies().length;return[new a(e,this.materials.purchaseable.GALVANIZED_CARRIAGE_BOLTx12),new a(e,this.materials.purchaseable.GALVANIZED_FLAT_WASHER),new a(e,this.materials.purchaseable.GALVANIZED_HEX_NUT)]}_boatLiftSupportHardwareLineItems(){if(0===this.boatLiftSupports().length)return[];const e=2*(this.crossTies().length/2+4);return[new a(e,this.materials.purchaseable.GALVANIZED_CARRIAGE_BOLTx10),new a(e,this.materials.purchaseable.GALVANIZED_FLAT_WASHER),new a(e,this.materials.purchaseable.GALVANIZED_HEX_NUT)]}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_crossTies","_boatLiftSupports"]}}i(WatersideHipRoof,p),i(WatersideHipRoof,u),i(WatersideHipRoof,l),e.exports=WatersideHipRoof},61847:(e,t,r)=>{const n=r(63768),i=r(44548);e.exports=class WatersidePier extends i{static displayName(){return"Pier"}static iconName(){return"stick-pier"}static defaultLength(){return n.unit(80,"ft")}static defaultWidth(){return n.unit(4,"ft")}}},62887:(e,t,r)=>{const n=r(63768),{extend:i}=r(50988),s=r(10765),o=r(42638),a=r(6556),l=r(9343),c=r(43275),u=r(69399),d=r(46748),h=r(8125);class WatersidePile extends s{static get roles(){return Object.fromEntries(Object.keys(WatersidePile.#d).map((e=>[e,e])))}static#h=n.unit(1,"ft");static#d=(()=>{const e=WatersidePile.#h;return{ROOF:n.add(e,u.defaultHeight()),RAILING:n.add(e,c.heightAboveDecking()),PERIMETER:n.add(e,n.unit(16,"in")),INTERIOR:e}})();static#p=(()=>Object.keys(WatersidePile.roles).reduce(((e,t)=>{var r;return e[t]=(r=t,e=>WatersidePile._heightAboveFullPondFor(e,r)),e}),{}))();static _heightAboveFullPondFor(e,t){const r=WatersidePile.#d[t];let i,s;return t===this.roles.ROOF?(s=e.edgeLocator(),i=e.componentOf?.().framingLevels?.().find((e=>e.roof().geometry().containsPoint(s))),i?n.add(WatersidePile.#h,i.height()):r):r}constructor(e,t,r){super(e,void 0,t),this._role=r}deckingOption(){return this.project().deckingOptionProvider().deckingOption()}role(){return this._role}isExisting(){return!1}selfMaterialLineItems(){const e=this.materials.purchaseable;return[new a(this.height(),this.materialSpecifier()),new a(2,e.GALVANIZED_CARRIAGE_BOLTx14),new a(2,e.GALVANIZED_FLAT_WASHER),new a(2,e.GALVANIZED_HEX_NUT),...this._pileCapMaterials()]}_pileCapMaterials(){if(!this.project().includePileCaps())return[];const e=this.constructor.roles;return e.INTERIOR===this.role()||e.ROOF===this.role()?[]:[new a(1,this.materials.PILE_CAP)]}locator(){return this.edgeLocator().addZ(-this.installedHeightAboveDecking().toNumeric(this.unit()))}installedHeightAboveDecking(){const e=this.constructor.roles;if(this.role()===e.INTERIOR)return n.unit(0,"ft");const t=this.deckingOption().materialSpecifier().details().width,r=d`${WatersidePile.#h} - ${t}`;return d`${this._heightAboveFullPond()} - ${r}`}height(){const e=this.penetrationDepth(),t=this._waterDepthService().waterDepthAt(this.locator()),r=this._heightAboveFullPond(),n=this._penetrationDepthSafetyFactor();return d`${e} + ${t} + ${r} + ${n}`}_heightAboveFullPond(){return WatersidePile.#p[this.role()](this)}_penetrationDepthSafetyFactor(){return n.unit(1,"ft")}penetrationDepth(){return this.project().pilePenetration()}_waterDepthService(){return this.project().waterDepthService()}defaultAnnotations(){return[this.lengthAnnotation()]}lengthAnnotation(){const e=this.locator(),t=this.formatDimension(this.purchaseLength()),r=new l(t,e.add(0,30).relatedTo(e),e,{adjustLocationForZoomLevel:!1});return r.setLayer(h.PILE_LENGTH_ANNOTATIONS),r}purchaseLength(){const e=this.height(),t=this.materialSpecifier().details().purchaseLengthSpecifiers.find((t=>n.largerEq(t.details().length,e)));return t?.details().length??e}}i(WatersidePile,o),e.exports=WatersidePile},69399:(e,t,r)=>{const n=r(63768),i=r(88548),s=r(61782),o=r(58405),a=r(10104),l=r(80317);e.exports=class WatersideRoofingLevel extends i{static defaultHeight(){return n.unit(9.5,"ft")}static _baseGeometryFrom(e){return e.boundingShape()}static _defaultFramingLevelGeometry(e){return e.defaultFramingLevelGeometry?.()??super._defaultFramingLevelGeometry(e)}_framingClasses(){return[a]}_substructureClass(){return this.foundation().role()===l.FLOATING_DOCK||this.foundation().role()===l.FLOATING_BERTH_DOCK?o:s}materialCategory(){return this.materials.categories.ROOF}}},86606:(e,t,r)=>{const n=r(62887);class WatersideSharedPile extends n{static preferredRoleFor(e){return e.findSmallest((e=>e.locator().z())).role()}constructor(e,t,r){super(e,t,WatersideSharedPile.preferredRoleFor(r)),this._referencePosts=r}referencePosts(){return this._referencePosts}}e.exports=WatersideSharedPile},98045:(e,t,r)=>{const n=r(13303);class WatersideBerthDockBuilder{constructor(e,t){this._componentClass=t}build(){return new(0,this._componentClass)(this._referencePoint,this._angle)}}n(WatersideBerthDockBuilder,["referencePoint","angle"]),e.exports=WatersideBerthDockBuilder},12992:(e,t,r)=>{const{$P:n}=r(62048),i=r(37528),s=r(30691),o=r(82422);e.exports=class WatersideDockFramer extends i{makeOutsideJoists(){return this.framingEdgePairs().flatMap((({edges:e})=>{const[t,r]=e,i=[t.begin().to(r.end()),r.begin().to(t.end())],s=this.offsetHelper().applyOffsetToEdges(i,this.framingDescriptor().outsideJoistOffset()),o=this.joistSpecifier(),a=this.materialDepth(o)/2,l=this.materialWidth(o)/2;return this._subtractConnectionsFrom(s).map((e=>this._makeJoist(e,o,n(-a,l))))}))}_makeJoist(e,t,r,n){const i=this._adjustJoistEdgeForConnectedDocks(e);return super._makeJoist(i,t,r,n)}_adjustJoistEdgeForConnectedDocks(e){const t=e.snapshot(),r=this.materialWidth(this.postSpecifier())/2;return t.endpoints().forEach((n=>{if(this._isConnectedToPerpendicularDock(n)){const i=(t.begin()===n?e.direction().negated():e.direction()).multipliedBy(r);n.moveBy(i.x(),i.y())}})),t}_isConnectedToPerpendicularDock(e){return this.dock().connections().some((t=>t.geometry().containsPoint(e)&&this.dock().isPerpendicularTo(t.otherDock(this.dock()))))}makeHeaders(){const e=this.dock().postRows(),t=e.first(),r=e.last(),n=[];for(let e=0;e<t.length-1;e++)n.push([t[e].locator().to(t[e+1].locator()).xy().addZ(this.dock().zLevel()),r[e].locator().to(r[e+1].locator()).xy().addZ(this.dock().zLevel())]);return n.flatMap((e=>this.makeHeadersForEdgePair(e)))}makeHeadersForEdgePair(e){const t=this.materialDepth(this.headerSpecifier())/2,r=this.offsetHelper().applyOffsetToEdges(e,this.headerOffset());return this._subtractConnectionsFrom(r).map((e=>this._makeHeader(e,this.headerSpecifier(),n(-t,0))))}makeSplitPileCaps(){const e=this.dock(),t=e.postRows(),r=this.splitPileCapSpecifier(),n=e.geometry();return t.flatMap((e=>{const t=e.first().locator().to(e.last().locator());return this._makeEdgesForPostSupports(t,r,this.splitPileCapOffset(),e.first().materialSpecifier()).filter((e=>n.containsPoint(e.center()))).map((e=>this._makeSplitPileCap(e,r)))}))}makePosts(){return this.postLayoutHelper().makePosts()}postLayoutHelper(){return new o(this.dock())}_subtractConnectionsFrom(e){const t=this.materialWidth(this.postSpecifier());return e.flatMap((e=>s.subtractSegmentsFromEdge(e,this.dock().connectionEdgesOn(e).map((e=>e.stretchedBy(t))))))}}},92526:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),s=r(95369);e.exports=class WatersideDockFramingDescriptor extends s{postSpecifier(){return this.materials.PT8x8}framingLevelSupportPostSpecifier(){return this.postSpecifier()}joistSpecifier(){return this.materials.PT2x8}headerSpecifier(){return this.materials.PT2x8}splitPileCapSpecifier(){return this.materials.PT2x10}crossBracingSpecifier(){return this.materials.PT2x6}maxPostSpacing(){return this.dock().maxPostSpacing()}maxJoistSpacing(){return n.unit(16,"in")}shouldDoubleEndJoists(){return!1}_postCornerInsetFromEdge(){return-this.materialWidth(this.postSpecifier())/2}fullPostOffset(){const e=this.halfPostWidth();return this.postOffset().add(-e,-e)}halfPostWidth(){return this.materialWidth(this.postSpecifier())/2}joistOffset(){return i(this._joistEndOffset(),-this.materialWidth(this.postSpecifier())/2,this._joistZOffset())}_joistEndOffset(){return 0}headerOffset(){return i(this.joistOffset().x()-this.materialWidth(this.headerSpecifier())/2,this.joistOffset().y(),this._headerZOffset())}_splitPileCapLateralOffset(){return n.unit(2,"in").toNumeric(this.dock().unit())}outsideJoistOffset(){return i(-this.materialWidth(this.postSpecifier())/2,0,this._joistZOffset())}}},81664:(e,t,r)=>{const n=r(61447);e.exports=class WatersideFixedDockToRoofSubstructureDescriptor extends n{dock(){return this.frame().foundation()}postSpecifier(){return this.dock().framingDescriptor().postSpecifier()}windBracingSpecifier(){return this.materials.WIND_BRACING_8x8}boatLiftSupportSpecifier(){return this.materials.LVL}}},33855:(e,t,r)=>{const n=r(63768),i=r(61447);e.exports=class WatersideFloatToRoofSubstructureDescriptor extends i{maxPostSpacing(){return n.unit(10,"ft")}postSpecifier(){return this.materials.PT6x6}windBracingSpecifier(){return this.materials.WIND_BRACING_6x6}boatLiftSupportSpecifier(){return this.materials.PT2x10}}},84475:(e,t,r)=>{const{$P:n}=r(62048),i=r(73399),s=r(80317),{equallySpacedLocators:o}=r(68606);e.exports=class WatersideFloatToRoofSubstructureFramer extends i{makePosts(){const e=this._framingLevel().foundation(),t=this.descriptor.maxPostSpacing().toNumeric(this._unit()),r=this._postEdges().flatMap((e=>o(e.begin(),e.end(),t))),i=this.descriptor.postSpecifier(),s=e.floatZLevel(),a=e.zLevel()-this._framingLevel().height().toNumeric(this._unit()),l=r.map((e=>{const t=e.addZ(s).to(e.addZ(a));return this._makeBoard(t,i,n(0,0),this._framingLevel().mainAxis())}));return this.frame().link(l)}_postEdges(){const e=this._framingLevel().foundation(),t=this._framingLevel().geometry().xy();return e.role()===s.FLOATING_BERTH_DOCK?e.fingerDocks().flatMap((e=>t.xy().intersection(e.geometry().xy()))).flatMap((e=>this._insetPostShape(e).edges())):this._insetPostShape(t).edges()}_insetPostShape(e){const t=this.descriptor.postSpecifier(),r=this._framingLevel().framing().framingDescriptor().bandingSpecifier(),i=this.descriptor.materialWidth(r)+this.descriptor.materialWidth(t)/2,s=n(-i,-i);return this.offsetHelper().applyOffsetToGeometry(e,s)}_framingLevel(){return this.frame().framingLevel()}}},39690:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),s=r(6559),o=r(1997),a=r(15411);e.exports=class WatersideFloatingDockFramer extends s{makeFloatBoards(){const e=this.descriptor.floatBoardSpecifier(),t=this.descriptor.materialWidth(e);return this._floatBoardEdges().map((r=>this._makeBoard(r,e,i(0,t/2),i(0,0,1))))}_floatMaterialForWidth(e){return this.materials[`FLOAT${e.toNumeric("ft").rounded()}x4x18`]}_floatWidths(e){const t=this._evenlyDivisibleFloatWidthsFor(e,n.unit(6,"ft"))??this._evenlyDivisibleFloatWidthsFor(e,n.unit(4,"ft"));if(t)return t;const r=this.materials.floats.map((e=>e.details().width)).uniqueValues();return a(e,r,this.dock().unit())}_evenlyDivisibleFloatWidthsFor(e,t){const r=n.divide(e,t).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES);if(Number.isInteger(r))return Array(r).fill(t)}_floatClass(){return o}floatZOffset(){return super.floatZOffset()+this.descriptor.materialWidth(this.descriptor.floatBoardSpecifier())}_floatBoardEdges(){const e=this.dock().floatBoardEdges();return this.offsetHelper().applyOffsetToEdges(e,this.descriptor.floatBoardOffset())}}},80892:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),{MaterialSpecifier:s}=r(93613),o=r(83007);e.exports=class WatersideFloatingDockFramingDescriptor extends o{joistSpecifier(){return this.materials.PT2x8}headerSpecifier(){return this.materials.PT2x8}bandingSpecifier(){return this.materials.PT2x10}floatBoardSpecifier(){return this.materials.PT2x6}floatBoardOffset(){return i(0,0,this.baseZOffset()+this.materialDepth(this.joistSpecifier()))}framingLevelSupportPostSpecifier(){return new s("FramingLevelSupportPost","FramingLevelSupportPost",{width:n.unit(0,"in")})}}},84559:(e,t,r)=>{const{$P:n}=r(62048),i=r(37528);e.exports=class WatersideGangwayFramer extends i{gangway(){return this.frame()}makeCrossSupports(){const e=this.descriptor.crossSupportSpecifier(),t=this.materialDepth(e)/2,r=this.materialWidth(e)/2,i=n(t,r),s=this.gangway();return[s.lowerEdge(),this._centerCrossEdge(),s.upperEdge()].map((e=>this._makeCrossSupport(e,i)))}_centerCrossEdge(){const e=this.framingSideEdges();return e.first().center().to(e.last().center()).relativeTo(this.gangway().referencePoint())}_makeCrossSupport(e,t){const r=this.descriptor.crossSupportSpecifier(),n=this.descriptor.deckThickness()+this.materialDepth(this.descriptor.joistSpecifier());return this._makeBoard(e.addZ(n),r,t,this.gangway().geometry().normal())}_makeHeader(e,t,r,n){if(n)return super._makeHeader(...arguments);const i=this.gangway().mainAxis();return n=e.direction().equals(this.gangway().crossAxis())?i:i.negated(),super._makeHeader(e,t,r,n)}}},18044:(e,t,r)=>{const n=r(63768),i=r(95369);e.exports=class WatersideGangwayFramingDescriptor extends i{gangway(){return this.frame()}floatingEndKickBoardSpecifier(){return this.deckingOptionProvider().deckingOption().materialSpecifier()}floatingEndStepHeight(){return this.floatingEndKickBoardSpecifier().details().depth}crossSupportSpecifier(){return this.materials.PT2x6}headerSpecifier(){return this.materials.PT2x10}joistSpecifier(){return this.materials.PT2x10}postSpecifier(){return this.materials.PT8x8}maxJoistSpacing(){return n.unit(16,"in")}maxPostSpacing(){return this.gangway().maxPostSpacing()}shouldDoubleEndJoists(){return!1}railingPostInsetFromLowerEdge(){return n.unit(2,"ft")}railingPostInsetFromUpperEdge(){return n.divide(this.postSpecifier().details().width,2)}}},50948:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),s=r(48151),o=r(73835),a=r(83465),l=r(46748);e.exports=class WatersideHipRoofFramingDescriptor extends s{defaultPitchChoiceIndex(){return 4}minimumRidgeLength(){return n.unit(12,"in")}overhang(){return n.unit(6,"in")}rafterSpacing(){return n.unit(16,"in")}strippingSpacing(){return n.unit(24,"in")}minBracingSpan(){return n.unit(6,"ft")}bracingLength(){return n.unit(4,"ft")}hasFlashing(){return!0}hasSheathing(){return!1}hasStripping(){return!0}hasWindBracing(){return!0}hasJoists(){return!1}hasBanding(){return!0}hasPostTopPlates(){return!0}rafterSpecifier(e){return e===o.roles.HIP?this.materials.SYP2x8:this.materials.SYP2x6}ridgeSpecifier(){return this.materials.SYP2x8}flashingSpecifier(){return this.materials.FASCIA_BOARD}roofingSpecifier(){return this.roof().roofingMaterial()}sheathingSpecifier(){return this.materials.T_AND_G_SHEATHING}bandingSpecifier(){return this.materials.PT2x10}crossTieSpecifier(){return this.materials.PT2x10}crossTieMaterialClass(){return a}boatLiftSupportSpecifier(){return this.frame().framingLevel().substructure().framingDescriptor().boatLiftSupportSpecifier()}boatLiftSupportMaterialClass(){return a}postTopPlateSpecifier(){return this.materials.PT2x8}strippingSpecifier(){return this.materials.PT2x4}windBracingSpecifier(){return this.frame().framingLevel().substructure().framingDescriptor().windBracingSpecifier()}defaultMaterialSpecifier(){return this.materials.PT2x6}roofingMaterialChoices(){return[this._makeRoofingMaterialChoice("Metal",this.materials.TUFF_RIB_METAL_ROOFING)]}flashingOffset(){const e=this.materialWidth(this.flashingSpecifier()),t=this.materialDepth(this.flashingSpecifier())/2,r=e*this.frame().pitch(),n=this.materialWidth(this.strippingSpecifier())/Math.cos(this.frame().pitchAngle());return i(e/2,e/2,t+r-n)}bandingOffset(){const e=this.materialWidth(this.bandingSpecifier());return i(2*-e,2*-e)}bandingCount(){return 2}normalOffsetToRoofingSurface(){return super.normalOffsetToRoofingSurface()+this.materialWidth(this.strippingSpecifier())}roofingOverhangPastRafters(){return n.unit(1.5,"in")}shouldHaveCollarTieAt(e,t){return e%2==0}overhangHeightAboveFramingLevel(){const e=this.roof(),t=this.overhang(),r=this.bandingSpecifier().details().width,n=this.rafterSpecifier().details().depth;return l`${n} / ${Math.cos(e.pitchAngle())} - (${t} + ${r} * 2) * ${e.pitch()}`}roofingAreaPerScrewFastenerBag(){return n.unit(200,"sqft")}}},62311:(e,t,r)=>{const{$P:n,Edge:i}=r(62048),s=r(36882),o=r(80317);e.exports=class WatersideHipRoofWoodenFramer extends s{substructure(){return this.frame().framingLevel().substructure()}makeCrossTies(){if(!this._onBerthDock())return[];const e=this.descriptor.crossTieSpecifier(),t=this.descriptor.materialDepth(e),r=this.descriptor.crossTieMaterialClass();return this._crossTieEdges().map((i=>this._createMaterial(r,i,e,n(t/2,0))))}makeBoatLiftSupports(){if(!this._onBerthDock())return[];const e=this.descriptor.boatLiftSupportSpecifier(),t=this.descriptor.materialDepth(e),r=this.descriptor.boatLiftSupportMaterialClass();return this._boatLiftSupportEdges().map((i=>this._createMaterial(r,i,e,n(t/2,0))))}_crossTieEdges(){const e=this.descriptor,t=this.roof().foundation(),r=this._roofPiles(),n=this._postWidth(),i=this._roofBaseZLevel(),s=e.materialWidth(e.crossTieSpecifier()),o=e.materialWidth(e.boatLiftSupportSpecifier()),a=this._insideBandingEdgeAlong(t.mainAxis()),l=t.fingerDocks().flatMap((e=>{const t=this._interiorPostRowEdgeFor(e,2*o-n/2);if(!t)return[];const s=this._outwardDirectionFor(e),l=[a.findLargest((e=>e.begin().dot(s))),t],c=r.filter((t=>e.geometry().containsPoint(t.locator())));return this.substructure().postRows(c).slice(1,-1).map((e=>{const t=e.first().locator().to(e.last().locator());return this._edgeAtLineBetween(l,t).xy().addZ(i).relativeTo(this.roof().referencePoint())}))})),c=(n+s)/2;return l.flatMap((e=>[e.shiftedAlongNormalBy(c),e.shiftedAlongNormalBy(-c)]))}_fingerDockPostGroups(){if(!this._onBerthDock())return[];const e=this.roof().foundation(),t=this._roofPiles();return e.fingerDocks().map((e=>t.filter((t=>e.geometry().containsPoint(t.locator())))))}_boatLiftSupportEdges(){const e=this._roofBaseZLevel(),t=this._postWidth(),r=this.descriptor,n=r.materialWidth(r.boatLiftSupportSpecifier()),i=this.roof().foundation(),s=i.fingerDocks().flatMap((e=>{const r=this._interiorPostRowEdgeFor(e,-t/2);return r?[r.shiftedAlongNormalBy(.5*-n),r.shiftedAlongNormalBy(1.5*-n)]:[]})),o=this._insideBandingEdgeAlong(i.crossAxis());return s.map((t=>this._edgeAtLineBetween(o,t).xy().addZ(e).relativeTo(this.roof().referencePoint())))}_interiorPostRowEdgeFor(e,t){const r=this._roofPiles().filter((t=>e.geometry().containsPoint(t.locator())));if(0===r.length)return;const n=this._outwardDirectionFor(e),i=this.substructure().postRows(r,n).first();return i.first().locator().to(i.last().locator()).movedByDelta(n.multipliedBy(t))}_outwardDirectionFor(e){const t=this.roof().foundation().locator(),r=this.roof().foundation().crossAxis();return r.multipliedBy(e.locator().subtract(t).dot(r)).normalized()}_edgeAtLineBetween(e,t){return new i(...e.flatMap((e=>e.intersectionsWithLineIn2D(t))))}_insideBandingEdgeAlong(e){const t=this.roof().baseGeometry().edges().filter((t=>Math.abs(t.direction().dot(e)).isNearTo(1)));return this.offsetHelper().applyOffsetToEdges(t,this.descriptor.bandingOffset())}_onBerthDock(){return[o.FIXED_BERTH_DOCK,o.FLOATING_BERTH_DOCK].includes(this.roof().foundation().role())}_postWidth(){const e=this.roof().framingLevel().substructure().framingDescriptor().postSpecifier();return this.descriptor.materialWidth(e)}_roofBaseZLevel(){return this.roof().framingLevel().geometry().zLevel()}}},82422:(e,t,r)=>{const{NormalToEdgeLocator:n,ProportionalEdgeLocator:i}=r(62048),{extend:s}=r(50988),o=r(80365),a=r(87763),l=r(30326),c=r(62887),u=r(24242);class WatersidePostLayoutHelper{constructor(e){this._dock=e}dock(){return this._dock}framingDescriptor(){return this.dock().framingDescriptor()}_unit(){return this.dock().unit()}offsetHelper(){return this._offsetHelper??=new a(this.dock())}makePosts(){const e=this.dock();return this.postLocations().map((t=>{const r=this._makePost(t);return r.setComponentOf(e),r}))}_makePost(e){const t=this._shouldSharePost(e)?l:c,r=this._postRoleAt(e);return new t(e,this.framingDescriptor().postSpecifier(),r)}_postRoleAt(e){return this.interiorRoleRequiredForPileAt(e)?c.roles.INTERIOR:this.roofRoleRequiredForPileAt(e)?c.roles.ROOF:this.railingRoleRequiredForPileAt(e)?c.roles.RAILING:this.perimeterRoleRequiredForPileAt(e)?c.roles.PERIMETER:c.roles.INTERIOR}roofRoleRequiredForPileAt(e){return this.dock().dockStrategy().roofRoleRequiredForPileAt(e,this.dock())}_framingLevels(){return this.dock().framingLevelsOverhead()}railingRoleRequiredForPileAt(e){return this._railingEdges().some((t=>t.xy().containsPoint(e.xy())))}_railingEdges(){return this.__railingEdges??=this.dock().railingEdges()}perimeterRoleRequiredForPileAt(e){const t=this.dock().edges().some((t=>t.xy().containsPoint(e.xy()))),r=this.dock().connections().some((t=>t.geometry().containsPoint(e)&&!t.geometry().intersects(e.x(),e.y())));return t&&!r}interiorRoleRequiredForPileAt(e){return this._isAtGangwayAttachment(e)||this.dock().dockStrategy().interiorRoleRequiredForPileAt(e,this.dock())}_isAtGangwayAttachment(e){const t=e.xy();return!this.dock().geometry().xy().vertices().find((e=>t.equals(e)))&&Boolean(this.dock().gangwayAttachmentEdges().find((e=>e.xy().containsPoint(t))))}_shouldSharePost(e){return this.dock().connections().some((t=>t.geometry().containsPoint(e)))}postLocations(){const e=this.crossAxisLines();return this.mainAxisLines().flatMap((t=>e.flatMap((e=>{const r=t.intersectionsWithLineIn2D(e).first();return r&&t.containsPointOnLine(r)?t.closestRelativePointTo(r):[]}))))}mainAxisLines(){return this._linesBetweenEdges(this.dock().sideEdges())}crossAxisLines(){return this._linesBetweenEdges(this.dock().endEdges())}_linesBetweenEdges(e){const t=this.offsetHelper().applyOffsetToEdges(e,this.framingDescriptor().fullPostOffset()),r=t.first(),s=r.direction(),o=r.end().subtract(r.begin()).dot(s).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES),a=this.dock().proposedPileDistancesFor(t).filter((e=>e>0&&e<o)),l=this.framingDescriptor().maxPostSpacing().toNumeric(this._unit()),c=new u(0,o,l).distances(a),d=new i(t.first(),0),h=new i(t.last(),1);return c.map((e=>new n(d,0,e).to(new n(h,0,-e))))}}s(WatersidePostLayoutHelper,o),e.exports=WatersidePostLayoutHelper},24242:e=>{class WatersideSpanHelper{constructor(e,t,r){this._begin=e,this._end=t,this._maxSpacing=r}begin(){return this._begin}end(){return this._end}maxSpacing(){return this._maxSpacing}span(){return this.end()-this.begin()}requiredSlotCount(){return this.spacingCount()+1}spacingCount(){return Math.ceil(this.span()/this.maxSpacing())}evenSpacing(){return this.span()/this.spacingCount()}spacing(){return this.evenSpacing()}split(e){return[new WatersideSpanHelper(this.begin(),e,this.maxSpacing()),new WatersideSpanHelper(e,this.end(),this.maxSpacing())]}distances(e=[]){let t,r;const n=e=>{t=e,r=0},i=[];for(n(this),r++;r<t.spacingCount();r++){const s=t.alternateDistanceTo(r,e);if(s){const[e,r]=t.split(s);i.push(e),n(r)}}return i.push(t),i.flatMap((e=>e.defaultDistances())).uniqueValues()}defaultDistances(){const e=this.requiredSlotCount(),t=[];for(let r=0;r<e;r++)t.push(this.distanceTo(r));return t}distanceTo(e){return this.begin()+this.spacing()*e}alternateDistanceTo(e,t){const r=this.distanceTo(e);return t.filter((e=>this._proposedDistanceFilter(e,r))).findSmallest((e=>Math.abs(e-r)))}_proposedDistanceFilter(e,t){return this._haveEqualSlotCounts(e,t)}_haveEqualSlotCounts(e,t){const r=this.split(e).map((e=>e.requiredSlotCount())),n=this.split(t).map((e=>e.requiredSlotCount()));return r.length===n.length&&r.every(((e,t)=>n[t]===e))}}e.exports=WatersideSpanHelper},88846:(e,t,r)=>{const n=r(5090),i=r(36189);e.exports=class WatersideDeckingCalculator extends i{static lineItemsFor(...e){if(0===e.length)return[];return this._groupDocksByDirection(e).flatMap((e=>{const t=e.first().project(),r=t.deckingOption().materialSpecifier(),n=e.first().deckingBoardGap(),i=e.first().mainAxis(),s=e.first().crossAxis(),o=e.map((e=>e.geometry()));return this.lineItemsForShapes(r,o,i,s,{gap:n,unit:t.unit()})}))}static _groupDocksByDirection(e){const t=new n;return e.forEach((e=>{t.has(e.mainAxis())?t.get(e.mainAxis()).push(e):t.set(e.mainAxis(),[e])})),t.values()}}},22373:(e,t,r)=>{const n=r(63768),{lumber:i,MaterialSpecifier:s}=r(93613),o=r(57418),a=r(6556),l=r(42947),c=(e,t)=>t.map((t=>new s(`PT${e}x${t}`,`${e}x${t}`,{length:n.unit(t,"ft")}))),u=(e,t,r,i)=>r.map((r=>new s(`${e}x${r}`,`${t} x ${r}`,{length:n.unit(r,"ft"),pricingIdentifier:i}))),d=(e,t,r=void 0,i=void 0)=>e.map((e=>{const o=n.unit(e,"ft"),a=n.unit(t,"in");return new s(`FLOAT${e}x4x${t}`,`${e}x4x${t} Float`,{width:o,length:n.unit(4,"ft"),depth:a,color2D:r,color3D:i})})),h=d([6,4,3,2],18,"#454545","#090909"),p=d([6,4,3,2],24,"#000000","#000000"),m=(e,t="")=>a.makeCategory(e,`${t}${e}`),f={categories:{BOAT_DOCKING:m("Boat Docking","ZZA-"),FIXED_DOCK:m("Fixed Dock"),FLOATING_DOCK:m("Floating Dock"),GANGWAY:m("Ramp"),RAILINGS:m("Railings"),ROOF:m("Roof")},floats:[...h,...p]},g=[new s("WOLF_SEASIDE","Wolf Seaside",{width:n.unit(1,"in"),depth:n.unit(5.5,"in"),purchaseLengthSpecifiers:u("WOLF_SEASIDE","Wolf Seaside",[12,16,20])}),new s("WOLF_TROPICAL","Wolf Tropical",{width:n.unit(1,"in"),depth:n.unit(5.5,"in"),purchaseLengthSpecifiers:u("WOLF_TROPICAL","Wolf Tropical",[12,16,20])}),new s("ENDECK_WOODLAND","Endeck Woodland",{width:n.unit(1,"in"),depth:n.unit(5.5,"in"),purchaseLengthSpecifiers:u("ENDECK_WOODLAND","Endeck Woodland",[12,16,20])}),new s("SYP2x6","Pine 2 x 6",{...i.PT2x6.details(),lcadSpecifier:i.PT2x6,materialColor:"#EDDB8A",purchaseLengthSpecifiers:u("SYP2x6","Pine 2 x 6",[8,10,12,14,16,20])}),new s("SYP2x8","Pine 2 x 8",{...i.PT2x8.details(),lcadSpecifier:i.PT2x8,materialColor:"#EDDB8A",purchaseLengthSpecifiers:u("SYP2x8","Pine 2 x 8",[8,10,12,14,16,18,20,24])}),new s("PT2x4","2x4",{...i.PT2x4.details(),lcadSpecifier:i.PT2x4,purchaseLengthSpecifiers:c("2x4",[8,10,12,14,16])}),new s("PT2x6","2x6",{...i.PT2x6.details(),lcadSpecifier:i.PT2x6,purchaseLengthSpecifiers:c("2x6",[8,10,12,14,16,20])}),new s("PT2x8","2x8",{...i.PT2x8.details(),lcadSpecifier:i.PT2x8,purchaseLengthSpecifiers:c("2x8",[8,10,12,14,16,18,20,24])}),new s("PT2x10","2x10",{...i.PT2x10.details(),lcadSpecifier:i.PT2x10,purchaseLengthSpecifiers:c("2x10",[10,12,14,16,20,24])}),new s("PT8x8","8x8",{...i.PT8x8.details(),lcadSpecifier:i.PT8x8,purchaseLengthSpecifiers:c("8x8",[14,16,18,20,22,24,26,28,30,36])}),new s("PT6x6","6x6",{...i.PT6x6.details(),lcadSpecifier:i.PT6x6,purchaseLengthSpecifiers:c("6x6",[12,14,16,18,20,22,24])}),new s("WIND_BRACING_8x8","Wind Bracing 8 x 8",{...i.PT8x8.details(),lcadSpecifier:i.PT8x8,purchaseLengthSpecifiers:u("WIND_BRACING_8x8","Wind Bracing 8 x 8",[16])}),new s("WIND_BRACING_6x6","Wind Bracing 6 x 6",{...i.PT6x6.details(),lcadSpecifier:i.PT6x6,purchaseLengthSpecifiers:u("WIND_BRACING_6x6","Wind Bracing 6 x 6",[12])}),new s("PILE_CAP","Pile Cap"),new s("LVL","LvL",{width:n.unit(1.75,"in"),depth:n.unit(11.875,"in"),materialColor:"#684636",purchaseLengthSpecifiers:u("LVL","LvL",[14,16,18,20,22,24,26,28,30,32,34,36,38,40],"LVL")}),...h,...p,new s("LAG_SCREW38",'3/8" Lag Screw'),new s("CARRIAGE_BOLTx4",'3/8 x 4" Carriage Bolt'),new s("GALVANIZED_CARRIAGE_BOLT","Galvanized Carriage Bolt",{purchaseLengthSpecifiers:(y="GALVANIZED_CARRIAGE_BOLT",b="Galvanized Carriage Bolt",v=[10,12,14],v.map((e=>new s(`${y}x${e}`,`${e}" ${b}`,{length:n.unit(e,"in"),pricingIdentifier:_}))))}),new s("GALVANIZED_FLAT_WASHER","Galvanized Flat Washer"),new s("GALVANIZED_HEX_NUT","Galvanized Hex Nut"),new s("GALVANIZED_LAG_BOLT","Galvanized Lag Bolt"),new s("PIPE_RAIL","Pipe",{purchaseLengthSpecifiers:u("PIPE_RAIL","Pipe",[4,5,6,7,8,9,10],"PIPE_RAIL")}),new s("PIPE_FLANGE","Pipe Flange"),new s("CABLE","Cable",{radius:n.unit(.1,"in"),materialName:"steel"}),new s("ROPE1_5",'1 1/2" Rope',{radius:n.unit(.75,"in"),materialName:"rope"}),new s("ROPE2",'2" Rope',{radius:n.unit(1,"in"),materialName:"rope"}),new s("WESTBURY_PICKET_RAILING_KIT","Picket Railing Kit",{purchaseLengthSpecifiers:u("WESTBURY_PICKET_RAILING_KIT","Picket Railing Kit",[5,6,8])}),new s("WESTBURY_POST","Picket Post"),new s("FASCIA_BOARD","5/4x6 Fascia Board",{...i.PT54x6.details(),lcadSpecifier:i.PT54x6,purchaseLengthSpecifiers:u("FASCIA_BOARD","Fascia Board 5/4 x 6",[8,10,12,14,16]),color:"#aaaaaa"}),new s("T_AND_G_SHEATHING","2x6x8 T&G Roof Underside Covering",{width:n.unit(5.5,"in"),length:n.unit(8,"ft"),coverage:n.unit(5.5/12*8,"sqft"),depth:n.unit(1.5,"in"),materialName:"weardeck",color:"#f2cca8",pricingUnit:"wallboard"}),new o("TUFF_RIB_METAL_ROOFING",'36" wide Tuff-Rib Metal Roofing',{width:n.unit(3,"ft"),depth:n.unit(3/16,"in"),materialName:"metal-roof",color:"#aaaaaa"}),new s("DRIP_EDGE","10' Drip Edge",{length:n.unit(10,"ft")}),new s("RIDGE_CAP","10' Ridge Cap",{length:n.unit(10,"ft")}),new s("ROOF_SCREW_FASTENERS","Roof Screw Fasteners Bag"),new s("GANGWAY_LOWER_DOCK_CONNECTION_KIT","Gangway Lower Dock Connection Kit"),new s("GANGWAY_UPPER_DOCK_CONNECTION_KIT","Gangway Upper Dock Connection Kit"),new s("GANGWAY_UPPER_SHORE_CONNECTION_KIT","Gangway Shore Connection Kit"),new s("CLEAT","Cleat",{defaultCategory:f.categories.BOAT_DOCKING}),new s("RUB_RAIL","Rub Rail",{defaultCategory:f.categories.BOAT_DOCKING}),new s("BOATHOUSE_LIFT","Hi Tide Boathouse Lift Assembly",{defaultCategory:f.categories.BOAT_DOCKING,nonMaterial:!0}),new s("PILE_LIFT","Hi Tide Pile Lift Assembly",{defaultCategory:f.categories.BOAT_DOCKING,nonMaterial:!0}),new s("PWC_LIFT","Hi Tide PWC Lift Assembly",{defaultCategory:f.categories.BOAT_DOCKING,nonMaterial:!0}),new s("MOORING_PILES","Mooring Piles",{defaultCategory:f.categories.BOAT_DOCKING,nonMaterial:!0}),new s("ANCHOR_PILES_AND_GUIDES","Anchor Piles and Guides",{defaultCategory:f.categories.FLOATING_DOCK,nonMaterial:!0}),new s("LADDERS","Ladders",{nonMaterial:!0}),new s("FUEL","Fuel",{nonMaterial:!0}),new s("DECKING_SCREWS","Decking Screws",{nonMaterial:!0}),new s("MATERIAL_TAX","Material Tax",{nonMaterial:!0}),new s("LABOR","Labor",{nonMaterial:!0}),new s("WORKERS_COMP","Workers Comp",{nonMaterial:!0}),new s("HEALTH_INSURANCE","Health Insurance",{nonMaterial:!0}),new s("LABOR_TAX","Labor Tax",{nonMaterial:!0}),new s("MARGIN","Margin",{nonMaterial:!0})];var y,b,v,_;g.forEach((e=>f[e.identifier()]=e));const x=e=>({identifier:e.identifier(),displayValue:e.name(),[l.item]:e.name(),[l.description]:e.description()}),w=g.flatMap((e=>e.details().purchaseLengthSpecifiers?[e,...e.details().purchaseLengthSpecifiers]:e));f.purchaseable={},w.filter((e=>{const t=e.details();return!t.nonMaterial&&(!!t.purchaseLengthSpecifiers?.some((t=>t.details().pricingIdentifier===e.identifier()))||!t.pricingIdentifier&&!t.purchaseLengthSpecifiers)})).forEach((e=>f.purchaseable[e.identifier()]=e)),f.lookupName=(e,t)=>{const r=w.find((t=>t.identifier()===e));return t?.[e]?.[l.item]??r?.name()??e},f.defaultMaterialDefinitions=()=>g.flatMap((e=>e.details().purchaseLengthSpecifiers?e.details().purchaseLengthSpecifiers.map((e=>x(e))):x(e))),e.exports=f},90556:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),s=r(20901),o=r(88646),a=r(30202),l=r(6556);e.exports=class WatersideCable extends a{_defaultCrossSection(){const e=this.materialSpecifier().details().radius;return new o([new s(i(0,0).expandedByRadius(e.toNumeric(this.unit())))])}materialLineItems(){const e=n.unit(this.edge().length(),this.unit());return new l(e,this.materialSpecifier())}}},58757:(e,t,r)=>{const{RailLengthHelper:n}=r(8423),i=r(91229),s=r(86580),o=r(31206),a=r(16856);e.exports=class WatersideCollection extends s{runClass(){return a}sectionClass(){return o}railLengthMode(){return n.mode.EVEN}projectedViewFigure(e,t,r){return i.withModel(this,e,t,r)}projectedAnnotationPDFBoundingBox(){return this.boundingBox()}materialCategory(){return this.materials.categories.RAILINGS}}},87548:(e,t,r)=>{const n=r(70291),i=r(41912),s=r(21260);e.exports=class WatersideEdgeRailingMultiState extends n{static defaultPostOnlyStyle(){return this._defaultPostOnlyStyle??=new i}static defaultToggleStateDrawingStyles(){const e={};return Object.assign(e,{posts:new s("hsl(55, 77%, 84%)","hsl(55, 77%, 24%)",[7,42])},super.defaultToggleStateDrawingStyles()),e}_currentRailingStyle(){switch(this.current().name){case"posts":return this.constructor.defaultPostOnlyStyle();case"rails":return this.dock().project().railingStyle();default:return}}}},6885:(e,t,r)=>{const n=r(63768),i=r(6556),s=r(27287),o=r(43275),a=r(22373);e.exports=class WatersideNotchedPostMountRailingPost extends o{static postSpecifier(){return a.PT6x6}static heightBelowDecking(){return n.unit(8,"in")}selfMaterialLineItems(){const e=this.materials.categories.RAILINGS;return[new i(this.height(),this.materialSpecifier(),{category:e})]}defaultFigure(){return new s(this)}_postBaseGeometry(){const e=this.geometry(),t=this.heightBelowSurface().toNumeric(this.unit());return e.movedBy(0,0,t).relatedTo(this.locator())}}},18670:(e,t,r)=>{const n=r(6885),i=r(75501);e.exports=class WatersideNotchedPostMountStyle extends i{postClass(){return n}postZOffset(){return n.heightBelowDecking()}}},32897:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),s=r(88646),o=r(56214),a=r(91953);e.exports=class WatersidePicketRail extends a{static defaultWidth(){return n.unit(2,"in")}static defaultDepth(){return n.unit(1,"in")}width(){return this.constructor.defaultWidth()}depth(){return this.constructor.defaultDepth()}crossSection(){const e=this.depth().toNumeric(this.unit()),t=this.width().toNumeric(this.unit());return new s([new o(i(0,0).expandedBy(t/2,e/2))])}materialLineItems(){return[]}}},72476:(e,t,r)=>{const{NullDrawable3D:n}=r(37732),i=r(43275),s=r(22373);e.exports=class WatersidePileMountRailingPost extends i{static postSpecifier(){return s.PT8x8}threeFigure(){return new n(this)}}},56099:(e,t,r)=>{const n=r(72476),i=r(75501);e.exports=class WatersidePileMountStyle extends i{postClass(){return n}postLocationsFor(e){if(!e.isSpaceForPosts())return[];const t=e.postLayoutEdge(),r=t.xy(),n=this._xyFrameStructurePostsLocationsFor(e).filter((e=>r.containsPoint(e))),i=e.edge().direction();return n.map((e=>t.closestRelativePointTo(e))).sort(((e,t)=>e.dot(i)-t.dot(i)))}_xyFrameStructurePostsLocationsFor(e){const t=e.frameStructure();if(!t)return[];const r=t.posts?.(),n=t.dockGroup?.()?.sharedPosts();return[r,n].flat().filter(Boolean).map((e=>e.locator().xy())).uniqueValues()}}},75501:(e,t,r)=>{const n=r(63768),{MissingOverride:i}=r(50988),s=r(83741);e.exports=class WatersidePostMountStyle extends s{postClass(){throw new i(this,"postClass")}sectionEdgeOffsetFromCenter(){return n.unit(0,"in")}}},91953:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),s=r(20901),o=r(88646),a=r(74215),l=r(6556),c=r(59663);e.exports=class WatersideRail extends a{static defaultRadius(){return n.unit(.8125,"in")}static defaultWidth(){return n.multiply(this.defaultRadius(),2)}static defaultDepth(){return n.multiply(this.defaultRadius(),2)}radius(){return this.constructor.defaultRadius()}width(){return n.multiply(this.radius(),2)}depth(){return n.multiply(this.radius(),2)}materialSpecifier(){return this.materials.PIPE_RAIL}color(){return this.componentOf().railingColor()}crossSection(){const e=this.radius().toNumeric(this.unit());return new o([new s(i(0,0).expandedByRadius(e))])}materialLineItems(){return[new l(this.pricingLength(),this.materialSpecifier()),new l(2,this.materials.PIPE_FLANGE)]}pricingLength(){return n.unit(this.edge().length().rounded(),this.unit())}defaultFigure(){return new c(this,this.figureProperties())}figureProperties(){if(this.color())return{fillStyle:this.color().fillStyle(),strokeStyle:this.color().strokeStyle(),lineWidth:.3}}}},43275:(e,t,r)=>{const n=r(63768),{MissingOverride:i}=r(50988),s=r(80371);e.exports=class WatersideRailingPost extends s{static postSpecifier(){throw new i(this,"postSpecifier")}static defaultLength(){return this.postSpecifier().details().depth}static defaultWidth(){return this.postSpecifier().details().width}static heightAboveDecking(){return n.unit(40,"in")}static heightBelowDecking(){return n.unit(0,"in")}materialSpecifier(){return this.constructor.postSpecifier()}heightAboveSurface(){return this.constructor.heightAboveDecking()}heightBelowSurface(){return this.constructor.heightBelowDecking()}height(){return n.add(this.heightAboveSurface(),this.heightBelowSurface())}materialNames(){return[this.materialSpecifier().details().materialName||"pressure-treated"]}}},31206:(e,t,r)=>{const n=r(63768),i=r(23525),s=r(73030),o=r(27805),a=r(86205),l=r(30601);e.exports=class WatersideRailingSection extends i{static postMountStyleClasses(){return[]}static railingStyleClasses(){return[l,a,o,s]}railingColor(){return this.railingStyle().color()}_defaultPostMountStyle(){return new(this.frameStructure().postMountStyleClassFor(this.edge()))}_classForPost(){return this.postMountStyle().postClass()}maxRailLength(){return this.frameStructure().maxPostSpacing()}minLength(){return n.multiply(this.postWidth(),2)}}},92554:(e,t,r)=>{const{ProportionalEdgeLocator:n}=r(62048),i=r(30202);e.exports=class WatersideRopeExtrusion extends i{controlPoint1(){return this._controlPoint1??=new n(this.edge(),1/3).addZ(this.edge().length()/8)}controlPoint2(){return this._controlPoint2??=new n(this.edge(),2/3).addZ(this.edge().length()/8)}}},22933:(e,t,r)=>{const n=r(63768),i=r(6556),s=r(51432),o=r(91953),a=r(92554);e.exports=class WatersideRopeRail extends o{constructor(e,t){super(e),this._materialSpecifier=t}materialSpecifier(){return this._materialSpecifier}radius(){return this.materialSpecifier().details().radius}materialLineItems(){return new i(this.pricingLength(),this.materialSpecifier())}pricingLength(){return n.add(super.pricingLength(),n.unit(1,"ft"))}extrusionClass(){return a}threeFigure(){return new s(this.extrusion())}}},16856:(e,t,r)=>{const n=r(52494),i=r(59503);e.exports=class WatersideRun extends i{_defaultPlacementStrategy(){return new n(this)}_defaultFrameStructure(){return this._findFrameStructure(this.project()?.enclosablePlatforms()||[])}_findFrameStructure(e){const t=this.edge().xy();return e.find((e=>e.geometry().edges().some((e=>e.xy().containsEdge(t)))))}}},23650:(e,t,r)=>{const n=r(63768),{extend:i}=r(50988),s=r(92214),o=r(90556),a=r(30093);class WatersideCableBlock extends a{infillCrossSection(){}infillSpacing(){return n.divide(this.infillSpan(),this.railingStyle().cableCount()+1)}infillSpecifier(){return this.materials.CABLE}infillClass(){return o}}i(WatersideCableBlock,s),e.exports=WatersideCableBlock},68200:(e,t,r)=>{const n=r(84155);e.exports=class WatersideNullRailingBlock extends n{}},45519:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),{extend:s}=r(50988),{MaterialSpecifier:o}=r(93613),a=r(88646),l=r(99343),c=r(56214),u=r(30093),d=r(32897),h=r(6556);class WatersidePicketBlock extends u{topRailClass(){return d}bottomRailClass(){return d}infillSpecifier(){const e=this.railingColor().materialName();return new o("infill","infill",{materialName:e})}infillCrossSection(){const e=n.unit(1,"in");return new a([new c(i(0,0).expandedBy(e.toNumeric(this.unit())/2))])}infillSpacing(){return n.unit(6,"in")}materialLineItems(){const e=this.materials.WESTBURY_PICKET_RAILING_KIT,t=this._totalLength(),r=this._maxPurchaseLength(e),i=Math.ceil(n.divide(t,r)),s=n.divide(t,i);return[...Array(i).fill().map((()=>new h(s,e))),new h(i-1,this.materials.WESTBURY_POST)]}_maxPurchaseLength(e){return e.details().purchaseLengthSpecifiers.last().details().length}_totalLength(){return n.unit(this.bottomRail().length().rounded(),this.unit())}}s(WatersidePicketBlock,l),e.exports=WatersidePicketBlock},78159:(e,t,r)=>{const n=r(63768),i=r(30093);e.exports=class WatersidePipeBlock extends i{bottomRailHeight(){return n.unit(18,"in")}}},30093:(e,t,r)=>{const n=r(63768),{extend:i}=r(50988),s=r(30691),o=r(84155),a=r(22766),l=r(29876),c=r(91953);class WatersideRailingBlock extends o{railingColor(){return this.railingStyle().color()}topRailClass(){return c}bottomRailClass(){return c}bottomRailHeight(){return n.unit(3,"in")}infillBaseEdge(){const e=-this.beginPost()?.length().toNumeric(this.unit())/2,t=-this.endPost()?.length().toNumeric(this.unit())/2;return s.stretchedEdgeBy(this.edge(),e,t).relativeToEdge(this.edge())}bottomRail(){if(this.railingStyle().includeBottomRail())return this._bottomRail??=this._defaultBottomRail()}infillBottomHeight(){return this.railingStyle().includeBottomRail()?n.add(this.bottomRailHeight(),n.divide(this.bottomRailDepth(),2)):super.infillBottomHeight()}components(){return super.components().filter(Boolean)}}i(WatersideRailingBlock,l),i(WatersideRailingBlock,a),e.exports=WatersideRailingBlock},91763:(e,t,r)=>{const n=r(63768),i=r(30093),s=r(22933);e.exports=class WatersideRopeBlock extends i{bottomRailHeight(){return n.unit(18,"in")}_createBottomRail(){return this._createRail(this.bottomRailHeight())}_createTopRail(){return this._createRail(this.topRailHeight())}_createRail(e){const t=this.railEdge().addZ(-e.toNumeric(this.unit())),r=this.railingStyle().ropeSpecifier();return new s(t,r)}}},73030:(e,t,r)=>{const{EditableProperty:n}=r(7340),i=r(23650),s=r(77521),o=r(67603);e.exports=class WatersideCableRailingStyle extends s{constructor(){super("cable","Cable","cable-rail")}blockClass(){return i}defaultDisplayProperties(){return new o(this,[...super.defaultDisplayProperties(),new n(this,"Include Bottom Rail",{type:"boolean"}),new n(this,"Cable Count",{type:"select",choices:this.cableCountChoices()})])}cableCount(){return this._cableCount??=this.cableCountChoices().last().value}setCableCount(e){this._cableCount=e,this.notifyPropertyChangedObservers()}cableCountChoices(){return[4,5,6,8].map((e=>({label:e.toString(),value:e})))}}},74665:(e,t,r)=>{const{EditableProperty:n}=r(7340),i=r(77521),s=r(67603);e.exports=class WatersideHorizontalRailRailingStyle extends i{defaultDisplayProperties(){return new s(this,[...super.defaultDisplayProperties(),new n(this,"Double Rail",{type:"boolean"})])}doubleRail(){return this.includeBottomRail()}toggleDoubleRail(){this.toggleIncludeBottomRail()}setDoubleRail(e){this.setIncludeBottomRail(e)}}},41912:(e,t,r)=>{const n=r(58684),i=r(68200);e.exports=class WatersideNullRailingStyle extends n{constructor(){super("null","No Infill")}blockClass(){return i}}},27805:(e,t,r)=>{const n=r(45519),i=r(77521);e.exports=class WatersidePicketRailingStyle extends i{constructor(){super("picket","Picket","picket-rail")}blockClass(){return n}}},86205:(e,t,r)=>{const n=r(78159),i=r(74665);e.exports=class WatersidePipeRailingStyle extends i{constructor(){super("pipe","Pipe","mid-rail")}blockClass(){return n}}},77521:(e,t,r)=>{const{EditableProperty:n}=r(7340),i=r(43320),s=r(67603),o=r(58684);e.exports=class WatersideRailingStyle extends o{static colorChoices(){return[new i("Black","metallic-black-low-gloss","#000000","#000000"),new i("Bronze","metallic-bronze-low-gloss","#755334","#242424"),new i("Stainless Steel","steel","#888888","#666666"),new i("Tan","metallic-tan-low-gloss","#9c8773","#454545")]}colorChoices(){return this.constructor.colorChoices()}color(){return this._color??=this.colorChoices().first()}setColor(e){this._color=e,this.notifyPropertyChangedObservers()}defaultDisplayProperties(){return new s(this,[new n(this,"Color",{type:"select",choices:this.colorChoices(),label:"Railing Color"})])}showColorProperty(){return this.colorChoices().length>1}includeBottomRail(){return this._includeBottomRail??=!0}toggleIncludeBottomRail(){this.setIncludeBottomRail(!this.includeBottomRail())}setIncludeBottomRail(e){this._includeBottomRail=e,this.notifyPropertyChangedObservers()}}},30601:(e,t,r)=>{const n=r(91763),i=r(74665),s=r(22373);e.exports=class WatersideRopeRailingStyle extends i{static colorChoices(){return[]}constructor(){super("rope","Rope","rope-rail")}blockClass(){return n}ropeSpecifier(){return this.doubleRail()?s.ROPE1_5:s.ROPE2}}},8125:e=>{e.exports={PILE_LENGTH_ANNOTATIONS:"Pile Length Annotations",RAILING_COLLECTION:"Railing Collection"}},97613:(e,t,r)=>{const n=r(48909),i=r(85438),s=r(72029),o=r(24730);e.exports=class WatersideBerthDockFigure extends n{constructor(e){super(),this.setModel(e)}defaultHandles(){return[...this.resizeHandles(),...this.rotationHandles(),this.selfHandle()]}selfHandle(){return new s(this)}rotationHandles(){return this.model().fingerDocks().flatMap((e=>e.sideEdges().findLargest((e=>e.center().distanceTo(this.model().locator()))).endpoints())).map((e=>new i(this.model(),e)))}resizeHandles(){return this.model().boundingShape().edges().map((e=>new o(e.snapshot(),this)))}zLevels(){return this.figures().flatMap((e=>e.zLevels?.()??[e.zLevel()])).uniqueValues()}handlesAt(e,t,r){const n=[];return this._framingLevelFigures().forEach((i=>n.fastMerge(i.handlesAt(e,t,r)))),n.fastMerge(super.handlesAt(e,t,r)),n}_framingLevelFigures(){const e=this._framingLevels();return this.figures().filter((t=>e.includes(t.model())))}_framingLevels(){return this.model().framingLevels?.()??[]}}},11521:(e,t,r)=>{const n=r(48909);e.exports=class WatersideDockGroupFigure extends n{defaultHandles(){return[]}_drawFigures(e,t){t.shapeOnly||super._drawFigures(e,t)}}},83277:(e,t,r)=>{const n=r(84757),i=r(82874),s=r(48426);e.exports=class WatersideGangwayFigure extends n{_edgeHandles(){const e=this.model();return[...e.deckingEdges().map((e=>new s(e,this))),new i(e.upperEdge(),this),new i(e.lowerEdge(),this)]}}},24730:(e,t,r)=>{const n=r(63768),{$P:i}=r(62048),s=r(48426);e.exports=class WatersideBerthDockEdgeHandle extends s{moveBy(e,t){const r=this.object(),s=r.normal().dot(i(e,t)),o=n.add(this._modelDimension(),n.unit(s,this.frame().unit()));if(o.equals(this._modelDimension()))return!1;const a=this._modelDimension();if(!this.setDimension(o))return!1;const l=n.subtract(this._modelDimension(),a).toNumeric(this.frame().unit()),c=r.normal().multipliedBy(l);return r.moveBy(c.x(),c.y()),this.frame().moveBy(c.x()/2,c.y()/2),this.figure().updateAnnotationFigures(),this.adjustFrame(c),!0}setDimension(e){return this._isEndEdge()?this.frame().setLength(e):this.frame().setWidth(e),this._modelDimension().equals(e)}}},58223:(e,t,r)=>{const{$P:n}=r(62048),i=r(47910);e.exports=class WatersideFloatHandle extends i{activate(){this._didMove=void 0,this._offset=void 0}deactivate(){this._didMove&&(this._float().snapToGrid(),this._float().floatChanged()),super.deactivate()}moveFromTo(e,t,r,i){const s=this._float();this._offset||(this._offset=n(e,t).subtract(s.locator()));const o=n(r,i).subtract(this._offset),a=s.locator().snapshot(),l=o.subtract(s.locator());this.moveBy(l.x(),l.y()),s.coerceToValidPosition({snapToGrid:!1});const c=!a.equals(s.locator());return this._didMove||=c,c}_float(){return this.object().model()}}},72148:(e,t,r)=>{const n=r(89929);e.exports=class WatersideBerthDockPlacementTool extends n{_componentAddedToProject(e){e.updateConnections()}draw(e,t){(this.unplacedComponentFigure().zLevels?.()??[]).forEach((r=>this.unplacedComponentFigure().draw(e,{...t,zLevel:r})))}}},17232:(e,t,r)=>{const{$P:n}=r(62048),i=r(63002),s=r(1997),o=r(10066),a=r(80317);e.exports=class WatersideFloatAdjustmentTool extends i{displayName(){return"Adjust Floats"}iconName(){return"move_selection_right"}drawShapeOnly(){return!1}_updateHoveredHandle(e,t,r){const n=this._topHandleUnderCursor(e,t,r),i=!n&&this.hoveredHandle()||n&&!n.equals(this.hoveredHandle());if(this._controller().setCursor("default"),i)this.setHoveredHandle(n),this._controller().draw();else if(!n){this._floatingDockAt(e,t)&&this._controller().setCursor("crosshair")}}_topHandleUnderCursor(e,t,r){return this.handles().find((n=>n.contains(e,t,r)))}handles(){const e=this._controller().drawing();return this._floats().flatMap((t=>e.figureFor(t).selfHandle()))}activate(){const e=this._controller().layerManager();this._originalDeckingLayerVisibility=e.isVisible(o.DECKING),this._originalRoofingLayerVisibility=e.isVisible(o.ROOFING),e.hide(o.DECKING),e.hide(o.ROOFING),super.activate(),this._controller().draw()}deactivate(){const e=this._controller().layerManager();this._originalDeckingLayerVisibility&&e.show(o.DECKING),this._originalRoofingLayerVisibility&&e.show(o.ROOFING),super.deactivate(),this._controller().draw(),this._originalDeckingLayerVisibility=void 0,this._originalRoofingLayerVisibility=void 0,this._handles=void 0,this._controller().setCursor("default")}async mouseUp(e,t,r={}){this._controller().setShapeOnly(!1),this._controller().draw();let n=!1;if(this.isMouseButtonInUse(this.mouseButtonToActivate(),r)||this._isTouchEvent(r.event)){const r=this.activeHandle();if(r){this._deactivateHandle();const e=r.selectableComponent();this._updateSelection(e),this.didChange()&&await this._controller().snapshotProject(),this._controller().redraw(),n=!0}else this.didPanOrZoom()||(n=this._onNonSelectionClick(e,t))}n||this.panZoomTool().mouseUp(e,t,r),this._multiSelectMode=!1,this._lastX=void 0,this._lastY=void 0,this.setActiveHandle(void 0)}_onNonSelectionClick(e,t){return this._placeFloat(e,t)}_placeFloat(e,t){const r=this._floatingDockAt(e,t);if(!r)return!1;const i=new s(n(e,t,r.floatZLevel()).relatedTo(r.referencePoint()),r.materials.FLOAT4x4x18,r.angle());return r.addFloat(i),i.coerceToValidPosition(),this._controller().select(i),this._controller().redraw(),!0}_floatingDockAt(e,t){return this._controller().project().docks().filter((e=>e.role()===a.FLOATING_DOCK)).find((r=>r.geometry().contains(e,t)))}_floats(){return this._controller().project().frames().flatMap((e=>e.floats?.()??[]))}}},22164:(e,t,r)=>{const{Migration:n}=r(57075),i=r(30915);e.exports=class SplitWatersideBerthDockFingerDocksMigration extends n{static version(){return"20230919154107"}static classType(){return i}change(){const e=this.currentObject(),t=e._fingerDocks,r=t.find((t=>t.locator().subtract(e.referencePoint()).dot(e.crossAxis())<0)),n=t.find((t=>t.locator().subtract(e.referencePoint()).dot(e.crossAxis())>0));e._portFingerDock=n,e._starboardFingerDock=r,this.removeProperty("_fingerDocks")}}},24168:(e,t,r)=>{const n=r(63768),{Migration:i}=r(57075),s=r(44548),o=r(59170);e.exports=class ResetFixedDockHeightForLoweredWaterLevelMigration extends i{static version(){return"20230922170653"}static classType(){return s}change(){const e=this.currentObject();this._updateDockHeight(e),this._updateFramingLevelGeometryZ(e)}_updateDockHeight(e){e.setHeight(n.add(e.height(),o.defaultWaterHeightBelowFullPond()))}_updateFramingLevelGeometryZ(e){const t=e.framingLevelsOverhead().first();if(!t)return;const r=t.geometry(),n=e.zLevel()-t.height().toNumeric(e.unit())-r.zLevel();n.isNearTo(0)||t.geometry().moveBy(0,0,n)}}},49410:(e,t,r)=>{const{three:{BufferAttribute:n,BufferGeometry:i,Float32BufferAttribute:s,InstancedBufferAttribute:o,InterleavedBuffer:a,InterleavedBufferAttribute:l,TriangleFanDrawMode:c,TriangleStripDrawMode:u,TrianglesDrawMode:d,Vector3:h}}=r(37732);function p(e){let t,r,i,s=-1,o=0;for(let n=0;n<e.length;++n){const a=e[n];if(void 0===t&&(t=a.array.constructor),t!==a.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(void 0===r&&(r=a.itemSize),r!==a.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(void 0===i&&(i=a.normalized),i!==a.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(-1===s&&(s=a.gpuType),s!==a.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;o+=a.count*r}const a=new t(o),l=new n(a,r,i);let c=0;for(let t=0;t<e.length;++t){const n=e[t];if(n.isInterleavedBufferAttribute){const e=c/r;for(let t=0,i=n.count;t<i;t++)for(let i=0;i<r;i++){const r=n.getComponent(t,i);l.setComponent(t+e,i,r)}}else a.set(n.array,c);c+=n.count*r}return void 0!==s&&(l.gpuType=s),l}e.exports={computeMikkTSpaceTangents:function(e,t,r=!0){if(!t||!t.isReady)throw new Error("BufferGeometryUtils: Initialized MikkTSpace library required.");if(!e.hasAttribute("position")||!e.hasAttribute("normal")||!e.hasAttribute("uv"))throw new Error('BufferGeometryUtils: Tangents require "position", "normal", and "uv" attributes.');function i(e){if(e.normalized||e.isInterleavedBufferAttribute){const t=new Float32Array(e.count*e.itemSize);for(let r=0,n=0;r<e.count;r++)t[n++]=e.getX(r),t[n++]=e.getY(r),e.itemSize>2&&(t[n++]=e.getZ(r));return t}return e.array instanceof Float32Array?e.array:new Float32Array(e.array)}const s=e.index?e.toNonIndexed():e,o=t.generateTangents(i(s.attributes.position),i(s.attributes.normal),i(s.attributes.uv));if(r)for(let e=3;e<o.length;e+=4)o[e]*=-1;return s.setAttribute("tangent",new n(o,4)),e!==s&&e.copy(s),e},mergeGeometries:function(e,t=!1){const r=null!==e[0].index,n=new Set(Object.keys(e[0].attributes)),s=new Set(Object.keys(e[0].morphAttributes)),o={},a={},l=e[0].morphTargetsRelative,c=new i;let u=0;for(let i=0;i<e.length;++i){const d=e[i];let h=0;if(r!==(null!==d.index))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+i+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(const e in d.attributes){if(!n.has(e))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+i+'. All geometries must have compatible attributes; make sure "'+e+'" attribute exists among all geometries, or in none of them.'),null;void 0===o[e]&&(o[e]=[]),o[e].push(d.attributes[e]),h++}if(h!==n.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+i+". Make sure all geometries have the same number of attributes."),null;if(l!==d.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+i+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(const e in d.morphAttributes){if(!s.has(e))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+i+".  .morphAttributes must be consistent throughout all geometries."),null;void 0===a[e]&&(a[e]=[]),a[e].push(d.morphAttributes[e])}if(t){let e;if(r)e=d.index.count;else{if(void 0===d.attributes.position)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+i+". The geometry must have either an index or a position attribute"),null;e=d.attributes.position.count}c.addGroup(u,e,i),u+=e}}if(r){let t=0;const r=[];for(let n=0;n<e.length;++n){const i=e[n].index;for(let e=0;e<i.count;++e)r.push(i.getX(e)+t);t+=e[n].attributes.position.count}c.setIndex(r)}for(const e in o){const t=p(o[e]);if(!t)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+e+" attribute."),null;c.setAttribute(e,t)}for(const e in a){const t=a[e][0].length;if(0===t)break;c.morphAttributes=c.morphAttributes||{},c.morphAttributes[e]=[];for(let r=0;r<t;++r){const t=[];for(let n=0;n<a[e].length;++n)t.push(a[e][n][r]);const n=p(t);if(!n)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+e+" morphAttribute."),null;c.morphAttributes[e].push(n)}}return c},mergeAttributes:p,interleaveAttributes:function(e){let t,r=0,n=0;for(let i=0,s=e.length;i<s;++i){const s=e[i];if(void 0===t&&(t=s.array.constructor),t!==s.array.constructor)return console.error("AttributeBuffers of different types cannot be interleaved"),null;r+=s.array.length,n+=s.itemSize}const i=new a(new t(r),n);let s=0;const o=[],c=["getX","getY","getZ","getW"],u=["setX","setY","setZ","setW"];for(let t=0,r=e.length;t<r;t++){const r=e[t],n=r.itemSize,a=r.count,d=new l(i,n,s,r.normalized);o.push(d),s+=n;for(let e=0;e<a;e++)for(let t=0;t<n;t++)d[u[t]](e,r[c[t]](e))}return o},estimateBytesUsed:function(e){let t=0;for(const r in e.attributes){const n=e.getAttribute(r);t+=n.count*n.itemSize*n.array.BYTES_PER_ELEMENT}const r=e.getIndex();return t+=r?r.count*r.itemSize*r.array.BYTES_PER_ELEMENT:0,t},mergeVertices:function(e,t=1e-4){t=Math.max(t,Number.EPSILON);const r={},i=e.getIndex(),s=e.getAttribute("position"),o=i?i.count:s.count;let a=0;const l=Object.keys(e.attributes),c={},u={},d=[],h=["getX","getY","getZ","getW"],p=["setX","setY","setZ","setW"];for(let t=0,r=l.length;t<r;t++){const r=l[t],i=e.attributes[r];c[r]=new n(new i.array.constructor(i.count*i.itemSize),i.itemSize,i.normalized);const s=e.morphAttributes[r];s&&(u[r]=new n(new s.array.constructor(s.count*s.itemSize),s.itemSize,s.normalized))}const m=.5*t,f=Math.log10(1/t),g=Math.pow(10,f),y=m*g;for(let t=0;t<o;t++){const n=i?i.getX(t):t;let s="";for(let t=0,r=l.length;t<r;t++){const r=l[t],i=e.getAttribute(r),o=i.itemSize;for(let e=0;e<o;e++)s+=~~(i[h[e]](n)*g+y)+","}if(s in r)d.push(r[s]);else{for(let t=0,r=l.length;t<r;t++){const r=l[t],i=e.getAttribute(r),s=e.morphAttributes[r],o=i.itemSize,d=c[r],m=u[r];for(let e=0;e<o;e++){const t=h[e],r=p[e];if(d[r](a,i[t](n)),s)for(let e=0,i=s.length;e<i;e++)m[e][r](a,s[e][t](n))}}r[s]=a,d.push(a),a++}}const b=e.clone();for(const t in e.attributes){const e=c[t];if(b.setAttribute(t,new n(e.array.slice(0,a*e.itemSize),e.itemSize,e.normalized)),t in u)for(let e=0;e<u[t].length;e++){const r=u[t][e];b.morphAttributes[t][e]=new n(r.array.slice(0,a*r.itemSize),r.itemSize,r.normalized)}}return b.setIndex(d),b},toTrianglesDrawMode:function(e,t){if(t===d)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(t===c||t===u){let r=e.getIndex();if(null===r){const t=[],n=e.getAttribute("position");if(void 0===n)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(let e=0;e<n.count;e++)t.push(e);e.setIndex(t),r=e.getIndex()}const n=r.count-2,i=[];if(t===c)for(let e=1;e<=n;e++)i.push(r.getX(0)),i.push(r.getX(e)),i.push(r.getX(e+1));else for(let e=0;e<n;e++)e%2==0?(i.push(r.getX(e)),i.push(r.getX(e+1)),i.push(r.getX(e+2))):(i.push(r.getX(e+2)),i.push(r.getX(e+1)),i.push(r.getX(e)));i.length/3!==n&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=e.clone();return s.setIndex(i),s.clearGroups(),s}return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),e},computeMorphedAttributes:function(e){const t=new h,r=new h,n=new h,i=new h,o=new h,a=new h,l=new h,c=new h,u=new h;function d(e,s,d,h,p,m,f,g){t.fromBufferAttribute(s,p),r.fromBufferAttribute(s,m),n.fromBufferAttribute(s,f);const y=e.morphTargetInfluences;if(d&&y){l.set(0,0,0),c.set(0,0,0),u.set(0,0,0);for(let e=0,s=d.length;e<s;e++){const s=y[e],g=d[e];0!==s&&(i.fromBufferAttribute(g,p),o.fromBufferAttribute(g,m),a.fromBufferAttribute(g,f),h?(l.addScaledVector(i,s),c.addScaledVector(o,s),u.addScaledVector(a,s)):(l.addScaledVector(i.sub(t),s),c.addScaledVector(o.sub(r),s),u.addScaledVector(a.sub(n),s)))}t.add(l),r.add(c),n.add(u)}e.isSkinnedMesh&&(e.applyBoneTransform(p,t),e.applyBoneTransform(m,r),e.applyBoneTransform(f,n)),g[3*p+0]=t.x,g[3*p+1]=t.y,g[3*p+2]=t.z,g[3*m+0]=r.x,g[3*m+1]=r.y,g[3*m+2]=r.z,g[3*f+0]=n.x,g[3*f+1]=n.y,g[3*f+2]=n.z}const p=e.geometry,m=e.material;let f,g,y;const b=p.index,v=p.attributes.position,_=p.morphAttributes.position,x=p.morphTargetsRelative,w=p.attributes.normal,R=p.morphAttributes.position,k=p.groups,j=p.drawRange;let z,q,$,Z,X,Y,ee;const te=new Float32Array(v.count*v.itemSize),re=new Float32Array(w.count*w.itemSize);if(null!==b)if(Array.isArray(m))for(z=0,$=k.length;z<$;z++)for(X=k[z],Y=Math.max(X.start,j.start),ee=Math.min(X.start+X.count,j.start+j.count),q=Y,Z=ee;q<Z;q+=3)f=b.getX(q),g=b.getX(q+1),y=b.getX(q+2),d(e,v,_,x,f,g,y,te),d(e,w,R,x,f,g,y,re);else for(Y=Math.max(0,j.start),ee=Math.min(b.count,j.start+j.count),z=Y,$=ee;z<$;z+=3)f=b.getX(z),g=b.getX(z+1),y=b.getX(z+2),d(e,v,_,x,f,g,y,te),d(e,w,R,x,f,g,y,re);else if(Array.isArray(m))for(z=0,$=k.length;z<$;z++)for(X=k[z],Y=Math.max(X.start,j.start),ee=Math.min(X.start+X.count,j.start+j.count),q=Y,Z=ee;q<Z;q+=3)f=q,g=q+1,y=q+2,d(e,v,_,x,f,g,y,te),d(e,w,R,x,f,g,y,re);else for(Y=Math.max(0,j.start),ee=Math.min(v.count,j.start+j.count),z=Y,$=ee;z<$;z+=3)f=z,g=z+1,y=z+2,d(e,v,_,x,f,g,y,te),d(e,w,R,x,f,g,y,re);return{positionAttribute:v,normalAttribute:w,morphedPositionAttribute:new s(te,3),morphedNormalAttribute:new s(re,3)}},mergeGroups:function(e){if(0===e.groups.length)return console.warn("THREE.BufferGeometryUtils.mergeGroups(): No groups are defined. Nothing to merge."),e;let t=e.groups;if(t=t.sort(((e,t)=>e.materialIndex!==t.materialIndex?e.materialIndex-t.materialIndex:e.start-t.start)),null===e.getIndex()){const t=e.getAttribute("position"),r=[];for(let e=0;e<t.count;e+=3)r.push(e,e+1,e+2);e.setIndex(r)}const r=e.getIndex(),n=[];for(let e=0;e<t.length;e++){const i=t[e],s=i.start,o=s+i.count;for(let e=s;e<o;e++)n.push(r.getX(e))}e.dispose(),e.setIndex(n);let i=0;for(let e=0;e<t.length;e++){const r=t[e];r.start=i,i+=r.count}let s=t[0];e.groups=[s];for(let r=1;r<t.length;r++){const n=t[r];s.materialIndex===n.materialIndex?s.count+=n.count:(s=n,e.groups.push(s))}return e},toCreasedNormals:function(e,t=Math.PI/3){const r=Math.cos(t),i=100*(1+1e-10),s=[new h,new h,new h],o=new h,a=new h,l=new h,c=new h;function u(e){return`${~~(e.x*i)},${~~(e.y*i)},${~~(e.z*i)}`}const d=e.index?e.toNonIndexed():e,p=d.attributes.position,m={};for(let e=0,t=p.count/3;e<t;e++){const t=3*e,r=s[0].fromBufferAttribute(p,t+0),n=s[1].fromBufferAttribute(p,t+1),i=s[2].fromBufferAttribute(p,t+2);o.subVectors(i,n),a.subVectors(r,n);const l=(new h).crossVectors(o,a).normalize();for(let e=0;e<3;e++){const t=u(s[e]);t in m||(m[t]=[]),m[t].push(l)}}const f=new Float32Array(3*p.count),g=new n(f,3,!1);for(let e=0,t=p.count/3;e<t;e++){const t=3*e,n=s[0].fromBufferAttribute(p,t+0),i=s[1].fromBufferAttribute(p,t+1),d=s[2].fromBufferAttribute(p,t+2);o.subVectors(d,i),a.subVectors(n,i),l.crossVectors(o,a).normalize();for(let e=0;e<3;e++){const n=m[u(s[e])];c.set(0,0,0);for(let e=0,t=n.length;e<t;e++){const t=n[e];l.dot(t)>r&&c.add(t)}c.normalize(),g.setXYZ(t+e,c.x,c.y,c.z)}}return d.setAttribute("normal",g),d}}},40431:(e,t,r)=>{const{three:{AnimationClip:n,Bone:i,Box3:s,BufferAttribute:o,BufferGeometry:a,ClampToEdgeWrapping:l,Color:c,ColorManagement:u,DirectionalLight:d,DoubleSide:h,FileLoader:p,FrontSide:m,Group:f,ImageBitmapLoader:g,InstancedMesh:y,InterleavedBuffer:b,InterleavedBufferAttribute:v,Interpolant:_,InterpolateDiscrete:x,InterpolateLinear:w,Line:R,LineBasicMaterial:k,LineLoop:j,LineSegments:z,LinearFilter:q,LinearMipmapLinearFilter:$,LinearMipmapNearestFilter:Z,LinearSRGBColorSpace:X,Loader:Y,LoaderUtils:ee,Material:te,MathUtils:re,Matrix4:ne,Mesh:ie,MeshBasicMaterial:se,MeshPhysicalMaterial:oe,MeshStandardMaterial:ae,MirroredRepeatWrapping:le,NearestFilter:ce,NearestMipmapLinearFilter:ue,NearestMipmapNearestFilter:de,NumberKeyframeTrack:he,Object3D:pe,OrthographicCamera:me,PerspectiveCamera:fe,PointLight:ge,Points:ye,PointsMaterial:be,PropertyBinding:ve,Quaternion:_e,QuaternionKeyframeTrack:xe,RepeatWrapping:we,Skeleton:Se,SkinnedMesh:Pe,Sphere:Te,SpotLight:Re,Texture:ke,TextureLoader:Ie,TriangleFanDrawMode:je,TriangleStripDrawMode:He,Vector2:ze,Vector3:Ge,VectorKeyframeTrack:We,SRGBColorSpace:Ve,InstancedBufferAttribute:qe}}=r(37732),$e=r(49410);function GLTFRegistry(){let e={};return{get:function(t){return e[t]},add:function(t,r){e[t]=r},remove:function(t){delete e[t]},removeAll:function(){e={}}}}const Xe={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class GLTFLightsExtension{constructor(e){this.parser=e,this.name=Xe.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let r=0,n=t.length;r<n;r++){const n=t[r];n.extensions&&n.extensions[this.name]&&void 0!==n.extensions[this.name].light&&e._addNodeRef(this.cache,n.extensions[this.name].light)}}_loadLight(e){const t=this.parser,r="light:"+e;let n=t.cache.get(r);if(n)return n;const i=t.json,s=((i.extensions&&i.extensions[this.name]||{}).lights||[])[e];let o;const a=new c(16777215);void 0!==s.color&&a.setRGB(s.color[0],s.color[1],s.color[2],X);const l=void 0!==s.range?s.range:0;switch(s.type){case"directional":o=new d(a),o.target.position.set(0,0,-1),o.add(o.target);break;case"point":o=new ge(a),o.distance=l;break;case"spot":o=new Re(a),o.distance=l,s.spot=s.spot||{},s.spot.innerConeAngle=void 0!==s.spot.innerConeAngle?s.spot.innerConeAngle:0,s.spot.outerConeAngle=void 0!==s.spot.outerConeAngle?s.spot.outerConeAngle:Math.PI/4,o.angle=s.spot.outerConeAngle,o.penumbra=1-s.spot.innerConeAngle/s.spot.outerConeAngle,o.target.position.set(0,0,-1),o.add(o.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+s.type)}return o.position.set(0,0,0),o.decay=2,mt(o,s),void 0!==s.intensity&&(o.intensity=s.intensity),o.name=t.createUniqueName(s.name||"light_"+e),n=Promise.resolve(o),t.cache.add(r,n),n}getDependency(e,t){if("light"===e)return this._loadLight(t)}createNodeAttachment(e){const t=this,r=this.parser,n=r.json.nodes[e],i=(n.extensions&&n.extensions[this.name]||{}).light;return void 0===i?null:this._loadLight(i).then((function(e){return r._getNodeRef(t.cache,i,e)}))}}class GLTFMaterialsUnlitExtension{constructor(){this.name=Xe.KHR_MATERIALS_UNLIT}getMaterialType(){return se}extendParams(e,t,r){const n=[];e.color=new c(1,1,1),e.opacity=1;const i=t.pbrMetallicRoughness;if(i){if(Array.isArray(i.baseColorFactor)){const t=i.baseColorFactor;e.color.setRGB(t[0],t[1],t[2],X),e.opacity=t[3]}void 0!==i.baseColorTexture&&n.push(r.assignTexture(e,"map",i.baseColorTexture,Ve))}return Promise.all(n)}}class GLTFMaterialsEmissiveStrengthExtension{constructor(e){this.parser=e,this.name=Xe.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const n=r.extensions[this.name].emissiveStrength;return void 0!==n&&(t.emissiveIntensity=n),Promise.resolve()}}class GLTFMaterialsClearcoatExtension{constructor(e){this.parser=e,this.name=Xe.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?oe:null}extendMaterialParams(e,t){const r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[],s=n.extensions[this.name];if(void 0!==s.clearcoatFactor&&(t.clearcoat=s.clearcoatFactor),void 0!==s.clearcoatTexture&&i.push(r.assignTexture(t,"clearcoatMap",s.clearcoatTexture)),void 0!==s.clearcoatRoughnessFactor&&(t.clearcoatRoughness=s.clearcoatRoughnessFactor),void 0!==s.clearcoatRoughnessTexture&&i.push(r.assignTexture(t,"clearcoatRoughnessMap",s.clearcoatRoughnessTexture)),void 0!==s.clearcoatNormalTexture&&(i.push(r.assignTexture(t,"clearcoatNormalMap",s.clearcoatNormalTexture)),void 0!==s.clearcoatNormalTexture.scale)){const e=s.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new ze(e,e)}return Promise.all(i)}}class GLTFMaterialsIridescenceExtension{constructor(e){this.parser=e,this.name=Xe.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?oe:null}extendMaterialParams(e,t){const r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[],s=n.extensions[this.name];return void 0!==s.iridescenceFactor&&(t.iridescence=s.iridescenceFactor),void 0!==s.iridescenceTexture&&i.push(r.assignTexture(t,"iridescenceMap",s.iridescenceTexture)),void 0!==s.iridescenceIor&&(t.iridescenceIOR=s.iridescenceIor),void 0===t.iridescenceThicknessRange&&(t.iridescenceThicknessRange=[100,400]),void 0!==s.iridescenceThicknessMinimum&&(t.iridescenceThicknessRange[0]=s.iridescenceThicknessMinimum),void 0!==s.iridescenceThicknessMaximum&&(t.iridescenceThicknessRange[1]=s.iridescenceThicknessMaximum),void 0!==s.iridescenceThicknessTexture&&i.push(r.assignTexture(t,"iridescenceThicknessMap",s.iridescenceThicknessTexture)),Promise.all(i)}}class GLTFMaterialsSheenExtension{constructor(e){this.parser=e,this.name=Xe.KHR_MATERIALS_SHEEN}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?oe:null}extendMaterialParams(e,t){const r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[];t.sheenColor=new c(0,0,0),t.sheenRoughness=0,t.sheen=1;const s=n.extensions[this.name];if(void 0!==s.sheenColorFactor){const e=s.sheenColorFactor;t.sheenColor.setRGB(e[0],e[1],e[2],X)}return void 0!==s.sheenRoughnessFactor&&(t.sheenRoughness=s.sheenRoughnessFactor),void 0!==s.sheenColorTexture&&i.push(r.assignTexture(t,"sheenColorMap",s.sheenColorTexture,Ve)),void 0!==s.sheenRoughnessTexture&&i.push(r.assignTexture(t,"sheenRoughnessMap",s.sheenRoughnessTexture)),Promise.all(i)}}class GLTFMaterialsTransmissionExtension{constructor(e){this.parser=e,this.name=Xe.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?oe:null}extendMaterialParams(e,t){const r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[],s=n.extensions[this.name];return void 0!==s.transmissionFactor&&(t.transmission=s.transmissionFactor),void 0!==s.transmissionTexture&&i.push(r.assignTexture(t,"transmissionMap",s.transmissionTexture)),Promise.all(i)}}class GLTFMaterialsVolumeExtension{constructor(e){this.parser=e,this.name=Xe.KHR_MATERIALS_VOLUME}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?oe:null}extendMaterialParams(e,t){const r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[],s=n.extensions[this.name];t.thickness=void 0!==s.thicknessFactor?s.thicknessFactor:0,void 0!==s.thicknessTexture&&i.push(r.assignTexture(t,"thicknessMap",s.thicknessTexture)),t.attenuationDistance=s.attenuationDistance||1/0;const o=s.attenuationColor||[1,1,1];return t.attenuationColor=(new c).setRGB(o[0],o[1],o[2],X),Promise.all(i)}}class GLTFMaterialsIorExtension{constructor(e){this.parser=e,this.name=Xe.KHR_MATERIALS_IOR}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?oe:null}extendMaterialParams(e,t){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const n=r.extensions[this.name];return t.ior=void 0!==n.ior?n.ior:1.5,Promise.resolve()}}class GLTFMaterialsSpecularExtension{constructor(e){this.parser=e,this.name=Xe.KHR_MATERIALS_SPECULAR}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?oe:null}extendMaterialParams(e,t){const r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[],s=n.extensions[this.name];t.specularIntensity=void 0!==s.specularFactor?s.specularFactor:1,void 0!==s.specularTexture&&i.push(r.assignTexture(t,"specularIntensityMap",s.specularTexture));const o=s.specularColorFactor||[1,1,1];return t.specularColor=(new c).setRGB(o[0],o[1],o[2],X),void 0!==s.specularColorTexture&&i.push(r.assignTexture(t,"specularColorMap",s.specularColorTexture,Ve)),Promise.all(i)}}class GLTFMaterialsBumpExtension{constructor(e){this.parser=e,this.name=Xe.EXT_MATERIALS_BUMP}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?oe:null}extendMaterialParams(e,t){const r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[],s=n.extensions[this.name];return t.bumpScale=void 0!==s.bumpFactor?s.bumpFactor:1,void 0!==s.bumpTexture&&i.push(r.assignTexture(t,"bumpMap",s.bumpTexture)),Promise.all(i)}}class GLTFMaterialsAnisotropyExtension{constructor(e){this.parser=e,this.name=Xe.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?oe:null}extendMaterialParams(e,t){const r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[],s=n.extensions[this.name];return void 0!==s.anisotropyStrength&&(t.anisotropy=s.anisotropyStrength),void 0!==s.anisotropyRotation&&(t.anisotropyRotation=s.anisotropyRotation),void 0!==s.anisotropyTexture&&i.push(r.assignTexture(t,"anisotropyMap",s.anisotropyTexture)),Promise.all(i)}}class GLTFTextureBasisUExtension{constructor(e){this.parser=e,this.name=Xe.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,r=t.json,n=r.textures[e];if(!n.extensions||!n.extensions[this.name])return null;const i=n.extensions[this.name],s=t.options.ktx2Loader;if(!s){if(r.extensionsRequired&&r.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,i.source,s)}}class GLTFTextureWebPExtension{constructor(e){this.parser=e,this.name=Xe.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,r=this.parser,n=r.json,i=n.textures[e];if(!i.extensions||!i.extensions[t])return null;const s=i.extensions[t],o=n.images[s.source];let a=r.textureLoader;if(o.uri){const e=r.options.manager.getHandler(o.uri);null!==e&&(a=e)}return this.detectSupport().then((function(i){if(i)return r.loadTextureImage(e,s.source,a);if(n.extensionsRequired&&n.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.loadTexture(e)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported}}class GLTFTextureAVIFExtension{constructor(e){this.parser=e,this.name=Xe.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,r=this.parser,n=r.json,i=n.textures[e];if(!i.extensions||!i.extensions[t])return null;const s=i.extensions[t],o=n.images[s.source];let a=r.textureLoader;if(o.uri){const e=r.options.manager.getHandler(o.uri);null!==e&&(a=e)}return this.detectSupport().then((function(i){if(i)return r.loadTextureImage(e,s.source,a);if(n.extensionsRequired&&n.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return r.loadTexture(e)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported}}class GLTFMeshoptCompression{constructor(e){this.name=Xe.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,r=t.bufferViews[e];if(r.extensions&&r.extensions[this.name]){const e=r.extensions[this.name],n=this.parser.getDependency("buffer",e.buffer),i=this.parser.options.meshoptDecoder;if(!i||!i.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return n.then((function(t){const r=e.byteOffset||0,n=e.byteLength||0,s=e.count,o=e.byteStride,a=new Uint8Array(t,r,n);return i.decodeGltfBufferAsync?i.decodeGltfBufferAsync(s,o,a,e.mode,e.filter).then((function(e){return e.buffer})):i.ready.then((function(){const t=new ArrayBuffer(s*o);return i.decodeGltfBuffer(new Uint8Array(t),s,o,a,e.mode,e.filter),t}))}))}return null}}class GLTFMeshGpuInstancing{constructor(e){this.name=Xe.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,r=t.nodes[e];if(!r.extensions||!r.extensions[this.name]||void 0===r.mesh)return null;const n=t.meshes[r.mesh];for(const e of n.primitives)if(e.mode!==rt.TRIANGLES&&e.mode!==rt.TRIANGLE_STRIP&&e.mode!==rt.TRIANGLE_FAN&&void 0!==e.mode)return null;const i=r.extensions[this.name].attributes,s=[],o={};for(const e in i)s.push(this.parser.getDependency("accessor",i[e]).then((t=>(o[e]=t,o[e]))));return s.length<1?null:(s.push(this.parser.createNodeMesh(e)),Promise.all(s).then((e=>{const t=e.pop(),r=t.isGroup?t.children:[t],n=e[0].count,i=[];for(const e of r){const t=new ne,r=new Ge,s=new _e,a=new Ge(1,1,1),l=new y(e.geometry,e.material,n);for(let e=0;e<n;e++)o.TRANSLATION&&r.fromBufferAttribute(o.TRANSLATION,e),o.ROTATION&&s.fromBufferAttribute(o.ROTATION,e),o.SCALE&&a.fromBufferAttribute(o.SCALE,e),l.setMatrixAt(e,t.compose(r,s,a));for(const t in o)if("_COLOR_0"===t){const e=o[t];l.instanceColor=new qe(e.array,e.itemSize,e.normalized)}else"TRANSLATION"!==t&&"ROTATION"!==t&&"SCALE"!==t&&e.geometry.setAttribute(t,o[t]);pe.prototype.copy.call(l,e),this.parser.assignFinalMaterial(l),i.push(l)}return t.isGroup?(t.clear(),t.add(...i),t):i[0]})))}}const Ye="glTF",Qe=1313821514,et=5130562;class GLTFBinaryExtension{constructor(e){this.name=Xe.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,12),r=new TextDecoder;if(this.header={magic:r.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==Ye)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const n=this.header.length-12,i=new DataView(e,12);let s=0;for(;s<n;){const t=i.getUint32(s,!0);s+=4;const n=i.getUint32(s,!0);if(s+=4,n===Qe){const n=new Uint8Array(e,12+s,t);this.content=r.decode(n)}else if(n===et){const r=12+s;this.body=e.slice(r,r+t)}s+=t}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class GLTFDracoMeshCompressionExtension{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=Xe.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const r=this.json,n=this.dracoLoader,i=e.extensions[this.name].bufferView,s=e.extensions[this.name].attributes,o={},a={},l={};for(const e in s){const t=at[e]||e.toLowerCase();o[t]=s[e]}for(const t in e.attributes){const n=at[t]||t.toLowerCase();if(void 0!==s[t]){const i=r.accessors[e.attributes[t]],s=nt[i.componentType];l[n]=s.name,a[n]=!0===i.normalized}}return t.getDependency("bufferView",i).then((function(e){return new Promise((function(t,r){n.decodeDracoFile(e,(function(e){for(const t in e.attributes){const r=e.attributes[t],n=a[t];void 0!==n&&(r.normalized=n)}t(e)}),o,l,X,r)}))}))}}class GLTFTextureTransformExtension{constructor(){this.name=Xe.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return void 0!==t.texCoord&&t.texCoord!==e.channel||void 0!==t.offset||void 0!==t.rotation||void 0!==t.scale?(e=e.clone(),void 0!==t.texCoord&&(e.channel=t.texCoord),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),e.needsUpdate=!0,e):e}}class GLTFMeshQuantizationExtension{constructor(){this.name=Xe.KHR_MESH_QUANTIZATION}}class GLTFCubicSplineInterpolant extends _{constructor(e,t,r,n){super(e,t,r,n)}copySampleValue_(e){const t=this.resultBuffer,r=this.sampleValues,n=this.valueSize,i=e*n*3+n;for(let e=0;e!==n;e++)t[e]=r[i+e];return t}interpolate_(e,t,r,n){const i=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=2*o,l=3*o,c=n-t,u=(r-t)/c,d=u*u,h=d*u,p=e*l,m=p-l,f=-2*h+3*d,g=h-d,y=1-f,b=g-d+u;for(let e=0;e!==o;e++){const t=s[m+e+o],r=s[m+e+a]*c,n=s[p+e+o],l=s[p+e]*c;i[e]=y*t+b*r+f*n+g*l}return i}}const tt=new _e;class GLTFCubicSplineQuaternionInterpolant extends GLTFCubicSplineInterpolant{interpolate_(e,t,r,n){const i=super.interpolate_(e,t,r,n);return tt.fromArray(i).normalize().toArray(i),i}}const rt={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},nt={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},it={9728:ce,9729:q,9984:de,9985:Z,9986:ue,9987:$},st={33071:l,33648:le,10497:we},ot={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},at={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},lt={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},ct={CUBICSPLINE:void 0,LINEAR:w,STEP:x},ut="OPAQUE",dt="MASK",ht="BLEND";function pt(e,t,r){for(const n in r.extensions)void 0===e[n]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[n]=r.extensions[n])}function mt(e,t){void 0!==t.extras&&("object"==typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function ft(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(let r=0,n=t.weights.length;r<n;r++)e.morphTargetInfluences[r]=t.weights[r];if(t.extras&&Array.isArray(t.extras.targetNames)){const r=t.extras.targetNames;if(e.morphTargetInfluences.length===r.length){e.morphTargetDictionary={};for(let t=0,n=r.length;t<n;t++)e.morphTargetDictionary[r[t]]=t}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function gt(e){let t;const r=e.extensions&&e.extensions[Xe.KHR_DRACO_MESH_COMPRESSION];if(t=r?"draco:"+r.bufferView+":"+r.indices+":"+yt(r.attributes):e.indices+":"+yt(e.attributes)+":"+e.mode,void 0!==e.targets)for(let r=0,n=e.targets.length;r<n;r++)t+=":"+yt(e.targets[r]);return t}function yt(e){let t="";const r=Object.keys(e).sort();for(let n=0,i=r.length;n<i;n++)t+=r[n]+":"+e[r[n]]+";";return t}function bt(e){switch(e){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}const vt=new ne;class GLTFParser{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new GLTFRegistry,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let r=!1,n=!1,i=-1;"undefined"!=typeof navigator&&(r=!0===/^((?!chrome|android).)*safari/i.test(navigator.userAgent),n=navigator.userAgent.indexOf("Firefox")>-1,i=n?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),"undefined"==typeof createImageBitmap||r||n&&i<98?this.textureLoader=new Ie(this.options.manager):this.textureLoader=new g(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new p(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const r=this,n=this.json,i=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll((function(e){return e._markDefs&&e._markDefs()})),Promise.all(this._invokeAll((function(e){return e.beforeRoot&&e.beforeRoot()}))).then((function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])})).then((function(t){const s={scene:t[0][n.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:n.asset,parser:r,userData:{}};return pt(i,s,n),mt(s,n),Promise.all(r._invokeAll((function(e){return e.afterRoot&&e.afterRoot(s)}))).then((function(){e(s)}))})).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[];for(let r=0,n=t.length;r<n;r++){const n=t[r].joints;for(let t=0,r=n.length;t<r;t++)e[n[t]].isBone=!0}for(let t=0,n=e.length;t<n;t++){const n=e[t];void 0!==n.mesh&&(this._addNodeRef(this.meshCache,n.mesh),void 0!==n.skin&&(r[n.mesh].isSkinnedMesh=!0)),void 0!==n.camera&&this._addNodeRef(this.cameraCache,n.camera)}}_addNodeRef(e,t){void 0!==t&&(void 0===e.refs[t]&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,r){if(e.refs[t]<=1)return r;const n=r.clone(),i=(e,t)=>{const r=this.associations.get(e);null!=r&&this.associations.set(t,r);for(const[r,n]of e.children.entries())i(n,t.children[r])};return i(r,n),n.name+="_instance_"+e.uses[t]++,n}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let r=0;r<t.length;r++){const n=e(t[r]);if(n)return n}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const r=[];for(let n=0;n<t.length;n++){const i=e(t[n]);i&&r.push(i)}return r}getDependency(e,t){const r=e+":"+t;let n=this.cache.get(r);if(!n){switch(e){case"scene":n=this.loadScene(t);break;case"node":n=this._invokeOne((function(e){return e.loadNode&&e.loadNode(t)}));break;case"mesh":n=this._invokeOne((function(e){return e.loadMesh&&e.loadMesh(t)}));break;case"accessor":n=this.loadAccessor(t);break;case"bufferView":n=this._invokeOne((function(e){return e.loadBufferView&&e.loadBufferView(t)}));break;case"buffer":n=this.loadBuffer(t);break;case"material":n=this._invokeOne((function(e){return e.loadMaterial&&e.loadMaterial(t)}));break;case"texture":n=this._invokeOne((function(e){return e.loadTexture&&e.loadTexture(t)}));break;case"skin":n=this.loadSkin(t);break;case"animation":n=this._invokeOne((function(e){return e.loadAnimation&&e.loadAnimation(t)}));break;case"camera":n=this.loadCamera(t);break;default:if(n=this._invokeOne((function(r){return r!=this&&r.getDependency&&r.getDependency(e,t)})),!n)throw new Error("Unknown type: "+e)}this.cache.add(r,n)}return n}getDependencies(e){let t=this.cache.get(e);if(!t){const r=this,n=this.json[e+("mesh"===e?"es":"s")]||[];t=Promise.all(n.map((function(t,n){return r.getDependency(e,n)}))),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],r=this.fileLoader;if(t.type&&"arraybuffer"!==t.type)throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(void 0===t.uri&&0===e)return Promise.resolve(this.extensions[Xe.KHR_BINARY_GLTF].body);const n=this.options;return new Promise((function(e,i){r.load(ee.resolveURL(t.uri,n.path),e,void 0,(function(){i(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))}))}))}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then((function(e){const r=t.byteLength||0,n=t.byteOffset||0;return e.slice(n,n+r)}))}loadAccessor(e){const t=this,r=this.json,n=this.json.accessors[e];if(void 0===n.bufferView&&void 0===n.sparse){const e=ot[n.type],t=nt[n.componentType],r=!0===n.normalized,i=new t(n.count*e);return Promise.resolve(new o(i,e,r))}const i=[];return void 0!==n.bufferView?i.push(this.getDependency("bufferView",n.bufferView)):i.push(null),void 0!==n.sparse&&(i.push(this.getDependency("bufferView",n.sparse.indices.bufferView)),i.push(this.getDependency("bufferView",n.sparse.values.bufferView))),Promise.all(i).then((function(e){const i=e[0],s=ot[n.type],a=nt[n.componentType],l=a.BYTES_PER_ELEMENT,c=l*s,u=n.byteOffset||0,d=void 0!==n.bufferView?r.bufferViews[n.bufferView].byteStride:void 0,h=!0===n.normalized;let p,m;if(d&&d!==c){const e=Math.floor(u/d),r="InterleavedBuffer:"+n.bufferView+":"+n.componentType+":"+e+":"+n.count;let o=t.cache.get(r);o||(p=new a(i,e*d,n.count*d/l),o=new b(p,d/l),t.cache.add(r,o)),m=new v(o,s,u%d/l,h)}else p=null===i?new a(n.count*s):new a(i,u,n.count*s),m=new o(p,s,h);if(void 0!==n.sparse){const t=ot.SCALAR,r=nt[n.sparse.indices.componentType],l=n.sparse.indices.byteOffset||0,c=n.sparse.values.byteOffset||0,u=new r(e[1],l,n.sparse.count*t),d=new a(e[2],c,n.sparse.count*s);null!==i&&(m=new o(m.array.slice(),m.itemSize,m.normalized));for(let e=0,t=u.length;e<t;e++){const t=u[e];if(m.setX(t,d[e*s]),s>=2&&m.setY(t,d[e*s+1]),s>=3&&m.setZ(t,d[e*s+2]),s>=4&&m.setW(t,d[e*s+3]),s>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return m}))}loadTexture(e){const t=this.json,r=this.options,n=t.textures[e].source,i=t.images[n];let s=this.textureLoader;if(i.uri){const e=r.manager.getHandler(i.uri);null!==e&&(s=e)}return this.loadTextureImage(e,n,s)}loadTextureImage(e,t,r){const n=this,i=this.json,s=i.textures[e],o=i.images[t],a=(o.uri||o.bufferView)+":"+s.sampler;if(this.textureCache[a])return this.textureCache[a];const l=this.loadImageSource(t,r).then((function(t){t.flipY=!1,t.name=s.name||o.name||"",""===t.name&&"string"==typeof o.uri&&!1===o.uri.startsWith("data:image/")&&(t.name=o.uri);const r=(i.samplers||{})[s.sampler]||{};return t.magFilter=it[r.magFilter]||q,t.minFilter=it[r.minFilter]||$,t.wrapS=st[r.wrapS]||we,t.wrapT=st[r.wrapT]||we,n.associations.set(t,{textures:e}),t})).catch((function(){return null}));return this.textureCache[a]=l,l}loadImageSource(e,t){const r=this,n=this.json,i=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then((e=>e.clone()));const s=n.images[e],o=self.URL||self.webkitURL;let a=s.uri||"",l=!1;if(void 0!==s.bufferView)a=r.getDependency("bufferView",s.bufferView).then((function(e){l=!0;const t=new Blob([e],{type:s.mimeType});return a=o.createObjectURL(t),a}));else if(void 0===s.uri)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const c=Promise.resolve(a).then((function(e){return new Promise((function(r,n){let s=r;!0===t.isImageBitmapLoader&&(s=function(e){const t=new ke(e);t.needsUpdate=!0,r(t)}),t.load(ee.resolveURL(e,i.path),s,void 0,n)}))})).then((function(e){var t;return!0===l&&o.revokeObjectURL(a),e.userData.mimeType=s.mimeType||((t=s.uri).search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/)?"image/jpeg":t.search(/\.webp($|\?)/i)>0||0===t.search(/^data\:image\/webp/)?"image/webp":"image/png"),e})).catch((function(e){throw console.error("THREE.GLTFLoader: Couldn't load texture",a),e}));return this.sourceCache[e]=c,c}assignTexture(e,t,r,n){const i=this;return this.getDependency("texture",r.index).then((function(s){if(!s)return null;if(void 0!==r.texCoord&&r.texCoord>0&&((s=s.clone()).channel=r.texCoord),i.extensions[Xe.KHR_TEXTURE_TRANSFORM]){const e=void 0!==r.extensions?r.extensions[Xe.KHR_TEXTURE_TRANSFORM]:void 0;if(e){const t=i.associations.get(s);s=i.extensions[Xe.KHR_TEXTURE_TRANSFORM].extendTexture(s,e),i.associations.set(s,t)}}return void 0!==n&&(s.colorSpace=n),e[t]=s,s}))}assignFinalMaterial(e){const t=e.geometry;let r=e.material;const n=void 0===t.attributes.tangent,i=void 0!==t.attributes.color,s=void 0===t.attributes.normal;if(e.isPoints){const e="PointsMaterial:"+r.uuid;let t=this.cache.get(e);t||(t=new be,te.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,t.sizeAttenuation=!1,this.cache.add(e,t)),r=t}else if(e.isLine){const e="LineBasicMaterial:"+r.uuid;let t=this.cache.get(e);t||(t=new k,te.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,this.cache.add(e,t)),r=t}if(n||i||s){let e="ClonedMaterial:"+r.uuid+":";n&&(e+="derivative-tangents:"),i&&(e+="vertex-colors:"),s&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=r.clone(),i&&(t.vertexColors=!0),s&&(t.flatShading=!0),n&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(r))),r=t}e.material=r}getMaterialType(){return ae}loadMaterial(e){const t=this,r=this.json,n=this.extensions,i=r.materials[e];let s;const o={},a=[];if((i.extensions||{})[Xe.KHR_MATERIALS_UNLIT]){const e=n[Xe.KHR_MATERIALS_UNLIT];s=e.getMaterialType(),a.push(e.extendParams(o,i,t))}else{const r=i.pbrMetallicRoughness||{};if(o.color=new c(1,1,1),o.opacity=1,Array.isArray(r.baseColorFactor)){const e=r.baseColorFactor;o.color.setRGB(e[0],e[1],e[2],X),o.opacity=e[3]}void 0!==r.baseColorTexture&&a.push(t.assignTexture(o,"map",r.baseColorTexture,Ve)),o.metalness=void 0!==r.metallicFactor?r.metallicFactor:1,o.roughness=void 0!==r.roughnessFactor?r.roughnessFactor:1,void 0!==r.metallicRoughnessTexture&&(a.push(t.assignTexture(o,"metalnessMap",r.metallicRoughnessTexture)),a.push(t.assignTexture(o,"roughnessMap",r.metallicRoughnessTexture))),s=this._invokeOne((function(t){return t.getMaterialType&&t.getMaterialType(e)})),a.push(Promise.all(this._invokeAll((function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,o)}))))}!0===i.doubleSided&&(o.side=h);const l=i.alphaMode||ut;if(l===ht?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,l===dt&&(o.alphaTest=void 0!==i.alphaCutoff?i.alphaCutoff:.5)),void 0!==i.normalTexture&&s!==se&&(a.push(t.assignTexture(o,"normalMap",i.normalTexture)),o.normalScale=new ze(1,1),void 0!==i.normalTexture.scale)){const e=i.normalTexture.scale;o.normalScale.set(e,e)}if(void 0!==i.occlusionTexture&&s!==se&&(a.push(t.assignTexture(o,"aoMap",i.occlusionTexture)),void 0!==i.occlusionTexture.strength&&(o.aoMapIntensity=i.occlusionTexture.strength)),void 0!==i.emissiveFactor&&s!==se){const e=i.emissiveFactor;o.emissive=(new c).setRGB(e[0],e[1],e[2],X)}return void 0!==i.emissiveTexture&&s!==se&&a.push(t.assignTexture(o,"emissiveMap",i.emissiveTexture,Ve)),Promise.all(a).then((function(){const r=new s(o);return i.name&&(r.name=i.name),mt(r,i),t.associations.set(r,{materials:e}),i.extensions&&pt(n,r,i),r}))}createUniqueName(e){const t=ve.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,r=this.extensions,n=this.primitiveCache;function i(e){return r[Xe.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then((function(r){return _t(r,e,t)}))}const s=[];for(let r=0,o=e.length;r<o;r++){const o=e[r],l=gt(o),c=n[l];if(c)s.push(c.promise);else{let e;e=o.extensions&&o.extensions[Xe.KHR_DRACO_MESH_COMPRESSION]?i(o):_t(new a,o,t),n[l]={primitive:o,promise:e},s.push(e)}}return Promise.all(s)}loadMesh(e){const t=this,r=this.json,n=this.extensions,i=r.meshes[e],s=i.primitives,o=[];for(let e=0,t=s.length;e<t;e++){const t=void 0===s[e].material?(void 0===(a=this.cache).DefaultMaterial&&(a.DefaultMaterial=new ae({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:m})),a.DefaultMaterial):this.getDependency("material",s[e].material);o.push(t)}var a;return o.push(t.loadGeometries(s)),Promise.all(o).then((function(r){const o=r.slice(0,r.length-1),a=r[r.length-1],l=[];for(let r=0,c=a.length;r<c;r++){const c=a[r],u=s[r];let d;const h=o[r];if(u.mode===rt.TRIANGLES||u.mode===rt.TRIANGLE_STRIP||u.mode===rt.TRIANGLE_FAN||void 0===u.mode)d=!0===i.isSkinnedMesh?new Pe(c,h):new ie(c,h),!0===d.isSkinnedMesh&&d.normalizeSkinWeights(),u.mode===rt.TRIANGLE_STRIP?d.geometry=toTrianglesDrawMode(d.geometry,He):u.mode===rt.TRIANGLE_FAN&&(d.geometry=toTrianglesDrawMode(d.geometry,je));else if(u.mode===rt.LINES)d=new z(c,h);else if(u.mode===rt.LINE_STRIP)d=new R(c,h);else if(u.mode===rt.LINE_LOOP)d=new j(c,h);else{if(u.mode!==rt.POINTS)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+u.mode);d=new ye(c,h)}Object.keys(d.geometry.morphAttributes).length>0&&ft(d,i),d.name=t.createUniqueName(i.name||"mesh_"+e),mt(d,i),u.extensions&&pt(n,d,u),t.assignFinalMaterial(d),l.push(d)}for(let r=0,n=l.length;r<n;r++)t.associations.set(l[r],{meshes:e,primitives:r});if(1===l.length)return i.extensions&&pt(n,l[0],i),l[0];const c=$e.mergeGeometries(l.map((e=>e.geometry)),!0),u=l.map((e=>e.material)),d=l.first();return d.geometry=c,d.material=u,i.extensions&&pt(n,d,i),d}))}loadCamera(e){let t;const r=this.json.cameras[e],n=r[r.type];if(n)return"perspective"===r.type?t=new fe(re.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):"orthographic"===r.type&&(t=new me(-n.xmag,n.xmag,n.ymag,-n.ymag,n.znear,n.zfar)),r.name&&(t.name=this.createUniqueName(r.name)),mt(t,r),Promise.resolve(t);console.warn("THREE.GLTFLoader: Missing camera parameters.")}loadSkin(e){const t=this.json.skins[e],r=[];for(let e=0,n=t.joints.length;e<n;e++)r.push(this._loadNodeShallow(t.joints[e]));return void 0!==t.inverseBindMatrices?r.push(this.getDependency("accessor",t.inverseBindMatrices)):r.push(null),Promise.all(r).then((function(e){const r=e.pop(),n=e,i=[],s=[];for(let e=0,o=n.length;e<o;e++){const o=n[e];if(o){i.push(o);const t=new ne;null!==r&&t.fromArray(r.array,16*e),s.push(t)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[e])}return new Se(i,s)}))}loadAnimation(e){const t=this.json,r=this,i=t.animations[e],s=i.name?i.name:"animation_"+e,o=[],a=[],l=[],c=[],u=[];for(let e=0,t=i.channels.length;e<t;e++){const t=i.channels[e],r=i.samplers[t.sampler],n=t.target,s=n.node,d=void 0!==i.parameters?i.parameters[r.input]:r.input,h=void 0!==i.parameters?i.parameters[r.output]:r.output;void 0!==n.node&&(o.push(this.getDependency("node",s)),a.push(this.getDependency("accessor",d)),l.push(this.getDependency("accessor",h)),c.push(r),u.push(n))}return Promise.all([Promise.all(o),Promise.all(a),Promise.all(l),Promise.all(c),Promise.all(u)]).then((function(e){const t=e[0],i=e[1],o=e[2],a=e[3],l=e[4],c=[];for(let e=0,n=t.length;e<n;e++){const n=t[e],s=i[e],u=o[e],d=a[e],h=l[e];if(void 0===n)continue;n.updateMatrix&&n.updateMatrix();const p=r._createAnimationTracks(n,s,u,d,h);if(p)for(let e=0;e<p.length;e++)c.push(p[e])}return new n(s,void 0,c)}))}createNodeMesh(e){const t=this.json,r=this,n=t.nodes[e];return void 0===n.mesh?null:r.getDependency("mesh",n.mesh).then((function(e){const t=r._getNodeRef(r.meshCache,n.mesh,e);return void 0!==n.weights&&t.traverse((function(e){if(e.isMesh)for(let t=0,r=n.weights.length;t<r;t++)e.morphTargetInfluences[t]=n.weights[t]})),t}))}loadNode(e){const t=this,r=this.json.nodes[e],n=t._loadNodeShallow(e),i=[],s=r.children||[];for(let e=0,r=s.length;e<r;e++)i.push(t.getDependency("node",s[e]));const o=void 0===r.skin?Promise.resolve(null):t.getDependency("skin",r.skin);return Promise.all([n,Promise.all(i),o]).then((function(e){const t=e[0],r=e[1],n=e[2];null!==n&&t.traverse((function(e){e.isSkinnedMesh&&e.bind(n,vt)}));for(let e=0,n=r.length;e<n;e++)t.add(r[e]);return t}))}_loadNodeShallow(e){const t=this.json,r=this.extensions,n=this;if(void 0!==this.nodeCache[e])return this.nodeCache[e];const s=t.nodes[e],o=s.name?n.createUniqueName(s.name):"",a=[],l=n._invokeOne((function(t){return t.createNodeMesh&&t.createNodeMesh(e)}));return l&&a.push(l),void 0!==s.camera&&a.push(n.getDependency("camera",s.camera).then((function(e){return n._getNodeRef(n.cameraCache,s.camera,e)}))),n._invokeAll((function(t){return t.createNodeAttachment&&t.createNodeAttachment(e)})).forEach((function(e){a.push(e)})),this.nodeCache[e]=Promise.all(a).then((function(t){let a;if(a=!0===s.isBone?new i:t.length>1?new f:1===t.length?t[0]:new pe,a!==t[0])for(let e=0,r=t.length;e<r;e++)a.add(t[e]);if(s.name&&(a.userData.name=s.name,a.name=o),mt(a,s),s.extensions&&pt(r,a,s),void 0!==s.matrix){const e=new ne;e.fromArray(s.matrix),a.applyMatrix4(e)}else void 0!==s.translation&&a.position.fromArray(s.translation),void 0!==s.rotation&&a.quaternion.fromArray(s.rotation),void 0!==s.scale&&a.scale.fromArray(s.scale);return n.associations.has(a)||n.associations.set(a,{}),n.associations.get(a).nodes=e,a})),this.nodeCache[e]}loadScene(e){const t=this.extensions,r=this.json.scenes[e],n=this,i=new f;r.name&&(i.name=n.createUniqueName(r.name)),mt(i,r),r.extensions&&pt(t,i,r);const s=r.nodes||[],o=[];for(let e=0,t=s.length;e<t;e++)o.push(n.getDependency("node",s[e]));return Promise.all(o).then((function(e){for(let t=0,r=e.length;t<r;t++)i.add(e[t]);return n.associations=(e=>{const t=new Map;for(const[e,r]of n.associations)(e instanceof te||e instanceof ke)&&t.set(e,r);return e.traverse((e=>{const r=n.associations.get(e);null!=r&&t.set(e,r)})),t})(i),i}))}_createAnimationTracks(e,t,r,n,i){const s=[],o=e.name?e.name:e.uuid,a=[];let l;switch(lt[i.path]===lt.weights?e.traverse((function(e){e.morphTargetInfluences&&a.push(e.name?e.name:e.uuid)})):a.push(o),lt[i.path]){case lt.weights:l=he;break;case lt.rotation:l=xe;break;case lt.position:case lt.scale:l=We;break;default:if(1===r.itemSize)l=he;else l=We}const c=void 0!==n.interpolation?ct[n.interpolation]:w,u=this._getArrayFromAccessor(r);for(let e=0,r=a.length;e<r;e++){const r=new l(a[e]+"."+lt[i.path],t.array,u,c);"CUBICSPLINE"===n.interpolation&&this._createCubicSplineTrackInterpolant(r),s.push(r)}return s}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const e=bt(t.constructor),r=new Float32Array(t.length);for(let n=0,i=t.length;n<i;n++)r[n]=t[n]*e;t=r}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(e){return new(this instanceof xe?GLTFCubicSplineQuaternionInterpolant:GLTFCubicSplineInterpolant)(this.times,this.values,this.getValueSize()/3,e)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function _t(e,t,r){const n=t.attributes,i=[];function o(t,n){return r.getDependency("accessor",t).then((function(t){e.setAttribute(n,t)}))}for(const t in n){const r=at[t]||t.toLowerCase();r in e.attributes||i.push(o(n[t],r))}if(void 0!==t.indices&&!e.index){const n=r.getDependency("accessor",t.indices).then((function(t){e.setIndex(t)}));i.push(n)}return u.workingColorSpace!==X&&"COLOR_0"in n&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${u.workingColorSpace}" not supported.`),mt(e,t),function(e,t,r){const n=t.attributes,i=new s;if(void 0===n.POSITION)return;{const e=r.json.accessors[n.POSITION],t=e.min,s=e.max;if(void 0===t||void 0===s)return void console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");if(i.set(new Ge(t[0],t[1],t[2]),new Ge(s[0],s[1],s[2])),e.normalized){const t=bt(nt[e.componentType]);i.min.multiplyScalar(t),i.max.multiplyScalar(t)}}const o=t.targets;if(void 0!==o){const e=new Ge,t=new Ge;for(let n=0,i=o.length;n<i;n++){const i=o[n];if(void 0!==i.POSITION){const n=r.json.accessors[i.POSITION],s=n.min,o=n.max;if(void 0!==s&&void 0!==o){if(t.setX(Math.max(Math.abs(s[0]),Math.abs(o[0]))),t.setY(Math.max(Math.abs(s[1]),Math.abs(o[1]))),t.setZ(Math.max(Math.abs(s[2]),Math.abs(o[2]))),n.normalized){const e=bt(nt[n.componentType]);t.multiplyScalar(e)}e.max(t)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}i.expandByVector(e)}e.boundingBox=i;const a=new Te;i.getCenter(a.center),a.radius=i.min.distanceTo(i.max)/2,e.boundingSphere=a}(e,t,r),Promise.all(i).then((function(){return void 0!==t.targets?function(e,t,r){let n=!1,i=!1,s=!1;for(let e=0,r=t.length;e<r;e++){const r=t[e];if(void 0!==r.POSITION&&(n=!0),void 0!==r.NORMAL&&(i=!0),void 0!==r.COLOR_0&&(s=!0),n&&i&&s)break}if(!n&&!i&&!s)return Promise.resolve(e);const o=[],a=[],l=[];for(let c=0,u=t.length;c<u;c++){const u=t[c];if(n){const t=void 0!==u.POSITION?r.getDependency("accessor",u.POSITION):e.attributes.position;o.push(t)}if(i){const t=void 0!==u.NORMAL?r.getDependency("accessor",u.NORMAL):e.attributes.normal;a.push(t)}if(s){const t=void 0!==u.COLOR_0?r.getDependency("accessor",u.COLOR_0):e.attributes.color;l.push(t)}}return Promise.all([Promise.all(o),Promise.all(a),Promise.all(l)]).then((function(t){const r=t[0],o=t[1],a=t[2];return n&&(e.morphAttributes.position=r),i&&(e.morphAttributes.normal=o),s&&(e.morphAttributes.color=a),e.morphTargetsRelative=!0,e}))}(e,t.targets,r):e}))}e.exports=class GLTFLoader extends Y{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register((function(e){return new GLTFMaterialsClearcoatExtension(e)})),this.register((function(e){return new GLTFTextureBasisUExtension(e)})),this.register((function(e){return new GLTFTextureWebPExtension(e)})),this.register((function(e){return new GLTFTextureAVIFExtension(e)})),this.register((function(e){return new GLTFMaterialsSheenExtension(e)})),this.register((function(e){return new GLTFMaterialsTransmissionExtension(e)})),this.register((function(e){return new GLTFMaterialsVolumeExtension(e)})),this.register((function(e){return new GLTFMaterialsIorExtension(e)})),this.register((function(e){return new GLTFMaterialsEmissiveStrengthExtension(e)})),this.register((function(e){return new GLTFMaterialsSpecularExtension(e)})),this.register((function(e){return new GLTFMaterialsIridescenceExtension(e)})),this.register((function(e){return new GLTFMaterialsAnisotropyExtension(e)})),this.register((function(e){return new GLTFMaterialsBumpExtension(e)})),this.register((function(e){return new GLTFLightsExtension(e)})),this.register((function(e){return new GLTFMeshoptCompression(e)})),this.register((function(e){return new GLTFMeshGpuInstancing(e)}))}load(e,t,r,n){const i=this;let s;if(""!==this.resourcePath)s=this.resourcePath;else if(""!==this.path){const t=ee.extractUrlBase(e);s=ee.resolveURL(t,this.path)}else s=ee.extractUrlBase(e);this.manager.itemStart(e);const o=function(t){n?n(t):console.error(t),i.manager.itemError(e),i.manager.itemEnd(e)},a=new p(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,(function(r){try{i.parse(r,s,(function(r){t(r),i.manager.itemEnd(e)}),o)}catch(e){o(e)}}),r,o)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return-1===this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.push(e),this}unregister(e){return-1!==this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,r,n){let i;const s={},o={},a=new TextDecoder;if("string"==typeof e)i=JSON.parse(e);else if(e instanceof ArrayBuffer){if(a.decode(new Uint8Array(e,0,4))===Ye){try{s[Xe.KHR_BINARY_GLTF]=new GLTFBinaryExtension(e)}catch(e){return void(n&&n(e))}i=JSON.parse(s[Xe.KHR_BINARY_GLTF].content)}else i=JSON.parse(a.decode(e))}else i=e;if(void 0===i.asset||i.asset.version[0]<2)return void(n&&n(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.")));const l=new GLTFParser(i,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e<this.pluginCallbacks.length;e++){const t=this.pluginCallbacks[e](l);t.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),o[t.name]=t,s[t.name]=!0}if(i.extensionsUsed)for(let e=0;e<i.extensionsUsed.length;++e){const t=i.extensionsUsed[e],r=i.extensionsRequired||[];switch(t){case Xe.KHR_MATERIALS_UNLIT:s[t]=new GLTFMaterialsUnlitExtension;break;case Xe.KHR_DRACO_MESH_COMPRESSION:s[t]=new GLTFDracoMeshCompressionExtension(i,this.dracoLoader);break;case Xe.KHR_TEXTURE_TRANSFORM:s[t]=new GLTFTextureTransformExtension;break;case Xe.KHR_MESH_QUANTIZATION:s[t]=new GLTFMeshQuantizationExtension;break;default:r.indexOf(t)>=0&&void 0===o[t]&&console.warn('THREE.GLTFLoader: Unknown extension "'+t+'".')}}l.setExtensions(s),l.setPlugins(o),l.parse(r,n)}parseAsync(e,t){const r=this;return new Promise((function(n,i){r.parse(e,t,n,i)}))}}},50254:(e,t,r)=>{const{Color:n,FrontSide:i,Matrix4:s,Mesh:o,PerspectiveCamera:a,Plane:l,ShaderMaterial:c,UniformsLib:u,UniformsUtils:d,Vector3:h,Vector4:p,WebGLRenderTarget:m}=r(37732).three;e.exports=class Water extends o{constructor(e,t={}){super(e),this.isWater=!0;const r=this,o=void 0!==t.textureWidth?t.textureWidth:512,f=void 0!==t.textureHeight?t.textureHeight:512,g=void 0!==t.clipBias?t.clipBias:0,y=void 0!==t.alpha?t.alpha:1,b=void 0!==t.time?t.time:0,v=void 0!==t.waterNormals?t.waterNormals:null,_=void 0!==t.sunDirection?t.sunDirection:new h(.70707,.70707,0),x=new n(void 0!==t.sunColor?t.sunColor:16777215),w=new n(void 0!==t.waterColor?t.waterColor:8355711),R=void 0!==t.eye?t.eye:new h(0,0,0),k=void 0!==t.distortionScale?t.distortionScale:20,j=void 0!==t.side?t.side:i,z=void 0!==t.fog&&t.fog,q=new l,$=new h,Z=new h,X=new h,Y=new s,ee=new h(0,0,-1),te=new p,re=new h,ne=new h,ie=new p,se=new s,oe=new a,ae=new m(o,f),le={uniforms:d.merge([u.fog,u.lights,{normalSampler:{value:null},mirrorSampler:{value:null},alpha:{value:1},time:{value:0},size:{value:1},distortionScale:{value:20},textureMatrix:{value:new s},sunColor:{value:new n(8355711)},sunDirection:{value:new h(.70707,.70707,0)},eye:{value:new h},waterColor:{value:new n(5592405)}}]),vertexShader:"\n\t\t\t\tuniform mat4 textureMatrix;\n\t\t\t\tuniform float time;\n\t\t\t\tvarying vec4 mirrorCoord;\n\t\t\t\tvarying vec4 worldPosition;\n\t\t\t\t#include <common>\n\t\t\t\t#include <fog_pars_vertex>\n\t\t\t\t#include <shadowmap_pars_vertex>\n\t\t\t\t#include <logdepthbuf_pars_vertex>\n\t\t\t\tvoid main() {\n\t\t\t\t\tmirrorCoord = modelMatrix * vec4( position, 1.0 );\n\t\t\t\t\tworldPosition = mirrorCoord.xyzw;\n\t\t\t\t\tmirrorCoord = textureMatrix * mirrorCoord;\n\t\t\t\t\tvec4 mvPosition =  modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t\tgl_Position = projectionMatrix * mvPosition;\n\t\t\t\t#include <beginnormal_vertex>\n\t\t\t\t#include <defaultnormal_vertex>\n\t\t\t\t#include <logdepthbuf_vertex>\n\t\t\t\t#include <fog_vertex>\n\t\t\t\t#include <shadowmap_vertex>\n\t\t\t}",fragmentShader:"\n        uniform sampler2D mirrorSampler;\n        uniform float alpha;\n        uniform float time;\n        uniform float size;\n        uniform float distortionScale;\n        uniform sampler2D normalSampler;\n        uniform vec3 sunColor;\n        uniform vec3 sunDirection;\n        uniform vec3 eye;\n        uniform vec3 waterColor;\n        varying vec4 mirrorCoord;\n        varying vec4 worldPosition;\n        vec4 getNoise( vec2 uv ) {\n        \tvec2 uv0 = ( uv / 103.0 ) + vec2(time / 17.0, time / 29.0);\n        \tvec2 uv1 = uv / 107.0-vec2( time / -19.0, time / 31.0 );\n        \tvec2 uv2 = uv / vec2( 8907.0, 9803.0 ) + vec2( time / 101.0, time / 97.0 );\n        \tvec2 uv3 = uv / vec2( 1091.0, 1027.0 ) - vec2( time / 109.0, time / -113.0 );\n        \tvec4 noise = texture2D( normalSampler, uv0 ) +\n        \t\ttexture2D( normalSampler, uv1 ) +\n        \t\ttexture2D( normalSampler, uv2 ) +\n        \t\ttexture2D( normalSampler, uv3 );\n        \treturn noise * 0.5 - 1.0;\n        }\n        void sunLight( const vec3 surfaceNormal, const vec3 eyeDirection, float shiny, float spec, float diffuse, inout vec3 diffuseColor, inout vec3 specularColor ) {\n        \tvec3 reflection = normalize( reflect( -sunDirection, surfaceNormal ) );\n        \tfloat direction = max( 0.0, dot( eyeDirection, reflection ) );\n        \tspecularColor += pow( direction, shiny ) * sunColor * spec;\n        \tdiffuseColor += max( dot( sunDirection, surfaceNormal ), 0.0 ) * sunColor * diffuse;\n        }\n        #include <common>\n        #include <packing>\n        #include <bsdfs>\n        #include <fog_pars_fragment>\n        #include <logdepthbuf_pars_fragment>\n        #include <lights_pars_begin>\n        #include <shadowmap_pars_fragment>\n        #include <shadowmask_pars_fragment>\n        void main() {\n        #include <logdepthbuf_fragment>\n        // MODIFIED FOR L.CAD\n        // Modified these two lines to work with L.CAD coordinate system\n        \tvec4 noise = getNoise(vec2(worldPosition.x, -worldPosition.y) * size );\n        \tvec3 surfaceNormal = normalize( vec3( noise.x, -noise.y, -noise.z ) * vec3( 1.5, 1.5, 1.0 ) );\n        \tvec3 diffuseLight = vec3(0.0);\n        \tvec3 specularLight = vec3(0.0);\n        \tvec3 worldToEye = eye-worldPosition.xyz;\n        \tvec3 eyeDirection = normalize( worldToEye );\n        \tsunLight( surfaceNormal, eyeDirection, 100.0, 2.0, 0.5, diffuseLight, specularLight );\n        \tfloat distance = length(worldToEye);\n        // MODIFIED FOR L.CAD\n        // Modified the next line to work with L.CAD coordinate system\n        \tvec2 distortion = surfaceNormal.xy * ( 0.001 + 1.0 / distance ) * distortionScale;\n        \tvec3 reflectionSample = vec3( texture2D( mirrorSampler, mirrorCoord.xy / mirrorCoord.w + distortion ) );\n        \tfloat theta = max( dot( eyeDirection, surfaceNormal ), 0.0 );\n        \tfloat rf0 = 0.3;\n        \tfloat reflectance = rf0 + ( 1.0 - rf0 ) * pow( ( 1.0 - theta ), 5.0 );\n        \tvec3 scatter = max( 0.0, dot( surfaceNormal, eyeDirection ) ) * waterColor;\n        \tvec3 albedo = mix( ( sunColor * diffuseLight * 0.3 + scatter ) * getShadowMask(), ( vec3( 0.1 ) + reflectionSample * 0.9 + reflectionSample * specularLight ), reflectance);\n        \tvec3 outgoingLight = albedo;\n        \tgl_FragColor = vec4( outgoingLight, alpha );\n          #include <tonemapping_fragment>\n          #include <fog_fragment>\n        }"},ce=new c({fragmentShader:le.fragmentShader,vertexShader:le.vertexShader,uniforms:d.clone(le.uniforms),lights:!0,side:j,fog:z});ce.uniforms.mirrorSampler.value=ae.texture,ce.uniforms.textureMatrix.value=se,ce.uniforms.alpha.value=y,ce.uniforms.time.value=b,ce.uniforms.normalSampler.value=v,ce.uniforms.sunColor.value=x,ce.uniforms.waterColor.value=w,ce.uniforms.sunDirection.value=_,ce.uniforms.distortionScale.value=k,ce.uniforms.eye.value=R,r.material=ce,r.update=()=>{ce.uniforms.time.value+=.7/60},r.onBeforeRender=function(e,t,n){if(Z.setFromMatrixPosition(r.matrixWorld),X.setFromMatrixPosition(n.matrixWorld),Y.extractRotation(r.matrixWorld),$.set(0,0,1),$.applyMatrix4(Y),re.subVectors(Z,X),re.dot($)>0)return;re.reflect($).negate(),re.add(Z),Y.extractRotation(n.matrixWorld),ee.set(0,0,-1),ee.applyMatrix4(Y),ee.add(X),ne.subVectors(Z,ee),ne.reflect($).negate(),ne.add(Z),oe.position.copy(re),oe.up.set(0,1,0),oe.up.applyMatrix4(Y),oe.up.reflect($),oe.lookAt(ne),oe.far=n.far,oe.updateMatrixWorld(),oe.projectionMatrix.copy(n.projectionMatrix),se.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),se.multiply(oe.projectionMatrix),se.multiply(oe.matrixWorldInverse),q.setFromNormalAndCoplanarPoint($,Z),q.applyMatrix4(oe.matrixWorldInverse),te.set(q.normal.x,q.normal.y,q.normal.z,q.constant);const i=oe.projectionMatrix;ie.x=(Math.sign(te.x)+i.elements[8])/i.elements[0],ie.y=(Math.sign(te.y)+i.elements[9])/i.elements[5],ie.z=-1,ie.w=(1+i.elements[10])/i.elements[14],te.multiplyScalar(2/te.dot(ie)),i.elements[2]=te.x,i.elements[6]=te.y,i.elements[10]=te.z+1-g,i.elements[14]=te.w,R.setFromMatrixPosition(n.matrixWorld),ae.texture.colorSpace=e.outputColorSpace;var s=e.getRenderTarget(),o=e.xr.enabled,a=e.shadowMap.autoUpdate;r.visible=!1;var l=t.background;t.background=t.environment,e.xr.enabled=!1,e.shadowMap.autoUpdate=!1,e.setRenderTarget(ae),e.state.buffers.depth.setMask(!0),!1===e.autoClear&&e.clear(),e.render(t,oe),r.visible=!0,t.background=l,e.xr.enabled=o,e.shadowMap.autoUpdate=a,e.setRenderTarget(s);const c=n.viewport;void 0!==c&&e.state.viewport(c)}}}},6773:(e,t,r)=>{var n=Object.create,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,c=(e,t,r)=>(r=null!=e?n(a(e)):{},((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let a of o(t))l.call(e,a)||a===r||i(e,a,{get:()=>t[a],enumerable:!(n=s(t,a))||n.enumerable});return e})(!t&&e&&e.__esModule?r:i(r,"default",{value:e,enumerable:!0}),e)),u=r(57075),d=c(r(21754)),h=c(r(23362)),p=c(r(12704)),m=c(r(10577)),f=c(r(50749)),g=c(r(70468)),y=c(r(35124)),b=c(r(18068)),v=c(r(74842)),_=c(r(12832)),x=c(r(5020)),w=c(r(65477));u.SmartObjectBuilder.configure((e=>{e.classes.addClasses(d.default,h.default,x.default,w.default,m.default,f.default,g.default,y.default,b.default,v.default,_.default,p.default)}))},21558:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(21754));var p={DEFAULT:new h.default("None",void 0)}},81970:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>y}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(63768)),m=r(7340),f=r(50988),g=d(r(87126));class Gate extends g.default{static makeGate(e){const t=new this(e);return t.setComponentOf(e),t}static minimumPostHeight(){throw new f.MissingOverride(this,"minimumPostHeight")}constructor(e){super(),this._opening=e}opening(){return this._opening}delegate(){return this._delegate}setDelegate(e){this._delegate=e}requiredOpeningWidth(e=p.unit(1,"in")){throw new f.MissingOverride(this,"requiredOpeningWidth")}materialSpecifier(){throw new f.MissingOverride(this,"materialSpecifier")}reset(){this._edge=void 0}edge(){return this._edge??=this._defaultEdge()}_defaultEdge(){return this.opening().edge()}async load(){return Promise.all(this.components().map((e=>e.load?.())))}components(){return[]}nonEssentialProperties(){return[...super.nonEssentialProperties(),...m.DisplayProperties.nonEssentialProperties(),"_edge"]}}(0,f.extend)(Gate,m.DisplayProperties);var y=Gate},21754:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>a}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));var a=class GateType{constructor(e,t){this._title=e,this._gateClass=t}title(){return this._title}gateClass(){return this._gateClass}hasGate(){return!!this.gateClass()}equals(e){return this.title()===e?.title()}}},23362:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>y}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(63768)),m=r(7340),f=r(62048),g=d(r(70468));class HybridSurfaceRailingPlacementStrategy extends g.default{defaultDisplayProperties(){return this.baseDisplayProperties()}displayPropertiesExposedAfterDrawing(){const e=this.lengthFormatter().baseUnit();return new m.PropertiesCollection(this,[new m.EditableProperty(this,"Slope",{type:"unit",defaultUnit:"deg",label:"Section Slope",ignoreIntermediateEdits:!0}),new m.EditableProperty(this,"Hypotenuse",{type:"unit",defaultUnit:e,label:"Section Surface Length",ignoreIntermediateEdits:!0}),new m.EditableProperty(this,"Rise",{type:"unit",defaultUnit:e,label:"Section Rise",ignoreIntermediateEdits:!0}),new m.EditableProperty(this,"Run",{type:"unit",defaultUnit:e,label:"Section Run",ignoreIntermediateEdits:!0}),new m.EditableProperty(this,"Stair Riser Count",{type:"number",label:"Nosings",ignoreIntermediateEdits:!0})])}showSlopeProperty(){return!1}showHypotenuseProperty(){return!1}showRunProperty(){return!0}showRiseProperty(){return!0}showStairRiserCountProperty(){return!0}slope(){const e=this.slopeRadians(),t=p.round(e.radiansToDegrees(),2);return p.unit(t,"deg")}setSlope(e){const t=p.multiply(this.run(),p.tan(e));this.updateRailingRun(t,void 0)}formatSlope(){return`${p.round(this.slope().toNumeric("deg"),2)} deg`}validateSlope(e,t){if(!e)return;const r=p.unit(0,"deg"),n=p.unit(89,"deg");if(p.smaller(t,r)){return`Must be ${`${Math.floor(r.toNumeric("deg")).rounded()}°`} or more.`}if(p.larger(t,n)){return`Must be ${`${Math.floor(n.toNumeric("deg")).rounded()}°`} or less.`}}slopeRadians(){return p.atan(this.pitch())}pitch(){return p.divide(this.rise(),this.run())}hypotenuse(){const e=this.rise().toNumeric(this.unit()),t=this.run().toNumeric(this.unit()),r=p.hypot(e,t);return p.unit(r,this.unit())}setHypotenuse(e){const t=p.multiply(e,p.sin(this.slope())),r=p.multiply(e,p.cos(this.slope()));this.updateRailingRun(t,r)}formatHypotenuse(){return this.lengthFormatter().format(this.hypotenuse())}validateHypotenuse(e,t){return this.validateRun(e,t)}rise(){if(!this.railingRun())return p.unit(0,"in");const e=this.railingRun().edge();return p.unit(Math.abs(e.begin().z()-e.end().z()),this.unit())}setRise(e){this.updateRailingRun(e,void 0)}formatRise(){return this.lengthFormatter().format(this.rise())}validateRise(e,t){if(!e)return;const r=p.unit(0,"in");if(p.smaller(t,r)){return`Must be ${this.lengthFormatter().format(r)} or more.`}}run(){return this.railingRun()?p.unit(this.railingRun().edge().xy().length(),this.unit()):p.unit(0,"in")}setRun(e){this.updateRailingRun(void 0,e)}formatRun(){return this.lengthFormatter().format(this.run())}validateRun(e,t){if(!e)return;const r=this.railingRun().sections().first().minLength();if(p.smaller(t,r)){return`Must be ${this.lengthFormatter().format(r)} or more.`}}stairRiserCount(){return this._stairRiserCount??=this._defaultStairRiserCount()}setStairRiserCount(e){const t=e<0?0:Math.floor(e);this._stairRiserCount=t,this.updateRailingRun()}_defaultStairRiserCount(){const e=this.run().toNumeric(this.unit()),t=p.unit(11,"in").toNumeric(this.unit());return Math.round(e/t)}clone(){const e=super.clone();return e.setStairRiserCount(this.stairRiserCount()),e}updateRailingRun(e=this.rise(),t=this.run()){this.railingRun()?.updateEdge(e,t),this.notifyPropertyChangedObservers()}stepRise(){return 0===this.stairRiserCount()?this.rise():p.divide(this.rise(),this.stairRiserCount())}stepRun(){return 0===this.stairRiserCount()?this.run():p.divide(this.run(),this.stairRiserCount())}initialEdge(e,t,r){const n=this.incrementSize(r).toNumeric(t),i=-this.surfaceHeight().toNumeric(t),s=(0,f.$P)(e.x(),e.y(),i),o=s.add(n,0);return s.to(o)}isRamp(){return!this.isLevel()&&0===this.stairRiserCount()}isLevel(){return this.rise().equals(p.unit(0,"in"))}isStairs(){return this.stairRiserCount()>0&&p.larger(this.rise(),p.unit(0,"in"))}minLength(){const e=this.railingRun().sections().first().constructor.minLength(),t=this.slopeRadians();return p.divide(e,Math.cos(t))}endpointMovedTo(e,t,{constrainToValidPosition:r,constrainToLengthIncrements:n}={}){const i=super.endpointMovedTo(e,t,{constrainToValidPosition:r,constrainToLengthIncrements:n}),s=this.railingRun().edge(),o=e===s.begin()?s.begin().z():s.end().z();return i.addZ(o)}}var y=HybridSurfaceRailingPlacementStrategy},70373:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(63768));const p=Object.freeze({AUTO:"AUTO",MAX_LENGTH:"MAX_LENGTH",SYMMETRIC:"SYMMETRIC",EVEN:"EVEN"});class RailLengthHelper{static mode=p;static createSystemParametersConfig(e,t,r){return{userLengthUnit:e,chunkingLength:t,maxLengthPreferenceThreshold:r}}static defaultSystemParametersConfig=Object.freeze({IMPERIAL:RailLengthHelper.createSystemParametersConfig("in",h.unit(1,"ft"),h.unit(50,"ft")),METRIC:RailLengthHelper.createSystemParametersConfig("mm",h.unit(1,"dm"),h.unit(12,"m"))});constructor(e,t,r="in",n=RailLengthHelper.defaultSystemParametersConfig.IMPERIAL){this._minLength=e,this._maxLength=t,this._worldUnit=r,this.setSystemParameters(n)}setSystemParameters(e){this._userLengthUnit=e.userLengthUnit,this._chunkingLength=e.chunkingLength,this._maxLengthPreferenceThreshold=e.maxLengthPreferenceThreshold}userLengthUnit(){return this._userLengthUnit}chunkingLength(){return this._chunkingLength}maxLengthPreferenceThreshold(){return this._maxLengthPreferenceThreshold}minLength(){return this._minLength}minLengthNumeric(){return this._toNumeric(this.minLength())}maxLength(){return this._maxLength}maxLengthNumeric(){return this._toNumeric(this.maxLength())}maxLengthTerminal(){return this.maxLength()}maxLengthInterior(){return this.maxLength()}unit(){return this._worldUnit}mode(){return this._mode??=p.AUTO}setMode(e){this._mode=e}_toNumeric(e){return e.toNumeric(this.unit()).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES)}_toPrecision(e){return Number(e.toPrecision(Math.SIGNIFICANT_DECIMAL_PLACES+2))}_isLessThanOrNearlyEqualTo(e,t){return e<t||e.isNearTo(t)}get railLengthPrecision(){return Math.SIGNIFICANT_DECIMAL_PLACES}railLengths(e){const t=h.unit(e.length().roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES),this.unit());let r;switch(this.mode()){case p.MAX_LENGTH:r=this.maxLengthRailLengths(t);break;case p.SYMMETRIC:r=this.symmetricRailLengths(t);break;case p.EVEN:r=this.evenRailLengths(t);break;default:r=h.largerEq(t,this.maxLengthPreferenceThreshold())?this.maxLengthRailLengths(t):this.symmetricRailLengths(t)}return r.map((e=>e.roundedTo(this.railLengthPrecision)))}_isOneRailLong(e){const t=this.maxLengthNumeric();return this._isLessThanOrNearlyEqualTo(e,t)}_isTwoRailsLong(e){return this._isLessThanOrNearlyEqualTo(e,this._twoRailsMaxLength())}_railCountFor(e,t,r=1){const n=(e/t).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES);return Math.max(r,Math.ceil(n))}_remainderFor(e,t,r){return(e-t*r).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES)}maxLengthRailLengths(e){const t=this._toNumeric(e);if(this._isOneRailLong(t))return[t];if(this._isTwoRailsLong(t))return this._maxLayoutEndLengths(t);const r=this._toNumeric(this.maxLengthTerminal()),n=this._toNumeric(this.maxLengthInterior()),i=t-r,s=this._maxLengthPrimaryRailCount(i,n),o=this._remainderFor(i,n,s),a=this._maxLayoutEndLengths(o,!1);return[r,...Array(s).fill(n),...a]}_maxLengthPrimaryRailCount(e,t){return this._railCountFor(e,t,2)-2}_maxLayoutEndLengths(e,t=!0){const r=t?this.maxLengthTerminal():this.maxLengthInterior(),n=this._toNumeric(r),i=this.minLengthNumeric(),s=Math.max(i,e-n);return[Math.min(n,e-s),s]}symmetricRailLengths(e){const t=this._toNumeric(e);if(this._isOneRailLong(t))return[t];if(this._isTwoRailsLong(t))return this._twoLengthsSymmetric(t);const r=this._toNumeric(this.maxLengthInterior()),n=this._symmetricTotalLengthForRailCount(t),i=this._railCountFor(n,r,3);let s=i-2,o=this._interiorRailLengthSymmetric(e,i);this._remainderFor(t,o,s)>this._twoRailsMaxLength()&&(s+=1,o=this._interiorRailLengthSymmetric(e,i));const a=this._remainderFor(t,o,s),l=this._twoLengthsSymmetric(a);return[l.first(),...Array(s).fill(o),l.last()]}_symmetricTotalLengthForRailCount(e){return e}_twoLengthsSymmetric(e){const t=this.userLengthUnit(),r=this._toPrecision(h.unit(e,this.unit()).toNumeric(t)),n=Math.floor(r/2);return[n,this._remainderFor(r,n,1)].map((e=>this._toNumeric(h.unit(e,t))))}_interiorRailLengthSymmetric(e,t){const r=this.chunkingLength(),n=this._toPrecision(h.divide(e,r)),i=this._interiorRailLengthChunked(n,t),s=this._toPrecision(h.divide(this.maxLengthInterior(),r)),o=h.min(s,i);return this._toNumeric(h.multiply(r,o))}_interiorRailLengthChunked(e,t){return Math.ceil(e/t)}_twoRailsMaxLength(){return 2*this._toNumeric(this.maxLengthTerminal())}evenRailLengths(e){const t=this._toNumeric(e),r=this.maxLengthNumeric();let n=Math.ceil((t/r).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES)),i=t/n;return this._isLongestRailValid(n,i)||(n+=1,i=t/n),Array(n).fill(i)}_isLongestRailValid(e,t){return this._isLessThanOrNearlyEqualTo(t,this.maxLengthNumeric())}}var m=RailLengthHelper},12704:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>b}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(63768)),m=r(7340),f=r(37732),g=r(62048),y=d(r(87126));class RailingBlock extends y.default{constructor(e){super(),this._edge=e}edge(){return this._edge}section(){return this.componentOf()}postProvider(){return this.section().postProvider()}railingStyle(){return this.section().railingStyle()}railEdge(){return this._edge}infill(){return this._infill??=this._defaultInfill()}infillCrossSection(){}_defaultInfill(){return[]}infillTopHeight(){return this.section().railingHeight()}infillBottomHeight(){return p.add(this._levelSectionInfillBottomHeight(),this.section().isSloped?.()?this.section().placementStrategy().verticalClearanceOffset():p.unit(0,this.unit()))}infillSpan(){return p.subtract(this.infillTopHeight(),this.infillBottomHeight())}infillBaseEdge(){return this.edge()}_levelSectionInfillBottomHeight(){return p.unit(0,"in")}isFirstBlock(){return this.section().beginBlock()===this}isLastBlock(){return this.section().endBlock()===this}isCornerAtBegin(){return this.isFirstBlock()&&Boolean(this.section().sectionConnectedToBegin())&&!this.section().angleAtBegin().isNearTo(0)}isCornerAtEnd(){return this.isLastBlock()&&Boolean(this.section().sectionConnectedToEnd())&&!this.section().angleAtEnd().isNearTo(0)}beginPost(){return this.section().postAtLocator(this.edge().begin())}endPost(){return this.section().postAtLocator(this.edge().end())}geometry(){return new g.Polygon([this.edge().begin(),this.edge().end()])}boundingCube(){return 0===this.components().length?this.edge().boundingBox().extrudedFromTo(0,0):g.Cube.mergedFiniteCubes(this.components())}defaultFigure(){return m.CompositeFigure.withModel(this)}threeFigure(){return f.Composite3DFigure.withModel(this)}resetComponents(){super.resetComponents(),this._infill=void 0}components(){return[...this.infill()]}async load(){return Promise.all(this.components().map((e=>e.load?.())))}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_infill"]}}var b=RailingBlock},10577:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>w}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(63768)),m=r(7340),f=r(37732),g=r(50988),y=d(r(70373)),b=d(r(87126)),v=d(r(18068)),_=d(r(74842));const x={begin:"begin",end:"end"};class RailingCollection extends b.default{static LOCATIONS=x;static displayName(){return"Railing Collection"}railingHeight(){return this._railingHeight??=this._defaultRailingHeight()}_defaultRailingHeight(){return p.unit(36,"in")}setRailingHeight(e){this._railingHeight=e,this.resetSections()}isClosedLoop(){if(this.railingRuns().length<=2)return!1;const e=this.railingRuns().first(),t=this.railingRuns().last();return e.edge().begin().equals(t.edge().end())}directionFlipped(){return this.railingRuns().first()?.directionFlipped()}flipRailings(){this.railingRuns().forEach((e=>e.flipDirection()))}terminalRailingRuns(){return this.railingRuns().filter((e=>!e.previousRun()||!e.nextRun()))}terminalSections(){return this.terminalRailingRuns().map((e=>e.previousRun()?e.sections().last():e.sections().first()))}nextSectionFor(e){const t=e.edge().end();return this._findAdjacentElement(t,e,this.sections())}previousSectionFor(e){const t=e.edge().begin();return this._findAdjacentElement(t,e,this.sections())}nextRunFor(e){const t=e.edge().end();return this._findAdjacentElement(t,e,this.railingRuns())}previousRunFor(e){const t=e.edge().begin();return this._findAdjacentElement(t,e,this.railingRuns())}continuousRailingRunsFor(e){const t=e;let r=t.nextRun();const n=[t];for(;t!==r&&r;)n.push(r),r=r.nextRun();if(!r)for(r=t.previousRun();t!==r&&r;)n.push(r),r=r.previousRun();return n.sort(((e,t)=>this.railingRuns().indexOf(e)-this.railingRuns().indexOf(t))),n}_findAdjacentElement(e,t,r){const n=e===t.edge().end();return r.find((r=>{if(r===t)return!1;return(n?r.edge().begin():r.edge().end()).equals(e,.001)}))}existingPostAtBegin(e){const t=e.postLayoutEdge().begin(),r=this.previousSectionFor(e),n=r?.endPost();if(n)return n.geometry().containsPoint(t,this._toleranceForSharedPostAtBegin())?n:void 0}existingPostAtEnd(e){const t=e.postLayoutEdge().end(),r=this.nextSectionFor(e),n=r?.beginPost();if(n)return n.geometry().containsPoint(t,this._toleranceForSharedPostAtEnd())?n:void 0}previousSectionForPost(e){return this.sections().find((t=>e.geometry().containsPoint(t.edge().end(),this._toleranceForSharedPostAtBegin())))}nextSectionForPost(e){return this.sections().find((t=>e.geometry().containsPoint(t.edge().begin(),this._toleranceForSharedPostAtEnd())))}_toleranceForSharedPostAtBegin(){return this._defaultToleranceForSharedPost()}_toleranceForSharedPostAtEnd(){return this._defaultToleranceForSharedPost()}_defaultToleranceForSharedPost(){return.01}railingRuns(){return this._railingRuns??=this._defaultRailingRuns()}_defaultRailingRuns(){return[]}createRun(e,t){return new(this.runClass())(e,this,t)}runClass(){return v.default}addRun(e){this.appendRun(e)}prependRun(e){this.railingRuns().unshift(e),this.runAdded(e)}appendRun(e){this.railingRuns().push(e),this.runAdded(e)}runAdded(e){e.setComponentOf(this),e.setGeometryChangedCallback((()=>this.onGeometryChanged())),this.resetSections(),this.resetAnnotations(),this._copyPropertiesFromConnectedSection(e),this.resetDisplayProperties()}reset(){this._railingRuns=void 0}resetSections(){this.railingRuns().forEach((e=>{e.resetSections()}))}resetSectionComponents(){this.railingRuns().forEach((e=>{e.resetSectionComponents()}))}structureDirection(){return 1}rescale(e){const t=this.center().multipliedBy(e);this.components().forEach((t=>t.rescale?.(e)));const r=t.subtract(this.center());this.moveBy(r.x(),r.y(),r.z())}sections(){return this.railingRuns().flatMap((e=>e.sections()))}sectionClass(){return _.default}openings(){return this.railingRuns().flatMap((e=>e.openings()))}gates(){return this.openings().flatMap((e=>e.gate())).filter((e=>e))}_copyPropertiesFromConnectedSection(e){const t=e.sections().map((e=>e.sectionConnectedToBegin()??e.sectionConnectedToEnd())).filter(Boolean).first();t&&e.sections().forEach((e=>e.applyRestorablePropertiesFromObject(t)))}resetAnnotations(){this.railingRuns().forEach((e=>e.resetAnnotations()))}removeRun(e){if(!e)return;const t=this.isClosedLoop(),r=e.previousRun(),n=e.nextRun();this.railingRuns().remove(e),e.setComponentOf(void 0),t&&this._reorderRuns(e.edge().end()),r?.resetSections(),n?.resetSections()}_reorderRuns(e){const t=this.railingRuns().find((t=>t.edge().begin().equals(e))),r=this.railingRuns().slice().filter((e=>e!==t));for(this._railingRuns=[t];r.length>0;){const e=this._railingRuns.last(),t=r.find((t=>e.edge().end().equals(t.edge().begin()))),n=r.indexOf(t);r.splice(n,1),this._railingRuns.push(t)}}splitCollection(e){const t=this._runAtSplit(e),r=new this.constructor;r.setComponentOf(this.componentOf()),r.applyRestorablePropertiesFromObject(this);const n=this.continuousRailingRunsFor(t);0!==n.length&&n.length!==this.railingRuns().length&&(this.project().add(r),n.forEach((e=>{this.removeRun(e),r.addRun(e)})))}_runAtSplit(e){return this.railingRuns().find((t=>t.edge().sharesEndpointWith(e)))}lastRun(){return this.railingRuns().last()}totalRailLength(){return this.sections().reduce(((e,t)=>{const r=t.length();return p.add(e,r)}),p.unit(0,"in"))}railLengthMode(){return this._railLengthMode??=this._defaultRailLengthMode()}_defaultRailLengthMode(){return this.railLengthModeOptions().first().value}setRailLengthMode(e){this._railLengthMode=e,this.resetSections()}railLengthModeOptions(){return[{label:"Auto-select",value:y.default.mode.AUTO},{label:"Symmetric",value:y.default.mode.SYMMETRIC},{label:"Max length",value:y.default.mode.MAX_LENGTH}]}baselineHeight(){return p.unit(-this._lowestZ(),this.unit())}setBaselineHeight(e){const t=-e.toNumeric(this.unit())-this._lowestZ();this.railingRuns().forEach((e=>{e.translateBy(0,0,t);const r=e.placementStrategy(),n=-e.edge().begin().z(),i=p.unit(n,this.unit());r.setSurfaceHeight?.(i)}))}baselineHeightProperty(e="in"){return new m.EditableProperty(this,"Baseline Height",{type:"unit",defaultUnit:e,restorable:!1})}_lowestZ(){return this.railingRuns().reduce(((e,t)=>p.max(e,t.lowestZ())),-1/0)}async load(){await Promise.all(this.components().map((e=>e.load?.())))}boundingBox(){if(!this._boundingBox){const e=this.railingRuns().map((e=>e.boundingBox()));this._boundingBox=e.reduce(((e,t)=>e.merge(t)))}return this._boundingBox}resetBoundingBox(){this._boundingBox=void 0}boundingCube(){return this.railingRuns().map((e=>e.boundingCube())).reduce(((e,t)=>e.merge(t)))}onGeometryChanged(){this.resetBoundingBox()}geometry(){return this.boundingBox().toPolygon()}vertices(){return this.railingRuns().map((e=>e.boundingBox())).reduce(((e,t)=>e.merge(t))).vertices()}contains(e,t){return this.boundingBox().contains(e,t)}components(){return this.railingRuns()}moveBy(e,t){return this.railingRuns().forEach((r=>r.translateBy(e,t))),!0}translateRunsAfter(e,t){const r=this.railingRuns().indexOf(e),n=this.railingRuns().slice(r+1);this.translateRuns(n,t)}translateRunsBefore(e,t){const r=this.railingRuns().indexOf(e),n=this.railingRuns().slice(0,r);this.translateRuns(n,t)}translateRuns(e,t){e.forEach((e=>{e.translateBy(t.x(),t.y(),t.z())})),this.onGeometryChanged()}snappableEndProxies(){const e=this.railingRuns().filter((e=>!e.previousRun())),t=this.railingRuns().filter((e=>!e.nextRun()));return[...e.map((e=>({locator:()=>e.edge().begin(),collection:this,side:x.begin}))),...t.map((e=>({locator:()=>e.edge().end(),collection:this,side:x.end})))]}defaultFigure(){return m.CompositeFigure.withModel(this)}threeFigure(){return f.Composite3DFigure.withModel(this)}postRestorationAction(){this.railingRuns().forEach((e=>e.setGeometryChangedCallback((()=>this.onGeometryChanged()))))}nonEssentialProperties(){return[...m.DisplayProperties.nonEssentialProperties(),...super.nonEssentialProperties(),"_boundingBox"]}}(0,g.extend)(RailingCollection,m.DisplayProperties);var w=RailingCollection},87126:(e,t,r)=>{var n,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(l,{default:()=>u}),e.exports=(n=l,((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(n=s(t,l))||n.enumerable});return e})(i({},"__esModule",{value:!0}),n));var c=r(93613);class RailingComponent extends c.ConstructionComponent{}var u=RailingComponent},50749:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>_}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(63768)),m=r(7340),f=r(37732),g=r(62048),y=r(50988),b=d(r(21558)),v=d(r(87126));class RailingOpening extends v.default{static defaultWidth(){return p.unit(24,"in")}static minimumWidth(){return this.defaultWidth()}static fromLocator(e,t,r,n){const i=new this(e.to(e)),s=r.toNumeric(n)/2,o=e.add(t.multipliedBy(-s)),a=e.add(t.multipliedBy(s)),l=o.to(a);return i.setEdge(l),i}constructor(e){super(),this._edge=e}postProvider(){return this.componentOf().postProvider()}_tempOpeningWithGateType(e){const t=new this.constructor(this.edge());t.setComponentOf(this.railingRun());const r=this.makeGate(t,e);return t._gate=r,t}gateTypeOptions(){return Object.values(this.gateTypes()).map((e=>({label:e.title(),value:e,disabled:!this.canHoldGateType(e)})))}gateTypes(){return b.default}canHoldGateType(e){if(!this.supportsGateType(e))return!1;if(!e.hasGate())return!0;const t=this._tempOpeningWithGateType(e),r=t.gate(),n=t.isWidthValid(r.requiredOpeningWidth()),i=t.canMountGateType(e);return n&&i}supportsGateType(e){const t=this.postProvider().railingStyle?.();if(!t)return!0;const r=t.supportedGateTypes();return void 0===r||r.includes(e)}isWidthValid(e){const t=this.railingRun().maximumSizeForOpening(this);return p.smallerEq(e,t)}canMountGateType(e){const t=e.gateClass().minimumPostHeight(),r=this.postBefore().heightAboveSurface?.()||this.postBefore().height();return p.smallerEq(t,r)}_emptyOpeningDisplayProperties(){return[new m.EditableProperty(this,"Width",{type:"unit",defaultUnit:"in",set:e=>this.setWidthConstrained(e)})]}defaultDisplayProperties(){return[this.gateTypeProperty(),...this.gate()?.displayProperties?.()||this._emptyOpeningDisplayProperties(),...this.pricingNotes()].filter((e=>e))}pricingNotes(){return[]}gateTypeProperty(){const e=this.gateTypeOptions();return 1===e.length?void 0:new m.EditableProperty(this,"Gate Type",{type:"select",choices:e})}postBefore(){return this.railingRun().postBefore(this)}postAfter(){return this.railingRun().postAfter(this)}railingRun(){return this.componentOf()}delete(){this.isDeleteable()&&this.componentOf()?.removeOpening(this)}edge(){return this._edge}setEdge(e){this._edge=e,this._grabRegion=void 0,this.railingRun()?.resetSections(),this.gate()?.reset()}width(){const e=this.edge().length();return p.unit(e,this.unit())}setWidth(e){const t=this.railingRun().setOpeningWidth(this,e);return t||this.resetDisplayProperties(),this.resetAnnotations(),t}formatWidth(){return this.lengthFormatter().format(this.width())}validateWidth(e,t){if(!e)return;const r=this.constructor.minimumWidth(),n=this.railingRun().maximumSizeForOpening(this),i=this.lengthFormatter().format(r),s=this.lengthFormatter().format(n);return p.smaller(t,r)?`Must be ${i} or more.`:p.larger(t,n)?`Not enough space. Must be ${s} or less.`:void 0}setWidthConstrained(e){if(this.gate())return!1;const t=this.constructor.minimumWidth(),r=this.railingRun().maximumSizeForOpening(this);let n=e;return p.smaller(e,t)?n=t:p.larger(e,r)&&(n=r),this.setWidth(n)}gate(){return this._gate}gateType(){return this._gateType??=this._defaultGateType()}_defaultGateType(){return this.gateTypes().DEFAULT}setGateType(e){if(e.hasGate()){if(!this.canMountGateType(e))return;const t=this._tempOpeningWithGateType(e),r=t.gate(),n=this.railingRun().maximumSizeForOpening(t),i=r.requiredOpeningWidth();if(p.larger(i,n))return;t.setWidth(i),this.setEdge(t.edge()),this.setWidth(i);const s=this.makeGate(this,e);s.setDelegate(this),this._gate=s}else this._gate=void 0;this._gateType=e,this.resetDisplayProperties(),this.railingRun().gateTypeChanged()}makeGate(e,t){return t.gateClass().makeGate(e)}gateWidthChanged(e){const t=e.requiredOpeningWidth();this.setWidth(t)}isGateArmWidthValid(e,t){const r=e.requiredOpeningWidth(t);return this.isWidthValid(r)}moveBy(e,t,r){return this.edge().moveBy(e,t,r)}centerEdge(){const e=this.edge().begin(),t=this.edge().end(),r=this.railingRun().centerEdge();return r.closestPointTo(e).to(r.closestPointTo(t))}grabRegion(){if(!this._grabRegion){const e=this.centerEdge(),t=this.railingRun().height(),r=e.center(),n=e.normal().multipliedBy(t/2),i=e.direction().multipliedBy(t/2),s=[r.add(n).add(i),r.add(n.negated()).add(i),r.add(n.negated()).add(i.negated()),r.add(n).add(i.negated())].map((e=>g.RelativeLocator.makeRelativeTo(e,this.edge().center())));this._grabRegion=new g.Polygon(s)}return this._grabRegion}contains(e,t){return this.grabRegion().contains(e,t)}vertices(){const e=this.railingRun().height()/2,t=this.centerEdge().shiftedAlongNormalBy(e),r=this.centerEdge().shiftedAlongNormalBy(-e);return[t.begin(),t.end(),r.end(),r.begin()]}geometry(){return new g.Polygon(this.vertices())}structureDirection(){return this.componentOf().structureDirection()}components(){return[this.gate()].filter((e=>e))}async load(){return Promise.all(this.components().map((e=>e.load?.())))}defaultFigure(){return m.CompositeFigure.withModel(this)}threeFigure(){return f.Composite3DFigure.withModel(this)}reset(){this._grabRegion=void 0,this._annotations=void 0,this.resetGate()}resetGate(){this.gate()?.reset()}resetAnnotations(){this._annotations=void 0,this.gate()?.resetAnnotations?.()}nonEssentialProperties(){return[...super.nonEssentialProperties(),...m.DisplayProperties.nonEssentialProperties(),"_grabRegion"]}}(0,y.extend)(RailingOpening,m.DisplayProperties);var _=RailingOpening},70468:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>g}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(63768)),p=r(7340),m=r(62048),f=r(50988);class RailingPlacementStrategy{static fromLocator(e,t,r){const n=r?r.clone():new this;return n.setSurfaceHeight(h.unit(-e.z(),t)),n}isStairs(){return!1}constructor(e){this._railingRun=e}defaultDisplayProperties(){return[...this.baseDisplayProperties(),...this.displayPropertiesExposedAfterDrawing()]}baseDisplayProperties(){const e=[];return this.showSurfaceHeightProperty()&&e.push(new p.EditableProperty(this,"Surface Height",{type:"unit",defaultUnit:this.lengthFormatter().baseUnit(),label:this.surfaceHeightPropertyLabel(),ignoreIntermediateEdits:!0})),e}displayPropertiesExposedAfterDrawing(){return[]}surfaceHeightPropertyLabel(){}surfaceHeight(){return this._surfaceHeight??=this._defaultSurfaceHeight()}setSurfaceHeight(e){this._surfaceHeight=e}_defaultSurfaceHeight(){return h.unit(0,"in")}formatSurfaceHeight(){return this.lengthFormatter().format(this.surfaceHeight())}showSurfaceHeightProperty(){return this._showSurfaceHeightProperty??=this._defaultShowSurfaceHeightProperty()}setShowSurfaceHeightProperty(e){this._showSurfaceHeightProperty=Boolean(e)}_defaultShowSurfaceHeightProperty(){return!1}verticalClearanceOffset(e){return h.unit(0,"in")}minLength(){return h.unit(-1/0,"in")}structureDirection(){return this.railingRun().structureDirection()}clone(){const e=new this.constructor;let t=this.surfaceHeight();return this.railingRun()&&(t=h.unit(-this.railingRun().edge().end().z(),this.railingRun().unit())),e.setSurfaceHeight(t),e}railingRun(){return this._railingRun}setRailingRun(e){this._railingRun=e}lengthFormatter(){return this.railingRun()?.lengthFormatter()??{format:e=>e.toString(),baseUnit:()=>"in"}}incrementSize(e=this.railingRun().componentOf().sectionClass()){return e.incrementSize()}incrementOptional(){return!1}nearestIncrementInterval(e){const t=this.incrementSize(this.railingRun()).toNumeric(this.railingRun().unit());return t*Math.round(e/t)}endpointMovedTo(e,t,{constrainToValidPosition:r=!0,constrainToLengthIncrements:n=!0}={}){const i=this.railingRun().edge(),s=e===i.begin()?i.end():i.begin();let o=t;if(r&&(o=this._nearestValidEndpoint(t,s)),!this.railingRun().incrementOptional()||n){const e=s.xy().to(o.xy()),t=this.nearestIncrementInterval(e.length());return new m.FixedEdgeLocator(e,t)}return o.xy()}endpointMoved(){}initialEdge(e,t,r){}_nearestValidEndpoint(e,t){const r=this.railingRun().edge().center().subtract(t).normalized(),n=[...this.railingRun().openings().flatMap((e=>[e.edge().begin(),e.edge().end()])),t].sort(((e,t)=>t.dot(r)-e.dot(r))).first(),i=this.railingRun().sections().find((e=>[e.edge().begin(),e.edge().end()].some((e=>e.equals(n))))).minLength(),s=this.minLength(),o=h.max(i,s).toNumeric(this.railingRun().unit()),a=n.add(r.multipliedBy(o)),l=r.xy().normalized(),c=a.xy();let u=a.to(a.add(r)).xy().closestPointTo(e.xy(),!0);return u.dot(l)<c.dot(l)&&(u=c),u}unit(){return this.railingRun()?.unit()??"in"}nonEssentialProperties(){return[...p.DisplayProperties.nonEssentialProperties(),"_propertyChangedObservers"]}}(0,f.extend)(RailingPlacementStrategy,p.DisplayProperties),(0,f.simpleObserver)(RailingPlacementStrategy,"propertyChanged");var g=RailingPlacementStrategy},17287:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>b}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(63768)),m=r(7340),f=r(37732),g=r(62048),y=d(r(87126));class RailingPost extends y.default{static defaultWidth(){return p.unit(3,"in")}static defaultLength(){return p.unit(3,"in")}constructor(e){super(),this._locator=e}locator(){return this._locator}width(){return this.constructor.defaultWidth()}length(){return this.constructor.defaultLength()}height(){return p.add(this.heightAboveSurface(),this.heightBelowSurface())}postProvider(){return this.section().postProvider()}edge(){return this.locator().edge()}mountStyle(){return this.section().postMountStyle()}railingStyle(){return this.section().railingStyle()}_relativeLocator(e){const t=this.geometry().normal(),r=e.toNumeric(this.unit()),n=t.multipliedBy(-r);return new g.RelativeLocator(this.locator(),n.x(),n.y(),n.z())}heightAboveSurface(){return this.section().railingHeight()}heightBelowSurface(){return this.mountStyle().postZOffset()}topLocator(){return this._relativeLocator(this.heightAboveSurface())}surfaceLocator(){return this.locator()}bottomLocator(){const e=this.heightBelowSurface().toNumeric(this.unit());return this.locator().addZ(e)}referencePoint(){return this.locator()}directionTo(e){return e.surfaceLocator().subtract(this.surfaceLocator()).normalized()}attachedSections(){return[this.previousSection(),this.nextSection()].filter(Boolean)}attachedRailDirections(){return this.attachedSections().map((e=>e.edge().direction()))}section(){return this.componentOf()}connectedSection(){return this.attachedSections().find((e=>e!==this.section()))}nextSection(){return this._nextSection??=this._defaultNextSection()}_defaultNextSection(){if(this.isLinePost())return;const e=this.section();return this.isBeginPost()?e:e.sectionConnectedToEnd()}previousSection(){return this._previousSection??=this._defaultPreviousSection()}_defaultPreviousSection(){if(this.isLinePost())return;const e=this.section();return this.isBeginPost()?e.sectionConnectedToBegin():e}isBeginPost(){const e=this.section().beginPost();return!!e&&this.locator().equals(e.locator())}isEndPost(){const e=this.section().endPost();return!!e&&this.locator().equals(e.locator())}isLinePost(){return!this.isBeginPost()&&!this.isEndPost()}isTerminalPost(){return 1===this.attachedSections().length}isDoublePostCorner(){if(this.isLinePost())return!1;if(this.isTerminalPost())return!1;const e=this.connectedSection();if(!e)return!1;const t=this.isEndPost()?e.beginPost():e.endPost();return!!t&&(!this.locator().equals(t.locator())&&this.isAtCorner())}isSinglePostCorner(){return 2===this.attachedSections().length&&!this.isDoublePostCorner()&&this.isAtCorner()}isAtCorner(){const e=this.connectedSection();return!!e&&!this.section().isParallelToSection(e)}isCornerPost(){return this.isSinglePostCorner()}thickness(){return this.height().toNumeric(this.unit())}geometry(){return this._geometry??=this._defaultGeometry()}_defaultGeometry(){const e=this.bottomLocator(),t=e.edge(),r=this.length().toNumeric(this.unit())/2,n=this.width().toNumeric(this.unit())/2;return(0,g.$P)(0,0,0).expandedBy(r,n).toPolygon().rotatedBy((0,g.$P)(0,0,0),t.theta()).movedBy(e.x(),e.y(),e.z()).relatedTo(e)}shape3D(){return this._shape3D??=this._defaultShape3D()}_defaultShape3D(){return new g.ExtrudedPolygon(this.geometry(),-this.thickness(),void 0,!1)}boundingCube(){return this.shape3D().boundingCube()}zLevel(){return this.topLocator().z()}defaultFigure(){const e=new m.NullDrawable;return e.setModel(this),e}threeFigure(){return new f.NullDrawable3D(this)}components(){return[]}async load(){return Promise.all(this.components().map((e=>e.load?.())))}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_nextSection","_previousSection","_geometry","_shape3D"]}}var b=RailingPost},35124:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(7340),p=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(10577));class RailingProject extends h.Project{lengthFormatter(){return this._lengthFormatter??=this._defaultLengthFormatter()}_defaultLengthFormatter(){return new h.ImperialLengthFormatter}unit(){return"in"}project(){return this}railingCollections(){return this.parts().filter((e=>e instanceof p.default))}}var m=RailingProject},18068:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>w}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(63768)),m=r(7340),f=r(37732),g=r(62048),y=r(50988),b=d(r(88431)),v=d(r(23362)),_=d(r(87126)),x=d(r(27744));class RailingRun extends _.default{constructor(e,t,r){super(),this._directionFlipped=!1,this._edge=e,this._postProvider=t,this.setPlacementStrategy(r)}edge(){return this._edge}setEdge(e){this._edge=e}updateEdge(e,t){const r=this.edge().begin(),n=this.edge().end(),i=Math.abs(r.z()-n.z()),s=this.edge().xy().length(),o=e.toNumeric(this.unit()),a=t.toNumeric(this.unit()),l=r.z()>n.z(),c=this.edge().xy().direction(),u=a-s,d=(l?c.negated():c).multipliedBy(u),h=d.x(),p=d.y(),m=o-i,f=(0,g.$P)(0,0,0),y=(0,g.$P)(h,p,m),b=l?y:f,v=l?f:y;r.moveBy(b.x(),b.y(),b.z()),n.moveBy(v.x(),v.y(),v.z()),this.componentOf().translateRunsBefore(this,b),this.componentOf().translateRunsAfter(this,v),this.componentOf().resetSectionComponents()}flipDirection(){this._directionFlipped=!this._directionFlipped,this.resetSections(),this.openings().forEach((e=>e.reset()))}directionFlipped(){return this._directionFlipped}flipSlope(){const e=this.edge().begin(),t=this.edge().end(),r=e.z()-t.z(),n=(0,g.$P)(0,0,-r),i=(0,g.$P)(0,0,r);e.moveBy(n.x(),n.y(),n.z()),t.moveBy(i.x(),i.y(),i.z()),this.componentOf().translateRunsBefore(this,n),this.componentOf().translateRunsAfter(this,i),this.componentOf().resetSectionComponents()}makeAngleRelative(e){const t=e.theta()+this.edge().angle();return new g.PolarCoordinate(1,t)}makeAnglesRelative(e){return e.map((e=>this.makeAngleRelative(e)))}validAngleWithEdge(e){if(!e)return!0;const t=e.begin(),r=t.equals(this.edge().begin())?this.edge().end():this.edge().begin();return new g.Angle(t,e.end(),r).smallestDeltaDegrees().roundedTo(3)>=this.minimumAngleBetweenRuns()}minimumAngleBetweenRuns(){return 90}_postWidth(){return this.sections().first().railingPosts().first().width()}structureDirection(){return this.componentOf().structureDirection()}async load(){return Promise.all(this.components().map((e=>e.load?.())))}placementStrategy(){return this._placementStrategy??=this._defaultPlacementStrategy()}_defaultPlacementStrategy(){return new v.default(this)}setPlacementStrategy(e){this.stopObservingPlacementStrategy(this._placementStrategy),this._placementStrategy=e,this._placementStrategy&&this._placementStrategy.setRailingRun(this),this.startObservingPlacementStrategy()}incrementSize(){return this.placementStrategy().incrementSize()}incrementOptional(){return this.placementStrategy().incrementOptional()}_nearestIncrementInterval(e){return this.placementStrategy().nearestIncrementInterval(e)}endpointMovedTo(e,t,{constrainToValidPosition:r=!0,constrainToLengthIncrements:n=!0}={}){return this.placementStrategy().endpointMovedTo(e,t,{constrainToValidPosition:r,constrainToLengthIncrements:n})}postProvider(){return this._postProvider}setPostProvider(e){this._postProvider=e}components(){return[...this.sections(),...this.openings()]}beginSection(){return this.sections().first()}endSection(){return this.sections().last()}previousRun(){return this.componentOf()?.previousRunFor(this)}nextRun(){return this.componentOf()?.nextRunFor(this)}moveEndpointTo(e,t,{constrainToValidPosition:r=!0,constrainToLengthIncrements:n=!0}={}){const i=this.endpointMovedTo(e,t,{constrainToValidPosition:r,constrainToLengthIncrements:n}).subtract(e);if(i.rho().isNearTo(0,.001))return!1;const s=e.moveBy(i.x(),i.y(),i.z());return s&&(this._updateSectionsAfterMoveEndpoint(),this.resetOpeningDisplayProperties(),this.placementStrategy().endpointMoved()),s}_updateSectionsAfterMoveEndpoint(){this._setSectionEdges(),this.resetSectionComponents()}rescale(e){this.sections().forEach((t=>t.rescale(e))),this.openings().forEach((e=>e.setWidth(e.width())))}collection(){return this.componentOf()}deleteSection(e){if(1===this.sections().length)return this.delete();if(this.collection().isClosedLoop())return this._splitRunAroundSection(e);const t=this._splitRunAroundSection(e);this.collection().splitCollection(t)}delete(){if(1===this.collection().railingRuns().length)return this.collection().delete();this.collection().isClosedLoop()?this.collection().removeRun(this):(this.collection().railingRuns().remove(this),this.collection().splitCollection(this.edge()))}_splitRunAroundSection(e){const t=this.edge(),r=this._removeNonAdjacentOpenings(e),n=this._removeAdjacentOpenings(e).filter((e=>void 0!==e));let i=e.edge();n.forEach((e=>i=i.merge(e.edge())));const s=1===n.length,o=s&&e.edge().end().equals(n.first().edge().begin());if(this.sections().remove(e),s){const e=o?this.sections().last().edge().snapshot():this.sections().first().edge().snapshot();return this.setEdge(e),this.resetSections(),this._addRemovedOpenings(r),i}return this._splitAndResizeRun(i,t),this._addRemovedOpenings(r),i}_removeAdjacentOpenings(e){return this.openings().filter((t=>e.edge().sharesEndpointWith(t.edge()))).map((e=>(this.openings().remove(e),e)))}_removeNonAdjacentOpenings(e){return this.openings().filter((t=>!e.edge().sharesEndpointWith(t.edge()))).map((e=>(this.removeOpening(e),e)))}_splitAndResizeRun(e,t){const r=[e,t].flatMap((e=>[e.begin(),e.end()])).sort(((e,t)=>e.distanceTo(this.edge().begin())-t.distanceTo(this.edge().begin())));this.setEdge(r[0].to(r[1]));const n=this.collection().createRun(new g.Edge(r[r.length-2],r[r.length-1]),this.placementStrategy().clone());this.collection().addRun(n)}_addRemovedOpenings(e){e.forEach((e=>{this.collection().railingRuns().forEach((t=>{if(t.edge().containsEdge(e.edge())&&!t.addOpening(e))throw new Error("Opening could not be added.")})),e.resetAnnotations()}))}resetSections(){this.saveSectionProperties(),this._sections=void 0,this.onGeometryChanged(),this.componentOf().resetDisplayProperties()}resetSectionComponents(){this.sections().forEach((e=>e.resetComponents())),this.onGeometryChanged()}sectionProperties(){return this._sectionProperties??=[]}setSectionProperties(e){this._sectionProperties=e}saveSectionProperties(){const e=this.sections().map((e=>{const t={};return e.restorableProperties().forEach((e=>{const r=e.name();t[r]=e.get()})),t}));this.setSectionProperties(e)}restoreSectionProperties(e){const t=this.sectionProperties();return e.forEach(((e,r)=>{if(!t[r])return;const n=t[r];Object.keys(n).forEach((t=>{const r=e.restorableProperties().find((e=>e.name()===t));if(!r)return;const i=n[t];r.set(i)}))})),e}resetOpenings(){this._openings=void 0}resetOpeningDisplayProperties(){this.openings().forEach((e=>e.resetDisplayProperties()))}resetOpeningGates(){this.openings().forEach((e=>e.resetGate()))}sectionClass(){return this.componentOf().sectionClass()}createSection(e){const t=new(this.sectionClass())(e,this.postProvider());return t.setComponentOf(this),t}sections(){return this._sections||(this._sections=this._generateSections(),this.restoreSectionProperties(this._sections),this._sectionsHaveBeenGenerated()),this._sections}_sectionsHaveBeenGenerated(){}nextSectionFor(e){return this.componentOf().nextSectionFor(e)}previousSectionFor(e){return this.componentOf().previousSectionFor(e)}isValid(){return this.edge().length()>=p.max(...this.sections().map((e=>e.minLength()))).toNumeric(this.unit())}setSectionLength(e,t){this.sectionLengthAdjuster().setLength(e,t),this.componentOf().resetAnnotations(),this.componentOf().resetSectionComponents()}sectionLengthAdjuster(){return this._sectionLengthAdjuster??=this._defaultSectionLengthAdjuster()}_defaultSectionLengthAdjuster(){const e=this.sectionLengthAdjusterIncrement();return new x.default(e)}sectionLengthAdjusterIncrement(){return this.incrementSize()}resetAnnotations(){this._annotations=void 0,this.sections().forEach((e=>e.resetAnnotations())),this.openings().forEach((e=>e.resetAnnotations()))}_setSectionEdges(){const e=this.openings().map((e=>e.edge())),t=b.default.orderEdges(e,this.edge().begin()),r=this.sections();this._sectionEdges(t).forEach(((e,t)=>{r[t].setEdge(e)}))}_generateSections(){const e=this.openings().map((e=>e.edge())),t=b.default.orderEdges(e,this.edge().begin());return this._sectionEdges(t).map((e=>this.createSection(e)))}_sectionEdges(e){const t=this.edge().begin(),r=this.edge().end(),n=[t,...e.flatMap((e=>[g.RelativeLocator.makeRelativeTo(e.begin(),t),g.RelativeLocator.makeRelativeTo(e.end(),t)])),r];this.directionFlipped()&&n.reverse();const i=[];for(let e=0;e<n.length;e+=2){const t=n[e].to(n[e+1]);i.push(t)}return i}sharedEndpoint(e){const t=this.edge(),r=[t.begin(),t.end()],n=[e.edge().begin(),e.edge().end()];return r.find((e=>n.some((t=>t.equals(e,.001)))))}moveBy(e,t){if(!this.canMoveBy())return!1;const r=this.edge().normal(),n=r.multipliedBy((0,g.$P)(e,t).dot(r));if(n.rho().isNearTo(0,.001))return!1;const i=[this.previousRun(),this.nextRun()].filter((e=>e)),s=this._smallestMoveDelta(i,n);return!s.rho().isNearTo(0,.001)&&(i.forEach((e=>{const t=e.sharedEndpoint(this);e.moveEndpointTo(t,t.add(s),{constrainToLengthIncrements:!1})})),this.translateBy(s.x(),s.y(),s.z()))}canMoveBy(){const e=[this.previousRun(),this.nextRun()].filter((e=>e)),t=e.every((e=>e.edge().isPerpendicularTo(this.edge(),.001)));if(e.length>1&&!t)return!1;const r=e.every((e=>e.isLevel()));return!(e.length>0&&!r)}_smallestMoveDelta(e,t){const r=e.map((e=>{const r=e.sharedEndpoint(this);if(!r)return(0,g.$P)(0,0);return e.endpointMovedTo(r,r.add(t)).subtract(r)}));let n=t;return e.length>0&&(n=r.reduce(((e,t)=>t.rho()<e.rho()?t:e))),n}translateBy(e,t,r){return this.edge().moveBy(e,t,r),this.openings().forEach((n=>n.moveBy(e,t,r))),this.onGeometryChanged(),!0}openings(){return this._openings??=[]}removeOpening(e){const t=this.sectionProperties(),r=this.sections().find((t=>t.edge().begin().equals(e.edge().end()))),n=this.sections().indexOf(r);n>-1&&t.splice(n,1),this.openings().remove(e),this.resetSections(),this.componentOf().resetDisplayProperties(),this.setSectionProperties(t),this.restoreSectionProperties(this.sections())}isSloped(){return!this.isLevel()}isLevel(){return b.default.isLevel(this.edge())}_findPlaceableSectionsFor(e,t){const r=this.sections();if(!e)return r;const n=e.edge(),i=[],s=r.slice();r.forEach((e=>{const t=e.edge(),r=[t.begin(),t.end()],o=[n.begin(),n.end()];r.some((e=>o.some((t=>t.equals(e,.001)))))&&(i.push(e),s.remove(e))}));const o=i.first()?.edge().begin(),a=i.last()?.edge().end(),l=s;if(o&&a){let e=o.to(a);this.directionFlipped()&&(e=e.reversed());const r=this.createSection(e);((e,r)=>{if(!t)return;const n=b.default.constrainEdgeToEdge(t,e),s=i.find((e=>n?.overlaps(e.edge())));r.applyRestorablePropertiesFromObject(s)})(e,r),l.push(r)}return l}_nearestValidOpeningEdge(e,t){const r=e.length().roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES),n=this._findPlaceableSectionsFor(t,e).map((e=>e.validOpeningEdge(t))).reduce(((t,n)=>{if(n.length().roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES)<r)return t;const i=n.begin().distanceTo(e.center()),s=n.end().distanceTo(e.center()),o=Math.min(i,s);return o<t.distance?{edge:n,distance:o}:t}),{edge:void 0,distance:1/0}).edge;if(!n)return;const i=b.default.constrainEdgeToEdge(e,n),s=n.begin().distanceTo(i.begin()),o=this._nearestIncrementInterval(s);if(!o.isNearTo(s,.001)){const e=n.direction().multipliedBy(o-s);i.moveBy(e.x(),e.y())}return i}addOpening(e){e.setComponentOf(this);const t=e.edge().center(),r=this.sections().findIndex((e=>e.edge().containsPoint(t)));this.saveSectionProperties();const n=this.sectionProperties();if(r>-1){const e=n[r];n.splice(r,0,e)}const i=e.edge(),s=this._nearestValidOpeningEdge(i);return!(!s||!s.containsPoint(i.center()))&&(e.setEdge(s),this.openings().push(e),this.resetSections(),this.setSectionProperties(n),this.restoreSectionProperties(this.sections()),!0)}gateTypeChanged(){this.componentOf().resetDisplayProperties(),this.resetSections()}moveOpening(e,t,r){const n=e.edge(),i=n.movedBy(t,r),s=this._nearestValidOpeningEdge(i,e);if(!s||s.equals(n,.001))return!1;const o=s.center().subtract(n.center());return e.moveBy(o.x(),o.y()),this.resetSections(),!0}maximumSizeForOpening(e){const t=e.edge().begin(),r=this._findPlaceableSectionsFor(e).find((e=>e.edge().containsPoint(t)));return p.unit(r.validOpeningEdge(e).length(),r.unit())}setOpeningWidth(e,t){const r=e.constructor.minimumWidth(),n=this.maximumSizeForOpening(e);if(p.smaller(t,r)||p.larger(t,n))return!1;const i=e.edge(),s=t.toNumeric(this.unit())-i.length(),o=i.stretchedBy(s),a=this._nearestValidOpeningEdge(o,e);return!!a&&(e.setEdge(a),this.resetSections(),!0)}terminalPosts(){return this.sections().flatMap((e=>[e.beginPost(),e.endPost()])).filter((e=>e))}_closestTerminalPostTo(e){return this.terminalPosts().reduce(((t,r)=>{const n=r.locator().distanceTo(e);return n<t.distance?{post:r,distance:n}:t}),{post:void 0,distance:1/0}).post}postBefore(e){const t=e.edge().begin();return this._closestTerminalPostTo(t)}postAfter(e){const t=e.edge().end();return this._closestTerminalPostTo(t)}placementStrategyProperties(){return this.placementStrategy().displayPropertiesExposedAfterDrawing()}startObservingPlacementStrategy(){this.placementStrategy().addPropertyChangedObserver(this,this.placementStrategyPropertyChanged)}stopObservingPlacementStrategy(e){e&&e.removePropertyChangedObserver(this,this.placementStrategyPropertyChanged)}placementStrategyPropertyChanged(){const e=this.edge().end().snapshot();this.moveEndpointTo(this.edge().end(),e);const t=this.edge().end().to(e),r=-t.length(),n=t.direction().multipliedBy(r);this.componentOf().translateRunsAfter(this,n),this.componentOf().resetSectionComponents(),this.sections().forEach((e=>e.resetDisplayProperties()))}onGeometryChanged(){this._geometryChangedCallback?.()}setGeometryChangedCallback(e){this._geometryChangedCallback=e}boundingCube(){return this.sections().map((e=>e.boundingCube())).reduce(((e,t)=>e.merge(t)))}boundingBox(){return this.geometry().boundingBox()}geometry(){return new g.Polygon(this.vertices())}vertices(){if(0===this.sections().length)return[this.edge().begin(),this.edge().end()];const e=this.sections().first().endEdges().first(),t=this.sections().last().endEdges().last();return[e.begin(),t.begin(),t.end(),e.end()]}normalOffset(){return Math.max(...this.sections().map((e=>e.normalOffset())))}negatedNormalOffset(){return Math.min(...this.sections().map((e=>e.negatedNormalOffset())))}height(){const e=this.edge().normal(),t=this.vertices().map((t=>e.dot(t)));return Math.max(...t)-Math.min(...t)}centerEdge(){const e=this.edge().direction(),t=this.geometry().edges().map((e=>e.center()));return t.sort(((t,r)=>e.dot(t)-e.dot(r))),t.first().to(t.last())}lowestZ(){const e=this.edge().begin(),t=this.edge().end();return Math.max(e.z(),t.z())}defaultFigure(){return m.CompositeFigure.withModel(this)}threeFigure(){return f.Composite3DFigure.withModel(this)}startEditing(){this.setIsPending(!0)}stopEditing(){this.setIsPending(!1)}isPending(){return void 0===this._isPending&&(this._isPending=!1),this._isPending}setIsPending(e){this._isPending=e}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_geometryChangedCallback","_isPending","_sections","_sectionLengthAdjuster"]}postRestorationAction(){this.restoreSectionProperties(this.sections()),this.startObservingPlacementStrategy()}beforeSerialize(){this.saveSectionProperties()}}(0,y.extend)(RailingRun,m.DisplayProperties);var w=RailingRun},74842:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>$}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(63768)),m=r(93613),f=r(7340),g=r(37732),y=r(62048),b=r(50988),v=d(r(88431)),_=d(r(70373)),x=d(r(12704)),w=d(r(87126)),R=d(r(17287)),k=d(r(12832)),j=d(r(72564)),z=d(r(66036)),q=d(r(65477));class RailingSection extends w.default{static postMountStyleClasses(){return[q.default]}static railingStyleClasses(){return[k.default]}static incrementSize(){return p.unit(1,"in")}static minLength(){return p.unit(6,"in")}static maxLength(){return p.unit(10,"ft")}static railingStyleChoices(){return this.railingStyleClasses().map((e=>new e))}constructor(e,t){super(),this._edge=e,this._postProvider=t}defaultDisplayProperties(){return new f.CompositePropertiesCollection(this,[new f.PropertiesCollection(this,this._selfDisplayProperties()),this.postMountStyle().displayProperties(),this.componentOf().placementStrategyProperties()])}_selfDisplayProperties(){return[]}postMountStyleProperty(){const e=this.postMountStyleChoices(),t=this._postMountStylePropertyType();return new f.EditableProperty(this,"Post Mount Style",{type:t,choices:e,label:"Mount Style",showOnCollection:!0})}_postMountStylePropertyType(){return"select"}railingStyleProperty(){const e=this.railingStyleChoices(),t=this._railingStylePropertyType();return new f.EditableProperty(this,"Railing Style",{type:t,choices:e,showOnCollection:!0})}_railingStylePropertyType(){return"segment"}edge(){return this._edge}setEdge(e){this._edge=e,this.resetComponents()}placementStrategy(){return this.componentOf().placementStrategy()}postMountStyle(){return this._postMountStyle||(this._postMountStyle=this._defaultPostMountStyle(),this.startObservingPostMountStyle()),this._postMountStyle}_defaultPostMountStyle(){return this.postMountStyleChoices().first()}setPostMountStyle(e){this.stopObservingPostMountStyle(),this._postMountStyle=e,this.startObservingPostMountStyle(),this.resetConnectedComponents()}startObservingPostMountStyle(){this._postMountStyle?.addPropertyChangedObserver(this,this.postMountStylePropertyChanged)}stopObservingPostMountStyle(){this._postMountStyle?.removePropertyChangedObserver(this,this.postMountStylePropertyChanged)}postMountStyleChoices(){return this._postMountStyleChoices??=this._defaultPostMountStyleChoices()}_defaultPostMountStyleChoices(){return this.constructor.postMountStyleClasses().map((e=>new e))}postMountStylePropertyChanged(){this.resetComponents()}railingStyle(){return this._railingStyle||(this._railingStyle=this._defaultRailingStyle(),this.startObservingRailingStyle()),this._railingStyle}_defaultRailingStyle(){return this.railingStyleChoices().first()}setRailingStyle(e){e?.copyPropertiesFromStyle(this.railingStyle()),this.stopObservingRailingStyle(),this._railingStyle=e,this.startObservingRailingStyle(),this.resetComponents(),this.resetInsetHelpers()}startObservingRailingStyle(){this._railingStyle?.addPropertyChangedObserver(this,this.railingStylePropertyChanged)}stopObservingRailingStyle(){this._railingStyle?.removePropertyChangedObserver(this,this.railingStylePropertyChanged)}railingStylePropertyChanged(){this.resetComponents()}railingStyleChoices(){return this._railingStyleChoices??=this.constructor.railingStyleChoices()}resetInsetHelpers(){this._postLayoutEdgeInsetHelper=void 0}componentLayoutEdgeOffset(){return this.postMountStyle().componentLayoutEdgeOffset(this)}componentLayoutEdge(){return this.postMountStyle().componentLayoutEdgeFor(this).relativeToEdge(this.edge())}componentLayoutLine(){return this.postMountStyle().componentLayoutLineFor(this)}postCenterOffsetFromEdge(){return this.postMountStyle().sectionEdgeOffsetFromCenter(this.postWidth())}railLayoutEdge(){return this.componentLayoutEdge().addZ(-this.railAttachmentHeight().toNumeric(this.unit())).relativeToEdge(this.edge())}railAttachmentHeight(){return this.railingHeight()}geometry(){return this.edge()}boundingShape(){const e=this.edge();return new y.Polygon([e.begin(),e.end(),e.begin()])}run(){return this.componentOf()}defaultStructureRepresentationWidth(){return this.run().defaultStructureRepresentationWidth()}railingHeight(){return this.postProvider().railingHeight()}flipSlope(){this.componentOf().flipSlope()}showFlipSlopeProperty(){return this.isSloped()}isSlopeFlipped(){if(this.isLevel())return!1;const e=this.edge();return e.begin().z()>e.end().z()}pendingGeometry(){const e=this.pendingRailWidth().toNumeric(this.unit())/2,t=this.componentLayoutEdge().shiftedAlongNormalBy(e),r=this.componentLayoutEdge().shiftedAlongNormalBy(-e);return new y.Polygon([t.begin(),t.end(),r.end(),r.begin()])}pendingRailWidth(){return p.unit(2,"in")}incrementSize(){return this.constructor.incrementSize()}length(){return p.unit(this.edge().length(),this.unit())}setLength(e){this.length().equals(e)||this.run().setSectionLength(this,e)}validateLength(e,t){if(!e)return;const r=this.minLength();if(p.smaller(t,r)){return`Must be ${this.lengthFormatter().format(r)} or more.`}}formatLength(){return this.lengthFormatter().format(this.length())}rescale(e){this.setLength(p.multiply(this.length(),e))}postProvider(){return this._postProvider}postWidth(){throw new b.MissingOverride(this,"postWidth")}sideEdges(){return this._sideEdges??=this._defaultSideEdges()}_defaultSideEdges(){const e=this.edge(),t=e.direction(),r=this.components().flatMap((e=>e.geometry().vertices())).map((e=>t.dot(e))),n=this.normalOffset(),i=this.negatedNormalOffset(),s=Math.max(...r),o=Math.min(...r),a=e.begin().dot(t),l=e.end().dot(t),c=new y.ProportionalEdgeLocator(e,0),u=new y.ProportionalEdgeLocator(e,1);return[new y.NormalToEdgeLocator(c,n,o-a).to(new y.NormalToEdgeLocator(u,n,s-l)),new y.NormalToEdgeLocator(c,i,o-a).to(new y.NormalToEdgeLocator(u,i,s-l))]}normalOffset(){const e=this.edge().normal(),t=this.components().flatMap((e=>e.geometry().vertices())).map((t=>e.dot(t))),r=this.edge().center().dot(e);return Math.max(...t)-r}negatedNormalOffset(){const e=this.edge().normal(),t=this.components().flatMap((e=>e.geometry().vertices())).map((t=>e.dot(t))),r=this.edge().center().dot(e);return Math.min(...t)-r}_findSideEdgeInDirection(e){const t=this.sideEdges().first();return t.center().subtract(this.edge().center()).normalized().equals(e)?t:this.sideEdges().last()}outerEdge(){return this._findSideEdgeInDirection(this.edge().normal())}innerEdge(){return this._findSideEdgeInDirection(this.edge().normal().negated())}endEdges(){const e=this.sideEdges().first(),t=this.sideEdges().last();return[e.begin().to(t.begin()),e.end().to(t.end())]}minLength(){return p.max(this.constructor.minLength(),this.placementStrategy().minLength())}maxRailLength(){return p.unit(10,"ft")}minRailLength(){return this.constructor.minLength()}angleAtBegin(){const e=this.sectionConnectedToBegin();return e?this.angleBetweenSections(e,this):NaN}angleAtEnd(){const e=this.sectionConnectedToEnd();return e?this.angleBetweenSections(this,e):NaN}angleBetweenSections(e,t){return(e.edge().theta().normalizedAngle()-t.edge().theta().normalizedAngle()).normalizedAngle()}isLevel(){return v.default.isLevel(this.edge())}isSloped(){return!this.isLevel()}slope(){if(this.isLevel())return p.unit(0,"deg");const e=this.edge(),t=Math.abs(e.begin().z()-e.end().z()),r=e.xy().length(),n=Math.atan(t/r);return p.unit(n,"rad")}moveBy(e,t,r){return!1}contains(e,t){return this.boundingPolygon().contains(e,t)}boundingBoxFootprintWidth(){return p.unit(4,"in").toNumeric(this.unit())}vertices(){const e=this.boundingBoxFootprintWidth()/2,t=this.componentLayoutEdge().shiftedAlongNormalBy(e),r=this.componentLayoutEdge().shiftedAlongNormalBy(-e);return[t.begin(),t.end(),r.end(),r.begin()]}boundingPolygon(){return new y.Polygon(this.vertices())}boundingBox(){return this.boundingPolygon().boundingBox()}boundingCube(){return y.Cube.mergedFiniteCubes(this.components())}postAttachmentsChanged(e){}resetComponents(){this.resetAnnotations(),this._rails=void 0,this._railingPosts=void 0,this._sideEdges=void 0,this._sectionConnectedToBegin=void 0,this._sectionConnectedToEnd=void 0,this._blocks=void 0,this.notifyDisplayPropertiesChangedObservers()}resetAnnotations(){this._annotations=void 0}resetConnectedComponents(){this.resetComponents(),setTimeout((()=>{this.sectionConnectedToBegin()?.resetComponents(),this.sectionConnectedToEnd()?.resetComponents()}))}async load(){return Promise.all(this.components().map((e=>e.load?.())))}rails(){return this._rails??=this._defaultRails()}_defaultRails(){return[]}beginPost(){if(!this.shouldHavePostAtBegin()){const e=this.postProvider().existingPostAtBegin(this);if(e)return e}return this.railingPosts().first()}endPost(){if(!this._railingPosts){const e=this.generateEndPost();return e.setComponentOf(this),e}if(!this.shouldHavePostAtEnd()){const e=this.postProvider().existingPostAtEnd(this);if(e)return e}return this.railingPosts().last()}connectedSections(){return[this.sectionConnectedToBegin(),this.sectionConnectedToEnd()].filter((e=>e))}sectionConnectedToBegin(){return this._sectionConnectedToBegin??=this.postProvider().previousSectionFor(this)}sectionConnectedToEnd(){return this._sectionConnectedToEnd??=this.postProvider().nextSectionFor(this)}sectionConnectedAt(e){return e.equals(this.edge().begin())?this.sectionConnectedToBegin():e.equals(this.edge().end())?this.sectionConnectedToEnd():void 0}sectionConnectedToTop(){if(!this.isLevel())return this.isBeginAtSlopeTop()?this.sectionConnectedToBegin():this.sectionConnectedToEnd()}sectionConnectedToBottom(){if(!this.isLevel())return this.isEndAtSlopeBottom()?this.sectionConnectedToEnd():this.sectionConnectedToBegin()}gateConnectedTo(e){const t=this.openingConnectedTo(e);return!!t&&!!t.gate()}openingConnectedTo(e){const t=this.componentOf().openings(),r=e.xy();return t.find((e=>e.edge().begin().xy().equals(r)||e.edge().end().xy().equals(r)))}objectConnectedToBegin(){return this.sectionConnectedToBegin()??this.openingConnectedTo(this.edge().begin())}objectConnectedToEnd(){return this.sectionConnectedToEnd()??this.openingConnectedTo(this.edge().end())}validOpeningEdge(e){const t=this.minLength().toNumeric(this.unit());return this.edge().stretchedBy(2*-t)}railingPosts(){return this._railingPosts??=this._defaultRailingPosts()}_defaultRailingPosts(){const e=this.postLocations();if(0===e.length)return[];const t=[];return e.forEach(((r,n)=>{if(0===n&&!this.shouldHavePostAtBegin())return;if(n===e.length-1&&!this.shouldHavePostAtEnd())return;const i=this.makePost(r,n,e.length-1);i.setComponentOf(this),t.push(i)})),t}shouldHavePostAtBegin(){const e=this.postProvider()?.existingPostAtBegin(this);return!e}shouldHavePostAtEnd(){return!0}makePost(e,t,r){const n=new(this._classForPost(t,r))(e);return n.setComponentOf(this),n}_classForPost(e,t){return R.default}postLocations(){if(!this.isSpaceForPosts())return[];const e=this.postLayoutEdge(),t=this.postSpacingLengths().slice(),r=t.length-1,n=this._beginPostLayoutInset(),i=[this._createPostLocation(e,n,-1,r)];return this.isSloped()&&this.edge().begin().z()>this.edge().end().z()&&t.reverse(),t.reduce(((t,n,s)=>{const o=this._createPostLocation(e,t+n,s,r);return i.push(o),t+n}),n),i}_createPostLocation(e,t,r,n){return new y.FixedEdgeLocator(e,t)}_beginPostLayoutInset(){return 0}isSpaceForPosts(){const e=this.edge().length().roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES),t=p.unit(e,this.unit());return p.largerEq(t,this.minPostSpacing())}postLayoutEdge(){const e=this.componentLayoutEdge(),t=this.postLayoutEdgeInsetHelper(),r=t.insetFor(this,this.edge().begin()).toNumeric(this.unit()),n=t.insetFor(this,this.edge().end()).toNumeric(this.unit());return v.default.stretchedEdgeBy(e,r,n).relativeToEdge(this.edge())}postLayoutEdgeInsetHelper(){const e=this.postLayoutEdgeInsetHelperClass();return this._postLayoutEdgeInsetHelper??=new e}postLayoutEdgeInsetHelperClass(){return z.default}minPostSpacing(){return this.minRailLength()}maxPostSpacing(){return this.maxRailLength()}stairMaxPostSpacing(){return this.maxPostSpacing()}stairMinPostSpacing(){return this.minPostSpacing()}postSpacingLengths(){const e=this.postLayoutEdge();return this.postSpacingHelper().railLengths(e)}postSpacingHelper(){const e=this.isSloped()?this._defaultSlopedPostSpacingHelper():this._defaultPostSpacingHelper();return e.setMode(this.postSpacingMode()),e}_defaultSlopedPostSpacingHelper(){return this.isStairs()?this._defaultStairPostSpacingHelper():this._defaultStringerPostSpacingHelper()}_defaultStringerPostSpacingHelper(){return this._defaultPostSpacingHelper()}_defaultStairPostSpacingHelper(){const e=this.stairMinPostSpacing(),t=this.stairMaxPostSpacing(),r=this.placementStrategy();return new j.default(e,t,r,this.unit(),this._railLengthHelperSystemParametersConfig())}_defaultPostSpacingHelper(){const e=this.minPostSpacing(),t=this.maxPostSpacing();return new _.default(e,t,this.unit(),this._railLengthHelperSystemParametersConfig())}_railLengthHelperSystemParametersConfig(){return _.default.defaultSystemParametersConfig.IMPERIAL}postSpacingMode(){return this.postProvider()?this.postProvider().railLengthMode():_.default.mode.EVEN}generateEndPost(){const e=this.postLocations(),t=this.makePost(e.last(),e.length-1,e.length-1);return t.setComponentOf(this),t}isBeginAtSlopeBottom(){return this.isSlopeBottomAt(this.edge().begin())}isBeginAtSlopeTop(){return this.isSlopeTopAt(this.edge().begin())}isEndAtSlopeBottom(){return this.isSlopeBottomAt(this.edge().end())}isEndAtSlopeTop(){return this.isSlopeTopAt(this.edge().end())}isBeginAtStairBottom(){return this.isBeginAtSlopeBottom()&&this.isStairs()}isBeginAtStairTop(){return this.isBeginAtSlopeTop()&&this.isStairs()}isEndAtStairBottom(){return this.isEndAtSlopeBottom()&&this.isStairs()}isEndAtStairTop(){return this.isEndAtSlopeTop()&&this.isStairs()}isSlopeBottomAt(e){if(this.isLevel())return!1;const t=this.edge().endpoints().find((t=>!e.equals(t)));return e.z()>t.z()}isSlopeTopAt(e){if(this.isLevel())return!1;const t=this.edge().endpoints().find((t=>!e.equals(t)));return e.z()<t.z()}isStairs(){return this.placementStrategy().isStairs()}delete(){this.run().deleteSection(this)}isDeleteable(){return!0}blockEdges(){return v.default.pointArrayToEdges(this.postLocations())}blockClass(){return x.default}blocks(){return this._blocks??=this._defaultBlocks()}_defaultBlocks(){const e=this.blockEdges(),t=this.blockClass();return e.map((e=>{const r=new t(e);return r.setComponentOf(this),r}))}beginBlock(){return this.blocks().first()}endBlock(){return this.blocks().last()}postAtLocator(e){const t=[...this.railingPosts()];return t.includes(this.beginPost())||t.push(this.beginPost()),t.includes(this.endPost())||t.push(this.endPost()),t.find((t=>t.locator().xy().equals(e.xy())))}components(){return[...this.rails(),...this.railingPosts(),...this.blocks()].filter((e=>e))}structureDirection(){return this.componentOf().structureDirection()}isPerpendicularToSection(e){return!!e&&e.edge().isPerpendicularTo(this.edge())}isParallelToSectionIn3D(e){return!!e&&e.edge().isParallelToIn3D(this.edge())}isParallelToSection(e){return e.edge().isParallelTo(this.edge())}defaultFigure(){const e=f.CompositeFigure.withModel(this);return e.setHandles(this.figureHandles()),e}threeFigure(){return g.Composite3DFigure.withModel(this)}_isSelectable(){return!0}figureHandles(){if(!this._isSelectable())return[];const e=new m.ConstructionComponentHandle(this);return e.setValidWhen(m.ConstructionComponentHandle.VALID_FOR_SELECTED),[e]}isPending(){return this.run().isPending?.()}pendingFigureColorOptions(){const e="#5bb2e4";return{strokeStyle:e,fillStyle:`${e}4d`}}postRestorationAction(){this.startObservingPostMountStyle(),this.startObservingRailingStyle()}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_rails","_railingPosts","_sideEdges","_sectionConnectedToBegin","_sectionConnectedToEnd","_postLayoutEdgeInsetHelper","_postMountStyleChoices","_railingStyleChoices",...f.DisplayProperties.nonEssentialProperties()]}}(0,b.extend)(RailingSection,f.DisplayProperties);var $=RailingSection},12832:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>y}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(63768)),m=r(7340),f=r(50988),g=d(r(52537));class RailingStyle{static supportedRailingHeights(){return[p.unit(36,"in"),p.unit(42,"in")]}static supportedPostWidths(){return[p.unit(2,"in")]}constructor(e,t,r){this._styleId=e,this._label=t,this._icon=r}equals(e){return this.styleId===e.styleId}get styleId(){return this._styleId}get value(){return this}get label(){return this._label}get icon(){return this._icon}supportedRailingHeights(){return this._supportedRailingHeights??=this.defaultSupportedRailingHeights()}defaultSupportedRailingHeights(){return this.constructor.supportedRailingHeights()}supportedPostWidths(){return this._supportedPostWidths??=this.defaultSupportedPostWidths()}defaultSupportedPostWidths(){return this.constructor.supportedPostWidths()}supportedGateTypes(){return this._supportedGateTypes??=this._defaultSupportedGateTypes()}_defaultSupportedGateTypes(){}terminalPostInset(){return this._terminalPostInset??=this.defaultTerminalPostInset()}setTerminalPostInset(e){this._terminalPostInset=e}edgeInsetForLayout(){return this.terminalPostInset()}defaultTerminalPostInset(){return p.unit(0,"in")}canApplyToRailingCollection(e){const t=this.supportedGateTypes();if(!t)return!0;const r=e.railingRuns().flatMap((e=>e.openings())).map((e=>e.gateType().title())),n=t.map((e=>e.title()));return 0===r.filter((e=>!n.includes(e))).length}structureEdgeOffsetFromCenter(e){return p.unit(0,"in")}nonEssentialProperties(){return[...m.DisplayProperties.nonEssentialProperties(),"_propertyChangedObservers","_supportedRailingHeights","_supportedPostWidths","_supportedGateTypes"]}copyPropertiesFromStyle(e){e.displayProperties().forEach((e=>{const t=this.displayProperties().find((t=>t.name()===e.name()));t&&t.set(e.get())}))}get materials(){throw new f.MissingOverride(this,"materials")}}var y=RailingStyle;(0,f.extend)(RailingStyle,m.DisplayProperties),(0,g.default)(RailingStyle,"propertyChanged")},72564:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(70373));class StairRailLengthHelper extends h.default{constructor(e,t,r,n,i){super(e,t,n,i),this._placementStrategy=r}get placementStrategy(){return this._placementStrategy}railLengths(e){const t=(e.xy().length()/this.stepRun().toNumeric(this.unit())).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES),r=this.maxLength().toNumeric(this.unit()),n=this.stepHypotenuse(),i=Math.max(Math.floor(r/n),1);if(i===1/0)return[e.length()];const s=Math.ceil(t/i),o=Math.floor(t/s),a=t%s,l=s-a,c=o*n,u=(o+1)*n;return[...Array(a.rounded()).fill(u),...Array(l.rounded()).fill(c)]}stepHypotenuse(){const e=this.stepRise(),t=this.stepRun();return Math.hypot(e.toNumeric(this.unit()),t.toNumeric(this.unit()))}stepRun(){return this.placementStrategy.stepRun()}stepRise(){return this.placementStrategy.stepRise()}}var p=StairRailLengthHelper},66036:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(63768));var p=class RailingLayoutInsetHelper{insetFor(e,t){if(!this._isLocatorSectionEdgeEndpoint(e,t))return this.fallbackInset(e);const r=e.sectionConnectedAt(t);if(!r)return this.terminalInset(e);if(e.isLevel()&&r.isLevel())return this.levelInset(e,r,t);return e.isSloped()===r.isSloped()?this.slopedInset(e,r,t):this.slopeTransitionInset(e,r,t)}_isLocatorSectionEdgeEndpoint(e,t){const r=e.edge();return t.equals(r.begin())||t.equals(r.end())}terminalInset(e){return h.unit(0,"in")}fallbackInset(e){return h.unit(0,"in")}levelInset(e,t,r){return e.isParallelToSection(t)?this.parallelInset(e,t):this.levelCornerInset(e,t)}parallelInset(e,t){return h.unit(0,"in")}levelCornerInset(e,t){return e.edge().isPerpendicularTo(t.edge())?this.rightAngleInset(e,t):this.obliqueInset(e,t)}rightAngleInset(e,t){return h.unit(0,"in")}obliqueInset(e,t){return this.rightAngleInset(e,t)}slopedInset(e,t,r){return this.levelInset(e,t,r)}slopeTransitionInset(e,t,r){const n=e.isParallelToSection(t),i=t.isSlopeTopAt(r)||e.isSlopeTopAt(r);return n?this.parallelSlopeTransitionInset(e,t,i):this.cornerSlopeTransitionInset(e,t,i)}parallelSlopeTransitionInset(e,t,r){return r?this.parallelSlopeTopTransitionInset(e,t):this.parallelSlopeBottomTransitionInset(e,t)}parallelSlopeTopTransitionInset(e,t){return this.parallelInset(e,t)}parallelSlopeBottomTransitionInset(e,t){return this.parallelInset(e,t)}cornerSlopeTransitionInset(e,t,r){return r?this.cornerSlopeTopTransitionInset(e,t):this.cornerSlopeBottomTransitionInset(e,t)}cornerSlopeTopTransitionInset(e,t){return e.edge().isPerpendicularTo(t.edge())?this.slopeTopTransitionRightAngleInset(e,t):this.slopeTopTransitionObliqueInset(e,t)}cornerSlopeBottomTransitionInset(e,t){return e.edge().isPerpendicularTo(t.edge())?this.slopeBottomTransitionRightAngleInset(e,t):this.slopeBottomTransitionObliqueInset(e,t)}slopeTopTransitionRightAngleInset(e,t){return this.rightAngleInset(e,t)}slopeTopTransitionObliqueInset(e,t){return this.slopeTopTransitionRightAngleInset(e,t)}slopeBottomTransitionRightAngleInset(e,t){return this.rightAngleInset(e,t)}slopeBottomTransitionObliqueInset(e,t){return this.slopeBottomTransitionRightAngleInset(e,t)}}},27744:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(63768));var p=class SectionLengthAdjuster{constructor(e){this._increment=e}increment(){return this._increment??=h.unit(1,"in")}setLength(e,t){const r=e.run(),n=this.endpointOffset(r,e,t),i=this.affectedRegionEdge(r,e);this.adjustRunLengthByOffset(r,n),this.adjustSectionLengthByOffset(r,e,n),this.translateOpeningsContainedByEdge(r,i,n),this.translateSectionsContainedByEdge(r,i,n),this.translateConnectedRuns(r,n)}endpointOffset(e,t,r){const n=this.increment().toNumeric(t.unit()),i=h.max(r,t.minLength()).toNumeric(t.unit()),s=Math.round(i/n)*n-t.edge().length();return e.edge().direction().multipliedBy(s)}affectedRegionEdge(e,t){const r=t.edge(),n=e.directionFlipped()?r.begin():r.end(),i=e.edge().end();return n.to(i)}adjustRunLengthByOffset(e,t){const[r,n]=e.edge().endpoints(),i=n.add(t);e.setEdge(r.to(i))}adjustSectionLengthByOffset(e,t,r){const[n,i]=t.edge().endpoints(),s=e.directionFlipped()?n.add(r):n,o=e.directionFlipped()?i:i.add(r),a=s.to(o).relativeToEdge(e.edge());t.setEdge(a)}translateOpeningsContainedByEdge(e,t,r){e.openings().filter((e=>{const r=e.edge().center();return t.containsPoint(r)})).forEach((e=>e.moveBy(r.x(),r.y(),r.z())))}translateSectionsContainedByEdge(e,t,r){e.sections().filter((e=>{const r=e.edge().center();return t.containsPoint(r)})).forEach((t=>{const n=t.edge().movedBy(r.x(),r.y(),r.z());t.setEdge(n.relativeToEdge(e.edge()))}))}translateConnectedRuns(e,t){e.componentOf().translateRunsAfter(e,t)}}},43554:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>g}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(63768)),m=r(50988),f=d(r(65477));var g=class PostFasciaMountStyleMixin{static styleIdentifier(){return f.default.MOUNT_STYLE_IDENTIFIERS.fascia}postZOffset(){return p.unit(10,"in")}structureEdgeOffsetFromCenter(e){return p.multiply(e,-.5)}sectionEdgeOffsetFromCenter(e=p.unit(0,"in")){return m.calculate`(${e} / 2 + ${this.insetFromEdgeOfPlatform()})`}}},5020:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>g}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=r(50988),m=d(r(43554)),f=d(r(65477));class PostFasciaMountStyle extends f.default{}(0,p.extend)(PostFasciaMountStyle,m.default);var g=PostFasciaMountStyle},65477:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>b}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(63768)),m=r(7340),f=r(50988),g=d(r(35801)),y=d(r(88431));class PostMountStyle{static MOUNT_STYLE_IDENTIFIERS={surface:"Surface",fascia:"Fascia"};static styleIdentifier(){return this.MOUNT_STYLE_IDENTIFIERS.surface}styleIdentifier(){return this.constructor.styleIdentifier()}isFasciaMount(){return this.styleIdentifier()===this.constructor.MOUNT_STYLE_IDENTIFIERS.fascia}isSurfaceMount(){return this.styleIdentifier()===this.constructor.MOUNT_STYLE_IDENTIFIERS.surface}postZOffset(){return p.unit(0,"in")}defaultDisplayProperties(){return[]}sectionEdgeOffsetFromCenter(e=p.unit(0,"in")){return f.calculate`-(${e} / 2 + ${this.insetFromEdgeOfPlatform()})`}insetFromEdgeOfPlatform(){return p.unit(0,"in")}get value(){return this}get label(){return this.constructor.styleIdentifier()}equals(e){return this.constructor===e.constructor}intersectionHelper(e){return new g.default(this._baseComponentLayoutEdge(e))}_baseComponentLayoutEdge(e){return e.edge().shiftedAlongNormalBy(this.componentLayoutEdgeOffset(e))}componentLayoutEdgeFor(e,t=!0){const r=this.intersectionHelper(e),n=e.sectionConnectedToBegin()?.componentLayoutLine(),i=e.sectionConnectedToEnd()?.componentLayoutLine(),s=r.edge(n,i,t,this.componentLayoutEdgeIntersectionOverride.bind(this,e)),o=this.componentLayoutEdgeInsetFor(e.edge().begin(),e),a=this.componentLayoutEdgeInsetFor(e.edge().end(),e);return y.default.stretchedEdgeBy(s,-o,-a)}componentLayoutEdgeIntersectionOverride(e,t,r,n,i){return r.isParallelTo(i)?t?r.begin():r.end():n||(t&&e.isBeginAtStairBottom()?r.begin():!t&&e.isEndAtStairBottom()?r.end():void 0)}componentLayoutEdgeInsetFor(e,t){return 0}componentLayoutLineFor(e){return this.intersectionHelper(e).line()}componentLayoutEdgeOffset(e){const t=this._componentLayoutEdgeOffsetDelta(e),r=e.structureDirection();return p.multiply(t,r).toNumeric(e.unit())}_componentLayoutEdgeOffsetDelta(e){return this.sectionEdgeOffsetFromCenter(e.postWidth())}_componentLayoutEdgeLocator(e,t,r,n){return e}nonEssentialProperties(){return[...m.DisplayProperties.nonEssentialProperties(),"_propertyChangedObservers"]}}(0,f.extend)(PostMountStyle,m.DisplayProperties),(0,f.simpleObserver)(PostMountStyle,"propertyChanged");var b=PostMountStyle},35801:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(88431));var p=class EdgeIntersectionHelper{constructor(e,t=0){this._baseEdge=e,this._offsetAlongNormal=t}baseEdge(){return this._baseEdge}offsetAlongNormal(){return this._offsetAlongNormal}line(){return this.baseEdge().shiftedAlongNormalBy(this.offsetAlongNormal())}edge(e,t,r=!0,n=this.overrideIntersection.bind(this)){const i=this.line();if(!r)return i;let[s,o]=i.endpoints();if(e&&!i.isParallelToIn3D(e)){const t=e.shiftedAlongNormalBy(this.offsetAlongNormal());s=this._lineIntersection(i,t,!0,n)}if(t&&!i.isParallelToIn3D(t)){const e=t.shiftedAlongNormalBy(this.offsetAlongNormal());o=this._lineIntersection(i,e,!1,n)}return s.to(o)}_lineIntersection(e,t,r,n){const i=e.intersectionsWithLine(t).first(),s=n(r,e,i,t);if(s)return s;if(i)return i;const o=e.xy().intersectionsWithLineIn2D(t.xy()).first(),a=r?e.begin():e.end();if(!o)return a;const l=o.addZ(a.z());if(h.default.isLevel(e))return l;const c=a.distanceTo(l),u=Math.PI_2-e.phi(),d=Math.tan(u)*c,p=l.addZ(d),m=l.addZ(-d);return e.containsPointOnLine(p)?p:m}overrideIntersection(e,t,r,n){}}},88431:(e,t,r)=>{var n,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(l,{default:()=>u}),e.exports=(n=l,((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(n=s(t,l))||n.enumerable});return e})(i({},"__esModule",{value:!0}),n));var c=r(62048);var u=class EdgeUtils{static orderEdges(e,t){const r=e.map((e=>{const r=t.distanceTo3D(e.begin()),n=t.distanceTo3D(e.end());return{directedEdge:r<n?e:e.reversed(),distance:Math.min(r,n)}}));return r.sort(((e,t)=>e.distance-t.distance)),r.map((e=>e.directedEdge))}static constrainEdgeToEdge(e,t){let r=t.closestPointTo(e.begin(),!0).to(t.closestPointTo(e.end(),!0));const n=t.direction(),i=t.begin().dot(n),s=t.end().dot(n),o=r.begin().dot(n),a=r.end().dot(n);if(o<i){const e=new c.FixedEdgeLocator(t,r.length()).snapshot();r=t.begin().to(e)}else if(a>s){const e=new c.FixedEdgeLocator(t,-r.length()).snapshot();r=e.to(t.end())}return r}static isLevel(e){return e.begin().z().isNearTo(e.end().z())}static mergeOverlappingEdges(e,t=void 0){if(0===e.length)return[];const r=e.first().direction(),n=Math.max(...e.flatMap((e=>[e.begin(),e.end()])).map((e=>r.dot(e)))),i=t??r.multipliedBy(n);return this.orderEdges(e,i).reduce(((e,t)=>{const r=e.find((e=>e.overlaps(t)));if(r){e.remove(r);const n=r.begin().distanceTo(r.end())>r.begin().distanceTo(t.end())?r.end():t.end();e.push(r.begin().to(n))}else e.push(t);return e}),[])}static overlappingEdgeSegments(e){const t=e.first().direction(),r=e.map((e=>e.direction().equals(t)?e:e.reversed())),n=r.map((e=>e.begin())).reduce(((e,r)=>r.dot(t)>e.dot(t)?r:e)),i=r.map((e=>e.end())).reduce(((e,r)=>r.dot(t)<e.dot(t)?r:e)),s=e.map((e=>{const t=e.closestRelativePointTo(n,!0).to(e.closestRelativePointTo(i,!0));if(e.overlapsBySignificantDistance(t))return t})).filter((e=>e));return s.length===e.length?s:[]}static subtractSegmentsFromEdge(e,t,r=void 0){if(0===t.length)return[e];const n=this.mergeOverlappingEdges(t,r),i=e.direction(),s=i.multipliedBy(Math.min(e.begin().dot(i),...n.flatMap((e=>[e.begin().dot(i),e.end().dot(i)])))),o=this.orderEdges(n,s),a=o.map(((t,r)=>{const n=o[r+1];if(n)return e.closestRelativePointTo(t.end()).to(e.closestRelativePointTo(n.begin()))})).filter((e=>e)),l=o.first().begin(),c=o.last().end();return l.subtract(e.begin()).dot(e.direction())>0&&a.unshift(e.begin().to(e.closestRelativePointTo(l))),c.subtract(e.end()).dot(e.direction())<0&&a.push(e.closestRelativePointTo(c).to(e.end())),a.filter((e=>!e.length().isNearTo(0)))}static pointIsBeforeEdge(e,t){const r=e.direction();return e.begin().to(t).direction().dot(r)<0}static pointIsAfterEdge(e,t){const r=e.direction();return e.end().to(t).direction().dot(r)>0}static pointIsAtEdgeTerminus(e,t){return e.begin().equals(t)||e.end().equals(t)}static pointArrayToEdges(e=[]){const t=[];return e.reduce(((e,r)=>(e!==r&&t.push(e.to(r)),r)),e.first()),t}static stretchedEdgeBy(e,t,r){const n=e.direction(),i=n.negated().multipliedBy(t),s=n.multipliedBy(r),o=e.begin().movedBy(i.x(),i.y(),i.z()),a=e.end().movedBy(s.x(),s.y(),s.z());return o.to(a)}static flattenedAtZ(e,t){return e.xy().addZ(t)}static axisAlign(e,t,r){const[n,i]=e.endpoints(),[s,o]=e.endpoints().map((e=>t.dot(e))).sort(((e,t)=>e-t)),a=Math.min(r.dot(n),r.dot(i));return t.multipliedBy(s).add(r.multipliedBy(a)).to(t.multipliedBy(o).add(r.multipliedBy(a)))}}},8423:(e,t,r)=>{r(84360);const n=r(13793),i=r(99240),s=r(73354),o=r(34109),a=r(99721),l=r(81029),c=r(80685),u=r(14727),d=r(38777),h=r(75020),p=r(77548),m=r(48316),f=r(66443),g=r(91948),y=r(47109),b=r(73731),v=r(68640),_=r(63510),x=r(50198),w=r(92639),R=r(54831),k=r(27325),j=r(97119),z=r(45707),q=r(35783);e.exports.DefaultGateTypes=n,e.exports.EdgeIntersectionHelper=i,e.exports.EdgeUtils=s,e.exports.Gate=o,e.exports.GateDelegate=a,e.exports.GateType=l,e.exports.HybridSurfaceRailingPlacementStrategy=c,e.exports.PostFasciaMountStyle=u,e.exports.PostFasciaMountStyleMixin=d,e.exports.PostMountStyle=h,e.exports.PostProvider=p,e.exports.RailLengthHelper=m,e.exports.RailingBlock=f,e.exports.RailingCollection=g,e.exports.RailingComponent=y,e.exports.RailingLayoutInsetHelper=b,e.exports.RailingOpening=v,e.exports.RailingPlacementStrategy=_,e.exports.RailingPost=x,e.exports.RailingProject=w,e.exports.RailingRun=R,e.exports.RailingSection=k,e.exports.RailingStyle=j,e.exports.SectionLengthAdjuster=z,e.exports.StairRailLengthHelper=q},51813:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>a}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));var a=class GateDelegate{gateWidthChanged(e){}isGateArmWidthValid(e,t){}}},87693:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>a}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));var a=class PostProvider{postDescriptor(){}existingPostAtBegin(e){}existingPostAtEnd(e){}previousSectionFor(e){}nextSectionFor(e){}}},3163:(e,t,r)=>{const n=r(23770),i=r(6962),s=n.createContext(new i);e.exports=s,e.exports.withIconFactory=function(e){return function(t){return n.createElement(s.Consumer,null,(r=>n.createElement(e,{...t,iconFactory:r})))}}},68522:(e,t,r)=>{const n=r(69722),i=r(23770),s=i.createContext(!1);class MobileBreakpoint extends i.Component{static MobileContext=s;static propTypes={mediaQuery:n.string,children:n.node};static defaultProps={mediaQuery:"(max-width: 884px)"};constructor(e){super(e),this.state={isMobile:this.mediaQuery().matches},this._updateMediaQuery=this._updateMediaQuery.bind(this)}componentDidMount(){this.mediaQuery().addListener(this._updateMediaQuery)}componentWillUnmount(){this.mediaQuery().removeListener(this._updateMediaQuery)}mediaQuery(){return this._mediaQuery||(this._mediaQuery=window.matchMedia(this.props.mediaQuery)),this._mediaQuery}_updateMediaQuery(){this.setState({isMobile:this.mediaQuery().matches})}render(){return i.createElement(s.Provider,{value:this.state.isMobile},this.props.children)}}e.exports=MobileBreakpoint},10643:(e,t,r)=>{const n=r(23770),i=n.createContext(document.createElement("div"));i.withModalRoot=function(e){return function(t){return n.createElement(i.Consumer,null,(r=>n.createElement(e,{...t,modalRoot:r})))}},e.exports=i},84789:(e,t,r)=>{const{action:n,decorate:i,extendObservable:s}=r(63737);class SaveOnServerController{constructor(e){this._repository=e,s(this,{_saveStatus:!this.repository().isDirty()}),this.startObservingSaveStatus()}startObservingSaveStatus(){this.repository().addDirtyStateChangedObserver(this,this._updateSaveStatus),this._updateSaveStatus()}stopObservingSaveStatus(){this.repository().removeDirtyStateChangedObserver(this,this._updateSaveStatus)}repository(){return this._repository}async save(){return this.repository().updateOnServer()}get saveStatus(){return this._saveStatus}_updateSaveStatus(){this._saveStatus=!this.repository().isDirty()}}i(SaveOnServerController,{_updateSaveStatus:n}),e.exports=SaveOnServerController},47794:(e,t,r)=>{const n=r(79951),i=r(1369),s=r(7651),o=r(98160),a=r(89672),l=r(7930),c=r(42567),u=r(6269),d=r(6770),h=r(34301),p=r(72922),m=r(6962),f=r(3163),g=r(44926),y=r(6836),b=r(6927),v=r(68522),_=r(9498),x=r(10643),w=r(22061),R=r(96810),k=r(65780),j=r(79018),z=r(1839),q=r(4316),$=r(70892),Z=r(90524),X=r(43642),Y=r(15270),ee=r(2101),te=r(84789),re=r(31447),ne=r(96158),ie=r(1041),se=r(25262),oe=r(85848),ae=r(75815),le=r(75680),ce=r(66787),ue=r(63903),de=r(5400),he=r(81085),pe=r(20909),me=r(86491),fe=r(22939),ge=r(21286);e.exports.AuxillaryCanvasView=n,e.exports.BooleanMapPropertyView=i,e.exports.BooleanPropertyView=s,e.exports.CollapsibleSidePanel=o,e.exports.ColorPropertyView=a,e.exports.DisplayPropertiesView=l,e.exports.DotMenu=c,e.exports.DrawingCanvas=u,e.exports.DrawingEditorActionBar=d,e.exports.DrawingEditorView=h,e.exports.Icon=p,e.exports.IconFactory=m,e.exports.IconFactoryContext=f,e.exports.LayerToggle=g,e.exports.LayersControl=y,e.exports.LayersPanel=b,e.exports.MobileBreakpoint=v,e.exports.Modal=_,e.exports.ModalRootContext=x,e.exports.MultiPerspectiveProjectEditorView=w,e.exports.NumberPropertyView=R,e.exports.PerspectiveEditorView=k,e.exports.PropertyPanel=j,e.exports.PropertyView=z,e.exports.RadioPropertyView=q,e.exports.RadioSelect=$,e.exports.RadioSelectPropertyView=Z,e.exports.ReactCanvasInput=X,e.exports.RedoControl=Y,e.exports.SaveButton=ee,e.exports.SaveOnServerController=te,e.exports.SelectPropertyView=re,e.exports.SelectionDeleteButton=ne,e.exports.TextAreaPropertyView=ie,e.exports.TextInput=se,e.exports.TextPropertyView=oe,e.exports.ToolPanel=ae,e.exports.ToolView=le,e.exports.TraySelect=ce,e.exports.TraySelectPropertyView=ue,e.exports.UndoControl=de,e.exports.UnitField=he,e.exports.UnitPropertyView=pe,e.exports.ZoomControl=me,e.exports.oneOfProps=fe,e.exports.pointerCapture=ge},22939:e=>{e.exports=(e,t)=>(r,n,i,...s)=>{const o=`one of \`${n}\` and \`${e}\` must be supplied. \`${i}\`. Validation failed.`;return r[e]&&r[n]?new Error(`only ${o}`):r[e]||r[n]?t(r,n,i,...s):new Error(o)}},79951:(e,t,r)=>{const n=r(69722),i=r(23770),{Popper:s}=r(59231),{BoundableAdapter:o}=r(7340);class AuxillaryCanvasView extends i.Component{static propTypes={children:n.node.isRequired,drawingController:n.object.isRequired,boundable:n.object.isRequired,placement:n.string,popperOpts:n.object};static defaultProps={placement:"right",popperOpts:{}};referenceElement(){return this._referenceElement||(this._referenceElement=new o(this.props.boundable,this.props.drawingController)),this._referenceElement}_renderOnComponent(){const e=this.referenceElement().getBoundingClientRect(),t={position:"fixed",left:`${e.left}px`,top:`${e.top}px`,zIndex:"100"};return i.createElement("div",{style:t},this.props.children)}_renderNextToComponent(){return i.createElement(s,{referenceElement:this.referenceElement(),placement:this.props.placement,positionFixed:!0,...this.props.popperOpts},(({ref:e,style:t,placement:r})=>i.createElement("div",{ref:e,style:t,"data-placement":r},this.props.children)))}render(){return"on"===this.props.placement?this._renderOnComponent():this._renderNextToComponent()}}e.exports=AuxillaryCanvasView},98160:(e,t,r)=>{const n=r(78035),i=r(69722),s=r(23770),{MobileContext:o}=r(68522),a=r(72922);class CollapsibleSidePanel extends s.Component{static contextType=o;static propTypes={side:i.oneOf(["left","right"]).isRequired,children:i.oneOfType([i.node,i.func]).isRequired};constructor(e,t){super(e),this.state={isMobile:t,collapsed:t}}componentDidUpdate(e){const t=this.context;this.state.isMobile!==t&&this.setState({isMobile:t,collapsed:t})}_toggleCollapsed(){this.setState((e=>({collapsed:!e.collapsed})))}_collapseButtonIconName(){return"left"===this.props.side?this.state.collapsed?"KeyboardArrowRight":"KeyboardArrowLeft":this.state.collapsed?"KeyboardArrowLeft":"KeyboardArrowRight"}_renderToggleCollapseButton(){return s.createElement("button",{onMouseDown:e=>e.preventDefault(),onClick:this._toggleCollapsed.bind(this),className:"side-panel__toggle"},s.createElement(a,{name:this._collapseButtonIconName()}))}render(){const e=n("side-panel",`side-panel--${this.props.side}`,{"side-panel--collapsed":this.state.collapsed});let t;return t="function"==typeof this.props.children?this.props.children(this.state.collapsed,this._toggleCollapsed.bind(this)):this.props.children,s.createElement("div",{className:e},this._renderToggleCollapseButton(),t)}}e.exports=CollapsibleSidePanel},42567:(e,t,r)=>{const n=r(69722),i=r(23770),s=r(72922);class DotMenu extends i.Component{static propTypes={children:n.node.isRequired};constructor(e){super(e),this.state={isOpen:!1}}_toggle(e){e.stopPropagation(),this.setState((e=>({isOpen:!e.isOpen})))}_renderMenuItems(){if(this.state.isOpen)return i.createElement("div",{className:"dropdown-menu__menu-list"},this.props.children)}_renderButton(){const e=this.state.isOpen?"close":"more_vert";return i.createElement("button",{className:"action-bar__dot-menu-button btn btn--icon",onClick:this._toggle.bind(this)},i.createElement(s,{name:e}))}render(){return i.createElement("div",{className:"dropdown-menu",onClick:this._toggle.bind(this)},this._renderButton(),this._renderMenuItems())}}e.exports=DotMenu},6269:(e,t,r)=>{const n=r(78035),i=r(69722),s=r(23770),o=r(21286),a=new Map;class DrawingCanvas extends s.Component{static propTypes={drawingEditor:i.object.isRequired,activePerspective:i.string,pointerCaptureProps:i.object};constructor(e){super(e),this._canvasAreaRef=s.createRef()}componentDidMount(){this._addCanvasToDOM(),this._keyboardListener=e=>this._handleKeyboardEvent(e),this._resizeListener=e=>this._resize(e),this._drawingControllerEventListener=e=>this._handleMouseEvent(e),this._addDrawingControllerEventListeners(),window.addEventListener("keydown",this._keyboardListener),window.addEventListener("keyup",this._keyboardListener),window.addEventListener("resize",this._resizeListener),this._drawingController().setCanvas(this._canvas()),this._drawingEditor().activate(),this._resize(),this._drawingController().draw()}componentWillUnmount(){this.props.drawingEditor.deactivate(),this._removeDrawingControllerEventListeners(this._drawingController(),this._canvas()),window.removeEventListener("keyup",this._keyboardListener),window.removeEventListener("keydown",this._keyboardListener),window.removeEventListener("resize",this._resizeListener)}componentDidUpdate(e){if(this.props.drawingEditor!==e.drawingEditor){e.drawingEditor.deactivate();const t=this._findOrCreateCanvasElement(e.drawingEditor);this._removeDrawingControllerEventListeners(e.drawingEditor.drawingController(),t),this._canvasAreaRef.current.removeChild(t),this._addCanvasToDOM(),this._drawingController().setCanvas(this._canvas()),this._drawingEditor().activate(),this._addDrawingControllerEventListeners(),this._resize(),this._drawingController().redraw()}}_drawingEditor(){return this.props.drawingEditor}_drawingController(){return this._drawingEditor().drawingController()}_canvas(){return this._findOrCreateCanvasElement()}_addDrawingControllerEventListeners(){this._drawingController().handledEvents().forEach((e=>{this._canvas().addEventListener(e,this._drawingControllerEventListener,{passive:!1})}))}_removeDrawingControllerEventListeners(e,t){e.handledEvents().forEach((e=>{t.removeEventListener(e,this._drawingControllerEventListener,{passive:!1})}))}_addCanvasToDOM(){const e=this._canvas(),t=this._perspectiveClassName();e.className=n("drawing-canvas",t),this._canvasAreaRef.current.appendChild(e)}_perspectiveClassName(){if(!this.props.activePerspective)return;return`drawing-canvas--${this.props.activePerspective.toLowerCase().replace(/[^\w\d]/g,"-")}`}_resize(){const e=this._canvasAreaRef.current.offsetHeight,t=this._canvasAreaRef.current.offsetWidth;this._canvas().height===e&&this._canvas().width===t||(this._canvas().height=e,this._canvas().width=t,this._drawingController().afterResize())}_handleMouseEvent(e){this._drawingController().handleMouseEvent(e)}_handleKeyboardEvent(e){this._drawingController().handleKeyboardEvent(e)}_findOrCreateCanvasElement(e=this.props.drawingEditor){let t=a.get(e);return t||(t=document.createElement("canvas"),t.id="drawing",a.set(e,t)),t}render(){return s.createElement("div",{className:"canvas-area",ref:this._canvasAreaRef,...this.props.pointerCaptureProps})}}e.exports=o(DrawingCanvas)},34301:(e,t,r)=>{const n=r(69722),i=r(23770);class DrawingEditorView extends i.Component{static propTypes={drawingEditor:n.object.isRequired,children:n.node};_project(){return this.props.drawingEditor.project()}componentDidMount(){this._project().addCurrentVersionReplacedObserver(this,this.forceUpdate)}componentWillUnmount(){this._project().removeCurrentVersionReplacedObserver(this,this.forceUpdate)}render(){return i.createElement("div",{className:"drawing-editor-container"},this.props.children,i.createElement("div",{id:"modalDlgHolder"}))}}e.exports=DrawingEditorView},72922:(e,t,r)=>{const n=r(69722),i=r(23770),{withIconFactory:s}=r(3163);class Icon extends i.Component{render(){const{name:e,iconFactory:t,...r}=this.props;return t.makeIcon(e,r)}}Icon.propTypes={name:n.string.isRequired,iconFactory:n.object.isRequired},e.exports=s(Icon)},6962:(e,t,r)=>{const n=r(23770);e.exports=class IconFactory{makeIcon(e,t){let i;try{i=r(80046)(`./${e}.svg`)}catch(e){i=r(52012)}return n.createElement(i,{...t})}}},44926:(e,t,r)=>{const n=r(78035),i=r(69722),s=r(23770),o=r(72922);class LayerToggle extends s.Component{static propTypes={layerName:i.string.isRequired,layerManager:i.object.isRequired,redrawView:i.func.isRequired};visible(){return this.props.layerManager.isVisible(this.props.layerName)}classes(){return n("layers__item","justify-between","gap-sm",{"layers__item--hidden":!this.visible()})}iconName(){return this.visible()?"check_box":"check_box_outline_blank"}_toggleLayer(){this.props.layerManager.toggle(this.props.layerName),this.props.redrawView(),this.forceUpdate()}render(){const{layerName:e}=this.props;return s.createElement("li",{className:this.classes()},s.createElement("span",null,e),s.createElement("button",{"data-testid":"layer-button",className:"btn btn--icon",onClick:()=>this._toggleLayer()},s.createElement(o,{name:this.iconName(),className:"icon"})))}}e.exports=LayerToggle},6836:(e,t,r)=>{const n=r(78035),i=r(69722),s=r(23770),o=r(72922),a=r(6927);class LayersControl extends s.Component{static propTypes={drawingController:i.object.isRequired,showLabel:i.bool,label:i.string,className:i.string,buttonClassName:i.string};static defaultProps={label:"Layers",buttonClassName:"btn--pill"};constructor(e){super(e),this.state={isDropdownOpen:!1}}_toggleDropdown(){this.setState((e=>({isDropdownOpen:!e.isDropdownOpen})))}_isDisabled(){return 0===this.props.drawingController.layerManager().layerNames().length}_isDropdownVisible(){return this.state.isDropdownOpen&&!this._isDisabled()}_renderLayersDropdown(){if(this._isDropdownVisible())return s.createElement("div",{className:"dropdown-menu__menu-list"},s.createElement(a,{drawingController:this.props.drawingController}))}_renderButtonLabel(){if(this.props.showLabel)return s.createElement("div",{className:"action-bar-label","data-testid":"layers-button-label"},this.props.label)}_renderButton(){const e=this.state.isDropdownOpen?"close":"layers",t=n("btn",this.props.buttonClassName);return s.createElement("button",{disabled:this._isDisabled(),className:t,onClick:this._toggleDropdown.bind(this),"data-testid":"layers-button"},this._renderButtonLabel(),s.createElement(o,{name:e}))}render(){const e=n("dropdown-menu",this.props.className);return s.createElement("div",{className:e},this._renderButton(),this._renderLayersDropdown())}}e.exports=LayersControl},6927:(e,t,r)=>{const n=r(69722),i=r(23770),s=r(44926);class LayersPanel extends i.Component{static propTypes={drawingController:n.object.isRequired};static getDerivedStateFromProps(e,t){const r=e.drawingController.layerManager();return t.layerManager===r?null:{layerManager:r}}constructor(e){super(e);const t=e.drawingController.layerManager();this.state={layerManager:t}}redrawView(){this.props.drawingController.redraw()}renderSeparator(e){if(0===e)return i.createElement("hr",{className:"divider--header"})}render(){const e=this.state.layerManager.layerNames();return 0===e.length?"":i.createElement(i.Fragment,null,i.createElement("header",{"data-testid":"layers-panel",className:"flex justify-left layers__header"},"Layers"),i.createElement("section",{className:"layers"},e.map(((e,t)=>i.createElement(i.Fragment,{key:e},this.renderSeparator(t),i.createElement(s,{layerName:e,layerManager:this.state.layerManager,redrawView:this.redrawView.bind(this)}))))))}}e.exports=LayersPanel},9498:(e,t,r)=>{const n=r(78035),i=r(69722),s=r(23770),o=r(47723),{withModalRoot:a}=r(10643);class Modal extends s.Component{static propTypes={visible:i.bool.isRequired,modalRoot:i.object.isRequired,children:i.node.isRequired,className:i.string,classes:i.string,onEscapeKey:i.func,onEnterKey:i.func,onClickOutsideModal:i.func};static defaultProps={visible:!1,onEscapeKey:()=>{},onEnterKey:()=>{},onClickOutsideModal:()=>{}};constructor(e){super(e),this._onKeyUp=this._onKeyUp.bind(this)}componentDidMount(){window.addEventListener("keyup",this._onKeyUp)}componentWillUnmount(){window.removeEventListener("keyup",this._onKeyUp)}_preventEventPropagation(e){e.stopPropagation()}_onKeyUp(e){if(!this.props.visible)return;const t=e.code;"Escape"===t?this.props.onEscapeKey():"Enter"!==t&&"NumpadEnter"!==t||this.props.onEnterKey()}_renderModal(){const{visible:e,modalRoot:t,onEscapeKey:r,onEnterKey:i,onClickOutsideModal:o,children:a,className:l,classes:c,...u}=this.props,d=n("modal",l,c);return s.createElement("div",{className:"modal-wrapper modal-wrapper--active",onClick:this._preventEventPropagation.bind(this)},s.createElement("div",{className:"modal-wrapper__backdrop",onClick:o,"data-testid":"outside-of-modal"}),s.createElement("div",{className:d,...u},a))}render(){return this.props.visible?o.createPortal(this._renderModal(),this.props.modalRoot):null}}e.exports=a(Modal)},22061:(e,t,r)=>{const n=r(69722),i=r(23770),{Redirect:s,Route:o,Switch:a}=r(44886),{MultiPerspectiveProjectEditor:l,PersistentProjectRepository:c}=r(7340),u=r(68522),d=r(79018),h=r(65780);class MultiPerspectiveProjectEditorView extends i.Component{static propTypes={versionedProject:n.object,drawingEditors:n.object,projectRepository:n.object,perspectiveComponentClasses:n.object,perspectiveOptions:n.object,defaultPerspective:n.string,match:n.object,mobileBreakpoint:n.string,history:n.object,onPerspectiveChanged:n.func,mediaQuery:n.string};static defaultProps={perspectiveComponentClasses:{default:h},perspectiveOptions:{}};_basePerspectiveOptions(){return{top:{actionBarOptions:{},leftSidePanel:!0,rightSidePanel:!0},default:{actionBarOptions:{},leftSidePanel:!1,rightSidePanel:!1,leftSideComponentClass:null,rightSideComponentClass:null,renderLeftSidePanel:e=>i.createElement(i.Fragment,null,i.createElement("div",{className:"side-panel__header"},i.createElement("h2",null,"Left side panel")),i.createElement("div",{className:"side-panel__body"},i.createElement("div",{className:"side-panel__section side-panel__section--padded"},i.createElement("p",null,"This is typically used for project components. Override the panel contents by setting perspectiveOptions on your MultiPerspectiveProjectEditorView")))),renderRightSidePanel:e=>i.createElement(d,{drawingController:e.drawingController()})}}}_currentGuide(){const e=this._basePath();return this.props.history.location.pathname.replace(e,"").match(/^\/([\w\s]+)/)[1]}async componentDidMount(){this.props.history&&(this._unlisten=this.props.history.listen((()=>{this.props.onPerspectiveChanged&&this.props.onPerspectiveChanged(this._currentGuide())})))}componentWillUnmount(){this._unlisten&&this._unlisten()}projectEditor(){return this._projectEditor||(this._projectEditor=this.defaultProjectEditor(this.props.drawingEditors,this.props.versionedProject,this.props.defaultPerspective)),this._projectEditor}defaultProjectEditor(e,t,r){return new l(e,t,r)}_basePath(){return this.props.match?this.props.match.path:""}_perspectiveComponentClass(e){return this.props.perspectiveComponentClasses[e]||this.props.perspectiveComponentClasses.default||h}projectRepository(){return this._projectRepository||(this.props.projectRepository?this._projectRepository=this.props.projectRepository:this._projectRepository=new c(this.props.versionedProject)),this._projectRepository}_perspectiveOptions(e){const t=this._basePerspectiveOptions();return Object.assign({},t.default,this.props.perspectiveOptions.default,t[e],this.props.perspectiveOptions[e])}_renderDrawingEditorView({match:e}){const t=e.params.perspective,r=this._perspectiveComponentClass(t),n=this.projectEditor().drawingEditor(t);return i.createElement(r,{drawingEditor:n,projectRepository:this.projectRepository(),perspectives:this.projectEditor().perspectives(),basePath:this._basePath(),activePerspective:t,...this._perspectiveOptions(t)})}render(){const e=this._basePath();return i.createElement(i.Fragment,null,i.createElement(u,{mediaQuery:this.props.mediaQuery},i.createElement(a,null,i.createElement(o,{path:`${e}/:perspective(${this.projectEditor().perspectives().join("|")})`,render:this._renderDrawingEditorView.bind(this)}),i.createElement(s,{to:`${e}/${this.projectEditor().defaultPerspective()}`}))))}}e.exports=MultiPerspectiveProjectEditorView},79018:(e,t,r)=>{const n=r(69722),i=r(23770),s=r(96158),o=r(7930);class PropertyPanel extends i.Component{static propTypes={drawingController:n.object.isRequired,propertyPanelLookup:n.instanceOf(Map),propertyViews:n.array,propertyEventRecorder:n.object,hideDeleteButton:n.bool};static defaultProps={propertyPanelLookup:new Map,propertyViews:[],hideDeleteButton:!1};constructor(e){super(e),this.state={selection:e.drawingController.selection(),project:e.drawingController.project().current()}}static getDerivedStateFromProps(e,t){return{selection:e.drawingController.selection(),project:e.drawingController.project().current()}}componentDidMount(){this._startObservingSelection()}componentWillUnmount(){this._stopObservingSelection()}componentDidUpdate(e){e.drawingController!==this.props.drawingController&&(this._stopObservingSelection(e.drawingController),this._startObservingSelection())}_startObservingSelection(){this.props.drawingController.addSelectionChangedObserver(this,this._updateSelection)}_stopObservingSelection(e=this.props.drawingController){e.removeSelectionChangedObserver(this,this._updateSelection)}_selectedComponents(e=this.state.selection){const t=e.components();return 0===t.length?[this.state.project]:t}_updateSelection(){const e=this.props.drawingController.selection();this.setState({selection:e})}propertyEventRecorder(){return this.props.propertyEventRecorder??this.props.drawingController}_selectionName(e){return e.name?.()??e.displayName?.()??e.constructor.name.replace(/([a-z])([A-Z])/g,"$1 $2")}_renderDeleteButton(){if(!this.props.hideDeleteButton)return i.createElement(s,{drawingController:this.props.drawingController,withDivider:!0})}_renderSelectionHeader(e){if(e[0]!==this.state.project){if(1===e.length){const t=this._selectionName(e.first());return i.createElement("span",{className:"property-panel__selection-title"},"Properties: ",i.createElement("span",{className:"property-panel__selection-name"},t))}return e.length>1?i.createElement("span",{className:"property-panel__selection-name"},"Multi Selection"):void 0}}_renderDisplayProperties(e){return i.createElement(o,{components:e,drawingController:this.props.drawingController,propertyViews:this.props.propertyViews,propertyEventRecorder:this.propertyEventRecorder()})}_renderPanelContent(e){if(1===e.length){const t=e.first(),r=this.props.propertyPanelLookup.get(t.constructor);if(r)return i.createElement(r,{drawingController:this.props.drawingController,model:t})}return this._renderDisplayProperties(e)}_renderPanelSection(){const e=this._selectedComponents();return i.createElement("div",{className:"property-panel__selection-wrapper"},i.createElement("div",{className:"property-panel__scrolling-section"},this._renderSelectionHeader(e),i.createElement("div",{className:"flex flex-col gap-md"},this._renderPanelContent(e))),this._renderDeleteButton())}render(){return i.createElement("div",{className:"property-panel__container"},this._renderPanelSection())}}e.exports=PropertyPanel},43642:(e,t,r)=>{const n=r(23770),i=r(47723),{AuxillaryDrawingElement:s}=r(7340),o=r(79951),a=r(25262);e.exports=class ReactCanvasInput extends s{show(e,t={}){const{getter:r,setter:s,label:a,props:l,wrapperClassName:c}=t;i.render(n.createElement(o,{boundable:e,placement:t.placement,drawingController:this.drawingController()},this.renderInputPanel(e,r,s,a,l,c)),this.rootElement())}renderInputPanel(e,t,r,i,s,o="canvas-input"){if(!t||!r)throw new Error("Missing required args");const l=i?n.createElement("label",{className:"form-label"},i):null;return n.createElement("div",{className:o},l,n.createElement(a,{classes:"form-control",value:e[t]().toString(),autoFocus:!0,onFocus:e=>e.target.select(),onBlur:()=>this.hide(),onSave:()=>{this.drawingController().project().createSnapshot(),this.hide()},onChange:t=>e[r](t),...s}))}hide(){i.unmountComponentAtNode(this.rootElement()),this.drawingController().draw()}}},15270:(e,t,r)=>{const n=r(78035),i=r(69722),s=r(23770),o=r(72922);class RedoControl extends s.Component{static propTypes={versionedProject:i.object.isRequired,label:i.any,className:i.string,useIcon:i.bool,showIconLabel:i.bool};static defaultProps={label:"Redo"};constructor(e){super(e),this.state={canRedo:this.props.versionedProject.canRedo()}}componentDidMount(){this._startObservingProject()}componentWillUnmount(){this._stopObservingProject()}componentDidUpdate(e){e.versionedProject!==this.props.versionedProject&&(this._stopObservingProject(e.versionedProject),this._startObservingProject())}_startObservingProject(){this.props.versionedProject.addCurrentVersionChangedObserver(this,this._updateCanRedo),this._updateCanRedo()}_stopObservingProject(e=this.props.versionedProject){e.removeCurrentVersionChangedObserver(this,this._updateCanRedo)}handleClick(){this._canRedo()&&this.props.versionedProject.redo()}_updateCanRedo(){this.setState(((e,t)=>({canRedo:t.versionedProject.canRedo()})))}_canRedo(){return this.state.canRedo}_iconOrText(){return this.props.useIcon?s.createElement(o,{name:"redo"}):this.props.label}_renderIconLabel(){if(this.props.useIcon&&this.props.showIconLabel)return s.createElement("div",{className:"action-bar-label","data-testid":"redo-button-label"},this.props.label)}render(){const e=!this._canRedo(),t=n(this.props.className,"btn",{"btn--disabled":e}),r={};return!1!==this.props.label&&(r.title=this.props.label),s.createElement("button",{type:"button",disabled:e,className:t,onClick:()=>this.handleClick(),"aria-label":this.props.label||"Redo",...r},this._renderIconLabel(),this._iconOrText())}}e.exports=RedoControl},96158:(e,t,r)=>{const n=r(69722),i=r(23770),s=r(72922);class SelectionDeleteButton extends i.Component{static propTypes={drawingController:n.object.isRequired,withDivider:n.bool};static defaultProps={withDivider:!1};componentDidMount(){this._startObservingSelection()}componentWillUnmount(){this._stopObservingSelection()}componentDidUpdate(e){e.drawingController!==this.props.drawingController&&(this._stopObservingSelection(e.drawingController),this._startObservingSelection())}_startObservingSelection(){this.props.drawingController.addSelectionChangedObserver(this,this.forceUpdate)}_stopObservingSelection(e=this.props.drawingController){e.removeSelectionChangedObserver(this,this.forceUpdate)}_delete(){this.props.drawingController.deleteSelection()}render(){const{drawingController:e,withDivider:t}=this.props,r=e.selection(),n=!r.components().some((e=>e.isDeleteable()));return r.isEmpty()||n?null:i.createElement("div",{className:"property-panel__delete-section"},t&&i.createElement("hr",{className:"divider"}),i.createElement("button",{type:"button",onClick:()=>this._delete(),className:"btn-delete full-width"},i.createElement(s,{name:"delete",className:"margin-right-xs"})," Delete"))}}e.exports=SelectionDeleteButton},25262:(e,t,r)=>{const n=r(69722),i=r(23770),{Component:s}=r(23770);class TextInput extends s{constructor(e){super(e),this.state={text:this.props.value}}componentDidUpdate(e,t){this.props.value!==e.value&&this.setState(((e,t)=>({text:t.value})))}async _saveNewValue(e){const t=this.currentValue();if(this._valueOfRightType(t))try{!1===await this.props.onSave(this.currentValue(),e)&&this._revertToOldValue(e)}catch(t){this._revertToOldValue(e)}else this._revertToOldValue(e)}_valueOfRightType(e){return"number"!==this.props.type||""!==e}_revertToOldValue(e){this.setState(((e,t)=>({text:t.value}))),this.props.onCancel(e)}_handleSpecialKeyPresses(e){const t="Enter"===e.key,r="Escape"===e.key;t?(e.preventDefault(),this._saveNewValue(e)):r&&(e.preventDefault(),this._revertToOldValue(e))}_onValueChange(e){this.props.disabled||this._updateValue(e)}_updateValue(e){const t=e.target.value;this.setState((()=>({text:t}))),this.props.onChange(t,e)}currentValue(){return this.state.text}render(){const{onSave:e,onCancel:t,onChange:r,value:n,classes:s,...o}=this.props;return i.createElement("input",{className:s,onChange:this._onValueChange.bind(this),onBlur:this._saveNewValue.bind(this),onKeyUp:this._handleSpecialKeyPresses.bind(this),value:this.currentValue(),...o})}}TextInput.defaultProps={classes:"",autoFocus:!1,onChange:()=>{},onCancel:()=>{},type:"text"},TextInput.propTypes={value:n.string.isRequired,onSave:n.func.isRequired,onCancel:n.func,onChange:n.func,placeholder:n.string,classes:n.string,type:n.string,name:n.string,disabled:n.bool},e.exports=TextInput},75815:(e,t,r)=>{const n=r(69722),i=r(23770),{Component:s}=r(23770),o=r(75680);class ToolPanel extends s{constructor(e){super(e),this._toolPalette().addAvailableToolsChangedObserver(this,this._availableToolsChanged)}_availableToolsChanged(){this.setState({})}_availableTools(){return this._toolPalette().tools()}_renderTools(){return this._availableTools().map((e=>i.createElement(o,{tool:e,toolPalette:this._toolPalette(),key:e.displayName()})))}_toolPalette(){return this.props.toolPalette}render(){return i.createElement("div",{className:"toolbar-panel"},i.createElement("div",{className:"section"},this._renderTools()))}}ToolPanel.propTypes={drawingController:n.object.isRequired,toolPalette:n.object.isRequired},e.exports=ToolPanel},75680:(e,t,r)=>{const n=r(69722),i=r(23770),{Component:s}=r(23770),o=r(22939),a=r(72922);class ToolView extends s{static propTypes={tool:o("toolName",n.object),toolName:o("tool",n.string),toolPalette:n.object.isRequired};componentDidMount(){this._toolPalette().addActiveToolChangedObserver(this,this._onActiveToolChanged)}componentWillUnmount(){this._toolPalette().removeActiveToolChangedObserver(this,this._onActiveToolChanged)}_toolPalette(){return this.props.toolPalette}_onActiveToolChanged(){this.setState({})}_tool(){return this.props.tool||this._toolPalette().tool(this.props.toolName)}_isActive(){const e=this._toolPalette().activeTool();return e&&e.displayName()===this._tool().displayName()}_activateTool(){this._toolPalette().setActiveTool(this._tool())}_deactivateTool(){this._toolPalette().setActiveTool(this._toolPalette().defaultTool())}_toggleTool(){this._isActive()?this._deactivateTool():this._activateTool()}render(){const e=this._tool().constructor.name;return i.createElement("div",{className:"tool "+(this._isActive()?"active":""),onClick:this._activateTool.bind(this)},i.createElement("div",{className:"icon-box"},i.createElement(a,{name:e,className:"icon"})),i.createElement("p",{className:"display-name"},this._tool().displayName()))}}e.exports=ToolView},5400:(e,t,r)=>{const n=r(78035),i=r(69722),s=r(23770),o=r(72922);class UndoControl extends s.Component{static propTypes={versionedProject:i.object.isRequired,label:i.any,className:i.string,useIcon:i.bool,showIconLabel:i.bool};constructor(e){super(e),this.state={canUndo:this.props.versionedProject.canUndo()}}static defaultProps={label:"Undo"};componentDidMount(){this._startObservingProject()}componentWillUnmount(){this._stopObservingProject()}componentDidUpdate(e){e.versionedProject!==this.props.versionedProject&&(this._stopObservingProject(e.versionedProject),this._startObservingProject())}_startObservingProject(){this.props.versionedProject.addCurrentVersionChangedObserver(this,this._updateCanUndo),this._updateCanUndo()}_stopObservingProject(e=this.props.versionedProject){e.removeCurrentVersionChangedObserver(this,this._updateCanUndo)}handleClick(){this._canUndo()&&this.props.versionedProject.undo()}_updateCanUndo(){this.setState(((e,t)=>({canUndo:t.versionedProject.canUndo()})))}_canUndo(){return this.state.canUndo}_iconOrText(){return this.props.useIcon?s.createElement(o,{name:"undo"}):this.props.label}_renderIconLabel(){if(this.props.useIcon&&this.props.showIconLabel)return s.createElement("div",{className:"action-bar-label","data-testid":"undo-button-label"},this.props.label)}render(){const e=!this._canUndo(),t=n(this.props.className,"btn",{"btn--disabled":e}),r={};return!1!==this.props.label&&(r.title=this.props.label),s.createElement("button",{type:"button",disabled:e,className:t,onClick:()=>this.handleClick(),"aria-label":this.props.label||"Undo",...r},this._renderIconLabel(),this._iconOrText())}}e.exports=UndoControl},81085:(e,t,r)=>{const n=r(63768),i=r(78035),s=r(69722),o=r(23770),{Unit:a}=r(62048),l=r(25262);class UnitField extends o.Component{static propTypes={value:s.string,name:s.string.isRequired,defaultUnit:s.string.isRequired,label:s.string.isRequired,disabled:s.bool,onSave:s.func.isRequired,onUpdate:s.func,onValidate:s.func,parse:s.func,placeholder:s.string,wrapperClassName:s.string,labelClassName:s.string,inputClassName:s.string,errorClassName:s.string,inputProperties:s.object};static defaultProps={value:"",onValidate:()=>{},onUpdate:()=>{},parse:e=>e,labelClassName:"form-label",inputClassName:"form-control",inputProperties:{}};constructor(e){super(e),this.state={unitString:e.value}}_hasUnit(e){return/[^\d. ]/g.test(e)}_validatedMeasurementWithUnit(e){try{const t=a.parse(e);return t.equalBase(n.unit(1,this.props.defaultUnit))?{isValid:!0,unit:t}:{isValid:!1,error:"Invalid unit"}}catch(e){return{isValid:!1,error:"Invalid unit"}}}_validatedMeasurement(e){const t=e.trim();if(""===t)return{isValid:!1};const r=parseFloat(t);if(!isFinite(r))return{isValid:!1,error:"Type a measurement"};return-1!==t.search(/\.[a-z]|\.[A-Z]|\. |\. [a-z]|\. [A-Z]/)?{isValid:!1}:this._hasUnit(t)?this._validatedMeasurementWithUnit(t):{isValid:!0,unit:n.unit(r,this.props.defaultUnit)}}updateUnit(e){const t=this.props.parse(e),{unit:r,isValid:n,error:i}=this._validatedMeasurement(t);r&&(r.fixPrefix=!0);const s=this.props.onValidate(n,r);s?this.setState({unitString:t,error:s}):(n&&this.props.onUpdate(r),this.setState({unitString:t,error:i}))}saveUnit(e){const t=this.props.parse(e),{unit:r,isValid:n,error:i}=this._validatedMeasurement(t);r&&(r.fixPrefix=!0);const s=this.props.onValidate(n,r);s?this.setState({unitString:t,error:s}):(n&&this.props.onSave(r),this.setState({unitString:t,error:i}))}_renderUnitField(){const e=i(this.props.wrapperClassName,{field_with_errors:Boolean(this.state.error)});return o.createElement("div",{className:e},o.createElement("label",{className:this.props.labelClassName,htmlFor:this.props.name},this.props.label),o.createElement(l,{className:this.props.inputClassName,name:this.props.name,id:this.props.name,placeholder:this.props.placeholder,value:this.state.unitString,disabled:this.props.disabled,onSave:e=>this.saveUnit(e),onChange:e=>this.updateUnit(e),...this.props.inputProperties}),this.state.error?o.createElement("p",{className:`error ${this.props.errorClassName}`},this.state.error):"")}render(){return this._renderUnitField()}}e.exports=UnitField},86491:(e,t,r)=>{const n=r(78035),i=r(69722),s=r(23770),o=r(72922);class ZoomControl extends s.Component{static propTypes={zoomPalette:i.object.isRequired};constructor(e){super(e),this._startObserving()}componentWillUnmount(){this._stopObserving()}componentDidUpdate(e,t,r){e.zoomPalette!==this.props.zoomPalette&&(this._stopObserving(e.zoomPalette),this._startObserving())}_startObserving(){this._zoomPalette().addZoomLevelChangedObserver(this,this.forceUpdate)}_stopObserving(e=this._zoomPalette()){e.removeZoomLevelChangedObserver(this)}_zoomPalette(){return this.props.zoomPalette}_activeZoomLevel(){return this._zoomPalette().activeZoomLevel()}_setZoom(e){const t=this._zoomPalette().zoomLevels().indexOf(this._activeZoomLevel()),r=this._zoomPalette().zoomLevels()[t+e];this._zoomPalette().setActiveZoomLevel(r.name())}_renderZoomOut(){const e=this._zoomPalette().zoomLevels()[0]===this._activeZoomLevel(),t=n("action-bar__zoom-out-button","btn","btn--icon",{"btn--disabled":e});return s.createElement("button",{className:t,disabled:e,onClick:()=>this._setZoom(-1)},s.createElement(o,{name:"zoom_out"}))}_renderZoomIn(){const e=this._zoomPalette().zoomLevels(),t=e[e.length-1]===this._activeZoomLevel(),r=n("action-bar__zoom-in-button","btn","btn--icon",{"btn--disabled":t});return s.createElement("button",{className:r,disabled:t,onClick:()=>this._setZoom(1)},s.createElement(o,{name:"zoom_in"}))}render(){return s.createElement("div",{className:"zoom-control"},this._renderZoomOut(),s.createElement("div",{className:"tag-readonly"},s.createElement("span",{className:"tag__label"},this._activeZoomLevel().name())),this._renderZoomIn())}}e.exports=ZoomControl},6770:(e,t,r)=>{const n=r(69722),i=r(23770),{NavLink:s}=r(44886),o=r(42567),a=r(72922),l=r(15270),c=r(5400),u=r(86491),d=r(2101);class DrawingEditorActionBar extends i.Component{static propTypes={drawingEditor:n.object.isRequired,projectRepository:n.object.isRequired,basePath:n.string.isRequired,perspectives:n.arrayOf(n.string).isRequired,includePerspectiveIcons:n.bool,includeUndoRedo:n.bool,renderBackLink:n.func,renderMenuItems:n.func,renderExtraElements:n.func,renderSaveButton:n.func,pointerCaptureProps:n.object};static defaultProps={includePerspectiveIcons:!0,includeUndoRedo:!0,renderBackLink:()=>{},renderExtraElements:()=>{},renderSaveButton:e=>i.createElement(d,{projectRepository:e})};_renderUndoRedoControls(){return this.props.includeUndoRedo?i.createElement(i.Fragment,null,i.createElement(c,{versionedProject:this.props.drawingEditor.project()}),i.createElement(l,{versionedProject:this.props.drawingEditor.project()})):null}_renderIconOrText(e){return this.props.includePerspectiveIcons?i.createElement(a,{name:`${e}View`,className:"navbar__view-icon"}):e}_renderViewLinks(){return i.createElement(i.Fragment,null,this.props.perspectives.map((e=>{const t=e.replace(/^[^a-zA-Z]*[a-zA-Z]/,(e=>e.toUpperCase()));return i.createElement(s,{to:`${this.props.basePath}/${e}`,className:"btn btn--no-border",activeClassName:"btn--active",title:`${t} view`,key:`editor-view-link-${e}`},this._renderIconOrText(t))})))}_renderZoomControl(){const e=this.props.drawingEditor.zoomPalette();if(e)return i.createElement(u,{zoomPalette:e})}_renderDotMenu(){if(this.props.renderMenuItems)return i.createElement(o,null,this.props.renderMenuItems(this.props.drawingEditor))}render(){return i.createElement("header",{className:"navbar",...this.props.pointerCaptureProps},i.createElement("div",{className:"navbar__content navbar__content--justify-start"},this.props.renderBackLink(this.props.drawingEditor),this._renderUndoRedoControls()),i.createElement("div",{className:"navbar__content navbar__content--justify-center"},this._renderViewLinks(),this._renderZoomControl()),i.createElement("div",{className:"navbar__content navbar__content--justify-end"},this.props.renderSaveButton(this.props.projectRepository),this.props.renderExtraElements(this.props.drawingEditor),this._renderDotMenu()))}}e.exports=DrawingEditorActionBar,e.exports.DrawingEditorActionBar=DrawingEditorActionBar},65780:(e,t,r)=>{const n=r(69722),i=r(23770),{ChromeCADExtensionController:s}=r(7340),o=r(98160),a=r(6269),l=r(6770);class PerspectiveEditorView extends i.Component{static propTypes={actionBarOptions:n.object,drawingEditor:n.object.isRequired,projectRepository:n.object.isRequired,perspectives:n.arrayOf(n.string).isRequired,basePath:n.string.isRequired,renderAccessoryElement:n.func,leftSidePanel:n.bool,rightSidePanel:n.bool,renderActionBar:n.func,renderLeftSidePanel:n.func,leftSideComponentClass:n.func,renderRightSidePanel:n.func,rightSideComponentClass:n.func,activePerspective:n.string};static defaultProps={renderLeftSidePanel:()=>{},renderRightSidePanel:()=>{},renderActionBar:e=>i.createElement(l,{drawingEditor:e.drawingEditor,projectRepository:e.projectRepository,basePath:e.basePath,perspectives:e.perspectives,...e})};componentDidMount(){this.chromeCADController().onLoad(this._drawingController())}componentDidUpdate(e,t){e.drawingEditor!==this.props.drawingEditor&&(this.chromeCADController().onUnload(),this.chromeCADController().onLoad(this._drawingController()))}componentWillUnmount(){this.chromeCADController().onUnload()}chromeCADController(){return this._chromeCADController??=this._defaultChromeCADController()}_defaultChromeCADController(){const e=window.__LCAD_CHROME_CAD_EVENT_EMITTER;return new s(e)}_drawingController(){return this.props.drawingEditor.drawingController()}_renderLeftSidePanel(){if(this.props.leftSidePanel){if(this.props.renderLeftSidePanel)return i.createElement(o,{side:"left"},((e,t)=>this.props.renderLeftSidePanel(this.props.drawingEditor,e,t)));if(this.props.leftSideComponentClass){const e=this.props.leftSideComponentClass;return i.createElement(e,{drawingEditor:this.props.drawingEditor})}}}_renderRightSidePanel(){if(this.props.rightSidePanel){if(this.props.renderRightSidePanel)return i.createElement(o,{side:"right"},((e,t)=>this.props.renderRightSidePanel(this.props.drawingEditor,e,t)));if(this.props.rightSideComponentClass){const e=this.props.rightSideComponentClass;return i.createElement(e,{drawingEditor:this.props.drawingEditor})}}}_renderActionBar(){const{drawingEditor:e,projectRepository:t,basePath:r,perspectives:n,actionBarOptions:i}=this.props;return this.props.renderActionBar({drawingEditor:e,projectRepository:t,basePath:r,perspectives:n,...i})}_renderAccessoryElement(){if(this.props.renderAccessoryElement)return this.props.renderAccessoryElement(this.props.drawingEditor)}render(){return i.createElement(i.Fragment,null,this._renderActionBar(),i.createElement("div",{className:"drawing-editor"},this._renderAccessoryElement(),this._renderLeftSidePanel(),this._renderRightSidePanel(),i.createElement(a,{drawingEditor:this.props.drawingEditor,activePerspective:this.props.activePerspective})))}}e.exports=PerspectiveEditorView},2101:(e,t,r)=>{const n=r(78035),{observer:i}=r(88078),s=r(69722),o=r(23770),a=r(84789);class SaveButton extends o.Component{static propTypes={projectRepository:s.object.isRequired,className:s.string};constructor(e){super(e),this.state={controller:new a(this.props.projectRepository)}}componentWillUnmount(){this.controller().stopObservingSaveStatus()}static getDerivedStateFromProps(e,t){return t.controller.repository()!==e.projectRepository?(t.controller.stopObservingSaveStatus(),{controller:new a(e.projectRepository)}):null}controller(){return this.state.controller}updateOnServer(){this.controller().save()}render(){let e=["action-bar__save-button--unsaved","btn-primary"],t="Save";this.controller().saveStatus&&(e=["action-bar__save-button--saved","btn"],t="Saved");const r=n("action-bar__save-button",...e,this.props.className);return o.createElement("button",{onClick:this.updateOnServer.bind(this),className:r},t)}}e.exports=i(SaveButton)},21286:(e,t,r)=>{const n=r(23770),i=["select-one","select-multiple","range"];e.exports=e=>class PointerCapture extends n.Component{_capturePointer(e){i.includes(e.target.type)||e.target.setPointerCapture(e.pointerId)}_releasePointer(e){i.includes(e.target.type)||e.target.releasePointerCapture(e.pointerId)}_pointerCaptureProps(){return{pointerCaptureProps:{onPointerDown:this._capturePointer,onPointerUp:this._releasePointer}}}render(){return n.createElement(e,{...this.props,...this._pointerCaptureProps()})}}},1369:(e,t,r)=>{const n=r(69722),i=r(23770);class BooleanMapPropertyView extends i.Component{static propTypes={property:n.object.isRequired,eventRecorder:n.object.isRequired};static forType="booleanmap";constructor(e){super(e),this.state={property:e.property,booleanMap:e.property.get()}}_onMappingToggle(e,{target:{checked:t}}){const{property:r,booleanMap:n}=this.state,i={...n,[e]:t};r.set(i),this.setState({booleanMap:r.get()}),this.props.eventRecorder.recordChange()}_renderMapping(){const{booleanMap:e,property:t}=this.state,r=Object.keys(e).filter((e=>!e.startsWith("_"))).sort();return i.createElement("div",{className:"display-property__wrapper--booleanmap"},r.map((r=>i.createElement("div",{key:r},i.createElement("input",{id:`${t.key()}-${r}`,className:"form__checkbox",type:"checkbox",checked:e[r],disabled:t.disabled()||!t.editable(),onChange:this._onMappingToggle.bind(this,r)}),i.createElement("label",{className:"form-label",htmlFor:`${t.key()}-${r}`},r)))))}render(){return i.createElement(i.Fragment,null,i.createElement("span",{className:"form-label"},this.state.property.label(),":"),this._renderMapping())}}e.exports=BooleanMapPropertyView},7651:(e,t,r)=>{const n=r(78035),i=r(69722),s=r(23770);class BooleanPropertyView extends s.Component{static propTypes={property:i.object.isRequired,eventRecorder:i.object.isRequired};static forType="boolean";constructor(e){super(e),this.state={isSelected:e.property.get()}}_toggle(){this.props.property.toggle(),this.props.eventRecorder.recordChange(),this.setState({isSelected:this.props.property.get()})}_setIndeterminate(e){if(!e)return;const t=this.props.property.get();e.indeterminate=![!0,!1].includes(t)}_renderCheckbox(){const e=this.props.property,t=n("form__checkbox",{disabled:e.disabled?.()});return s.createElement("div",null,s.createElement("input",{id:e.key(),name:e.key(),className:t,type:"checkbox",disabled:e.disabled?.(),checked:!!this.state.isSelected,onChange:this._toggle.bind(this),ref:this._setIndeterminate.bind(this)}),s.createElement("label",{className:"form-label",htmlFor:e.key()},e.label()))}_renderPropertyValue(e){return s.createElement("div",null,s.createElement("span",{className:"form-label"},e.label(),":"),s.createElement("span",{className:"form-control form-control--read-only"},this.state.isSelected?"True":"False"))}render(){const e=this.props.property;return e.editable()?this._renderCheckbox(e):this._renderPropertyValue(e)}}e.exports=BooleanPropertyView},89672:(e,t,r)=>{const n=r(69722),i=r(23770);class ColorPropertyView extends i.Component{static propTypes={property:n.object.isRequired,eventRecorder:n.object.isRequired};static forType="color";constructor(e){super(e),this.state={color:this.props.property.get()}}_updateColor(e){const t=e.target.value;this.props.property.set(t),this.props.eventRecorder.recordChange(),this.setState({color:this.props.property.get()})}_datasetListId(){if(this.props.property.options().list)return`color-list-${this.props.property.key()}`}_renderDatalist(){if(this.props.property.options().list)return i.createElement("datalist",{id:this._datasetListId()},this.props.property.options().list().map((e=>i.createElement("option",{key:e,value:e,title:e}))))}render(){return i.createElement(i.Fragment,null,this._renderDatalist(),i.createElement("div",{className:"form-group--inline"},i.createElement("label",{className:"form-label",htmlFor:this.props.property.key()},this.props.property.label(),":"),i.createElement("input",{id:this.props.property.key(),type:"color",disabled:this.props.property.disabled?.(),className:"form__color",value:this.state.color,onChange:this._updateColor.bind(this),list:this._datasetListId()})))}}e.exports=ColorPropertyView},7930:(e,t,r)=>{const n=r(69722),i=r(23770),{CompositeEditableProperty:s}=r(7340),o=r(1839);class DisplayPropertiesView extends i.Component{static propTypes={components:n.array.isRequired,propertyEventRecorder:n.object.isRequired,drawingController:n.object,propertyViews:n.array};static defaultProps={propertyViews:[]};componentDidMount(){this._startObservingComponents()}componentWillUnmount(){this._stopObservingComponents()}componentDidUpdate(e){e.components!==this.props.components&&(this._stopObservingComponents(e.components),this._startObservingComponents())}_startObservingComponents(){this.props.components.forEach((e=>e.addDisplayPropertiesChangedObserver?.(this,this._availablePropertiesChanged)))}_stopObservingComponents(e=this.props.components){e.forEach((e=>e.removeDisplayPropertiesChangedObserver?.(this,this._availablePropertiesChanged)))}_availablePropertiesChanged(){this.forceUpdate()}render(){const{components:e,drawingController:t,propertyViews:r}=this.props;let n=e.first().displayProperties?.()??[];return 0===n.length?null:(e.length>1&&(n=s.overlappingProperties(e)),n.map((e=>i.createElement(o,{key:e.key(),property:e,drawingController:t,eventRecorder:this.props.propertyEventRecorder,propertyViews:r}))))}}e.exports=DisplayPropertiesView},96810:(e,t,r)=>{const n=r(69722),i=r(23770);class NumberPropertyView extends i.Component{static propTypes={property:n.object.isRequired,eventRecorder:n.object.isRequired};static forType="number";constructor(e){super(e),this.state={currentValue:e.property.get()}}_handleSpecialKeyPress(e){"Enter"===e.key&&(e.preventDefault(),this._saveProperty())}async _onInputChange(e){const t=parseFloat(e);isNaN(t)?await this.setState({currentValue:""}):await this.setState({currentValue:t});!this.props.property.options().ignoreIntermediateEdits&&this._setPropertyValue()}_setPropertyValue(){const{currentValue:e}=this.state;""===e?this.props.property.set(void 0):this.props.property.set(e),this.props.eventRecorder.recordIntermediateChange()}_saveProperty(){this._setPropertyValue(),this.props.eventRecorder.recordChange(),this.setState({currentValue:this.props.property.get()})}_renderNumberInput(){const e=this.props.property;return i.createElement("div",null,i.createElement("label",{className:"form-label",htmlFor:e.key()},e.label(),":"),i.createElement("input",{className:"form-control",id:e.key(),type:"number",disabled:e.disabled?.(),value:this.state.currentValue,onChange:e=>this._onInputChange(e.target.value),onBlur:e=>this._saveProperty(),onKeyUp:e=>this._handleSpecialKeyPress(e)}))}_renderPropertyValue(){return i.createElement("div",null,i.createElement("span",{className:"form-label"},this.props.property.label(),":"),i.createElement("span",{className:"form-control form-control--read-only"},this.props.property.get()))}render(){const e=this.props.property;return e.editable()?this._renderNumberInput(e):this._renderPropertyValue(e)}}e.exports=NumberPropertyView},1839:(e,t,r)=>{const n=r(69722),i=r(23770),s=[r(1369),r(7651),r(89672),r(96810),r(4316),r(90524),r(31447),r(1041),r(85848),r(63903),r(20909)];class PropertyView extends i.Component{static propTypes={property:n.object.isRequired,eventRecorder:n.object.isRequired,drawingController:n.object,propertyViews:n.array};static defaultProps={propertyViews:[]};constructor(e){super(e),this.state={fieldKey:0}}componentDidUpdate(e){this.props.property!==e.property&&(this._stopObserving(e.property),this._startObserving(this.props.property),this._reset())}componentDidMount(){this._startObserving()}_startObserving(){this.props.property.addExternalChangeObserver(this,this._reset)}componentWillUnmount(){this._stopObserving()}_stopObserving(e=this.props.property){e.removeExternalChangeObserver(this,this._reset)}_reset(){this.setState((e=>({fieldKey:e.fieldKey+1})))}propertyViews(){return this._propertyViews||(this._propertyViews=this.defaultPropertyViews()),this._propertyViews}defaultPropertyViews(){const e=this.props.propertyViews.slice();return s.forEach((t=>{e.some((e=>e.forType===t.forType))||e.push(t)})),e}render(){const e=this.props.property,t=e.editable()?"editable":"readonly",r=this.propertyViews().find((t=>t.forType===e.type()));return i.createElement("div",{className:`display-property display-property--${t} display-property--${e.type()}`},i.createElement(r,{key:`property-view-${this.state.fieldKey}`,property:e,drawingController:this.props.drawingController,eventRecorder:this.props.eventRecorder}))}}e.exports=PropertyView},4316:(e,t,r)=>{const n=r(69722),i=r(23770);class RadioPropertyView extends i.Component{static propTypes={property:n.object.isRequired,eventRecorder:n.object.isRequired};static forType="radio";constructor(e){super(e),this.state={property:e.property,selectedValue:e.property.get()}}selectedChoiceLabel(){const{property:e,selectedValue:t}=this.state,r=e.options().choices.find((e=>e.value===t||e.value?.equals?.(t)));return r?.label??""}_updateProperty(e){this.state.property.set(e),this.props.eventRecorder.recordChange(),this.setState({selectedValue:this.state.property.get()})}_renderRadioButtons(){const e=this.state.property;return i.createElement("div",{className:"form-control-inline-group"},e.options().choices.map((({label:t,value:r,disabled:n})=>i.createElement("div",{key:t,className:"form-group"},i.createElement("input",{id:`${e.key()}-${t}`,name:e.name(),type:"radio",checked:this.state.selectedValue===r,onChange:this._updateProperty.bind(this,r),disabled:e.disabled()||!e.editable()||n,value:t,className:"form-control"}),i.createElement("label",{className:"form-label",htmlFor:`${e.key()}-${t}`},t)))))}render(){return i.createElement(i.Fragment,null,i.createElement("span",{className:"form-label"},this.state.property.label(),":"),this._renderRadioButtons())}}e.exports=RadioPropertyView},70892:(e,t,r)=>{const n=r(78035),i=r(69722),s=r(23770);class RadioSelect extends s.Component{static propTypes={getProperty:i.func.isRequired,setProperty:i.func.isRequired,options:i.array.isRequired,label:i.string,wrapperClassName:i.string,labelClassName:i.string,disabled:i.bool};constructor(e){super(e),this.state={selectedValue:e.getProperty()}}_setProperty(e){this.props.setProperty(e),this.setState({selectedValue:this.props.getProperty()})}_renderLabel(){const e=this.props.label;return e?s.createElement("legend",{className:this.props.labelClassName},e,":"):""}_renderOption(e,t){const r=n("form-label",{"form-label--selected":t});return s.createElement("div",{key:e.label},s.createElement("input",{id:`radio-${e.label}-${e.value}`,type:"radio",value:e.label,className:"hidden",selected:t,onClick:()=>this._setProperty(e.value),disabled:e.disabled}),s.createElement("label",{className:r,title:e.label,htmlFor:`radio-${e.label}-${e.value}`},e.label))}render(){const{selectedValue:e}=this.state,{options:t}=this.props,r=t.find((t=>e===t.value));return s.createElement("fieldset",{className:`radio-select ${this.props.wrapperClassName}`,disabled:this.props.disabled},this._renderLabel(),s.createElement("div",{className:"radio-select__options"},t.map((e=>{const t=r===e;return this._renderOption(e,t)}))))}}e.exports=RadioSelect},90524:(e,t,r)=>{const n=r(69722),i=r(23770),s=r(70892);class RadioSelectPropertyView extends i.Component{static propTypes={property:n.object.isRequired,eventRecorder:n.object.isRequired};static forType="radioselect";_updateProperty(e){this.props.property.set(e),this.props.eventRecorder.recordChange()}render(){const e=this.props.property;return i.createElement(s,{getProperty:()=>e.get(),setProperty:this._updateProperty.bind(this),label:e.label(),options:e.options().choices,labelClassName:"display-property__label",disabled:e.disabled?.()})}}e.exports=RadioSelectPropertyView},31447:(e,t,r)=>{const n=r(69722),i=r(23770);class SelectPropertyView extends i.Component{static propTypes={property:n.object.isRequired,eventRecorder:n.object.isRequired};static forType="select";constructor(e){super(e),this.state={property:e.property,selectedValue:e.property.get()}}selectedChoiceLabel(){const{property:e,selectedValue:t}=this.state;return e.options().choices.find((e=>this._valuesAreEqual(e.value,t))).label}_valuesAreEqual(e,t){return e===t||e?.equals?.(t)}_updateProperty(e){const t=this.state.property,r=e.target.value,n=this.state.property.options().choices.find((e=>e.label===r)).value;t.set(n),this.props.eventRecorder.recordChange(),this.setState({selectedValue:this.state.property.get()})}_getStandInValue(e){const t=e.options().choices,{selectedValue:r}=this.state;if(e.multipleValuesSelected())return"(multiple selected)";return t.some((e=>this._valuesAreEqual(e.value,r)))?void 0:"(option unavailable)"}_renderSelectBox(e){const t=e.options().choices,r=this._getStandInValue(e);return i.createElement("div",null,i.createElement("label",{className:"form-label",htmlFor:e.key()},e.label(),":"),i.createElement("select",{id:e.key(),className:"form-control",onChange:e=>this._updateProperty(e),value:r??this.selectedChoiceLabel(),disabled:e.disabled?.()},r&&i.createElement("option",{disabled:!0},r),t.map((e=>i.createElement("option",{key:e.label,value:e.label,disabled:e.disabled},e.label)))))}_renderSelectedOption(e){return i.createElement("div",null,i.createElement("span",{className:"form-label"},e.label(),":"),i.createElement("span",{className:"form-control form-control--read-only"},this.selectedChoiceLabel()))}render(){const e=this.state.property;return e.editable()?this._renderSelectBox(e):this._renderSelectedOption(e)}}e.exports=SelectPropertyView},1041:(e,t,r)=>{const n=r(69722),i=r(23770),s=e=>`string-key-${e.get().toString().split(" ").join("-").toString()}`;class TextAreaPropertyView extends i.Component{static propTypes={property:n.object.isRequired,eventRecorder:n.object.isRequired};constructor(e){super(e),this.state={key:s(e.property),text:e.property.get().join("\r\n").toString()}}static forType="textarea";_updateProperty(e){const t=e.target.value;this.props.property.set(t),this.props.eventRecorder.recordIntermediateChange(),this.setState({text:this.props.property.get().join("\r\n").toString()})}_saveProperty(e){this._updateProperty(e),this.props.eventRecorder.recordChange(),this.setState({key:s(this.props.property)})}render(){const e=this.props.property;return i.createElement("div",null,i.createElement("label",{className:"form-label",htmlFor:e.key()},e.label(),":"),i.createElement("textarea",{id:e.key(),key:this.state.key,name:e.key(),value:this.state.text,onChange:this._updateProperty.bind(this),onBlur:this._saveProperty.bind(this),className:"form__textarea",disabled:e.disabled()}))}}e.exports=TextAreaPropertyView},85848:(e,t,r)=>{const n=r(69722),i=r(23770),s=r(25262),o=e=>`string-key-${e.get().split(" ").join("-").toString()}`;class TextPropertyView extends i.Component{static propTypes={property:n.object.isRequired,eventRecorder:n.object.isRequired};static forType="text";constructor(e){super(e),this.state={key:o(e.property)}}_updateProperty(e){this.props.property.set(e),this.props.eventRecorder.recordIntermediateChange()}_saveProperty(e){this._updateProperty(e),this.props.eventRecorder.recordChange(),this.setState({key:o(this.props.property)})}_renderTextInput(e){return i.createElement("div",null,i.createElement("label",{className:"form-label",htmlFor:e.key()},e.label(),":"),i.createElement(s,{id:e.key(),key:this.state.key,name:e.key(),value:e.get(),placeholder:e.options().placeholder,onChange:this._updateProperty.bind(this),onSave:this._saveProperty.bind(this),classes:"form-control",disabled:e.disabled()}))}_renderPropertyValue(e){return i.createElement("div",null,i.createElement("span",{className:"form-label"},e.label(),":"),i.createElement("span",{className:"form-control form-control--read-only"},e.get()))}render(){const e=this.props.property;return e.editable()?this._renderTextInput(e):this._renderPropertyValue(e)}}e.exports=TextPropertyView},66787:(e,t,r)=>{const n=r(78035),i=r(69722),s=r(23770),o=r(72922);class TraySelect extends s.Component{static propTypes={getProperty:i.func.isRequired,setProperty:i.func.isRequired,options:i.array.isRequired,label:i.string,wrapperClassName:i.string,labelClassName:i.string,disabled:i.bool};constructor(e){super(e),this.state={selectedValue:e.getProperty()}}_setProperty(e){this.props.setProperty(e),this.setState({selectedValue:this.props.getProperty()})}isSelected(e){const t=this.state.selectedValue;return""!==t&&(e.value===t||e.value?.equals?.(t))}_renderOption(e,t){const r=n("form-label",{selected:t}),i=this.props.label,a=e.label,l=`${i}-${a}`.split(" ").join("-").toLowerCase();return s.createElement("div",{key:a,className:"form-group"},s.createElement("input",{id:l,type:"radio",value:a,className:"form-control hidden",selected:t,onClick:()=>this._setProperty(e.value),disabled:e.disabled}),s.createElement("label",{className:r,htmlFor:l,title:a},s.createElement(o,{name:e.icon})))}_renderlabel(){const e=this.props.label;return e?s.createElement("span",{className:this.props.labelClassName},e,":"):""}render(){const e=this.props.options.find((e=>this.isSelected(e)));return s.createElement(s.Fragment,null,this._renderlabel(),s.createElement("fieldset",{className:`tray-select ${this.props.wrapperClassName}`,disabled:this.props.disabled},s.createElement("legend",{className:"tray-select__legend"},"Selected: ",s.createElement("b",null,e?.label)),s.createElement("div",{className:"flex flex-wrap"},this.props.options.map((e=>this._renderOption(e,this.isSelected(e)))))))}}e.exports=TraySelect},63903:(e,t,r)=>{const n=r(69722),i=r(23770),s=r(66787);class TraySelectPropertyView extends i.Component{static propTypes={property:n.object.isRequired,eventRecorder:n.object.isRequired};static forType="trayselect";_updateProperty(e){this.props.property.set(e),this.props.eventRecorder.recordChange()}render(){const e=this.props.property;return i.createElement(s,{getProperty:()=>e.get(),setProperty:this._updateProperty.bind(this),label:e.label(),options:e.options().choices,labelClassName:"form-label",disabled:e.disabled?.()})}}e.exports=TraySelectPropertyView},20909:(e,t,r)=>{const n=r(69722),i=r(23770),s=r(81085);class UnitPropertyView extends i.Component{static propTypes={property:n.object.isRequired,eventRecorder:n.object.isRequired};static forType="unit";constructor(e){super(e),this.state={fieldKey:0}}_updateProperty(e){this.props.property.set(e),this.props.eventRecorder.recordIntermediateChange()}_saveProperty(e){this._updateProperty(e),this.props.eventRecorder.recordChange(),this.setState((e=>({fieldKey:e.fieldKey+1})))}_parseInput(e){return this.props.property.parse(e)}_renderUnitField(){const e=this.props.property,t=!this.props.property.options().ignoreIntermediateEdits;return i.createElement(s,{key:`unit-field-${this.state.fieldKey}`,name:e.key(),label:`${e.label()}:`,value:e.format(),...t?{onUpdate:this._updateProperty.bind(this)}:{},onSave:this._saveProperty.bind(this),onValidate:(t,r)=>e.validate(t,r),parse:this._parseInput.bind(this),defaultUnit:e.options().defaultUnit,disabled:e.disabled(),wrapperClassName:"display-property__wrapper--unit",labelClassName:"form-label",inputClassName:"form-control",errorClassName:"form-error",inputProperties:e.options().inputHTML??{}})}_renderPropertyValue(){const e=this.props.property;let t=e.get();return e.options().defaultUnit&&(t=t.to(e.options().defaultUnit)),i.createElement("div",null,i.createElement("span",{className:"form-label"},e.label(),":"),i.createElement("span",{className:"form-control form-control--read-only"},t.toString()))}render(){return this.props.property.editable()?this._renderUnitField():this._renderPropertyValue()}}e.exports=UnitPropertyView},89677:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(63768));var p=class MaterialLineItem{constructor(e,t){this._quantity=e,this._specifier=t}quantity(){return this._quantity}specifier(){return this._specifier}add(e){this._quantity=h.add(this.quantity(),e)}}},94776:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));r(50988);var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(63768));var p=class MaterialList{constructor(e=[]){e.forEach((e=>{this.add(e)}))}add(e){const t=this.lineItemForSpecifier(e.specifier());t?t.add(e.quantity()):this.materialLineItemsMap().set(e.specifier().identifier(),e)}materialLineItemsMap(){return this._materialLineItemsMap||(this._materialLineItemsMap=new Map),this._materialLineItemsMap}hasQuantityOfMaterial(e,t){return this.hasLineItemForSpecifier(t)&&h.equal(this.lineItemForSpecifier(t).quantity(),e)}hasLineItemForSpecifier(e){return this.materialLineItemsMap().has(e.identifier())}lineItemForSpecifier(e){return this.materialLineItemsMap().get(e.identifier())}lineItems(){return[...this.materialLineItemsMap().values()]}consolidate(e){e.lineItems().forEach((e=>{this.add(e)}))}}},44751:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>b}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(63768)),m=r(93613),f=d(r(89677)),g=d(r(94776));const y=p.unit(8,"ft");m.MaterialSpecifier.prototype.hasOtherHardware=function(){return Boolean(this.hardware)},m.MaterialSpecifier.prototype.materialList=function(e){const t=new g.default([new f.default(e,this)]);return this.hasOtherHardware()&&this.hardware.forEach((e=>{t.consolidate(e.specifier.materialList(e.quantity))})),t},m.MaterialSpecifier.prototype.requiredHardware=function(e){let t=[{specifier:this,quantity:e}];return this.hardware&&this.hardware.forEach((r=>{t=t.concat(r.specifier.requiredHardware(Math.ceil(r.quantity*e)))})),t},m.MaterialSpecifier.prototype.isRailPicket=function(){return-1!==this.identifier().indexOf("PT2x2")},m.MaterialSpecifier.prototype.toPounds=function(e){if(void 0===this.quantityPerPound)throw new Error(`Don't know how to convert ${this.identifier()} to pounds`);return Math.ceil(e/this.quantityPerPound)},m.MaterialSpecifier.prototype._cutShortLumber=function(e){let t=[],r=[];for(const t in e)for(let n=0;n<e[t];n++)r=r.concat(p.unit(t,"ft"));const n=this.details().cutLengths.filter((e=>p.smaller(e,p.unit(18,"ft")))).last(),i={};let s=p.unit(0,"ft");r.forEach(((e,o)=>{s=p.add(s,e);const a=p.min(...this.details().cutLengths.filter((e=>p.largerEq(e,s))));if(o===r.length-1){if(!a)throw new Error("No viable cut lengths found");t=t.concat({specifier:m.lumber[this._cutIdentifierWithLength(a)],quantity:1})}else if(p.larger(p.add(s,r[o+1]),n)){const e=this._cutIdentifierWithLength(a);i[e]?i[e].quantity+=1:i[e]={specifier:m.lumber[e],quantity:1},s=p.unit(0,"ft")}}));for(const e in i)t.push(i[e]);return t},m.MaterialSpecifier.prototype._processRegularLumber=function(e,t){const r=p.min(...this.details().cutLengths.filter((t=>p.largerEq(t,e))));return{specifier:m.lumber[this._cutIdentifierWithLength(r)],quantity:t}},m.MaterialSpecifier.prototype._processLongLumber=function(e,t){const r=this.details().cutLengths.last(),n={};let i=0;for(let s=0;s<t;s++){let t=e;for(;p.largerEq(this._nextHigherLength(t),r);)t=p.subtract(t,r),i++;const s=this._nextHigherLength(t).toNumeric("ft");n[s]=n[s]?n[s]+1:1}return[{specifier:m.lumber[this._cutIdentifierWithLength(r)],quantity:i}].concat(this._cutShortLumber(n))},m.MaterialSpecifier.prototype._cutLargeAndRegularLumber=function(e,t){const r=this.details().cutLengths.last();return p.larger(e,r)?this._processLongLumber(e,t):this._processRegularLumber(e,t)},m.MaterialSpecifier.prototype._nextHigherLength=function(e){return p.chain(e.toNumeric("ft")).ceil().unit("ft").done()},m.MaterialSpecifier.prototype._cutIdentifierWithLength=function(e){const t=p.largerEq(e,y)?e.toNumeric("ft").rounded():e.toNumeric("in").rounded();return`${this.identifier()}x${t}`},m.MaterialSpecifier.prototype._chooseBalusters=function(e){if(0===e.length)return{};return{specifier:e[0].length().equals(p.unit(42,"in"))?m.lumber.PT2x2x42:m.lumber.PT2x2x36,quantity:e.length}},m.MaterialSpecifier.prototype.lumberYardSpecifiers=function(e){let t=[];if(0===e.length)return t;const r=p.unit(6,"ft"),n={},i={};if(e[0].materialSpecifier().isRailPicket())return t.concat(this._chooseBalusters(e));if(e.forEach((e=>{const t=this._nextHigherLength(e.length()),s=t.toNumeric("ft");p.larger(t,r)?i[s]=i[s]?i[s]+1:1:n[s]=n[s]?n[s]+1:1})),Object.keys(i).length>0)for(const e in i)t=t.concat(this._cutLargeAndRegularLumber(p.unit(e,"ft"),i[e]));return Object.keys(n).length>0&&(t=t.concat(this._cutShortLumber(n))),t};var b=m.MaterialSpecifier},27871:(e,t,r)=>{const n=r(56148),i=r(57711),s=r(71058);e.exports.MaterialLineItem=n,e.exports.MaterialList=i,e.exports.MaterialSpecifier=s},71251:(e,t,r)=>{var n=Object.create,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,c=(e,t,r)=>(r=null!=e?n(a(e)):{},((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let a of o(t))l.call(e,a)||a===r||i(e,a,{get:()=>t[a],enumerable:!(n=s(t,a))||n.enumerable});return e})(!t&&e&&e.__esModule?r:i(r,"default",{value:e,enumerable:!0}),e)),u=r(57075),d=c(r(31067)),h=c(r(9278)),p=c(r(81772));u.SmartObjectBuilder.configure((e=>{e.classes.addClasses(d.default,h.default,p.default)}))},31067:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>b}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(63768)),m=r(62048),f=d(r(67889)),g=d(r(9278)),y=d(r(21915));class Board extends g.default{constructor(e,t,r,n,i=(0,m.$P)(0,0,1)){super(e,r,n),this._endLocator=t,this._planeNormal=i}planeNormal(){return this._planeNormal}endLocator(){return this._endLocator}defaultMaterialSpecifier(){return y.default.PT2x6}edge(){return this.locator().to(this.endLocator())}width(){return this.materialSpecifier().details().depth}primaryDirection(){return this.edge().direction()}defaultOffsetFromCenter(){const e=this.depth().toNumeric(this.unit());return(0,m.$P)(0,e/2)}defaultGeometry(){const e=this.locator().to(this.endLocator()),t=new m.ProportionalEdgeLocator(e,0),r=new m.ProportionalEdgeLocator(e,1),n=this.width().toNumeric(this.unit()),i=this.depth().toNumeric(this.unit()),s=this.planeNormal(),o=this.offset(),a=o.x()-n/2,l=o.x()+n/2,c=o.y()-i/2;return new m.Polygon([new m.PlanarNormalToEdgeLocator(t,s,a,0,c),new m.PlanarNormalToEdgeLocator(t,s,l,0,c),new m.PlanarNormalToEdgeLocator(r,s,l,0,c),new m.PlanarNormalToEdgeLocator(r,s,a,0,c)])}moveBy(e,t,r){const n=this.locator().moveBy(e,t,r),i=this.endLocator().moveBy(e,t,r);return n||i}length(){return p.unit(this.locator().distanceTo3D(this.endLocator()),this.unit())}setShape(e){const t=this.locator().to(this.endLocator()),r=this.planeNormal();this._geometry=new m.Polygon(e.vertices().map((e=>{const n=e.distanceTo(t.begin())<e.distanceTo(t.end())?new m.ProportionalEdgeLocator(t,0):new m.ProportionalEdgeLocator(t,1),i=e.subtract(n).dot(t.normal().negated()),s=e.subtract(n).dot(t.direction());return new m.PlanarNormalToEdgeLocator(n,r,i,s)})))}shape3D(){return this._shape3D||(this._shape3D=new m.ExtrudedPolygon(this.shape(),this.thickness(),this._extrudeVertices.bind(this),!1)),this._shape3D}_extrudeVertices(e,t){const r=this.planeNormal().normalized().multipliedBy(t);return e.map((e=>new m.RelativeLocator(e,r.x(),r.y(),r.z())))}mitreFirstBoard(e){const t=new m.ProportionalEdgeLocator(e,0),r=new m.ProportionalEdgeLocator(e,1);this.setVertex(2,new m.NormalToEdgeLocator(t,0,0)),this.setVertex(3,new m.NormalToEdgeLocator(r,0,0))}mitreSecondBoard(e){const t=new m.ProportionalEdgeLocator(e,0),r=new m.ProportionalEdgeLocator(e,1);this.setVertex(1,new m.NormalToEdgeLocator(t,0,0)),this.setVertex(0,new m.NormalToEdgeLocator(r,0,0))}cutTo(e){const t=this._findIntersection(e,this.geometry());return t&&this.setShape(t),Boolean(t)}_findIntersection(e,t){const r=this.edge().direction(),n=this.planeNormal().normalized(),i=r.cross(n).normalized(),s=this._projectedPolygon(e,r,i,n),o=this._projectedPolygon(t,r,i,n),a=s.intersection(o).first();if(a)return new m.Polygon(a.vertices().map((e=>r.multipliedBy(e.x()).add(i.multipliedBy(e.y())).add(n.multipliedBy(e.z())))))}_projectedPolygon(e,t,r,n){return new m.Polygon(e.vertices().map((e=>(0,m.$P)(e.dot(t),e.dot(r),e.dot(n)))))}defaultFigure(){return new f.default(this)}}var b=Board},74675:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>y}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=r(7340),m=r(50988),f=d(r(23305)),g=d(r(73926));class ConstructionComponent extends p.GeometricComponent{locatedMaterials(){return[this]}allLocatedMaterials(){return this.locatedMaterials()}defaultFigure(){return new f.default(this)}defaultFigureXZ(){return new p.Drawable}defaultFigureYZ(){return new p.Drawable}project(){return this.componentOf()?.project?.()}}(0,m.extend)(ConstructionComponent,g.default);var y=ConstructionComponent},76967:(e,t,r)=>{var n,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(l,{default:()=>d}),e.exports=(n=l,((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(n=s(t,l))||n.enumerable});return e})(i({},"__esModule",{value:!0}),n));var c=r(62048),u=r(50988);class GeometricComponent extends c.Component{boundingCube(){return this.boundingBox().extrudedFromTo(-this.height(),this.baseZ())}baseZ(){return 0}height(){return 12}center(){return this.boundingBox().center()}geometry(){throw new u.MissingOverride(this,"geometry")}boundingBox(){return this.geometry().boundingBox()}xLevel(){return 1e3}yLevel(){return 1e3}zLevel(){return 1e3}containsPoint(e){return this.contains(e.x(),e.y())}contains(e,t){return this.geometry().contains(e,t)}moveBy(e,t,r){return this.geometry().moveBy(e,t,r)}annotations(){return this._annotations||(this._annotations=this.defaultAnnotations()),this._annotations}defaultAnnotations(){return[]}annotationsXZ(){return this._annotationsXZ||(this._annotationsXZ=this.defaultAnnotationsXZ()),this._annotationsXZ}defaultAnnotationsXZ(){return[]}annotationsYZ(){return this._annotationsYZ||(this._annotationsYZ=this.defaultAnnotationsYZ()),this._annotationsYZ}defaultAnnotationsYZ(){return[]}nonEssentialProperties(){return["_annotations","_annotationsXZ","_annotationsYZ"]}}var d=GeometricComponent},9278:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>y}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(63768)),m=r(62048),f=r(50988),g=d(r(74675));class Material extends g.default{constructor(e,t,r){super(),this._locator=e||(0,m.$P)(0,0,0),this._materialSpecifier=t,this._offset=r??this.defaultOffsetFromCenter()}locator(){return this._locator}offset(){return this._offset}setLocator(e){this._locator=e}center(){const e=this.boundingBox().center(),t=(0,m.$R)(e.x(),e.y(),this.locator().z());return t.setSource(this.locator()),t}defaultOffsetFromCenter(){return 0}defaultMaterialSpecifier(){throw new f.MissingOverride(this,"defaultMaterialSpecifier")}thickness(){return this.depth().toNumeric(this.unit())}depth(){return this.materialSpecifier().details().width}materialSpecifier(){return this._materialSpecifier||(this._materialSpecifier=this.defaultMaterialSpecifier()),this._materialSpecifier}vertices(){return this.geometry().vertices()}geometry(){return this._geometry||(this._geometry=this.defaultGeometry()),this._geometry}defaultGeometry(){const e=this.locator(),t=this.materialSpecifier(),r=t.details().width.toNumeric(this.unit());return new m.Polygon([new m.RelativeLocator(e,this.offset()-r/2,0),new m.RelativeLocator(e,this.offset()+r/2,0),new m.RelativeLocator(e,this.offset()+r/2,t.details().depth),new m.RelativeLocator(e,this.offset()-r/2,t.details().depth)])}setVertex(e,t){this.vertices()[e]=t}minimumStandardLength(){const e=this.length().toNumeric("ft");let t=Math.ceil(e);return t%2==1&&(t+=1),p.unit(t,"ft")}topSurface(){return new m.Polygon(this.vertices())}bottomSurface(){const e=this.vertices().map((e=>new m.RelativeZLocator(e,this.thickness())));return new m.Polygon(e)}}(0,f.extend)(Material,m.ShapeFromVertices);var y=Material},81772:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>a}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));var a=class MaterialSpecifier{constructor(e,t,{description:r,...n}={}){this._identifier=e,this._name=t,this._description=r,this._details=n}identifier(){return this._identifier}name(){return this._name}description(){return this._description}details(){return this._details}equals(e){return this.identifier()===e.identifier()}}},21915:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>w}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));r(37230);var p=d(r(63768)),m=d(r(81772));const f=[8,10,12,14,16,18,20].map((e=>p.unit(e,"ft"))),g=[8,10,12,14,16].map((e=>p.unit(e,"ft"))),y=[8,10,12].map((e=>p.unit(e,"ft"))),b=[3,3.5].map((e=>p.unit(e,"ft"))),v=[new m.default("PT54x6","5/4 x 6",{width:p.unit(1,"in"),depth:p.unit(5.5,"in"),cutLengths:g}),new m.default("PT2x4","2 x 4",{width:p.unit(1.5,"in"),depth:p.unit(3.5,"in"),cutLengths:g}),new m.default("PT2x6","2 x 6",{width:p.unit(1.5,"in"),depth:p.unit(5.5,"in"),cutLengths:g}),new m.default("PT2x8","2 x 8",{width:p.unit(1.5,"in"),depth:p.unit(7.25,"in"),cutLengths:g,maximumCommonLumberLength:p.unit(16,"ft")}),new m.default("PT2x10","2 x 10",{width:p.unit(1.5,"in"),depth:p.unit(9.25,"in"),cutLengths:f,maximumCommonLumberLength:p.unit(16,"ft")}),new m.default("PT2x12","2 x 12",{width:p.unit(1.5,"in"),depth:p.unit(11.25,"in"),cutLengths:g,maximumCommonLumberLength:p.unit(16,"ft")}),new m.default("PT4x4","4 x 4",{width:p.unit(3.5,"in"),depth:p.unit(3.5,"in"),cutLengths:y}),new m.default("PT6x6","6 x 6",{width:p.unit(5.5,"in"),depth:p.unit(5.5,"in"),cutLengths:y}),new m.default("PT8x8","8 x 8",{width:p.unit(7.25,"in"),depth:p.unit(7.25,"in"),cutLengths:y}),new m.default("PT2x2","2 x 2",{width:p.unit(1.5,"in"),depth:p.unit(1.5,"in"),cutLengths:b})],_={},x=p.unit(8,"ft");v.forEach((e=>{_[e.identifier()]=e,e.details().cutLengths.forEach((t=>{const r=new m.default(((e,t)=>{let r;return r=p.largerEq(t,x)?t.toNumeric("ft").rounded():t.toNumeric("in").rounded(),`${e}x${r}`})(e.identifier(),t),(n=e.name(),i=t,p.largerEq(i,x)?`${n} x ${i.toNumeric("ft").rounded()}'`:`${n} x ${i.toNumeric("in").rounded()}"`),{length:t,width:e.details().width,depth:e.details().depth});var n,i;_[r.identifier()]=r}))}));var w=_},86910:(e,t,r)=>{var n,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(l,{default:()=>u}),e.exports=(n=l,((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(n=s(t,l))||n.enumerable});return e})(i({},"__esModule",{value:!0}),n));var c=r(50988);class FrameObservable{frameChanged(){this.notifyFrameChangedObservers(),this.frameResized()}frameResized(){this.notifyFrameResizedObservers()}}(0,c.simpleObserver)(FrameObservable,"frameChanged"),(0,c.simpleObserver)(FrameObservable,"frameResized");var u=FrameObservable},73926:(e,t,r)=>{var n,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(l,{default:()=>u}),e.exports=(n=l,((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(n=s(t,l))||n.enumerable});return e})(i({},"__esModule",{value:!0}),n));var c=r(50988);var u=class UnitFromParent{unit(){return this.componentOf()?this.componentOf().unit():this.defaultUnit()}defaultUnit(){return"in"}lengthFormatter(){return this.componentOf()?this.componentOf().lengthFormatter():this.defaultLengthFormatter()}defaultLengthFormatter(){throw new c.MissingOverride(this,"defaultLengthFormatter")}}},67889:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(23305));class BoardFigure extends h.default{_draw(e,t){e._drawPolygon(this.model().geometry())}defaultProperties(){return{...super.defaultProperties(),strokeStyle:"black",lineWidth:"0.1",fillStyle:"#7d2828"}}}var p=BoardFigure},23305:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>f}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(7340),p=r(50988),m=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(17467));class ConstructionComponentFigure extends h.Drawable{constructor(e){super(),this._model=e}snapPoint(){return this.model().center()}boundingBox(){return this.model().boundingBox()}selfHandle(){return new m.default(this.model())}}(0,p.extend)(ConstructionComponentFigure,h.LevelsFromModel);var f=ConstructionComponentFigure},21702:(e,t,r)=>{var n,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(l,{default:()=>u}),e.exports=(n=l,((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(n=s(t,l))||n.enumerable});return e})(i({},"__esModule",{value:!0}),n));var c=r(7340);class FrontDrawing extends c.Drawing{constructor(e){super(),this._model=e}setModel(e){super.setModel(e),delete this._figures}updateFigures(){}defaultFigures(){return this.model()?this.model().components().slice().map(this._componentRenderer):[]}_componentRenderer(e){return e.defaultFigureXZ()}_getAnnotationsFromModel(){return this.model()&&this.model().annotationsXZ?this.model().annotationsXZ():[]}}var u=FrontDrawing},17467:(e,t,r)=>{var n,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(l,{default:()=>u}),e.exports=(n=l,((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(n=s(t,l))||n.enumerable});return e})(i({},"__esModule",{value:!0}),n));var c=r(7340);class ConstructionComponentHandle extends c.Handle{selectableComponent(){return this.object()}draw(e,t){this._drawHandle(e,this.indicatorProperties(),t)}drawSelected(e,t){this._drawHandle(e,this._selectedProperties(),t)}_drawHandle(e,t,r){const n=new c.PolygonFigure(this.object().vertices());n.updateProperties(t),n.draw(e,r)}_selectedProperties(){return{fillStyle:"rgba(255, 255, 255, 0.0)",strokeStyle:"#5bb2e4",_pixelLineWidth:3,globalAlpha:".8"}}moveFromTo(e,t,r,n){return this.deltaIsSignificant(r-e,n-t)&&this._tool&&this._tool.drawing().updateFigures(),super.moveFromTo(e,t,r,n)}snapToEdge(e,t=10){return!!this.object().snapToEdge&&this.object().snapToEdge(e,t)}}var u=ConstructionComponentHandle},93613:(e,t,r)=>{r(26858);const n=r(82726),i=r(87496),s=r(74734),o=r(86608),a=r(7938),l=r(76141),c=r(35081),u=r(45518),d=r(68597),h=r(20767),p=r(46617),m=r(98718);e.exports.Board=n,e.exports.BoardFigure=i,e.exports.ConstructionComponent=s,e.exports.ConstructionComponentFigure=o,e.exports.ConstructionComponentHandle=a,e.exports.FrameObservable=l,e.exports.FrontDrawing=c,e.exports.GeometricComponent=u,e.exports.Material=d,e.exports.MaterialSpecifier=h,e.exports.UnitFromParent=p,e.exports.lumber=m},11235:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>y}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=r(7340),m=d(r(31199)),f=(r(45718),d(r(29235)));const g=new m.default.Raycaster;class Drawing3DController extends p.DrawingController{async addComponent(e){await this.batchUpdateProject((t=>t.add(e)))}async removeComponent(e){await this.batchUpdateProject((t=>t.remove(e)))}async batchUpdateProject(e){const t=new f.default(this,e);await t.apply()}deactivate(){super.deactivate(),this.releaseResources()}draw(){this.canvas()&&(this.drawing().addToScene(this.scene()),this._lightScene(this.scene()),this._renderLoopActive=!0,this.renderer().setAnimationLoop((()=>{this._render()})),this._beforeUnloadCallback=()=>this._beforeUnload(),window.addEventListener("beforeunload",this._beforeUnloadCallback))}redraw(e=!0){this._figuresShouldUpdate=e,this._renderLoopActive?this.drawing().updateFigures(this.scene()):(this.drawing().updateFigures(),this.draw())}_beforeUnload(){this.releaseResources()}_defaultDrawing(){return this.project().drawing3D()}clearDrawing(){this._drawing&&(this.releaseResources(),this._drawing=void 0)}releaseResources(){window.removeEventListener("beforeunload",this._beforeUnloadCallback),this.renderer().setAnimationLoop(null),this._renderLoopActive=!1,this._disposeThreeJSChildren(this.scene()),this.renderer().dispose(),this._camera=void 0,this._ambientLight=void 0,this._directionalLight=void 0,this._scene=void 0,this._boundingCube=void 0,this._focusPoint=void 0}_disposeThreeJSChildren(e){if(e.children&&e.children.length>0&&e.children.forEach((e=>{this._disposeThreeJSChildren(e),e.dispose&&e.dispose()})),e.geometry&&e.geometry.dispose(),e.material){(Array.isArray(e.material)?e.material:[e.material]).forEach((e=>e.dispose()))}}_render(){this._ensureAllFiguresAreUpToDate(),this.activeTool().update(),this._updateDirectionalLightPosition(),this.renderer().render(this.scene(),this.camera())}_ensureAllFiguresAreUpToDate(){this._figuresShouldUpdate&&this.drawing().update(this.layerManager()),this._figuresShouldUpdate=!1}_lightScene(e){e.add(this.ambientLight());const t=this.directionalLight();e.add(t),e.add(t.target)}_selectionWillChange(e,t){e.deactivate3D(this.scene(),this.drawing()),t.activate3D(this.scene(),this.drawing())}_onSelectionCreated(e){e.activate3D(this.scene(),this.drawing())}ambientLight(){return this._ambientLight||(this._ambientLight=new m.default.AmbientLight(16777215,.3)),this._ambientLight}directionalLight(){return this._directionalLight||(this._directionalLight=new m.default.DirectionalLight(16777215,.4),this._directionalLight.position.set(-1,-1,-1),this._directionalLight.position.multiplyScalar(300)),this._directionalLight}_updateDirectionalLightPosition(){const e=this.camera().getWorldPosition(this.cameraPositionVector()),t=this.directionalLight(),r=this.focusPoint();t.position.copy(e),t.target.position.copy(r)}renderer(){if(!this._renderer){const e=this.canvas(),t=new m.default.WebGLRenderer({canvas:e,...this._rendererOptions()});this._configureRenderer(t),this._renderer=t}return this._renderer}_rendererOptions(){return{alpha:!0,antialias:!0,logarithmicDepthBuffer:!0}}_configureRenderer(e){e.setClearColor(16777215,0)}scene(){return this._scene||(this._scene=this._emptyScene(),this._scene.userData.layerMapping=this.drawing().layers()),this._scene}_emptyScene(){return new m.default.Scene}boundingCube(){return this._boundingCube||(this._boundingCube=this.drawing().boundingCube()),this._boundingCube}_onVersionReplaced(){this.clearSelection(),this._drawing&&(this.drawing().setModel(this.project().current()),this.drawing().updateFigures(this._scene))}centerStage(){return this.boundingCube().center().toThreeJS()}focusPoint(){return this._focusPoint||(this._focusPoint=this.centerStage()),this._focusPoint}raycasterObstructingFigures(){return this._getChildFigures(this.drawing())}_getChildFigures(e){return e.figures?e.figures().flatMap((e=>this._getChildFigures(e))):e}raycasterObstructingMeshes(){return this.raycasterObstructingFigures().map((e=>e.mesh?.())).filter((e=>e))}afterResize(){this.renderer().setViewport(0,0,this.canvas().width,this.canvas().height),this._resizeCamera(),this.camera().updateProjectionMatrix()}_resizeCamera(){this.camera().aspect=this.canvas().width/this.canvas().height}_cameraNearPlane(){return.1}_cameraFarPlane(){return 1e6}_cameraFieldOfView(){return 45}_initialCameraPosition(){const e=this._initialCameraDirection();return this.focusPoint().clone().addScaledVector(e,this._initialCameraZoomAdjustment())}_initialCameraZoomAdjustment(){const e=this.boundingCube(),t=Math.max(e.width(),e.height(),e.depth()),r=this._cameraFieldOfView().degreesToRadians();return 1.5*Math.abs(t/2/Math.tan(r/2))}_initialCameraDirection(){const e=this.boundingCube().bottomRight().toThreeJS(),t=this.focusPoint();return(new m.default.Vector3).subVectors(e,t).normalize()}cameraPositionVector(){return this._cameraPositionVector||(this._cameraPositionVector=new m.default.Vector3),this._cameraPositionVector}camera(){if(!this._camera){if(!this.canvas())throw new Error("Cannot call a camera before setting a canvas.");const e=this.canvas().width/this.canvas().height;this._camera=new m.default.PerspectiveCamera(this._cameraFieldOfView(),e,this._cameraNearPlane(),this._cameraFarPlane()),this.drawing().layers().setCamera(this._camera),this._camera.up.set(0,0,-1),this._cameraPositionVector=new m.default.Vector3,this._camera.position.copy(this._initialCameraPosition()),this._camera.lookAt(this.focusPoint()),this._camera.getWorldPosition(this.cameraPositionVector())}return this._camera}raycaster(){return g}handlesAt(e){const t=this.drawing().handlesAt(e);return this.shouldShowLayer("Annotations")&&t.fastMerge(this.drawing().annotationHandlesAt(e)),t}_onSelectionChanged(){this.notifySelectionChangedObservers()}_browserCoordinatesToToolCoordinates(e){return e}}var y=Drawing3DController},32583:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>y}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(31199)),m=d(r(18225)),f=d(r(63902)),g=d(r(11235));class PhotorealisticDrawing3DController extends g.default{_updateDirectionalLightPosition(){}_configureRenderer(e){super._configureRenderer(e),e.useLegacyLights=!1,e.shadowMap.enabled=!0,e.shadowMap.type=p.default.PCFSoftShadowMap,e.outputColorSpace=this.rendererOutputColorSpace(),e.toneMapping=this.rendererToneMapping(),e.toneMappingExposure=this.rendererExposure()}rendererOutputColorSpace(){return this._rendererOutputColorSpace??p.default.SRGBColorSpace}rendererOutputEncoding(){return this.rendererOutputColorSpace()}setRendererOutputColorSpace(e){this._rendererOutputColorSpace=e}setRendererOutputEncoding(e){this.setRendererOutputColorSpace(e)}rendererExposure(){return this._rendererExposure??1}setRendererExposure(e){this._rendererExposure=e,this.setRendererToneMapping()}rendererToneMapping(){return this._rendererToneMapping??p.default.LinearToneMapping}setRendererToneMapping(e){this._rendererToneMapping=e}_lightScene(e){const t=this.boundingCube(),r=this.focusPoint();this._addEnvironment(e);const[n,...i]=this._lights(r),s=this._shadowPlane(t,r,n);e.add(n,...i,s),this._configureShadows(n,e)}_lights(e){const t=[this.mainLight(e)];return this.imageBasedLighting()||t.push(this.backLight(e),this.ambientLight()),t}environmentLoaded(){return this._environmentPromise}async environmentTexture(){if(!this._environmentTexture){const e=new f.default;this._environmentTexture=await e.loadAsync(this.environmentTextureUrl())}return this._environmentTexture}environmentTextureUrl(){return this._environmentTextureUrl}setEnvironmentTextureUrl(e){this._environmentTextureUrl=e}imageBasedLighting(){return this._imageBasedLighting??Boolean(this.environmentTextureUrl())}setImageBasedLighting(e){this._imageBasedLighting=e}_addEnvironment(e){if(!this.environmentTextureUrl())return;const t=new m.default(this.renderer());this._environmentPromise=new Promise((e=>setTimeout(e))).then((()=>this.environmentTexture())).then((r=>{const n=t.fromEquirectangular(r);t.dispose(),e.environment=n.texture})),t.compileEquirectangularShader()}mainLight(e){const t=this.imageBasedLighting()?1:2,r=new p.default.DirectionalLight(16777215,t);return r.position.copy(this.mainLightOffset()).add(e),r.target.position.copy(e),r.target.updateMatrixWorld(),r}mainLightOffset(){return this._mainLightOffset??new p.default.Vector3(-2,2,-4).normalize()}setMainLightOffset(e,t,r){this._mainLightOffset=new p.default.Vector3(e,t,r).normalize()}backLight(e){const t=new p.default.DirectionalLight(16777215,2);return t.position.set(2,-2,6).add(e),t.target.position.copy(e),t.target.updateMatrixWorld(),t}ambientLight(){return new p.default.AmbientLight(16777215,.5)}_shadowPlane(e,t,r){const n=r.position.toPoint().subtract(r.target.position.toPoint()).phi()-Math.PI_2,i=e.depth(),s=Math.abs(i/Math.tan(n))+10,o=new p.default.PlaneGeometry(e.width()+2*s,e.height()+2*s);o.rotateX(Math.PI);const a=new p.default.ShadowMaterial({opacity:.3}),l=new p.default.Mesh(o,a);return l.position.set(t.x,t.y,e.low()),l.updateMatrixWorld(),l.receiveShadow=!0,l.renderOrder=-2,l}_configureShadows(e,t){e.castShadow=!0;e.shadow.mapSize.set(4096,4096),e.up.set(0,0,-1),e.shadow.camera.up.set(0,0,-1),e.lookAt(e.target.position);const{size:r,distanceFromCenter:n}=this._shadowCameraParameters(e,t);e.shadow.camera.left=-r.x/2,e.shadow.camera.right=r.x/2,e.shadow.camera.top=r.y/2,e.shadow.camera.bottom=-r.y/2,e.shadow.camera.near=-r.z/2+n,e.shadow.camera.far=r.z/2+n}_shadowCameraParameters(e,t){const r=e.quaternion,n=e.position.distanceTo(e.target.position),i=(new p.default.Box3).setFromObject(t),s=i.toCube().vertices().map((e=>e.toThreeJS())),o=new p.default.Vector3(1,0,0).applyQuaternion(r),a=new p.default.Vector3(0,1,0).applyQuaternion(r),l=new p.default.Vector3(0,0,1).applyQuaternion(r),c=s.map((e=>new p.default.Vector3(e.dot(o),e.dot(a),e.dot(l))));i.setFromPoints(c);return{size:i.getSize(new p.default.Vector3),distanceFromCenter:n}}}var y=PhotorealisticDrawing3DController},29235:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>a}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));var a=class ProjectUpdateBatch{constructor(e,t){this._controller=e,this._transaction=t}controller(){return this._controller}project(){return this.controller().project()}drawing(){return this.controller().drawing()}scene(){return this.controller().scene()}async apply(){try{await this._transaction(this)}finally{await this.controller().snapshotProject()}}add(e){this.project().add(e);const t=e.threeFigure();this.drawing().add(t),t.addToScene(this.scene())}remove(e){const t=this.drawing().figureFor(e);this.project().remove(e),this.drawing().remove(t),t.removeFromScene(this.scene())}select(e){this.controller().setSelectedComponent(e)}}},48385:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>v}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(99970)),m=r(93613),f=r(62048),g=r(50988),y=d(r(63481)),b=d(r(31199));class ComponentFrom3DModel extends m.ConstructionComponent{constructor(e,t,r={w:1,x:0,y:0,z:0},n=(0,f.$P)(1,1,1)){super(),this._referencePoint=e,this.__modelIdentifier=t,this._rotation=r,this._scale=n}_modelIdentifier(){return this.__modelIdentifier}_customizeThreeGeometry(e){}referencePoint(){return this._referencePoint}rotation(){return this._rotation}scale(){return this._scale}transform(){const e=this.rotation();return(new b.default.Matrix4).compose(this.referencePoint().toThreeJS(),new b.default.Quaternion(e.x,e.y,e.z,e.w),this.scale().toThreeJS())}_box3(){return this.shape3D().boundingBox||this.shape3D().computeBoundingBox(),this.shape3D().boundingBox}boundingCube(){const e=this.transform();return this._box3().clone().applyMatrix4(e).toCube()}boundingBox(){const e=this.boundingCube();return new f.Rectangle(e.topLeft().x(),e.topLeft().y(),e.width(),e.height())}center(){return this.boundingCube().center()}contains(e,t){return this.topProjections().some((r=>r.contains(e,t)))}_modelRepository(){throw new g.MissingOverride(this,"_modelRepository")}_threeGeometryFrom3DModel(){return this._modelRepository().getModel(this._modelIdentifier())}xLevel(){return this.boundingCube().left()}yLevel(){return this.boundingCube().bottom()}zLevel(){return this.boundingCube().high()}resetShape3D(){this._geometry3D&&this._geometry3D.dispose(),this._geometry3D=void 0}shape3D(){return this._geometry3D||(this._geometry3D=this._threeGeometryFrom3DModel(),this._customizeThreeGeometry(this._geometry3D)),this._geometry3D}_indexConnectivity(e,t){const r=[],n=[],i=this._makeVertexIndexFunction(n,t);return this._eachGeometryFace(((t,n)=>{t.normal.clone().applyQuaternion(this.rotation()).dot(e)<=1e-5||r.push([i(n.first()),i(n[1]),i(n.last())])})),{cells:r,cellPositions:n}}_makeVertexIndexFunction(e,t){const r=new b.default.Vector3,n={};return i=>{r.copy(i).applyMatrix4(t);const s=r.toArray(),o=s.toString();if(o in n)return n[o];{const t=e.length;return n[o]=t,e.push(s),t}}}_buildShapes(e,t,r){0===e.length?t.push(r):1===e.length?this._addEdgeToShape(t[e.first()],r):(this._mergeShapes(t[e.first()],t[e.last()],r),t.splice(e.last(),1))}_mergeShapes(e,t,r){this._edgeConnectsShapeEndpoints(e.first(),t.last(),r)?e.unshift(...t):this._edgeConnectsShapeEndpoints(e.last(),t.first(),r)?e.push(...t):this._edgeConnectsShapeEndpoints(e.first(),t.first(),r)?e.unshift(...t.reverse()):e.push(...t.reverse())}_edgeConnectsShapeEndpoints(e,t,r){if(e===t)return!0;const n=r.first(),i=r.last();return e===n&&t===i||e===i&&t===n}_addEdgeToShape(e,t){const r=t.first(),n=t.last();r===e.first()?e.unshift(n):r===e.last()?e.push(n):n===e.first()?e.unshift(r):n===e.last()&&e.push(r)}_findShapesFromEdgeLoop(e){const t=[e.shift()];return e.forEach((e=>{const r=[];t.forEach(((t,n)=>{(e.includes(t.first())||e.includes(t.last()))&&r.push(n)})),this._buildShapes(r,t,e)})),t}_2dProjections(e,t,r){const n=this.transform(),{cells:i,cellPositions:s}=this._indexConnectivity(e,n),o=(0,p.default)(i),a=this._findShapesFromEdgeLoop(o);return this._boundaryIndexesToPolygons(a,s,t,r)}_boundaryIndexesToPolygons(e,t,r,n){return e.map((e=>{const i=e.slice(1).map((e=>(0,f.$P)(...r(t[e])))),s=new f.Polygon(i).relatedTo(n);return s.isCounterClockwise()&&s.reverseVertices(),s}))}xyViewDirection(){return new b.default.Vector3(0,0,-1)}yzViewDirection(){return new b.default.Vector3(-1,0,0)}xzViewDirection(){return new b.default.Vector3(0,1,0)}selectXY(e){return e}selectYZ(e){return[e[1],e[2],e[0]]}selectXZ(e){return[e[0],e[2],e[1]]}defaultTopShapes(){return this._2dProjections(this.xyViewDirection(),this.selectXY,this.referencePoint())}defaultLeftSideShapes(){return this._2dProjections(this.yzViewDirection(),this.selectYZ,this.referencePoint().yz())}defaultFrontShapes(){return this._2dProjections(this.xzViewDirection(),this.selectXZ,this.referencePoint().xz())}topProjections(){return this._geometryTop||(this._geometryTop=this.defaultTopShapes()),this._geometryTop}leftSideProjections(){return this._geometryLeft||(this._geometryLeft=this.defaultLeftSideShapes()),this._geometryLeft}frontProjections(){return this._geometryFront||(this._geometryFront=this.defaultFrontShapes()),this._geometryFront}_eachGeometryFace(e){this.shape3D().index?this._eachIndexedGeometryFace(e):this._eachNotIndexedGeometryFace(e)}_eachIndexedGeometryFace(e){const t=this.shape3D(),r=t.getAttribute("position"),n=new b.default.Vector3,i=new b.default.Vector3,s=new b.default.Vector3,o=new b.default.Vector3,a=t.index;for(let t=0;t<a.count;t+=3){const l={a:a.array[t],b:a.array[t+1],c:a.array[t+2],normal:new b.default.Vector3};this._getPositionsForFace(l,i,s,o,r),this._computeFaceNormal(l,i,s,o,n),e(l,[i,s,o])}}_eachNotIndexedGeometryFace(e){const t=this.shape3D().getAttribute("position"),r=new b.default.Vector3,n=new b.default.Vector3,i=new b.default.Vector3,s=new b.default.Vector3;for(let o=0;o<t.count;o+=3){const a={a:o,b:o+1,c:o+2,normal:new b.default.Vector3};this._getPositionsForFace(a,n,i,s,t),this._computeFaceNormal(a,n,i,s,r),e(a,[n,i,s])}}_computeFaceNormal(e,t,r,n,i){e.normal.subVectors(n,r).cross(i.subVectors(t,r)).normalize()}_getPositionsForFace(e,t,r,n,i){t.fromBufferAttribute(i,e.a),r.fromBufferAttribute(i,e.b),n.fromBufferAttribute(i,e.c)}threeFigure(){return new y.default(this,this.shape3D())}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_vertices","_boundingCube","_geometry3D","_geometryFront","_geometryTop","_geometryLeft"]}}var v=ComponentFrom3DModel},40799:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(31199));var p=class RaycastablePlane{constructor(e){this._plane=e,this.children=[],this.layers=new h.default.Layers,this.layers.enableAll()}raycast(e,t){const r=e.ray.intersectPlane(this._plane,new h.default.Vector3);r&&t.push({point:r,distance:r.distanceTo(e.ray.origin),object:this._plane})}}},5585:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>f}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(7340),p=r(62048),m=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(76110));class Composite3DFigure extends h.CompositeFigure{_componentRenderer(e){return e.threeFigure()}_componentSorter(){return 0}addToScene(e){this.figures().forEach((t=>t.addToScene(e))),this.applyLayerMapping(e.userData.layerMapping),this.applyLayerTransparency(e.userData.layerMapping)}removeFromScene(e){this.figures().forEach((t=>t.removeFromScene(e)))}update(e){this.figures().forEach((t=>t.update(e)))}updateFigures(e){this.strategy().updateFigures(e)}_defaultStrategy(){return this.model()?new m.default(this):new h.StaticFigureStrategy}applyLayerMapping(e){this.figures().forEach((t=>{t.applyLayerMapping&&t.applyLayerMapping(e)}))}applyLayerTransparency(e){this.figures().forEach((t=>{t.applyLayerTransparency&&t.applyLayerTransparency(e)}))}_isValidBoundingCube(e){return e.isFinite()}selfHandle(){}handlesAt(e){return this.handles().fastFilter((t=>t.contains(e)))}boundingCube(){return p.Cube.mergedFiniteCubes(this.parts())}}var f=Composite3DFigure},64556:(e,t,r)=>{var n,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(l,{default:()=>d}),e.exports=(n=l,((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(n=s(t,l))||n.enumerable});return e})(i({},"__esModule",{value:!0}),n));var c=r(7340),u=r(50988);class Drawable3D extends c.Drawable{boundingCube(){throw new u.MissingOverride(this,"boundingCube")}_isValidBoundingCube(e){return e.isFinite()}addToScene(e){throw new u.MissingOverride(this,"addToScene")}removeFromScene(e){throw new u.MissingOverride(this,"removeFromScene")}handlesAt(e){return this.handles().fastFilter((t=>t.contains(e)))}selfHandle(){throw new u.MissingOverride(this,"selfHandle")}update(e){}}var d=Drawable3D},80580:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>y}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=r(7340),m=r(62048),f=d(r(49502)),g=d(r(76110));class Drawing3D extends p.Drawing{addToScene(e){this.figures().forEach((t=>t.addToScene(e)))}layers(){return this._layers||(this._layers=new f.default(this,this._defaultLayers(),this._defaultLayerLocks(),this._defaultLayerTransparency())),this._layers}_defaultLayers(){return{}}_defaultLayerLocks(){return{}}_defaultLayerTransparency(){return{}}_componentRenderer(e){return e.threeFigure()}_componentSorter(){return 0}_isValidBoundingCube(e){return e.isFinite()}applyLayerTransparency(e){this.figures().forEach((t=>{t.applyLayerTransparency&&t.applyLayerTransparency(e)}))}boundingCube(){return m.Cube.mergedFiniteCubes(this.parts())}update(e){this.figures().forEach((t=>t.update(e)))}updateFigures(e){this.strategy().updateFigures(e)}_defaultStrategy(){return this.model()?new g.default(this):new p.StaticFigureStrategy}handlesAt(e){let t;if(this._handles)t=this._handles.fastFilter((t=>t.contains(e)));else{t=[];const r=this.figures();for(let n=r.length-1;n>=0;n--)t.fastMerge(r[n].handlesAt(e));const n=this.selfHandle();n&&n.contains(e)&&t.push(n)}return t}annotationHandlesAt(e){let t=[];return this.figures().forEach((r=>t=r.annotationHandlesAt(e).concat(t))),t=t.concat(super.annotationHandlesAt(e)),t}}var y=Drawing3D},49502:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>a}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));var a=class LayerManager3D{constructor(e,t,r,n){this._drawing=e,this._layerDefaults=t,this._lockingDefaults=r,this._transparencyDefaults=n}setCamera(e){if(this._camera){const t=this._camera.layers.mask;this._camera=e,this._camera.layers.mask=t}else this._camera=e,this.showDefaultLayers()}layerNames(){return Object.keys(this._layerDefaults)}threeLayerMask(e){const t=Object.keys(e);return t.reduce(((r,n)=>{const i=this.threeLayer(n,t);return e[n]&&(r|=i),r}),1)}setLayerDefaults(e){const t=Object.keys(e),r=this.layerNames().filter((e=>t.includes(e))),n=Object.assign({},e);r.forEach((e=>n[e]=this.isVisible(e))),this._showLayers(n),this._layerDefaults=e}showDefaultLayers(){this._showLayers(this._layerDefaults)}_showLayers(e){this._camera.layers.mask=this.threeLayerMask(e)}isVisible(e){return this._camera?0!=(this._camera.layers.mask&this.threeLayer(e)):this._layerDefaults[e]}isLocked(e){return!!this._lockingDefaults[e]}toggleLock(e){this._lockingDefaults[e]=!this._lockingDefaults[e]}isTransparent(e){return!!this._transparencyDefaults[e]}toggleTransparency(e){this._transparencyDefaults[e]=!this._transparencyDefaults[e],this._drawing.applyLayerTransparency(this)}toggle(e){this._camera&&this._camera.layers.toggle(this.threeLayerIndex(e))}threeLayerIndex(e,t=this.layerNames()){return t.indexOf(e)+1}threeLayer(e,t=this.layerNames()){return 1<<this.threeLayerIndex(e,t)}}},8229:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(62048),p=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(64556));class NullDrawable3D extends p.default{constructor(e){super(),this.setModel(e)}addToScene(e){}removeFromScene(e){}applyLayerMapping(e){}layer(){}defaultHandles(){return[]}selfHandle(){}boundingCube(){const e=this.model().referencePoint();return new h.Cube(e.x(),e.y(),e.z(),0,0,0)}}var m=NullDrawable3D},59555:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>y}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(31199)),m=d(r(56252)),f=d(r(64556)),g=d(r(97345));class Shape3DFigure extends f.default{constructor(e){super(),this.setModel(e),this._transparency=!1}shape3D(){return this.model()}boundingCube(){return this.model().boundingCube()}addToScene(e){e.add(this._threeMeshFigure()),this.applyLayerMapping(e.userData.layerMapping)}applyLayerMapping(e){this.mesh().layers.mask=e.threeLayer(this.layer())}layer(){}removeFromScene(e){const t=this.mesh();e.remove(t),t.geometry.dispose()}threeGeometry(){const e=[],t=[],r=[];this.shape3D().faces().forEach((n=>this._triangulateAndAddFace(n,e,t,r)));const n=new p.default.BufferGeometry,i=[];return t.forEach(((e,t)=>{n.addGroup(i.length,e.length,t),i.fastMerge(e)})),n.setIndex(i),n.setAttribute("position",new p.default.Float32BufferAttribute(e,3)),n.setAttribute("uv",new p.default.Float32BufferAttribute(r,2)),n.computeVertexNormals(),n.computeBoundsTree(),n}_triangulateAndAddFace(e,t,r,n,{materialIndex:i=0,mainAxis:s=this._mainAxis()}={}){r[i]||(r[i]=[]);const o=t.length/3,a=e.vertices().map((e=>e.toThreeJS())),l=e.normal().toThreeJS(),c=(new p.default.Vector3).crossVectors(s,l);a.forEach((e=>{t.push(e.x,e.y,e.z),this._generateUVCoordinates(e,n,s,c)}));const u=this._triangleVertexIndices(a,l),d=new p.default.Vector3,h=new p.default.Vector3,m=new p.default.Vector3;u.forEach((e=>{const n=o+e[0],s=o+e[1],a=o+e[2];d.fromArray(t,3*n),h.fromArray(t,3*s),m.fromArray(t,3*a),r[i].push(n,s,a)}))}_mainAxis(){return this.model().primaryDirection?this.model().primaryDirection().toThreeJS():new p.default.Vector3(1,0,0)}_triangleVertexIndices(e,t){const r=new p.default.Vector3(0,0,1),n=new p.default.Quaternion;n.setFromUnitVectors(t,r);const i=e.map((e=>e.clone().applyQuaternion(n)));return p.default.ShapeUtils.triangulateShape(i,[])}_generateUVCoordinates(e,t,r,n){t.push(e.dot(r),e.dot(n))}_threeMeshFigure(){const e=this.threeGeometry(),t=new p.default.Mesh(e,this._materials());return t.receiveShadow=!0,t.castShadow=!0,t.figure=this,this._mesh=t,t}mesh(){return this._mesh||(this._mesh=this._threeMeshFigure()),this._mesh}handles(){return this._handles||(this._handles=this.defaultHandles()),this._handles}selfHandle(){return new m.default(this.model(),this)}update(){this.handles().forEach((e=>e.update()))}materialLibrary(){return g.default.instance()}materialNames(){return[]}_materials(){const e=this.materialNames();if(0===e.length){return new(this._nonsharedMaterialClass())(this._transparency?this.transparentProperties():this.properties())}const t=this.materialLibrary();return 1===e.length?t.lookupMaterial(this.materialNames().first()):e.map((e=>t.lookupMaterial(e)))}_nonsharedMaterialClass(){return p.default.MeshStandardMaterial}defaultProperties(){return{color:11184810,flatShading:!0}}transparentProperties(){return{...this.properties(),transparent:!0,opacity:.4,depthWrite:!1}}}var y=Shape3DFigure},63481:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>g}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=r(62048),m=d(r(31199)),f=d(r(59555));class ThreeGeometryFigure extends f.default{addToScene(e){e.add(this._threeMeshFigure()),this.applyLayerMapping(e.userData.layerMapping),this.applyLayerTransparency(e.userData.layerMapping)}removeFromScene(e){e.remove(this.mesh())}threeGeometry(){return this.model().shape3D()}_threeMeshFigure(){const e=new m.default.Mesh(this.threeGeometry());return e.castShadow=!0,e.receiveShadow=!0,this.updateMaterial(e),e.figure=this,this._mesh=e,this._setMeshTransform(e),e}applyLayerTransparency(e){this._setTransparency(e.isTransparent(this.layer()))}_setTransparency(e){this._transparency!==e&&(this._transparency=e,this.updateMaterial())}boundingCube(){return this._boundingCube||(this._boundingCube=this._defaultBoundingCube(),this._boundingCube.isFinite()||console.warn("Invalid bounding cube",this)),this._boundingCube}_defaultBoundingCube(){const e=(new m.default.Box3).setFromObject(this.mesh()),t=e.min,r=(new m.default.Vector3).subVectors(e.min,e.max);return new p.Cube(t.x,t.y,t.z,Math.abs(r.x),Math.abs(r.y),Math.abs(r.z))}update(){this._setMeshTransform(),super.update()}updateMaterial(e=this.mesh()){const t=this._materials(),r=e.material;e.material=t,r.dispose()}_setMeshTransform(e=this.mesh()){if(this.model().referencePoint){const t=this.model().referencePoint();e.position.set(t.x(),t.y(),t.z())}if(this.model().rotation){const t=this.model().rotation()||{x:0,y:0,z:0,w:1};e.quaternion.set(t.x,t.y,t.z,t.w)}if(this.model().scale){const t=this.model().scale();e.scale.set(t.x(),t.y(),t.z())}e.updateMatrixWorld()}}var g=ThreeGeometryFigure},97345:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(31199));var p=class ThreeMaterialLibrary{static instance(){return this._instance||(this._instance=new this),this._instance}register(e,t){this.materialDefinitions()[e]={load:t}}lookupMaterial(e){const t=this.materialDefinitions()[e];return t.material||(t.material=t.load(this.textureLoader())),t.material}materialDefinitions(){return this._materialDefinitions||(this._materialDefinitions={}),this._materialDefinitions}textureLoader(){return this._textureLoader||(this._textureLoader=new h.default.TextureLoader),this._textureLoader}}},76110:(e,t,r)=>{var n,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(l,{default:()=>u}),e.exports=(n=l,((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(n=s(t,l))||n.enumerable});return e})(i({},"__esModule",{value:!0}),n));var c=r(7340);class CompositeModel3DStrategy extends c.CompositeModelStrategy{updateFigures(e){const t=this.model().components();this._removeDeadFigures(t,e),this.figures().forEach((t=>t.updateFigures(e))),this._addMissingFigures(t,e),this.compositeFigure().updateAnnotationFigures(e)}_removeDeadFigures(e,t){this._deadFigures(e).forEach((e=>this._removeFigure(e,t)))}_removeFigure(e,t){const r=this.figures().indexOf(e);r>-1&&(this.figures().splice(r,1),e.stopObserving&&e.stopObserving(),t&&e.removeFromScene&&e.removeFromScene(t))}_addMissingFigures(e,t){const r=this.figures().map((e=>e.model()));e.forEach((e=>{if(r.includes(e))return;const n=this._componentRenderer(e);this.compositeFigure().add(n),t&&n.addToScene(t)}))}}var u=CompositeModel3DStrategy},56252:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>f}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));r(62048);var p=d(r(39344)),m=d(r(31199));class Handle3D extends p.default{constructor(e,t){super(e),this._figure=t}figure(){return this._figure}contains(e){const[t]=e.intersectObject(this.mesh(),!1);if(t)return this._currentIntersection=t,t;this._currentIntersection=void 0}lastCalculatedIntersection(){return this._currentIntersection}mesh(){return this._mesh||(this._mesh=this.figure().mesh().clone(),this._mesh.renderOrder=1),this._mesh}hoveredMesh(){this._hoverMaterial||(this._hoverMaterial=new m.default.MeshLambertMaterial(this.hoverProperties()));const e=this.mesh();return e.material=this._hoverMaterial,e}activeMesh(){this._activeMaterial||(this._activeMaterial=new m.default.MeshLambertMaterial(this.activeProperties()));const e=this.mesh();return e.material=this._activeMaterial,e}selectedMesh(){return this._selectedMesh||(this._selectedMesh=this.figure().mesh().clone(),this._selectedMesh.renderOrder=1),this._selectedMaterial||(this._selectedMaterial=new m.default.MeshLambertMaterial(this.selectedProperties())),this._selectedMesh.material=this._selectedMaterial,this._selectedMesh}update(){this.updateGeometry();const e=this.mesh();e.position.copy(this.figure().mesh().position),e.quaternion.copy(this.figure().mesh().quaternion),e.updateMatrixWorld();const t=this.selectedMesh();t.position.copy(this.figure().mesh().position),t.quaternion.copy(this.figure().mesh().quaternion),t.updateMatrixWorld()}updateGeometry(){const e=this.mesh(),t=this.selectedMesh(),r=this.figure().mesh().geometry;e.geometry=r,t.geometry=r}hoverProperties(){return{color:16766045,emissive:16766045,emissiveIntensity:.2,side:m.default.DoubleSide}}activeProperties(){return{color:16766045,emissive:16766045,emissiveIntensity:.5,side:m.default.DoubleSide}}selectedProperties(){return{color:16766045,emissive:16766045,emissiveIntensity:.5,side:m.default.DoubleSide}}interactionSpace(){}moveFromTo(e,t,r,n,i,s){const o=this._moveFromTo(e,t,r,n,i,s);return o&&this.figure().update(),o}_moveFromTo(e,t,r,n,i,s){return this.object().moveFromTo?this.object().moveFromTo(e,t,r,n,i,s):this.moveBy(n-e,i-t,s-r)}moveBy(e,t,r){return this.deltaIsSignificant(e,t,r)&&this._moveBy(e,t,r)}deltaIsSignificant(e,t,r){const n=Math.DEFAULT_TOLERANCE;return Math.abs(e)+Math.abs(t)+Math.abs(r)>n}_moveBy(e,t,r){return this.object().moveBy(e,t,r)}selectableComponent(){return this.object()}validWhen(){return p.default.VALID_FOR_HOVER}}Handle3D.VALID_FOR_HOVER=p.default.VALID_FOR_HOVER,Handle3D.VALID_FOR_SELECTED=p.default.VALID_FOR_SELECTED;var f=Handle3D},58823:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>_}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(75035)),m=r(7340),f=r(62048),g=d(r(40799)),y=d(r(31199)),b=d(r(56252)),v=d(r(79549));class ComponentSelectionTool3D extends m.Tool{displayName(){return"Select"}navigationTool(){return this._navigationTool??=this.defaultNavigationTool()}defaultNavigationTool(){return new v.default(this._controller())}get scene(){return this._controller().scene()}get raycaster(){return this._controller().raycaster()}get camera(){return this._controller().camera()}get canvas(){return this._controller().canvas()}get project(){return this._controller().project()}get selectionLock(){return!1}controller(){return this._controller()}viewPlane(){return this._viewPlane??=new y.default.Plane}isActive(){return this._active}activate(){this.isActive()||(this._active=!0,this.navigationTool().activate(),this.registerKeyboardShortcuts())}deactivate(){this.isActive()&&(this._active=!1,this.navigationTool().deactivate(),this.unregisterKeyboardShortcuts())}didNavigate(){return this.navigationTool().didNavigate()}select(e){this._updateSelection(e)}_updateSelection(e){e?e instanceof p.default?this._controller().setSelection(e):this._controller().select(e):this._controller().clearSelection()}recordChange(){this._didChange=!0}clearChange(){this._didChange=!1}didChange(){return this._didChange}mouseDown(e,t,r){this.navigationTool().mouseDown(e,t,r),this.didNavigate()||(this._lastX=e,this._lastY=t,this._dragActive=!1,this._activateHandlesAt(e,t))}mouseMove(e,t,r){this.navigationTool().mouseMove(e,t,r),this.didNavigate()||this._updateHoveredHandle(e,t)}mouseDrag(e,t,r={}){if(!this._dragActive){if((0,f.$P)(e,t).distanceTo((0,f.$P)(this._lastX,this._lastY))<=1)return}this._dragActive=!0;let n=!1;const i=this.activeHandle();if(i){const r=this._findPointInInteractionSpace(e,t);if(r){const{x:e,y:t,z:s}=this._lastPosition,{x:o,y:a,z:l}=r.point;i.moveFromTo(e,t,s,o,a,l)&&(this.recordChange(),this._lastPosition=r.point),n=!0}}n||this.navigationTool().mouseDrag(e,t,r)}async mouseUp(e,t,r={}){let n=!1;const i=this._selectionLocked(r&&r.shiftKey),s=this.activeHandle();if(s){if(s.deactivate(this),!i){const e=s.selectableComponent();this._updateSelection(e)}this.didChange()&&await this._controller().snapshotProject(),n=!0}n||(this.didNavigate()||this._controller().clearSelection(),this.navigationTool().mouseUp(e,t,r)),this.setActiveHandle(void 0),this._lastPosition=void 0,this._dragActive=!1,this._lastX=void 0,this._lastY=void 0}mouseScroll(e){return this.navigationTool().mouseScroll(e)}multiTouchStart(e,t,{event:r,...n}){this.navigationTool().multiTouchStart(e,t,{event:r,...n})}multiTouchMove(e,t,r){this.navigationTool().multiTouchMove(e,t,r)}multiTouchEnd(e,t,r){this.navigationTool().multiTouchEnd(e,t,r)}_updateHoveredHandle(e,t){const r=this._setRaycasterFrom((0,f.$P)(e,t)),n=this._topHandleUnderCursor(r);(!n&&this.hoveredHandle()||n&&!n.equals(this.hoveredHandle()))&&this.setHoveredHandle(n)}_activateHandlesAt(e,t){this.clearChange();const r=this._setRaycasterFrom((0,f.$P)(e,t)),n=this._topHandleUnderCursor(r);if(this.setHoveredHandle(void 0),this.setActiveHandle(n),this.activeHandle()){this.activeHandle().activate(this);const r=this.activeHandle().lastCalculatedIntersection().point;this.viewPlane().setFromNormalAndCoplanarPoint(this.camera.getWorldDirection(this.viewPlane().normal),r);const n=this._findPointInInteractionSpace(e,t);this._lastPosition=n?n.point:r}}_findPointInInteractionSpace(e,t){const r=this._setRaycasterFrom((0,f.$P)(e,t)),n=this.activeHandle().interactionSpace()||[new g.default(this.viewPlane())];return r.intersectObjects(n).first()}_setRaycasterFrom(e){const t=this.raycaster,r=this._browserCoordinatesToCameraCoordinates(e);return t.setFromCamera(r,this.camera),t}_topHandleUnderCursor(e){const t=this._controller().selectedComponent(),r=this._maximumUnobscuredDistance(e),n=this.controller().drawing().layers();return this._allHandlesUnderCursor(e).filter((e=>e.lastCalculatedIntersection().distance<=r)).filter((e=>n.isVisible(e.figure().layer())&&!n.isLocked(e.figure().layer()))).filter((e=>e.validWhen()===b.default.VALID_FOR_HOVER||void 0!==t&&e.validWhen()===b.default.VALID_FOR_SELECTED&&e.selectableComponent()===t)).sort(((e,t)=>e.lastCalculatedIntersection().distance-t.lastCalculatedIntersection().distance)).first()}_allHandlesUnderCursor(e){return this._controller().handlesAt(e)}_maximumUnobscuredDistance(e){const t=e.intersectObjects(this._raycasterObstructingMeshes(),!0).filter((e=>!(e.object.material.transparent&&e.object.material.opacity<1))).filter((e=>e.object.layers.test(this.camera.layers)));return t.length>0?t.first().distance:1/0}_raycasterObstructingMeshes(){return this._controller().raycasterObstructingMeshes()}update(){}_browserCoordinatesToCameraCoordinates(e){const t=new y.default.Vector2,r=this.canvas.getBoundingClientRect();return t.x=(e.x()-r.left)/r.width*2-1,t.y=-(e.y()-r.top)/r.height*2+1,t}_selectionLocked(e){return!(!this.selectionLock||e)&&!!this._controller().selectedComponent()}activeHandle(){return this._activeHandle}setActiveHandle(e){this._activeHandle&&this._activeHandle!==e&&(this.scene.remove(this._activeMesh),this._setDefaultCursor()),e&&this._activeHandle!==e&&(this._activeMesh=e.activeMesh(),this.scene.add(this._activeMesh),this._setCursorIfProvided(e.activeCursor())),this._activeHandle=e}hoveredHandle(){return this._hoveredHandle}setHoveredHandle(e){this._hoveredHandle&&!this._hoveredHandle.equals(e)&&(this.scene.remove(this._hoveredMesh),this._setDefaultCursor()),e&&!e.equals(this._hoveredHandle)&&(this._hoveredMesh=e.hoveredMesh(),this.scene.add(this._hoveredMesh),this._setCursorIfProvided(e.hoverCursor())),this._hoveredHandle=e}_setCursorIfProvided(e){e&&this._controller().setCursor(e)}_setDefaultCursor(){this._controller().setDefaultCursor()}}var _=ComponentSelectionTool3D},79549:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>v}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=r(7340),m=d(r(3539)),f=d(r(96316)),g=d(r(38344)),y=d(r(35989)),b=d(r(64655));class CompositeNavigationTool3D extends f.default{constructor(e){super(e),this._active=!1}update(){}isActive(){return this._active}activate(){this.isActive()||(this._active=!0,this._didPan=void 0,this._didOrbit=void 0,this._didZoom=void 0,this.registerKeyboardShortcuts())}deactivate(){this.isActive()&&(this._active=!1,this.panTool().deactivate(),this.orbitTool().deactivate(),this.zoomTool().deactivate(),this.unregisterKeyboardShortcuts())}panTool(){return this._panTool??=this.defaultPanTool()}defaultPanTool(){const e=this._controller(),t=this.constructor.SECONDARY_MOUSE_BUTTON,r=this.constructor.AUXILIARY_MOUSE_BUTTON;return new m.default(e,new y.default(e),{mouseButtonsToActivate:[t,r],touchesToActivate:2})}setPanTool(e){this._panTool=e}panningEnabled(){return this.panTool().isActive()}enablePanning(){return this.panTool().activate()}disablePanning(){return this.panTool().deactivate()}orbitTool(){return this._orbitTool??=this.defaultOrbitTool()}defaultOrbitTool(){const e=this._controller();return new m.default(e,new g.default(e))}setOrbitTool(e){this._orbitTool=e}orbitingEnabled(){return this.orbitTool().isActive()}enableOrbiting(){return this.orbitTool().activate()}disableOrbiting(){return this.orbitTool().deactivate()}zoomTool(){return this._zoomTool??=this.defaultZoomTool()}defaultZoomTool(){const e=this._controller(),t=new b.default(e);return new p.ZoomViewportTool(e,t)}setZoomTool(e){this._zoomTool=e}didPan(){return this._didPan}didOrbit(){return this._didOrbit}didZoom(){return this._didZoom}didNavigate(){return this.didPan()||this.didOrbit()||this.didZoom()}mouseDown(e,t,r){this._didPan=this.panTool().mouseDown(e,t,r),this._didZoom=this.zoomTool().mouseDown(e,t,r),this._didOrbit=this.orbitTool().mouseDown(e,t,r)}mouseMove(e,t,r){this._didPan=this.panTool().mouseMove(e,t,r),this._didZoom=this.zoomTool().mouseMove(e,t,r),this._didOrbit=this.orbitTool().mouseMove(e,t,r)}mouseDrag(e,t,r={}){this._didPan=this.panTool().mouseDrag(e,t,r),this._didZoom=this.zoomTool().mouseDrag(e,t,r),this._didOrbit=this.orbitTool().mouseDrag(e,t,r)}mouseUp(e,t,r){this._didPan=this.panTool().mouseUp(e,t,r),this._didZoom=this.zoomTool().mouseUp(e,t,r),this._didOrbit=this.orbitTool().mouseUp(e,t,r)}mouseScroll(e){this._didPan=this.panTool().mouseScroll(e),this._didZoom=this.zoomTool().mouseScroll(e),this._didOrbit=this.orbitTool().mouseScroll(e)}multiTouchMove(e,t,r){this._didPan=this.panTool().multiTouchMove(e,t,r),this._didZoom=this.zoomTool().multiTouchMove(e,t,r),this._didOrbit=this.orbitTool().multiTouchMove(e,t,r)}multiTouchStart(e,t,r){this._didPan=this.panTool().multiTouchStart(e,t,r),this._didZoom=this.zoomTool().multiTouchStart(e,t,r),this._didOrbit=this.orbitTool().multiTouchStart(e,t,r)}multiTouchEnd(e,t,r){this._didPan=this.panTool().multiTouchEnd(e,t,r),this._didZoom=this.zoomTool().multiTouchEnd(e,t,r),this._didOrbit=this.orbitTool().multiTouchEnd(e,t,r)}_keyboardShortcuts(){return{}}registerKeyboardShortcuts(){this._controller().shortcutManager().registerShortcuts(this._keyboardShortcuts(),this),this.panTool().registerKeyboardShortcuts(),this.orbitTool().registerKeyboardShortcuts(),this.zoomTool().registerKeyboardShortcuts()}unregisterKeyboardShortcuts(){this.panTool().unregisterKeyboardShortcuts(),this.orbitTool().unregisterKeyboardShortcuts(),this.zoomTool().unregisterKeyboardShortcuts(),this._controller().shortcutManager().unregisterShortcuts(this._keyboardShortcuts(),this)}}var v=CompositeNavigationTool3D},3539:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(73155));class MoveViewportTool3D extends h.default{_dragHandled(e,t){super._dragHandled(e,t),this._lastX=e,this._lastY=t}}var p=MoveViewportTool3D},96316:(e,t,r)=>{var n,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(l,{default:()=>u}),e.exports=(n=l,((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(n=s(t,l))||n.enumerable});return e})(i({},"__esModule",{value:!0}),n));var c=r(7340);class Tool3D extends c.Tool{get camera(){return this._controller().camera()}get canvas(){return this._controller().canvas()}mouseDown(e,t,r){this._lastX=e,this._lastY=t}mouseUp(e,t,r){this._lastX=void 0,this._lastY=void 0}setLastPosition(e,t){this._controller().draw(),this._lastX=e,this._lastY=t}}var u=Tool3D},38344:(e,t,r)=>{var n,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(l,{default:()=>d}),e.exports=(n=l,((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(n=s(t,l))||n.enumerable});return e})(i({},"__esModule",{value:!0}),n));var c=r(7340),u=r(62048);class OrbitOperation3D extends c.MovementOperation{constructor(e){super(e),this._accumulatedThetaDelta=0,this._accumulatedPhiDelta=0}camera(){return this.controller().camera()}canvas(){return this.controller().canvas()}focusPoint(){return this.controller().focusPoint()}_minPolarAngle(){return 0+Math.DEFAULT_TOLERANCE}_maxPolarAngle(){return Math.PI-Math.DEFAULT_TOLERANCE}_minAzimuthAngle(){return-1/0}_maxAzimuthAngle(){return 1/0}apply(e,t,r,n,i){const s=this.canvas(),o=r-e,a=n-t;this._orbitLeft(Math.TWO_PI*o/s.clientHeight),this._orbitUp(Math.TWO_PI*a/s.clientHeight),this._updateCamera()}_orbitLeft(e){this._accumulatedThetaDelta+=e}_orbitUp(e){this._accumulatedPhiDelta+=e}_updateCamera(){const e=this.camera(),t=this._calculateUpdatedPositionFor(e,this._accumulatedThetaDelta,this._accumulatedPhiDelta);e.position.copy(t),e.lookAt(this.focusPoint());this._accumulatedThetaDelta*=.6,this._accumulatedPhiDelta*=.6}_calculateUpdatedPositionFor(e,t,r){const n=e.position.toPoint(),i=this.focusPoint().toPoint(),s=n.subtract(i),o=(s.theta()+t).constrained(this._minAzimuthAngle(),this._maxAzimuthAngle()),a=(s.phi()+r).constrained(this._minPolarAngle(),this._maxPolarAngle());return u.Point.fromSpherical(s.rho(),o,a).add(i).toThreeJS()}}var d=OrbitOperation3D},35989:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(7340),p=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(31199));class PanOperation3D extends h.MovementOperation{constructor(e){super(e),this._panMomentum=new p.default.Vector3}camera(){return this.controller().camera()}canvas(){return this.controller().canvas()}focusPoint(){return this.controller().focusPoint()}apply(e,t,r,n,i){const s=this.canvas(),o=this.camera(),a=r-e,l=n-t,c=new p.default.Vector3;if(o.isPerspectiveCamera){const e=new p.default.Vector3,t=o.position;e.copy(t).sub(this.focusPoint());let r=e.length();r*=Math.tan(o.fov/2*Math.PI/180),c.add(this._panLeft(2*a*r/s.clientHeight,o.matrix)),c.add(this._panUp(2*l*r/s.clientHeight,o.matrix))}else o.isOrthographicCamera?(c.add(this._panLeft(a*(o.right-o.left)/o.zoom/s.clientWidth,o.matrix)),c.add(this._panUp(l*(o.top-o.bottom)/o.zoom/s.clientHeight,o.matrix))):console.warn("WARNING: PanOperation3D encountered an unknown camera type - pan disabled.");this._updateCamera(c)}_panLeft(e,t){const r=new p.default.Vector3;return r.setFromMatrixColumn(t,0),r.multiplyScalar(-e),r}_panUp(e,t){const r=new p.default.Vector3;return r.setFromMatrixColumn(t,1),r.multiplyScalar(e),r}_updateCamera(e){const t=this.camera(),r=this.focusPoint(),n=(new p.default.Vector3).addVectors(this._panMomentum,e);r.add(n),t.position.add(n),t.lookAt(r),this._panMomentum.copy(new p.default.Vector3(0,0,0))}}var m=PanOperation3D},64655:(e,t,r)=>{var n,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(l,{default:()=>u}),e.exports=(n=l,((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(n=s(t,l))||n.enumerable});return e})(i({},"__esModule",{value:!0}),n));var c=r(7340);class ZoomOperation3D extends c.ZoomOperation{camera(){return this.controller().camera()}focusPoint(){return this.controller().focusPoint()}apply(e,t,r){const n=this.camera(),i=this.focusPoint(),s=r-1;n.position.lerp(i,s)}}var u=ZoomOperation3D},83497:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>g}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=r(7340),m=d(r(11235)),f=d(r(79549));r(93743),r(6120),r(72427),r(31199);class Drawing3DEditor extends p.DrawingEditor{constructor(e,t=m.default){super(e,t)}drawing(){return this.project().drawing3D()}defaultTools(){return[new f.default(this.drawingController())]}zoomPalette(){}selectAll(){}}var g=Drawing3DEditor},25619:(e,t,r)=>{var n,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(l,{default:()=>u}),e.exports=(n=l,((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(n=s(t,l))||n.enumerable});return e})(i({},"__esModule",{value:!0}),n));var c=r(50988);var u=class Model3DRepository{static instance(){return this._instance||(this._instance=new this),this._instance}static setInstance(e){this._instance=e}_loadGeometryFromFile(e){throw new c.MissingOverride(this,"_loadGeometryFromFile")}models(){return this._models||(this._models=new Map),this._models}async _getModelAsync(e){if(!this.models().has(e)){const t=await this._loadGeometryFromFile(e);t&&this.models().set(e,t)}return this.models().get(e)}_getModelSync(e){if(!this.models().has(e)){const t=this._loadGeometryFromFile(e);t&&this.models().set(e,t)}return this.models().get(e)}getModel(e){throw new c.MissingOverride(this,"getModel")}}},45718:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>Selection3DExtensions}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(75035)),m=r(50988),f=d(r(31199));class Selection3DExtensions{_getSelectedMeshForComponent(e,t){const r=t.figureFor(e).selfHandle();return r?.selectedMesh()}_selectionGroup(){return this.__selectionGroup}_setSelectionGroup(e){this.__selectionGroup=e}_generateSelectionGroup(e){const t=new f.default.Group;return this.components().forEach((r=>{const n=this._getSelectedMeshForComponent(r,e);n&&t.add(n)})),t}activate3D(e,t){this._setSelectionGroup(this._generateSelectionGroup(t)),e.add(this._selectionGroup())}deactivate3D(e,t){e.remove(this._selectionGroup()),this._setSelectionGroup(void 0)}}(0,m.extend)(p.default,Selection3DExtensions)},93743:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(62048),p=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(31199));h.Locator.prototype.toThreeJS=function(){return new p.default.Vector3(this.x(),this.y(),this.z())};var m=h.Locator},6120:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(7340),p=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(80580));h.Project.prototype.drawing3D=function(){return new p.default(this)};var m=h.Project},72427:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(62048),p=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(59555));h.ShapeFromVertices.prototype.threeFigure=function(){return new p.default(this.shape3D())};var m=h.ShapeFromVertices},31199:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>g}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(28019)),p=r(20066),m=r(62048);var f,g=((f=h).BufferGeometry.prototype.computeBoundsTree=function(){p.computeBoundsTree.call(this,{maxDepth:80})},f.BufferGeometry.prototype.disposeBoundsTree=p.disposeBoundsTree,f.Mesh.prototype.raycast=p.acceleratedRaycast,f.Vector3.prototype.toPoint=function(){return(0,m.$P)(this.x,this.y,this.z)},f.Box3.prototype.toCube=function(){const e=this.min,t=(new h.Vector3).subVectors(this.min,this.max);return new m.Cube(e.x,e.y,e.z,Math.abs(t.x),Math.abs(t.y),Math.abs(t.z))},f)},37732:(e,t,r)=>{const n=r(3764),i=r(6054),s=r(56784),o=r(72546),a=r(30368),l=r(11263),c=r(59807),u=r(53466),d=r(36780),h=r(15839),p=r(89653),m=r(78922),f=r(17798),g=r(31590),y=r(21724),b=r(15451),v=r(97080),_=r(95984),x=r(61546),w=r(25683),R=r(6031),k=r(28793),j=r(92534),z=r(57701),q=r(19505),$=r(34214),Z=r(48676),X=r(77e3),Y=r(30175),ee=r(43478),te=r(6282);e.exports.ComponentFrom3DModel=n,e.exports.ComponentSelectionTool3D=i,e.exports.Composite3DFigure=s,e.exports.CompositeModel3DStrategy=o,e.exports.CompositeNavigationTool3D=a,e.exports.Drawable3D=l,e.exports.Drawing3D=c,e.exports.Drawing3DController=u,e.exports.Drawing3DEditor=d,e.exports.Handle3D=h,e.exports.LayerManager3D=p,e.exports.Locator=m,e.exports.Model3DRepository=f,e.exports.MoveViewportTool3D=g,e.exports.NullDrawable3D=y,e.exports.OrbitOperation3D=b,e.exports.PMREMGenerator=v,e.exports.PanOperation3D=_,e.exports.PhotorealisticDrawing3DController=x,e.exports.Project=w,e.exports.ProjectUpdateBatch=R,e.exports.RGBELoader=k,e.exports.RaycastablePlane=j,e.exports.Selection3DExtensions=z,e.exports.Shape3DFigure=q,e.exports.ShapeFromVertices=$,e.exports.ThreeGeometryFigure=Z,e.exports.ThreeMaterialLibrary=X,e.exports.Tool3D=Y,e.exports.ZoomOperation3D=ee,e.exports.three=te},18225:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>ye}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(31199));const{CubeReflectionMapping:p,CubeRefractionMapping:m,CubeUVReflectionMapping:f,LinearFilter:g,NoToneMapping:y,NoBlending:b,RGBAFormat:v,HalfFloatType:_,BackSide:x,LinearSRGBColorSpace:w,BufferAttribute:R,BufferGeometry:k,Mesh:j,OrthographicCamera:z,PerspectiveCamera:q,ShaderMaterial:$,Vector3:Z,Color:X,WebGLRenderTarget:Y,MeshBasicMaterial:ee,BoxGeometry:te}=h.default,re=[.125,.215,.35,.446,.526,.582],ne=20,ie=new z,se=new X;let oe=null,ae=0,le=0;const ce=(1+Math.sqrt(5))/2,ue=1/ce,de=[new Z(1,1,1),new Z(-1,1,1),new Z(1,1,-1),new Z(-1,1,-1),new Z(0,ce,ue),new Z(0,ce,-ue),new Z(ue,0,ce),new Z(-ue,0,ce),new Z(ce,ue,0),new Z(-ce,ue,0)];function he(e,t,r){const n=new Y(e,t,r);return n.texture.mapping=f,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function pe(e,t,r,n,i){e.viewport.set(t,r,n,i),e.scissor.set(t,r,n,i)}function me(){return new $({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:ge(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:b,depthTest:!1,depthWrite:!1})}function fe(){return new $({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:ge(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t",blending:b,depthTest:!1,depthWrite:!1})}function ge(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\n    // RM: Modified for LightningCAD: make -z up\n    vec3 getDirection(vec2 uv, float face) {\n      uv = 2.0 * uv - 1.0;\n      vec3 direction = vec3(uv, 1.0);\n      if (face == 0.0) {\n        direction = direction.zxy; // ( 1, -u, v ) pos x\n        direction.y *= -1.0;\n      } else if (face == 1.0) {\n        direction.x *= -1.0; // ( -u, v, 1 ) pos y\n      } else if (face == 2.0) {\n        direction = direction.xzy;\n        direction.xy *= -1.0; // ( -u, -1, v ) pos z\n      } else if (face == 3.0) {\n        direction = direction.zxy;\n        direction.x *= -1.0; // ( -1, u, v ) neg x\n      } else if (face == 4.0) {\n        direction *= -1.0; // ( -u, -v, -1 ) neg y\n      } else if (face == 5.0) {\n        direction = direction.xzy; // ( u, 1, v ) neg z\n      }\n      return direction;\n    }\n    // RM: End Modified for LightningCAD\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t"}var ye=class PMREMGenerator{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,r=.1,n=100){oe=this._renderer.getRenderTarget(),ae=this._renderer.getActiveCubeFace(),le=this._renderer.getActiveMipmapLevel(),this._setSize(256);const i=this._allocateTargets();return i.depthBuffer=!0,this._sceneToCubeUV(e,r,n,i),t>0&&this._blur(i,0,0,t),this._applyPMREM(i),this._cleanup(i),i}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=fe(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=me(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(oe,ae,le),e.scissorTest=!1,pe(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===p||e.mapping===m?this._setSize(0===e.image.length?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),oe=this._renderer.getRenderTarget(),ae=this._renderer.getActiveCubeFace(),le=this._renderer.getActiveMipmapLevel();const r=t||this._allocateTargets();return this._textureToCubeUV(e,r),this._applyPMREM(r),this._cleanup(r),r}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,r={magFilter:g,minFilter:g,generateMipmaps:!1,type:_,format:v,colorSpace:w,depthBuffer:!1},n=he(e,t,r);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=he(e,t,r);const{_lodMax:n}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=function(e){const t=[],r=[],n=[];let i=e;const s=e-4+1+re.length;for(let o=0;o<s;o++){const s=Math.pow(2,i);r.push(s);let a=1/s;o>e-4?a=re[o-e+4-1]:0===o&&(a=0),n.push(a);const l=1/(s-2),c=-l,u=1+l,d=[c,c,u,c,u,u,c,c,u,u,c,u],h=6,p=6,m=3,f=2,g=1,y=new Float32Array(m*p*h),b=new Float32Array(f*p*h),v=new Float32Array(g*p*h);for(let e=0;e<h;e++){const t=e%3*2/3-1,r=e>2?0:-1,n=[t,r,0,t+2/3,r,0,t+2/3,r+1,0,t,r,0,t+2/3,r+1,0,t,r+1,0];y.set(n,m*p*e),b.set(d,f*p*e);const i=[e,e,e,e,e,e];v.set(i,g*p*e)}const _=new k;_.setAttribute("position",new R(y,m)),_.setAttribute("uv",new R(b,f)),_.setAttribute("faceIndex",new R(v,g)),t.push(_),i>4&&i--}return{lodPlanes:t,sizeLods:r,sigmas:n}}(n)),this._blurMaterial=function(e,t,r){const n=new Float32Array(ne),i=new Z(0,1,0),s=new $({name:"SphericalGaussianBlur",defines:{n:ne,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/r,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:ge(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t",blending:b,depthTest:!1,depthWrite:!1});return s}(n,e,t)}return n}_compileMaterial(e){const t=new j(this._lodPlanes[0],e);this._renderer.compile(t,ie)}_sceneToCubeUV(e,t,r,n){const i=new q(90,1,t,r),s=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],a=this._renderer,l=a.autoClear,c=a.toneMapping;a.getClearColor(se),a.toneMapping=y,a.autoClear=!1;const u=new ee({name:"PMREM.Background",side:x,depthWrite:!1,depthTest:!1}),d=new j(new te,u);let h=!1;const p=e.background;p?p.isColor&&(u.color.copy(p),e.background=null,h=!0):(u.color.copy(se),h=!0);for(let t=0;t<6;t++){const r=t%3;0===r?(i.up.set(0,s[t],0),i.lookAt(o[t],0,0)):1===r?(i.up.set(0,0,s[t]),i.lookAt(0,o[t],0)):(i.up.set(0,s[t],0),i.lookAt(0,0,o[t]));const l=this._cubeSize;pe(n,r*l,t>2?l:0,l,l),a.setRenderTarget(n),h&&a.render(d,i),a.render(e,i)}d.geometry.dispose(),d.material.dispose(),a.toneMapping=c,a.autoClear=l,e.background=p}_textureToCubeUV(e,t){const r=this._renderer,n=e.mapping===p||e.mapping===m;n?(null===this._cubemapMaterial&&(this._cubemapMaterial=fe()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=me());const i=n?this._cubemapMaterial:this._equirectMaterial,s=new j(this._lodPlanes[0],i);i.uniforms.envMap.value=e;const o=this._cubeSize;pe(t,0,0,3*o,2*o),r.setRenderTarget(t),r.render(s,ie)}_applyPMREM(e){const t=this._renderer,r=t.autoClear;t.autoClear=!1;for(let t=1;t<this._lodPlanes.length;t++){const r=Math.sqrt(this._sigmas[t]*this._sigmas[t]-this._sigmas[t-1]*this._sigmas[t-1]),n=de[(t-1)%de.length];this._blur(e,t-1,t,r,n)}t.autoClear=r}_blur(e,t,r,n,i){const s=this._pingPongRenderTarget;this._halfBlur(e,s,t,r,n,"latitudinal",i),this._halfBlur(s,e,r,r,n,"longitudinal",i)}_halfBlur(e,t,r,n,i,s,o){const a=this._renderer,l=this._blurMaterial;"latitudinal"!==s&&"longitudinal"!==s&&console.error("blur direction must be either latitudinal or longitudinal!");const c=new j(this._lodPlanes[n],l),u=l.uniforms,d=this._sizeLods[r]-1,h=isFinite(i)?Math.PI/(2*d):2*Math.PI/39,p=i/h,m=isFinite(i)?1+Math.floor(3*p):ne;m>ne&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${m} samples when the maximum is set to 20`);const f=[];let g=0;for(let e=0;e<ne;++e){const t=e/p,r=Math.exp(-t*t/2);f.push(r),0===e?g+=r:e<m&&(g+=2*r)}for(let e=0;e<f.length;e++)f[e]=f[e]/g;u.envMap.value=e.texture,u.samples.value=m,u.weights.value=f,u.latitudinal.value="latitudinal"===s,o&&(u.poleAxis.value=o);const{_lodMax:y}=this;u.dTheta.value=h,u.mipInt.value=y-r;const b=this._sizeLods[n];pe(t,3*b*(n>y-4?n-y+4:0),4*(this._cubeSize-b),3*b,2*b),a.setRenderTarget(t),a.render(c,ie)}}},63902:(e,t,r)=>{var n,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(l,{default:()=>u}),e.exports=(n=l,((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(n=s(t,l))||n.enumerable});return e})(i({},"__esModule",{value:!0}),n));var c=r(28019);class RGBELoader extends c.DataTextureLoader{constructor(e){super(e),this.type=c.HalfFloatType}parse(e){const t=function(e,t){switch(e){case 1:throw new Error("THREE.RGBELoader: Read Error: "+(t||""));case 2:throw new Error("THREE.RGBELoader: Write Error: "+(t||""));case 3:throw new Error("THREE.RGBELoader: Bad File Format: "+(t||""));default:throw new Error("THREE.RGBELoader: Memory Error: "+(t||""))}},r=function(e,t,r){t=t||1024;let n=e.pos,i=-1,s=0,o="",a=String.fromCharCode.apply(null,new Uint16Array(e.subarray(n,n+128)));for(;0>(i=a.indexOf("\n"))&&s<t&&n<e.byteLength;)o+=a,s+=a.length,n+=128,a+=String.fromCharCode.apply(null,new Uint16Array(e.subarray(n,n+128)));return-1<i&&(!1!==r&&(e.pos+=s+i+1),o+a.slice(0,i))},RGBEByteToRGBFloat=function(e,t,r,n){const i=e[t+3],s=Math.pow(2,i-128)/255;r[n+0]=e[t+0]*s,r[n+1]=e[t+1]*s,r[n+2]=e[t+2]*s,r[n+3]=1},RGBEByteToRGBHalf=function(e,t,r,n){const i=e[t+3],s=Math.pow(2,i-128)/255;r[n+0]=c.DataUtils.toHalfFloat(Math.min(e[t+0]*s,65504)),r[n+1]=c.DataUtils.toHalfFloat(Math.min(e[t+1]*s,65504)),r[n+2]=c.DataUtils.toHalfFloat(Math.min(e[t+2]*s,65504)),r[n+3]=c.DataUtils.toHalfFloat(1)},n=new Uint8Array(e);n.pos=0;const i=function(e){const n=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,i=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,s=/^\s*FORMAT=(\S+)\s*$/,o=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,a={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};let l,c;for((e.pos>=e.byteLength||!(l=r(e)))&&t(1,"no header found"),(c=l.match(/^#\?(\S+)/))||t(3,"bad initial token"),a.valid|=1,a.programtype=c[1],a.string+=l+"\n";l=r(e),!1!==l;)if(a.string+=l+"\n","#"!==l.charAt(0)){if((c=l.match(n))&&(a.gamma=parseFloat(c[1])),(c=l.match(i))&&(a.exposure=parseFloat(c[1])),(c=l.match(s))&&(a.valid|=2,a.format=c[1]),(c=l.match(o))&&(a.valid|=4,a.height=parseInt(c[1],10),a.width=parseInt(c[2],10)),2&a.valid&&4&a.valid)break}else a.comments+=l+"\n";return 2&a.valid||t(3,"missing format specifier"),4&a.valid||t(3,"missing image size specifier"),a}(n),s=i.width,o=i.height,a=function(e,r,n){const i=r;if(i<8||i>32767||2!==e[0]||2!==e[1]||128&e[2])return new Uint8Array(e);i!==(e[2]<<8|e[3])&&t(3,"wrong scanline width");const s=new Uint8Array(4*r*n);s.length||t(4,"unable to allocate buffer space");let o=0,a=0;const l=4*i,c=new Uint8Array(4),u=new Uint8Array(l);let d=n;for(;d>0&&a<e.byteLength;){a+4>e.byteLength&&t(1),c[0]=e[a++],c[1]=e[a++],c[2]=e[a++],c[3]=e[a++],2==c[0]&&2==c[1]&&(c[2]<<8|c[3])==i||t(3,"bad rgbe scanline format");let r,n=0;for(;n<l&&a<e.byteLength;){r=e[a++];const i=r>128;if(i&&(r-=128),(0===r||n+r>l)&&t(3,"bad scanline data"),i){const t=e[a++];for(let e=0;e<r;e++)u[n++]=t}else u.set(e.subarray(a,a+r),n),n+=r,a+=r}const h=i;for(let e=0;e<h;e++){let t=0;s[o]=u[e+t],t+=i,s[o+1]=u[e+t],t+=i,s[o+2]=u[e+t],t+=i,s[o+3]=u[e+t],o+=4}d--}return s}(n.subarray(n.pos),s,o);let l,u,d;switch(this.type){case c.FloatType:d=a.length/4;const e=new Float32Array(4*d);for(let t=0;t<d;t++)RGBEByteToRGBFloat(a,4*t,e,4*t);l=e,u=c.FloatType;break;case c.HalfFloatType:d=a.length/4;const t=new Uint16Array(4*d);for(let e=0;e<d;e++)RGBEByteToRGBHalf(a,4*e,t,4*e);l=t,u=c.HalfFloatType;break;default:throw new Error("THREE.RGBELoader: Unsupported type: "+this.type)}return{width:s,height:o,data:l,header:i.string,gamma:i.gamma,exposure:i.exposure,type:u}}setDataType(e){return this.type=e,this}load(e,t,r,n){return super.load(e,(function(e,r){switch(e.type){case c.FloatType:case c.HalfFloatType:e.colorSpace=c.LinearSRGBColorSpace,e.minFilter=c.LinearFilter,e.magFilter=c.LinearFilter,e.generateMipmaps=!1,e.flipY=!0}t&&t(e,r)}),r,n)}}var u=RGBELoader},8398:(e,t,r)=>{var n=Object.create,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,c=(e,t,r)=>(r=null!=e?n(a(e)):{},((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let a of o(t))l.call(e,a)||a===r||i(e,a,{get:()=>t[a],enumerable:!(n=s(t,a))||n.enumerable});return e})(!t&&e&&e.__esModule?r:i(r,"default",{value:e,enumerable:!0}),e)),u=r(57075),d=c(r(14687)),h=c(r(28440)),p=c(r(73400)),m=c(r(40611));u.SmartObjectBuilder.configure((e=>{e.classes.addClasses(m.default,h.default,d.default,p.default)}))},2563:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(95099));var p=class ChromeCADExtensionController{constructor(e){this.setEventEmitter(e)}eventEmitter(){return this._eventEmitter}setEventEmitter(e){e?.setConnectCallback((()=>this._connectToChromeCAD())),this._eventEmitter=e}onLoad(e){this.__drawingController=e,this.eventEmitter()&&(this._versionedProject().addCurrentVersionChangedObserver(this.eventEmitter(),this.eventEmitter().onSnapshot),this.eventEmitter().onLoad())}onUnload(){this.eventEmitter()&&(this._versionedProject()?.removeCurrentVersionChangedObserver(this.eventEmitter(),this.eventEmitter().onSnapshot),this.eventEmitter().onUnload())}_connectToChromeCAD(){if(!this._drawingController()||!this.eventEmitter())return;const e={project:this._versionedProject(),drawingController:this._drawingController()};this.eventEmitter().emitEvent(new h.default(h.default.types.CONNECT,e))}_versionedProject(){return this._drawingController()?.project()}_drawingController(){return this.__drawingController}}},43468:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>k}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(63768)),m=r(62048),f=r(50988),g=d(r(1494)),y=d(r(87456)),b=d(r(94381)),v=d(r(56939)),_=d(r(20505)),x=d(r(69125)),w=d(r(61396)),R=d(r(89868));r(30818);class DrawingController{constructor(e,t,r){this._drawing=e,this._project=t,t&&this._observeProject(t),this._toolHolder=r}async deleteSelection(){this.selection().isEmpty()||(this.selection().delete(),this.clearSelection(),await this.snapshotProjectAndRedraw())}async undoLastChange(){this.project().canUndo()&&await this.project().undo()}async redoNextChange(){this.project().canRedo()&&await this.project().redo()}activate(){this._registerKeyboardShortcuts()}deactivate(){this._unregisterKeyboardShortcuts()}drawing(){return this._drawing||(this._drawing=this._defaultDrawing()),this._drawing}_defaultDrawing(){return this.project().drawing()}setDrawing(e){this.clearDrawing(),this._drawing=e,this._selectionFactory=void 0}canvas(){return this._canvas}setCanvas(e){this._canvas=e,this._pendingCursor&&(this.setCursor(this._pendingCursor),this._pendingCursor=void 0),this.setTranslation()}activeTool(){return this.toolHolder().value()}toolHolder(){return this._toolHolder||(this._toolHolder=new _.default(new y.default(this))),this._toolHolder}setTranslation(e,t){this._translateX=e,this._translateY=t}translateBy(e,t){this._translateX=this.translateX()+e,this._translateY=this.translateY()+t}translateX(){return void 0===this._translateX&&(this._translateX=this.defaultTranslateX()),this._translateX}translateY(){return void 0===this._translateY&&(this._translateY=this.defaultTranslateY()),this._translateY}defaultTranslateX(){let e=0;return this.drawing()&&this.canvas()&&(e=this.canvasCenter().x()-this._scaledDrawingCenterPoint().x()),e}defaultTranslateY(){let e=0;return this.drawing()&&this.canvas()&&(e=this.canvasCenter().y()-this._scaledDrawingCenterPoint().y()),e}canvasCenter(){return this.canvas()?(0,m.$P)(this.canvas().width/2,this.canvas().height/2):(0,m.$P)(0,0)}_scaledDrawingCenterPoint(){return this.drawing().centerPoint().multipliedBy(this.scale())}scale(){return this._scale||(this._scale=this.defaultScale()),this._scale}setScale(e){this._scale=e}defaultScale(){return 1}defaultRotationAngle(){return 0}rotationAngle(){return void 0===this._rotation&&(this._rotation=this.defaultRotationAngle()),this._rotation}setRotationAngle(e){this._rotation=e}setMagnification(e){this.setScale(e),this.draw()}browserCoordinatesToModelCoordinates(e){if(!this.canvas())return e;const t=(0,m.$P)((e.x()-this.translateX()-this._getCanvasAbsoluteOffsetLeft())/this.scale(),(e.y()-this.translateY()-this._getCanvasAbsoluteOffsetTop())/this.scale());return 0!==this.rotationAngle()&&t.rotateBy((0,m.$P)(0,0),-this.rotationAngle()),t}modelCoordinatesToBrowserCoordinates(e){if(!this.canvas())return e;let t=e;return 0!==this.rotationAngle()&&(t=e.rotatedBy((0,m.$P)(0,0),this.rotationAngle())),(0,m.$P)(t.x()*this.scale()+this.translateX()+this._getCanvasAbsoluteOffsetLeft(),t.y()*this.scale()+this.translateY()+this._getCanvasAbsoluteOffsetTop())}_getCanvasAbsoluteOffsetLeft(){return this.canvas().getBoundingClientRect().left}_getCanvasAbsoluteOffsetTop(){return this.canvas().getBoundingClientRect().top}project(){return this._project||this.setProject(this.defaultProject()),this._project}setProject(e){this._project&&this._unobserveProject(this._project),this._project=e,this._project&&(this._observeProject(this._project),this.clearDrawing(),this.clearSelection())}_observeProject(e){e.addCurrentVersionReplacedObserver(this,this._onVersionReplaced)}_unobserveProject(e){e.removeCurrentVersionReplacedObserver(this,this._onVersionReplaced)}clearDrawing(){this._drawing&&(this._drawing.dispose(),this._drawing=void 0,this._selectionFactory=void 0)}_onVersionReplaced(){this._drawing&&(this.drawing().setModel(this.project().current()),this.redraw()),this._tryToRestoreSelection()}defaultProject(){return new g.default}async snapshotProject(){await this.project().createSnapshot()}async addComponent(e){this.project().add(e),await this.snapshotProjectAndRedraw()}async removeComponent(e){this.project().remove(e),await this.snapshotProjectAndRedraw()}selection(){return this._selection||(this._selection=this.selectionFactory().createEmptySelection(),this._onSelectionCreated(this._selection)),this._selection}_onSelectionCreated(e){}_selectionWillChange(e,t){}_onSelectionChanged(){this.notifySelectionChangedObservers(),this._drawing&&this.redraw()}setSelection(e){this.selection()!==e&&(this._selectionWillChange(this.selection(),e),this._selection=e,this._onSelectionChanged())}selectionFactory(){return this._selectionFactory||(this._selectionFactory=this.defaultSelectionFactory()),this._selectionFactory}defaultSelectionFactory(){return new x.default(this.drawing())}select(...e){this.setSelection(this.selectionFactory().createSelectionForComponents(...e))}clearSelection(){this.setSelection(this.selectionFactory().createEmptySelection())}addToSelection(...e){0!==e.length&&this.setSelection(this.selection().add(...e))}removeFromSelection(e){this.setSelection(this.selection().remove(e))}_tryToRestoreSelection(){this.selection().replaceFrom(this.project().stableIdComponentLookup())?this._onSelectionChanged():this.clearSelection()}setSelectedComponent(e){e?this.select(e):this.clearSelection()}selectedComponent(){if(this.selection()&&this.selection().component)return this.selection().component()}draw(e){if(!this.canvas())return;const t=this.defaultContext();t&&t._alterAndRestoreAfter&&t._alterAndRestoreAfter((()=>{this._clearCanvas(t),t.translate(this.translateX(),this.translateY()),t.scale(this.scale(),this.scale()),t.rotate(this.rotationAngle()),t._requestRedraw=()=>this.scheduleRedraw(),this._draw(t,e)}))}scheduleRedraw(){this._scheduleRedrawAnimationFrameId||(this._scheduleRedrawAnimationFrameId=requestAnimationFrame((e=>{this._scheduleRedrawAnimationFrameId=void 0,this.draw(e)})))}_draw(e,t){const r={bounds:this._canvasBoundsInDrawingUnits(),layerManager:this.layerManager(),timestamp:t};this.drawing().draw(e,r),this.drawing().drawAnnotations(e,r),this._drawToolAnnotations(e,r),this._drawSelectedHandle(e,r),e._alterAndRestoreAfter((()=>{e.globalCompositeOperation="destination-over",this._drawBackground(e,r)}))}_clearCanvas(e){e.clearRect(0,0,this.canvas().width,this.canvas().height)}_drawToolAnnotations(e,t){const r=this.activeTool();r&&r.draw&&r.draw(e,t)}_drawSelectedHandle(e,t){this.selection().drawSelected(e,t)}_drawBackground(e,t){this.backgroundGridFigure().draw(e,t)}defaultContext(){return this.canvas().getContext("2d")}_canvasBoundsInDrawingUnits(){const e=this.canvas().getBoundingClientRect(),t=(0,m.$P)(e.left,e.top),r=(0,m.$P)(e.right,e.bottom),n=this.browserCoordinatesToModelCoordinates(t),i=this.browserCoordinatesToModelCoordinates(r);return n.toCorner(i)}updateFigures(){this.drawing().updateFigures()}setDefaultCursor(){this._canvas?this._canvas.style.cursor=this.defaultCursorStyle():this._pendingCursor=this.defaultCursorStyle()}defaultCursorStyle(){return"initial"}setCursor(e){this._canvas?this._canvas.style.cursor=e:this._pendingCursor=e}cursor(){return this._canvas?this._canvas.style.cursor||this.defaultCursorStyle():this._pendingCursor||this.defaultCursorStyle()}recordChange(){this.snapshotProjectAndRedraw()}recordIntermediateChange(){this.redraw()}redraw(){this.updateFigures(),this.draw()}async snapshotProjectAndRedraw(){this.redraw();const e=this.canvasUpdateDelay();if(e>0)return new Promise((t=>{setTimeout((async()=>{await this.snapshotProject(),t()}),e)}));await this.snapshotProject()}drawThis(e){const t=this.defaultContext();t._alterAndRestoreAfter((()=>{t.scale(this.scale(),this.scale()),e(t)}))}layerManager(){return this._layerManager||(this._layerManager=this.defaultLayerManager()),this._layerManager}setLayerManager(e){this._layerManager=e}defaultLayerManager(){return new R.default}shouldShowLayer(e){return this.layerManager().isVisible(e)}showLayer(e){this.layerManager().show(e)}hideLayer(e){this.layerManager().hide(e)}toggleLayer(e){this.layerManager().toggle(e)}handlesAt(e,t,r,n){const i=this.layerManager(),s=this.drawing().handlesAt(e,t,{scale:r,layerManager:i,validWhen:n});return s.fastMerge(this.drawing().annotationHandlesAt(e,t,{scale:r,layerManager:i,validWhen:n})),s}setBackgroundGridMeasurement(e){this._gridMeasurement=e,this._backgroundGrid=void 0,this._backgroundGridFigure=void 0}backgroundGridMeasurement(){return this._gridMeasurement||(this._gridMeasurement=this.defaultBackgroundGridMeasurement()),this._gridMeasurement}defaultBackgroundGridMeasurement(){return p.unit(12,"in")}defaultMajorGridLineSpacing(){return 1}backgroundGrid(){return this._backgroundGrid||(this._backgroundGrid=new b.default(this.backgroundGridMeasurement(),this.defaultMajorGridLineSpacing())),this._backgroundGrid}backgroundGridFigure(){return this._backgroundGridFigure||(this._backgroundGridFigure=this.backgroundGrid().defaultFigure()),this._backgroundGridFigure}defaultShortcutManager(){return new w.default}shortcutManager(){return this._shortcutManager||(this._shortcutManager=this.defaultShortcutManager()),this._shortcutManager}handleKeyboardEvent(e){this.shortcutManager().handleKeyboardEvent(e)}handledEvents(){return["touchstart","touchmove","touchend","touchcancel","mouseover","mouseleave","mousemove","mousedown","mouseup","wheel","contextmenu","dblclick"]}handleMouseEvent(e){if(e.stopPropagation(),e.preventDefault(),!this.canvas())throw new Error(DrawingController.ERROR_NO_CANVAS);if(this._shouldIgnoreInteraction(e))this._ignoreCurrentInteraction=!0;else if(this._ignoreCurrentInteraction)this._ignoreCurrentInteraction=!this._ignoredInteractionFinished(e);else if("touchstart"!==e.type&&"mousedown"!==e.type||!globalThis.document||(document.activeElement?.blur(),this.canvas().focus()),"wheel"===e.type){const t=e.deltaY;this.activeToolHandleEvent("mouseScroll",t)}else{const t=this._multiTouchEvent(e)?this._lookupMultiTouchEventHandlerFxn(e):this._lookupMouseEventHandlerFxn(e);if(!t)return;const r=this._getCoordinatesFromEvent(e);this._lastXY=this._browserCoordinatesToToolCoordinates(r);const n={buttons:e.buttons,button:e.button,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey,scale:this.scale(),rotation:this.rotationAngle(),event:e};this.activeToolHandleEvent(t,this.lastX(),this.lastY(),n)}}lastX(){return this._lastXY?this._lastXY.x():0}lastY(){return this._lastXY?this._lastXY.y():0}activeToolHandleEvent(e,...t){return this.activeTool()[e](...t)}_shouldIgnoreInteraction(e){return"mouseover"===e.type&&e.buttons>0}_ignoredInteractionFinished(e){return"mouseleave"===e.type||"mouseup"===e.type&&0===e.buttons}_lookupMouseEventHandlerFxn(e){let t;switch(e.type){case"mousedown":case"touchstart":t="mouseDown";break;case"mouseup":case"touchend":case"touchcancel":t="mouseUp";break;case"touchmove":t="mouseDrag";break;case"mousemove":t=e.buttons>0?"mouseDrag":"mouseMove";break;case"contextmenu":t="contextMenu";break;case"dblclick":t="doubleClick";break;default:t=void 0}return t}_lookupMultiTouchEventHandlerFxn(e){let t;switch(e.type){case"touchstart":t="multiTouchStart";break;case"touchmove":t="multiTouchMove";break;case"touchend":case"touchcancel":t="multiTouchEnd";break;default:t=void 0}return t}_multiTouchEvent(e){return e.changedTouches&&e.changedTouches.length>1||e.touches&&e.touches.length>1}_getCoordinatesFromEvent(e){let t=e.pageX,r=e.pageY;if(void 0===t&&void 0===r){const n=e.touches.length>0?e.touches:e.changedTouches;t=n[0].pageX,r=n[0].pageY}return(0,m.$P)(t,r)}_browserCoordinatesToToolCoordinates(e){return this.browserCoordinatesToModelCoordinates(e)}clipboard(){return this._clipboard||(this._clipboard=new v.default(this)),this._clipboard}handleCopySelection(e,t){this.clipboard().copy(this.selection())}async handlePasteSelection(e,t){this.clipboard().paste(this.lastX(),this.lastY(),this.project())&&await this.snapshotProject()}canvasUpdateDelay(){return this._canvasUpdateDelay||0}setCanvasUpdateDelay(e){this._canvasUpdateDelay=e}afterResize(){this.draw()}_keyboardShortcuts(){return{deleteSelection:[{keys:"delete"},{keys:"backspace"}],undoLastChange:[{keys:"cmd+z"},{keys:"ctrl+z"}],redoNextChange:[{keys:"shift+cmd+z"},{keys:"ctrl+y"}],handleCopySelection:[{keys:"ctrl+c"},{keys:"cmd+c"}],handlePasteSelection:[{keys:"ctrl+v"},{keys:"cmd+v"}]}}_registerKeyboardShortcuts(){this.shortcutManager().registerShortcuts(this._keyboardShortcuts(),this)}_unregisterKeyboardShortcuts(){this.shortcutManager().unregisterShortcuts(this._keyboardShortcuts(),this)}}(0,f.simpleObserver)(DrawingController,"selectionChanged"),DrawingController.ERROR_NO_CANVAS="You cannot use mouse tools without a canvas";var k=DrawingController},61396:(e,t,r)=>{var n,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(l,{default:()=>u}),e.exports=(n=l,((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(n=s(t,l))||n.enumerable});return e})(i({},"__esModule",{value:!0}),n));var c=r(8008);var u=class KeyboardShortcutManager{constructor(){this._shortcuts=new Map,this.notifyShortcutListenersSync=this.notifyShortcutListenersSync.bind(this),this.handleKeyboardEvent=this.handleKeyboardEvent.bind(this),this.unhandledRejectionHandler=this._defaultUnhandledRejectionHandler.bind(this)}get unhandledRejectionHandler(){return this._unhandledRejectionHandler}set unhandledRejectionHandler(e){this._unhandledRejectionHandler=e}get pendingPromiseHandler(){return this._pendingPromiseHandler}set pendingPromiseHandler(e){this._pendingPromiseHandler=e}handleKeyboardEvent(e){const t=e.type;if(this._hotkeyHandler&&this._hotkeyHandler[t])return this._hotkeyHandler[t](e)}notifyShortcutListenersSync(e,t){e.stopImmediatePropagation();const r=this.notifyShortcutListeners(e,t);return this.pendingPromiseHandler&&this.pendingPromiseHandler(r),!1}async notifyShortcutListeners(e,t){if(!this._shortcuts.has(t.shortcut))return;const r=this._shortcuts.get(t.shortcut);for(let n=r.length-1;n>-1;n--)if(!1===await this.notifyShortcutListener(r[n],e,t))return}async notifyShortcutListener(e,t,r){const{listener:n,callbackFunctionName:i}=e;try{return await n[i](t,r)}catch(e){this.unhandledRejectionHandler(t,r,e)}}registerShortcuts(e,t){Object.entries(e).forEach((([e,r])=>{r.forEach((r=>{this.registerShortcut(r.keys,t,e,r.options)}))}))}registerShortcut(e,t,r,n={}){this.hasShortcutRegistered(e)||(this._shortcuts.set(e,[]),this.hotkeyLibrary()(e,{element:this._eventTargetAdapter,...n},this.notifyShortcutListenersSync)),this._shortcuts.get(e).push({listener:t,callbackFunctionName:r})}hasShortcutRegistered(e){return this._shortcuts.has(e)}unregisterShortcuts(e,t){Object.entries(e).forEach((([e,r])=>{r.forEach((r=>{this.unregisterShortcut(r.keys,t,e)}))}))}unregisterShortcut(e,t,r){if(!this.hasShortcutRegistered(e))return;const n=this._shortcuts.get(e).filter((e=>e.listener!==t||e.callbackFunctionName!==r));n.length>0?this._shortcuts.set(e,n):(this._shortcuts.delete(e),this.hotkeyLibrary().unbind(e,this.notifyShortcutListenersSync))}_defaultUnhandledRejectionHandler(e,t,r){console.error(r)}unregisterAll(){this.hotkeyLibrary().unbind(),this._shortcuts=new Map}hotkeyLibrary(){return this._hotkeyLibrary||(this._hotkeyLibrary=(0,c.loadHotkeysLibrary)(),this._hotkeyHandler={},this._eventTargetAdapter={addEventListener:(e,t)=>{this._hotkeyHandler[e]=t},removeEventListener:(e,t)=>{this._hotkeyHandler[e]===t&&(this._hotkeyHandler[e]=void 0)}}),this._hotkeyLibrary}}},89868:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>a}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));var a=class LayerManager{constructor(e){this._layers=e}layers(){return this._layers||(this._layers={Annotations:!0}),this._layers}setLayers(e){this._layers=e}layerNames(){return Object.keys(this.layers())}isVisible(e){const t=this.layers()[e];return void 0===t||t}toggle(e){this.layers()[e]=!this.layers()[e]}show(e){this.layers()[e]=!0}hide(e){this.layers()[e]=!1}}},42820:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(50988),p=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(80993));class CompositeEditableProperty extends p.default{static overlappingProperties(e){const t=e.flatMap((e=>[...e?.displayProperties?.()??[]])).filter((e=>e.editable())),r=[],n=[];return t.forEach((i=>{if(r.includes(i))return;const s=t.filter((e=>e.isCompatibleWith(i)));r.fastMerge(s),s.length===e.length&&n.push(new this(i.name(),i.type(),s))})),n}constructor(e,t,r){super(e,t),this._editableProperties=r,this._editableProperties.forEach((e=>{e.addExternalChangeObserver(this,this.update)}))}editableProperties(){return this._editableProperties}displayProperties(){return this.editableProperties()}editable(){return!0}shouldRecordChange(){return this.editableProperties().some((e=>e.shouldRecordChange()))}multipleValuesSelected(){return this.uniqueValues().length>1}uniqueValues(){return this.editableProperties().map((e=>e.get())).uniqueValues()}_defaultLabel(){const e=this.editableProperties(),t=e.first().label();return e.every((e=>e.label()===t))?t:super._defaultLabel()}disabled(){return this.editableProperties().some((e=>e.disabled()))}get(){const e=this.uniqueValues();return 1===e.length?e.first():""}set(...e){this.editableProperties().map((t=>t.set(...e)))}toggle(){let e=Boolean(this.get());this.multipleValuesSelected()&&(e=!1),this.editableProperties().filter((t=>t.get()===e)).map((e=>e.toggle()))}format(){const e=this.editableProperties().map((e=>e.format())).uniqueValues();return 1===e.length?e.first():""}visible(){return this.editableProperties().every((e=>e.visible()))}parse(e){const t=this.editableProperties().map((t=>t.parse(e))).uniqueValues();return t.length>1?e:t.first()}validate(e,t){const r=this.editableProperties().map((r=>r.validate(e,t))),n=[...new Set(r.filter((e=>e)))];if(0!==n.length)return n.join(", ")}options(){return this._options||(this._options=this._defaultOptions()),this._options}_defaultOptions(){const e=this.editableProperties().map((e=>e.options())),t={};return e.forEach((r=>{Object.entries(r).forEach((([r,n])=>{if(void 0!==t[r])return;if(e.every((e=>(0,h.isDeepEqual)(e[r],n))))t[r]=n;else if(Array.isArray(n)){const n=this._findArrayIntersection(e.map((e=>e[r])));t[r]=n}}))})),t}_findArrayIntersection(e){const t=e.length,r=e.flat(),n=[];return r.forEach((e=>{if(n.some((t=>(0,h.isDeepEqual)(t,e))))return;r.sum((t=>(0,h.isDeepEqual)(t,e)?1:0))===t&&n.push(e)})),n}}var m=CompositeEditableProperty},95716:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(31889));class CompositePropertiesCollection extends h.default{constructor(e,t){super(e),this._collections=t}collections(){return this._collections}displayProperties(){return this.collections().flatMap((e=>[...e]))}append(e){this._collections.push(e),this.isObserving()&&this._startObservingCollection(e)}isObserving(){return this._isObserving??=!1}startObserving(){this.isObserving()||(this._isObserving=!0,this.collections().forEach(this._startObservingCollection.bind(this)))}_startObservingCollection(e){e.addPropertiesChangedObserver?.(this,this.propertiesChanged),e.startObserving?.()}stopObserving(){this._isObserving=!1,this.collections().forEach((e=>{e.removePropertiesChangedObserver?.(this,this.propertiesChanged),e.stopObserving?.()}))}propertiesChanged(){super.propertiesChanged(),this.model().notifyDisplayPropertiesChangedObservers(!0)}}var p=CompositePropertiesCollection},80993:(e,t,r)=>{var n,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(l,{default:()=>u}),e.exports=(n=l,((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(n=s(t,l))||n.enumerable});return e})(i({},"__esModule",{value:!0}),n));var c=r(50988);class DisplayProperty{constructor(e,t){this._name=e,this._type=t}editable(){throw new c.MissingOverride(this,"editable")}options(){throw new c.MissingOverride(this,"options")}get(){throw new c.MissingOverride(this,"get")}multipleValuesSelected(){return!1}name(){return this._name}type(){return this._type}label(){return this._label||(this._label=this._defaultLabel()),this._label}_defaultLabel(){return this.name()}namespace(e){return this._label=`${e} ${this.label()}`,this}key(){return[...this.label().split(" "),...this.name().split(" ")].join("-").toLowerCase()}update(){this.notifyExternalChangeObservers()}isCompatibleWith(e){if(!(this.name()===e.name()&&this.type()===e.type()&&this.label()===e.label()&&this.editable()===e.editable()))return!1;const t=this.options(),r=e.options();return[...new Set([...Object.keys(t),...Object.keys(r)])].every((e=>Array.isArray(t[e])?Array.isArray(r[e])&&t[e].some((t=>r[e].some((e=>(0,c.isDeepEqual)(t,e))))):!Array.isArray(r[e])))}visible(){return!0}toString(){return`<${this.constructor.name} '${this.name()}'>`}}(0,c.simpleObserver)(DisplayProperty,"externalChange");var u=DisplayProperty},98745:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(56913));class EditableProperty extends h.default{constructor(e,t,{disabled:r,shouldRecordChange:n,set:i,parse:s,toggle:o,validate:a,...l}={}){super(e,t,l),this._disabled=r,this._shouldRecordChange=n,i&&(this.set=i),o&&(this.toggle=o),a&&(this.validate=a),s&&(this.parse=s);const c=this.name().split(" ");this._setterName=`set${c.join("")}`,this._togglerName=`toggle${c.join("")}`,this._validatorName=`validate${c.join("")}`,this._parserName=`parse${c.join("")}`}editable(){return!0}disabled(){return this._disabled}shouldRecordChange(){return this._shouldRecordChange??!0}set(...e){this.component()[this._setterName](...e)}toggle(){this.component()[this._togglerName]()}validate(e,t){if(this.component()[this._validatorName])return this.component()[this._validatorName](e,t)}parse(e){return this.component()[this._parserName]?this.component()[this._parserName](e):e}}var p=EditableProperty},14687:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>f}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(62048),p=r(50988),m=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(11737));class FreeFloatingDimensionAnnotation extends h.DimensionAnnotation{constructor(e,t,r=(0,h.$P)(0,0)){super(e,0,t),this._referencePoint=new h.RelativeLocator(r),e&&(this._edge=new h.Edge(h.RelativeLocator.makeRelativeTo(e.begin(),this._referencePoint),h.RelativeLocator.makeRelativeTo(e.end(),this._referencePoint))),this.setSignificantDecimalPlaces(2)}referencePoint(){return this._referencePoint}makeRelativeTo(e){this.referencePoint().source()!==e&&this.referencePoint().setSource(e)}clone(e=(0,h.$P)(0,0)){return new this.constructor(this.edge(),this.unit(),e)}boundingShape(e=1){const t=7/e,r=t+1,n=-t-1;return new h.Polygon([new h.NormalToEdgeLocator(this.edgeBegin(),r),new h.NormalToEdgeLocator(this.edgeEnd(),r),new h.NormalToEdgeLocator(this.edgeEnd(),n),new h.NormalToEdgeLocator(this.edgeBegin(),n)])}zLevel(){return 1}defaultFigure(){return new m.default(this)}begin(){return this.edgeBegin()}moveableBegin(){return this.edge().begin()}moveBeginTo(e){const t=this.moveableBegin();return t.moveBy(e.x()-t.x(),e.y()-t.y())}end(){return this.edgeEnd()}moveEndTo(e){const t=this.moveableEnd();return t.moveBy(e.x()-t.x(),e.y()-t.y())}moveableEnd(){return this.edge().end()}moveBy(e,t){return this.edge().moveBy(e,t)}contains(e,t){return this.edge().contains(e,t)}toString(){return`${this.constructor.name} (${this.begin().to2DString()}->${this.end().to2DString()})`}}(0,p.extend)(FreeFloatingDimensionAnnotation,h.Component);var f=FreeFloatingDimensionAnnotation},28440:(e,t,r)=>{var n,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(l,{default:()=>d}),e.exports=(n=l,((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(n=s(t,l))||n.enumerable});return e})(i({},"__esModule",{value:!0}),n));var c=r(62048),u=r(50988);class GeometricComponent extends c.Component{boundingCube(){return this.boundingBox().extrudedFromTo(-this.height(),this.baseZ())}baseZ(){return 0}height(){return 12}center(){return this.boundingBox().center()}shape(){return this.geometry()}geometry(){throw new u.MissingOverride(this,"geometry")}boundingBox(){return this.geometry().boundingBox()}boundingShape(){return this.geometry()}xLevel(){return 1e3}yLevel(){return 1e3}zLevel(){return 1e3}containsPoint(e){return this.contains(e.x(),e.y())}contains(e,t){return this.geometry().contains(e,t)}moveBy(e,t,r){return this.geometry().moveBy(e,t,r)}annotations(){return this._annotations||(this._annotations=this.defaultAnnotations()),this._annotations}defaultAnnotations(){return[]}annotationsXZ(){return this._annotationsXZ||(this._annotationsXZ=this.defaultAnnotationsXZ()),this._annotationsXZ}defaultAnnotationsXZ(){return[]}annotationsYZ(){return this._annotationsYZ||(this._annotationsYZ=this.defaultAnnotationsYZ()),this._annotationsYZ}defaultAnnotationsYZ(){return[]}nonEssentialProperties(){return["_annotations","_annotationsXZ","_annotationsYZ"]}}var d=GeometricComponent},73400:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(62048),p=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(47468));class ImageComponent extends h.Component{constructor(e,t,r,n=(0,h.$P)(0,0),i=(0,h.$P)(0,0),s,o,a){super(),this._url=e,this._width=t,this._height=r,this._angle=s,this._opacity=o,this._placeholderUrl=a,this._referencePoint=new h.RelativeLocator(i),this.setLocation(n)}url(){return this._url}setUrl(e){this._url=e}placeholderUrl(){return this._placeholderUrl}setPlaceholderUrl(e){this._placeholderUrl=e}width(){return this._width}setWidth(e){this._width=e}height(){return this._height}setHeight(e){this._height=e}shapeUpdated(){this._location=h.RelativeLocator.makeRelativeTo(this.boundingBox().center(),this.referencePoint());const e=this.boundingShape().rotatedBy(this.location(),-this.angle()).boundingBox();this._width=e.width(),this._height=e.height()}location(){return this._location}setLocation(e){this._location=h.RelativeLocator.makeRelativeTo(e,this._referencePoint)}referencePoint(){return this._referencePoint}makeRelativeTo(e){this.referencePoint().source()!==e&&this.referencePoint().setSource(e)}opacity(){return void 0===this._opacity&&(this._opacity=1),this._opacity}setOpacity(e){this._opacity=e}angle(){return void 0===this._angle&&(this._angle=0),this._angle}setAngle(e,t=this.location()){const r=e-this.angle();this._angle=e,this.boundingShape().rotateBy(t,r)}clone(e=(0,h.$P)(0,0)){return new this.constructor(this.url(),this.width(),this.height(),this.location(),e,this.angle(),this.opacity(),this.placeholderUrl())}boundingBox(){return this.boundingShape().boundingBox()}discardCachedGeometries(){this._boundingShape=void 0}boundingShape(){return this._boundingShape||(this._boundingShape=h.Polygon.rectangle(this.location(),this.width(),this.height()).rotatedBy(this.location(),this.angle()).relatedTo(this.referencePoint())),this._boundingShape}moveBy(e,t){return this.referencePoint().moveBy(e,t)}defaultFigure(){return new p.default(this)}zLevel(){return 1e3}toString(){const e=this.url().split("/").pop();return`${this.constructor.name} (showing ${e} at ${this.location().to2DString()})`}nonEssentialProperties(){return["_boundingShape"]}}var m=ImageComponent},36122:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(73400));class ImageComponentBuilder{constructor(e){this._url=e}size(e,t){return this._width=e,this._height=t,this}width(e){return this._width=e,this}height(e){return this._height=e,this}centerLocation(e){return this._location=e,this}referencePoint(e){return this._referencePoint=e,this}angle(e){return this._angle=e,this}opacity(e){return this._opacity=e,this}placeholderUrl(e){return this._placeholderUrl=e,this}_requiredProperties(){return["url","width","height"]}_checkValid(){const e=this._requiredProperties().filter((e=>void 0===this[`_${e}`]));if(e.length>0)throw new Error(`Missing required properties: ${e.join(", ")}`)}build(){return this._checkValid(),new h.default(this._url,this._width,this._height,this._location,this._referencePoint,this._angle,this._opacity,this._placeholderUrl)}}h.default.builder=function(e){return new ImageComponentBuilder(e)};var p=ImageComponentBuilder},71090:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>a}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));var a=class MetadataManager{constructor(e={}){this._metadata=e}metadata(){return this._metadata}setMetadata(e){this._metadata=e}setProperty(e,t){this.metadata()[e]=t}}},62204:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>f}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(42820)),m=d(r(31889));class OverlappingPropertiesCollection extends m.default{constructor(e,t=void 0){super(),this._models=e,this._inclusionFlag=t}models(){return this._models}inclusionFlag(){return this._inclusionFlag}observableModels(){return this.models()}displayProperties(){return p.default.overlappingProperties(this.models()).filter((e=>!this.inclusionFlag()||e.options()[this.inclusionFlag()]))}}var f=OverlappingPropertiesCollection},40611:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(62048),p=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(79482));class Project extends h.Composite{constructor(e){super(),this._referencePoint=e||(0,h.$P)(0,0)}referencePoint(){return this._referencePoint}toString(){return this.components().map((e=>e.toString()))}moveBy(e,t){return this.referencePoint().moveBy(e,t)}drawing(){return new p.default(this)}snapPoint(){return this.referencePoint()}project(){return this}get metadata(){return this.metadataManager()?.metadata()??{}}metadataManager(){return this._metadataManager}setMetadataManager(e){this._metadataManager=e}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_metadataManager"]}}var m=Project},31889:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(50988),p=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(19140));class PropertiesCollection{constructor(e,t){this._model=e,this._displayProperties=t}}(0,h.extend)(PropertiesCollection,p.default),PropertiesCollection.prototype[Symbol.iterator]=p.default.prototype[Symbol.iterator];var m=PropertiesCollection},19140:(e,t,r)=>{var n,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(l,{default:()=>u}),e.exports=(n=l,((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(n=s(t,l))||n.enumerable});return e})(i({},"__esModule",{value:!0}),n));var c=r(50988);class PropertiesCollectionMixin{*[Symbol.iterator](){for(let e=0;e<this.visibleProperties().length;e++)yield this.visibleProperties()[e]}model(){return this._model}displayProperties(){return this._displayProperties??=[]}visibleProperties(){return this.displayProperties().filter((e=>e.visible()))}map(e){return this.visibleProperties().map(e)}filter(e){return this.visibleProperties().filter(e)}forEach(e){this.visibleProperties().forEach(e)}find(e){return this.visibleProperties().find(e)}includes(e){return this.visibleProperties().includes(e)}observableModels(){return[this.model()]}startObserving(){this._isObserving||(this._isObserving=!0,this.observableModels().forEach((e=>{e.addDisplayPropertiesChangedObserver(this,this.propertiesChanged)})))}stopObserving(){this._isObserving=!1,this.observableModels().forEach((e=>{e.removeDisplayPropertiesChangedObserver(this,this.propertiesChanged)}))}propertiesChanged(e){e||this.notifyPropertiesChangedObservers()}}(0,c.simpleObserver)(PropertiesCollectionMixin,"propertiesChanged");var u=PropertiesCollectionMixin},56913:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(80993));class ReadableProperty extends h.default{constructor(e,t,{type:r,label:n,get:i,format:s,visible:o,...a}={}){super(t,r),this._component=e,this._label=n,i&&(this.get=i),s&&(this.format=s),o&&(this.visible=o);const l=t.split(" ");this._getterName=`${l.first().toLowerCase()}${l.slice(1).join("")}`,this._formatterName=`format${l.join("")}`,this._visibleName=`show${l.join("")}Property`,this._options=a}component(){return this._component}editable(){return!1}options(){return this._options}get(){const e=this.component()[this._getterName]();return"boolean"===this.type()?Boolean(e):e}format(){return this.component()[this._formatterName]?this.component()[this._formatterName]():this.get().toString()}visible(){return!this.component()[this._visibleName]||this.component()[this._visibleName]()}}var p=ReadableProperty},1494:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>y}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=r(50988),m=d(r(71090)),f=d(r(40611)),g=d(r(74589));class VersionedProject{constructor(e=new f.default,{id:t,...r}={}){return this._current=e,this._externalId=t,this._metadataManager=new m.default(r),this._ensureCurrentHasMetadata(),(0,p.delegateMissingTo)(this,"current")}versionManager(){return this._versionManager||(this._versionManager=new g.default(this)),this._versionManager}setVersionManager(e){this._versionManager=e}metadataManager(){return this._metadataManager}externalId(){return this._externalId}setExternalId(e){this._externalId=e}_ensureCurrentHasMetadata(){this.current().setMetadataManager(this.metadataManager())}current(){if(!this._current){const e=new f.default;e.setMetadataManager(this.metadataManager()),this._current=e}return this._current}setCurrent(e){this._current=e,this._ensureCurrentHasMetadata()}undo(){return this.versionManager().undo()}redo(){return this.versionManager().redo()}canRedo(){return this.versionManager().canRedo()}canUndo(){return this.versionManager().canUndo()}createSnapshot(){return this.versionManager().createSnapshot()}updateLatestSnapshot(){return this.versionManager().updateLatestSnapshot()}clearSnapshots(){return this.versionManager().clearSnapshots()}}(0,p.simpleObserver)(VersionedProject,"currentVersionChanged"),(0,p.simpleObserver)(VersionedProject,"currentVersionReplaced");var y=VersionedProject},74589:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(57075),p=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(43269));class CountLimitedMemoryVersioningStrategy extends p.default{constructor(e){super(e),this._undoVersionLimit=8}current(){return this.versionedProject().current()}undoRedoInProgress(){return this._undoRedoInProgress}async undo(){this._undoRedoInProgress=!0,this.redoVersions().push(this.undoVersions().pop()),await this._restoreSnapshot(this.undoVersions().last()),this._undoRedoInProgress=!1}async redo(){this._undoRedoInProgress=!0,this.undoVersions().push(this.redoVersions().pop()),await this._restoreSnapshot(this.undoVersions().last()),this._undoRedoInProgress=!1}async _restoreSnapshot(e){if(void 0===e)throw new Error("No snapshot to restore");this.versionedProject().setCurrent(await this.objectBuilder().parse(e)),await Promise.all([this.versionedProject().notifyCurrentVersionChangedObservers(e),this.versionedProject().notifyCurrentVersionReplacedObservers()])}canRedo(){return this.redoVersions().length>0}canUndo(){return this.undoVersions().length>1}undoVersions(){return this._undoVersions||(this._undoVersions=[]),this._undoVersions}redoVersions(){return this._redoVersions||(this._redoVersions=[]),this._redoVersions}async createSnapshot(){if(this.undoRedoInProgress())return void console.error(new Error("#createSnapshot called during an undo/redo operation - early exiting"));const{json:e}=await this.jsonBuilder().stringify(this.current());return this.undoVersions().push(e),this.limitVersions(),this._redoVersions=void 0,await this.versionedProject().notifyCurrentVersionChangedObservers(e),e}async updateLatestSnapshot(){if(this.undoRedoInProgress())return void console.error(new Error("#updateLatestSnapshot called during an undo/redo operation - early exiting"));const{json:e}=await this.jsonBuilder().stringify(this.current()),t=this.undoVersions().length-1;return this.undoVersions().splice(t,1,e),await this.versionedProject().notifyCurrentVersionChangedObservers(e),e}clearSnapshots(){const e=this.undoVersions().pop();this._undoVersions=[e],this._redoVersions=[]}limitVersions(){this.undoVersions().length>this.undoVersionLimit&&this.undoVersions().shift()}get undoVersionLimit(){return this._undoVersionLimit}set undoVersionLimit(e){this._undoVersionLimit=e}jsonBuilder(){return this._jsonBuilder||(this._jsonBuilder=new h.SmartJsonBuilder),this._jsonBuilder}objectBuilder(){return this._objectBuilder||(this._objectBuilder=new h.SmartObjectBuilder),this._objectBuilder}}var m=CountLimitedMemoryVersioningStrategy},43269:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>a}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));var a=class VersioningStrategy{constructor(e){this._versionedProject=e,e&&(this._firstSnapshotCompletePromise=this.createSnapshot())}async isReady(){return this._firstSnapshotCompletePromise}versionedProject(){return this._versionedProject}undo(){}canUndo(){}redo(){}canRedo(){}createSnapshot(){}updateLatestSnapshot(){}clearSnapshots(){}}},72818:(e,t,r)=>{var n,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(l,{default:()=>u}),e.exports=(n=l,((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(n=s(t,l))||n.enumerable});return e})(i({},"__esModule",{value:!0}),n));var c=r(50988);class DisplayProperties{static nonEssentialProperties(){return["_displayProperties","_displayPropertiesChangedObservers"]}resetDisplayProperties(){const e=this._displayProperties;this._displayProperties=void 0,this.notifyDisplayPropertiesChangedObservers(),e?.stopObserving?.()}displayProperties(){return this._displayProperties||(this._displayProperties=this.defaultDisplayProperties(),this._displayProperties.startObserving?.()),this._displayProperties}defaultDisplayProperties(){return[]}restorableProperties(){return this.displayProperties().filter((e=>{const t=!1!==e.options().restorable,r=e.component?.()===this||e.model?.()===this,n="action"!==e.type();return t&&r&&n}))}applyRestorablePropertiesFromObject(e){if(!e)return;const t=this.restorableProperties();e.restorableProperties().forEach((e=>{const r=t.find((t=>t.name()===e.name()));if(!r)return;if("boolean"!==r.type())return void r.set(e.get());r.get()!==e.get()&&r.toggle()}))}}(0,c.simpleObserver)(DisplayProperties,"displayPropertiesChanged");var u=DisplayProperties},92403:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(92472));var p=class StableID{stableID(){return this._stableID||(this._stableID=(0,h.default)()),this._stableID}beforeSerialize(){this.stableID()}}},66393:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(40022));class ImperialDecimalLengthFormatter extends h.default{constructor(e=Math.SIGNIFICANT_DECIMAL_PLACES,t=!0,r){super(t,r),this._decimalPlaces=e}decimalPlaces(){return this._decimalPlaces}inchesString(e){return`${e.roundedTo(this.decimalPlaces())}${this.inchSymbol()}`}}var p=ImperialDecimalLengthFormatter},48196:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>g}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(63768)),m=r(27281),f=d(r(40022));class ImperialFractionLengthFormatter extends f.default{constructor(e=16,t=!0,r){super(t,r),this._fractionDenominator=e}fractionDenominator(){return this._fractionDenominator}absoluteUnits(e){return Math.abs((0,m.roundToFraction)(e,this.fractionDenominator()))}inchesString(e){const t=Math.trunc(e),r=p.fraction(e-t),n=[];0!==t&&n.push(t),0!==r.n&&n.push(`${r.n}/${r.d}`);return`${n.join(" ")}${this.inchSymbol()}`}}var g=ImperialFractionLengthFormatter},40022:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(52597));class ImperialLengthFormatter extends h.default{constructor(e=!0,{inchSymbol:t='"',footSymbol:r="'",feetInchesSeparator:n="",crossoverUnit:i}={}){super(),this._formatWithFeet=e,this._inchSymbol=t,this._footSymbol=r,this._feetInchesSeparator=n,this._crossoverUnit=i}baseUnit(){return"in"}formatWithFeet(){return this._formatWithFeet}_formatValue(e){const t=this.shouldFormatWithFeet(e)?Math.trunc(e/12):0,r=this.shouldFormatWithFeet(e)?e%12:e,n=[],i=e=>{e&&n.push(e)};return 0!==t&&i(this.feetString(t)),0!==t&&0!==r&&i(this.feetInchesSeparator()),0!==r&&i(this.inchesString(r)),n.join(" ")}_overCrossoverPoint(e){return e>this.crossoverUnit().toNumeric(this.baseUnit())}shouldFormatWithFeet(e){return!!this.formatWithFeet()&&(!this.crossoverUnit()||this._overCrossoverPoint(e))}crossoverUnit(){return this._crossoverUnit}feetString(e){return`${e}${this.footSymbol()}`}feetInchesSeparator(){return this._feetInchesSeparator}inchesString(e){return`${e}${this.inchSymbol()}`}zeroLengthString(){return`0${this.inchSymbol()}`}inchSymbol(){return this._inchSymbol}footSymbol(){return this._footSymbol}}var p=ImperialLengthFormatter},52597:(e,t,r)=>{var n,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(l,{default:()=>u}),e.exports=(n=l,((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(n=s(t,l))||n.enumerable});return e})(i({},"__esModule",{value:!0}),n));r(62048);var c=r(50988);var u=class LengthFormatter{absoluteUnits(e){return Math.abs(e)}signString(e){return e>=0?"":"-"}baseUnit(){throw new c.MissingOverride(this,"baseUnit")}zeroLengthString(){return`0 ${this.baseUnit()}`}_formatValue(){throw new c.MissingOverride(this,"_formatValue")}format(e){if(void 0===e)return this.zeroLengthString();const t=e.toNumeric(this.baseUnit()).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES),r=this.signString(t),n=this.absoluteUnits(t),i=this._formatValue(n);return 0===i.length?this.zeroLengthString():`${r}${i}`}}},67166:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>g}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=r(62048),m=d(r(9304)),f=d(r(44224));class AngleAnnotationFigure extends f.default{constructor(e){super(),this._model=e,this._setScale(1)}annotation(){return this.model()}snapPoint(){return this.annotation().vertex()}boundingBox(){return this._boundingTriangle().boundingBox()}defaultProperties(){return{_pixelLineWidth:1,strokeStyle:"#111111",fillStyle:"#111111"}}contains(e,t){return this.annotation().contains(e,t,this._pixelsToDrawingUnits(10))}moveBy(e,t){return this.annotation().moveBy(e,t)}handles(){return[new m.default(this)]}_draw(e){this._setScaleFromContext(e),this.drawArc(e),this._drawBrackets(e),this._drawArrowHeads(e),this._drawLabel(e)}bracket1(){return new p.Edge(new p.FixedEdgeLocator(this._ray1(),this._distance()-this._bracketLength()),new p.FixedEdgeLocator(this._ray1(),this._distance()+this._bracketLength()))}bracket2(){return new p.Edge(new p.FixedEdgeLocator(this._ray2(),this._distance()-this._bracketLength()),new p.FixedEdgeLocator(this._ray2(),this._distance()+this._bracketLength()))}_drawBrackets(e){const t=this.bracket1();e._drawLine(t.begin(),t.end());const r=this.bracket2();e._drawLine(r.begin(),r.end())}_drawArrowHeads(e){const t=this._pixelsToDrawingUnits(13);let r=this._ray1().normalAngle(),n=this._ray2().normalAngle();this._angle().clockwise()?n+=Math.PI:r+=Math.PI,e._drawArrowhead(this.arrowHead1TipLocator(),r,t),e._drawArrowhead(this.arrowHead2TipLocator(),n,t)}arrowHead1TipLocator(){return new p.FixedEdgeLocator(this._ray1(),this._distance())}arrowHead2TipLocator(){return new p.FixedEdgeLocator(this._ray2(),this._distance())}drawArc(e){e.beginPath(),e.arc(this._vertex().x(),this._vertex().y(),this._distance(),this._ray1().normalizedAngle(),this._ray2().normalizedAngle(),!this._angle().clockwise()),e.stroke()}_drawLabel(e){const t=this.annotation().text();e._alterAndRestoreAfter((()=>{this._setFontSizeOnContext(e),this._positionText(e,t),this._drawText(e,t)}))}_drawText(e,t){e.fillText(t,0,0)}_positionText(e,t){const r=e.measureText(t),n=new p.Edge(this._vertex(),this.annotation().location()),i=new p.FixedEdgeLocator(n,n.length()+r.width),s=-r.width/2;e.translate(i.x()+s,i.y())}_distance(){return this.annotation().distance()}_angle(){return this.annotation().angle()}_vertex(){return this._angle().vertex()}_ray1(){return this._angle().ray1()}_ray2(){return this._angle().ray2()}_boundingTriangle(){return new p.Polygon([this._vertex(),new p.FixedEdgeLocator(this._ray1(),this._distance()+this._bracketLength()),new p.FixedEdgeLocator(this._ray2(),this._distance()+this._bracketLength())])}fontSize(){return this._pixelsToDrawingUnits(12)}_bracketLength(){return this._pixelsToDrawingUnits(13)}_setFontSizeOnContext(e){e.font=`${this.fontSize()}px sans-serif`}_scale(){return this._scaleValue}_setScale(e){this._scaleValue=e}_setScaleFromContext(e){this._setScale(e.runningScaleX())}_pixelsToDrawingUnits(e){return e/this._scale()}}var g=AngleAnnotationFigure;p.AngleAnnotation.prototype.defaultFigure=function(){const e=new AngleAnnotationFigure(this);return e.setLayer(this.layer()),e}},1314:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>f}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(68662)),m=d(r(44224));class BackgroundGridFigure extends m.default{constructor(e){super(),this.setModel(e)}boundingBox(){return new p.default(-1/0,-1/0,1/0,1/0)}defaultProperties(){return{strokeStyle:"#ddd",_pixelLineWidth:.5}}_gridCellWidth(){return this.model().gridMeasurement().toNumeric()*this.model().majorGridLineSpacing()}_minimumGridLineSpacingPixels(){return 5}_skipDrawing(e){return e._drawingUnitsToPixels(this._gridCellWidth())<this._minimumGridLineSpacingPixels()}_draw(e,{bounds:t}){const r=this.model().gridMeasurement().toNumeric()*this.model().majorGridLineSpacing();e.beginPath(),this._drawHorizontalLines(e,t,r),this._drawVerticalLines(e,t,r),e.stroke()}_drawHorizontalLines(e,t,r){const n=Math.ceil(t.top()/r),i=Math.floor(t.bottom()/r);for(let s=n;s<=i;s++){const n=s*r;e.moveTo(t.left(),n),e.lineTo(t.right(),n)}}_drawVerticalLines(e,t,r){const n=Math.ceil(t.left()/r),i=Math.floor(t.right()/r);for(let s=n;s<=i;s++){const n=s*r;e.moveTo(n,t.top()),e.lineTo(n,t.bottom())}}}var f=BackgroundGridFigure},65737:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(44224));class CanvasSpinner extends h.default{constructor(e){super(),this._model=e,this._image=new Image,this._image.src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmVyc2lvbj0iMS4xIiB3aWR0aD0iMTEwcHgiIGhlaWdodD0iMTEwcHgiPgogIDxnPgogICAgPGNpcmNsZSBjeD0iNTAiIGN5PSIwIiByPSI1IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg1IDUpIi8+CiAgICA8Y2lyY2xlIGN4PSI3NSIgY3k9IjYuNjk4NzI5OCIgcj0iNSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNSA1KSIvPgogICAgPGNpcmNsZSBjeD0iOTMuMzAxMjcwMiIgY3k9IjI1IiByPSI1IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg1IDUpIi8+CiAgICA8Y2lyY2xlIGN4PSIxMDAiIGN5PSI1MCIgcj0iNSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNSA1KSIvPgogICAgPGNpcmNsZSBjeD0iOTMuMzAxMjcwMiIgY3k9Ijc1IiByPSI1IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg1IDUpIi8+CiAgICA8Y2lyY2xlIGN4PSI3NSIgY3k9IjkzLjMwMTI3MDIiIHI9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDUgNSkiLz4KICAgIDxjaXJjbGUgY3g9IjUwIiBjeT0iMTAwIiByPSI1IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg1IDUpIi8+CiAgICA8Y2lyY2xlIGN4PSIyNSIgY3k9IjkzLjMwMTI3MDIiIHI9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDUgNSkiLz4KICAgIDxjaXJjbGUgY3g9IjYuNjk4NzI5OCIgY3k9Ijc1IiByPSI1IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg1IDUpIi8+CiAgICA8Y2lyY2xlIGN4PSIwIiBjeT0iNTAiIHI9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDUgNSkiLz4KICAgIDxjaXJjbGUgY3g9IjYuNjk4NzI5OCIgY3k9IjI1IiByPSI1IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg1IDUpIi8+CiAgICA8Y2lyY2xlIGN4PSIyNSIgY3k9IjYuNjk4NzI5OCIgcj0iNSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNSA1KSIvPgoKICAgIDxhbmltYXRlVHJhbnNmb3JtIGF0dHJpYnV0ZVR5cGU9InhtbCIgYXR0cmlidXRlTmFtZT0idHJhbnNmb3JtIiB0eXBlPSJyb3RhdGUiIGZyb209IjAgNTUgNTUiIHRvPSIzNjAgNTUgNTUiIGR1cj0iM3MiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiAvPgogIDwvZz4KPC9zdmc+Cg==",this._rotationSpeed=Math.PI/64,this._rotation=0,this._interval=setInterval(this._rotateLoadingImage.bind(this),25)}boundingBox(){return this._model.boundingBox()}dispose(){clearInterval(this._interval)}_rotateLoadingImage(){this._rotation+=1,this._redraw()}_redraw(){this._redrawCallback&&this._redrawCallback()}_draw(e){this._redrawCallback=()=>e._requestRedraw();const t=Math.min(this.boundingBox().width(),this.boundingBox().height())/5,r=this.boundingBox().center();e.translate(r.x(),r.y()),e.rotate(this._rotation*this._rotationSpeed),e.translate(-t/2,-t/2),e.drawImage(this._image,0,0,t,t)}}var p=CanvasSpinner},60562:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(62048),p=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(16137));class CircleFigure extends p.default{constructor(e,t){super();const r=e instanceof h.Circle;this._circle=r?e:new h.Circle(e,t)}shape(){return this._circle}snapPoint(){return this.shape().snapPoint()}_draw(e){e._drawCircle(this.shape())}}var m=CircleFigure;h.Circle.prototype.defaultFigure=function(){return new CircleFigure(this)}},16137:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(50988),p=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(44224));class ClosedShapeFigure extends p.default{boundingBox(){return this.shape().boundingBox()}shape(){throw new h.MissingOverride(this,"shape")}_draw(e,t){throw new h.MissingOverride(this,"_draw")}contains(e,t){return this.shape().contains(e,t)}moveBy(e,t){return this.shape().moveBy(e,t)}}var m=ClosedShapeFigure},94239:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>v}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=r(62048),m=r(50988),f=d(r(39344)),g=d(r(44224)),y=d(r(36526)),b=d(r(24024));class CompositeFigure extends g.default{static withFigures(e){const t=new this,r=new b.default(e);return t.setStrategy(r),t}static withModel(e){const t=new this;return t.setModel(e),t}static withStrategy(e,t=void 0){const r=new this;return r.setStrategy(e),r.setModel(t),r}strategy(){return this._strategy||(this._strategy=this._defaultStrategy()),this._strategy}setStrategy(e){this._strategy=e}_defaultStrategy(){return this.model()?new y.default(this):new b.default}figures(){return this._figures||(this._figures=this.defaultFigures()),this._figures}figureFor(e){return super.figureFor(e)||this._componentFigureFor(e)}_componentFigureFor(e){for(const t of this.figures()){const r=t.figureFor(e);if(r)return r}}updateFigures(){this.strategy().updateFigures()}parts(){return this.figures()}defaultFigures(){return this.strategy().defaultFigures()}_draw(e,t={}){const{layerManager:r}=t;this.layerVisible(r)&&this._drawSelf(e,t),this._drawFigures(e,t)}_drawSelf(e,t){}_drawFigures(e,t){this.figures().forEach((r=>r.draw(e,t)))}dispose(){this.figures().forEach((e=>e.dispose()))}_drawAnnotations(e,t){this.figures().forEach((r=>r.drawAnnotations(e,t))),super._drawAnnotations(e,t)}moveBy(e,t){let r=!1;return this.figures().forEach((n=>r=n.moveBy(e,t)||r)),r}modifiableCornerHandles(e){const t=[],r=this.figures();for(let n=r.length-1;n>=0;n--)t.fastMerge(r[n].modifiableCornerHandles(e));return t.fastMerge(super.modifiableCornerHandles(e)),t}handlesAt(e,t,r={}){const{scale:n,layerManager:i,validWhen:s=[f.default.VALID_FOR_HOVER]}=r,o=this.layerVisible(i);if(this._handles)return o?this._handles.fastFilter((r=>s.includes(r.validWhen())&&r.contains(e,t,n))):[];const a=[],l=this.figures();for(let n=l.length-1;n>=0;n--)a.fastMerge(l[n].handlesAt(e,t,r));const c=this.selfHandle();return o&&s.includes(c?.validWhen())&&c?.contains(e,t,n)&&a.push(c),a}defaultHandles(){const e=[],t=this.figures();for(let r=t.length-1;r>=0;r--)e.fastMerge(t[r].handles());const r=this.selfHandle();return r&&e.push(r),e}annotationHandles(){const e=[],t=this.figures();for(let r=0;r<t.length;r++)e.fastMerge(t[r].annotationHandles());return e.fastMerge(this.selfAnnotationHandles()),e}annotationHandlesAt(e,t,r={}){const{scale:n,layerManager:i}=r;let s=[];return this.annotationsVisible(i)&&(s=this.selfAnnotationHandles().fastFilter((r=>r.contains(e,t,n)))),[...this.figures().flatMap((n=>n.annotationHandlesAt(e,t,r))),...s]}xLevel(){if(this.model()&&this.model().xLevel)return this.model().xLevel();return this.figures().map((e=>e.xLevel())).reduce(((e,t)=>e<t?e:t))}yLevel(){if(this.model()&&this.model().yLevel)return this.model().yLevel();return this.figures().map((e=>e.yLevel())).reduce(((e,t)=>e>t?e:t))}zLevel(){if(this.model()&&this.model().zLevel)return this.model().zLevel();return this.figures().map((e=>e.zLevel())).reduce(((e,t)=>e<t?e:t))}_componentRenderer(e){return e.defaultFigure()}_componentSorter(e,t){return this._zLevelComparator(e,t)}_zLevelComparator(e,t){return t.zLevel()-e.zLevel()}_skipDrawing(e,t){return!1}boundingBox(){return 0===this.parts().length?new p.Rectangle(0,0,0,0):this.parts().map((e=>e.boundingBox())).reduce(((e,t)=>e.merge(t)))}}(0,m.extend)(CompositeFigure,p.Composite);var v=CompositeFigure},23885:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>g}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=r(62048),m=d(r(29465)),f=d(r(44224));class DimensionAnnotationFigure extends f.default{constructor(e){super(),this._model=e,this._scaleValue=1}snapPoint(){return this.model().edgeBegin()}_scale(){return this._scaleValue}_setScale(e){this._scaleValue=e}_setScaleFromContext(e){this._setScale(e.runningScaleX())}_pixelsToDrawingUnits(e){return e/this._scale()}_offset(){return this._pixelsToDrawingUnits(this.annotation().distance()<0?-6:6)}_arrowsOffset(){return this._pixelsToDrawingUnits(this.annotation().distance()<0?6:-6)}_containsBuffer(){return this._pixelsToDrawingUnits(9)}distance(){return this.annotation().distance()}annotation(){return this.model()}defaultProperties(){return{_pixelLineWidth:.5,strokeStyle:"#111111",fillStyle:"#111111"}}boundingBox(){const e=this.annotation().distance()+this.fontSize();return new p.Polygon([this.annotation().edge().begin(),this.annotation().edge().end(),new p.NormalToEdgeLocator(this.annotation().edgeEnd(),e),new p.NormalToEdgeLocator(this.annotation().edgeBegin(),e)]).boundingBox()}contains(e,t){return this.lineShape().contains(e,t)}moveBy(e,t){return this._textShape=void 0,this.annotation().moveBy(e,t)}handles(){return[new m.default(this)]}_isTextOrientedUpsideDown(e){const t=e.normalizedAngle();return t>Math.PI_2-.001&&t<Math.THREE_PI_2-.001}_setFontSizeOnContext(e){e.font=`${this.fontSize()}px sans-serif`}fontSize(){return this._pixelsToDrawingUnits(12)}_skipDrawing(e,t){return this._setScaleFromContext(e),super._skipDrawing(e,t)}_draw(e,t){this._setFontSizeOnContext(e),this._drawBrackets(e);const r=this._dimensionLineEdge(),n=e.measureText(this.annotation().text()).width,i=this._textOffsetAlongEdge(e,t.bounds,r);this._drawDimensionLine(e,n,i,r),this._drawLabel(e,n,i,r)}_textOffsetAlongEdge(e,t,r){if(!t)return r.length()/2;const n=r.segmentsInsidePolygon(t).first();if(!n)return r.length()/2;const i=n.center();return r.begin().distanceTo(i)}_drawBrackets(e){const t=this.annotation().edgeBegin(),r=this.annotation().edgeEnd(),n=this.distance();this._drawLeftBracket(e,t,n),this._drawRightBracket(e,r,n)}_drawRightBracket(e,t,r){e._drawLine(new p.NormalToEdgeLocator(t,r),new p.NormalToEdgeLocator(t,this._offset()))}_drawLeftBracket(e,t,r){e._drawLine(new p.NormalToEdgeLocator(t,this._offset()),new p.NormalToEdgeLocator(t,r))}_drawDimensionLine(e,t,r,n){this._drawLineSegmentsAroundLabel(e,t,r,n),this._drawArrows(e)}_drawLineSegmentsAroundLabel(e,t,r,n){this._drawLeftLineSegment(n,t,r,e),this._drawRightLineSegment(n,t,r,e)}_drawRightLineSegment(e,t,r,n){const i=new p.FixedEdgeLocator(e,r+t/2+2),s=e.end();n._drawLine(i,s)}_drawLeftLineSegment(e,t,r,n){const i=e.begin(),s=new p.FixedEdgeLocator(e,r-t/2-2);n._drawLine(i,s)}_drawArrows(e){const t=this._dimensionLineEdge(),r=t.angle(),n=this._pixelsToDrawingUnits(9);e._drawArrowhead(t.begin(),r+Math.PI,n),e._drawArrowhead(t.end(),r,n)}_drawLabel(e,t,r,n){const i=this.annotation().text();e._alterAndRestoreAfter((()=>{this._positionText(e,t,r,n),this._orientText(e),this._drawText(e,i)}))}_drawText(e,t){e.fillText(t,0,0)}_positionText(e,t,r,n){const i=this.annotation().edge().angle(),s=new p.FixedEdgeLocator(n,r);let o;o=this._isTextOrientedUpsideDown(i+e.runningRotation())?new p.NormalToEdgeLocator(s,this.fontSize()/3,t/2):new p.NormalToEdgeLocator(s,-this.fontSize()/3,-t/2),this._textShape=this.defaultTextShape(o,t),e.translate(o.x(),o.y())}_orientText(e){let t=this.annotation().edge().angle();this._isTextOrientedUpsideDown(t+e.runningRotation())&&(t+=Math.PI),e.rotate(t)}_dimensionLineEdge(){return new p.Edge(new p.NormalToEdgeLocator(this.annotation().edgeBegin(),this._distanceToDimensionLine()),new p.NormalToEdgeLocator(this.annotation().edgeEnd(),this._distanceToDimensionLine()))}_distanceToDimensionLine(){return this.distance()+this._arrowsOffset()}defaultTextShape(e,t){return new p.Polygon([e.add(0,-this.fontSize()),e.add(t,-this.fontSize()),e.add(t,this.fontSize()/2),e.add(0,this.fontSize()/2)])}textShape(){return this._textShape}lineShape(){const e=this._distanceToDimensionLine()+this._containsBuffer(),t=this._distanceToDimensionLine()-this._containsBuffer();return new p.Polygon([new p.NormalToEdgeLocator(this.annotation().edgeBegin(),e),new p.NormalToEdgeLocator(this.annotation().edgeEnd(),e),new p.NormalToEdgeLocator(this.annotation().edgeEnd(),t),new p.NormalToEdgeLocator(this.annotation().edgeBegin(),t)])}}var g=DimensionAnnotationFigure;p.DimensionAnnotation.prototype.defaultFigure=function(){const e=new DimensionAnnotationFigure(this);return e.setLayer(this.layer()),e}},44224:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>y}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=r(62048),m=r(50988),f=d(r(85457)),g=d(r(39344));class Drawable extends p.Handleable{_draw(e,t){throw new m.MissingOverride(this,"_draw")}contains(e,t){throw new m.MissingOverride(this,"contains")}moveBy(e,t){throw new m.MissingOverride(this,"moveBy")}boundingBox(){throw new m.MissingOverride(this,"boundingBox")}dispose(){}figureFor(e){if(this.model()===e)return this}properties(){return this._properties||(this._properties=this.defaultProperties()),this._properties}setProperty(e,t){this.properties()[e]=t}updateProperties(e){Object.assign(this.properties(),e)}defaultProperties(){return{}}layer(){return this._layer}setLayer(e){this._layer=e}layerVisible(e,t=this.layer()){return!e||e.isVisible(t)}annotationsVisible(e){return this.layerVisible(e,"Annotations")&&this.layerVisible(e)}_skipDrawing(e,{bounds:t,layerManager:r}={}){return!this.layerVisible(r)||t&&!t.intersects(this.boundingBox())}draw(e,t={}){this._skipDrawing(e,t)||(e._alterAndRestoreAfter((()=>{Object.assign(e,this.properties()),this._draw(e,t)})),!this.layerVisible(t.layerManager,"Annotations")&&this.properties().Annotations&&this._drawAnnotationsOnThisShapeOnly(e,t))}_drawAnnotationsOnThisShapeOnly(e,t){let r=this._getAnnotationFiguresFromModel();0===r.length&&(r=this.annotationFigures()),r.forEach((r=>r.draw(e,t)))}drawAnnotations(e,t){const{layerManager:r}=t;this.annotationsVisible(r)&&this._drawAnnotations(e,t)}_drawAnnotations(e,t){this.annotationFigures().forEach((r=>r.draw(e,t)))}annotationFigures(){return this._annotationFigures||(this._annotationFigures=this.defaultAnnotationFigures()),this._annotationFigures}setAnnotationFigures(e){this._annotationFigures=e}_getAnnotationsFromModel(){return this.model()&&this.model().annotations?this.model().annotations():[]}_getAnnotationFiguresFromModel(){return this._getAnnotationsFromModel().map((e=>e.defaultFigure()))}defaultAnnotationFigures(){return this._getAnnotationFiguresFromModel()}updateAnnotationFigures(){const e=this.annotationFigures(),t=e.slice(),r=this._getAnnotationsFromModel();t.forEach((t=>{if(!r.some((e=>t.model()===e))){const r=e.indexOf(t);e.splice(r,1)}})),r.forEach((t=>{!e.some((e=>e.model()===t))&&e.push(t.defaultFigure())}))}updateFigures(){this.updateAnnotationFigures()}handles(){return this._handles?this._handles:this.defaultHandles()}handlesAt(e,t,{scale:r,layerManager:n,validWhen:i=[g.default.VALID_FOR_HOVER]}={}){return this.layerVisible(n)?this.handles().fastFilter((n=>i.includes(n.validWhen())&&n.contains(e,t,r))):[]}defaultHandles(){return[this.selfHandle()]}selfHandle(){return new g.default(this)}annotationHandles(){return this.selfAnnotationHandles()}selfAnnotationHandles(){const e=[],t=this.annotationFigures();for(let r=0;r<t.length;r++)e.fastMerge(t[r].handles());return e}annotationHandlesAt(e,t,{scale:r,layerManager:n}={}){return this.annotationsVisible(n)?this.annotationHandles().fastFilter((n=>n.contains(e,t,r))):[]}modifiableCornerHandles(e){let t=[];if(this.model()&&this.model().modifiableCorners){const r=e=>new f.default(e,this,this.model());t=this.model().modifiableCorners(e).map(r)}return t}setHandles(e){this._handles=e}setModel(e){this._model=e}model(){return this._model}xLevel(){return 1e3}yLevel(){return-1e3}zLevel(){return 1e3}_contrastHexColor(e){return(299*this._hexToR(e)+587*this._hexToG(e)+114*this._hexToB(e))/1e3>=128?"#000000":"#ffffff"}_hexToR(e){return parseInt(this._cutHex(e).substring(0,2),16)}_hexToG(e){return parseInt(this._cutHex(e).substring(2,4),16)}_hexToB(e){return parseInt(this._cutHex(e).substring(4,6),16)}_cutHex(e){return"#"===e.charAt(0)?e.length>4?e.substring(1,7):this._make6Digits(e.substring(1,4)):e.length>4?e:this._make6Digits(e)}_make6Digits(e){return e.charAt(0)+e.charAt(0)+e.charAt(1)+e.charAt(1)+e.charAt(2)+e.charAt(2)}}var y=Drawable},77503:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>g}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=r(62048),m=d(r(21315)),f=d(r(44224));class DrawableImage extends f.default{constructor(e,t,r={}){super(),this._referencePoint=t,this._options=r,this._imageLoader=new m.default(e,r.retry),this.loadImage()}imageLoaded(){return this._imageLoader.imageReady()}loadImage(){return this._loadingPromise||(this._loadingPromise=this._imageLoader.loadImage().then((()=>this._redraw()))),this._loadingPromise}_getBoundingBoxFromModel(){let e=this.model()?.boundingShape?.();return e&&this.model()?.angle?.()&&(e=e.rotatedBy(this.model().location(),-this.model().angle())),e?.boundingBox?.()}_createBoundingBoxFromImage(){if(this.imageLoaded()){const e=this._referencePoint.x(),t=this._referencePoint.y(),r=this._options.width||this.image().width,n=this._options.height||this.image().height;return new p.Rectangle(e,t,r,n)}}image(){return this._imageLoader.image()}moveBy(e,t){return this._referencePoint.moveBy(e,t)}contains(e,t){return this.boundingBox()&&this.boundingBox().contains(e,t)}_redraw(){this._redrawCallback&&this._redrawCallback()}_draw(e){this.imageLoaded()?(this._imageIsRotated()&&this._rotateCanvas(e),this._imageIsTranslucent()&&this._lowerCanvasOpacity(e),e.drawImage(this.image(),...this._imageBounds(),...this._canvasBounds())):this._redrawCallback=()=>e._requestRedraw()}_lowerCanvasOpacity(e){e.globalAlpha=this.model().opacity()}_imageIsTranslucent(){return this.model()?.opacity&&this.model().opacity()<1}_rotateCanvas(e){const t=this.model().location();e.translate(t.x(),t.y()),e.rotate(this.model().angle()),e.translate(-t.x(),-t.y())}_imageIsRotated(){return this.model()?.location?.()&&this.model()?.angle?.()}_skipDrawing(e,t){return!(!this.imageLoaded()||!this.boundingBox())&&super._skipDrawing(e,t)}_canvasBounds(){return[this.boundingBox().x(),this.boundingBox().y(),this.boundingBox().width(),this.boundingBox().height()]}_imageBounds(){return[0,0,this.image().width,this.image().height]}boundingBox(){const e=this._getBoundingBoxFromModel();return e||(this._boundingBox||(this._boundingBox=this._createBoundingBoxFromImage()),this._boundingBox)}}var g=DrawableImage},79482:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));r(50988);var h=r(62048),p=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(94239));class Drawing extends p.default{constructor(e){super(),this.setModel(e)}moveBy(e,t){return this.model().moveBy(e,t)}contains(e,t){return!0}snapPoint(){return this.model().snapPoint()}centerPoint(){return this.boundingBox()?this.boundingBox().center():(0,h.$P)(0,0)}selfHandle(){}textHandles(){const e=[],t=this.figures();for(let r=0;r<t.length;r++)t[r].textHandles&&e.fastMerge(t[r].textHandles());return e}}var m=Drawing},11737:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>y}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=r(62048),m=d(r(11887)),f=d(r(52032)),g=d(r(23885));class FreeFloatingDimensionAnnotationFigure extends g.default{handles(){return[...this._vertexHandles(),this.selfHandle()]}selfHandle(){return new m.default(this.annotation(),this)}_vertexHandles(){return[new f.default(this.annotation().moveableBegin(),this),new f.default(this.annotation().moveableEnd(),this)]}zLevel(){return 1}defaultProperties(){return{_pixelLineWidth:2,strokeStyle:"#111111",fillStyle:"#111111"}}fontSize(e){const t=this._pixelsToDrawingUnits(18);e&&e._alterAndRestoreAfter((()=>{const r=this.annotation().text();e.font=`${t}px sans-serif`,this._desiredFontSizeWidth=e.measureText(r).width}));const r=this._dimensionLineEdge().length()*(2/3)/this._desiredFontSizeWidth,n=t*r;return Math.min(t,n)}bracketHeight(){return this.fontSize()/2}_calculateTextMetrics(e){const t=this.annotation().text();this._textMetrics=e.measureText(t)}_distanceToDimensionLine(){return 0}_canFitArrows(){return this._arrowheadLength()>this._pixelsToDrawingUnits(10)}_arrowheadLength(){const e=this._pixelsToDrawingUnits(4);return Math.min(this._pixelsToDrawingUnits(18),(this._dimensionLineEdge().length()-(this._textMetrics.width+e))/2)}_arrowheadAngle(){return Math.PI/8}_setFontSizeOnContext(e){e.font=`${this.fontSize(e)}px sans-serif`}_draw(e,t){this._setScaleFromContext(e),this._setFontSizeOnContext(e),this._calculateTextMetrics(e),this._drawTranslucentBackground(e);const r=this._dimensionLineEdge(),n=this._textMetrics.width,i=this._textOffsetAlongEdge(e,t.bounds,r);this._drawLabel(e,n,i,r),this._drawLineSegmentsAroundLabel(e,n,i,r),this._drawBrackets(e),this._canFitArrows()&&this._drawArrows(e)}_drawTranslucentBackground(e){const t=this.bracketHeight(),r=this.annotation().edgeBegin(),n=this.annotation().edgeEnd();e._alterAndRestoreAfter((()=>{e.strokeStyle="transparent",e.fillStyle="rgba(255, 255, 255, .7)",e._drawPolygon(new p.Polygon([new p.NormalToEdgeLocator(n,t),new p.NormalToEdgeLocator(n,-t),new p.NormalToEdgeLocator(r,-t),new p.NormalToEdgeLocator(r,t)]))}))}_drawRightBracket(e,t,r){this._drawBracket(e,t)}_drawLeftBracket(e,t,r){this._drawBracket(e,t)}_drawBracket(e,t){const r=this.bracketHeight();e._drawLine(new p.NormalToEdgeLocator(t,r),new p.NormalToEdgeLocator(t,-r))}_drawArrows(e){const t=this._dimensionLineEdge(),r=t.angle();e._drawArrowhead(t.begin(),r+Math.PI,this._arrowheadLength(),this._arrowheadAngle()),e._drawArrowhead(t.end(),r,this._arrowheadLength(),this._arrowheadAngle())}}var y=FreeFloatingDimensionAnnotationFigure},40124:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(88210));class FreeFormSelectionBoundaryFigure extends h.default{constructor(e){super(e.shape()),this.setModel(e),this.setIncludeEdgeHandles(!1),this.setIncludeVertexHandles(!1)}_draw(e){e.setLineDash([5,3]),e.strokeStyle="#000000",e.fillStyle="rgba(75,75,75,0.25)",super._draw(e)}}var p=FreeFormSelectionBoundaryFigure},47468:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>R}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=r(62048),m=d(r(9852)),f=d(r(72094)),g=d(r(50602)),y=d(r(65737)),b=d(r(94239)),v=d(r(44224)),_=d(r(77503)),x=d(r(22481));const w={showPlaceholder:!0,showError:!0};class ImageComponentFigure extends v.default{constructor(e,t={}){super(),this.setModel(e),this._options=Object.assign({},w,t),this.imageFigure()}showPlaceholder(){this._options.showPlaceholder=!0}hidePlaceholder(){this._options.showPlaceholder=!1}showError(){this._options.showError=!0}hideError(){this._options.showError=!1}moveBy(e,t){return this.model().moveBy(e,t)}boundingBox(){return this.model().boundingBox()}contains(e,t){return this.boundingBox().contains(e,t)}zLevel(){return this.model().zLevel()}_draw(e,t){this.imageFigure().imageLoaded()?this._drawImage(e,t):this._loadingError?this._drawError(e,t):this._drawPlaceholder(e,t)}_drawPlaceholder(e,t){this.placeholderFigure().draw(e,t),this._redrawCallback=()=>e._requestRedraw()}_drawError(e,t){this.errorFigure().draw(e,t)}_drawImage(e,t){this.imageFigure().draw(e,t)}selfHandle(){return new m.default(this)}_cornerHandles(){const e=this.model().boundingShape().vertices();return e.map(((t,r)=>{if(0===r)return;const n=r-1,i=n<0?e.length-1:n,s=e[i],o=r+1,a=o>e.length-1?0:o,l=e[a];return new f.default(t,[l,s],this)})).filter((e=>e))}defaultHandles(){return[...this._cornerHandles(),new g.default(this.model(),this.model().boundingShape().vertices().first(),this.model().location()),this.selfHandle()]}_makeImageFigure(){const e=new _.default(this.model().url(),this.model().referencePoint(),{retry:this._options.retry});return e.setModel(this.model()),e.loadImage().then((()=>{this._disposePlaceholderFigure(),this._redraw()})).catch((e=>{this._loadingError=e,this._redraw()})),e}imageFigure(){return this._imageFigure||(this._imageFigure=this._makeImageFigure()),this._imageFigure}_makeErrorFigure(){const e=new _.default("data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzEwMHB4JyB3aWR0aD0nMTAwcHgnICBmaWxsPSIjMDAwMDAwIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3BhY2U9InByZXNlcnZlIiB2ZXJzaW9uPSIxLjEiIHN0eWxlPSJzaGFwZS1yZW5kZXJpbmc6Z2VvbWV0cmljUHJlY2lzaW9uO3RleHQtcmVuZGVyaW5nOmdlb21ldHJpY1ByZWNpc2lvbjtpbWFnZS1yZW5kZXJpbmc6b3B0aW1pemVRdWFsaXR5OyIgdmlld0JveD0iMCAwIDEuNzg4IDEuNTQxIiB4PSIwcHgiIHk9IjBweCIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiPjxkZWZzPjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+CgogICAgLmZpbDAge2ZpbGw6I0M2MkEyM30KCiAgPC9zdHlsZT48L2RlZnM+PGc+PHBhdGggY2xhc3M9ImZpbDAiIGQ9Ik0xLjc1MyAxLjEyN2wtMC41ODEgLTAuOTUxYy0wLjA2NywtMC4wOTggLTAuMTUzLC0wLjE3NiAtMC4yNzgsLTAuMTc2IC0wLjEyNSwwIC0wLjIxMSwwLjA3OCAtMC4yNzgsMC4xNzZsLTAuNTg0IDAuOTU2Yy0wLjA0NCwwLjA5IC0wLjA0NCwwLjE5NSAwLjAwOSwwLjI4MiAwLjA0OCwwLjA3NyAwLjEzLDAuMTI3IDAuMjIxLDAuMTI3bDEuMjY0IDBjMC4wOSwwIDAuMTczLC0wLjA1IDAuMjIsLTAuMTI3IDAuMDUzLC0wLjA4NiAwLjA1NSwtMC4xOTggMC4wMDcsLTAuMjg3em0tMC41ODggLTAuNDEyYzAuMDI1LDAuMDI1IDAuMDI1LDAuMDY2IDAsMC4wOWwtMC4xMzYgMC4xMzYgMC4xMzYgMC4xMzVjMC4wMjUsMC4wMjUgMC4wMjUsMC4wNjYgMCwwLjA5MWwtMC4wNDUgMC4wNDVjLTAuMDI1LDAuMDI1IC0wLjA2NiwwLjAyNSAtMC4wOTEsMGwtMC4xMzUgLTAuMTM2IC0wLjEzNiAwLjEzNmMtMC4wMjQsMC4wMjUgLTAuMDY1LDAuMDI1IC0wLjA5LDBsLTAuMDQ1IC0wLjA0NWMtMC4wMjUsLTAuMDI1IC0wLjAyNSwtMC4wNjYgMCwtMC4wOTFsMC4xMzUgLTAuMTM1IC0wLjEzNSAtMC4xMzZjLTAuMDI1LC0wLjAyNCAtMC4wMjUsLTAuMDY1IDAsLTAuMDlsMC4wNDUgLTAuMDQ1YzAuMDI1LC0wLjAyNSAwLjA2NiwtMC4wMjUgMC4wOSwwbDAuMTM2IDAuMTM1IDAuMTM1IC0wLjEzNWMwLjAyNSwtMC4wMjUgMC4wNjYsLTAuMDI1IDAuMDkxLDBsMC4wNDUgMC4wNDV6Ij48L3BhdGg+PC9nPjwvc3ZnPgo=",this.model().referencePoint(),{retry:!1}),t={boundingShape:()=>{const e=Math.min(this.boundingBox().width(),this.boundingBox().height())/12,t=e,r=this.boundingBox().center().x()-e/2,n=this.boundingBox().center().y()-e/2;return new p.Rectangle(r,n,e,t).toPolygon()}};e.setModel(t);const r=this.model().boundingShape().defaultFigure();return r.updateProperties({lineWidth:4,strokeStyle:"#C62A23",fillStyle:"rgba(196, 44, 42, .1)"}),b.default.withFigures([e,r])}errorFigure(){return this._errorFigure||(this._options.showError?this._errorFigure=this._makeErrorFigure():this._errorFigure=new x.default),this._errorFigure}_makePlaceholderFigure(){let e;if(this.model().placeholderUrl())e=new _.default(this.model().placeholderUrl(),this.model().referencePoint(),{retry:!1}),e.setModel(this.model());else{const t=this.model().boundingShape().defaultFigure();t.updateProperties({lineWidth:"4",strokeStyle:"#090000",fillStyle:"rgb(138,139,141, .1)"});const r=new y.default(this.model());e=b.default.withFigures([r,t])}return e}_disposePlaceholderFigure(){this._placeholderFigure?.dispose(),this._placeholderFigure=new x.default}placeholderFigure(){return this._placeholderFigure||(this._options.showPlaceholder?this._placeholderFigure=this._makePlaceholderFigure():this._placeholderFigure=new x.default),this._placeholderFigure}_redraw(){this._redrawCallback&&this._redrawCallback()}}var R=ImageComponentFigure},22481:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>f}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(68662)),m=d(r(44224));class NullDrawable extends m.default{constructor(e){super(),this.setModel(e)}_skipDrawing(){return!0}_draw(e,t){}contains(e,t){return!1}moveBy(e,t){return!1}boundingBox(){return new p.default(0,0,0,0)}}var f=NullDrawable},56553:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(62048),p=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(16137));class PathFigure extends p.default{constructor(e){super(),this._model=e}_draw(e,t){const r=this.shape(),n=r.origin();e.beginPath(),e.moveTo(n.x(),n.y()),r.segments().forEach((t=>{"Edge"===t.constructor.name?e.lineTo(t.end().x(),t.end().y()):"Arc"===t.constructor.name?e.arc(t.center().x(),t.center().y(),t.radius(),t.startAngle(),t.endAngle(),t.isCounterClockwise()):"CubicBezier"===t.constructor.name&&e.bezierCurveTo(t.controlPoint1().x(),t.controlPoint1().y(),t.controlPoint2().x(),t.controlPoint2().y(),t.end().x(),t.end().y())})),this.shape().closed()&&(e.closePath(),e.fill()),e.stroke()}handles(){return[]}shape(){return this.model()}}var m=PathFigure;h.Path.prototype.defaultFigure=function(){return new PathFigure(this)}},88210:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>b}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=r(62048),m=d(r(85457)),f=d(r(75421)),g=d(r(52032)),y=d(r(16137));class PolygonFigure extends y.default{constructor(e){if(super(),!e)return;const t=e instanceof p.Polygon;this._polygon=t?e:new p.Polygon(e)}zLevel(){return this._polygon.zLevel()}setIncludeEdgeHandles(e){this._includeEdgeHandles=e}includeEdgeHandles(){let e=!0;return void 0!==this._includeEdgeHandles&&(e=this._includeEdgeHandles),e}setIncludeVertexHandles(e){this._includeVertexHandles=e}includeVertexHandles(){let e=!0;return void 0!==this._includeVertexHandles&&(e=this._includeVertexHandles),e}modifiableCornerHandles(e){let t=super.modifiableCornerHandles(e);if(0===t.length&&this.shape().modifiableCorners){const r=e=>new m.default(e,this,this.shape());t=this.shape().modifiableCorners(e).map(r)}return t}shape(){return this.model()?this.model().shape():this._polygon}_draw(e){e._drawPolygon(this.shape())}defaultHandles(){return[...this.includeVertexHandles()?this._vertexHandles():[],...this.includeEdgeHandles()?this._edgeHandles():[],this.selfHandle()]}_vertexHandles(){return this.vertices().map((e=>new g.default(e,this)))}_edgeHandles(){return this.edges().map((e=>new f.default(e,this)))}vertices(){return this.shape().vertices()}edges(){return this.shape().edges()}}var b=PolygonFigure;p.Polygon.prototype.defaultFigure=function(){return new PolygonFigure(this)},g.default.prototype._makeFigureFromPoints=function(e){return new PolygonFigure(e)}},90131:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>g}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(75421)),m=d(r(52032)),f=d(r(16137));class PolygonWithHolesFigure extends f.default{constructor(e){super(),this._polygon=e}setIncludeEdgeHandles(e){this._includeEdgeHandles=e}includeEdgeHandles(){let e=!0;return void 0!==this._includeEdgeHandles&&(e=this._includeEdgeHandles),e}setIncludeVertexHandles(e){this._includeVertexHandles=e}includeVertexHandles(){let e=!0;return void 0!==this._includeVertexHandles&&(e=this._includeVertexHandles),e}shape(){return this.model()?this.model().shape():this._polygon}defaultHandles(){let e=[],t=[];return this.includeVertexHandles()&&(e=this._vertexHandles()),this.includeEdgeHandles()&&(t=this._edgeHandles()),[...e,...t,this.selfHandle()]}_vertexToVertexHandle(e){return new m.default(e,this)}_vertexHandles(){return this.shape().surface().vertices().map(this._vertexToVertexHandle.bind(this))}_edgeToEdgeHandle(e){return new p.default(e,this)}_edgeHandles(){return this.shape().surface().edges().map(this._edgeToEdgeHandle.bind(this))}_draw(e){this._drawSurface(e),this._outlineHoles(e)}_drawSurface(e){e._alterAndRestoreAfter((()=>{this._clipHoles(e),e._drawPolygon(this.shape().surface())}))}_clipHoles(e){if(0===this.shape().holes().length)return;e.beginPath();const t=this.shape().boundingBox().insettedBy(-20);e.rect(t.x(),t.y(),t.width(),t.height()),this.shape().holes().forEach((t=>{const r=t.vertices()[0];e.moveTo(r.x(),r.y()),e._addPolygonToCurrentPath(t),e.lineTo(r.x(),r.y())})),e.clip("evenodd")}_outlineHoles(e){this.shape().holes().forEach((t=>{e.beginPath(),e._addPolygonToCurrentPath(t),e.closePath(),e.stroke()}))}}var g=PolygonWithHolesFigure},59793:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(62048),p=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(16137));class RectangleFigure extends p.default{constructor(e,t,r,n){super();const i=e instanceof h.Rectangle;this._rectangle=i?e:new h.Rectangle(e,t,r,n)}shape(){return this._rectangle}boundingBox(){return this.shape()}snapPoint(){return this.vertices()[0]}vertices(){return this.shape().vertices()}_draw(e){e._drawRectangle(this.shape())}}var m=RectangleFigure;h.Rectangle.prototype.defaultFigure=function(){return new RectangleFigure(this)}},79728:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>v}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));r(50988);var p=r(62048),m=d(r(88155)),f=d(r(35837)),g=d(r(52032)),y=d(r(78210)),b=d(r(44224));class MyTextGeometryAdapter extends m.default{constructor(e,t,r){super(e,t,r),this._textLocation=r}contains(e,t,r){return!!this._textLocation().equals((0,p.$P)(e,t),Math.DEFAULT_TOLERANCE)||super.contains(e,t,r)}}class TextAnnotationFigure extends b.default{constructor(e){super(),this._model=e,this._fontSize=20}defaultProperties(){return{fillStyle:this.model().color(),strokeStyle:this.model().color(),font:`${this._fontSize}px sans-serif`,lineWidth:"1",shapeOnly:!0}}_textSubstringWidth(e,t=this._makeTemporaryContext()){return t.font=this._font,t.measureText(e).width}_textGeometryAdapter(){return new MyTextGeometryAdapter(this,"_annotationBoundingBox",this._textLocation.bind(this))}_textIndexLocatorAdapter(){return new f.default(this,"_textSubstringWidth")}textHandles(){return[new y.default(this,this.model(),this._textGeometryAdapter(),this._textIndexLocatorAdapter(),(()=>{}))]}_skipDrawing(e,t){return!1}boundingBox(){return this._annotationBoundingBox(this._makeTemporaryContext())}_draw(e){this._drawText(e),this._drawArrow(e)}_drawText(e){this.measureText(e,this.model().text());const t=this.textDimensions();e.fillText(this.model().text(),this._textLocation().x(),this._textLocation().y()+t.height())}_drawArrow(e){this._clipAroundText(e);const t=this.textDimensions();e._drawArrow(new p.Edge(t.center(),this.model().anchor()),9,6)}_clipAroundText(e){const t=this.textDimensions().insettedBy(-8),r=this.model().anchor().toCorner(t.center()).merge(t).insettedBy(-3);e.beginPath(),e.rect(r.x(),r.y(),r.width(),r.height()),e.rect(t.x(),t.y(),t.width(),t.height()),e.closePath(),e.clip("evenodd")}contains(e,t,r=this._makeTemporaryContext()){if(this._textLocation().equals((0,p.$P)(e,t),Math.DEFAULT_TOLERANCE))return!0;return this._annotationBoundingBox(r).contains(e,t)}_makeTemporaryContext(){return document.createElement("canvas").getContext("2d")}_annotationBoundingBox(e=this._makeTemporaryContext()){return e.font=this.properties().font,new p.Rectangle(this._textLocation().x(),this._textLocation().y()+5,e.measureText(this.text()).width,this._fontSize)}measureText(e,t){e.font=this.properties().font;this._dimensions=new p.Rectangle(this._textLocation().x(),this._textLocation().y()+5,e.measureText(t).width,this._fontSize)}textDimensions(){return this._dimensions}text(){return this.model().text()}anchor(){return this.model().anchor()}_textLocation(){return this.model().textLocation()}moveBy(e,t){return this.model().moveBy(e,t)}defaultHandles(){return this.textHandles().push(new g.default(this.model().anchor(),this))}zLevel(){return 0}}var v=TextAnnotationFigure},20647:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(62048),p=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(44224));class TextCursorFigure extends p.default{constructor(e){super(),this.setModel(e),this._fontSize=20}defaultProperties(){return{fillStyle:"#000000",strokeStyle:"#000000",font:`${this._fontSize}px sans-serif`}}_skipDrawing(e,t){return!1}boundingBox(){const e=this.findCursorLocation(this._makeTemporaryContext());return new h.Polygon([e.begin(),e.end(),e.begin()]).boundingBox()}_draw(e){if(e.TextCursor){const t=this.findCursorLocation(e);e._drawLine(t.begin(),t.end())}}_makeTemporaryContext(){return document.createElement("canvas").getContext("2d")}contains(){return!1}findCursorLocation(e){const t=this.model().textIndexLocator().substringWidth(this.model().textBeforeCursor(),e);return this.model().textGeometry().shape(e).leftEdge().movedBy(t,0)}roundLocationToNearestCharacter(e,t){const r=t-this.model().textGeometry().shape(e).left(),n=this._findSubstringsWidths(e);return n.sort(((e,t)=>Math.abs(r-e.width)-Math.abs(r-t.width))),n[0].substring}_findSubstringsWidths(e){const t=[],r=this.model().text().length;for(let e=0;e<=r;e++)t.push(this.model().text().substring(0,e));return t.map((t=>({substring:t,width:this.model().textIndexLocator().substringWidth(t,e)})))}}var m=TextCursorFigure},83681:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>g}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(68662)),m=d(r(39344)),f=d(r(44224));class TextFigure extends f.default{constructor(e,t){super(),this._locator=t,this._text=e,this._fontSize=10}locator(){return this._locator}text(){return this._text}fontSize(){return this._fontSize}setFontSize(e){this._fontSize=e}snapPoint(){return this.locator()}_draw(e){e.font=`${this.fontSize()}px sans-serif`,e.fillText(this.text(),this.locator().x(),this.locator().y())}_skipDrawing(e,t){return!1}boundingBox(){const e=this._makeTemporaryContext().measureText(this.text()).width,t=this.fontSize();return new p.default(this.locator().x(),this.locator().y(),e,t)}contains(e,t){const r=this._makeTemporaryContext().measureText(this.text()).width,n=e-this.locator().x(),i=this.locator().y()-t,s=n>=0&&n<=r,o=i>=0&&i<=this.fontSize();return s&&o}_makeTemporaryContext(){return document.createElement("canvas").getContext("2d")}moveBy(e,t){return this.locator().moveBy(e,t)}handles(){return[new m.default(this)]}defaultProperties(){return{fillStyle:"black"}}}var g=TextFigure},36526:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>a}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));var a=class CompositeModelStrategy{constructor(e){this._compositeFigure=e}model(){return this._compositeFigure.model()}compositeFigure(){return this._compositeFigure}figures(){return this.compositeFigure().figures()}_componentFigures(){return this.model().components().map(this._componentRenderer.bind(this)).sort(this._componentSorter())}defaultFigures(){return this._componentFigures()}updateFigures(){const e=this.model().components();this._removeDeadFigures(e),this.figures().forEach((e=>e.updateFigures())),this._addMissingFigures(e),this.figures().sort(this._componentSorter()),this.compositeFigure().updateAnnotationFigures()}_componentSorter(){return this.compositeFigure()._componentSorter.bind(this.compositeFigure())}_removeDeadFigures(e){this._deadFigures(e).forEach((e=>this._removeFigure(e)))}_removeFigure(e){const t=this.figures().indexOf(e);t>-1&&(this.figures().splice(t,1),e.dispose())}_addMissingFigures(e){const t=this.figures().map((e=>e.model()));e.forEach((e=>{t.includes(e)||this.compositeFigure().add(this._componentRenderer(e))}))}_componentRenderer(e){return this.compositeFigure()._componentRenderer(e)}_deadFigures(e){return this.figures().filter((t=>t.model()&&!this._isFigureConnectedToOneOfMyComponents(e,t)))}_isFigureConnectedToOneOfMyComponents(e,t){const r=t.model();return e.includes(r)}}},47540:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>a}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));var a=class FiguresFromLambdaStrategy{constructor(e){this._lambda=e}updateFigures(){}defaultFigures(){return this._lambda()}}},24024:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>a}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));var a=class StaticFigureStrategy{constructor(e=[]){this._figures=e}updateFigures(){}defaultFigures(){return this._figures}}},80438:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(39344));var p=class GeometryFromModel{contains(e,t){return this.model().contains(e,t)}vertices(){return this.model()[this._verticesProperty||"vertices"]()}moveBy(e,t){return this.model().moveBy(e,t)}defaultHandles(){return[new h.default(this.model())]}xLevel(){return this.model().xLevel&&this.model().xLevel()||1e3}yLevel(){return this.model().yLevel&&this.model().yLevel()||-1e3}zLevel(){return this.model().zLevel&&this.model().zLevel()||1e3}}},49183:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>a}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));var a=class LevelsFromModel{xLevel(){return this.model().xLevel()}yLevel(){return this.model().yLevel()}zLevel(){return this.model().zLevel()}}},9304:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(39344));class AngleAnnotationHandle extends h.default{draw(e){e.updateProperties(this.indicatorProperties()),this.object().drawArc(e)}indicatorProperties(){return{fillStyle:"#FFD45D",strokeStyle:"#FFD45D",_pixelLineWidth:10,globalAlpha:".8"}}}var p=AngleAnnotationHandle},29465:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>g}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=r(62048),m=d(r(88210)),f=d(r(39344));class AnnotationHandle extends f.default{draw(e,t){const r=this.object().annotation().edgeBegin(),n=this.object().annotation().edgeEnd(),i=this.object().distance(),s=new m.default([new p.NormalToEdgeLocator(r,i),new p.NormalToEdgeLocator(r,i),new p.NormalToEdgeLocator(n,i),new p.NormalToEdgeLocator(n,i)]);s.updateProperties(this.indicatorProperties()),s.draw(e,t)}indicatorProperties(){return{fillStyle:"rgba(255,212,93, 0.5)",strokeStyle:"#FFD45D",_pixelLineWidth:9,globalAlpha:".8"}}}var g=AnnotationHandle},10041:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(39344));class ComponentHandle extends h.default{constructor(e,t){super(e),this._component=t}selectableComponent(){return this._component}activate(e){this._activatingTool=e}deactivate(e){this._activatingTool=void 0}activatingTool(){return this._activatingTool}}var p=ComponentHandle},21483:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(62048),p=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(39344));class CompositeSelectionHandle extends p.default{selectableComponent(){return this.object()}drawSelected(e,t){e._alterAndRestoreAfter((()=>{this._drawBoundingBox(e),this._drawComponentsOutline(e,t)}))}_drawComponentsOutline(e){e.strokeStyle="rgba(91, 178, 228, 1)",this.object().components().forEach((t=>e._drawPolygon(t.boundingShape())))}_drawBoundingBox(e){e.strokeStyle="rgba(91, 178, 228, 1)",e.fillStyle="rgba(91, 178, 228, 0.25)",e.lineWidth=1,e._drawPolygon(this.object().shape())}contains(e,t){return this.object().shape().containsPoint((0,h.$P)(e,t))}}var m=CompositeSelectionHandle},19028:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(62048),p=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(46095));class CornerEdgeAdjusterHandle extends p.default{constructor(e,t,r){super(e,t,r),this._cornerEdgeBegin=this.object().begin(),this._cornerEdgeEnd=this.object().end()}_otherEdges(){return this.frame().edges().filter((e=>e.begin()!==this._cornerEdgeBegin&&e.end()!==this._cornerEdgeBegin&&e.begin()!==this._cornerEdgeEnd&&e.end()!==this._cornerEdgeEnd))}_otherVertices(){return this.frame().vertices().filter((e=>e!==this._cornerEdgeBegin&&e!==this._cornerEdgeEnd))}_moveBy(e,t){const r=this._targetDistanceAlongEdge(e,t),n=this._constrainedDistanceAlongEdge(r,e,t);return this._moveCornerEdge(n),!0}_moveCornerEdge(e){const t=this._cornerEdgeBegin.distance(),r=this._cornerEdgeEnd.distance();this._cornerEdgeBegin.setDistance(-e),this._cornerEdgeEnd.setDistance(e),0!==this.checkInvertedEdges().length&&(this._cornerEdgeBegin.setDistance(t),this._cornerEdgeEnd.setDistance(r)),this.adjustFrame()}_targetDistanceAlongEdge(e,t){const r=this.object().center().add(e,t),n=this._cornerEdgeEnd.edge().begin(),i=Math.max(r.subtract(n).r(),6);return Math.SQRT2*i}_constrainedDistanceAlongEdge(e,t,r){const n=this._maxDistanceConstrainedByBegin(e),i=this._maxDistanceConstrainedByEnd(e),s=this._maxDistanceConstrainedByEdge(t,r);return Math.min(n,i,s)+this._cornerEdgeEnd.distance()}_maxDistanceConstrainedByEdge(e,t){const r=this.movementAlongNormal(e,t),n=this.constrainedEdgeMovement(r,[this.object()],this._otherVertices());return Math.SQRT2*n.r()}_maxDistanceConstrainedByEnd(e){const t=new h.PolarCoordinate(e-this._cornerEdgeEnd.distance(),this._cornerEdgeEnd.edge().theta());return this.constrainedMovement(t,[this._cornerEdgeEnd],this._otherEdges()).r()}_maxDistanceConstrainedByBegin(e){const t=new h.PolarCoordinate(e+this._cornerEdgeBegin.distance(),this._cornerEdgeBegin.edge().theta()+Math.PI);return this.constrainedMovement(t,[this._cornerEdgeBegin],this._otherEdges()).r()}}var m=CornerEdgeAdjusterHandle},85457:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(52032));class CornerHandle extends h.default{constructor(e,t,r){super(e,t),this._model=r}notchCorner(e){return this._model.notchCorner(this.object(),e)}cutCorner(e){return this._model.cutCorner(this.object(),e)}}var p=CornerHandle},75421:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(62048),p=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(80387));class EdgeHandle extends p.default{tolerance(e){return 6/e}contains(e,t,r=1){return this._distanceFromCenterTo(e,t)+Math.DEFAULT_TOLERANCE<this.tolerance(r)}_distanceFromCenterTo(e,t){return this.object().xy().shortestLineFrom(new h.Point(e,t)).length()}_moveBy(e,t){const r=this.movementAlongNormal(e,t);return this.object().moveBy(r.x(),r.y())}movementAlongNormal(e,t){const r=this.object().shortestLineFrom(this.object().begin().add(e,t),!0);return new h.PolarCoordinate(r.length(),r.theta()+Math.PI).snapshot().roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES)}draw(e){const t=e.runningScaleX(),r=new h.ProportionalEdgeLocator(this.object(),0),n=new h.ProportionalEdgeLocator(this.object(),1),i=new h.Polygon([new h.NormalToEdgeLocator(r,-this.tolerance(t)),new h.NormalToEdgeLocator(r,0),new h.NormalToEdgeLocator(n,0),new h.NormalToEdgeLocator(n,-this.tolerance(t))]);e.fillStyle="#FFD45D",e.strokeStyle="rgba(255,255,255,0.0)",e.globalAlpha=.8,e._drawPolygon(i)}}var m=EdgeHandle},46095:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>g}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=r(62048),m=d(r(75421)),f=d(r(39344));class FrameAdjusterHandle extends m.default{constructor(e,t,r){super(t,r),this._frame=e}frame(){return this._frame}selectableComponent(){return this.frame()}adjustFrame(){this.frame().frameResized&&this.frame().frameResized()}validWhen(){return f.default.VALID_FOR_SELECTED}minimumLength(){return this.frame().minimumSpan?this.frame().minimumSpan(this.object()):24}maximumLength(){return this.frame().maximumSpan?this.frame().maximumSpan(this.object()):1/0}_moveBy(e,t){const r=this.constrainedMovementAlongNormal(e,t);let n=super._moveBy(r.x(),r.y());return(!n||this.checkInvertedEdges().length>0)&&(n=super._moveBy(-r.x(),-r.y())),n&&this.adjustFrame(r),n}checkInvertedEdges(){return this.frame().edges().filter((e=>this.frame().edges().some((t=>e.begin()!==t.end()&&e.end()!==t.begin()&&e.intersections(t).length>0))))}constrainedMovement(e,t,r){const n=this.minimumLength(),i=this.maximumLength(),s=t.map((t=>t.add(e))).reduce(((e,s,o)=>{const a=t[o],l=r.reduce(((e,t)=>{const r=t.closestPointTo(a),o=new p.Edge(a,s),l=o.shortestLineFrom(r,!0),c=new p.Edge(a,l.end()),u=c.length(),d=Math.sqrt(n*n-l.length()*l.length())||-1/0;let h=o.length();o.roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES).theta()!==c.roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES).theta()&&(h=-h),u<Math.DEFAULT_TOLERANCE&&(h=-1/0);const m=h-u+d;let f=-1/0;return o.direction().dot(t.normal())<0&&(f=t.shortestLineFrom(s).length()-i),Math.max(m,f,e)}),-1/0);return Math.max(l,e)}),0);return new p.PolarCoordinate(e.r()-s,e.theta())}movingVertices(e){const t=e.normalized().multipliedBy(Math.DEFAULT_TOLERANCE),r=this.frame().vertices(),n=r.map((e=>e.snapshot()));this.object().moveBy(t.x(),t.y());const i=r.filter(((e,t)=>!e.equals(n[t],Math.DEFAULT_TOLERANCE/10)));return this.object().moveBy(-t.x(),-t.y()),i}constrainedMovementAlongNormal(e,t){const r=this.frame().edges(),n=this.movementAlongNormal(e,t),i=this.movingVertices(n),s=r.filter((e=>!i.some((t=>e.begin()===t||e.end()===t))&&e.theta()!==n.theta())),o=r.filter((e=>i.includes(e.begin())&&i.includes(e.end()))),a=this.frame().vertices().filter((e=>!i.includes(e))),l=this.constrainedMovement(n,i,s),c=this.constrainedEdgeMovement(n,o,a);return l.r()<c.r()?l:c}constrainedEdgeMovement(e,t,r){const n=this.minimumLength(),i=e.theta().normalizedAngle();let s;return t.forEach((e=>{r.forEach((t=>{const r=e.shortestLineFrom(t),o=new p.FixedEdgeLocator(r,n).subtract(r.end());Math.abs(r.reversed().normalizedAngle()-i)<Math.DEFAULT_TOLERANCE&&(!s||s.r()>o.r())&&(s=o)}))})),s&&e.r()>s.r()?s:e}}var g=FrameAdjusterHandle},11887:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(62048),p=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(39344));class FreeFloatingDimensionAnnotationHandle extends p.default{constructor(e,t){super(e),this._figure=t}selectableComponent(){return this.object()}_edge(){return this.object().edge()}_moveBy(e,t){return this._edge().moveBy(e,t)}contains(e,t,r=1){const n=this._figure.bracketHeight(r);return this._distanceFromCenterTo(e,t)+Math.DEFAULT_TOLERANCE<n}_distanceFromCenterTo(e,t){return this._edge().xy().shortestLineFrom((0,h.$P)(e,t)).length()}draw(e){e._alterAndRestoreAfter((()=>{const t=e.runningScaleX();e.fillStyle="#FFD45D",e.strokeStyle="rgba(255,255,255,0.0)",e.globalAlpha=.8,e._pixelLineWidth=2;const r=this.object().boundingShape(t);e._drawPolygon(r)}))}drawSelected(e){e._alterAndRestoreAfter((()=>{const t=e.runningScaleX();e.fillStyle="rgba(255, 255, 255, 0.0)",e.strokeStyle="rgba(91, 178, 228, 0.75)",e._pixelLineWidth=2;const r=this.object().boundingShape(t);e._drawPolygon(r)}))}}var m=FreeFloatingDimensionAnnotationHandle},74089:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(39344));class FrontHandle extends h.default{contains(e,t){return this.object().boundingCube?this.object().boundingCube().frontSide().contains(e,t):this.object().contains(e,0)}moveFromTo(e,t,r,n){const i=r-e,s=n-t;return this.moveBy(i,s)}_moveBy(e,t){return this.object().moveBy(e,0,t)}}var p=FrontHandle},39344:(e,t,r)=>{var n,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(l,{default:()=>u}),e.exports=(n=l,((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(n=s(t,l))||n.enumerable});return e})(i({},"__esModule",{value:!0}),n));r(62048);const c="hover";class Handle{constructor(e,t=c){this.setObject(e),this._validWhen=t}equals(e){let t=!1;if(e){const r=e.constructor.name===this.constructor.name,n=this._compareObjects(this.object(),e.object());t=r&&n}return t}_compareObjects(e,t){let r=!1;return e===t?r=!0:e.equals?r=e.equals(t):t.equals&&(r=t.equals(e)),r}toString(){return this.object().toString()}object(){return this._handleableObject}setObject(e){this._handleableObject=e}setProperty(e,t){this.object().setProperty&&this.object().setProperty(e,t)}hoverCursor(){return this._hoverCursor}setHoverCursor(e){this._hoverCursor=e}activeCursor(){return this._activeCursor||this.hoverCursor()}setActiveCursor(e){this._activeCursor=e}activate(e){}deactivate(e){}hover(){}unhover(){}contains(e,t,r){return this.object().contains(e,t,r)}snapToGrid(e){e.contains(this.object().snapPoint())||this._moveReferencePointToGrid(e)}_moveReferencePointToGrid(e){const t=this.object().snapPoint(),r=e.closestPointTo(t).subtract(t);this.moveBy(r.x(),r.y())}moveFromTo(e,t,r,n){return this.object().moveFromTo?this.object().moveFromTo(e,t,r,n):this.moveBy(r-e,n-t)}moveBy(e,t){return this.deltaIsSignificant(e,t)&&this._moveBy(e,t)}deltaIsSignificant(e,t){const r=Math.DEFAULT_TOLERANCE;return Math.abs(e)+Math.abs(t)>r}_moveBy(e,t){return this.object().moveBy(e,t)}selectableComponent(){}validWhen(){return this._validWhen}setValidWhen(e){this._validWhen=e}draw(e,t){}drawSelected(e,t){}indicatorProperties(){return{fillStyle:"rgba(255,212,93, 0.5)",strokeStyle:"#FFD45D",_pixelLineWidth:3,globalAlpha:".8"}}}Handle.VALID_FOR_HOVER=c,Handle.VALID_FOR_SELECTED="selected";var u=Handle},9852:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(62048),p=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(39344));class ImageComponentHandle extends p.default{selectableComponent(){return this.object().model()}figure(){return this.object()}draw(e){e._alterAndRestoreAfter((()=>{e.lineWidth=4,e.strokeStyle="#FFD45D",e.fillStyle="rgba(255, 255, 255, 0.0)",e.globalAlpha=".8",e._drawPolygon(this.selectableComponent().boundingShape())}))}drawSelected(e){e._alterAndRestoreAfter((()=>{e.lineWidth=4,e.strokeStyle="rgba(91, 178, 228, 0.8)",e.fillStyle="rgba(255, 255, 255, 0.0)",e._drawPolygon(this.selectableComponent().boundingShape()),this.figure().handles().fastFilter((e=>e.object()instanceof h.Locator)).forEach((t=>t.draw(e)))}))}}var m=ImageComponentHandle},72094:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>y}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=r(62048),m=d(r(60562)),f=d(r(39344)),g=d(r(52032));class ImageCornerHandle extends g.default{constructor(e,t,r){super(e,r);const n=e.subtract(t.first()),i=e.subtract(t.last());this._diagonal=n.add(i).normalized(),this._adjacentLocators=t}figure(){return this._figure}validWhen(){return f.default.VALID_FOR_SELECTED}selectableComponent(){return this.figure().model()}diagonal(){return this._diagonal}radius(e){return 10/e}tolerance(e){return this.radius(e)}_moveBy(e,t){const r=this._preserveAspectRatio(e,t);let n;return this._adjacentLocators.forEach((e=>{const t=this.object().to(e),i=t.normal().multipliedBy(t.normal().dot(r));n=t.moveBy(i.x(),i.y())})),n&&this.figure().model().shapeUpdated(),n}_preserveAspectRatio(e,t){const r=this.diagonal().dot((0,p.$P)(e,t));return this.diagonal().multipliedBy(r)}draw(e){const t=e.runningScaleX(),r=new m.default(this.object(),this.radius(t));r.updateProperties({strokeStyle:"#000000",_pixelLineWidth:1,fillStyle:"#FFFFFF"}),r.draw(e)}}var y=ImageCornerHandle},52032:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(80387));class LocatorHandle extends h.default{tolerance(e){return 6/e}highlightSize(e){return 4/e}contains(e,t,r=1){return this.object().distanceTo(e,t)<this.tolerance(r)}draw(e){const t=e.runningScaleX(),r=this.highlightSize(t),n=this._makeFigureFromPoints([this.object().add(r,r),this.object().add(r,-r),this.object().add(-r,-r),this.object().add(-r,r)]);n.updateProperties({strokeStyle:"rgba(255, 255, 255, 0.0)",fillStyle:"#FFD45D",globalAlpha:".8"}),n.draw(e)}_makeFigureFromPoints(e){const t=["LocatorHandle.prototype._makeFigureFromPoints() is installed when PolygonFigure is loaded/imported.","If you see this error, you may resolve it with a manual import (or require) of PolygonFigure.","Alternatively, import (or require) LocatorHandle through the drawing-editor index file."].join("\n");throw new Error(t)}}var p=LocatorHandle},80387:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(39344));class ResizingHandle extends h.default{constructor(e,t){super(e),this._figure=t}activate(e){super.activate(e),this._figure.setProperty("Annotations",!0)}deactivate(e){super.deactivate(e),this._figure.setProperty("Annotations",!1)}}var p=ResizingHandle},50602:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(62048),p=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(39344));class RotationHandle extends p.default{constructor(e,t,r){super(t),this._model=e,this._center=r}selectableComponent(){return this.model()}validWhen(){return p.default.VALID_FOR_SELECTED}model(){return this._model}center(){return this._center}_pixelsToDrawingUnits(e){return e/this.scale()}_setScale(e){this._scale=e}scale(){return this._scale??1}moveFromTo(e,t,r,n){const i=this.center().to((0,h.$P)(r,n)).angle()+(this.model().angle()-this.center().to(this.object()).angle());return this.model().setAngle(i),!0}contains(e,t,r){return this._setScale(r),this._hitTestRegion().contains(e,t)}_hitTestRegion(){const e=this._centerToCornerEdge(),t=this._interiorLocator(e),r=this._hitTestRegionCenter(e,t),n=this._hitTestRegionExterior(e,r),i=this._hitTestRegionStart(e,r),s=this._hitTestRegionEnd(e,r);return new h.Polygon([t,i,n,s])}_hitTestRegionCenter(e,t){const r=this._radius()-this._pixelsToDrawingUnits(2);return t.add(new h.PolarCoordinate(r,e.theta()))}_hitTestRegionExterior(e,t){const r=this._pixelsToDrawingUnits(12);return t.add(e.direction().multipliedBy(r))}_hitTestRegionStart(e,t){const r=this._pixelsToDrawingUnits(20);return t.add(e.normal().multipliedBy(r))}_hitTestRegionEnd(e,t){const r=this._pixelsToDrawingUnits(20);return t.add(e.normal().multipliedBy(-r))}_interiorLocator(e){return new h.NormalToEdgeLocator(new h.ProportionalEdgeLocator(e,1),0,this._offsetAlongEdge())}_centerToCornerEdge(){return this.center().to(this.object())}draw(e){this._setScale(e.runningScaleX());const t=this._centerToCornerEdge(),r=this._interiorLocator(t),n=this._startArcAngleFromHorizontal(t),i=this._endArcAngleFromHorizontal(t);e._alterAndRestoreAfter((()=>{this.drawArcOutline(e,r,n,i),this.drawArrowHeads(e,r,n,i),this.drawMainArcSection(e,r,n,i)}))}drawArcOutline(e,t,r,n){this.setOutlineProperties(e);const i=this._lineWidth()/2,s=this._smallLineWidth()/2;this._drawArc(e,t,this._radius()+(i+s),r,n),this._drawArc(e,t,this._radius()-(i+s),r,n)}drawMainArcSection(e,t,r,n){e.strokeStyle=this._mainFillColor(),e.lineWidth=this._lineWidth();const i=5..degreesToRadians();this._drawArc(e,t,this._radius(),r+i,n-i)}_drawArc(e,t,r,n,i){e.beginPath(),e.arc(t.x(),t.y(),r,n,i,!0),e.stroke()}drawArrowHeads(e,t,r,n){this.setOutlineProperties(e),this.drawBeginArrowHead(e,t,r),this.endBeginArrowHead(e,t,n)}drawBeginArrowHead(e,t,r){this._drawArrowhead(e,this._beginArrowHeadTipLocator(t,r),r+Math.PI_2)}_beginArrowHeadTipLocator(e,t){const r=new h.PolarCoordinate(this._radius(),t),n=this._arrowHeadLength()-this._pixelsToDrawingUnits(2),i=new h.PolarCoordinate(n,t+Math.PI_2);return e.add(r).add(i)}endBeginArrowHead(e,t,r){this._drawArrowhead(e,this._endArrowHeadTipLocator(t,r),r-Math.PI_2)}_endArrowHeadTipLocator(e,t){const r=new h.PolarCoordinate(this._radius(),t),n=this._arrowHeadLength()-this._pixelsToDrawingUnits(2),i=new h.PolarCoordinate(n,t-Math.PI_2);return e.add(r).add(i)}_drawArrowhead(e,t,r){e._drawArrowhead(t,r,this._arrowHeadLength(),this._arrowheadAngle()),e.stroke()}_radius(){return this._pixelsToDrawingUnits(15)}_endArcAngleFromHorizontal(e){return e.theta()-this._arcAngleOffset()}_startArcAngleFromHorizontal(e){return e.theta()+this._arcAngleOffset()}_arcAngleOffset(){return Math.PI/8}_arrowHeadWidth(){return this._pixelsToDrawingUnits(16)}_arrowHeadLength(){return this._pixelsToDrawingUnits(12)}_arrowheadAngle(){return Math.atan(this._arrowHeadWidth()/2/this._arrowHeadLength())}_offsetAlongEdge(){return(Math.max(this._pixelsToDrawingUnits(10),5)+this._lineWidth()/2)/Math.cos(Math.PI_4)-this._radius()}_lineWidth(){return this._pixelsToDrawingUnits(5)}_smallLineWidth(){return this._pixelsToDrawingUnits(1)}_mainFillColor(){return"rgba(91, 178, 228)"}_outlineColor(){return"#000000"}setOutlineProperties(e){e.fillStyle=this._mainFillColor(),e.strokeStyle=this._outlineColor(),e.lineWidth=this._smallLineWidth()}}var m=RotationHandle},23855:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(39344));class SideHandle extends h.default{contains(e,t){return this.object().boundingCube?this.object().boundingCube().leftSide().contains(e,t):this.object().contains(e,0)}moveFromTo(e,t,r,n){const i=r-e,s=n-t;return this.moveBy(i,s)}_moveBy(e,t){return this.object().moveBy(0,e,t)}}var p=SideHandle},78210:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(26279));class TextAnnotationHandle extends h.default{selectableComponent(){return this.object().model()}}var p=TextAnnotationHandle},26279:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>f}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(57411)),m=d(r(39344));class TextHandle extends m.default{constructor(e,t,r,n,i){super(e),this._textEditor=new p.default(t,r,n),this._populateIfNecessaryFn=i}draw(e){const t=this._textGeometry().shape(e).insettedBy(-2);e._alterAndRestoreAfter((()=>{e.lineWidth=4,e.strokeStyle="#FFD45D",e.fillStyle="rgba(255, 255, 255, 0.0)",e.globalAlpha=".8",e._drawRectangle(t)}))}drawSelected(e){e._alterAndRestoreAfter((()=>{const t=this._textGeometry().shape(e).insettedBy(-2);e.lineWidth=4,e.strokeStyle="rgba(91, 178, 228, 0.8)",e.fillStyle="rgba(255, 255, 255, 0.0)",e._drawRectangle(t)}))}_textGeometry(){return this.textEditor().textGeometry()}keyDown(e){return"ArrowLeft"===e?(this.textEditor().retreatCursor(),!1):"ArrowRight"===e?(this.textEditor().advanceCursor(),!1):"Backspace"===e?(this.textEditor().backspace(),!0):1===e.length&&(this.textEditor().insertText(e),!0)}contains(e,t,r){return this._textGeometry().contains(e,t,r)}textEditor(){return this._textEditor}text(){return this.textEditor().text()}populateIfNecessary(){this._populateIfNecessaryFn()}}var f=TextHandle},14995:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>b}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(75035)),m=d(r(39344)),f=d(r(16850)),g=d(r(68414)),y=d(r(87456));class ComponentSelectionTool extends g.default{constructor(e,t){super(e),this._active=!1,this._zoomPalette=t,this._multiSelectModifierKeys=["shiftKey"]}mouseButtonToActivate(){return y.default.PRIMARY_MOUSE_BUTTON}multiSelectModifierKeys(){return this._multiSelectModifierKeys}setMultiSelectModifierKeys(...e){this._multiSelectModifierKeys=e}zoomPalette(){return this._zoomPalette}isActive(){return this._active}activate(){this.isActive()||(this._active=!0,this.panZoomTool().activate(),this.registerKeyboardShortcuts())}deactivate(){this.isActive()&&(this._active=!1,this.panZoomTool().deactivate(),this.unregisterKeyboardShortcuts())}panZoomTool(){return this._panZoomTool||(this._panZoomTool=new f.default(this._controller(),this.zoomPalette())),this._panZoomTool}setPanTool(e){this.panZoomTool().setPanTool(e)}panTool(){return this.panZoomTool().panTool()}didPan(){return this.panZoomTool().didPan()}setZoomTool(e){this.panZoomTool().setZoomTool(e)}zoomTool(){return this.panZoomTool().zoomTool()}didZoom(){return this.panZoomTool().didZoom()}displayName(){return"Select"}select(e){this._updateSelection(e)}_modifyingCurrentSelection(){return this._controller().selection()&&this._multiSelectMode}_updateSelection(e){e?e instanceof p.default?this._controller().setSelection(e):this._modifyingCurrentSelection()?this._controller().selection().includes(e)?this._controller().removeFromSelection(e):this._controller().addToSelection(e):this._controller().select(e):this._controller().clearSelection()}_resetSelection(){this._controller().clearSelection()}recordChange(){this._didChange=!0}clearChange(){this._didChange=!1}didChange(){return this._didChange}setActiveHandle(e){this._activeHandle&&this._setDefaultCursor(),this._activeHandle=e,this._setCursorIfProvided(this._activeHandle?.activeCursor())}activeHandle(){return this._activeHandle}setHoveredHandle(e){e!==this._hoveredHandle&&(this._hoveredHandle&&(this._hoveredHandle.unhover(),this._setDefaultCursor()),this._hoveredHandle=e,this._hoveredHandle&&(this._hoveredHandle.hover(),this._setCursorIfProvided(this._hoveredHandle.hoverCursor())))}hoveredHandle(){return this._hoveredHandle}_setCursorIfProvided(e){e&&this._controller().setCursor(e)}_setDefaultCursor(){this._controller().setDefaultCursor()}_topHandleUnderCursor(e,t,r){return this._topHandleOfSelectedComponent(e,t,r)||this._topHoverHandle(e,t,r)}_allHandlesUnderCursor(e,t,r,n){return this._controller().handlesAt(e,t,r,n)}_topHandleOfSelectedComponent(e,t,r){const n=this._controller().selection();if(n&&!this._modifyingCurrentSelection()){return(n.handlesAt(e,t,{scale:r,layerManager:this._controller().layerManager(),validWhen:[m.default.VALID_FOR_HOVER,m.default.VALID_FOR_SELECTED]})||[]).shift()}}_topHoverHandle(e,t,r){return this._allHandlesUnderCursor(e,t,r,[m.default.VALID_FOR_HOVER]).first()}_updateHoveredHandle(e,t,r){const n=this._topHandleUnderCursor(e,t,r);(!n&&this.hoveredHandle()||n&&!n.equals(this.hoveredHandle()))&&(this.setHoveredHandle(n),this._controller().draw())}_setMultiSelectMode(e){e&&(this._multiSelectMode=this.multiSelectModifierKeys().some((t=>e[t])))}mouseDown(e,t,r={}){this._setMultiSelectMode(r),this.panZoomTool().mouseDown(e,t,r),this.didPanOrZoom()||(this.isMouseButtonInUse(this.mouseButtonToActivate(),r)||this._isTouchEvent(r.event))&&this._activateHandlesAt(e,t,r)}_activateHandlesAt(e,t,r){this._lastX=e,this._lastY=t,this.clearChange();const n=this._topHandleUnderCursor(e,t,r.scale);this.setHoveredHandle(void 0),this.setActiveHandle(n),this.activeHandle()?(this.activeHandle().activate(this),this._controller().draw()):this._controller().clearSelection()}mouseMove(e,t,r={}){this._setMultiSelectMode(r),this.panZoomTool().mouseMove(e,t,r),this.didPanOrZoom()||this._updateHoveredHandle(e,t,r.scale)}mouseDrag(e,t,r={}){let n=!1;if(this.isMouseButtonInUse(this.mouseButtonToActivate(),r)||this._isTouchEvent(r.event)){const r=this.activeHandle();if(r){r.setProperty("ShapeOnly",!0);r.moveFromTo(this._lastX,this._lastY,e,t)&&(this._controller().draw(),this.recordChange(),this._lastX=e,this._lastY=t),n=!0}}n||this.panZoomTool().mouseDrag(e,t,r)}async mouseUp(e,t,r={}){let n=!1;if(this.isMouseButtonInUse(this.mouseButtonToActivate(),r)||this._isTouchEvent(r.event)){const e=this.activeHandle();if(e){this._deactivateHandle();const t=e.selectableComponent();this._updateSelection(t),this.didChange()&&await this._controller().snapshotProject(),this._controller().redraw(),n=!0}}n||this.panZoomTool().mouseUp(e,t,r),this._multiSelectMode=!1,this._lastX=void 0,this._lastY=void 0,this.setActiveHandle(void 0)}_deactivateHandle(){this.activeHandle().setProperty("ShapeOnly",!1),this.activeHandle().deactivate(this)}mouseScroll(e){this.panZoomTool().mouseScroll(e)}multiTouchMove(e,t,r){this.panZoomTool().multiTouchMove(e,t,r)}multiTouchStart(e,t,r){this.panZoomTool().multiTouchStart(e,t,r),this.activeHandle()&&(this._deactivateHandle(),this.setActiveHandle(void 0),this.didChange()&&this._controller().snapshotProjectAndRedraw())}multiTouchEnd(e,t,r){this.panZoomTool().multiTouchEnd(e,t,r)}draw(e,t){this.hoveredHandle()&&this.hoveredHandle().draw(e,t),this.activeHandle()&&this.activeHandle().draw(e,t)}_keyboardShortcuts(){return{_resetSelection:[{keys:"esc"}]}}registerKeyboardShortcuts(){this._controller().shortcutManager().registerShortcuts(this._keyboardShortcuts(),this)}unregisterKeyboardShortcuts(){this._controller().shortcutManager().unregisterShortcuts(this._keyboardShortcuts(),this)}}var b=ComponentSelectionTool},16850:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>b}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(73155)),m=d(r(68414)),f=d(r(10917)),g=d(r(32049)),y=d(r(10789));class CompositePanZoomTool extends m.default{constructor(e,t){super(e),this._active=!1,this._zoomPalette=t}isActive(){return this._active}activate(){this.isActive()||(this._active=!0,this._didPan=void 0,this._didZoom=void 0,this.registerKeyboardShortcuts())}deactivate(){this.isActive()&&(this._active=!1,this.panTool().deactivate(),this.zoomTool().deactivate(),this._controller().setDefaultCursor(),this.unregisterKeyboardShortcuts())}setPanTool(e){this._panTool=e}defaultPanTool(){const e=this._controller();return new p.default(e,new g.default(e),{touchesToActivate:2})}panTool(){return this._panTool||(this._panTool=this.defaultPanTool()),this._panTool}panningEnabled(){return this.panTool().isActive()}didPan(){return this._didPan}disablePanning(){return this.panTool().deactivate()}enablePanning(){return this.panTool().activate()}setZoomTool(e){this._zoomTool=e}defaultZoomTool(){const e=this._controller(),t=new y.default(e,this._zoomPalette);return new f.default(e,t)}zoomTool(){return this._zoomTool||(this._zoomTool=this.defaultZoomTool()),this._zoomTool}didZoom(){return this._didZoom}didPanOrZoom(){return this.didPan()||this.didZoom()}mouseDown(e,t,r){this._didPan=this.panTool().mouseDown(e,t,r),this._didZoom=this.zoomTool().mouseDown(e,t,r)}mouseMove(e,t,r){this._didPan=this.panTool().mouseMove(e,t,r),this._didZoom=this.zoomTool().mouseMove(e,t,r)}mouseDrag(e,t,r={}){this._didPan=this.panTool().mouseDrag(e,t,r),this._didZoom=this.zoomTool().mouseDrag(e,t,r)}mouseUp(e,t,r){this._didPan=this.panTool().mouseUp(e,t,r),this._didZoom=this.zoomTool().mouseUp(e,t,r)}mouseScroll(e){this._didPan=this.panTool().mouseScroll(e),this._didZoom=this.zoomTool().mouseScroll(e)}multiTouchMove(e,t,r){this._didPan=this.panTool().multiTouchMove(e,t,r),this._didZoom=this.zoomTool().multiTouchMove(e,t,r)}multiTouchStart(e,t,r){this._didPan=this.panTool().multiTouchStart(e,t,r),this._didZoom=this.zoomTool().multiTouchStart(e,t,r)}multiTouchEnd(e,t,r){this._didPan=this.panTool().multiTouchEnd(e,t,r),this._didZoom=this.zoomTool().multiTouchEnd(e,t,r)}_keyboardShortcuts(){return{}}registerKeyboardShortcuts(){this._controller().shortcutManager().registerShortcuts(this._keyboardShortcuts(),this),this.panTool().registerKeyboardShortcuts(),this.zoomTool().registerKeyboardShortcuts()}unregisterKeyboardShortcuts(){this.panTool().unregisterKeyboardShortcuts(),this.zoomTool().unregisterKeyboardShortcuts(),this._controller().shortcutManager().unregisterShortcuts(this._keyboardShortcuts(),this)}}var b=CompositePanZoomTool},22479:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(87456));class CutCornerTool extends h.default{displayName(){return"Cut"}_handles(){return this._drawing().modifiableCornerHandles(48)}draw(e){this._handles().forEach((t=>t.draw(e)))}mouseMove(e,t){this._controller().draw()}setActiveHandle(e){this._activeHandle=e}activeHandle(){return this._activeHandle}mouseDown(e,t,{scale:r=1}={}){const n=this._handles().filter((n=>n.contains(e,t,r)));this.setActiveHandle(n.first())}mouseUp(e,t){this.activeHandle()&&(this.activeHandle().cutCorner(24),this._controller().snapshotProjectAndRedraw())}}var p=CutCornerTool},24653:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(50988),p=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(87456));class DraggableComponentTool extends p.default{activate(){this._beforeAddToDrawing(0,0),this._addToDrawing(0,0),this._afterAddToDrawing(0,0),this._controller().draw()}_addToDrawing(e,t){throw new h.MissingOverride(this,"_addToDrawing")}_beforeAddToDrawing(e,t){this._lastX=e,this._lastY=t}_afterAddToDrawing(e,t){this._drawing().updateFigures()}mouseMove(e,t){const r=e-(this._lastX||0),n=t-(this._lastY||0);this.moveBy(r,n),this._lastX=e,this._lastY=t}moveBy(e,t){}mouseUp(e,t){this.mouseMove(e,t),this.deactivate()}deactivate(){this._finalize(),this._lastX=null,this._lastY=null}_finalize(){throw new h.MissingOverride(this,"finalize")}}var m=DraggableComponentTool},37588:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(50988),p=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(16850));class FreeFormDrawingTool extends p.default{drawingActive(){return this._drawingActive}_startDrawing(e,t){this._drawingActive=!0}async _stopDrawing(e,t){this._drawingActive=!1}_discardDrawing(){this._drawingActive=!1}_continueDrawing(e,t){}mouseDown(e,t,r){this.isActive()&&(super.mouseDown(e,t,r),this.didPanOrZoom()||this._startDrawing(e,t))}async mouseUp(e,t,r={}){this.isActive()&&(super.mouseUp(e,t,r),this.didPanOrZoom()||this.drawingActive()&&await this._stopDrawing(e,t))}mouseDrag(e,t,r={}){this.isActive()&&(super.mouseDrag(e,t,r),this.didPanOrZoom()||this.drawingActive()&&(super.mouseMove(e,t,r),this._continueDrawing(e,t)))}multiTouchStart(e,t,r){this.drawingActive()&&this._discardDrawing(),super.multiTouchStart(e,t,r)}multiTouchMove(e,t,r){this.drawingActive()&&this._discardDrawing(),super.multiTouchMove(e,t,r)}multiTouchEnd(e,t,r){this.drawingActive()&&this._discardDrawing(),super.multiTouchEnd(e,t,r)}deactivateSelf(){this.deactivate(),this.notifySelfDeactivationEventObservers()}_keyboardShortcuts(){return{...super._keyboardShortcuts(),deactivateSelf:[{keys:"escape"}]}}}(0,h.simpleObserver)(FreeFormDrawingTool,"selfDeactivationEvent");var m=FreeFormDrawingTool},67204:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>f}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(48713)),m=d(r(37588));class FreeFormSelectionTool extends m.default{constructor(...e){super(...e),this._displayName="Free Form Select"}deactivate(){this.isActive()&&(super.deactivate(),this._resetBoundary())}setDisplayName(e){this._displayName=e}displayName(){return this._displayName}selectionBoundary(){return this._selectionBoundary}_resetBoundary(){this._selectionBoundary=void 0}_startDrawing(e,t){super._startDrawing(e,t),this._selectionBoundary=new p.default(this._controller().selectionFactory()),this._selectionBoundary.addVertex(e,t)}selectableComponents(){return this._getSelectableComponents?this._getSelectableComponents():this._controller().project().parts()}setSelectableComponentsQuery(e){this._getSelectableComponents=e}async _stopDrawing(e,t){this._selectionBoundary.addVertex(e,t);const r=this.selectionBoundary().selectComponents(this.selectableComponents());this._controller().setSelection(r),this._controller().redraw(),await this.deactivateSelf()}_continueDrawing(e,t){this.selectionBoundary().addVertex(e,t),this._controller().redraw()}draw(e){this.selectionBoundary()&&this.selectionBoundary().figure().draw(e)}}var f=FreeFormSelectionTool},8362:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>g}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=r(62048),m=d(r(14687)),f=d(r(16850));class MeasurementTool extends f.default{displayName(){return"MeasurementTool"}activate(){this.isActive()||(super.activate(),this._controller().setCursor(this._activeCursor()),this._controller().clearSelection())}deactivate(){this.isActive()&&(super.deactivate(),this._removeAnnotation()&&this._controller().redraw(),this._resetState())}isClick(){return!this.panTool().didDrag()}_removeAnnotation(){let e=!1;return this.currentAnnotation()&&(this.currentAnnotation().delete(),e=!0),e}_resetState(){this._annotation=void 0}_activeCursor(){return"crosshair"}currentAnnotation(){return this._annotation}async mouseUp(e,t,r={}){this.isActive()&&(await super.mouseUp(e,t,r),!this.didPanOrZoom()&&this.isClick()&&(this.currentAnnotation()?(this._moveEndpointTo(e,t),this._annotation=void 0,await this._controller().snapshotProjectAndRedraw()):(this._createModel(e,t),this._controller().draw())))}unit(){return this._unit||"in"}setUnit(e){this._unit=e}_createModel(e,t){const r=this._controller().project().referencePoint();this._annotation=new m.default(new p.Edge((0,p.$P)(e,t),(0,p.$P)(e,t)),this.unit(),r),this._controller().project().add(this._annotation)}_moveEndpointTo(e,t){const r=this.currentAnnotation().edge().end();r.moveBy(e-r.x(),t-r.y())}mouseMove(e,t,r){this.isActive()&&(super.mouseMove(e,t,r),this.didPanOrZoom()||this.currentAnnotation()&&(this._moveEndpointTo(e,t),this._controller().redraw()))}}var g=MeasurementTool},73155:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(19302));class MoveViewportTool extends h.default{constructor(e,t,r){super(e,r),this._interactionOperation=t}interactionOperation(){return this._interactionOperation}wasMultiTouch(){return this._wasMultiTouch}didDrag(){return this._didDrag}activate(){super.activate(),this._didDrag=!1}deactivate(){super.deactivate(),this._wasMultiTouch=!1}lastX(){return this._lastX}lastY(){return this._lastY}mouseDown(e,t,r={}){return this._didDrag=!1,(this.isActive()||this._activateByMouse(r)||this._activateByTouches(r))&&(this._lastX=e,this._lastY=t),super.mouseDown(e,t,r)}mouseMove(e,t,r={}){return(this.isActive()||this._activateByMouse(r)||this._activateByTouches(r))&&(this._lastX=e,this._lastY=t),super.mouseMove(e,t,r)}mouseDrag(e,t,r={}){return void 0===this.lastX()||void 0===this.lastY()?this.mouseDown(e,t,r):(this._didDrag||=this._isDragSignificant(this.lastX(),this.lastY(),e,t,r),!!this.didDrag()&&(super.mouseDrag(e,t,r),!!this.isActive()&&(!this._isMultiTouchEvent(r.event)&&(this.interactionOperation().apply(this.lastX(),this.lastY(),e,t,r),this._dragHandled(e,t),!0))))}_dragHandled(e,t){this._didDrag=!0}mouseUp(e,t,r={}){return this._lastX=void 0,this._lastY=void 0,super.mouseUp(e,t,r)}multiTouchStart(e,t,r={}){return this.mouseDown(e,t,r),this._wasMultiTouch=!0,super.multiTouchStart(e,t,r)}multiTouchMove(e,t,r={}){return super.multiTouchMove(e,t,r),!!this.isActive()&&(this.wasMultiTouch()?(this._wasMultiTouch=!0,this.interactionOperation().apply(this.lastX(),this.lastY(),e,t,r),this._dragHandled(e,t),!0):this.multiTouchStart(e,t,r))}multiTouchEnd(e,t,r){return this.mouseUp(e,t,r),super.multiTouchEnd(e,t,r)}}var p=MoveViewportTool},2157:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(87456));class NotchCornerTool extends h.default{displayName(){return"Notch"}_handles(){return this._drawing().modifiableCornerHandles(48)}draw(e){this._handles().forEach((t=>t.draw(e)))}mouseMove(e,t){this._controller().draw()}setActiveHandle(e){this._activeHandle=e}activeHandle(){return this._activeHandle}mouseDown(e,t,{scale:r=1}={}){const n=this._handles().filter((n=>n.contains(e,t,r)));this.setActiveHandle(n.shift())}mouseUp(e,t){this.activeHandle()&&(this.activeHandle().notchCorner(24),this._controller().snapshotProjectAndRedraw())}}var p=NotchCornerTool},68414:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(50988),p=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(87456));class PanningZoomingTool extends p.default{setPanTool(e){throw new h.MissingOverride(this,"setPanTool")}panTool(){throw new h.MissingOverride(this,"panTool")}didPan(){throw new h.MissingOverride(this,"didPan")}panningEnabled(){return this.panTool().isActive()}disablePanning(){return this.panTool().deactivate()}enablePanning(){return this.panTool().activate()}setZoomTool(e){throw new h.MissingOverride(this,"setZoomTool")}zoomTool(){throw new h.MissingOverride(this,"zoomTool")}didZoom(){throw new h.MissingOverride(this,"didZoom")}didPanOrZoom(){return this.didPan()||this.didZoom()}}var m=PanningZoomingTool},41959:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(87456));class SnappingTool extends h.default{activate(){this._active=!0}deactivate(){this._active=!1}isActive(){return this._active}snapToGrid(e){this.isActive()&&e.snapToGrid(this._controller().backgroundGrid())}}var p=SnappingTool},32867:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>b}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=r(62048),m=r(50988),f=d(r(90963)),g=d(r(39344)),y=d(r(87456));class TextTool extends y.default{displayName(){return"Text"}activate(){this._controller().setCursor("text")}deactivate(){this._finalizeWorkInProgress(),this._controller().setDefaultCursor()}draw(e){this._controller()._projectLayers().forEach((t=>{e[t]=this._controller().shouldShowLayer(t)})),this.cursor()&&this.cursor().defaultFigure().draw(e),this.activeHandle()&&this.activeHandle().draw(e)}mouseDown(e,t){this._clickedInActiveTarget(e,t)||this._finalizeWorkInProgress()}mouseUp(e,t){this._clickedInActiveTarget(e,t)?this._placeCursorInText(e):this._isTextAtLocation(e,t)?(this._selectTarget(e,t),this._enableEditing(),this._placeCursorInText(e)):(this._createTargetAt(e,t),this._selectTarget(e,t),this._enableEditing())}mouseMove(e,t){const r=this._textAtLocation(e,t)||new g.default({});!r.equals(this.activeHandle())&&(this.setActiveHandle(r),this._controller().draw())}keyDown(e){this.target()&&("Enter"===e?this._finalizeWorkInProgress():this.targetHandle().keyDown(e)?this._controller().snapshotProjectAndRedraw():this._controller().redraw())}activeHandle(){return this._activeHandle}setActiveHandle(e){this._activeHandle=e}setCreator(e){this._creator=e}creator(){return this._creator||(this._creator=(e,t,r)=>new f.default(void 0,t,r)),this._creator}cursor(){return this.textEditor()&&this.textEditor().cursor()}target(){return this.targetHandle()&&this.targetHandle().object()}targetHandle(){return this._targetHandle}setTargetHandle(e){this._targetHandle=e}textEditor(){return this.targetHandle()&&this.targetHandle().textEditor()}_getCanvasContext(){return this._controller().canvas().getContext("2d")}_handles(){return this._drawing().textHandles()}_createTargetAt(e,t){const r=this.creator()("",this._createRelativeLocator(e,t),this._createRelativeLocator(e,t));this._controller().addComponent(r)}_clickedInActiveTarget(e,t){return this.target()&&this.target().contains(e,t,this._getCanvasContext())}_selectTarget(e,t){this.setTargetHandle(this._handles().find((r=>r.contains(e,t,this._getCanvasContext())))),this.setActiveHandle(void 0)}_isTextAtLocation(e,t){return this._handles().some((r=>r.contains(e,t,this._getCanvasContext())))}_textAtLocation(e,t){return this._handles().find((r=>r.contains(e,t,this._getCanvasContext())))}_trimTargetText(){this.textEditor().trimText()}_enableEditing(){this._controller().showLayer("TextCursor"),this._blinkCursor()}_disableCursor(){clearTimeout(this._cursorTimeoutId),this._controller().redraw()}_blinkCursor(){this._cursorTimeoutId=setTimeout((()=>{this._controller().toggleLayer("TextCursor"),this._controller().redraw(),this._blinkCursor()}),500)}_placeCursorInText(e){const t=this.cursor().defaultFigure().roundLocationToNearestCharacter(this._getCanvasContext(),e);this.cursor().moveCursorAfterSubstring(t),this._controller().redraw()}_createRelativeLocator(e,t){const r=this._source(),n=e-r.x(),i=t-r.y();return new p.RelativeLocator(r,n,i)}_finalizeWorkInProgress(){this.target()&&(this._isTargetUseless()?(this._controller().removeComponent(this.target().model()),this._forgetCurrentTargetHandle()):(this._forgetCurrentTargetHandle(),this.notifyCreationObservers()),this._disableCursor())}_isTargetUseless(){return this._trimTargetText(),this.targetHandle().populateIfNecessary(),this.textEditor().isEmptyText()}_forgetCurrentTargetHandle(){this._targetHandle=void 0}_source(){return this._controller().project().referencePoint()}}(0,m.simpleObserver)(TextTool,"creation");var b=TextTool},87456:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>a}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));class Tool{constructor(e){this._controllerObj=e}activate(){}deactivate(){}keyDown(e){}isMouseButtonInUse(e,t){if(0===t.buttons){if(e===Tool.PRIMARY_MOUSE_BUTTON)return 0===t.button;if(e===Tool.SECONDARY_MOUSE_BUTTON)return 2===t.button;if(e===Tool.AUXILIARY_MOUSE_BUTTON)return 1===t.button}else{if(e===Tool.PRIMARY_MOUSE_BUTTON)return 1===t.buttons;if(e===Tool.SECONDARY_MOUSE_BUTTON)return 2===t.buttons;if(e===Tool.AUXILIARY_MOUSE_BUTTON)return 4===t.buttons}return!1}_isDragSignificant(e,t,r,n,{event:i}={}){const s=r-e,o=n-t,a=this._isTouchEvent(i)?this.singleTouchTolerance():this.mouseTolerance();return s*s+o*o>a*a}singleTouchTolerance(){return this._touchTolerance??10}setSingleTouchTolerance(e){this._touchTolerance=e}mouseTolerance(){return this._mouseTolerance??1}setMouseTolerance(e){this._mouseTolerance=e}_getTouches(e){return e&&e.touches?e.touches.length:0}_getChangedTouches(e){return e&&e.changedTouches?e.changedTouches.length:0}_isTouchEvent(e={}){const t=this._getTouches(e),r=this._getChangedTouches(e);return 1===t||0===t&&1===r}_isMultiTouchEvent(e={}){const t=this._getTouches(e),r=this._getChangedTouches(e);return t>1||0===t&&r>1}mouseDown(e,t,r){}doubleClick(e,t,r){}mouseMove(e,t,r){}mouseDrag(e,t,r){this.mouseMove(e,t,r)}mouseUp(e,t,r){}mouseScroll(e){}contextMenu(e,t,r){}multiTouchStart(e,t,r){}multiTouchMove(e,t,r){}multiTouchEnd(e,t,r){}draw(e,t){}displayName(){return"Tool"}registerKeyboardShortcuts(){}unregisterKeyboardShortcuts(){}_controller(){return this._controllerObj}_drawing(){return this._controller().drawing()}}Tool.PRIMARY_MOUSE_BUTTON="primary",Tool.SECONDARY_MOUSE_BUTTON="secondary",Tool.AUXILIARY_MOUSE_BUTTON="auxiliary";var a=Tool},19302:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(87456));class ToolWithLifecycle extends h.default{constructor(e,{mouseButtonsToActivate:t=[h.default.PRIMARY_MOUSE_BUTTON],touchesToActivate:r=1}={}){super(e),this._mouseButtonsToActivate=t,this._touchesToActivate=r,this._keyboardKeysToActivate=void 0}mouseButtonsToActivate(){return this._mouseButtonsToActivate}setMouseButtonsToActivate(e){this._mouseButtonsToActivate=e}setMouseButtonToActivate(e){this.setMouseButtonsToActivate([e])}touchesToActivate(){return this._touchesToActivate}setTouchesToActivate(e){this._touchesToActivate=e}keyboardKeysToActivate(){return this._keyboardKeysToActivate}setKeyboardKeysToActivate(e){const t=this._keyboardShortcutsRegistered;t&&this.unregisterKeyboardShortcuts(),this._keyboardKeysToActivate=e,t&&this.registerKeyboardShortcuts()}isActive(){return Boolean(this._isActive)}activate(){this.isActive()||(this._showCursor(),this._isActive=!0)}deactivate(){this.isActive()&&(this._hideCursor(),this._isActive=!1)}cursor(){return this._cursor??=this.defaultCursor()}defaultCursor(){return"grab"}setCursor(e){this._cursor=e}inProgressCursor(){return this._inProgressCursor??=this.defaultInProgressCursor()}defaultInProgressCursor(){return"grabbing"}setInProgressCursor(e){this._inProgressCursor=e}_showCursor(){this._existingCursor=this._controller().cursor(),this._controller().setCursor(this.cursor())}_showInProgressCursor(){this._controller().setCursor(this.inProgressCursor())}_hideInProgressCursor(){this.isActive()?this._controller().setCursor(this.cursor()):this._showOriginalCursor()}_showOriginalCursor(){this._controller().setCursor(this._existingCursor),this._existingCursor=void 0}_hideCursor(){this._showOriginalCursor()}mouseDown(e,t,r={}){if(this.isActive())return this._showInProgressCursor(),!0}mouseMove(e,t,r={}){return this.isActive()}mouseDrag(e,t,r={}){if(this._activateByMouse(r)||this._activateByTouches(r))return this.activate(),this._showInProgressCursor(),!0}mouseUp(e,t,r={}){const n=this.isActive();this._hideInProgressCursor(),this._activateByMouse(r)&&this.deactivate();const{event:i={}}=r;return this.isActive()&&i.changedTouches?.length>0&&this.deactivate(),n}multiTouchStart(e,t,r={}){return this.isActive()}multiTouchMove(e,t,r={}){if(this._activateByTouches(r))return this.activate(),!0}multiTouchEnd(e,t,r){return this.deactivate(),!0}_activateByMouse(e){return 0!==this.mouseButtonsToActivate().length&&this.mouseButtonsToActivate().some((t=>this.isMouseButtonInUse(t,e)))}_activateByTouches(e){const{event:t={}}=e;return this._getTouches(t)===this.touchesToActivate()}handleKeyboardEvent(e,t){"keyup"===e.type?this.deactivate():this.isActive()||this.activate()}_keyboardShortcuts(){return{handleKeyboardEvent:[{keys:this.keyboardKeysToActivate(),options:{keyup:!0}}]}}registerKeyboardShortcuts(){this._keyboardShortcutsRegistered=!0,this.keyboardKeysToActivate()&&this._controller().shortcutManager().registerShortcuts(this._keyboardShortcuts(),this)}unregisterKeyboardShortcuts(){this._keyboardShortcutsRegistered=!1,this.keyboardKeysToActivate()&&this._controller().shortcutManager().unregisterShortcuts(this._keyboardShortcuts(),this)}}var p=ToolWithLifecycle},10917:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(62048),p=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(87456));class ZoomViewportTool extends p.default{constructor(e,t){super(e),this._interactionOperation=t}interactionOperation(){return this._interactionOperation}lastMultiTouch(){return this._lastMultiTouch}lastX(){return this._lastX??0}lastY(){return this._lastY??0}activate(){super.activate(),this._didDrag=!1}deactivate(){super.deactivate(),this._wasMultiTouch=!1}zoomTo(e,t,r){this.interactionOperation().apply(e,t,r)}mouseMove(e,t,r){this._lastX=e,this._lastY=t}mouseUp(e,t,r={}){if(!this._isTouchEvent(r.event))return!1;const n=this.multiTouchInProgress();return 0===r.event.touches.length&&(this._lastMultiTouch=void 0),n}mouseScroll(e){const t=1-Math.min(e,749)/750;return this.zoomTo(this.lastX(),this.lastY(),t),!0}multiTouchInProgress(){return Boolean(this._lastMultiTouch)}multiTouchStart(e,t,r={}){return this._lastMultiTouch=r.event.touches,!0}multiTouchMove(e,t,r={}){const{event:n}=r;if(!this.multiTouchInProgress())return this.multiTouchStart(e,t,r);const i=n.touches;if(this._isZoomGesture(this.lastMultiTouch(),i)){const r=this._getTouchDistance(this.lastMultiTouch()),n=this._getTouchDistance(i)/r;this.zoomTo(e,t,n)}return this._lastMultiTouch=i,this.mouseMove(e,t),!0}multiTouchEnd(e,t,r){return this._lastMultiTouch=void 0,!0}_isZoomGesture(e,t){const r=this._getTouchDistance([e[0],t[0]]).isNearTo(0),n=this._getTouchDistance([e[1],t[1]]).isNearTo(0);return!(!(r||n)||!(!r||!n))||Math.abs(this._getTouchPathDivergence(e,t))>40..degreesToRadians()}_getTouchDistance(e){const t=[e[0],e[1]].map((e=>(0,h.$P)(e.pageX,e.pageY)));return t[0].to(t[1]).length()}_getTouchPathDivergence(e,t){const r=[e[0],e[1]].map((e=>(0,h.$P)(e.pageX,e.pageY))),n=[t[0],t[1]].map((e=>(0,h.$P)(e.pageX,e.pageY))),i=n[0].subtract(r[0]).theta();return n[1].subtract(r[1]).theta()-i}}var m=ZoomViewportTool},93126:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>a}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));var a=class InteractionOperation{constructor(e){this._controller=e}controller(){return this._controller}apply(){}}},14589:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(93126));class MovementOperation extends h.default{apply(e,t,r,n,i){}}var p=MovementOperation},32049:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(62048),p=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(14589));class PanOperation2D extends p.default{apply(e,t,r,n,i={}){const s=(0,h.$P)(r,n),o=(0,h.$P)(e,t),{scale:a=1,rotation:l=0}=i;0!==l&&(s.rotateBy((0,h.$P)(0,0),l),o.rotateBy((0,h.$P)(0,0),l));const c=s.subtract(o).multipliedBy(a);this.controller().translateBy(c.x(),c.y()),this.controller().draw()}}var m=PanOperation2D},60627:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(93126));class ZoomOperation extends h.default{apply(e,t,r){}}var p=ZoomOperation},10789:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(60627));class ZoomOperation2D extends h.default{constructor(e,t){super(e),this._zoomPalette=t}zoomPalette(){return this._zoomPalette}apply(e,t,r){this.zoomPalette().zoomBy(e,t,r)}}var p=ZoomOperation2D},90772:(e,t,r)=>{var n,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(l,{default:()=>u}),e.exports=(n=l,((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(n=s(t,l))||n.enumerable});return e})(i({},"__esModule",{value:!0}),n));var c=r(50988);var u=class AutosaveAdapter{constructor(e){this._autosaveableObject=e}autosaveableObject(){return this._autosaveableObject}canSave(){return!0}canSafeSave(){throw new c.MissingOverride}failureMessage(){throw new c.MissingOverride}registerCallback(e,t){throw new c.MissingOverride}removeCallback(e,t){throw new c.MissingOverride}async save(){throw new c.MissingOverride}async safeSave(){throw new c.MissingOverride}}},54639:(e,t,r)=>{var n,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(l,{default:()=>u}),e.exports=(n=l,((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(n=s(t,l))||n.enumerable});return e})(i({},"__esModule",{value:!0}),n));var c=r(50988);class AutosaveController{static _defaultConfig(){return{debounceTimeSeconds:2,maxWaitSeconds:30}}constructor(e){this._adapter=e,this._debounceTime=1e3*this._config().debounceTimeSeconds,this._maxWait=1e3*this._config().maxWaitSeconds,this._handleVisibilityChange=this._handleVisibilityChange.bind(this),this._handleWindowBlur=this._handleWindowBlur.bind(this),window.addEventListener("online",(e=>this.notifyOnlineStatusChangedObservers(!0))),window.addEventListener("offline",(e=>this.notifyOnlineStatusChangedObservers(!1)))}adapter(){return this._adapter}start(){this.adapter().registerCallback(this,this.requestAutosave),window.addEventListener("blur",this._handleWindowBlur),this._windowHidden=!1,document.addEventListener("visibilitychange",this._handleVisibilityChange)}stop(){document.removeEventListener("visibilitychange",this._handleVisibilityChange),window.removeEventListener("blur",this._handleWindowBlur),this.adapter().removeCallback(this,this.requestAutosave)}requestAutosave(){void 0!==this._debounceTimeoutId&&clearTimeout(this._debounceTimeoutId),this._debounceTimeoutId=setTimeout((()=>this._performSave()),this._debounceTime),void 0===this._maxWaitTimeoutId&&(this._maxWaitTimeoutId=setTimeout((()=>this._performSave()),this._maxWait))}cancelAutosave(){this._cancelTimers()}async _performSave(){this._cancelTimers();try{this.adapter().canSave()&&(await this.adapter().save(),await this.notifyConnectionStatusObservers(!0))}catch(e){e.status&&e.status>500?this.notifyConnectionStatusObservers(!1):console.error(this.adapter().failureMessage(),e)}}_cancelTimers(){this._debounceTimeoutId&&clearTimeout(this._debounceTimeoutId),this._maxWaitTimeoutId&&clearTimeout(this._maxWaitTimeoutId),this._debounceTimeoutId=void 0,this._maxWaitTimeoutId=void 0}_handleVisibilityChange(){"hidden"!==document.visibilityState||this._windowHidden||(this._windowHidden=!0,this.adapter().canSafeSave()&&(this._cancelTimers(),this.adapter().safeSave())),"visible"===document.visibilityState&&(this._windowHidden=!1)}_handleWindowBlur(){this.adapter().canSafeSave()&&(this._cancelTimers(),this.adapter().safeSave())}}(0,c.extend)(AutosaveController,c.Configurable),(0,c.simpleObserver)(AutosaveController,"connectionStatus"),(0,c.simpleObserver)(AutosaveController,"onlineStatusChanged");var u=AutosaveController},17186:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>a}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));var a=class AuxillaryDrawingElement{constructor(e){this._drawingController=e,this._root=document.body.appendChild(document.createElement("div"))}drawingController(){return this._drawingController}rootElement(){return this._root}show(e,t={}){}hide(){}}},94381:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(62048),p=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(1314));var m=class BackgroundGrid{constructor(e,t=1){this._gridMeasurement=e,this._majorGridLineSpacing=t}gridMeasurement(){return this._gridMeasurement}majorGridLineSpacing(){return this._majorGridLineSpacing}closestPointTo(e){const t=this.gridMeasurement().toNumeric(),r=Math.round(e.x()/t)*t,n=Math.round(e.y()/t)*t;return(0,h.$P)(r,n,e.z())}contains(e){const t=this.gridMeasurement().toNumeric().roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES);return e.x()%t==0&&e.y()%t==0}defaultFigure(){return new p.default(this)}}},74598:(e,t,r)=>{var n,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(l,{default:()=>u}),e.exports=(n=l,((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(n=s(t,l))||n.enumerable});return e})(i({},"__esModule",{value:!0}),n));var c=r(62048);var u=class BoundableAdapter{constructor(e,t){this._boundable=e,this._drawingController=t}margin(){return 10}boundable(){return this._boundable}drawingController(){return this._drawingController}scale(){return this.drawingController().scale()}getBoundingClientRect(){const e=this.boundable().boundingBox().vertices().map((e=>this.drawingController().modelCoordinatesToBrowserCoordinates(e))),t=new c.Polygon(e).boundingBox().insettedBy(-this.margin(),-this.margin());return{top:t.top(),left:t.left(),bottom:t.bottom(),right:t.right(),width:t.width(),height:t.height()}}get clientWidth(){return this.getBoundingClientRect().width}get clientHeight(){return this.getBoundingClientRect().height}}},95099:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>a}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));var a=class ChromeCADEvent{static get types(){return{LOAD:"chrome-cad:load",UNLOAD:"chrome-cad:unload",CONNECT:"chrome-cad:connect",SNAPSHOT:"chrome-cad:snapshot"}}constructor(e,t={}){this._type=e,this._details=t}get type(){return this._type}get details(){return this._details}}},93829:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(50988),p=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(95099));class ChromeCADEventEmitter{constructor(e=(()=>{})){this._connectCallback=e}connect(){this._connectCallback()}setConnectCallback(e){this._connectCallback=e}onLoad(){this.emitEvent(new p.default(p.default.types.LOAD))}onUnload(){this.emitEvent(new p.default(p.default.types.UNLOAD))}onSnapshot(){this.emitEvent(new p.default(p.default.types.SNAPSHOT))}emitEvent(e){this.notifyEventObservers(e)}}(0,h.simpleObserver)(ChromeCADEventEmitter,"event");var m=ChromeCADEventEmitter},56939:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>a}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));var a=class Clipboard{constructor(e){this._selectionManager=e}copy(e){e&&(this._selection=e.clone())}contents(){return this._selection}paste(e,t,r){if(!this.contents()||this.contents().isEmpty())return;const n=this.contents().clone();return this._moveSelectionTo(n,e,t),n.addTo(r),this._selectionManager.setSelection(n),n}_moveSelectionTo(e,t,r){const n=t-this.contents().location().x(),i=r-this.contents().location().y();e.moveBy(n,i)}}},10330:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>g}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=r(62048),m=d(r(21483)),f=d(r(75035));class CompositeSelection extends f.default{constructor(e,t){super(t),e&&(this._components=this._findUniqueComponents(e),this._setShapeToCompositeBoundingBox())}_findUniqueComponents(e){return[...new Set(e)]}clone(){const e=this.components().map((e=>e.clone()));return new this.constructor(e,this.selectionFactory())}addTo(e){this.components().forEach((t=>e.add(t)))}handlesAt(e,t,r){if(this.shape().contains(e,t))return[this.defaultHandle()]}drawSelected(e,t){this.defaultHandle().drawSelected(e,t)}defaultHandle(){return new m.default(this)}location(){return this.shape().centroid()}referencePoint(){return this._referencePoint||(this._referencePoint=(0,p.$P)(0,0)),this._referencePoint}shape(){return this._shape||(this._shape=new p.Polygon([])),this._shape}_setShapeToCompositeBoundingBox(){if(0===this.components().length)return void(this._shape=new p.Rectangle(0,0,0,0).toPolygon());this._shape=this.components().map((e=>e.boundingBox())).reduce(((e,t)=>e.merge(t))).insettedBy(-5,-5).toPolygon().relatedTo(this.referencePoint())}moveBy(e,t){this.referencePoint().moveBy(e,t);return this.components().map((r=>r.moveBy(e,t))).some((e=>e))}add(...e){return this.selectionFactory().createMultiSelection([...e,...this.components()])}components(){return this._components||(this._components=[]),this._components}remove(e){return this.components().remove(e),this.selectionFactory().createSelectionForComponents(...this.components())}isEmpty(){return 0===this.components().length}includes(e){return this.components().includes(e)}replaceFrom(e){const t=this.components().map((e=>e.stableID&&e.stableID())).filter((e=>e)).map((t=>e(t))).filter((e=>e));return t.length===this.components().length&&(this._components=t,!0)}}var g=CompositeSelection},22582:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>v}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(43468)),m=d(r(1494)),f=d(r(14995)),g=d(r(76184)),y=d(r(9354)),b=d(r(24443));var v=class DrawingEditor{constructor(e,t=p.default){this.setProject(e),this._drawingControllerClass=t}project(){return this._project||(this._project=new m.default),this._project}setProject(e){this._project=e,this._drawingController&&this._drawingController.setProject(e)}drawingController(){return this._drawingController||(this._drawingController=this.defaultDrawingController()),this._drawingController}setDrawingController(e){this._drawingController=e}defaultDrawingControllerClass(){return this._drawingControllerClass}defaultDrawingController(){return new(this.defaultDrawingControllerClass())(this.drawing(),this.project())}toolPalette(){return this._toolPalette||(this._toolPalette=this.defaultToolPalette()),this._toolPalette}defaultToolPalette(){return new g.default(this.drawingController().toolHolder(),this.defaultTools())}defaultTools(){return[new f.default(this.drawingController(),this.zoomPalette())]}zoomPalette(){return this._zoomPalette||(this._zoomPalette=this.defaultZoomPalette()),this._zoomPalette}setZoomPalette(e){this._zoomPalette=e}defaultZoomPalette(){const e=new b.default(this.drawingController());return e.addZoomLevel(new y.default("1x",1)),e.addZoomLevel(new y.default("2x",2)),e.addZoomLevel(new y.default("4x",4)),e.setActiveZoomLevel("4x"),e}drawing(){return this.project().drawing()}activate(){this.drawingController().activate(),this.drawingController().shortcutManager().registerShortcuts({selectAll:[{keys:"cmd+a"},{keys:"ctrl+a"}]},this)}deactivate(){this.drawingController().deactivate(),this.drawingController().shortcutManager().unregisterShortcuts({selectAll:[{keys:"cmd+a"},{keys:"ctrl+a"}]},this)}selectAll(){this.drawingController().select(...this.project().parts()),this.toolPalette().setActiveTool(this.toolPalette().tool("Select"))}}},80936:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(62048),p=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(75035));class EmptySelection extends p.default{moveBy(e,t){return!1}includes(e){return!1}components(){return[]}remove(e){return this}isEmpty(){return!0}location(){return(0,h.$P)(0,0)}add(...e){return 0===e.length?this:1===e.length?this.selectionFactory().createSingleSelection(e.first()):this.selectionFactory().createMultiSelection(e)}replaceFrom(e){return!0}}var m=EmptySelection},48713:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>g}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(38129)),m=r(62048),f=d(r(40124));var g=class FreeFormSelectionBoundary{constructor(e){this._selectionFactory=e}defaultFigure(){return new f.default(this)}figure(){return this._figure||(this._figure=this.defaultFigure()),this._figure}referencePoint(){return this._referencePoint||(this._referencePoint=(0,m.$P)(0,0)),this._referencePoint}shape(){return this._shape||(this._shape=new m.Polygon([])),this._shape}selectComponents(e){const t=this._findComponentsToSelect(e);return this._selectionFactory.createSelectionForComponents(...t)}_simplifiedBoundaryShape(){const e=this.shape().vertices().map((e=>({x:e.x(),y:e.y()}))),t=(0,p.default)(e).map((({x:e,y:t})=>(0,m.$P)(e,t)));return new m.Polygon(t)}_findComponentsToSelect(e){if(this.shape().vertices().length<3)return[];const t=this._simplifiedBoundaryShape(),r=t.boundingBox(),n=t.edges();return e.filter((e=>r.intersects(e.boundingBox()))).filter((e=>{const r=e.boundingShape();if(t.containsPoint(r.vertices().first()))return!0;if(r.containsPoint(t.vertices().first()))return!0;let i,s;return t.vertices().length>r.vertices().length?(s=r.edges(),i=n):(s=n,i=r.edges()),i.some((e=>s.some((t=>e.intersectionsWithEdgeIn2D(t).length>0))))}))}addVertex(e,t){this.shape().vertices().push(new m.RelativeLocator(this.referencePoint(),e,t))}}},21315:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(24574));const p=new h.default(8,2);var m=class ImageLoader{constructor(e,t=p){this._ready=!1,this._retry=t,e instanceof Image?(this._image=e,this._imageURL=this._image.src,this._ready=!0,this._imageLoadingPromise=Promise.resolve(this)):(this._image=new Image,this._imageURL=e)}shouldRetry(){return this._retry&&this._retry.shouldRetry()}retryLoading(){this._retry&&this._retry.retry((()=>this._image.src=this._imageURL))}imageReady(){return this._ready}async loadImage(){return this._imageLoadingPromise||(this._imageLoadingPromise=this._createLoadingPromise()),this._imageLoadingPromise}_createLoadingPromise(){return new Promise(((e,t)=>{this._image.onload=()=>{this._ready=!0,e()},this._image.onerror=e=>{this.shouldRetry()?this.retryLoading():t(e)},this._image.src=this._imageURL}))}image(){if(this.imageReady())return this._image}}},63886:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>f}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(22582)),m=d(r(94617));class MultiPerspectiveProjectEditor extends m.default{constructor(e,t,r){super(t),this._drawingEditors=e,this._defaultPerspective=r}defaultPerspective(){return this._defaultPerspective||"top"}drawingEditor(e=this.defaultPerspective()){const t=this.drawingEditors()[e];if(!t)throw new Error(`Unknown drawing editor perspective "${e}"`);return t}drawingEditors(){return this._drawingEditors||(this._drawingEditors=this.defaultDrawingEditors()),this._drawingEditors}defaultDrawingEditors(){return{top:new p.default(this.project())}}perspectives(){return Object.keys(this.drawingEditors())}}var f=MultiPerspectiveProjectEditor},20505:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(50988),p=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(28718));class ObservableValueHolder extends p.default{constructor(e){super(e),this._initialized=!0}setValue(e){super.setValue(e),this._initialized&&this.notifyValueChangedObservers()}}(0,h.simpleObserver)(ObservableValueHolder,"valueChanged");var m=ObservableValueHolder},98007:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>y}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(48515)),m=d(r(54639)),f=d(r(70475)),g=d(r(77628));class PersistentProjectRepository extends g.default{apiClient(){return this._apiClient||(this._apiClient=new p.default),this._apiClient}startAutosave(){this.autosaveController().start()}stopAutosave(){this.autosaveController().stop()}projectsPath(){return"/projects"}_loadFromServerApiUrl(e){return`${this.projectsPath()}/${e}`}async loadFromServer(e){const t=await this.apiClient().get(this._loadFromServerApiUrl(e));await this._loadFromJSON(t.project),await this.setLastPersistedState(t.project.design)}_createOnServerApiUrl(){return this.projectsPath()}async createOnServer(e){const{json:t}=await this.generateProjectJSON(),r={name:e,design:t},n=await this.apiClient().post(this._createOnServerApiUrl(),{body:r}),{id:i,design:s,...o}=n.project;this.project().setExternalId(i),this.project().metadataManager().setMetadata(o),await this.setLastPersistedState(t)}_updateOnServerApiUrl(){return`${this.projectsPath()}/${this.projectId()}`}async updateOnServer(){this.autosaveController().cancelAutosave();const{json:e}=await this.generateProjectJSON(),t={...this.project().metadataManager().metadata(),design:e};await this.apiClient().put(this._updateOnServerApiUrl(),{body:{project:t}}),await this.setLastPersistedState(e)}async saveBeforeNavigatingAway(){const e=this._updateOnServerApiUrl(),t=this.latestProjectJSON(),r={...this.project().metadataManager().metadata(),design:t};fetch(this.apiClient()._formatUrl(e),{method:"PUT",body:JSON.stringify({project:r}),credentials:"same-origin",keepalive:!0,headers:this.apiClient().defaultHeaders()}),await this.setLastPersistedState(t)}autosaveController(){if(!this._autosaveController){const e=new f.default(this);this._autosaveController=new m.default(e)}return this._autosaveController}_deleteOnServerApiUrl(e){return`${this.projectsPath()}/${e}`}async deleteOnServer(e){return this.apiClient().delete(this._deleteOnServerApiUrl(e))}}var y=PersistentProjectRepository},70475:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(90772));class ProjectAutosaveAdapter extends h.default{canSave(){return Boolean(this.autosaveableObject().project().externalId())}canSafeSave(){return this.autosaveableObject().isDirty()}registerCallback(e,t){this.autosaveableObject().project().addCurrentVersionChangedObserver(e,t)}removeCallback(e,t){this.autosaveableObject().project().removeCurrentVersionChangedObserver(e,t)}async save(){return this.autosaveableObject().updateOnServer()}async safeSave(){return this.autosaveableObject().saveBeforeNavigatingAway()}failureMessage(){return`Autosave failed for project ${this.autosaveableObject().projectId()}`}}var p=ProjectAutosaveAdapter},94617:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>f}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(1494)),m=d(r(22582));var f=class ProjectEditor{constructor(e){this._project=e}project(){return this._project||(this._project=this.defaultProject()),this._project}setProject(e){this._project=e}defaultProject(){return new p.default}drawingEditor(){return this._drawingEditor||(this._drawingEditor=new m.default(this.project())),this._drawingEditor}}},77628:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>y}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=r(57075),m=r(50988),f=d(r(40611)),g=d(r(1494));class ProjectRepository{constructor(e){e&&this.setProject(e)}defaultProject(){return new g.default(new f.default)}projectId(){return this.project().externalId()}setProjectId(e){this.project().setExternalId(e)}project(){return this._project||(this._project=this.defaultProject(),this._startObservingProject()),this._project}async setProject(e){this._stopObservingProject(),this._project=e,await this._project.versionManager().isReady(),this._startObservingProject(),await this.notifyProjectLoadedObservers()}_startObservingProject(){this.project()&&(this.project().addCurrentVersionChangedObserver(this,this._onProjectVersionChanged),this._latestProjectJSON=void 0)}_stopObservingProject(){this.project()&&this.project().removeCurrentVersionChangedObserver(this,this._onProjectVersionChanged)}async _onProjectVersionChanged(){const{json:e}=await this.generateProjectJSON();this._latestProjectJSON=e,await this.notifyDirtyStateChangedObservers()}isDirty(){return void 0===this.project().externalId()||void 0!==this.latestProjectJSON()&&this.latestProjectJSON()!==this.lastPersistedState()}lastPersistedState(){return this._lastPersistedState}async setLastPersistedState(e){this._lastPersistedState=e,await this.notifyDirtyStateChangedObservers()}async _loadFromJSON(e){const{design:t,...r}=e;await this.setProject(new g.default(await this.buildObjectFromJSON(t),r))}generateProjectJSON(){return this.buildJSONFromObject(this.project().current())}latestProjectJSON(){return this._latestProjectJSON}jsonBuilder(){return this._jsonBuilder||(this._jsonBuilder=new p.SmartJsonBuilder),this._jsonBuilder}objectBuilder(){return this._objectBuilder||(this._objectBuilder=new p.SmartObjectBuilder),this._objectBuilder}buildJSONFromObject(e){return this.jsonBuilder().stringify(e)}buildObjectFromJSON(e){return this.objectBuilder().parse(e)}}(0,m.simpleObserver)(ProjectRepository,"projectLoaded"),(0,m.simpleObserver)(ProjectRepository,"dirtyStateChanged");var y=ProjectRepository},5824:(e,t,r)=>{var n,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(l,{default:()=>u}),e.exports=(n=l,((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(n=s(t,l))||n.enumerable});return e})(i({},"__esModule",{value:!0}),n));var c=r(50988);var u=class PropertyEventRecorder{recordChange(){throw new c.MissingOverride(this,"recordChange")}recordIntermediateChange(){throw new c.MissingOverride(this,"recordIntermediateChange")}}},24574:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>a}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));var a=class RetryAlgorithm{constructor(e,t){this._count=e,this._delay=t,this._retriesAttempted=0}count(){return this._count}delay(){return this._delay}retriesAttempted(){return this._retriesAttempted}shouldRetry(){return this.retriesAttempted()<this.count()}retry(e){this._retriesAttempted++,setTimeout(e,1e3*this.delay())}}},59958:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>a}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));var a=class SelectableComponent{moveBy(e,t){}delete(){}clone(){}boundingBox(){}}},75035:(e,t,r)=>{var n,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(l,{default:()=>u}),e.exports=(n=l,((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(n=s(t,l))||n.enumerable});return e})(i({},"__esModule",{value:!0}),n));var c=r(50988);var u=class Selection{constructor(e){this._selectionFactory=e}selectionFactory(){return this._selectionFactory}handlesAt(e,t,r){return[]}drawSelected(e,t){}components(){throw new c.MissingOverride(this,"components")}add(...e){throw new c.MissingOverride(this,"add")}remove(e){throw new c.MissingOverride(this,"remove")}includes(e){throw new c.MissingOverride(this,"includes")}moveBy(e,t){throw new c.MissingOverride(this,"moveBy")}delete(){this.components().filter((e=>e.isDeleteable())).forEach((e=>e.delete()))}clone(){}location(){}isEmpty(){throw new c.MissingOverride(this,"isEmpty")}replaceFrom(e){throw new c.MissingOverride(this,"replaceFrom")}}},69125:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>g}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(10330)),m=d(r(80936)),f=d(r(76755));var g=class SelectionFactory{constructor(e){this._drawing=e}createSelectionForComponents(...e){return 0===e.length?this.createEmptySelection():1===e.length?this.createSingleSelection(e.first()):this.createMultiSelection(e)}createEmptySelection(){return new m.default(this)}createSingleSelection(e){return new f.default(e,this._drawing,this)}createMultiSelection(e){return new p.default(e,this)}}},69096:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>a}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));var a=class SelectionManager{removeFromSelection(e){}addToSelection(...e){}setSelection(e){}clearSelection(){}selection(){}select(...e){}selectionFactory(){}}},76755:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(75035));class SingleSelection extends h.default{constructor(e,t,r){super(r),this._drawing=t,this._component=e}clone(){return new this.constructor(this.component().clone(),this._drawing,this.selectionFactory())}addTo(e){e.add(this.component())}component(){return this._component}components(){return[this.component()]}location(){return this.component().boundingBox().center()}moveBy(e,t){return this.component().moveBy(e,t)}handlesAt(e,t,r){const n=this._drawing.figureFor(this.component());return n?n.handlesAt(e,t,r):[]}drawSelected(e,t){const r=this._drawing.figureFor(this.component());if(!r||!r.selfHandle)return;const n=r.selfHandle();n&&n.drawSelected(e,t)}add(...e){return this.selectionFactory().createMultiSelection([this.component(),...e])}remove(e){return e!==this.component()?this:this.selectionFactory().createEmptySelection()}isEmpty(){return!this._component}includes(e){return this.component()===e}replaceFrom(e){if(this.component().stableID){const t=e(this.component().stableID());if(t)return this._component=t,!0}return!1}}var p=SingleSelection},68759:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(50988),p=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(30555));class TextAdapter{constructor(e,t,r=this._defaultTextSetter(t)){this._model=e,this._textGetter=t,this._textSetter=r}model(){return this._model}text(){return this.model()[this.textGetter()]()}setText(e){this.model()[this.textSetter()](e)}textGetter(){return this._textGetter}textSetter(){return this._textSetter}_defaultTextSetter(e){return`set${e[0].toUpperCase()}${e.slice(1)}`}}(0,h.supply)(TextAdapter,p.default);var m=TextAdapter},90963:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>y}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=r(62048),m=r(50988),f=d(r(79728)),g=d(r(30555));class TextAnnotation extends p.Component{constructor(e,t,r,n){super(),this.setText(e),this._textLocation=t,this._anchor=r,this.setColor(n||"#000000")}anchor(){return this._anchor}textLocation(){return this._textLocation}color(){return this._color}setColor(e){this._color=e}layer(){return this._layer}setLayer(e){this._layer=e}moveBy(e,t){return this.textLocation().moveBy(e,t)}defaultFigure(){const e=new f.default(this);return e.setLayer(this.layer()),e}}(0,m.supply)(TextAnnotation,g.default);var y=TextAnnotation},51272:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(20647));var p=class TextCursor{constructor(e,t,r){this._textInterface=e,this._textGeometry=t,this._textIndexLocator=r}textInterface(){return this._textInterface}textIndexLocator(){return this._textIndexLocator}textGeometry(){return this._textGeometry}cursorPosition(){return void 0===this._cursorPosition&&(this._cursorPosition=this.text().length),this._cursorPosition}setCursorPosition(e){e>=0&&(this._cursorPosition=e)}advance(){this.cursorPosition()!==this.text().length&&(this._cursorPosition=this.cursorPosition()+1)}retreat(){0!==this.cursorPosition()&&(this._cursorPosition=this.cursorPosition()-1)}moveCursorAfterSubstring(e){this._cursorPosition=e.length}textBeforeCursor(){return this.text().slice(0,this.cursorPosition())}textAfterCursor(){return this.text().slice(this.cursorPosition())}defaultFigure(){return new h.default(this)}text(){return this.textInterface().text()}textLocation(){return this.textGeometry().textLocation()}}},57411:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(51272));var p=class TextEditor{constructor(e,t,r){this._textInterface=e,this._textGeometry=t,this._textIndexLocator=r}cursor(){return void 0===this._cursor&&(this._cursor=new h.default(this.textInterface(),this.textGeometry(),this.textIndexLocator())),this._cursor}isEmptyText(){return 0===this.text().length}advanceCursor(){this.cursor().advance()}retreatCursor(){this.cursor().retreat()}insertText(e){const t=this.cursor().textBeforeCursor(),r=this.cursor().textAfterCursor();this._setText(t+e+r),this.advanceCursor()}backspace(){const e=this.cursor().textBeforeCursor().slice(0,-1),t=this.cursor().textAfterCursor();this._setText(e+t),this.retreatCursor()}textInterface(){return this._textInterface}textGeometry(){return this._textGeometry}textIndexLocator(){return this._textIndexLocator}trimText(){this._setText(this.text().trim())}_setText(e){this.textInterface().setText(e)}text(){return this.textInterface().text()}}},23686:(e,t,r)=>{var n,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(l,{default:()=>u}),e.exports=(n=l,((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(n=s(t,l))||n.enumerable});return e})(i({},"__esModule",{value:!0}),n));var c=r(50988);var u=class TextGeometry{shape(e){throw new c.MissingOverride(this,"shape")}contains(e,t,r){return this.shape(r).contains(e,t)}}},88155:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(50988),p=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(23686));class TextGeometryAdapter{constructor(e,t){this._model=e,this._shapeGetter=t}model(){return this._model}shape(e){return this.model()[this.shapeGetter()](e)}shapeGetter(){return this._shapeGetter}}(0,h.supply)(TextGeometryAdapter,p.default);var m=TextGeometryAdapter},35837:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>f}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(1605)),m=d(r(32789));class TextIndexLocatorAdapter{constructor(e,t){this._model=e,this._substringWidthGetter=t}model(){return this._model}substringWidth(e,t){return this.model()[this.substringWidthGetter()](e,t)}substringWidthGetter(){return this._substringWidthGetter}}(0,p.default)(TextIndexLocatorAdapter,m.default);var f=TextIndexLocatorAdapter},32789:(e,t,r)=>{var n,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(l,{default:()=>u}),e.exports=(n=l,((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(n=s(t,l))||n.enumerable});return e})(i({},"__esModule",{value:!0}),n));var c=r(50988);var u=class TextIndexLocatorInterface{substringWidth(e){throw new c.MissingOverride(this,"substringWidth")}}},30555:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>a}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));var a=class TextInterface{setText(e){this._text=e}text(){return this._text||(this._text=this._defaultText()),this._text}_defaultText(){return""}}},76184:(e,t,r)=>{var n,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(l,{default:()=>u}),e.exports=(n=l,((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(n=s(t,l))||n.enumerable});return e})(i({},"__esModule",{value:!0}),n));var c=r(50988);class ToolPalette{constructor(e,t){if(this._activeToolHolder=e,this._tools=t,t){const e=t[0];this.setDefaultTool(e),this.setActiveTool(e),this.tools().forEach((e=>this._startObservingTool(e)))}}tools(){return this._tools||(this._tools=[]),this._tools}tool(e){return this.tools().find((t=>t.displayName()===e))}setDefaultTool(e){this._defaultTool=e}defaultTool(){return this._defaultTool}removeTool(e){const t=this.tools().indexOf(e);if(-1===t)throw new Error(ToolPalette.ERROR_FOREIGN_TOOL);this._stopObservingTool(e),this.defaultTool()===e&&this.setDefaultTool(void 0),this.activeTool()===e&&this.setActiveTool(this.defaultTool()),this.tools().splice(t,1),this.notifyAvailableToolsChangedObservers()}addTool(e){this.tools().push(e),this._startObservingTool(e),this.notifyAvailableToolsChangedObservers()}setActiveTool(e){if(e){if(-1===this.tools().indexOf(e))throw new Error(ToolPalette.ERROR_FOREIGN_TOOL)}this.activeTool()&&this.activeTool().deactivate(),this._activeToolHolder.setValue(e),e&&e.activate()}activeTool(){return this._activeToolHolder.value()}deactivateTool(){this.setActiveTool(this.defaultTool())}addActiveToolChangedObserver(e,t){this._activeToolHolder.addValueChangedObserver(e,t)}removeActiveToolChangedObserver(e){this._activeToolHolder.removeValueChangedObserver(e)}_startObservingTool(e){e.addSelfDeactivationEventObserver&&e.addSelfDeactivationEventObserver(this,(()=>this._onToolDeactivatedItself(e)))}_stopObservingTool(e){e.removeSelfDeactivationEventObserver&&e.removeSelfDeactivationEventObserver(this)}_onToolDeactivatedItself(e){this.defaultTool()!==e?this.setActiveTool(this.defaultTool()):(this._activeToolHolder.setValue(null),console.log("No active tool because default tool deactivated itself"))}}(0,c.simpleObserver)(ToolPalette,"availableToolsChanged"),ToolPalette.ERROR_FOREIGN_TOOL="Tried to manipulate a tool that is not in the ToolPalette #tools collection";var u=ToolPalette},28718:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>a}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));var a=class ValueHolder{constructor(e){this.setValue(e)}value(){return this._value}setValue(e){this._value=e}}},9354:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>a}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));var a=class ZoomLevel{constructor(e,t){this._name=e,this._magnificationLevel=t}name(){return this._name}magnificationLevel(){return this._magnificationLevel}}},24443:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>f}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(62048),p=r(50988),m=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(9354));class ZoomPalette{constructor(e,t){this._drawingController=e,this._baselineMagnification=t||1}removeZoomLevel(e){const t=this._findZoomLevel(e);if(void 0===t)throw new Error(`Zoom level ${e} does not exist`);this._zoomLevels=this.zoomLevels().filter((e=>e!==t)),this._sortLevels(),this._defaultZoomLevelName===e&&this._fixupDefaultZoomLevel()}_fixupDefaultZoomLevel(){this.zoomLevels().length>0?this._defaultZoomLevelName=this.zoomLevels()[0].name():this._defaultZoomLevelName=void 0}addZoomLevel(e){if(void 0!==this._findZoomLevel(e.name()))throw new Error(`Zoom level ${e.name()} already exists`);this.zoomLevels().push(e),this._sortLevels(),this._defaultZoomLevelName||(this._defaultZoomLevelName=e.name())}_sortFunction(e,t){return e.magnificationLevel()-t.magnificationLevel()}_sortLevels(){this.zoomLevels().sort(this._sortFunction)}defaultZoomLevel(){return this._defaultZoomLevelName}setDefaultZoomLevel(e){if(!this._findZoomLevel(e))throw new Error(`Zoom level ${e} does not exist`);this._defaultZoomLevelName=e}setActiveZoomLevel(e){const t=this._findZoomLevel(e);if(void 0===t)throw new Error(`Unknown zoom level ${e}`);this._setActiveZoomLevelObject(t);const r=this.activeZoomLevel().magnificationLevel()/this._drawingController.scale();this.zoomCanvasCenterBy(r)}resetActiveZoomLevel(){this._activeZoomLevel=void 0}_setActiveZoomLevelObject(e){this._activeZoomLevel=e,this.notifyZoomLevelChangedObservers()}_findZoomLevel(e){return this.zoomLevels().find((t=>t.name()===e))}activeZoomLevel(){return this._activeZoomLevel||this._activateDefaultZoomLevel(),this._activeZoomLevel}_activateDefaultZoomLevel(){const e=this.defaultZoomLevel();e&&(this._activeZoomLevel=this._findZoomLevel(e),this._drawingController.setScale(this.activeZoomLevel().magnificationLevel()))}zoomLevels(){return this._zoomLevels||(this._zoomLevels=[]),this._zoomLevels}zoomInAt(e,t){this._zoomAt(e,t,this._zoomFactor()),this._syncActiveZoomLevelWithScale()}zoomOutAt(e,t){this._zoomAt(e,t,1/this._zoomFactor()),this._syncActiveZoomLevelWithScale()}zoomCanvasCenterBy(e){const t=this._drawingController.browserCoordinatesToModelCoordinates(this._drawingController.canvasCenter());this._zoomAt(t.x(),t.y(),e)}zoomBy(e,t,r){this._zoomAt(e,t,r),this._syncActiveZoomLevelWithScale()}_syncActiveZoomLevelWithScale(){const e=this._drawingController.scale(),t=Math.pow(10,-3),r=this.zoomLevels().find((r=>r.magnificationLevel().isNearTo(e,t)));r?this._setActiveZoomLevelObject(r):this._setCustomZoomLevel(e)}_resetCustomZoomLevel(){this._customZoomLevel&&(this.removeZoomLevel(this._customZoomLevel.name()),this._customZoomLevel=void 0)}_setCustomZoomLevel(e){this._resetCustomZoomLevel();const t=`${Math.round(e/this._baselineMagnification*100).toString()}%`;let r=this._findZoomLevel(t);r||(this._customZoomLevel=new m.default(t,e),this.addZoomLevel(this._customZoomLevel),r=this._customZoomLevel),this._setActiveZoomLevelObject(r)}_zoomAt(e,t,r){const n=(0,h.$P)(e,t).rotatedBy((0,h.$P)(0,0),this._drawingController.rotationAngle()),i=this._moveCanvasOriginToZoomTarget(n);this._zoomCanvas(r),this._moveCanvasOriginToStartingPoint(i,r),this._drawingController.draw()}_zoomFactor(){return 1.1}_moveCanvasOriginToZoomTarget(e){const t=e.multipliedBy(this._drawingController.scale()).roundedTo(0);return this._drawingController.translateBy(t.x(),t.y()),t}_moveCanvasOriginToStartingPoint(e,t){this._drawingController.translateBy(-e.x()*t,-e.y()*t)}_zoomCanvas(e){const t=this._drawingController.scale()*e;this._drawingController.setScale(t)}}(0,p.simpleObserver)(ZoomPalette,"zoomLevelChanged");var f=ZoomPalette},30818:(e,t,r)=>{var n,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(l,{default:()=>u}),e.exports=(n=l,((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(n=s(t,l))||n.enumerable});return e})(i({},"__esModule",{value:!0}),n));var c=r(41185);"undefined"==typeof CanvasRenderingContext2D&&(globalThis.CanvasRenderingContext2D=function(){this.scale=()=>{},this.translate=()=>{},this.rotate=()=>{},this.save=()=>{},this.restore=()=>{}});var u=(0,c.mixCanvasRenderingContext2DExtensions)(CanvasRenderingContext2D)},41185:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>f,mixCanvasRenderingContext2DExtensions:()=>g}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(62048),p=r(50988),m=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(96037));class CanvasRenderingContext2DMixin{updateProperties(e){for(const t in e)this[t]=e[t]}_addPolygonToCurrentPath(e){const t=e.vertices();for(let e=0;e<t.length;e++){const r=t[e];this.lineTo(r.x(),r.y())}}_drawPolygon(e,{stroke:t=!0,fill:r=!0}={}){this.beginPath(),this._addPolygonToCurrentPath(e),this.closePath(),r&&this.fill(),t&&this.stroke()}_drawCircle(e,{stroke:t=!0,fill:r=!0}={}){this.beginPath(),this.arc(e.x(),e.y(),e.radius(),0,Math.TWO_PI),this.closePath(),r&&this.fill(),t&&this.stroke()}_drawRectangle(e,{stroke:t=!0,fill:r=!0}={}){this.beginPath(),this.rect(e.x(),e.y(),e.width(),e.height()),this.closePath(),r&&this.fill(),t&&this.stroke()}_drawRoundedRectangle(e,t){const r=this._pixelsToDrawingUnits(t),[n,i,s,o]=e.vertices();this.beginPath(),this.moveTo(n.x()+r,n.y()),this.arcTo(i.x(),i.y(),s.x(),s.y(),r),this.arcTo(s.x(),s.y(),o.x(),o.y(),r),this.arcTo(o.x(),o.y(),n.x(),n.y(),r),this.arcTo(n.x(),n.y(),i.x(),i.y(),r),this.closePath(),this.stroke(),this.fill()}_drawLine(e,t){this.beginPath(),this.moveTo(e.x(),e.y()),this.lineTo(t.x(),t.y()),this.stroke()}_drawArcBetween(e,t,r){const n=e.to(t),i=n.length()/2,s=n.theta(),o=n.theta()+Math.PI;this.beginPath(),this.arc(n.center().x(),n.center().y(),i,s,o,r),this.stroke()}_drawDashedLine(e,t,r=[5,15]){this.setLineDash(r),this._drawLine(e,t)}_drawConnectedLineSegments(e){this.beginPath();const[t,...r]=e;this.moveTo(t.x(),t.y());for(let e=0;e<r.length;e+=1)this.lineTo(r[e].x(),r[e].y());this.stroke()}_drawArrow(e,t=5,r=2){const n=new h.Edge(e.begin(),new h.FixedEdgeLocator(e,-t));this._drawLine(n.begin(),n.end());const i=r/2,s=Math.sqrt(t*t+i*i),o=Math.atan(i/t);this._drawArrowhead(e.end(),e.angle(),s,o)}_drawArrowhead(e,t,r=5,n=Math.PI/16){const i=t+Math.PI;this.beginPath(),this.moveTo(e.x(),e.y());let s=e.add(new h.PolarCoordinate(r,i+n));this.lineTo(s.x(),s.y()),s=e.add(new h.PolarCoordinate(r,i-n)),this.lineTo(s.x(),s.y()),this.closePath(),this.fill()}_alterAndRestoreAfter(e){this.save();try{e()}finally{this.restore()}}_pixelsToDrawingUnits(e){return e/this.runningScaleX()}_drawingUnitsToPixels(e){return e*this.runningScaleX()}}var f=CanvasRenderingContext2DMixin;const g=e=>((0,m.default)(e),(0,p.extend)(e,CanvasRenderingContext2DMixin),Object.defineProperty(e.prototype,"_pixelLineWidth",{get(){return this._drawingUnitsToPixels(this.lineWidth)},set(e){this.lineWidth=this._pixelsToDrawingUnits(e)},enumerable:!0,configurable:!0}),e)},59106:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>y}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=r(62048),m=d(r(94239)),f=d(r(88210)),g=d(r(47540));p.ShapeFromVertices.prototype.defaultFigure=function(){return new f.default(this.shape())},p.ShapeFromVertices.prototype.defaultFigureXZ=function(){const e=new g.default((()=>this.shape3D().frontProjections().map((e=>new f.default(e)))));return m.default.withStrategy(e,this)},p.ShapeFromVertices.prototype.defaultFigureYZ=function(){const e=new g.default((()=>this.shape3D().leftSideProjections().map((e=>new f.default(e)))));return m.default.withStrategy(e,this)};var y=p.ShapeFromVertices},7340:(e,t,r)=>{r(53541);const n=r(7653),i=r(82823),s=r(13868),o=r(19510),a=r(48395),l=r(83894),c=r(2233),u=r(612),d=r(25381),h=r(80205),p=r(29945),m=r(40544),f=r(82128),g=r(98278),y=r(60584),b=r(58610),v=r(15493),_=r(90394),x=r(53012),w=r(65870),R=r(78904),k=r(5942),j=r(31755),z=r(14066),q=r(19233),$=r(25332),Z=r(95975),X=r(63357),Y=r(85666),ee=r(93791),te=r(34668),re=r(28992),ne=r(12322),ie=r(3356),se=r(68013),oe=r(77560),ae=r(42901),le=r(34303),ce=r(61926),ue=r(88241),de=r(58151),he=r(52117),pe=r(5544),me=r(64268),fe=r(26643),ge=r(99479),ye=r(13262),be=r(16802),ve=r(57344),_e=r(46710),xe=r(60651),we=r(29708),Se=r(2163),Pe=r(29635),Te=r(54748),Re=r(72351),ke=r(16769),Ie=r(79071),je=r(87441),He=r(35027),ze=r(53948),Ge=r(27377),We=r(32787),Ve=r(10409),qe=r(17062),$e=r(34856),Xe=r(53735),Ye=r(53981),Qe=r(80853),et=r(32875),tt=r(52411),rt=r(85880),nt=r(74070),it=r(88435),st=r(61329),ot=r(73413),at=r(33322),lt=r(57160),ct=r(5237),ut=r(21728),dt=r(68076),ht=r(92516),pt=r(5115),mt=r(91860),ft=r(10753),gt=r(78864),yt=r(59194),bt=r(8397),vt=r(1270),_t=r(52234),xt=r(90998),wt=r(7464),St=r(1967),Pt=r(65808),Et=r(56707),Mt=r(38431),Ct=r(6998),At=r(80568),Tt=r(64340),Dt=r(43950),Ot=r(41557),Rt=r(14881),Lt=r(52093),kt=r(78853),Nt=r(36138),Ft=r(88035),It=r(57191),Bt=r(75717),jt=r(42122),Ht=r(93918),Ut=r(90179),zt=r(84590),Gt=r(33651),Wt=r(27854),Vt=r(58698),qt=r(5498),$t=r(8083),Zt=r(94341),Kt=r(88543),Xt=r(78634),Yt=r(44182),Jt=r(24512),Qt=r(23029),er=r(72242),tr=r(37974),rr=r(14532),nr=r(96),ir=r(30226),sr=r(93794),or=r(59311),ar=r(26815),lr=r(30409),cr=r(6609),ur=r(32125),dr=r(12380),hr=r(8929),pr=r(90510),mr=r(44892),fr=r(31934),gr=r(28344),yr=r(8008),br=r(34973);e.exports.AngleAnnotationFigure=n,e.exports.AngleAnnotationHandle=i,e.exports.AnnotationHandle=s,e.exports.ApiClient=o,e.exports.AutosaveAdapter=a,e.exports.AutosaveController=l,e.exports.AuxillaryDrawingElement=c,e.exports.BackgroundGrid=u,e.exports.BackgroundGridFigure=d,e.exports.BoundableAdapter=h,e.exports.CanvasRenderingContext2D=p,e.exports.CanvasRenderingContext2DMixin=m,e.exports.CanvasSpinner=f,e.exports.ChromeCADEvent=g,e.exports.ChromeCADEventEmitter=y,e.exports.ChromeCADExtensionController=b,e.exports.CircleFigure=v,e.exports.Clipboard=_,e.exports.ClosedShapeFigure=x,e.exports.Color=w,e.exports.ComponentHandle=R,e.exports.ComponentSelectionTool=k,e.exports.CompositeEditableProperty=j,e.exports.CompositeFigure=z,e.exports.CompositeModelStrategy=q,e.exports.CompositePanZoomTool=$,e.exports.CompositePropertiesCollection=Z,e.exports.CompositeSelection=X,e.exports.CompositeSelectionHandle=Y,e.exports.CornerEdgeAdjusterHandle=ee,e.exports.CornerHandle=te,e.exports.CountLimitedMemoryVersioningStrategy=re,e.exports.CutCornerTool=ne,e.exports.DimensionAnnotationFigure=ie,e.exports.DisplayProperties=se,e.exports.DisplayProperty=oe,e.exports.DraggableComponentTool=ae,e.exports.Drawable=le,e.exports.DrawableImage=ce,e.exports.Drawing=ue,e.exports.DrawingController=de,e.exports.DrawingEditor=he,e.exports.EdgeHandle=pe,e.exports.EditableProperty=me,e.exports.EmptySelection=fe,e.exports.FiguresFromLambdaStrategy=ge,e.exports.FrameAdjusterHandle=ye,e.exports.FreeFloatingDimensionAnnotation=be,e.exports.FreeFloatingDimensionAnnotationFigure=ve,e.exports.FreeFloatingDimensionAnnotationHandle=_e,e.exports.FreeFormDrawingTool=xe,e.exports.FreeFormSelectionBoundary=we,e.exports.FreeFormSelectionBoundaryFigure=Se,e.exports.FreeFormSelectionTool=Pe,e.exports.FrontHandle=Te,e.exports.GeometricComponent=Re,e.exports.GeometryFromModel=ke,e.exports.Handle=Ie,e.exports.HttpError=je,e.exports.ImageComponent=He,e.exports.ImageComponentBuilder=ze,e.exports.ImageComponentFigure=Ge,e.exports.ImageComponentHandle=We,e.exports.ImageCornerHandle=Ve,e.exports.ImageLoader=qe,e.exports.ImperialDecimalLengthFormatter=$e,e.exports.ImperialFractionLengthFormatter=Xe,e.exports.ImperialLengthFormatter=Ye,e.exports.InteractionOperation=Qe,e.exports.KeyboardShortcutManager=et,e.exports.LayerManager=tt,e.exports.LengthFormatter=rt,e.exports.LevelsFromModel=nt,e.exports.LocatorHandle=it,e.exports.MeasurementTool=st,e.exports.MetadataManager=ot,e.exports.MoveViewportTool=at,e.exports.MovementOperation=lt,e.exports.MultiPerspectiveProjectEditor=ct,e.exports.NotchCornerTool=ut,e.exports.NullDrawable=dt,e.exports.ObservableValueHolder=ht,e.exports.OverlappingPropertiesCollection=pt,e.exports.PanOperation2D=mt,e.exports.PanningZoomingTool=ft,e.exports.PathFigure=gt,e.exports.PersistentProjectRepository=yt,e.exports.PolygonFigure=bt,e.exports.PolygonWithHolesFigure=vt,e.exports.Project=_t,e.exports.ProjectAutosaveAdapter=xt,e.exports.ProjectEditor=wt,e.exports.ProjectRepository=St,e.exports.PropertiesCollection=Pt,e.exports.PropertiesCollectionMixin=Et,e.exports.PropertyEventRecorder=Mt,e.exports.PropertyStack=Ct,e.exports.ReadableProperty=At,e.exports.RectangleFigure=Tt,e.exports.ResizingHandle=Dt,e.exports.RetryAlgorithm=Ot,e.exports.RotationHandle=Rt,e.exports.RunningTransformProperties=Lt,e.exports.SelectableComponent=kt,e.exports.Selection=Nt,e.exports.SelectionFactory=Ft,e.exports.SelectionManager=It,e.exports.ShapeFromVertices=Bt,e.exports.SideHandle=jt,e.exports.SingleSelection=Ht,e.exports.SnappingTool=Ut,e.exports.StableID=zt,e.exports.StaticFigureStrategy=Gt,e.exports.StringGzip=Wt,e.exports.TextAdapter=Vt,e.exports.TextAnnotation=qt,e.exports.TextAnnotationFigure=$t,e.exports.TextAnnotationHandle=Zt,e.exports.TextCursor=Kt,e.exports.TextCursorFigure=Xt,e.exports.TextEditor=Yt,e.exports.TextFigure=Jt,e.exports.TextGeometry=Qt,e.exports.TextGeometryAdapter=er,e.exports.TextHandle=tr,e.exports.TextIndexLocatorAdapter=rr,e.exports.TextIndexLocatorInterface=nr,e.exports.TextInterface=ir,e.exports.TextTool=sr,e.exports.Tool=or,e.exports.ToolPalette=ar,e.exports.ToolWithLifecycle=lr,e.exports.ValueHolder=cr,e.exports.VersionedProject=ur,e.exports.VersioningStrategy=dr,e.exports.ZoomLevel=hr,e.exports.ZoomOperation=pr,e.exports.ZoomOperation2D=mr,e.exports.ZoomPalette=fr,e.exports.ZoomViewportTool=gr,e.exports.dynamicModuleLoaders=yr,e.exports.extendWithRunningTransformProperties=br},48515:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>g}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=r(50988),m=d(r(64854)),f=d(r(28639));class ApiClient{static _defaultConfig(){return{baseUrl:"/api/v1",compress:!1}}constructor({baseUrl:e=this._config().baseUrl,urlParams:t={},compress:r=this._config().compress}={}){this.baseUrl=e,this._compress=r,this.urlParams=t}get baseUrl(){return this._baseUrl}set baseUrl(e){this._baseUrl=e}get urlParams(){return this._urlParams}set urlParams(e){this._urlParams=e}async delete(e,t={}){return await this.fetch(e,"DELETE",t)}async get(e,t={}){return await this.fetch(e,"GET",t)}async post(e,t={}){return await this.fetch(e,"POST",t)}async put(e,t={}){return await this.fetch(e,"PUT",t)}async fetch(e,t,{body:r,urlParams:n,queryParams:i,headers:s,compress:o,stringify:a}={}){const l=this._formatUrl(e,n,i),c=await this._makeOptions(s,t,r,o,a);let u;try{u=await fetch(l,c)}catch(e){this._handleFetchError(e)}if(u)return await this._checkForHttpError(u),this.tryParseJson(u)}_handleFetchError(e){throw e instanceof TypeError?new m.default({status:503,statusText:"Service Unavailable"}):e}async _makeOptions(e,t,r,n=this._compress,i=!0){return{headers:this._makeHeaders(e,n,r),method:t.toUpperCase(),body:await this._prepareBody(r,n,i),credentials:"same-origin"}}_makeHeaders(e,t,r){const n=this._shouldCompress(t,r)?{"Content-Encoding":"gzip"}:{};return{...this.defaultHeaders(r),...e,...n}}_isFormData(e){return"function"==typeof FormData&&e instanceof FormData}async _prepareBody(e,t,r){if(!e)return;if(this._isFormData(e))return e;const n=r?JSON.stringify(e):e;return this._shouldCompress(t,e)?new f.default(n).encode():n}_shouldCompress(e,t){return!!t&&(!this._isFormData(t)&&e)}_formatUrl(e,t,r){return 0===e.indexOf("http://")||0===e.indexOf("https://")?this._formatAbsoluteUrl(e,t,r):this._formatRelativeUrl(e,t,r)}_formatRelativeUrl(e,t,r){const n=!this.baseUrl.endsWith("/")&&!e.startsWith("/")?"/":"",i=`${this.baseUrl}${n}${e}`;return this._formatAbsoluteUrl(i,t,r)}_formatAbsoluteUrl(e,t,r){const n=r?`?${this._queryString(r)}`:"";return`${this.substituteUrlParamValues(e,t)}${n}`}substituteUrlParamValues(e,t){const r=Object.assign({},this.urlParams,t);return e.replace(/(:\w+)(\/|$)/g,((t,n)=>{const i=n.substring(1),s=r[i];void 0===s&&console.error(`Unable to find value for param ${n} in URL ${e}`);const o=encodeURIComponent(s);return t.endsWith("/")?`${o}/`:o}))}defaultHeaders(e){return e&&this._isFormData(e)?{Accept:"application/json"}:{Accept:"application/json","Content-Type":"application/json"}}async tryParseJson(e){const t=e.headers.get("content-type");if(t&&!t.includes("application/json"))return e;try{return await e.json()}catch(t){return e}}_queryString(e){return Object.keys(e).map((t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`)).join("&")}async _checkForHttpError(e){if(e.ok)return;const t=e.headers.get("content-type");if(!t||t.includes("application/json")){let t;try{t=await e.json()}catch(e){}if(t)throw new m.default(e,t)}throw new m.default(e)}}(0,p.extend)(ApiClient,p.Configurable);var g=ApiClient},19827:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>a}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));var a=class Color{constructor(e,t,r,n){this._r=e,this._g=t,this._b=r,this._a=n}static fromHex(e){return new this(parseInt(e.slice(1,3),16)/255,parseInt(e.slice(3,5),16)/255,parseInt(e.slice(5,7),16)/255,parseInt(e.slice(7,9),16)/255||1)}r(){return this._r}setR(e){this._r=e}g(){return this._g}setG(e){this._g=e}b(){return this._b}setB(e){this._b=e}a(){return this._a}setA(e){this._a=e}equals(e){return this.r()===e.r()&&this.g()===e.g()&&this.b()===e.b()&&this.a()===e.a()}toString(){return`rgba(${255*this.r()}, ${255*this.g()}, ${255*this.b()}, ${this.a()})`}}},64854:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>a}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));class HttpError extends Error{constructor(e,t={}){super(),this.status=e.status,this.statusText=e.statusText,this.message=t.err||`${this.statusText} ${this.status}`,this.body=t}}var a=HttpError},3963:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>a}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));var a=class PropertyStack extends Array{constructor(e){super(),e&&(this._propertiesOfInterest=e)}setPropertiesOfInterest(e){this._propertiesOfInterest=e}trackAllProperties(){this._propertiesOfInterest=void 0}propertiesOfInterest(e){return this._propertiesOfInterest?this._propertiesOfInterest:Object.keys(e).filter((t=>"function"!=typeof e[t]))}_snapshot(e){const t={};for(const r of this.propertiesOfInterest(e))t[r]=e[r];return t}saveStateOf(e){this.push(this._snapshot(e))}_copySnapshotProperties(e,t){for(const r in t)e[r]=t[r]}_removePropertiesNotInSnapshot(e,t){this.propertiesOfInterest(e).filter((e=>void 0===t[e])).forEach((t=>e[t]=void 0))}restoreStateOf(e){const t=this.pop();this._copySnapshotProperties(e,t),this._removePropertiesNotInSnapshot(e,t)}}},58218:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(50988),p=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(3963));var m=class RunningTransformProperties{static requiredProperties(){return["_runningScaleX","_runningScaleY","_runningTranslationX","_runningTranslationY","_runningRotation"]}runningScaleX(){return this._runningScaleX||1}runningScaleY(){return this._runningScaleY||1}runningTranslationX(){return this._runningTranslationX||0}runningTranslationY(){return this._runningTranslationY||0}runningRotation(){return this._runningRotation||0}translate(e,t){return this._runningTranslationX=this.runningTranslationX()+e,this._runningTranslationY=this.runningTranslationY()+t,this._standardTranslate.apply(this,arguments)}scale(e,t){return this._runningScaleX=this.runningScaleX()*e,this._runningScaleY=this.runningScaleY()*t,this._standardScale.apply(this,arguments)}rotate(e){return this._runningRotation=this.runningRotation()+e,this._standardRotate.apply(this,arguments)}save(){return this._propertyStack().saveStateOf(this),this._standardSave.apply(this,arguments)}restore(){return this._propertyStack().restoreStateOf(this),this._standardRestore.apply(this,arguments)}_propertiesOfInterest(){}_propertyStack(){if(!this.__propertyStack){Object.defineProperty(this,"__propertyStack",{enumerable:!1,writable:!0,configurable:!0,value:new p.default});const e=this._propertiesOfInterest();e?this.__propertyStack.setPropertiesOfInterest(e):this.__propertyStack.trackAllProperties()}return this.__propertyStack}_standardTranslate(e,t){throw new h.MissingOverride(this,"_standardTranslate")}_standardScale(e,t){throw new h.MissingOverride(this,"_standardScale")}_standardRotate(e){throw new h.MissingOverride(this,"_standardRotate")}_standardSave(){throw new h.MissingOverride(this,"_standardSave")}_standardRestore(){throw new h.MissingOverride(this,"_standardRestore")}}},28639:(e,t,r)=>{var n,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(l,{default:()=>u}),e.exports=(n=l,((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(n=s(t,l))||n.enumerable});return e})(i({},"__esModule",{value:!0}),n));var c=r(97943);var u=class StringGzip{constructor(e){this._string=e}async encode(){const e=(new TextEncoder).encode(this._string);return new Promise(((t,r)=>{(0,c.gzip)(e,{consume:!0},((e,n)=>{if(e)return r(e);t(n)}))}))}}},96037:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>f}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(32650)),m=d(r(58218));function f(e,t){if(e.prototype._standardTranslate)return;const r=e.prototype.translate,n=e.prototype.scale,i=e.prototype.rotate,s=e.prototype.save,o=e.prototype.restore;(0,p.default)(e,m.default),e.prototype._standardTranslate=r,e.prototype._standardScale=n,e.prototype._standardRotate=i,e.prototype._standardSave=s,e.prototype._standardRestore=o,e.prototype._propertiesOfInterest=t?()=>t.concat(m.default.requiredProperties()):()=>{}}},42826:(e,t,r)=>{var n=Object.create,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,c=(e,t,r)=>(r=null!=e?n(a(e)):{},((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let a of o(t))l.call(e,a)||a===r||i(e,a,{get:()=>t[a],enumerable:!(n=s(t,a))||n.enumerable});return e})(!t&&e&&e.__esModule?r:i(r,"default",{value:e,enumerable:!0}),e)),u=r(57075),d=c(r(30045)),h=c(r(55327)),p=c(r(31255)),m=c(r(39288)),f=c(r(95203)),g=c(r(40436)),y=c(r(90749)),b=c(r(14935)),v=c(r(13482)),_=c(r(26563)),x=c(r(11541)),w=c(r(52353)),R=c(r(42932)),k=c(r(97856)),j=c(r(61210)),z=c(r(15904)),q=c(r(66904)),$=c(r(33381)),Z=c(r(9348)),X=c(r(18350)),Y=c(r(86819)),ee=c(r(36990)),te=c(r(86e3)),re=c(r(44425)),ne=c(r(4674)),ie=c(r(68662));u.SmartObjectBuilder.configure((e=>{e.classes.addClasses(d.default,h.default,p.default,m.default,f.default,g.default,y.default,b.default,v.default,_.default,x.default,w.default,R.default,k.default,j.default,z.default,q.default,$.default,Z.default,X.default,Y.default,ee.default,te.default,re.default,ne.default,ie.default)}))},18477:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>y}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=r(98326),m=r(42932),f=d(r(97856)),g=d(r(68662));var y=class Arc{constructor(e,t,r,{isClockwise:n=!0,isMinorAngle:i=!0}={}){this._begin=e,this._end=t,this._radius=r,this._isClockwise=n,this._isMinorAngle=i}boundingBox(){const e=this.referenceFrame();return(!this._boundingBox||this._cachedBoundingBoxFrame&&this._cachedBoundingBoxFrame<e)&&(this._boundingBox=this._defaultBoundingBox(),this._cachedBoundingBoxFrame=e),this._boundingBox}_defaultBoundingBox(){const e=this.radius(),t=this.center(),r=new f.default(e,this.begin().subtract(t).theta()),n=new f.default(e,this.end().subtract(t).theta()),i=[r.add(t),n.add(t)],s=Math.ceil(r.theta()/Math.PI_2),o=Math.floor(n.theta()/Math.PI_2);for(let r=s;r<=o;r++)i.push(new f.default(e,r*Math.PI_2).add(t));const a=i.map((e=>e.x())),l=i.map((e=>e.y())),c=Math.min(...a),u=Math.max(...a)-c,d=Math.min(...l),h=Math.max(...l)-d;return new g.default(c,d,u,h)}intersections(e){const t=this.center(),r=e.closestPointTo(t,!0),n=r.distanceTo(t);if(n>this.radius()&&!n.isNearTo(this.radius()))return[];let i;if(n.isNearTo(this.radius()))i=[r];else{const t=Math.sqrt(this.radius()**2-n**2);i=[new f.default(-t,e.theta()).add(r),new f.default(t,e.theta()).add(r)]}const s=this.begin().subtract(t).theta(),o=this.sweepAngle();return i.filter((r=>{let n=r.subtract(t).theta()-s;n<0&&(n+=Math.TWO_PI);const i=n<=o,a=n>=Math.TWO_PI-o;return(this.isClockwise()?i:a)&&e.containsPoint(r)}))}referenceFrame(){return Math.max(this.begin().referenceFrame(),this.end().referenceFrame())}center(){const e=this.referenceFrame();if(!this._center||this._cachedCenterFrame&&this._cachedCenterFrame<e){const t=this.isClockwise()?(Math.PI-this.sweepAngle())/2:-(Math.PI-this.sweepAngle())/2,r=this.chord().theta()+t;this._center=this.begin().add(new f.default(this.radius(),r)),this._cachedCenterFrame=e}return this._center}sweepAngle(){const e=this.referenceFrame();if(!this._sweepAngle||this._cachedSweepAngleFrame&&this._cachedSweepAngleFrame<e){const t=Math.acos(1-(this.chordLength()/this.radius())**2/2);this._sweepAngle=this.isMinorAngle()?t:2*Math.PI-t,this._cachedSweepAngleFrame=e}return this._sweepAngle}divisions(e){const t=this.center(),r=this.sweepAngle()/e,n=t.to(this.begin()).theta(),i=this.radius(),s=[this.begin()],o=this.isClockwise()?1:-1;for(let a=1;a<=e-1;a++){const e=n+a*r*o;s.push(t.add(new f.default(i,e)))}return s.push(this.end()),s}point(e){const t=this.center(),r=t.to(this.begin()).theta(),n=this.sweepAngle()*e,i=this.isClockwise()?1:-1;return new f.default(this.radius(),r+i*n).add(t)}x(e){return this.point(e).x()}y(e){return this.point(e).y()}z(e){this.begin().z()}length(){return this.arcLength()}arcLength(){return this.radius()*this.sweepAngle()}chordLength(){return this.begin().distanceTo(this.end())}chord(){return this._chord??=this.begin().to(this.end())}signedRelativeArea(){const e=this.sweepAngle();return(this.isClockwise()?1:-1)*(this.radius()**2*(e-Math.sin(e))/2)}radius(){return this._radius}begin(){return this._begin}end(){return this._end}isMinorAngle(){return this._isMinorAngle}isClockwise(){return this._isClockwise}isCounterClockwise(){return!this.isClockwise()}reversed(){return new this.constructor(this.end(),this.begin(),{isClockwise:!this.isClockwise(),isMinorAngle:this.isMinorAngle()})}contains(e,t,r,n=Math.DEFAULT_TOLERANCE){const i=(0,m.$P)(e,t);if(Math.abs(i.distanceTo(this.begin()))<=n||i.distanceTo(this.end())<=n)return!0;if(Math.abs(i.distanceTo(this.center())-this.radius())>n)return!1;const s=(this.isClockwise()?this.chord().normal():this.chord().normal().negated()).dot(i.subtract(this.begin()));return Math.sign(s)>0}moveBy(e,t,r){let n=!1;return[this.center(),this.begin(),this.end()].forEach((i=>n=i.moveBy(e,t,r)||n)),n}toString(){return`${this.begin()}${this._symbol()}${this.end()} @ R${this.radius()}`}_symbol(){return{true:{true:"↶",false:"⤿"},false:{true:"↷",false:"⤾"}}[this.isClockwise()][this.isMinorAngle()]}equals(e){if(this===e)return!0;if(!(e&&e.begin&&e.end&&e.radius))return!1;const t=this.begin().equals(e.begin()),r=this.end().equals(e.end()),n=this.length().isNearTo(e.length());return t&&r&&n}startAngle(){return this.begin().subtract(this.center()).theta().normalizedAngle()}endAngle(){const e=this.isClockwise()?this.sweepAngle():-this.sweepAngle();return this.startAngle()+e}crossings(e){const t=this.center(),r=this.radius(),n=e.y()-t.y();if(Math.abs(n)>r&&!Math.abs(n).isNearTo(r))return 0;let i;if(Math.abs(n).isNearTo(r))i=[t.x()];else{const e=Math.sqrt(r**2-n**2);i=[t.x()+e,t.x()-e]}return i.filter((t=>t>=e.x()&&this._quickContains(t,e.y()))).length}_quickContains(e,t){const r=this.begin(),n=this.end(),i=Math.DEFAULT_TOLERANCE;if(r.distanceTo(e,t)<=i||n.distanceTo(e,t)<=i)return!0;const s=this.isClockwise()?(0,p.locatorNormalAngle)(n.x()-r.x(),n.y()-r.y()):(0,p.locatorNormalAngle)(r.x()-n.x(),r.y()-n.y());return(e-r.x())*(0,p.locatorX)(1,s)+(t-r.y())*(0,p.locatorY)(1,s)>0}}},10680:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>_}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));r(37230),r(50988);var p=r(97436),m=d(r(32640)),f=d(r(55327)),g=d(r(72284)),y=d(r(86819)),b=d(r(97856));const v=[[.1279381953467522,-.0640568928626056],[.1279381953467522,.0640568928626056],[.1258374563468283,-.1911188674736163],[.1258374563468283,.1911188674736163],[.1216704729278034,-.3150426796961634],[.1216704729278034,.3150426796961634],[.1155056680537256,-.4337935076260451],[.1155056680537256,.4337935076260451],[.1074442701159656,-.5454214713888396],[.1074442701159656,.5454214713888396],[.0976186521041139,-.6480936519369755],[.0976186521041139,.6480936519369755],[.0861901615319533,-.7401241915785544],[.0861901615319533,.7401241915785544],[.0733464814110803,-.820001985973903],[.0733464814110803,.820001985973903],[.0592985849154368,-.8864155270044011],[.0592985849154368,.8864155270044011],[.0442774388174198,-.9382745520027328],[.0442774388174198,.9382745520027328],[.0285313886289337,-.9747285559713095],[.0285313886289337,.9747285559713095],[.0123412297999872,-.9951872199970213],[.0123412297999872,.9951872199970213]];class CubicBezier extends g.default{constructor(e,t,r,n,i=Math.SIGNIFICANT_DECIMAL_PLACES){super(),this._begin=e,this._end=n,this._controlPoint1=t,this._controlPoint2=r,this._significantDecimalPlaces=i}snapPoint(){return this.begin()}toString(){return`${this.begin()}~>${this.end()}`}referenceFrame(){return Math.max(...this.vertices().map((e=>e.referenceFrame())))}begin(){return this._begin}end(){return this._end}controlPoint1(){return this._controlPoint1}controlPoint2(){return this._controlPoint2}significantDecimalPlaces(){return this._significantDecimalPlaces}vertices(){return[this.begin(),this.controlPoint1(),this.controlPoint2(),this.end()]}edge(){return this.begin().to(this.end())}equals(e){if(this===e)return!0;if(!(e&&e.begin&&e.end&&e.controlPoint1&&e.controlPoint2))return!1;const t=this.begin().equals(e.begin()),r=this.controlPoint1().equals(e.controlPoint1()),n=this.controlPoint2().equals(e.controlPoint2()),i=this.end().equals(e.end());return t&&r&&n&&i}mutableSources(){const e=this.vertices().flatMap((e=>e.mutableSources()));return[...new Set(e)]}moveBy(e,t,r){let n=!1;return this.mutableSources().forEach((i=>n=i.moveBy(e,t,r)||n)),n}movedBy(e,t,r){const n=this.snapshot();return n.moveBy(e,t,r),n}reversed(){return new this.constructor(this.end(),this.controlPoint2(),this.controlPoint1(),this.begin())}roundedTo(e){return new this.constructor(this.begin().roundedTo(e),this.controlPoint1().roundedTo(e),this.controlPoint2().roundedTo(e),this.end().roundedTo(e))}snapshot(){return new this.constructor(this.begin().snapshot(),this.controlPoint1().snapshot(),this.controlPoint2().snapshot(),this.end().snapshot())}center(){return this.begin().add(this.controlPoint1().multipliedBy(3)).add(this.controlPoint2().multipliedBy(3)).add(this.end()).dividedBy(8)}signedArea(){const e=this.begin(),t=this.end(),r=this.controlPoint1(),n=this.controlPoint2(),i=e.x(),s=e.y(),o=r.x(),a=r.y(),l=n.x(),c=n.y(),u=t.x(),d=t.y();return(i*(10*s+6*a+3*c+d)+3*o*(-2*s+c+d)+l*(-3*s-3*a+6*d)+u*(-s-3*a-6*c-10*d))/20}signedRelativeArea(){const e=this.begin(),t=this.end(),r=.5*(e.x()*(e.y()+t.y())-t.x()*(e.y()+t.y()));return this.signedArea()-r}boundingBox(){const e=this.extrema().reduce(((e,t)=>(t.x()>e.xMax&&(e.xMax=t.x()),t.x()<e.xMin&&(e.xMin=t.x()),t.y()>e.yMax&&(e.yMax=t.y()),t.y()<e.yMin&&(e.yMin=t.y()),e)),{xMin:1/0,xMax:-1/0,yMin:1/0,yMax:-1/0});return(0,m.default)(e.xMin.roundedTo(6),e.yMin.roundedTo(6)).toCorner((0,m.default)(e.xMax.roundedTo(6),e.yMax.roundedTo(6)))}extrema(){return[...this._tangentRoots().map((e=>(0,m.default)(this.x(e),this.y(e),this.z(e)))),this.begin(),this.end()]}xy(){return new this.constructor(this.begin().xy(),this.controlPoint1().xy(),this.controlPoint2().xy(),this.end().xy(),this.significantDecimalPlaces())}x(e){return this._cubic(e,this._xWeights())}y(e){return this._cubic(e,this._yWeights())}z(e){return this._cubic(e,this._zWeights())}point(e){const t=this.vertices().map((e=>[e.x(),e.y(),e.z()])),r=1-e,n=e,i=r*r,s=r*r*r,o=n*n,a=n*n*n;return(0,m.default)(1*t[0][0]*s+3*t[1][0]*i*n+3*t[2][0]*r*o+1*t[3][0]*a,1*t[0][1]*s+3*t[1][1]*i*n+3*t[2][1]*r*o+1*t[3][1]*a,1*t[0][2]*s+3*t[1][2]*i*n+3*t[2][2]*r*o+1*t[3][2]*a)}length(e=1){const t=e=>Math.sqrt(this._xTangent(e)**2+this._yTangent(e)**2+this._zTangent(e)**2),r=e/2;return v.map((([e,n])=>r*e*t(r*n+r))).sum()}intersects(e,t,r,n=Math.DEFAULT_TOLERANCE){return this.contains(e,t,r,n)}contains(e,t,r,n=Math.DEFAULT_TOLERANCE){return void 0===r?this.xy().containsPoint((0,m.default)(e,t),n):this.containsPoint((0,m.default)(e,t,r),n)}intersectsPoint(e){return this.containsPoint(e)}containsPoint(e,t=Math.DEFAULT_TOLERANCE){return!!this.boundingBox().contains(e.x(),e.y())&&this.shortestLineFrom(e).length().isNearTo(0,t)}shortestLineFrom(e){return new f.default(e,this.closestPointTo(e))}closestPointTo(e,t=Math.DEFAULT_TOLERANCE){return this.closestPointAndTTo(e,t).point}closestPointAndTTo(e,t=Math.DEFAULT_TOLERANCE){const r=e.snapshot(),n={point:this.begin(),distance:this.begin().distanceTo(r),t:0},i=this._pointWithDistanceAndTValue(.5,r),s={point:this.end(),distance:this.end().distanceTo(r),t:1};let o=this._pickClosestPoint(n,i,s),a=.25;for(let e=0;e<15;e++){const e=1===o.t?{distance:1/0}:this._pointWithDistanceAndTValue(o.t+a,r),n=0===o.t?{distance:1/0}:this._pointWithDistanceAndTValue(o.t-a,r);if(Math.abs(Math.min(e.distance,n.distance)-o.distance)<=t)break;o=this._pickClosestPoint(o,e,n);if(o.distance<=t)break;a*=.5}return{point:o.point,t:o.t}}_pointWithDistanceAndTValue(e,t){const r=this.point(e),n=r.distanceTo(t);return{point:r,distance:n,t:e}}_pickClosestPoint(e,t,r){return t.distance<e.distance&&t.distance<r.distance?t:r.distance<e.distance?r:e}intersections(e){if(!(e instanceof f.default))throw new Error("only curve-edge intersections supported as of now");return this.intersectionsWithEdgeIn3D(e)}intersectionsWithEdgeIn2D(e){const t=e.begin(),r=e.theta(),n=this.vertices().map((e=>e.snapshot().rotatedBy(t,-r).subtract(t))),i=n.map((e=>e.x())),s=e.vector().r();return this._cubicRootsFor(n.map((e=>e.y()))).filter((e=>{const t=this._cubic(e,i);return t>=0&&t<=s})).map((e=>(0,m.default)(this.x(e),this.y(e),this.z(e))))}crossings(e){const t=this.vertices().map((t=>t.subtract(e)));return this._cubicRootsFor(t.map((e=>e.y()))).filter((t=>this.x(t)>=e.x())).length}intersectionsWithEdge(e){return this.intersectionsWithEdgeIn3D(e)}intersectionsWithEdgeIn3D(e){const t=e.begin(),r=e.direction(),n=e.normal().negated(),i=n.cross(r),s=this.vertices().map((e=>{const s=e.snapshot().subtract(t);return(0,m.default)(s.dot(r),s.dot(i),s.dot(n))}));let o=[],a=this._cubicRootsFor(s.map((e=>e.y())));const l=this._cubicRootsFor(s.map((e=>e.z())));return a&&l?(a=a.map((e=>e.roundedTo(14))),o=l.filter((e=>a.includes(e.roundedTo(14))))):o=a||l,o.map((e=>(0,m.default)(this.x(e),this.y(e),this.z(e)))).filter((t=>e.containsPoint(t)))}runCurveThrough(e){const t=this.begin(),r=this.end(),n=t.distanceTo(e),i=n/(n+r.distanceTo(e)),s=(Math.atan2(r.y()-t.y(),r.x()-t.x())-Math.atan2(e.y()-t.y(),e.x()-t.x())+Math.TWO_PI)%Math.TWO_PI;let o=t.distanceTo(r)/3;(s<0||s>Math.PI)&&(o=-o);const a=y.default.from3Points(t,r,e),l=e.subtract(a.center()).theta()-Math.PI_2,c=new b.default(1,l),u=e.add(c.multipliedBy(i*o)),d=e.subtract(c.multipliedBy((1-i)*o));this.moldCurveTo(e,i,u,d)}moldCurveTo(e,t,r,n){const i=this.begin(),s=this.end(),o=(a=t,Math.abs((a**3+(1-a)**3-1)/(a**3+(1-a)**3)));var a;const l=(e=>(1-e)**3/(e**3+(1-e)**3))(t),c=i.multipliedBy(l).add(s.multipliedBy(1-l)),u=e.subtract(c.subtract(e).dividedBy(o)),d=r.subtract(u.multipliedBy(t)).dividedBy(1-t),h=n.subtract(u.multipliedBy(1-t)).dividedBy(t),p=d.subtract(i.multipliedBy(1-t)).dividedBy(t),m=h.subtract(s.multipliedBy(t)).dividedBy(1-t),f=p.subtract(this.controlPoint1()),g=m.subtract(this.controlPoint2());this.controlPoint1().moveBy(f.x(),f.y()),this.controlPoint2().moveBy(g.x(),g.y())}deCasteljauTangentPoints(e){const t=this.begin().multipliedBy(1-e).add(this.controlPoint1().multipliedBy(e)),r=this.controlPoint2().multipliedBy(1-e).add(this.end().multipliedBy(e)),n=this.controlPoint1().multipliedBy(1-e).add(this.controlPoint2().multipliedBy(e));return[t.multipliedBy(1-e).add(n.multipliedBy(e)),n.multipliedBy(1-e).add(r.multipliedBy(e))]}_cubic(e,t){const r=1-e,n=e,i=r*r,s=r*r*r,o=n*n,a=n*n*n;return 1*t[0]*s+3*t[1]*i*n+3*t[2]*r*o+1*t[3]*a}_quadratic(e,t){const r=1-e,n=e;return 1*t[0]*r**2+2*t[1]*r*n+1*t[2]*n**2}_xWeights(){return this.vertices().map((e=>e.x()))}_yWeights(){return this.vertices().map((e=>e.y()))}_zWeights(){return this.vertices().map((e=>e.z()))}_tangentFunction(e){return t=>this._quadratic(t,[3*(e[1]-e[0]),3*(e[2]-e[1]),3*(e[3]-e[2])])}_xTangent(e){return this._tangentFunction(this._xWeights())(e)}_yTangent(e){return this._tangentFunction(this._yWeights())(e)}_zTangent(e){return this._tangentFunction(this._zWeights())(e)}_tangentRoots(){const e=this._xWeights(),t=this._yWeights();return[...this._derivativeRootsFor(e),...this._derivativeRootsFor(t)].sort()}_derivativeRootsFor(e){const t=3*(-e[0]+3*e[1]-3*e[2]+e[3]),r=6*(e[0]-2*e[1]+e[2]),n=3*(e[1]-e[0]);let i;return i=0===t?[-n/r].filter((e=>e>=0&&e<=1)):[(-r+Math.sqrt(r**2-4*t*n))/(2*t),(-r-Math.sqrt(r**2-4*t*n))/(2*t)],i.filter((e=>e>=0&&e<=1))}_cubicRootsFor(e){const[t,r,n,i]=e,s=e=>e>=0&&e<=1;let o=3*r-t-3*n+i,a=3*t-6*r+3*n,l=-3*t+3*r,c=t;if(0===o){if(o=a,a=l,l=c,0===o){if(0===a)return;return[-l/a].filter(s)}const e=Math.sqrt(a**2-4*o*l);return 0===e?[-a/(2*o)].filter(s):[(-a+e)/(2*o),(-a-e)/(2*o)].filter(s)}return(0,p.getCubicRoots)(o,a,l,c).filter((e=>0===e.imag)).map((e=>e.real)).filter(s)}}var _=CubicBezier},26713:(e,t,r)=>{var n=Object.create,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,c=(e,t,r)=>(r=null!=e?n(a(e)):{},((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let a of o(t))l.call(e,a)||a===r||i(e,a,{get:()=>t[a],enumerable:!(n=s(t,a))||n.enumerable});return e})(!t&&e&&e.__esModule?r:i(r,"default",{value:e,enumerable:!0}),e)),u=r(50988),d=c(r(81976)),h=c(r(86714)),p=c(r(30685)),m=c(r(49029));(0,u.extend)(d.default,h.default),(0,u.extend)(d.default,p.default),(0,u.extend)(d.default,m.default)},37230:(e,t,r)=>{var n=r(27281);Math.TWO_PI=2*Math.PI,Math.PI_2=Math.PI/2,Math.PI_4=Math.PI/4,Math.THREE_PI_2=3*Math.PI_2,Math.THREE_PI_4=3*Math.PI_4,Math.SIGNIFICANT_DECIMAL_PLACES=6,Math.DEFAULT_TOLERANCE=Math.pow(10,-Math.SIGNIFICANT_DECIMAL_PLACES),Math.SQFT_PER_SQIN=1/144,Number.prototype.isVertical=function(){return Math.abs(this%Math.PI)===Math.PI_2},Number.prototype.isHorizontal=function(){return this%Math.PI==0},Number.prototype.normalizedAngle=function(){return(this+Math.TWO_PI*Math.floor((Math.TWO_PI-this)/Math.TWO_PI))%Math.TWO_PI},Number.prototype.radiansToDegrees=function(){return 180*this/Math.PI},Number.prototype.degreesToRadians=function(){return 2*this*Math.PI/360},Number.prototype.rounded=function(){return Math.round(this)},Number.prototype.roundedTo=function(e){return(0,n.decimalAdjust)("round",this,-e)},Number.prototype.constrained=function(e,t){return void 0===t&&(t=1/0),Math.max(Math.min(this,t),e)},Number.prototype.isNearTo=function(e,t){t=t||Math.DEFAULT_TOLERANCE;const r=Math.abs(Math.log10(t)),n=Math.pow(10,r),i=(this*n-e*n)/n;return Math.abs(i)<=t}},30045:(e,t,r)=>{var n,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(l,{default:()=>d,mixUnitExtensions:()=>u}),e.exports=(n=l,((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(n=s(t,l))||n.enumerable});return e})(i({},"__esModule",{value:!0}),n));r(37230);var c=r(63768);function u(e){e.prototype.inches=function(){return"in"===this.formatUnits()?this:this.to("in")},function(e){if(e.prototype._originalToJSON)return;e.prototype._originalToJSON=e.prototype.toJSON,e.prototype.toJSON=function(){const e=this._originalToJSON();return e.constructor=this.constructor,e}}(e),e.prototype.restore=function(t,r,n){Object.assign(this,e.fromJSON(t))},e.prototype.toInches=function(e=Math.SIGNIFICANT_DECIMAL_PLACES){return this.toNumeric("in").roundedTo(e)},e.prototype.mm=function(){return"mm"===this.formatUnits()?this:this.to("mm")},e.prototype.toMM=function(e=Math.SIGNIFICANT_DECIMAL_PLACES){return this.toNumeric("mm").roundedTo(e)},e.prototype.feet=function(){return"ft"===this.formatUnits()?this:this.to("ft")},e.prototype.toDecimalFeet=function(e=Math.SIGNIFICANT_DECIMAL_PLACES){return this.toNumeric("ft").roundedTo(e)};const t=["in","ft"];return e.prototype.isImperial=function(){return t.includes(this.formatUnits())},function(e){if(e.prototype._originalToString)return;e.prototype._originalToString=e.prototype.toString,e.prototype.toString=function(){if(!this.isImperial())return this._originalToString();let e,t,r="";const n=Math.abs(this.toNumeric().roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES));this.toNumeric()<0&&(r="-"),"ft"===this.formatUnits()?(e=Math.floor(n),t=Math.abs(this.toInches())%12):(e=Math.floor(n/12),t=n%12);const i=[];if(0!==e&&i.push(`${e}'`),0!==t&&i.push(`${t}"`),0===i.length)return'0"';return`${r}${i.join(" ")}`},e.prototype.valueOf=e.prototype.toString}(e),function(e){if(e._originalParse)return;e._originalParse=e.parse,e.parse=function(e){return e.includes('"')||e.includes("'")?this._parseLengthUnitWithTickMarks(e):this._originalParse(e)}}(e),e._parseLengthUnitWithTickMarks=function(t){const r=this._parseNegative(t),n=12*this._parseFeetWithTickMarks(t)+this._parseInchesWithTickMarks(t);return new e(r?-n:n,"in")},e._parseNegative=function(e){return e.startsWith("-")},e._parseFeetWithTickMarks=function(e){const t=/(?<feet>[\d.]+)'/.exec(e);if(!t)return 0;const r=t.groups.feet;return parseFloat(r)??0},e._parseInchesWithTickMarks=function(e){const t=/(?<inchesWhole>\d+)?\s*(?<inchesNumerator>\d+)\/(?<inchesDenominator>\d+)"/.exec(e);if(t){return(parseFloat(t.groups.inchesWhole)||0)+parseFloat(t.groups.inchesNumerator)/parseFloat(t.groups.inchesDenominator)}const r=/(?<inchesDecimal>[\d.]+)"/.exec(e);return r?parseFloat(r.groups.inchesDecimal):0},e}var d=u(c.Unit);Number.prototype.inches=function(){return new c.Unit(this.valueOf(),"in")},Number.prototype.mm=function(){return new c.Unit(this.valueOf(),"mm")},Number.prototype.feet=function(){return new c.Unit(this.valueOf(),"ft")}},62048:(e,t,r)=>{r(44417),r(83388),r(95429);const n=r(48351),i=r(4693),s=r(24873),o=r(77185),a=r(63918),l=r(84540),c=r(12522),u=r(43034),d=r(18347),h=r(40387),p=r(18905),m=r(17943),f=r(4664),g=r(70490),y=r(46407),b=r(5734),v=r(22075),_=r(71162),x=r(551),w=r(49701),R=r(50143),k=r(54124),j=r(87171),z=r(67653),q=r(66836),$=r(2856),Z=r(37498),X=r(63153),Y=r(79274),ee=r(44674),te=r(42533),re=r(68118),ne=r(16052),ie=r(44471),se=r(76472),oe=r(1541),ae=r(59455),le=r(54207),ce=r(38283),ue=r(27026),de=r(23281),he=r(35545),pe=r(93413),me=r(96146),fe=r(73827),ge=r(12003),ye=r(39420),be=r(68232),ve=r(64917),_e=r(72),xe=r(10240);e.exports.$P=n,e.exports.$R=i,e.exports.Angle=s,e.exports.AngleAnnotation=o,e.exports.Annotation=a,e.exports.Arc=l,e.exports.Circle=c,e.exports.ClippablePolygon=u,e.exports.Component=d,e.exports.Composite=h,e.exports.Cube=p,e.exports.CubicBezier=m,e.exports.DimensionAnnotation=f,e.exports.Edge=g,e.exports.EdgeIntersectionLocator=y,e.exports.EdgeRelativeLocator=b,e.exports.ExtrudedPolygon=v,e.exports.FixedEdgeLocator=_,e.exports.FixedZLocator=x,e.exports.General=w,e.exports.Handleable=R,e.exports.LineIntersectionLocator=k,e.exports.Locator=j,e.exports.LocatorArithmeticMixin=z,e.exports.LocatorManipulationMixin=q,e.exports.LocatorTransmutationMixin=$,e.exports.LocatorXY=Z,e.exports.LocatorXZ=X,e.exports.LocatorYZ=Y,e.exports.Matrix=ee,e.exports.Mesh=te,e.exports.ModifiableCorners=re,e.exports.NormalToEdgeLocator=ne,e.exports.Path=ie,e.exports.PlanarNormalToEdgeLocator=se,e.exports.PlanarNormalToEdgeLocatorBuilder=oe,e.exports.Point=ae,e.exports.PolarCoordinate=le,e.exports.Polygon=ce,e.exports.PolygonClipping=ue,e.exports.PolygonWithHoles=de,e.exports.ProportionalEdgeLocator=he,e.exports.Rectangle=pe,e.exports.RelativeEdge=me,e.exports.RelativeLocator=fe,e.exports.RelativeZLocator=ge,e.exports.ShapeFromVertices=ye,e.exports.ThreeSourceRelativeLocator=be,e.exports.TriangleMesh=ve,e.exports.Unit=_e,e.exports.functions=xe},55327:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>_}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));r(50988),r(37230);var p=d(r(32640)),m=r(98326),f=d(r(11541)),g=d(r(97856)),y=d(r(61210)),b=d(r(15904)),v=d(r(72284));class Edge extends v.default{constructor(e,t,r=Math.SIGNIFICANT_DECIMAL_PLACES){super(),this._begin=e,this._end=t,this._significantDecimalPlaces=r}snapPoint(){return this.begin()}toString(){return`${this.begin()}->${this.end()}`}referenceFrame(){return Math.max(this._begin.referenceFrame(),this._end.referenceFrame())}begin(){return this._begin}end(){return this._end}center(){return new y.default(this,.5)}endpoints(){return[this.begin(),this.end()]}sharedEndpointWith(e,t=Math.DEFAULT_TOLERANCE){return this.endpoints().find((r=>r.equals(e.begin(),t)||r.equals(e.end(),t)))}sharesEndpointWith(e,t=Math.DEFAULT_TOLERANCE){return Boolean(this.sharedEndpointWith(e,t))}boundingBox(){return this.begin().toCorner(this.end())}equals(e){if(this===e)return!0;if(!(e&&e.begin&&e.end&&e.length))return!1;const t=this.begin().equals(e.begin()),r=this.end().equals(e.end()),n=this.length().isNearTo(e.length());return t&&r&&n}mutableSources(){const e=this._begin.mutableSources().concat(this._end.mutableSources());return[...new Set(e)]}replaceNearestEndpoint(e){const t=this.begin(),r=this.end();e.distanceTo3D(t)>e.distanceTo3D(r)?this._end=e:this._begin=e}withNearestEndpointReplaced(e){const t=this.snapshot();return t.replaceNearestEndpoint(e),t}stretchBy(e){const t=this.direction(),r=t.negated().multipliedBy(e/2),n=t.multipliedBy(e/2);this.begin().moveBy(r.x(),r.y(),r.z()),this.end().moveBy(n.x(),n.y(),n.z())}stretchedBy(e){const t=this.snapshot();return t.stretchBy(e),t}relativeTo(e,t=e){const r=b.default.makeRelativeTo(this.begin(),e),n=b.default.makeRelativeTo(this.end(),t);return r.to(n)}relativeToEdge(e){return this.relativeTo(e.begin(),e.end())}isParallelToZAxis(){return this.begin().x()===this.end().x()&&this.begin().y()===this.end().y()}isHorizontal(){return this._end.y()===this._begin.y()}isVertical(){return this._end.x()===this._begin.x()}isNearlyHorizontal(){return this._end.y().isNearTo(this._begin.y())}isNearlyVertical(){return this._end.x().isNearTo(this._begin.x())}isNearlyOrthogonal(){return this.isNearlyVertical()||this.isNearlyHorizontal()}isNearlyDiagonalToRightAngle(){const e=this.normalizedAngle()%Math.PI;return e.isNearTo(Math.PI_4)||e.isNearTo(Math.THREE_PI_4)}isNearlyDiagonalToOctagonalAngle(){const e=this.normalizedAngle()%Math.PI_2;return e.isNearTo(Math.PI_4/2)||e.isNearTo(Math.THREE_PI_4/2)}isHeadingPositiveX(){return this._end.x()>this._begin.x()}isHeadingPositiveY(){return this._end.y()>this._begin.y()}isPerpendicularTo(e){const t=(this.normalizedAngle()-e.normalizedAngle()).normalizedAngle();return t.isNearTo(Math.PI_2)||t.isNearTo(Math.THREE_PI_2)}isPerpendicularTo3D(e){return this.vector().dot(e.vector()).isNearTo(0)}isReflexTo(e){return(this.angle()-e.angle()).normalizedAngle()>Math.PI}isParallelTo(e,t=Math.DEFAULT_TOLERANCE){return this.xy().isParallelToIn3D(e.xy(),t)}isParallelToIn3D(e,t=Math.DEFAULT_TOLERANCE){return Math.abs(this.vector().normalized().dot(e.vector().normalized())).isNearTo(1,t)}moveBy(e,t,r){let n=!1;return this.mutableSources().forEach((i=>n=i.moveBy(e,t,r)||n)),n}movedBy(e,t,r){const n=this.snapshot();return n.moveBy(e,t,r),n}movedByDelta(e){return this.movedBy(e.x(),e.y(),e.z())}reversed(){return new this.constructor(this.end(),this.begin())}shiftedAlongNormalBy(e){return new this.constructor(new f.default(new y.default(this,0),e),new f.default(new y.default(this,1),e))}addZ(e){return new this.constructor(this.begin().addZ(e),this.end().addZ(e))}segmentsInsidePolygon(e,t=Math.DEFAULT_TOLERANCE){const r=e=>e.intersectionsWithEdgeIn2D(this,t).filter((e=>{const r=e.equals(this.begin(),t),n=e.equals(this.end(),t);return!r&&!n})),n=[],i=e.edges();for(let e=0;e<i.length;e++){const t=r(i[e]);n.fastMerge(t)}n.sort(((e,t)=>e.distanceTo(this.begin())-t.distanceTo(this.begin())));const s=e.containsPoint(this.begin(),t),o=e.containsPoint(this.end(),t);s&&n.unshift(this.begin()),o&&n.push(this.end());const a=[];for(let e=0;e<n.length-1;e+=2){const r=n[e].to(n[e+1]);r.length()>=t&&a.push(r)}return a}signedRelativeArea(){return 0}vector(){return this._end.subtract(this._begin)}direction(){return this.vector().normalized()}length(){return this.vector().rho()}angle(){return this.theta()}normalizedAngle(){return this.angle().normalizedAngle()}angleToDegrees(){return 180*this.angle()/Math.PI}normalAngle(){const e=this.referenceFrame();return(!this._normalAngle||this._cachedNormalAngleFrame&&this._cachedNormalAngleFrame<e)&&(this._normalAngle=this.vector().normalAngle(),this._cachedNormalAngleFrame=e),this._normalAngle}normal(){return new g.default(1,this.normalAngle())}theta(){const e=this.referenceFrame();return(!this._angle||this._cachedAngleFrame&&this._cachedAngleFrame<e)&&(this._angle=this.vector().theta(),this._cachedAngleFrame=e),this._angle}phi(){return this.vector().phi()}intersectsPoint(e){return this.containsPoint(e)}intersects(e,t,r,n=Math.DEFAULT_TOLERANCE){return this.contains(e,t,r,n)}containsEdge(e,t=Math.DEFAULT_TOLERANCE){return this.containsPoint(e.begin(),t)&&this.containsPoint(e.end(),t)}containsPoint(e,t=Math.DEFAULT_TOLERANCE){return this.shortestLineFrom(e).length().isNearTo(0,t)}containsPointOnLine(e,t=Math.DEFAULT_TOLERANCE){return this.shortestLineFrom(e,!0).length().isNearTo(0,t)}contains(e,t,r,n=Math.DEFAULT_TOLERANCE){return void 0===r?this.xy().containsPoint((0,p.default)(e,t),n):this.containsPoint((0,p.default)(e,t,r),n)}shortestLineFrom(e,t){return new this.constructor(e,this.closestPointTo(e,t))}_vectorAndPercentDistanceAlongSegmentOfClosestPointTo(e,t){const r=this.vector();let n=e.subtract(this._begin).dot(r)/r.dot(r);return t||(n=n.constrained(0,1)),{vector:r,percentDistanceAlongSegment:n}}closestPointTo(e,t){const r=this._vectorAndPercentDistanceAlongSegmentOfClosestPointTo(e,t);return this._begin.add(r.vector.multipliedBy(r.percentDistanceAlongSegment))}closestRelativePointTo(e,t){let r=this._vectorAndPercentDistanceAlongSegmentOfClosestPointTo(e,t).percentDistanceAlongSegment;return r<0&&(r-=1),new y.default(this,r)}slope(){return(this._end.y()-this._begin.y())/(this._end.x()-this._begin.x())}yIntercept(){return this.isVertical()?-1/0:this._begin.y()-this.slope()*this._begin.x()}xIntercept(){return this.isHorizontal()?-1/0:this.isVertical()?this._begin.x():-this.yIntercept()/this.slope()}intersections(e){return e.intersectionsWithEdge(this)}rotateBy(e,t){this._begin.rotateBy(e,t),this._end.rotateBy(e,t)}rotatedBy(e,t){const r=this.snapshot();return r.rotateBy(e,t),r}merge(e){const t=[this.begin(),this.end(),e.begin(),e.end()],r=t.map((e=>t.filter((t=>t!==e)).reduce(((t,r)=>{const n=e.distanceTo(r);return n<t.length?t:{begin:r,end:e,length:n}}),{length:0}))).reduce(((e,t)=>t.length<e.length?e:t));return new this.constructor(r.begin,r.end)}overlaps(e,t=Math.DEFAULT_TOLERANCE){const r=this.containsPoint(e.begin(),t)||this.containsPoint(e.end(),t)||e.containsPoint(this.begin(),t)||e.containsPoint(this.end(),t);return this.isParallelTo(e,t)&&r}overlapsBySignificantDistance(e,t=Math.DEFAULT_TOLERANCE){const r=[],n=(e,n)=>{e.containsPoint(n,t)&&r.every((e=>!n.equals(e,t)))&&r.push(n)};return n(this,e.begin()),n(this,e.end()),n(e,this.begin()),n(e,this.end()),r.length>=2}intersectionsWithLineIn2D(e){if(this.isParallelTo(e))return[];const t=this.sharedEndpointWith(e,Math.DEFAULT_TOLERANCE);if(t)return[t];const r=e.begin(),n=new this.constructor(this._begin.subtract(r),this._end.subtract(r)),i=(0,p.default)(0,0),s=e.theta();n.rotateBy(i,-s);const o=n.xIntercept();if(!isFinite(o))return[];const a=(0,p.default)(o,0);return a.rotateBy(i,s),[a.add(r)]}intersectionsWithEdgeIn2D(e,t=Math.DEFAULT_TOLERANCE){if(this.isParallelTo(e))return[];const r=this.sharedEndpointWith(e,t);if(r)return[r];const n=e.begin(),i=new this.constructor(this._begin.subtract(n),this._end.subtract(n)),s=(0,p.default)(0,0),o=e.theta();if(i.rotateBy(s,-o),i.begin().y()*i.end().y()>t)return[];const a=i.xIntercept();if(!isFinite(a)||a<-t||a>e.vector().r()&&!a.isNearTo(e.vector().r()))return[];const l=(0,p.default)(a,0);return l.rotateBy(s,o),[l.add(n)]}_intersectionsIn3D(e,t){if(this.containsEdge(e)||e.contains(this))return[];const r=this.xy()[t](e.xy())[0];if(this.begin().z().isNearTo(this.end().z())&&this.end().z().isNearTo(e.begin().z())&&e.begin().z().isNearTo(e.end().z()))return r?[(0,p.default)(r.x(),r.y(),this.begin().z()).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES)]:[];const n=this.yz()[t](e.yz())[0];if(this.begin().x().isNearTo(this.end().x())&&this.end().x().isNearTo(e.begin().x())&&e.begin().x().isNearTo(e.end().x()))return n?[(0,p.default)(this.begin().x(),n.x(),n.y()).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES)]:[];const i=this.xz()[t](e.xz())[0];if(this.begin().y().isNearTo(this.end().y())&&this.end().y().isNearTo(e.begin().y())&&e.begin().y().isNearTo(e.end().y()))return i?[(0,p.default)(i.x(),this.begin().y(),i.y()).roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES)]:[];let s;return r&&n&&(s=(0,p.default)(r.x(),r.y(),n.y()),r.y().isNearTo(n.x())&&this.containsPointOnLine(s)&&e.containsPointOnLine(s))||n&&i&&(s=(0,p.default)(i.x(),n.x(),i.y()),n.y().isNearTo(i.y())&&this.containsPointOnLine(s)&&e.containsPointOnLine(s))||r&&i&&(s=(0,p.default)(r.x(),r.y(),i.y()),r.x().isNearTo(i.x())&&this.containsPointOnLine(s)&&e.containsPointOnLine(s))?[s.roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES)]:[]}intersectionsWithEdge(e){return this._intersectionsIn3D(e,"intersectionsWithEdgeIn2D")}intersectionsWithLine(e){return this._intersectionsIn3D(e,"intersectionsWithLineIn2D")}crossings(e){const t=this.begin(),r=this.end(),n=t.y(),i=r.y(),s=e.y();if(i<n){if(s<i||s>n)return 0}else if(s>i||s<n)return 0;const o=e.x(),a=t.x(),l=r.x();return o>a&&o>l?0:o<a&&o<l?1:Number(n>i?(0,m.locatorTheta)(o-l,s-i)>=(0,m.locatorTheta)(a-l,n-i):(0,m.locatorTheta)(o-a,s-n)>=(0,m.locatorTheta)(l-a,i-n))}xy(){return new this.constructor(this.begin().xy(),this.end().xy())}xz(){return new this.constructor(this.begin().xz(),this.end().xz())}yz(){return new this.constructor(this.begin().yz(),this.end().yz())}roundedTo(e){return new this.constructor(this.begin().roundedTo(e),this.end().roundedTo(e))}snapshot(){return new this.constructor(this.begin().snapshot(),this.end().snapshot())}nonEssentialProperties(){return["_normalAngle","_cachedNormalAngleFrame","_angle","_cachedAngleFrame"]}isLocatorBetweenEndpoints(e){return this.isPerpendicularTo(this.shortestLineFrom(e))}}var _=Edge},31255:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(55327));class RelativeEdge extends h.default{constructor(e,t,r){super(e,t),this._superEdge=r}superEdge(){if(!this._superEdge){const e=this.begin().edge&&this.begin().edge(),t=this.end().edge&&this.end().edge();this._superEdge=e||t}return this._superEdge}moveBy(e,t,r){const n=this.superEdge();return n?n.moveBy(e,t,r):super.moveBy(e,t,r)}}var p=RelativeEdge},32640:(e,t,r)=>{var n,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(l,{default:()=>c}),e.exports=(n=l,((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(n=s(t,l))||n.enumerable});return e})(i({},"__esModule",{value:!0}),n));var c=r(42932).$P},30858:(e,t,r)=>{var n,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(l,{default:()=>c}),e.exports=(n=l,((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(n=s(t,l))||n.enumerable});return e})(i({},"__esModule",{value:!0}),n));var c=r(15904).$R},39288:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>f}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(32640)),m=d(r(81976));r(37230);class EdgeIntersectionLocator extends m.default{constructor(e,t){super(),this._edge=e,this._intersectingEdge=t}referenceFrame(){return Math.max(this.edge().referenceFrame(),this.intersectingEdge().referenceFrame())}intersectingEdge(){return this._intersectingEdge}edge(){return this._edge}x(){return this.intersection().x()}y(){return this.intersection().y()}z(){return this.intersection().z()}moveBy(e,t){return!1}intersection(){const e=this.referenceFrame(),t=Math.SIGNIFICANT_DECIMAL_PLACES;if(!this._intersection||!this._cachedFrame||this._cachedFrame<e){const r=this.edge().roundedTo(t),n=this.intersectingEdge().roundedTo(t),i=r.intersections(n),s=i.length<1;this._intersection=s?(0,p.default)(1/0,1/0):i[0],this._cachedFrame=e}return this._intersection}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_intersection","_cachedFrame"]}}var f=EdgeIntersectionLocator},69855:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>f}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(50988),p=r(98326),m=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(81976));r(37230);class EdgeRelativeLocator extends m.default{constructor(e){super(),this._referenceFrame=(0,p.locatorFrame)(),this._edge=e,this._fromEnd=!1}referenceFrame(){return Math.max(this._referenceFrame,this.edge().referenceFrame())}distance(){throw new h.MissingOverride(this,"distance")}mutableSources(){return this.edge().mutableSources()}setEdge(e){this._edge=e,this._referenceFrame=(0,p.nextLocatorFrame)(),this.deleteCache()}deleteCache(){this._x=void 0,this._y=void 0,this._z=void 0}edge(){return this._edge}x(){const e=this.referenceFrame();return(void 0===this._x||!this._cachedXFrame||this._cachedXFrame<e)&&(this._fromEnd?this._x=this._edge.end().x()+this.relativeX():this._x=this._edge.begin().x()+this.relativeX(),this._cachedXFrame=e),this._x}y(){const e=this.referenceFrame();return(void 0===this._y||!this._cachedYFrame||this._cachedYFrame<e)&&(this._fromEnd?this._y=this._edge.end().y()+this.relativeY():this._y=this._edge.begin().y()+this.relativeY(),this._cachedYFrame=e),this._y}z(){const e=this.referenceFrame();return(void 0===this._z||!this._cachedZFrame||this._cachedZFrame<e)&&(this._fromEnd?this._z=this._edge.end().z()+this.relativeZ():this._z=this._edge.begin().z()+this.relativeZ(),this._cachedZFrame=e),this._z}moveBy(e,t){return!1}relativeX(){return this._edge.isVertical()?0:(0,p.locatorX)(this.distance(),this._edge.theta(),this._edge.phi())}relativeY(){return this._edge.isHorizontal()?0:(0,p.locatorY)(this.distance(),this._edge.theta(),this._edge.phi())}relativeZ(){return(0,p.locatorZ)(this.distance(),this._edge.phi())}atEnd(){const e=this._edge.length();return this.distance()===e}atBegin(){const e=this._edge.length(),t=this.distance();return 0===t||t===-e}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_x","_y","_z","_cachedXFrame","_cachedYFrame","_cachedZFrame"]}}var f=EdgeRelativeLocator},95203:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(69855)),p=r(98326);class FixedEdgeLocator extends h.default{constructor(e,t){super(e),this.setDistance(t)}setDistance(e){this._fromEnd=e<0,this._distance=e,this._referenceFrame=(0,p.nextLocatorFrame)(),this.deleteCache()}distance(){return this._distance}increaseDistanceBy(e){this.setDistance(this.distance()+e)}increasedDistanceBy(e){const t=new this.constructor(this.edge(),this.distance());return t.increaseDistanceBy(e),t}decreaseDistanceBy(e){this.setDistance(Math.max(this.distance()-e,0))}decreasedDistanceBy(e){const t=new this.constructor(this.edge(),this.distance());return t.decreaseDistanceBy(e),t}}var m=FixedEdgeLocator},40436:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(98326),p=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(81976));class FixedZLocator extends p.default{constructor(e,t){super(),this._referenceFrame=(0,h.locatorFrame)(),this._locator=e,this._z=t||0}referenceFrame(){return Math.max(this._referenceFrame,this._locator.referenceFrame())}updateReferenceFrame(){this._referenceFrame=(0,h.nextLocatorFrame)()}x(){return this._locator.x()}y(){return this._locator.y()}z(){return this._z}moveBy(e,t,r){const n=!(0===e&&0===t&&(!r||0===r));return n&&(this._locator.moveBy(e,t),r&&(this._z+=r,this.updateReferenceFrame())),n}}var m=FixedZLocator},98326:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>b,locatorFrame:()=>l,locatorNormalAngle:()=>y,locatorPhi:()=>g,locatorR:()=>p,locatorRho:()=>m,locatorTheta:()=>f,locatorX:()=>u,locatorY:()=>d,locatorZ:()=>h,nextLocatorFrame:()=>c}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));let a=1;const l=()=>a,c=()=>(a++,a),u=(e,t,r)=>{const n=(()=>{if(!t)return e;if(t===Math.PI)return-e;return t===Math.PI_2||t===-Math.PI_2||t===Math.THREE_PI_2?0:e*Math.cos(t)})();return void 0===r||r===Math.PI_2?n:n*Math.sin(r)},d=(e,t,r)=>{const n=(()=>{if(t===Math.PI_2)return e;if(t===Math.THREE_PI_2||t===-Math.PI_2)return-e;return 0===t||t===Math.PI?0:e*Math.sin(t)})();return void 0===r||r===Math.PI_2?n:n*Math.sin(r)},h=(e,t)=>void 0===t||t===Math.PI_2?0:e*Math.cos(t),p=(e,t)=>Math.sqrt(e*e+t*t),m=(e,t,r)=>Math.sqrt(e*e+t*t+r*r),f=(e,t)=>Math.atan2(t,e),g=(e,t,r)=>0===r?Math.PI_2:Math.acos(r/m(e,t,r)),y=(e,t)=>f(e,t)+(e<=0&&t<0?Math.THREE_PI_2:-Math.PI_2);var b={locatorFrame:l,nextLocatorFrame:c,locatorX:u,locatorY:d,locatorZ:h,locatorR:p,locatorRho:m,locatorTheta:f,locatorPhi:g,locatorNormalAngle:y}},90749:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>f}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(32640)),m=d(r(39288));class LineIntersectionLocator extends m.default{intersection(){const e=this.referenceFrame();if(!this._intersection||!this._cachedFrame||this._cachedFrame<e){const t=Math.SIGNIFICANT_DECIMAL_PLACES,r=this.edge().roundedTo(t),n=this.intersectingEdge().roundedTo(t),i=r.intersectionsWithLine(n),s=i.length<1;this._intersection=s?(0,p.default)(1/0,1/0):i[0],this._cachedFrame=e}return this._intersection}}var f=LineIntersectionLocator},81976:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));r(57075),r(37230);var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(72284)),p=r(98326);class Locator extends h.default{snapPoint(){return this}x(){return(0,p.locatorX)(this.r(),this.theta())}y(){return(0,p.locatorY)(this.r(),this.theta())}z(){return 0}equals(e,t=Math.DEFAULT_TOLERANCE){return e===this||e.x&&this.x().isNearTo(e.x(),t)&&e.y&&this.y().isNearTo(e.y(),t)&&this.z&&this.z().isNearTo(e.z(),t)}isBetween(e,t,r){r||(r=Math.DEFAULT_TOLERANCE);const n=e.distanceTo(t);return e.distanceTo(this)+t.distanceTo(this)<=n+r}r(){return(0,p.locatorR)(this.x(),this.y())}theta(){return(0,p.locatorTheta)(this.x(),this.y())}rho(){return(0,p.locatorRho)(this.x(),this.y(),this.z())}phi(){return(0,p.locatorPhi)(this.x(),this.y(),this.z())}normalAngle(){return(0,p.locatorNormalAngle)(this.x(),this.y())}distanceTo(e,t){const r=this._yForDistanceTo(e,t),n=this._xForDistanceTo(e);return(0,p.locatorR)(this.x()-n,this.y()-r)}distanceTo3D(e,t,r){const n=this._yForDistanceTo(e,t),i=this._xForDistanceTo(e),s=this._zForDistanceTo(e,r);return(0,p.locatorRho)(this.x()-i,this.y()-n,this.z()-s)}_yForDistanceTo(e,t){return void 0!==t?t:e.y?e.y():0}_xForDistanceTo(e){return e.x?e.x():e}_zForDistanceTo(e,t){return void 0!==t?t:e.z?e.z():0}to2DString(){return`${this.x().roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES)},${this.y().roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES)}`}to3DString(){return`${this.to2DString()},${this.z().roundedTo(Math.SIGNIFICANT_DECIMAL_PLACES)}`}toString(){return`${this.constructor.name} (${this.to3DString()})`}postRestorationAction(){this._referenceFrame=(0,p.nextLocatorFrame)()}nonEssentialProperties(){return["_referenceFrame"]}mutableSources(){return[this]}_noMovementRequired(e,t,r){return 0===e&&0===t&&(!r||0===r)}referenceFrame(){return Math.max(...this.mutableSources().map((e=>e.referenceFrame())))}findClosestPoint(e){return this.findClosestPoint2D(e)}findClosestPoint2D(e){return e.findSmallest((e=>this.distanceTo(e)))}findClosestPoint3D(e){return e.findSmallest((e=>this.distanceTo3D(e)))}}var m=Locator},14935:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(81976));class LocatorXY extends h.default{constructor(e){super(),this._locator=e}referenceFrame(){return this._locator.referenceFrame()}x(){return this._locator.x()}y(){return this._locator.y()}z(){return 0}moveBy(e,t,r){return this._locator.moveBy(e,t,r)}isRelativeTo(e){return this._locator===e||this._locator.isRelativeTo&&this._locator.isRelativeTo(e)||!1}}var p=LocatorXY},13482:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(81976));class LocatorXZ extends h.default{constructor(e){super(),this._locator=e}referenceFrame(){return this._locator.referenceFrame()}x(){return this._locator.x()}y(){return this._locator.z()}z(){return 0}moveBy(e,t,r){return this._locator.moveBy(e,r,t)}}var p=LocatorXZ},26563:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(81976));class LocatorYZ extends h.default{constructor(e){super(),this._locator=e}referenceFrame(){return this._locator.referenceFrame()}x(){return this._locator.y()}y(){return this._locator.z()}z(){return 0}moveBy(e,t,r){return this._locator.moveBy(r,e,t)}}var p=LocatorYZ},11541:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(98326),p=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(81976));class NormalToEdgeLocator extends p.default{constructor(e,t,r,n){super(),this._sourceLocator=e,this._distance=t,this._offsetAlongEdge=r,this._angle=void 0===n?Math.PI_2:n,this._referenceFrame=(0,h.locatorFrame)()}referenceFrame(){return Math.max(this._referenceFrame,this.source().referenceFrame())}updateReferenceFrame(){this._referenceFrame=(0,h.nextLocatorFrame)()}setDistance(e){this._distance=e,this.updateReferenceFrame()}setOffsetAlongEdge(e){this._offsetAlongEdge=e,this.updateReferenceFrame()}edge(){return this.source().edge?this.source().edge():null}source(){return this._sourceLocator}atEnd(){return!!this.source().atEnd&&this.source().atEnd()}atBegin(){return!!this.source().atBegin&&this.source().atBegin()}x(){const e=this.referenceFrame();if(void 0===this._x||!this._cachedXFrame||this._cachedXFrame<e){let t=this.source().x();const r=this.edge().angle();this._offsetAlongEdge&&(t+=(0,h.locatorX)(this._offsetAlongEdge,r)),this._distance&&(t+=(0,h.locatorX)(this._distance,r-this._angle)),this._x=t,this._cachedXFrame=e}return this._x}y(){const e=this.referenceFrame();if(void 0===this._y||!this._cachedYFrame||this._cachedYFrame<e){let t=this.source().y();const r=this.edge().angle();this._offsetAlongEdge&&(t+=(0,h.locatorY)(this._offsetAlongEdge,r)),this._distance&&(t+=(0,h.locatorY)(this._distance,r-this._angle)),this._y=t,this._cachedYFrame=e}return this._y}z(){return this.source().z()}moveBy(e,t,r){return!1}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_referenceFrame","_cachedXFrame","_cachedYFrame","_x","_y"]}}var m=NormalToEdgeLocator},52353:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>g}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=r(98326),m=d(r(81976)),f=d(r(62218));class PlanarNormalToEdgeLocator extends m.default{static builder(e,t){return new f.default({edgeLocator:e,planeNormal:t})}constructor(e,t,r=0,n=0,i=0){super(),this._sourceLocator=e,this._distance=r,this._offsetAlongEdge=n,this._offsetAlongPlaneNormal=i,this._planeNormal=t,this._referenceFrame=(0,p.locatorFrame)()}referenceFrame(){return Math.max(this._referenceFrame,this.source().referenceFrame(),this._planeNormal.referenceFrame())}updateReferenceFrame(){this._referenceFrame=(0,p.nextLocatorFrame)()}setDistance(e){this._distance=e,this._normalVector=void 0,this.updateReferenceFrame()}setOffsetAlongEdge(e){this._offsetAlongEdge=e,this._edgeVector=void 0,this.updateReferenceFrame()}setOffsetAlongPlaneNormal(e){this._offsetAlongPlaneNormal=e,this._planeNormalVector=void 0,this.updateReferenceFrame()}edge(){return this.source().edge&&this.source().edge()}planeNormal(){return this._planeNormal}source(){return this._sourceLocator}atEnd(){return!!this.source().atEnd&&this.source().atEnd()}atBegin(){return!!this.source().atBegin&&this.source().atBegin()}normalVector(){const e=this.referenceFrame();if(!this._normalVector||!this._cachedNormalVectorFrame||this._cachedNormalVectorFrame<e){const t=this.edge().vector(),r=this.planeNormal();this._normalVector=r.cross(t).normalized().multipliedBy(this._distance),this._cachedNormalVectorFrame=e}return this._normalVector}edgeVector(){const e=this.referenceFrame();return(!this._edgeVector||!this._cachedEdgeVectorFrame||this._cachedEdgeVectorFrame<e)&&(this._edgeVector=this.edge().direction().multipliedBy(this._offsetAlongEdge),this._cachedEdgeVectorFrame=e),this._edgeVector}planeNormalVector(){const e=this.referenceFrame();return(!this._planeNormalVector||!this._cachedPlaneNormalVectorFrame||this._cachedPlaneNormalVectorFrame<e)&&(this._planeNormalVector=this.planeNormal().multipliedBy(this._offsetAlongPlaneNormal),this._cachedPlaneNormalVectorFrame=e),this._planeNormalVector}x(){const e=this.referenceFrame();if(void 0===this._x||!this._cachedXFrame||this._cachedXFrame<e){let t=this.source().x();t+=this.normalVector().x(),t+=this.edgeVector().x(),t+=this.planeNormalVector().x(),this._x=t,this._cachedXFrame=e}return this._x}y(){const e=this.referenceFrame();if(void 0===this._y||!this._cachedYFrame||this._cachedYFrame<e){let t=this.source().y();t+=this.normalVector().y(),t+=this.edgeVector().y(),t+=this.planeNormalVector().y(),this._y=t,this._cachedYFrame=e}return this._y}z(){const e=this.referenceFrame();if(void 0===this._z||!this._cachedZFrame||this._cachedZFrame<e){let t=this.source().z();t+=this.normalVector().z(),t+=this.edgeVector().z(),t+=this.planeNormalVector().z(),this._z=t,this._cachedZFrame=e}return this._z}moveBy(e,t,r){return!1}nonEssentialProperties(){return[...super.nonEssentialProperties(),"_referenceFrame","_cachedXFrame","_cachedYFrame","_cachedZFrame","_x","_y","_z","_normalVector","_edgeVector"]}}f.default.setClassToBuild(PlanarNormalToEdgeLocator);var g=PlanarNormalToEdgeLocator},62218:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>a}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));class PlanarNormalToEdgeLocatorBuilder{static setClassToBuild(e){this._injectedClass=e}static _classToBuild(){return this._injectedClass}constructor(e={}){this._edgeLocator=e.edgeLocator,this._planeNormal=e.planeNormal,this._distance=e.distance,this._offsetAlongEdge=e.offsetAlongEdge,this._offsetAlongPlaneNormal=e.offsetAlongPlaneNormal}edgeLocator(e){return this._edgeLocator=e,this}planeNormal(e){return this._planeNormal=e,this}distance(e){return this._distance=e,this}offsetAlongEdge(e){return this._offsetAlongEdge=e,this}offsetAlongPlaneNormal(e){return this._offsetAlongPlaneNormal=e,this}_requiredProperties(){return["edgeLocator","planeNormal"]}_checkValid(){const e=this._requiredProperties().filter((e=>void 0===this[`_${e}`]));if(e.length>0)throw new Error(`Missing required properties: ${e.join(", ")}`)}build(){this._checkValid();return new(PlanarNormalToEdgeLocatorBuilder._classToBuild())(this._edgeLocator,this._planeNormal,this._distance,this._offsetAlongEdge,this._offsetAlongPlaneNormal)}}var a=PlanarNormalToEdgeLocatorBuilder},42932:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{$P:()=>m,default:()=>f}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(98326),p=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(81976));class Point extends p.default{static fromSpherical(e,t,r){return new this((0,h.locatorX)(e,t,r),(0,h.locatorY)(e,t,r),(0,h.locatorZ)(e,r))}constructor(e,t,r){super(),this._referenceFrame=(0,h.locatorFrame)(),this._x=e,this._y=t,this._z=r}referenceFrame(){return this._referenceFrame}updateReferenceFrame(){this._referenceFrame=(0,h.nextLocatorFrame)()}x(){return this._x}y(){return this._y}z(){return this._z||(this._z=0),this._z}moveBy(e,t,r){return!this._noMovementRequired(e,t,r)&&(e&&(this._x=this.x()+e),t&&(this._y=this.y()+t),r&&(this._z=this.z()+r),this.updateReferenceFrame(),!0)}rotateBy(e,t,r=0){const n=this.x()-e.x(),i=this.y()-e.y(),s=this.z()-e.z(),o=(0,h.locatorRho)(n,i,s),a=(0,h.locatorTheta)(n,i)+t,l=(0,h.locatorPhi)(n,i,s)+r;this._x=(0,h.locatorX)(o,a,l)+e.x(),this._y=(0,h.locatorY)(o,a,l)+e.y(),this._z=(0,h.locatorZ)(o,l)+e.z(),this.updateReferenceFrame()}}function m(e,t,r){return new Point(e,t,r)}var f=Point},97856:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(98326),p=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(81976));class PolarCoordinate extends p.default{constructor(e,t){super(),this._referenceFrame=(0,h.locatorFrame)(),this._r=e,this._theta=t}referenceFrame(){return this._referenceFrame}updateReferenceFrame(){this._referenceFrame=(0,h.nextLocatorFrame)()}r(){return this._r}theta(){return this._theta}moveBy(e,t,r){if(this._noMovementRequired(e,t,r))return!1;const n=this.x()+e,i=this.y()+t;return this._r=(0,h.locatorR)(n,i),this._theta=(0,h.locatorTheta)(n,i),this.updateReferenceFrame(),!0}multipliedBy(e){return new this.constructor(this.r()*e,this.theta())}}var m=PolarCoordinate},61210:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(69855));class ProportionalEdgeLocator extends h.default{constructor(e,t){super(e),this._fromEnd=t<0,this._fraction=t}fraction(){return this._fraction}x(){const e=this.fraction();return 1===e?this.edge().end().x():0===e||-1===e?this.edge().begin().x():super.x()}y(){const e=this.fraction();return 1===e?this.edge().end().y():0===e||-1===e?this.edge().begin().y():super.y()}z(){const e=this.fraction();return 1===e?this.edge().end().z():0===e||-1===e?this.edge().begin().z():super.z()}relativeZ(){return(this.edge().end().z()-this.edge().begin().z())*this.fraction()}distance(){return this.fraction()*this.edge().length()}atEnd(){return 1===this.fraction()}atBegin(){return 0===this.fraction()||-1===this.fraction()}}var p=ProportionalEdgeLocator},15904:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{$R:()=>f,default:()=>g}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(32640)),m=d(r(66904));class RelativeLocator extends m.default{constructor(e,t=0,r=0,n=0){super(e,n),this._relativeX=t,this._relativeY=r}static makeRelativeTo(e,t){return new this(t,e.x()-t.x(),e.y()-t.y(),e.z()-t.z())}source(){return this._locator}setSource(e){const t=this._locator.x()-e.x(),r=this._locator.y()-e.y(),n=this._locator.z()-e.z();this.moveBy(t,r,n),this._locator=e}x(){return this._locator.x()+this._relativeX}y(){return this._locator.y()+this._relativeY}relativeX(){return this._relativeX}relativeY(){return this._relativeY}moveBy(e,t,r){return!this._noMovementRequired(e,t,r)&&(e&&(this._relativeX+=e),t&&(this._relativeY+=t),r&&(this._relativeZ+=r),this.updateReferenceFrame(),!0)}rotateBy(e,t,r){const n=this.snapshot();n.rotateBy(e,t,r);const i=n.subtract(this);this._relativeX=this._relativeX+i.x(),this._relativeY=this._relativeY+i.y(),this._relativeZ=this._relativeZ+i.z(),this.updateReferenceFrame()}isRelativeTo(e){return this._locator===e||this._locator.isRelativeTo&&this._locator.isRelativeTo(e)||!1}}function f(e,t,r){return new RelativeLocator((0,p.default)(0,0,0),e,t,r)}var g=RelativeLocator},66904:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(98326),p=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(81976));class RelativeZLocator extends p.default{constructor(e,t){super(),this._referenceFrame=(0,h.locatorFrame)(),this._locator=e,this._relativeZ=t||0}referenceFrame(){return Math.max(this._referenceFrame,this._locator.referenceFrame())}updateReferenceFrame(){this._referenceFrame=(0,h.nextLocatorFrame)()}edge(){return this._locator.edge?this._locator.edge():null}atEnd(){return!!this._locator.atEnd&&this._locator.atEnd()}atBegin(){return!!this._locator.atBegin&&this._locator.atBegin()}x(){return this._locator.x()}y(){return this._locator.y()}z(){return this._locator.z()+this._relativeZ}relativeZ(){return this._relativeZ}moveBy(e,t,r){const n=this._locator.moveBy(e,t)||r&&0!==r;return n&&(r&&(this._relativeZ+=r),this.updateReferenceFrame()),n}}var m=RelativeZLocator},33381:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>y}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(98326)),m=d(r(81976));const f=p.default.locatorFrame,g=p.default.nextLocatorFrame;class ThreeSourceRelativeLocator extends m.default{constructor(e,t,r,n=0,i=0,s=0){super(),this._referenceFrame=f(),this._xSource=e,this._ySource=t,this._zSource=r,this._relativeX=n,this._relativeY=i,this._relativeZ=s}referenceFrame(){return Math.max(this._referenceFrame,this._xSource.referenceFrame(),this._ySource.referenceFrame(),this._zSource.referenceFrame())}updateReferenceFrame(){this._referenceFrame=g()}x(){return this._xSource.x()+this._relativeX}y(){return this._ySource.y()+this._relativeY}z(){return this._zSource.z()+this._relativeZ}moveBy(e,t,r){return!this._noMovementRequired(e,t,r)&&(e&&(this._relativeX+=e),t&&(this._relativeY+=t),r&&(this._relativeZ+=r),this.updateReferenceFrame(),!0)}setXSource(e){this._relativeX=this.x()-e.x(),this._xSource=e}setYSource(e){this._relativeY=this.y()-e.y(),this._ySource=e}setZSource(e){this._relativeZ=this.z()-e.z(),this._zSource=e}isRelativeTo(e){return this._xSource===e||this._ySource===e||this._zSource===e||this._xSource.isRelativeTo&&this._xSource.isRelativeTo(e)||this._ySource.isRelativeTo&&this._ySource.isRelativeTo(e)||this._zSource.isRelativeTo&&this._zSource.isRelativeTo(e)||!1}}var y=ThreeSourceRelativeLocator},86714:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));r(37230);var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(32640)),p=r(50988);var m=class LocatorArithmeticMixin{x(){throw new p.MissingOverride(this,"x")}y(){throw new p.MissingOverride(this,"y")}z(){throw new p.MissingOverride(this,"z")}rho(){throw new p.MissingOverride(this,"rho")}snapshot(){return(0,h.default)(this.x(),this.y(),this.z())}add(e,t,r){const n=void 0===t?e.y?e.y():0:t,i=void 0===t?e.x?e.x():0:e,s=void 0===r?e.z?e.z():0:r;return(0,h.default)(i+this.x(),n+this.y(),s+this.z())}subtract(e,t,r){const n=void 0===t?e.y?e.y():0:t,i=void 0===t?e.x?e.x():0:e,s=void 0===r?e.z?e.z():0:r;return(0,h.default)(this.x()-i,this.y()-n,this.z()-s)}multipliedBy(e){return(0,h.default)(this.x()*e,this.y()*e,this.z()*e)}dividedBy(e){if(0===e)throw new Error("Cannot divide by zero.");return(0,h.default)(this.x()/e,this.y()/e,this.z()/e)}dot(e){return this.x()*e.x()+this.y()*e.y()+this.z()*e.z()}cross(e){const t=this.y()*e.z()-this.z()*e.y(),r=this.z()*e.x()-this.x()*e.z(),n=this.x()*e.y()-this.y()*e.x();return(0,h.default)(t,r,n)}roundedTo(e){return(0,h.default)(this.x().roundedTo(e),this.y().roundedTo(e),this.z().roundedTo(e))}normalized(){return this.rho()?this.dividedBy(this.rho()):this}negated(){return(0,h.default)(-this.x(),-this.y(),-this.z())}}},30685:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(32640)),p=r(50988);var m=class LocatorManipulationMixin{x(){throw new p.MissingOverride(this,"x")}y(){throw new p.MissingOverride(this,"y")}z(){throw new p.MissingOverride(this,"z")}moveBy(e,t,r){throw new p.MissingOverride(this,"moveBy")}rotateBy(e,t,r){throw new p.MissingOverride(this,"rotateBy")}snapshot(){return(0,h.default)(this.x(),this.y(),this.z())}movedBy(e,t,r){const n=this.snapshot();return n.moveBy(e,t,r),n}rotatedBy(e,t,r){const n=this.snapshot();return n.rotateBy(e,t,r),n}}},49029:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>w}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=r(50988),m=d(r(55327)),f=d(r(86819)),g=d(r(68662)),y=d(r(14935)),b=d(r(13482)),v=d(r(26563)),_=d(r(15904)),x=d(r(66904));var w=class LocatorTransmutationMixin{x(){throw new p.MissingOverride(this,"x")}y(){throw new p.MissingOverride(this,"y")}z(){throw new p.MissingOverride(this,"z")}expandedByRadius(e){return new f.default(this,e)}expandedBy(e,t=e){return new g.default(this.x()-e,this.y()-t,2*e,2*t)}extendedBy(e,t=e){const r=e<0?this.x()+e:this.x(),n=t<0?this.y()+t:this.y();return new g.default(r,n,Math.abs(e),Math.abs(t))}toCorner(e){return this.extendedBy(e.x()-this.x(),e.y()-this.y())}to(e){return new m.default(this,e)}addZ(e){return new x.default(this,e)}relatedTo(e){return _.default.makeRelativeTo(this,e)}xy(){return new y.default(this)}xz(){return new b.default(this)}yz(){return new v.default(this)}}},70088:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(72284));class Component extends h.default{static displayName(){return this.name.replace(/([a-z])([A-Z])/g,"$1 $2")}displayName(){return this.constructor.displayName()}clone(){}delete(){this.isDeleteable()&&this.componentOf()&&this.componentOf().remove(this)}isDeleteable(){return!0}setComponentOf(e){this._componentOf=e}componentOf(){return this._componentOf}}var p=Component},9348:(e,t,r)=>{var n,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(l,{default:()=>u}),e.exports=(n=l,((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(n=s(t,l))||n.enumerable});return e})(i({},"__esModule",{value:!0}),n));var c=r(50988);class Composite{add(e){this._attachMyComponent(e),this.parts().push(e),this.notifyCollectionChangedObservers()}remove(e){if(this._removeMyComponent(e))this._detachMyComponent(e);else if(e.componentOf){const t=e.componentOf();if(!t)throw new Error(`Removing ${e.toString()} from ${this.toString()} but it's componentOf is set to ${t}!`);t.remove(e)}}contains(e,t){return this.parts().some((r=>r.contains(e,t)))}parts(){return this._parts||(this._parts=this.defaultParts()),this._parts}defaultParts(){return[]}components(){return this.parts()}clear(){this._removeAllParts(),this.notifyCollectionChangedObservers()}_removeAllParts(){const e=this.parts();for(;e.length;)e.pop()}_attachMyComponent(e){e.setComponentOf&&e.setComponentOf(this)}_detachMyComponent(e){e.componentOf&&e.componentOf()===this&&e.setComponentOf(void 0)}_removeMyComponent(e){const t=this.parts(),r=t.indexOf(e),n=-1!==r;return n&&t.splice(r,1),this.notifyCollectionChangedObservers(),n}stableIdComponentLookup(){return this.componentForStableID.bind(this)}componentForStableID(e){if(this.stableID&&this.stableID()===e)return this;const t=this.parts();for(let r=0;r<t.length;r++){const n=t[r];if(n.stableID&&n.stableID()===e)return n;if(n.componentForStableID){const t=n.componentForStableID(e);if(t)return t}}}nonEssentialProperties(){return["_collectionChangedObservers"]}}(0,c.simpleObserver)(Composite,"collectionChanged");var u=Composite},79595:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>y}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=r(50988),m=d(r(32640)),f=d(r(95203)),g=d(r(15904));var y=class ModifiableCorners{edges(){throw new p.MissingOverride(this,"edges")}vertices(){throw new p.MissingOverride(this,"vertices")}replaceVertex(e,t){throw new p.MissingOverride(this,"replaceVertex")}cutCorner(e,t){const r=this._newCornerAlongIncomingEdge(e,t),n=this._newCornerAlongOutgoingEdge(e,t);this.replaceVertex(e,[r,n])}notchCorner(e,t,r=0,n=e){const i=g.default.makeRelativeTo(this._newCornerAlongIncomingEdge(e,t),n),s=g.default.makeRelativeTo(this._newCornerAlongOutgoingEdge(e,t),n),o=this._newCornerInNotch(e,i,s,r,n);this.replaceVertex(e,[i,o,s])}modifiableCorners(e){return this.vertices().filter((t=>this._isCornerModifiable(t,e)))}_isCornerModifiable(e,t){const r=this._findEdgeEndingWith(e),n=this._findEdgeStartingWith(e);return this._edgesFormRightAngle(r,n)&&this._edgesAreLongEnough(r,n,t)}_findEdgeEndingWith(e){return this.edges().find((t=>t.end()===e))}_findEdgeStartingWith(e){return this.edges().find((t=>t.begin()===e))}_newCornerAlongIncomingEdge(e,t){return new f.default(this._findEdgeEndingWith(e),-t)}_newCornerAlongOutgoingEdge(e,t){return new f.default(this._findEdgeStartingWith(e),t)}_isIncomingEdgeHorizontal(e){return this._findEdgeEndingWith(e).isNearlyHorizontal()}_newCornerInNotch(e,t,r,n,i){let s;return s=this._isIncomingEdgeHorizontal(e)?(0,m.default)(t.x(),r.y(),n):(0,m.default)(r.x(),t.y(),n),g.default.makeRelativeTo(s,i)}_edgesFormRightAngle(e,t){return e.isNearlyOrthogonal()&&t.isNearlyOrthogonal()}_edgesAreLongEnough(e,t,r){return e.length()>=r&&t.length()>=r}}},74997:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>g}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=r(50988),m=d(r(86e3)),f=d(r(44425));var g=class ShapeFromVertices{vertices(){throw new p.MissingOverride(this,"vertices")}thickness(){return 0}shape3D(){return this._shape3D||(this._shape3D=new m.default(this.shape(),this.thickness())),this._shape3D}shape(){return new f.default(this.vertices())}edges(){const e=this.vertices();return e.map(((t,r)=>{const n=e[(r+1)%e.length];return t.to(n)}))}boundingBox(){return this.shape().boundingBox()}boundingCube(){return this.shape3D().boundingCube()}width(){return this.boundingBox().width()}depth(){return this.boundingBox().height()}xLevel(){return this.vertices().map((e=>e.x())).reduce(((e,t)=>e<t?e:t))}yLevel(){return this.vertices().map((e=>e.y())).reduce(((e,t)=>e>t?e:t))}zLevel(){return this.vertices()[0].z()}contains(e,t,r){return this.shape().contains(e,t,r)}toString(){return`<${this.constructor.name} with shape ${this.shape()}>`}}},18350:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(55327));class Angle{constructor(e,t,r){this._vertex=e,this._ray1=new h.default(e,t),this._ray2=new h.default(e,r)}vertex(){return this._vertex}ray1(){return this._ray1}ray2(){return this._ray2}contains(e){const t=this.smallestDeltaRadians(),r=new Angle(this._vertex,e,this.ray1().end()).smallestDeltaRadians(),n=new Angle(this._vertex,e,this.ray2().end()).smallestDeltaRadians();return r<=t&&n<=t}smallestDeltaRadians(){const e=this.ray1().vector(),t=this.ray2().vector(),r=Math.acos((e.dot(t)/(e.rho()*t.rho())).constrained(-1,1));return Math.abs(r<Math.PI?r:Math.TWO_PI-r)}smallestDeltaDegrees(){return this.smallestDeltaRadians().radiansToDegrees()}bisectingTheta(){let e=this.smallestDeltaRadians()/2;return this.clockwise()||(e*=-1),(this.ray1().theta()+e).normalizedAngle()}clockwise(){const e=(this.ray2().angle()-this.ray1().angle()).normalizedAngle();return e>=0&&e<=Math.PI}toString(){return`(${this.ray1().end().to2DString()})->(${this.vertex().to2DString()})->(${this.ray1().end().to2DString()})`}}var p=Angle},86819:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>v}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(32640)),m=r(98326),f=d(r(15904)),g=d(r(72284)),y=d(r(44425)),b=d(r(68662));class Circle extends g.default{static from3Points(e,t,r){const[n,i]=[e.x(),e.y()],[s,o]=[t.x(),t.y()],[a,l]=[r.x(),r.y()],c=n*n+i*i,u=s*s+o*o,d=a*a+l*l,h=n*(o-l)+s*(l-i)+a*(i-o),m=c*(l-o)+u*(i-l)+d*(o-i),f=c*(s-a)+u*(a-n)+d*(n-s),g=c*(a*o-s*l)+u*(n*l-a*i)+d*(s*i-n*o),y=-m/(2*h),b=-f/(2*h),v=(e.z()+t.z()+r.z())/3,_=Math.sqrt((m*m+f*f-4*h*g)/(4*h*h));return new this((0,p.default)(y,b,v),_)}constructor(e,t){super(),this._center=e||(0,p.default)(0,0),this._radius=void 0===t?10:t}center(){return this._center}x(){return this.center().x()}y(){return this.center().y()}z(){return this.center().z()}radius(){return this._radius}diameter(){return 2*this.radius()}contains(e,t){return(0,m.locatorR)(e-this.x(),t-this.y())<=this.radius()}moveBy(e,t,r){return this.center().moveBy(e,t,r)}movedBy(e,t,r){const n=this.snapshot();return n.moveBy(e,t,r),n}snapshot(){return new Circle(this.center().snapshot(),this.radius())}snapPoint(){return this.center()}intersects(e){const t=this.radius()+e.radius();return this.center().subtract(e.center()).r()<=t}equals(e){if(!e.radius||!e.center)return!1;const t=this.center().equals(e.center()),r=this.radius()===e.radius();return t&&r}boundingBox(){const e=this.x()-this.radius(),t=this.y()-this.radius(),r=this.diameter();return new b.default(e,t,r,r)}toPolygon(e=8){if(e<4)throw new Error("Circles cannot be turned into Polygons with less than four vertices");const t=this._verticesForPolygon(e);return new y.default(t)}_verticesForPolygon(e){const t=[];for(let r=0;r<e;r++){const n=(0,m.locatorX)(this.radius(),Math.PI/e*2*r),i=(0,m.locatorY)(this.radius(),Math.PI/e*2*r);t.push(new f.default(this.center(),n,i))}return t}}var v=Circle},47199:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>g}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=r(50988),m=d(r(79595)),f=d(r(44425));class ClippablePolygon extends f.default{}(0,p.supply)(ClippablePolygon,m.default);var g=ClippablePolygon},36990:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>g}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=r(50988),m=d(r(32640)),f=d(r(68662));class Cube extends f.default{constructor(e,t,r,n,i,s){super(e,t,n,i),this._z=r,this._depth=s}static extrudeRectangleFromTo(e,t,r){return new this(e.left(),e.top(),Math.min(t,r),e.width(),e.height(),Math.abs(t-r))}static unitCube(){return new Cube(0,0,0,1,1,1)}z(){return this._z}depth(){return this._depth}high(){return this._z}low(){return this._z+this._depth}center(){return(0,m.default)(this.left()+this.width()/2,this.top()+this.height()/2,this.z()+this.depth()/2)}topLeft(){return(0,m.default)(this.left(),this.top(),this.z())}topRight(){return(0,m.default)(this.right(),this.top(),this.z())}bottomLeft(){return(0,m.default)(this.left(),this.bottom(),this.z())}bottomRight(){return(0,m.default)(this.right(),this.bottom(),this.z())}vertices(){const e=[this.topLeft(),this.topRight(),this.bottomRight(),this.bottomLeft()],t=e.map((e=>e.movedBy(0,0,this.depth())));return[...e,...t]}toString(){return`Cube( ${[this.x(),this.y(),this.z(),this.width(),this.height(),this.depth()].join(", ")} )`}leftSide(){return new f.default(this.y(),this.z(),this.height(),this.depth())}frontSide(){return new f.default(this.x(),this.z(),this.width(),this.depth())}topSide(){return new f.default(this.x(),this.y(),this.width(),this.height())}equals(e){return!0===(e&&e.z&&e.z()===this.z()&&super.equals(e)&&e.depth&&e.depth()===this.depth())}merge(e){const t=Math.min(this.x(),e.x()),r=Math.min(this.y(),e.y()),n=Math.min(this.z(),e.z()),i=Math.max(this.right(),e.right())-t,s=Math.max(this.bottom(),e.bottom())-r,o=Math.max(this.low(),e.low())-n;return new this.constructor(t,r,n,i,s,o)}contains(e,t,r){return super.contains(e,t)&&r>=this.high()&&(r<=this.low()||r.isNearTo(this.low(),Math.DEFAULT_TOLERANCE))}containsPoint(e){return this.contains(e.x(),e.y(),e.z())}containsShape(e){return e.vertices().every((e=>this.containsPoint(e)))}moveBy(e,t,r){return this._z=this._z+r,super.moveBy(e,t)||0!==r}movedBy(e,t,r){const n=new this.constructor(this.x(),this.y(),this.z(),this.width(),this.height(),this.depth());return n.moveBy(e,t,r),n}insetBy(e,t,r=e){return super.insetBy(e,t),this._z+=r,this._depth-=2*r,this}insettedBy(e,t=e,r=e){const n=this.x()+e,i=this.y()+t,s=this.z()+r,o=this.width()-2*e,a=this.height()-2*t,l=this.depth()-2*r;return new this.constructor(n,i,s,o,a,l)}boundingBox(){return this.topSide()}roundedTo(e){return new this.constructor(this.x().roundedTo(e),this.y().roundedTo(e),this.z().roundedTo(e),this.width().roundedTo(e),this.height().roundedTo(e),this.depth().roundedTo(e))}rounded(){return new this.constructor(Math.round(this.x()),Math.round(this.y()),Math.round(this.z()),Math.round(this.width()),Math.round(this.height()),Math.round(this.depth()))}intersects(e){throw new p.MissingOverride(this,"intersects")}toPolygon(){throw new Error("Cube should not implement #toPolygon")}extrudedFromTo(e,t){throw new Error("Cube should not implement #extrudedFromTo")}isFinite(){return isFinite(this.x())&&isFinite(this.y())&&isFinite(this.z())&&isFinite(this.width())&&isFinite(this.height())&&isFinite(this.depth())}static mergedFiniteCubes(e=[],t=(e=>e.boundingCube())){return 0===e.length?Cube.unitCube():e.reduce(((e,r)=>{const n=t(r);return n.isFinite()?e=e?e.merge(n):n:console.warn("Invalid cube for object",r),e}),null)}}var g=Cube;f.default.prototype.extrudedFromTo=function(e,t){return Cube.extrudeRectangleFromTo(this,e,t)}},86e3:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>g}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));r(50988);var p=d(r(15904)),m=d(r(36990)),f=d(r(44425));var g=class ExtrudedPolygon{constructor(e,t,r,n=!0){this._vertices=e?.vertices(),this._extrusionLength=t;const i=r||this.constructor.extrudeZ;this._extrudedVertices=i?.(this._vertices,t),this._reverseFaces=n}static extrudeZ(e,t){return e?.map((e=>new p.default(e,0,0,t)))}vertices(){return this._reverseFaces?this._vertices.fastConcat(this._extrudedVertices):this._extrudedVertices.fastConcat(this._vertices)}leftSideProjections(){return this.faces().fastFilter((e=>e.normal().x()<0)).map((e=>{const t=e.vertices().map((e=>e.yz()));return new f.default(t)}))}topProjections(){return this.faces().fastFilter((e=>e.normal().z()<0)).map((e=>{const t=e.vertices().map((e=>e.xy()));return new f.default(t)}))}frontProjections(){return this.faces().fastFilter((e=>e.normal().y()>0)).map((e=>{const t=e.vertices().map((e=>e.xz()));return new f.default(t)}))}boundingCube(){const e=this.vertices().reduce(((e,t)=>((void 0===e.minX||t.x()<e.minX)&&(e.minX=t.x()),(void 0===e.maxX||t.x()>e.maxX)&&(e.maxX=t.x()),(void 0===e.minY||t.y()<e.minY)&&(e.minY=t.y()),(void 0===e.maxY||t.y()>e.maxY)&&(e.maxY=t.y()),(void 0===e.minZ||t.z()<e.minZ)&&(e.minZ=t.z()),(void 0===e.maxZ||t.z()>e.maxZ)&&(e.maxZ=t.z()),e)),{});return new m.default(e.minX,e.minY,e.minZ,e.maxX-e.minX,e.maxY-e.minY,e.maxZ-e.minZ)}faces(){return this.polygonFaces().fastConcat(this.fillerFaces())}polygonFaces(){if(this._reverseFaces){const e=this._vertices.slice().reverse();return[new f.default(e),new f.default(this._extrudedVertices)]}{const e=this._extrudedVertices.slice().reverse();return[new f.default(e),new f.default(this._vertices)]}}fillerFaces(){const e=this._vertices.length,t=new Array(e);for(let r=0;r<e;r++)this._reverseFaces?t[r]=new f.default([this._vertices[r],this._vertices[(r+1)%e],this._extrudedVertices[(r+1)%e],this._extrudedVertices[r]]):t[r]=new f.default([this._extrudedVertices[r],this._extrudedVertices[(r+1)%e],this._vertices[(r+1)%e],this._vertices[r]]);return t}}},72830:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>a}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));var a=class Mesh{constructor(e){this._faces=e}faces(){return this._faces}vertices(){const e=[];for(let t=0;t<this._faces.length;t++)e.fastMerge(this._faces[t].vertices());return e}vertexArray(){return this.vertices().reduce(((e,t)=>{const r=[t.x(),-t.z(),t.y()];return e.fastConcat(r)}),[])}}},63812:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>v}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(18477)),m=d(r(10680)),f=d(r(55327)),g=r(42932),y=d(r(44425)),b=d(r(72284));class Path extends b.default{constructor(e,t=[]){super(),this._origin=e,this._segments=t}closed(){return this._closed??=!0}setClosed(e){this._closed=e}addEdge(e){return this.segments().push(new f.default(this.lastVertex(),e)),this}addArc(e,t,{isClockwise:r=!0,isMinorAngle:n=!0}={}){return this.segments().push(new p.default(this.lastVertex(),e,t,{isClockwise:r,isMinorAngle:n})),this}addCubicBezier(e,t,r){const n=this.lastVertex(),i=t.relatedTo(n),s=r.relatedTo(e);return this.segments().push(new m.default(n,i,s,e)),this}origin(){return this._origin}vertices(){return[this.origin(),...this.segments().map((e=>e.end()))]}area(){const e=this.vertices(),t=e.length;let r=0;for(let n=0,i=1;n<t;++n,i=(n+1)%t)r+=e[n].x()*e[i].y()-e[i].x()*e[n].y();const n=.5*r;return this.segments().reduce(((e,t)=>e+t.signedRelativeArea()),n)}perimeter(){return this.segments().sum((e=>e.length()))}intersects(e,t,r,n=Math.DEFAULT_TOLERANCE){return!!this.segments().find((i=>i.contains(e,t,r,n)))}containsPoint(e,t=Math.DEFAULT_TOLERANCE){return this.contains(e.x(),e.y(),e.z(),t)}contains(e,t,r,n=Math.DEFAULT_TOLERANCE){const i=(0,g.$P)(e,t,r),s=i.to(i.add(1e6,0,0));return this.segments().sum((e=>e.intersections(s).length))%2==1||this.intersects(e,t,r,n)}moveBy(e,t,r){let n=!1;return this.vertices().forEach((i=>n=i.moveBy(e,t,r)||n)),n}boundingBox(){return this.segments().reduce(((e,t)=>e?e.merge(t.boundingBox()):t.boundingBox()),void 0)}toPolygon(){const e=this.segments();return new y.default(e.reduce(((e,t)=>(t.divisions?e.push(...t.divisions(8).slice(1)):e.push(t.end()),e)),[e.first().begin()]))}segments(){return this._segments??=[]}lastVertex(){return this.segments().last()?.end()??this._origin}}var v=Path},44425:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>_}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));r(50988);var p=d(r(55327)),m=d(r(32640)),f=d(r(97856)),g=d(r(15904)),y=d(r(72284)),b=d(r(22711)),v=d(r(68662));class Polygon extends y.default{constructor(e){super(),this._vertices=e}static regularTriangle(e,t){return new this([e.add(new f.default(t,270..degreesToRadians())),e.add(new f.default(t,30..degreesToRadians())),e.add(new f.default(t,150..degreesToRadians()))].map((t=>g.default.makeRelativeTo(t,e))))}static rectangle(e,t,r){const n=new g.default(e,-t/2,-r/2);return new this(new v.default(n.x(),n.y(),t,r).toPolygon().vertices().map((t=>g.default.makeRelativeTo(t,e))))}contains(e,t,r=Math.DEFAULT_TOLERANCE){let n=!1;const i=this.vertices().length;for(let r=0;r<i;r++){const s=this.vertices()[r],o=s.x(),a=s.y(),l=this.vertices()[(r+1)%i],c=l.x(),u=l.y();a>t!=u>t&&e<(c-o)*(t-a)/(u-a)+o&&(n=!n)}return n||this.intersects(e,t,r)}movedBy(e,t,r){const n=this.snapshot();return n.moveBy(e,t,r),n}moveBy(e,t,r){let n=!1;return this.vertices().forEach((i=>n=i.moveBy(e,t,r)||n)),n}rotateBy(e,t){this.vertices().forEach((r=>r.rotateBy(e,t)))}rotatedBy(e,t){const r=this.snapshot();return r.rotateBy(e,t),r}snapPoint(){return this.vertices()[0]}relatedTo(e){return new this.constructor(this.vertices().map((t=>g.default.makeRelativeTo(t,e))))}toString(){const e=this.vertices().map((e=>`(${e.to3DString()})`)).join(", ");return`${this.constructor.name} [${e}]`}vertices(){return this._vertices}toArray(){return this.vertices().map((e=>[e.x(),e.y(),e.z()]))}equals(e){if(!e.vertices)return!1;const t=e.vertices(),r=this.vertices();if(t.length!==r.length)return!1;const n=t.findIndex((e=>e.equals(r[0])));if(-1===n)return!1;for(let e=0;e<r.length;e++){const i=t[(e+n)%t.length];if(!r[e].equals(i))return!1}return!0}tiles(e,t){const r=[],n=this.boundingBox(),i=n.topLeft(),s=Math.ceil(n.height()/t),o=Math.ceil(n.width()/e);for(let n=0;n<s;n++)for(let s=0;s<o;s++){const o=i.x()+e*s,a=i.y()+t*n,l=this.centroid().z(),c=(0,m.default)(o,a,l),u=(0,m.default)(o+e,a,l),d=(0,m.default)(o,a+t,l),h=(0,m.default)(o+e,a+t,l),p=new this.constructor([d,c,u,h]);r.fastMerge(p.intersection(this))}return r}_geojsonGeometryToOurPolygons(e,t){return t.map((([t])=>this._geojsonPolygonToOurPolygon(e,t)))}roundedTo(e){return new this.constructor(this.vertices().map((t=>t.roundedTo(e))))}intersection(e,t=Math.SIGNIFICANT_DECIMAL_PLACES){this._ensureSameZLevel([e],t);const r=this.vertices()[0],n=e.to2DGeoJSONPolygon(t),i=this.to2DGeoJSONPolygon(t),s=b.default.intersection(i,n)||[];return this._geojsonGeometryToOurPolygons(r,s)}union(...e){const t=Math.SIGNIFICANT_DECIMAL_PLACES;this._ensureSameZLevel(e,t);const r=this.vertices()[0],n=this.to2DGeoJSONPolygon(t),i=e.map((e=>[e.to2DGeoJSONPolygon(t)])),s=b.default.union([n],...i);return this._geojsonGeometryToOurPolygons(r,s)}difference(e,t=Math.SIGNIFICANT_DECIMAL_PLACES){const r=[e].flat();this._ensureSameZLevel(r,t);const n=this.vertices()[0],i=r.map((e=>e.to2DGeoJSONPolygon(t))),s=this.to2DGeoJSONPolygon(t),o=b.default.difference(s,...i)||[];return this._geojsonGeometryToOurPolygons(n,o)}_ensureSameZLevel(e,t){const r=10**-t,n=this.vertices().first().z();if(!e.every((e=>n.isNearTo(e.vertices().first().z(),r))))throw new Error("Shapes must be at same level")}to2DGeoJSONLinearRing(e=Math.SIGNIFICANT_DECIMAL_PLACES){const t=this.toArray();return t.push(t[0]),this.isCounterClockwise()||t.reverse(),t.map((t=>[t[0].roundedTo(e),t[1].roundedTo(e)]))}to2DGeoJSONPolygon(e=Math.SIGNIFICANT_DECIMAL_PLACES){return[this.to2DGeoJSONLinearRing(e)]}static fromGeoJSONLinearRing(e){const t=new this(e.slice(0,-1).map((([e,t,r])=>(0,m.default)(e,t,r))));return t.isCounterClockwise()&&t.reverseVertices(),t}_removeSuperfluousVertices(){const e=this.edges();e.forEach(((t,r)=>{const n=e[(r+1)%e.length];t.isParallelTo(n)&&t.end().equals(n.begin())&&this.removeVertex(t.end())}))}_geojsonPolygonToOurPolygon(e,t){const r=this.constructor.fromGeoJSONLinearRing(t);return r._removeSuperfluousVertices(),r._rotateVerticesToStartNearestTo(e),r.vertices()[0].z()!==e.z()&&r.moveBy(0,0,e.z()-r.vertices()[0].z()),r}_rotateVerticesToStartNearestTo(e){const t=this.vertices(),r=t.map((t=>t.distanceTo(e))),n=Math.min(...r);this._rotateArray(t,r.indexOf(n))}_rotateArray(e,t){const r=e.length>>>0;t>>=0,e.unshift(...e.splice(t%r,r))}edges(){const e=[],t=this.vertices().length;if(0===t)return e;for(let r=0;r<t-1;r++)e.push(new p.default(this.vertices()[r],this.vertices()[r+1]));return e.push(new p.default(this.vertices()[t-1],this.vertices()[0])),e}normal(){let e=(0,m.default)(0,0,0);const t=this.vertices();return t.forEach(((r,n)=>{const i=t[(n+1)%t.length];e=e.add((r.y()-i.y())*(r.z()+i.z()),(r.z()-i.z())*(r.x()+i.x()),(r.x()-i.x())*(r.y()+i.y()))})),e.normalized()}containsPoint(e,t=Math.DEFAULT_TOLERANCE){return this.contains(e.x(),e.y(),t)}containsEdge(e,t=Math.DEFAULT_TOLERANCE){return this.containsPoint(e.begin(),t)&&this.containsPoint(e.end(),t)}overlapsPoint(e,t=Math.DEFAULT_TOLERANCE){return console.warn(new Error("Polygon #overlapsPoint is deprecated - use #containsPoint instead")),this.containsPoint(e,t)}snapshot(){return new this.constructor(this.vertices().map((e=>e.snapshot())))}boundingBox(){const e=this.vertices().reduce(((e,t)=>(t.x()<e.minX&&(e.minX=t.x()),t.x()>e.maxX&&(e.maxX=t.x()),t.y()<e.minY&&(e.minY=t.y()),t.y()>e.maxY&&(e.maxY=t.y()),e)),{minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0});return new v.default(e.minX,e.minY,e.maxX-e.minX,e.maxY-e.minY)}perimeter(){const e=this.vertices();return e.reduce(((t,r,n)=>{const i=e[(n+1)%e.length];return t+r.to(i).length()}),0)}centroid(){const e=this.vertices();if(1===e.length)return e.first();const t=t=>e[t].x(),r=t=>e[t].y();let n=0,i=0;for(let s=0,o=1,a=e.length;s<a;++s,o=(s+1)%a)n+=(t(s)+t(o))*(t(s)*r(o)-t(o)*r(s)),i+=(r(s)+r(o))*(t(s)*r(o)-t(o)*r(s));const s=6*this.signedArea(e),o=e.reduce(((e,t)=>e+t.z()),0)/e.length;return(0,m.default)(n/s,i/s,o)}isCounterClockwise(){return this.signedArea()<0}reverseVertices(){this.vertices().reverse(),this.vertices().unshift(this.vertices().pop())}signedArea(){const e=this.normal(),t=(0,m.default)(Math.abs(e.x()),Math.abs(e.y()),Math.abs(e.z()));let r,n;return t.x()>Math.max(t.y(),t.z())?(r=e=>e.yz(),n=1/t.x()):t.y()>Math.max(t.x(),t.z())?(r=e=>(0,m.default)(e.z(),e.x()),n=1/t.y()):(r=e=>(0,m.default)(e.x(),e.y()),n=1/t.z()),this._projectedSignedArea(r)*n}_projectedSignedArea(e){const t=this.vertices().map(e),r=t.length;let n=0;for(let e=0,i=1;e<r;++e,i=(e+1)%r)n+=t[e].x()*t[i].y()-t[i].x()*t[e].y();return.5*n}area(){return Math.abs(this.signedArea())}intersects(e,t,r=Math.DEFAULT_TOLERANCE){return this.edges().some((n=>n.intersects(e,t,void 0,r)))}overlapsShape(e,t=Math.DEFAULT_TOLERANCE){return this.intersectsShape(e,t)||this.containsShape(e,t)||e.containsShape(this,t)}containsShape(e,t=Math.DEFAULT_TOLERANCE){return e.vertices().every((e=>this.containsPoint(e,t)))}intersectsShape(e,t=Math.DEFAULT_TOLERANCE){return!e.containsShape(this,t)&&!this.containsShape(e,t)&&(e.vertices().some((e=>this.containsPoint(e,t)))||this.vertices().some((r=>e.containsPoint(r,t)))||this.edges().some((t=>e.edges().some((e=>t.intersectionsWithEdge(e).length>0)))))}isAdjacentTo(e){if(this.vertices().first().z()!==e.vertices().first().z())return!1;const t=this.edges(),r=e.edges(),n=t.some((e=>r.some((t=>e.overlapsBySignificantDistance(t))))),i=this.intersection(e).sum((e=>e.signedArea())).isNearTo(0);return n&&i}replaceVertex(e,t){const r=this.vertices().indexOf(e);this.vertices().splice(r,1),this._insertAfterIndex(r,t)}replaceVertices(e,t,r){const n=this.vertices().indexOf(e);this.removeVertices(e,t),this._insertAfterIndex(n,r)}insertAfter(e,t){const r=this.vertices().indexOf(e)+1;this._insertAfterIndex(r,t)}_insertAfterIndex(e,t){this.vertices().splice(e,0,...t)}removeVertices(e,t){let r=this.vertices().indexOf(e);const n=this.vertices().indexOf(t);n<r&&(this.vertices().splice(r),r=0),this.vertices().splice(r,n-r+1)}removeVertex(e){const t=this.vertices().indexOf(e);this.vertices().splice(t,1)}setZeroVertex(e){let t=this.vertices();const r=t.indexOf(e);if(0!==r){const e=t.splice(0,r);t=t.concat(e)}this._vertices=t}xy(){return new this.constructor(this.vertices().map((e=>e.xy())))}xz(){return new this.constructor(this.vertices().map((e=>e.xz())))}yz(){return new this.constructor(this.vertices().map((e=>e.yz())))}zLevel(){let e=1/0,t=-1/0;return this.vertices().forEach((r=>{const n=r.z();n<e&&(e=n),n>t&&(t=n)})),(t-e)/2+e}}var _=Polygon;v.default.prototype.toPolygon=function(){return new Polygon(this.vertices())}},22711:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(81126));var p=h.default.default?h.default.default:h.default},4674:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>b}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(32640)),m=d(r(15904)),f=d(r(72284)),g=d(r(44425)),y=d(r(22711));class PolygonWithHoles extends f.default{static fromGeojsonPolygon(e,t=0){const r=new this(g.default.fromGeoJSONLinearRing(e.shift()).vertices(),void 0,e.map((e=>{const t=g.default.fromGeoJSONLinearRing(e);return t.reverseVertices(),t})));return r.moveBy(0,0,t),r}constructor(e=[],t=(0,p.default)(0,0),r=[]){super(),this._surface=new g.default(e),this._referencePoint=t,this._holes=r}surface(){return this._surface}vertices(){return this.surface().vertices()}edges(){return this.surface().edges()}isAdjacentTo(e){return this.surface().isAdjacentTo(e)}holes(){return this._holes}reverseVertices(){this.surface().reverseVertices(),this.holes().forEach((e=>e.reverseVertices()))}movedBy(e,t,r){const n=this.snapshot();return n.moveBy(e,t,r),n}moveBy(e,t,r){let n=this.surface().moveBy(e,t,r);return this._holes.forEach((i=>n=i.moveBy(e,t,r)||n)),n}rotateBy(e,t){this.surface().rotateBy(e,t),this.holes().forEach((r=>r.rotateBy(e,t)))}rotatedBy(e,t){const r=this.snapshot();return r.rotateBy(e,t),r}relatedTo(e){return new this.constructor(this.vertices().map((t=>m.default.makeRelativeTo(t,e))),e,this.holes().map((t=>t.relatedTo(e))))}centroid(){return this._surface.centroid()}boundingBox(){return this._surface.boundingBox()}contains(e,t){return this.surface().contains(e,t)&&!this._containedByHole(e,t)}_containedByHole(e,t){return this.holes().some((r=>r.contains(e,t)))}area(){const e=this.holes().sum((e=>e.area()));return this.surface().area()-e}overlapsShape(e){return!!this.surface().overlapsShape(e)&&!this._holesContainShape(e)}_holesContainShape(e){return this.holes().some((t=>t.containsShape(e)))}to2DGeoJSONPolygon(e){return[this.surface().to2DGeoJSONLinearRing(e),...this.holes().map((t=>t.to2DGeoJSONLinearRing(e)))]}excludeRegion(e){const t=this.surface().to2DGeoJSONPolygon(),r=e.to2DGeoJSONPolygon(),n=y.default.difference([t],[r]);if(0===n.length)throw new Error(PolygonWithHoles.ERROR_NO_RESULTING_GEOMETRY);if(n.length>1)throw new Error(PolygonWithHoles.ERROR_MULTIPLE_RESULTING_GEOMETRY);this._surface=g.default.fromGeoJSONLinearRing(n[0][0]).relatedTo(this._referencePoint);for(let e=1;e<n[0].length;e++){const t=g.default.fromGeoJSONLinearRing(n[0][e]).relatedTo(this._referencePoint);this._holes.push(t)}}removeVertex(e){this.surface().removeVertex(e)}_removeSuperfluousVertices(){this.surface()._removeSuperfluousVertices(),this.holes().forEach((e=>e._removeSuperfluousVertices()))}_geojsonPolygonToOurPolygon(e,t){const r=this.constructor.fromGeojsonPolygon(t,e.z());return r._removeSuperfluousVertices(),r}_geojsonGeometryToOurPolygons(e,t){return t.map((t=>this._geojsonPolygonToOurPolygon(e,t)))}roundedTo(e){return new this.constructor(this.vertices().map((t=>t.roundedTo(e))),this._referencePoint.roundedTo(e),this.holes().map((t=>t.roundedTo(e))))}intersection(e,t=Math.SIGNIFICANT_DECIMAL_PLACES){if(this.vertices()[0].z()!==e.vertices()[0].z())throw new Error("Shapes must be at same level");const r=this.vertices()[0],n=e.to2DGeoJSONPolygon(t),i=this.to2DGeoJSONPolygon(t),s=y.default.intersection(i,n)||[];return this._geojsonGeometryToOurPolygons(r,s)}union(...e){const t=Math.SIGNIFICANT_DECIMAL_PLACES;e.forEach((e=>{if(this.vertices()[0].z()!==e.vertices()[0].z())throw new Error("Shapes must be at same level")}));const r=this.vertices()[0],n=this.to2DGeoJSONPolygon(t),i=e.map((e=>[e.to2DGeoJSONPolygon(t)])),s=y.default.union([n],...i);return this._geojsonGeometryToOurPolygons(r,s)}difference(e,t=Math.SIGNIFICANT_DECIMAL_PLACES){const r=[e].flat();if(r.some((e=>this.vertices()[0].z()!==e.vertices()[0].z())))throw new Error("Shapes must be at same level");const n=this.vertices()[0],i=r.map((e=>e.to2DGeoJSONPolygon(t))),s=this.to2DGeoJSONPolygon(t),o=y.default.difference(s,...i)||[];return this._geojsonGeometryToOurPolygons(n,o)}xy(){return new this.constructor(this.vertices().map((e=>e.xy())),this._referencePoint.xy(),this.holes().map((e=>e.xy())))}snapshot(){return new this.constructor(this.vertices().map((e=>e.snapshot())),this._referencePoint.snapshot(),this.holes().map((e=>e.snapshot())))}containsPoint(e){return this.contains(e.x(),e.y())}containsShape(e){return e.vertices().every((e=>this.containsPoint(e)))}equals(e){return this===e||this.holes().length===e.holes().length&&(!!this.surface().equals(e.surface())&&this.holes().every((t=>e.holes().some((e=>t.equals(e))))))}}PolygonWithHoles.ERROR_NO_RESULTING_GEOMETRY="No result",PolygonWithHoles.ERROR_MULTIPLE_RESULTING_GEOMETRY="Too many results";var b=PolygonWithHoles},68662:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>y}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(55327)),m=d(r(32640)),f=d(r(15904)),g=d(r(72284));class Rectangle extends g.default{constructor(e,t,r,n){super(),this._topLeft=void 0!==t?(0,m.default)(e,t):e,this._width=r,this._height=n}x(){return this._topLeft.x()}y(){return this._topLeft.y()}width(){return this._width}height(){return this._height}area(){return this._width*this._height}top(){return this.y()}bottom(){return this.y()+this.height()}left(){return this.x()}right(){return this.x()+this.width()}center(){return(0,m.default)(this.left()+this.width()/2,this.top()+this.height()/2)}topLeft(){return(0,m.default)(this.left(),this.top())}topCenter(){return(0,m.default)(this.left()+this.width()/2,this.top())}topRight(){return(0,m.default)(this.right(),this.top())}rightCenter(){return(0,m.default)(this.right(),this.top()+this.height()/2)}bottomLeft(){return(0,m.default)(this.left(),this.bottom())}leftCenter(){return(0,m.default)(this.left(),this.top()+this.height()/2)}bottomCenter(){return(0,m.default)(this.left()+this.width()/2,this.bottom())}bottomRight(){return(0,m.default)(this.right(),this.bottom())}vertices(){return[this.topLeft(),this.topRight(),this.bottomRight(),this.bottomLeft()]}topEdge(){return new p.default(this.topLeft(),this.topRight())}rightEdge(){return new p.default(this.topRight(),this.bottomRight())}bottomEdge(){return new p.default(this.bottomRight(),this.bottomLeft())}leftEdge(){return new p.default(this.bottomLeft(),this.topLeft())}edges(){return[this.topEdge(),this.rightEdge(),this.bottomEdge(),this.leftEdge()]}contains(e,t){const r=Math.DEFAULT_TOLERANCE;return(e>=this.left()||e.isNearTo(this.left(),r))&&(t>=this.top()||t.isNearTo(this.top(),r))&&(e<=this.right()||e.isNearTo(this.right(),r))&&(t<=this.bottom()||t.isNearTo(this.bottom(),r))}moveBy(e,t){return this._topLeft.moveBy(e,t)}snapPoint(){return this.center()}relatedTo(e){const t=f.default.makeRelativeTo(this._topLeft,e);return new this.constructor(t,void 0,this.width(),this.height())}boundingBox(){return this}toPolygon(){const e=["Rectangle.prototype.toPolygon() is installed when Polygon is loaded/imported.","If you see this error, you may resolve it with a manual import (or require) of Polygon.","Alternatively, import (or require) Rectangle through the geometry index file."].join("\n");throw new Error(e)}extrudedFromTo(e,t){const r=["Rectangle.prototype.extrudedFromTo() is installed when Cube is loaded/imported.","If you see this error, you may resolve it with a manual import (or require) of Cube.","Alternatively, import (or require) Rectangle through the geometry index file."].join("\n");throw new Error(r)}toString(){return`Rectangle( ${[this.x(),this.y(),this.width(),this.height()].join(", ")} )`}equals(e,t){return t?!0===(e&&e.x&&e.x().isNearTo(this.x(),t)&&e.y&&e.y().isNearTo(this.y(),t)&&e.width&&e.width().isNearTo(this.width(),t)&&e.height&&e.height().isNearTo(this.height(),t)):!0===(e&&e.x&&e.x()===this.x()&&e.y&&e.y()===this.y()&&e.width&&e.width()===this.width()&&e.height&&e.height()===this.height())}merge(e){const t=Math.min(this.x(),e.x()),r=Math.min(this.y(),e.y());return new this.constructor(t,r,Math.max(this.right(),e.right())-t,Math.max(this.bottom(),e.bottom())-r)}containsPoint(e){return this.contains(e.x(),e.y())}containsShape(e){return this.toPolygon().containsShape(e)}intersects(e){return!(this.bottom()<e.top()||this.top()>e.bottom()||this.right()<e.left()||this.left()>e.right())}movedBy(e,t){return void 0===t&&(t=e),new this.constructor(this.x()+e,this.y()+t,this.width(),this.height())}insetBy(e,t){return void 0===t&&(t=e),this._topLeft.moveBy(e,t),this._width-=2*e,this._height-=2*t,this}insettedBy(e,t){return void 0===t&&(t=e),new this.constructor(this.x()+e,this.y()+t,this.width()-2*e,this.height()-2*t)}rounded(){return new this.constructor(Math.round(this.x()),Math.round(this.y()),Math.round(this.width()),Math.round(this.height()))}roundedTo(e){return new this.constructor(this.x().roundedTo(e),this.y().roundedTo(e),this.width().roundedTo(e),this.height().roundedTo(e))}static isRectangle(e){return 4===e.vertices().length&&Rectangle._polygonHas4RightAngles(e)}static _previousEdge(e,t){return 0===t?e[3]:e[t-1]}static _polygonHas4RightAngles(e){const t=e.edges();return t.every(((e,r)=>t[r].isPerpendicularTo(Rectangle._previousEdge(t,r))))}}var y=Rectangle},20786:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>a}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));var a=class TriangleMesh{constructor(e){this._triangleVertices=e}vertices(){return this._vertices||(this._vertices=this.normalizedVertices()),this._vertices}faces(){return this._triangleVertices}normalizedVertices(){const e=[];for(let t=0;t<this._triangleVertices.length;t++)e.fastMerge(this._triangleVertices[t]);return e}vertexArray(){return this._vertexArray||(this._vertexArray=this.normalizedVertexArray()),this._vertexArray}normalizedVertexArray(){return this.vertices().reduce(((e,t)=>e.concat([t.x(),-t.z(),t.y()])),[])}vertexNormals(){if(!this._vertexNormals){const e=this._triangleVertices;this._vertexNormals=[],e.forEach((e=>{const t=e[1].subtract(e[0]),r=e[2].subtract(e[0]),n=t.cross(r).normalized().dividedBy(5);for(let e=0;e<3;e++)this._vertexNormals.push(n.x()),this._vertexNormals.push(n.y()),this._vertexNormals.push(n.z())}))}return this._vertexNormals}}},85678:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>v}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(55327)),m=d(r(32640)),f=d(r(95203)),g=d(r(97856)),y=d(r(44425)),b=d(r(2479));class AngleAnnotation extends b.default{constructor(e,t=500,r=1){super(t),this._angle=e,this._minDistance=r}snapPoint(){return this.vertex()}angle(){return this._angle}vertex(){return this.angle().vertex()}minDistance(){return this._minDistance}degrees(){return this.angle().smallestDeltaDegrees().roundedTo(this.significantDecimalPlaces())}text(){return`${this.degrees()}°`}location(){return this.vertex().add(new g.default(this.distance(),this.angle().bisectingTheta()))}moveBy(e,t){const r=this.vertex().add(new g.default(this.angle().ray1().length(),this.angle().bisectingTheta())),n=new p.default(this.vertex(),r).closestPointTo(this.location().movedBy(e,t)),i=Math.max(n.distanceTo(this.vertex()),this.minDistance()),s=this.distance();return this.setDistance(i.rounded()),this.distance()!==s}toString(){return this.text()}contains(e,t,r=1){return this.vertex().distanceTo(e,t).isNearTo(this.distance(),r)&&this.angle().contains((0,m.default)(e,t))}_boundingTriangle(){return new y.default([this.vertex(),new f.default(this.angle().ray1(),this.distance()),new f.default(this.angle().ray2(),this.distance())])}boundingBox(){return this._boundingTriangle().boundingBox()}}var v=AngleAnnotation},2479:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(72284));class Annotation extends h.default{constructor(e){super(),this._distance=e}distance(){return this._distance}setDistance(e){this._distance=e}layer(){return this._layer}setLayer(e){this._layer=e}significantDecimalPlaces(){return this._significantDecimalPlaces||(this._significantDecimalPlaces=0),this._significantDecimalPlaces}setSignificantDecimalPlaces(e){this._significantDecimalPlaces=e}}var p=Annotation},36869:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>b}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(30045)),m=d(r(11541)),f=d(r(61210)),g=d(r(44425)),y=d(r(2479));class DimensionAnnotation extends y.default{constructor(e,t=30,r="in"){super(t),this._edge=e,this._unit=r}snapPoint(){return this.edgeBegin()}edge(){return this._edge}edgeBegin(){return this._edgeBegin||(this._edgeBegin=new f.default(this.edge(),0)),this._edgeBegin}edgeEnd(){return this._edgeEnd||(this._edgeEnd=new f.default(this.edge(),1)),this._edgeEnd}setEdge(e){this._edge=e,this.reset()}reset(){this._edgeBegin=void 0,this._edgeEnd=void 0}moveBy(e,t){const r=this.edge().shortestLineFrom(this.edge().begin().add(e,t),!0),n=Math.abs(r.angle()-this.edge().normalAngle())<Math.PI/16?-r.length():r.length();return this.setDistance(this.distance()+n),!0}unit(){return this._unit}text(){return this.measurement().toString()}boundingBox(){return new g.default([new m.default(this.edgeBegin(),this.distance()),new m.default(this.edgeEnd(),this.distance()),new m.default(this.edgeEnd(),-this.distance()),new m.default(this.edgeBegin(),-this.distance())]).boundingBox()}measurement(){const e=this.edge().length().roundedTo(this.significantDecimalPlaces());return new p.default(e,this.unit())}nonEssentialProperties(){return["_edgeEnd","_edgeBegin"]}}var b=DimensionAnnotation},72284:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>a}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));var a=class Handleable{contains(e,t){return!1}moveBy(e,t){return!1}snapPoint(){return{x:()=>0,y:()=>0}}}},63059:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>a}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));var a=class Matrix{constructor(e){this._columns=e}columns(){return this._columns.length}rows(){return this._columns[0].length}element(e,t){return this._columns[t-1][e-1]}multiply(e){if(this.columns()===e.rows()){const t=[];for(let r=1;r<=this.rows();r++)for(let n=1;n<=e.columns();n++){let i=0;for(let t=1;t<=this.columns();t++)i+=this.element(r,t)*e.element(t,n);t[n-1]||(t[n-1]=[]),t[n-1][r-1]=i}return new this.constructor(t)}}equal(e){if(this.columns()!==e.columns()||this.rows()!==e.rows())return!1;let t=!0;for(let r=1;r<=this.rows();r++)for(let n=1;n<=this.columns();n++)t=t&&this.element(r,n)===e.element(r,n);return t}flatten(){return this._columns.reduce(((e,t)=>e.concat(t)),[])}static Identity(e){const t=[];for(let r=0;r<e;r++){const n=[];for(let t=0;t<e;t++)n.push(r===t?1:0);t.push(n)}return new this(t)}static RotationX(e){return new this([[1,0,0,0],[0,Math.cos(e),Math.sin(e),0],[0,-Math.sin(e),Math.cos(e),0],[0,0,0,1]])}static RotationY(e){return new this([[Math.cos(e),Math.sin(e),0,0],[-Math.sin(e),Math.cos(e),0,0],[0,0,1,0],[0,0,0,1]])}static RotationZ(e){return new this([[Math.cos(e),0,Math.sin(e),0],[0,1,0,0],[-Math.sin(e),0,Math.cos(e),0],[0,0,0,1]])}}},27281:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};function a(e,t,r){if(r<0){const n=10**-r;return Math[e](t*n)/n}{const n=10**r;return Math[e](t/n)*n}}function l(e){const t=c(e),r=Math.floor(t/12),n=t%12,i=Math.floor(n),s=Math.floor(16*(n-i));let o="";return r>0&&(o+=`${r}'`),i>0&&(o+=` ${i}`),s>0?o+=s%8==0?' 1/2"':s%4==0?` ${Math.floor(s/4)}/4"`:s%2==0?` ${Math.floor(s/2)}/8"`:` ${s}/16"`:i>0&&(o+='"'),o}function c(e){return a("round",e,-Math.SIGNIFICANT_DECIMAL_PLACES)}((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{decimalAdjust:()=>a,default:()=>d,inchesInReadableFormat:()=>l,round:()=>c,roundToFraction:()=>u}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));const u=(e,t=8)=>Math.round(e*t)/t;var d={decimalAdjust:a,inchesInReadableFormat:l,round:c,roundToFraction:u}},59257:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>a}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));var a=class ClassMap{constructor(...e){this.clear(),this.addClasses(...e),this.addClasses(Map,Set)}clear(){this._nameToClassMap={}}addClass(e,t=void 0){this._nameToClassMap[t||e.name]=e,e.alsoKnownAs&&e.alsoKnownAs().forEach((t=>this._nameToClassMap[t]=e))}addClasses(...e){e.forEach((e=>this.addClass(e)))}addCommonJSModule(e){this.addClasses(...this._objectValues(e))}addModule(e){this.addClasses(...this._objectValues(e))}classNames(){return Object.keys(this._nameToClassMap)}getClass(e){const t=this._nameToClassMap[e];if(!t)throw new Error(`${e} is not a defined class`);return t}_objectValues(e){return Object.keys(e).map((t=>e[t]))}}},14153:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(72971));var p=class ExternalObjectCache{async store(e){return e}async retrieve(e){const[t,r]=e.split("/");return new h.default(void 0,t,parseInt(r,10))}}},72971:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(92472));var p=class ExternalReference{constructor(e,t=(0,h.default)(),r=1){this._object=e,this._uuid=t,this._version=r}object(){return this._object}get serializeAsExternal(){return!0}uuid(){return this._uuid}version(){return this._version}incrementVersion(){this._version+=1}id(){return`${this.uuid()}/${this.version()}`}}},10715:(e,t,r)=>{var n,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(l,{default:()=>u}),e.exports=(n=l,((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(n=s(t,l))||n.enumerable});return e})(i({},"__esModule",{value:!0}),n));var c=r(50988);class Migration{static version(){throw new c.MissingOverride(Migration,"version")}static classType(){throw new c.MissingOverride(Migration,"classType")}appliesTo(e){return e instanceof this.constructor.classType()}version(){return this.constructor.version()}objects(){return this._objects??=[]}add(...e){this.objects().push(...e)}runAll(){this.objects().forEach((e=>{this.run(e)}))}run(e){this.setCurrentObject(e),this.change()}change(){throw new c.MissingOverride(this,"change")}renameProperty(e,t){const r=this.currentObject();r[t]=r[e],r[e]=void 0}removeProperty(e){this.currentObject()[e]=void 0}currentObject(){return this._currentObject}setCurrentObject(e){this._currentObject=e}}var u=Migration},80168:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(66800));var p=class MigrationManager{static migrations(){return h.default.instance().migrations()}static currentVersion(){return this.migrations().map((e=>e.version()))}constructor(e=[]){this._jsonVersion=e.slice()}jsonVersion(){return this._jsonVersion}migrations(){return this.constructor.migrations()}migrationQueue(){return this._migrationQueue??=this._defaultMigrationQueue()}_defaultMigrationQueue(){return this.migrations().filter((e=>!this.jsonVersion().includes(e.version()))).sort(((e,t)=>e.version()-t.version())).map((e=>new e))}enqueueMigrationsFor(e){this.migrationQueue().forEach((t=>{t.appliesTo(e)&&t.add(e)}))}runMigrations(){this.migrationQueue().forEach((e=>{e.runAll(),this.jsonVersion().push(e.version())}))}}},66800:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>a}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));var a=class MigrationRegistry{static instance(){return this._instance??=new this}migrations(){return this._migrations??=[]}add(...e){this.migrations().push(...e)}remove(e){this.migrations().remove(e)}}},42337:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=r(50988),p=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(80168));r(11148),r(40110),r(28459);class SmartJsonBuilder{static _defaultConfig(){return{externalObjectCache:void 0}}constructor(e){this._idCache=new Map,this._externalObjectCache=e||this._config().externalObjectCache}_replacer(e,t){if("object"!=typeof t)return t;if(null===t)return t;const r=t.constructor.name;if("Array"===r)return t;if(t.serializeAsExternal){if(!this.externalObjectCache())throw new Error(`${r} is marked as external, but external object cache was not provided to SmartJsonBuilder`);return this._externalObjectPromises.push(this.externalObjectCache().store(t)),{externalReference:t.id()}}if(this.isSerialized(t))return{referenceId:this.idFor(t)};t.beforeSerialize&&t.beforeSerialize();const n=t._toJSONProperties();return n._id=this.generateIdFor(t),n._className=r,n}externalObjectCache(){return this._externalObjectCache}isSerialized(e){return this._idCache.has(e)}generateIdFor(e){const t=this._nextId();return this._idCache.set(e,t),t}idFor(e){return this._idCache.get(e)}async stringify(e){this.__nextId=void 0,this._idCache.clear(),this._externalObjectPromises=[],e.jsonVersion=p.default.currentVersion();const t=JSON.stringify(e,this._replacer.bind(this)),r=await Promise.all(this._externalObjectPromises);return e.jsonVersion=void 0,{json:t,externalObjects:r}}_nextId(){const e=this.__nextId??1;return this.__nextId=e+1,e}}(0,h.extend)(SmartJsonBuilder,h.Configurable);var m=SmartJsonBuilder},3058:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>g}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));r(11148),r(40110),r(28459);var p=r(50988),m=d(r(59257)),f=d(r(25373));class SmartObjectBuilder{static _defaultConfig(){return{classes:new m.default,externalObjectCache:void 0}}constructor(e,t){this._classes=e||this._config().classes,this._externalObjectCache=t||this._config().externalObjectCache}async parse(e){const t=JSON.parse(e);return this.buildSmartObject(t)}async buildSmartObject(e){return new f.default(this._classes,e,this.externalObjectCache()).smartObject()}externalObjectCache(){return this._externalObjectCache}}(0,p.extend)(SmartObjectBuilder,p.Configurable);var g=SmartObjectBuilder},25373:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(80168));var p=class SmartObjectRestorer{constructor(e,t,r){this._classMap=e,this._migrationManager=new h.default(t?.jsonVersion),this._genericObjectTree=t,this._externalObjectCache=r,this._idMapping={},this._migrationQueue=[],this._postRestorationActionQueue=[],this._externalObjectReferences=[]}async smartObject(){const e=this.buildSmartObject(this._genericObjectTree);return e&&(e.jsonVersion=void 0),this._restoreObjectReferences(e),await this._restoreExternalReferences(e),this.migrationManager().runMigrations(),this._runPostRestorationActions(),e}migrationManager(){return this._migrationManager}objectById(e){return this._idMapping[e]}enqueuePostRestorationAction(e){this._postRestorationActionQueue.push(e)}buildSmartObject(e){return Array.isArray(e)?this._restoreArray(e):this._isKnownClassInstance(e)?this._restoreKnownClassInstance(e):this._isObjectReference(e)?e:this._restoreGenericObjectOrValue(e)}async _restoreExternalReferences(){const e=[];for(let t=0;t<this._externalObjectReferences.length;t++){const{parent:r,key:n}=this._externalObjectReferences[t],i=r[n].externalReference,s=this._externalObjectCache.retrieve(i).then((e=>r[n]=e));e.push(s)}await Promise.all(e)}_restoreObjectReferences(e,t=void 0,r=void 0){Array.isArray(e)?this._restoreReferencesInArray(e):this._isObject(e)&&this._restoreReferenceOrChildren(e,t,r)}_runPostRestorationActions(){this._postRestorationActionQueue.forEach((e=>e()))}_restoreArray(e){const t=[];for(let r=0;r<e.length;r++)t[r]=this.buildSmartObject(e[r]);return t}_isKnownClassInstance(e){return this._isObject(e)&&e._className&&"Object"!==e._className}_isObjectReference(e){return this._isObject(e)&&(e.referenceId||e.externalReference)}_restoreKnownClassInstance(e){const t=e._className,r=new(this._lookupClass(t));return this._mapId(e._id,r),r.restore(e,this),r}_restoreGenericObjectOrValue(e){if(!this._isObject(e))return e;const t={};return t.restore(e,this),e._id&&this._mapId(e._id,t),t}_isObject(e){return"object"==typeof e&&null!==e}_lookupClass(e){return this._classMap.getClass(e)}_mapId(e,t){this._idMapping[e]=t}_restoreReferencesInArray(e){e.forEach(((t,r)=>this._restoreObjectReferences(t,e,r)))}_restoreReferenceOrChildren(e,t,r){if(e.referenceId)t[r]=this.objectById(e.referenceId);else if(e.customRestoreReferences)e.customRestoreReferences(this);else if(e.externalReference){if(!this._externalObjectCache)throw new Error("JSON includes external references, but external object cache was not provided to SmartObjectBuilder");this._externalObjectReferences.push({parent:t,key:r})}else this.restoreObjectChildrenReferences(e)}restoreObjectChildrenReferences(e){Object.keys(e).forEach((t=>this._restoreObjectReferences(e[t],e,t)))}}},85771:(e,t,r)=>{var n,i,s,o=Object.create,a=Object.defineProperty,l=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyNames,u=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty,h=(n=r(23410),s=null!=n?o(u(n)):{},((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of c(t))d.call(e,i)||i===r||a(e,i,{get:()=>t[i],enumerable:!(n=l(t,i))||n.enumerable});return e})(!i&&n&&n.__esModule?s:a(s,"default",{value:n,enumerable:!0}),n));Object.defineProperties(Array.prototype,{jsonEquals:{value(e,t,r){return!(!e||this.length!==e.length)&&this.every(((n,i)=>(0,h.default)(n,e[i],t,r)))},enumerable:!1,configurable:!0}})},11148:()=>{Object.defineProperty(Map.prototype,"_toJSONProperties",{value(){return{_className:"Map",data:[...this]}},enumerable:!1,writable:!0}),Object.defineProperty(Map.prototype,"restore",{value(e,t){t.buildSmartObject(e.data).forEach((([e,t])=>this.set(e,t)))},enumerable:!1,writable:!0}),Object.defineProperty(Map.prototype,"customRestoreReferences",{value(e){[...this].forEach((([t,r])=>{let n=t,i=r;if(t.referenceId)n=e.objectById(t.referenceId);else{if(t.externalReference)throw new Error("External references in Maps not yet implemented");e.restoreObjectChildrenReferences(t)}if(r.referenceId)i=e.objectById(r.referenceId);else{if(r.externalReference)throw new Error("External references in Maps not yet implemented");e.restoreObjectChildrenReferences(r)}n!==t?(this.delete(t),this.set(n,i)):i!==r&&this.set(n,i)}))},enumerable:!1,writable:!0})},28459:(e,t,r)=>{var n,i,s,o=Object.create,a=Object.defineProperty,l=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyNames,u=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty,h=(n=r(23410),s=null!=n?o(u(n)):{},((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of c(t))d.call(e,i)||i===r||a(e,i,{get:()=>t[i],enumerable:!(n=l(t,i))||n.enumerable});return e})(!i&&n&&n.__esModule?s:a(s,"default",{value:n,enumerable:!0}),n));r(50988);Object.prototype.restore=function(e,t){const r=Object.keys(e);for(let n=0;n<r.length;n++){const i=r[n];try{const r=t.buildSmartObject(e[i]);void 0!==r&&(this[i]=r)}catch(t){console.log(`Error trying to restore ${e._className}{${e._id}}.${i}`),console.log(t)}}t.migrationManager().enqueueMigrationsFor(this),this.postRestorationAction&&t.enqueuePostRestorationAction(this.postRestorationAction.bind(this))},Object.prototype.nonEssentialProperties=function(){return[]},Object.prototype._makeNonEssentialPropertiesNonEnumerable=function(){this.nonEssentialProperties().forEach((e=>{Object.defineProperty(this,e,{enumerable:!1,writable:!0,configurable:!0})}))},Object.prototype._essentialProperties=function(){return this._makeNonEssentialPropertiesNonEnumerable(),Object.keys(this)},Object.prototype._toJSONProperties=function(){return this._essentialProperties().reduce(((e,t)=>(e[t]=this[t],e)),{})},Object.prototype._jsonCompareProperty=function(e,t,r,n){return"_id"===n||"_className"===n||(0,h.default)(this[n],e[n],t,r)},Object.prototype.jsonEquals=function(e,t=[],r=[]){return this===e||this._essentialProperties().fastConcat(e._essentialProperties()).every(this._jsonCompareProperty.bind(this,e,t,r))},Object.defineProperty(Object.prototype,"serializeAsExternal",{value:!1,enumerable:!1,configurable:!0,writable:!0}),Object.defineProperty(Object.prototype,"jsonEquals",{enumerable:!1}),Object.defineProperty(Object.prototype,"_jsonCompareProperty",{enumerable:!1}),Object.defineProperty(Object.prototype,"_toJSONProperties",{enumerable:!1}),Object.defineProperty(Object.prototype,"restore",{enumerable:!1}),Object.defineProperty(Object.prototype,"nonEssentialProperties",{enumerable:!1}),Object.defineProperty(Object.prototype,"_makeNonEssentialPropertiesNonEnumerable",{enumerable:!1}),Object.defineProperty(Object.prototype,"_essentialProperties",{enumerable:!1})},40110:()=>{Object.defineProperty(Set.prototype,"_toJSONProperties",{value(){return{_className:"Set",data:[...this]}},enumerable:!1,writable:!0}),Object.defineProperty(Set.prototype,"restore",{value(e,t){t.buildSmartObject(e.data).forEach((e=>this.add(e)))},enumerable:!1,writable:!0}),Object.defineProperty(Set.prototype,"customRestoreReferences",{value(e){[...this].forEach((t=>{if(t.referenceId)this.delete(t),this.add(e.objectById(t.referenceId));else{if(t.externalReference)throw new Error("External references in Sets not yet implemented");e.restoreObjectChildrenReferences(t)}}))},enumerable:!1,writable:!0})},57075:(e,t,r)=>{r(1517),r(29530),r(67591),r(13462);const n=r(38720),i=r(58824),s=r(65958),o=r(25874),a=r(52703),l=r(7295),c=r(56692),u=r(96005),d=r(59608),h=r(33541);r(53639),e.exports.ClassMap=n,e.exports.ExternalObjectCache=i,e.exports.ExternalReference=s,e.exports.Migration=o,e.exports.MigrationManager=a,e.exports.MigrationRegistry=l,e.exports.SmartJsonBuilder=c,e.exports.SmartObjectBuilder=u,e.exports.SmartObjectRestorer=d,e.exports.jsonCompare=h},23410:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};function a(e,t,r,n){if(e===t||e&&e.equals&&e.equals(t))return!0;const i=r.indexOf(e);if(-1!==i){if(i===n.indexOf(t))return!0}else r.push(e),n.push(t);return e&&e.jsonEquals&&e.jsonEquals(t,r,n)}((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>a}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t))},10940:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d=(e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>f}),e.exports=(n=h,u(s({},"__esModule",{value:!0}),n));var p=d(r(10715)),m=d(r(66800));class RemoveClassVersionMigration extends p.default{static version(){return"20230519125300"}static classType(){return Object}change(){this.removeProperty("_classVersion")}}m.default.instance().add(RemoveClassVersionMigration);var f=RemoveClassVersionMigration},46982:(e,t,r)=>{var n,i,s,o=Object.create,a=Object.defineProperty,l=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyNames,u=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty,h=(n=r(14418),s=null!=n?o(u(n)):{},((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of c(t))d.call(e,i)||i===r||a(e,i,{get:()=>t[i],enumerable:!(n=l(t,i))||n.enumerable});return e})(!i&&n&&n.__esModule?s:a(s,"default",{value:n,enumerable:!0}),n));const p={first(){return this[0]},last(){return this[this.length-1]},remove(e){const t=this.indexOf(e);return t>-1&&this.splice(t,1),this},replace(e,...t){const r=this.indexOf(e);return r>-1&&this.splice(r,1,...t),this},sum(e=(e=>e)){return this.reduce(((t,r,n)=>t+e(r,n,this)),0)},fastConcat(e){if(!e)return this.slice();const t=this.length,r=e.length,n=Array(t+r);for(let e=0;e<t;e++)n[e]=this[e];for(let i=0;i<r;i++)n[t+i]=e[i];return n},fastMerge(e){if(!e||!e.length)return;const t=this.length,r=e.length;this.length=t+r;for(let n=0;n<r;n++)this[t+n]=e[n]},fastFilter(e){const t=this.length;if(0===t)return[];const r=[];let n;for(let i=0;i<t;i++)n=this[i],e(n)&&r.push(n);return r},uniqueValues(){return this.reduce(((e,t)=>e.some((e=>(0,h.default)(e,t)))?e:[t,...e]),[])},findSmallest(e){if(0!==this.length)return this.reduce(((t,r)=>e(r)<e(t)?r:t))},findLargest(e){if(0!==this.length)return this.reduce(((t,r)=>e(r)>e(t)?r:t))},selectSmallest(e){return this.reduce(((t,r)=>{const n=t.first()?e(t.first()):1/0,i=e(r);return i.isNearTo(n)?t.concat(r):i<n?[r]:t}),[])},selectLargest(e){return this.reduce(((t,r)=>{const n=t.first()?e(t.first()):-1/0,i=e(r);return i.isNearTo(n)?t.concat(r):i>n?[r]:t}),[])}},m={writable:!0,enumerable:!1,configurable:!0},f={};Object.keys(p).forEach((e=>{f[e]=Object.assign({},m,{value:p[e]})})),Object.defineProperties(Array.prototype,f)},50988:(e,t,r)=>{r(57949);const n=r(95034),i=r(84251),s=r(26651),o=r(30771),a=r(32007),l=r(63857),c=r(93561),u=r(172),d=r(6209),h=r(97606),p=r(52537),m=r(53768);e.exports.Configurable=n,e.exports.MissingOverride=i,e.exports.ObserverCollection=s,e.exports.calculate=o,e.exports.delegateMissingTo=a,e.exports.extend=l,e.exports.isDeepEqual=c,e.exports.measureMethod=u,e.exports.override=d,e.exports.overrideMethod=h,e.exports.simpleObserver=p,e.exports.supply=m},23399:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>a}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));var a=class Configurable{static configure(e){return e(this.config())}static config(){return this._config||(this._config=this._defaultConfig()),this._config}static _defaultConfig(){return{}}_config(){return this.constructor.config()}}},51616:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>a}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));class MissingOverride extends Error{constructor(e,t){super(),this.message=`${e.constructor.name} failed to override #${t}`}}var a=MissingOverride},73216:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>a}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));var a=class ObserverCollection{constructor(){this._observers=new Map,this._enabled=!0}enabled(){return this._enabled}setEnabled(e){this._enabled=e}observers(){return this._observers}add(e,t){this.observers().has(e)||this.observers().set(e,[]),this.observers().get(e).push(t)}remove(e,t){if(t){const r=this.observers().get(e);if(r){const n=r.indexOf(t);r.splice(n,1),0===r.length&&this.observers().delete(e)}}else this.observers().delete(e)}}},8824:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>m}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(63768));const p={};var m=function(e,...t){const r={},n=e.reduce(((e,n,i)=>{const s=`value${i}`;return r[s]=t[i-1],e+s+n})).replace(/\n/g," ");return n in p||(p[n]=h.compile(n)),p[n].evaluate(r)}},4948:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>a}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));var a=function(e,t){return new Proxy(e,{get(e,r,n){if(void 0!==e[r])return Reflect.get(e,r,n);{const n=e[t]();let i=n[r];return"function"==typeof i&&(i=i.bind(n)),i}},getOwnPropertyDescriptor:(e,r)=>Reflect.getOwnPropertyDescriptor(e,r)||Reflect.getOwnPropertyDescriptor(e[t](),r),has:(e,r)=>Reflect.has(e,r)||Reflect.has(e[t](),r)})}},20366:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(25107));var p=function(e,t){const r=e.mixins??[];e.mixins=[...r,t];const n=t.prototype;for(const r of Object.getOwnPropertyNames(n)){const i=n[r],s=!(i instanceof Function),o=i===t,a=Object.hasOwnProperty.call(e.prototype,r);s||o||a||(0,h.default)(e.prototype,t.prototype,r)}for(const r of Object.getOwnPropertyNames(t)){const n=t[r],i=!(n instanceof Function),s=n===t,o=Object.hasOwnProperty.call(e,r);i||s||o||(0,h.default)(e,t,r)}}},14418:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>a}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));var a=function e(t,r){if(t===r)return!0;if("object"==typeof t&&"object"==typeof r){if("function"==typeof t.equals)return t.equals(r);const n=Object.keys(t),i=Object.keys(r),s=[...new Set([...n,...i])];if(n.length===s.length&&i.length===s.length)return n.every((n=>e(t[n],r[n])))}return!1}},13741:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>l}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));const a="undefined"!=typeof window&&window.performance||{};a.now=a.now||a.mozNow||a.msNow||a.oNow||a.webkitNow||Date.now;var l=function(e,t){let r=0;const n=e.prototype[t];e.prototype[t]=(...e)=>{r++;const i=a.now();n.call(this,...e);const s=a.now();console.log(`${t} #${r} took ${s-i}ms`)}}},32650:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(25107));var p=function(e,t){const r=t.prototype;for(const n of Object.getOwnPropertyNames(r)){const i=r[n];!(i instanceof Function)||i===t||(0,h.default)(e.prototype,t.prototype,n)}for(const r of Object.getOwnPropertyNames(t)){const n=t[r];!(n instanceof Function)||n===t||(0,h.default)(e,t,r)}}},25107:e=>{var t,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(o,{default:()=>a}),e.exports=(t=o,((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))s.call(e,l)||l===o||r(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e})(r({},"__esModule",{value:!0}),t));var a=function(e,t,r){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n)}},43510:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(73216));function p(e,t){const r=`${t}Observers`,n=`_${r}`,i=`add${t[0].toUpperCase()}${t.slice(1)}Observer`,s=`remove${t[0].toUpperCase()}${t.slice(1)}Observer`,o=`removeAll${r[0].toUpperCase()}${r.slice(1)}`,a=`notify${r[0].toUpperCase()}${r.slice(1)}`,l=`enable${t[0].toUpperCase()}${t.slice(1)}Notifications`,c=`disable${t[0].toUpperCase()}${t.slice(1)}Notifications`,u=`${t}NotificationsEnabled`;e.prototype[r]=function(){return this[n]||(this[n]=new h.default),this[n]},e.prototype[i]=function(e,t){this[r]().add(e,t)},e.prototype[s]=function(e,t){this[r]().remove(e,t)},e.prototype[o]=function(){this[r]().observers().clear()},e.prototype[l]=function(){this[r]().setEnabled(!0)},e.prototype[c]=function(){this[r]().setEnabled(!1)},e.prototype[u]=function(){return this[r]().enabled()},e.prototype[a]=function(...e){if(this[u]()){const t=this[r]().observers(),n=Array.from(t.keys());return Promise.all(n.reduce(((r,n)=>(t.has(n)&&t.get(n).forEach((t=>{r.push(t.apply(n,e))})),r)),[]))}}}},1605:(e,t,r)=>{var n,i=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of a(t))c.call(e,i)||i===r||s(e,i,{get:()=>t[i],enumerable:!(n=o(t,i))||n.enumerable});return e},d={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(d,{default:()=>p}),e.exports=(n=d,u(s({},"__esModule",{value:!0}),n));var h=((e,t,r)=>(r=null!=e?i(l(e)):{},u(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)))(r(25107));var p=function(e,t){const r=e.mixins??[];e.mixins=[...r,t];const n=t.prototype;for(const r of Object.getOwnPropertyNames(n)){const i=n[r],s=!(i instanceof Function),o=i===t,a=e.prototype[r];s||o||a||(0,h.default)(e.prototype,t.prototype,r)}for(const r of Object.getOwnPropertyNames(t)){const n=t[r],i=!(n instanceof Function),s=n===t,o=e[r];i||s||o||(0,h.default)(e,t,r)}}},73549:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createVersion=t.createUppercasePi=t.createUppercaseE=t.createTrue=t.createTau=t.createSQRT2=t.createSQRT1_2=t.createPi=t.createPhi=t.createNull=t.createNaN=t.createLOG2E=t.createLOG10E=t.createLN2=t.createLN10=t.createInfinity=t.createI=t.createFalse=t.createE=void 0;var n=r(66212),i=r(59012),s=r(44879),o=r(30369);t.createTrue=(0,n.factory)("true",[],(()=>!0)),t.createFalse=(0,n.factory)("false",[],(()=>!1)),t.createNull=(0,n.factory)("null",[],(()=>null)),t.createInfinity=a("Infinity",["config","?BigNumber"],(e=>{let{config:t,BigNumber:r}=e;return"BigNumber"===t.number?new r(1/0):1/0})),t.createNaN=a("NaN",["config","?BigNumber"],(e=>{let{config:t,BigNumber:r}=e;return"BigNumber"===t.number?new r(NaN):NaN})),t.createPi=a("pi",["config","?BigNumber"],(e=>{let{config:t,BigNumber:r}=e;return"BigNumber"===t.number?(0,s.createBigNumberPi)(r):o.pi})),t.createTau=a("tau",["config","?BigNumber"],(e=>{let{config:t,BigNumber:r}=e;return"BigNumber"===t.number?(0,s.createBigNumberTau)(r):o.tau})),t.createE=a("e",["config","?BigNumber"],(e=>{let{config:t,BigNumber:r}=e;return"BigNumber"===t.number?(0,s.createBigNumberE)(r):o.e})),t.createPhi=a("phi",["config","?BigNumber"],(e=>{let{config:t,BigNumber:r}=e;return"BigNumber"===t.number?(0,s.createBigNumberPhi)(r):o.phi})),t.createLN2=a("LN2",["config","?BigNumber"],(e=>{let{config:t,BigNumber:r}=e;return"BigNumber"===t.number?new r(2).ln():Math.LN2})),t.createLN10=a("LN10",["config","?BigNumber"],(e=>{let{config:t,BigNumber:r}=e;return"BigNumber"===t.number?new r(10).ln():Math.LN10})),t.createLOG2E=a("LOG2E",["config","?BigNumber"],(e=>{let{config:t,BigNumber:r}=e;return"BigNumber"===t.number?new r(1).div(new r(2).ln()):Math.LOG2E})),t.createLOG10E=a("LOG10E",["config","?BigNumber"],(e=>{let{config:t,BigNumber:r}=e;return"BigNumber"===t.number?new r(1).div(new r(10).ln()):Math.LOG10E})),t.createSQRT1_2=a("SQRT1_2",["config","?BigNumber"],(e=>{let{config:t,BigNumber:r}=e;return"BigNumber"===t.number?new r("0.5").sqrt():Math.SQRT1_2})),t.createSQRT2=a("SQRT2",["config","?BigNumber"],(e=>{let{config:t,BigNumber:r}=e;return"BigNumber"===t.number?new r(2).sqrt():Math.SQRT2})),t.createI=a("i",["Complex"],(e=>{let{Complex:t}=e;return t.I})),t.createUppercasePi=(0,n.factory)("PI",["pi"],(e=>{let{pi:t}=e;return t})),t.createUppercaseE=(0,n.factory)("E",["e"],(e=>{let{e:t}=e;return t})),t.createVersion=(0,n.factory)("version",[],(()=>i.version));function a(e,t,r){return(0,n.factory)(e,t,r,{recreateOnConfigChange:!0})}},29538:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_CONFIG=void 0;t.DEFAULT_CONFIG={relTol:1e-12,absTol:1e-15,matrix:"Matrix",number:"number",numberFallback:"number",precision:64,predictable:!1,randomSeed:null}},86856:(e,t,r)=>{"use strict";var n=r(87929);Object.defineProperty(t,"__esModule",{value:!0}),t.create=function e(t,r){const n=(0,i.default)({},p.DEFAULT_CONFIG,r);if("function"!=typeof Object.create)throw new Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");const g=h.mixin({isNumber:u.isNumber,isComplex:u.isComplex,isBigNumber:u.isBigNumber,isBigInt:u.isBigInt,isFraction:u.isFraction,isUnit:u.isUnit,isString:u.isString,isArray:u.isArray,isMatrix:u.isMatrix,isCollection:u.isCollection,isDenseMatrix:u.isDenseMatrix,isSparseMatrix:u.isSparseMatrix,isRange:u.isRange,isIndex:u.isIndex,isBoolean:u.isBoolean,isResultSet:u.isResultSet,isHelp:u.isHelp,isFunction:u.isFunction,isDate:u.isDate,isRegExp:u.isRegExp,isObject:u.isObject,isMap:u.isMap,isPartitionedMap:u.isPartitionedMap,isObjectWrappingMap:u.isObjectWrappingMap,isNull:u.isNull,isUndefined:u.isUndefined,isAccessorNode:u.isAccessorNode,isArrayNode:u.isArrayNode,isAssignmentNode:u.isAssignmentNode,isBlockNode:u.isBlockNode,isConditionalNode:u.isConditionalNode,isConstantNode:u.isConstantNode,isFunctionAssignmentNode:u.isFunctionAssignmentNode,isFunctionNode:u.isFunctionNode,isIndexNode:u.isIndexNode,isNode:u.isNode,isObjectNode:u.isObjectNode,isOperatorNode:u.isOperatorNode,isParenthesisNode:u.isParenthesisNode,isRangeNode:u.isRangeNode,isRelationalNode:u.isRelationalNode,isSymbolNode:u.isSymbolNode,isChain:u.isChain});g.config=(0,m.configFactory)(n,g.emit),g.expression={transform:{},mathWithTransform:{config:g.config}};const y=[],b=[];const v={};function _(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return g.typed.apply(g.typed,t)}_.isTypedFunction=s.default.isTypedFunction;const x=(0,f.importFactory)(_,(function e(t){if((0,c.isFactory)(t))return t(g);const r=t[Object.keys(t)[0]];if((0,c.isFactory)(r))return r(g);if(!(0,d.isLegacyFactory)(t))throw console.warn("Factory object with properties `type`, `name`, and `factory` expected",t),new Error("Factory object with properties `type`, `name`, and `factory` expected");const i=y.indexOf(t);let s;return-1===i?(s=!0===t.math?t.factory(g.type,n,e,g.typed,g):t.factory(g.type,n,e,g.typed),y.push(t),b.push(s)):s=b[i],s}),g,v);return g.import=x,g.on("config",(()=>{Object.values(v).forEach((e=>{e&&e.meta&&e.meta.recreateOnConfigChange&&x(e,{override:!0})}))})),g.create=e.bind(null,t),g.factory=c.factory,g.import(Object.values((0,d.deepFlatten)(t))),g.ArgumentsError=o.ArgumentsError,g.DimensionError=a.DimensionError,g.IndexError=l.IndexError,g};var i=n(r(37693)),s=n(r(83999)),o=r(11563),a=r(6523),l=r(17967),c=r(66212),u=r(91612),d=r(61175),h=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=g(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&{}.hasOwnProperty.call(e,s)){var o=i?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}return n.default=e,r&&r.set(e,n),n}(r(83392)),p=r(29538),m=r(18205),f=r(59234);function g(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(g=function(e){return e?r:t})(e)}},18205:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NUMBER_OPTIONS=t.MATRIX_OPTIONS=void 0,t.configFactory=function(e,t){function r(i){if(i){if(void 0!==i.epsilon){console.warn('Warning: The configuration option "epsilon" is deprecated. Use "relTol" and "absTol" instead.');const e=(0,n.clone)(i);return e.relTol=i.epsilon,e.absTol=.001*i.epsilon,delete e.epsilon,r(e)}const l=(0,n.clone)(e);a(i,"matrix",s),a(i,"number",o),(0,n.deepExtend)(e,i);const c=(0,n.clone)(e),u=(0,n.clone)(i);return t("config",c,l,u),c}return(0,n.clone)(e)}return r.MATRIX_OPTIONS=s,r.NUMBER_OPTIONS=o,Object.keys(i.DEFAULT_CONFIG).forEach((t=>{Object.defineProperty(r,t,{get:()=>e[t],enumerable:!0,configurable:!0})})),r};var n=r(61175),i=r(29538);const s=t.MATRIX_OPTIONS=["Matrix","Array"],o=t.NUMBER_OPTIONS=["number","BigNumber","Fraction"];function a(e,t,r){void 0===e[t]||r.includes(e[t])||console.warn('Warning: Unknown value "'+e[t]+'" for configuration option "'+t+'". Available options: '+r.map((e=>JSON.stringify(e))).join(", ")+".")}},59234:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.importFactory=function(e,t,r,a){function l(t,n,i){var s;if(i.wrap&&"function"==typeof n&&(n=function(e){const t=function(){const t=[];for(let e=0,r=arguments.length;e<r;e++){const r=arguments[e];t[e]=r&&r.valueOf()}return e.apply(r,t)};e.transform&&(t.transform=e.transform);return t}(n)),"function"==typeof(s=n)&&"string"==typeof s.signature&&(n=e(t,{[n.signature]:n})),e.isTypedFunction(r[t])&&e.isTypedFunction(n))return n=i.override?e(t,n.signatures):e(r[t],n),r[t]=n,delete a[t],c(t,n),void r.emit("import",t,(function(){return n}));if(void 0===r[t]||i.override)return r[t]=n,delete a[t],c(t,n),void r.emit("import",t,(function(){return n}));if(!i.silent)throw new Error('Cannot import "'+t+'": already exists')}function c(e,t){t&&"function"==typeof t.transform?(r.expression.transform[e]=t.transform,h(e)&&(r.expression.mathWithTransform[e]=t.transform)):(delete r.expression.transform[e],h(e)&&(r.expression.mathWithTransform[e]=t))}function u(e){delete r.expression.transform[e],h(e)?r.expression.mathWithTransform[e]=r[e]:delete r.expression.mathWithTransform[e]}function d(t,n){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.fn;if(o.includes("."))throw new Error("Factory name should not contain a nested path. Name: "+JSON.stringify(o));const l=m(t)?r.expression.transform:r,c=o in r.expression.transform,d=(0,s.hasOwnProperty)(l,o)?l[o]:void 0,h=function(){const s={};t.dependencies.map(i.stripOptionalNotation).forEach((e=>{if(e.includes("."))throw new Error("Factory dependency should not contain a nested path. Name: "+JSON.stringify(e));"math"===e?s.math=r:"mathWithTransform"===e?s.mathWithTransform=r.expression.mathWithTransform:"classes"===e?s.classes=r:s[e]=r[e]}));const a=t(s);if(a&&"function"==typeof a.transform)throw new Error('Transforms cannot be attached to factory functions. Please create a separate function for it with export const path = "expression.transform"');if(void 0===d||n.override)return a;if(e.isTypedFunction(d)&&e.isTypedFunction(a))return e(d,a);if(n.silent)return d;throw new Error('Cannot import "'+o+'": already exists')};t.meta&&!1===t.meta.lazy?(l[o]=h(),d&&c?u(o):(m(t)||p(t))&&(0,s.lazy)(r.expression.mathWithTransform,o,(()=>l[o]))):((0,s.lazy)(l,o,h),d&&c?u(o):(m(t)||p(t))&&(0,s.lazy)(r.expression.mathWithTransform,o,(()=>l[o]))),a[o]=t,r.emit("import",o,h)}function h(e){return!(0,s.hasOwnProperty)(f,e)}function p(e){return!(e.fn.includes(".")||(0,s.hasOwnProperty)(f,e.fn)||e.meta&&e.meta.isClass)}function m(e){return void 0!==e&&void 0!==e.meta&&!0===e.meta.isTransformFunction||!1}const f={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return function(e,t){const r=arguments.length;if(1!==r&&2!==r)throw new o.ArgumentsError("import",r,1,2);t||(t={});const a={};!function e(r,n,o){if(Array.isArray(n))n.forEach((t=>e(r,t)));else if("object"==typeof n)for(const t in n)(0,s.hasOwnProperty)(n,t)&&e(r,n[t],t);else if((0,i.isFactory)(n)||void 0!==o){const e=(0,i.isFactory)(n)?m(n)?n.fn+".transform":n.fn:o;if((0,s.hasOwnProperty)(r,e)&&r[e]!==n&&!t.silent)throw new Error('Cannot import "'+e+'" twice');r[e]=n}else if(!t.silent)throw new TypeError("Factory, Object, or Array expected")}(a,e);for(const e in a)if((0,s.hasOwnProperty)(a,e)){const r=a[e];if((0,i.isFactory)(r))d(r,t);else if("function"==typeof(c=r)||"number"==typeof c||"string"==typeof c||"boolean"==typeof c||null===c||(0,n.isUnit)(c)||(0,n.isComplex)(c)||(0,n.isBigNumber)(c)||(0,n.isFraction)(c)||(0,n.isMatrix)(c)||Array.isArray(c))l(e,r,t);else if(!t.silent)throw new TypeError("Factory, Object, or Array expected")}var c}};var n=r(91612),i=r(66212),s=r(61175),o=r(11563)},19455:(e,t,r)=>{"use strict";var n=r(87929);Object.defineProperty(t,"__esModule",{value:!0}),t.createTyped=void 0;var i=n(r(83999)),s=r(66212),o=r(91612),a=r(34749);let l=function(){return l=i.default.create,i.default};const c=["?BigNumber","?Complex","?DenseMatrix","?Fraction"];t.createTyped=(0,s.factory)("typed",c,(function(e){let{BigNumber:t,Complex:r,DenseMatrix:n,Fraction:i}=e;const s=l();return s.clear(),s.addTypes([{name:"number",test:o.isNumber},{name:"Complex",test:o.isComplex},{name:"BigNumber",test:o.isBigNumber},{name:"bigint",test:o.isBigInt},{name:"Fraction",test:o.isFraction},{name:"Unit",test:o.isUnit},{name:"identifier",test:e=>o.isString&&/^[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{10300}-\u{1031F}\u{1032D}-\u{10340}\u{10342}-\u{10349}\u{10350}-\u{10375}\u{10380}-\u{1039D}\u{103A0}-\u{103C3}\u{103C8}-\u{103CF}\u{10400}-\u{1049D}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{10570}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10860}-\u{10876}\u{10880}-\u{1089E}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{10900}-\u{10915}\u{10920}-\u{10939}\u{10980}-\u{109B7}\u{109BE}\u{109BF}\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A60}-\u{10A7C}\u{10A80}-\u{10A9C}\u{10AC0}-\u{10AC7}\u{10AC9}-\u{10AE4}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B60}-\u{10B72}\u{10B80}-\u{10B91}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10D00}-\u{10D23}\u{10E80}-\u{10EA9}\u{10EB0}\u{10EB1}\u{10F00}-\u{10F1C}\u{10F27}\u{10F30}-\u{10F45}\u{10F70}-\u{10F81}\u{10FB0}-\u{10FC4}\u{10FE0}-\u{10FF6}\u{11003}-\u{11037}\u{11071}\u{11072}\u{11075}\u{11083}-\u{110AF}\u{110D0}-\u{110E8}\u{11103}-\u{11126}\u{11144}\u{11147}\u{11150}-\u{11172}\u{11176}\u{11183}-\u{111B2}\u{111C1}-\u{111C4}\u{111DA}\u{111DC}\u{11200}-\u{11211}\u{11213}-\u{1122B}\u{1123F}\u{11240}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A8}\u{112B0}-\u{112DE}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133D}\u{11350}\u{1135D}-\u{11361}\u{11400}-\u{11434}\u{11447}-\u{1144A}\u{1145F}-\u{11461}\u{11480}-\u{114AF}\u{114C4}\u{114C5}\u{114C7}\u{11580}-\u{115AE}\u{115D8}-\u{115DB}\u{11600}-\u{1162F}\u{11644}\u{11680}-\u{116AA}\u{116B8}\u{11700}-\u{1171A}\u{11740}-\u{11746}\u{11800}-\u{1182B}\u{118A0}-\u{118DF}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{1192F}\u{1193F}\u{11941}\u{119A0}-\u{119A7}\u{119AA}-\u{119D0}\u{119E1}\u{119E3}\u{11A00}\u{11A0B}-\u{11A32}\u{11A3A}\u{11A50}\u{11A5C}-\u{11A89}\u{11A9D}\u{11AB0}-\u{11AF8}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C2E}\u{11C40}\u{11C72}-\u{11C8F}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D30}\u{11D46}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D89}\u{11D98}\u{11EE0}-\u{11EF2}\u{11F02}\u{11F04}-\u{11F10}\u{11F12}-\u{11F33}\u{11FB0}\u{12000}-\u{12399}\u{12480}-\u{12543}\u{12F90}-\u{12FF0}\u{13000}-\u{1342F}\u{13441}-\u{13446}\u{14400}-\u{14646}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A70}-\u{16ABE}\u{16AD0}-\u{16AED}\u{16B00}-\u{16B2F}\u{16B40}-\u{16B43}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16E40}-\u{16E7F}\u{16F00}-\u{16F4A}\u{16F50}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18D00}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D6C0}\u{1D6C2}-\u{1D6DA}\u{1D6DC}-\u{1D6FA}\u{1D6FC}-\u{1D714}\u{1D716}-\u{1D734}\u{1D736}-\u{1D74E}\u{1D750}-\u{1D76E}\u{1D770}-\u{1D788}\u{1D78A}-\u{1D7A8}\u{1D7AA}-\u{1D7C2}\u{1D7C4}-\u{1D7CB}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E030}-\u{1E06D}\u{1E100}-\u{1E12C}\u{1E137}-\u{1E13D}\u{1E14E}\u{1E290}-\u{1E2AD}\u{1E2C0}-\u{1E2EB}\u{1E4D0}-\u{1E4EB}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1E800}-\u{1E8C4}\u{1E900}-\u{1E943}\u{1E94B}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}][0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{10300}-\u{1031F}\u{1032D}-\u{10340}\u{10342}-\u{10349}\u{10350}-\u{10375}\u{10380}-\u{1039D}\u{103A0}-\u{103C3}\u{103C8}-\u{103CF}\u{10400}-\u{1049D}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{10570}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10860}-\u{10876}\u{10880}-\u{1089E}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{10900}-\u{10915}\u{10920}-\u{10939}\u{10980}-\u{109B7}\u{109BE}\u{109BF}\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A60}-\u{10A7C}\u{10A80}-\u{10A9C}\u{10AC0}-\u{10AC7}\u{10AC9}-\u{10AE4}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B60}-\u{10B72}\u{10B80}-\u{10B91}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10D00}-\u{10D23}\u{10E80}-\u{10EA9}\u{10EB0}\u{10EB1}\u{10F00}-\u{10F1C}\u{10F27}\u{10F30}-\u{10F45}\u{10F70}-\u{10F81}\u{10FB0}-\u{10FC4}\u{10FE0}-\u{10FF6}\u{11003}-\u{11037}\u{11071}\u{11072}\u{11075}\u{11083}-\u{110AF}\u{110D0}-\u{110E8}\u{11103}-\u{11126}\u{11144}\u{11147}\u{11150}-\u{11172}\u{11176}\u{11183}-\u{111B2}\u{111C1}-\u{111C4}\u{111DA}\u{111DC}\u{11200}-\u{11211}\u{11213}-\u{1122B}\u{1123F}\u{11240}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A8}\u{112B0}-\u{112DE}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133D}\u{11350}\u{1135D}-\u{11361}\u{11400}-\u{11434}\u{11447}-\u{1144A}\u{1145F}-\u{11461}\u{11480}-\u{114AF}\u{114C4}\u{114C5}\u{114C7}\u{11580}-\u{115AE}\u{115D8}-\u{115DB}\u{11600}-\u{1162F}\u{11644}\u{11680}-\u{116AA}\u{116B8}\u{11700}-\u{1171A}\u{11740}-\u{11746}\u{11800}-\u{1182B}\u{118A0}-\u{118DF}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{1192F}\u{1193F}\u{11941}\u{119A0}-\u{119A7}\u{119AA}-\u{119D0}\u{119E1}\u{119E3}\u{11A00}\u{11A0B}-\u{11A32}\u{11A3A}\u{11A50}\u{11A5C}-\u{11A89}\u{11A9D}\u{11AB0}-\u{11AF8}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C2E}\u{11C40}\u{11C72}-\u{11C8F}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D30}\u{11D46}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D89}\u{11D98}\u{11EE0}-\u{11EF2}\u{11F02}\u{11F04}-\u{11F10}\u{11F12}-\u{11F33}\u{11FB0}\u{12000}-\u{12399}\u{12480}-\u{12543}\u{12F90}-\u{12FF0}\u{13000}-\u{1342F}\u{13441}-\u{13446}\u{14400}-\u{14646}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A70}-\u{16ABE}\u{16AD0}-\u{16AED}\u{16B00}-\u{16B2F}\u{16B40}-\u{16B43}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16E40}-\u{16E7F}\u{16F00}-\u{16F4A}\u{16F50}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18D00}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D6C0}\u{1D6C2}-\u{1D6DA}\u{1D6DC}-\u{1D6FA}\u{1D6FC}-\u{1D714}\u{1D716}-\u{1D734}\u{1D736}-\u{1D74E}\u{1D750}-\u{1D76E}\u{1D770}-\u{1D788}\u{1D78A}-\u{1D7A8}\u{1D7AA}-\u{1D7C2}\u{1D7C4}-\u{1D7CB}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E030}-\u{1E06D}\u{1E100}-\u{1E12C}\u{1E137}-\u{1E13D}\u{1E14E}\u{1E290}-\u{1E2AD}\u{1E2C0}-\u{1E2EB}\u{1E4D0}-\u{1E4EB}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1E800}-\u{1E8C4}\u{1E900}-\u{1E943}\u{1E94B}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}]*$/u.test(e)},{name:"string",test:o.isString},{name:"Chain",test:o.isChain},{name:"Array",test:o.isArray},{name:"Matrix",test:o.isMatrix},{name:"DenseMatrix",test:o.isDenseMatrix},{name:"SparseMatrix",test:o.isSparseMatrix},{name:"Range",test:o.isRange},{name:"Index",test:o.isIndex},{name:"boolean",test:o.isBoolean},{name:"ResultSet",test:o.isResultSet},{name:"Help",test:o.isHelp},{name:"function",test:o.isFunction},{name:"Date",test:o.isDate},{name:"RegExp",test:o.isRegExp},{name:"null",test:o.isNull},{name:"undefined",test:o.isUndefined},{name:"AccessorNode",test:o.isAccessorNode},{name:"ArrayNode",test:o.isArrayNode},{name:"AssignmentNode",test:o.isAssignmentNode},{name:"BlockNode",test:o.isBlockNode},{name:"ConditionalNode",test:o.isConditionalNode},{name:"ConstantNode",test:o.isConstantNode},{name:"FunctionNode",test:o.isFunctionNode},{name:"FunctionAssignmentNode",test:o.isFunctionAssignmentNode},{name:"IndexNode",test:o.isIndexNode},{name:"Node",test:o.isNode},{name:"ObjectNode",test:o.isObjectNode},{name:"OperatorNode",test:o.isOperatorNode},{name:"ParenthesisNode",test:o.isParenthesisNode},{name:"RangeNode",test:o.isRangeNode},{name:"RelationalNode",test:o.isRelationalNode},{name:"SymbolNode",test:o.isSymbolNode},{name:"Map",test:o.isMap},{name:"Object",test:o.isObject}]),s.addConversions([{from:"number",to:"BigNumber",convert:function(e){if(t||u(e),(0,a.digits)(e)>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+e+"). Use function bignumber(x) to convert to BigNumber.");return new t(e)}},{from:"number",to:"Complex",convert:function(e){return r||d(e),new r(e,0)}},{from:"BigNumber",to:"Complex",convert:function(e){return r||d(e),new r(e.toNumber(),0)}},{from:"bigint",to:"number",convert:function(e){if(e>Number.MAX_SAFE_INTEGER)throw new TypeError("Cannot implicitly convert bigint to number: value exceeds the max safe integer value (value: "+e+")");return Number(e)}},{from:"bigint",to:"BigNumber",convert:function(e){return t||u(e),new t(e.toString())}},{from:"bigint",to:"Fraction",convert:function(e){return i||h(e),new i(e.toString())}},{from:"Fraction",to:"BigNumber",convert:function(e){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(e){return r||d(e),new r(e.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(e){i||h(e);const t=new i(e);if(t.valueOf()!==e)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+e+"). Use function fraction(x) to convert to Fraction.");return t}},{from:"string",to:"number",convert:function(e){const t=Number(e);if(isNaN(t))throw new Error('Cannot convert "'+e+'" to a number');return t}},{from:"string",to:"BigNumber",convert:function(e){t||u(e);try{return new t(e)}catch(t){throw new Error('Cannot convert "'+e+'" to BigNumber')}}},{from:"string",to:"bigint",convert:function(e){try{return BigInt(e)}catch(t){throw new Error('Cannot convert "'+e+'" to BigInt')}}},{from:"string",to:"Fraction",convert:function(e){i||h(e);try{return new i(e)}catch(t){throw new Error('Cannot convert "'+e+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(e){r||d(e);try{return new r(e)}catch(t){throw new Error('Cannot convert "'+e+'" to Complex')}}},{from:"boolean",to:"number",convert:function(e){return+e}},{from:"boolean",to:"BigNumber",convert:function(e){return t||u(e),new t(+e)}},{from:"boolean",to:"bigint",convert:function(e){return BigInt(+e)}},{from:"boolean",to:"Fraction",convert:function(e){return i||h(e),new i(+e)}},{from:"boolean",to:"string",convert:function(e){return String(e)}},{from:"Array",to:"Matrix",convert:function(e){return n||function(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}(),new n(e)}},{from:"Matrix",to:"Array",convert:function(e){return e.valueOf()}}]),s.onMismatch=(e,t,r)=>{const n=s.createError(e,t,r);if(["wrongType","mismatch"].includes(n.data.category)&&1===t.length&&(0,o.isCollection)(t[0])&&r.some((e=>!e.params.includes(",")))){const t=new TypeError(`Function '${e}' doesn't apply to matrices. To call it elementwise on a matrix 'M', try 'map(M, ${e})'.`);throw t.data=n.data,t}throw n},s.onMismatch=(e,t,r)=>{const n=s.createError(e,t,r);if(["wrongType","mismatch"].includes(n.data.category)&&1===t.length&&(0,o.isCollection)(t[0])&&r.some((e=>!e.params.includes(",")))){const t=new TypeError(`Function '${e}' doesn't apply to matrices. To call it elementwise on a matrix 'M', try 'map(M, ${e})'.`);throw t.data=n.data,t}throw n},s}));function u(e){throw new Error(`Cannot convert value ${e} into a BigNumber: no class 'BigNumber' provided`)}function d(e){throw new Error(`Cannot convert value ${e} into a Complex number: no class 'Complex' provided`)}function h(e){throw new Error(`Cannot convert value ${e} into a Fraction, no class 'Fraction' provided.`)}},23272:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.all=void 0;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=i(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=s?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(62882));function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(i=function(e){return e?r:t})(e)}t.all=n},87651:(e,t,r)=>{"use strict";var n=r(87929);Object.defineProperty(t,"__esModule",{value:!0}),t.config=void 0;var i=n(r(37693)),s=r(29538),o=r(18205);const a=function(e){if(e)throw new Error("The global config is readonly. \nPlease create a mathjs instance if you want to change the default configuration. \nExample:\n\n  import { create, all } from 'mathjs';\n  const mathjs = create(all);\n  mathjs.config({ number: 'BigNumber' });\n");return Object.freeze(s.DEFAULT_CONFIG)};t.config=a,(0,i.default)(a,s.DEFAULT_CONFIG,{MATRIX_OPTIONS:o.MATRIX_OPTIONS,NUMBER_OPTIONS:o.NUMBER_OPTIONS})},19213:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"AccessorNodeDependencies",{enumerable:!0,get:function(){return i.AccessorNodeDependencies}}),Object.defineProperty(t,"ArrayNodeDependencies",{enumerable:!0,get:function(){return b.ArrayNodeDependencies}}),Object.defineProperty(t,"AssignmentNodeDependencies",{enumerable:!0,get:function(){return R.AssignmentNodeDependencies}}),Object.defineProperty(t,"BigNumberDependencies",{enumerable:!0,get:function(){return X.BigNumberDependencies}}),Object.defineProperty(t,"BlockNodeDependencies",{enumerable:!0,get:function(){return le.BlockNodeDependencies}}),Object.defineProperty(t,"ChainDependencies",{enumerable:!0,get:function(){return ye.ChainDependencies}}),Object.defineProperty(t,"ComplexDependencies",{enumerable:!0,get:function(){return je.ComplexDependencies}}),Object.defineProperty(t,"ConditionalNodeDependencies",{enumerable:!0,get:function(){return We.ConditionalNodeDependencies}}),Object.defineProperty(t,"ConstantNodeDependencies",{enumerable:!0,get:function(){return $e.ConstantNodeDependencies}}),Object.defineProperty(t,"DenseMatrixDependencies",{enumerable:!0,get:function(){return pt.DenseMatrixDependencies}}),Object.defineProperty(t,"EDependencies",{enumerable:!0,get:function(){return Eo.EDependencies}}),Object.defineProperty(t,"FibonacciHeapDependencies",{enumerable:!0,get:function(){return qt.FibonacciHeapDependencies}}),Object.defineProperty(t,"FractionDependencies",{enumerable:!0,get:function(){return ir.FractionDependencies}}),Object.defineProperty(t,"FunctionAssignmentNodeDependencies",{enumerable:!0,get:function(){return or.FunctionAssignmentNodeDependencies}}),Object.defineProperty(t,"FunctionNodeDependencies",{enumerable:!0,get:function(){return ar.FunctionNodeDependencies}}),Object.defineProperty(t,"HelpDependencies",{enumerable:!0,get:function(){return yr.HelpDependencies}}),Object.defineProperty(t,"ImmutableDenseMatrixDependencies",{enumerable:!0,get:function(){return Pr.ImmutableDenseMatrixDependencies}}),Object.defineProperty(t,"IndexDependencies",{enumerable:!0,get:function(){return Mr.IndexDependencies}}),Object.defineProperty(t,"IndexNodeDependencies",{enumerable:!0,get:function(){return Cr.IndexNodeDependencies}}),Object.defineProperty(t,"InfinityDependencies",{enumerable:!0,get:function(){return Tr.InfinityDependencies}}),Object.defineProperty(t,"LN10Dependencies",{enumerable:!0,get:function(){return Wr.LN10Dependencies}}),Object.defineProperty(t,"LN2Dependencies",{enumerable:!0,get:function(){return Vr.LN2Dependencies}}),Object.defineProperty(t,"LOG10EDependencies",{enumerable:!0,get:function(){return qr.LOG10EDependencies}}),Object.defineProperty(t,"LOG2EDependencies",{enumerable:!0,get:function(){return $r.LOG2EDependencies}}),Object.defineProperty(t,"MatrixDependencies",{enumerable:!0,get:function(){return yn.MatrixDependencies}}),Object.defineProperty(t,"NaNDependencies",{enumerable:!0,get:function(){return In.NaNDependencies}}),Object.defineProperty(t,"NodeDependencies",{enumerable:!0,get:function(){return jn.NodeDependencies}}),Object.defineProperty(t,"ObjectNodeDependencies",{enumerable:!0,get:function(){return Zn.ObjectNodeDependencies}}),Object.defineProperty(t,"OperatorNodeDependencies",{enumerable:!0,get:function(){return Yn.OperatorNodeDependencies}}),Object.defineProperty(t,"PIDependencies",{enumerable:!0,get:function(){return Mo.PIDependencies}}),Object.defineProperty(t,"ParenthesisNodeDependencies",{enumerable:!0,get:function(){return ei.ParenthesisNodeDependencies}}),Object.defineProperty(t,"ParserDependencies",{enumerable:!0,get:function(){return ni.ParserDependencies}}),Object.defineProperty(t,"RangeDependencies",{enumerable:!0,get:function(){return ki.RangeDependencies}}),Object.defineProperty(t,"RangeNodeDependencies",{enumerable:!0,get:function(){return Bi.RangeNodeDependencies}}),Object.defineProperty(t,"RelationalNodeDependencies",{enumerable:!0,get:function(){return qi.RelationalNodeDependencies}}),Object.defineProperty(t,"ResultSetDependencies",{enumerable:!0,get:function(){return ts.ResultSetDependencies}}),Object.defineProperty(t,"SQRT1_2Dependencies",{enumerable:!0,get:function(){return ds.SQRT1_2Dependencies}}),Object.defineProperty(t,"SQRT2Dependencies",{enumerable:!0,get:function(){return hs.SQRT2Dependencies}}),Object.defineProperty(t,"SpaDependencies",{enumerable:!0,get:function(){return Hs.SpaDependencies}}),Object.defineProperty(t,"SparseMatrixDependencies",{enumerable:!0,get:function(){return zs.SparseMatrixDependencies}}),Object.defineProperty(t,"SymbolNodeDependencies",{enumerable:!0,get:function(){return ao.SymbolNodeDependencies}}),Object.defineProperty(t,"UnitDependencies",{enumerable:!0,get:function(){return So.UnitDependencies}}),Object.defineProperty(t,"absDependencies",{enumerable:!0,get:function(){return n.absDependencies}}),Object.defineProperty(t,"acosDependencies",{enumerable:!0,get:function(){return s.acosDependencies}}),Object.defineProperty(t,"acoshDependencies",{enumerable:!0,get:function(){return o.acoshDependencies}}),Object.defineProperty(t,"acotDependencies",{enumerable:!0,get:function(){return a.acotDependencies}}),Object.defineProperty(t,"acothDependencies",{enumerable:!0,get:function(){return l.acothDependencies}}),Object.defineProperty(t,"acscDependencies",{enumerable:!0,get:function(){return c.acscDependencies}}),Object.defineProperty(t,"acschDependencies",{enumerable:!0,get:function(){return u.acschDependencies}}),Object.defineProperty(t,"addDependencies",{enumerable:!0,get:function(){return d.addDependencies}}),Object.defineProperty(t,"addScalarDependencies",{enumerable:!0,get:function(){return h.addScalarDependencies}}),Object.defineProperty(t,"all",{enumerable:!0,get:function(){return Ho.all}}),Object.defineProperty(t,"andDependencies",{enumerable:!0,get:function(){return p.andDependencies}}),Object.defineProperty(t,"andTransformDependencies",{enumerable:!0,get:function(){return m.andTransformDependencies}}),Object.defineProperty(t,"applyDependencies",{enumerable:!0,get:function(){return f.applyDependencies}}),Object.defineProperty(t,"applyTransformDependencies",{enumerable:!0,get:function(){return g.applyTransformDependencies}}),Object.defineProperty(t,"argDependencies",{enumerable:!0,get:function(){return y.argDependencies}}),Object.defineProperty(t,"asecDependencies",{enumerable:!0,get:function(){return v.asecDependencies}}),Object.defineProperty(t,"asechDependencies",{enumerable:!0,get:function(){return _.asechDependencies}}),Object.defineProperty(t,"asinDependencies",{enumerable:!0,get:function(){return x.asinDependencies}}),Object.defineProperty(t,"asinhDependencies",{enumerable:!0,get:function(){return w.asinhDependencies}}),Object.defineProperty(t,"atan2Dependencies",{enumerable:!0,get:function(){return j.atan2Dependencies}}),Object.defineProperty(t,"atanDependencies",{enumerable:!0,get:function(){return k.atanDependencies}}),Object.defineProperty(t,"atanhDependencies",{enumerable:!0,get:function(){return z.atanhDependencies}}),Object.defineProperty(t,"atomicMassDependencies",{enumerable:!0,get:function(){return q.atomicMassDependencies}}),Object.defineProperty(t,"avogadroDependencies",{enumerable:!0,get:function(){return $.avogadroDependencies}}),Object.defineProperty(t,"bellNumbersDependencies",{enumerable:!0,get:function(){return Z.bellNumbersDependencies}}),Object.defineProperty(t,"bigintDependencies",{enumerable:!0,get:function(){return Y.bigintDependencies}}),Object.defineProperty(t,"bignumberDependencies",{enumerable:!0,get:function(){return ee.bignumberDependencies}}),Object.defineProperty(t,"binDependencies",{enumerable:!0,get:function(){return te.binDependencies}}),Object.defineProperty(t,"bitAndDependencies",{enumerable:!0,get:function(){return re.bitAndDependencies}}),Object.defineProperty(t,"bitAndTransformDependencies",{enumerable:!0,get:function(){return ne.bitAndTransformDependencies}}),Object.defineProperty(t,"bitNotDependencies",{enumerable:!0,get:function(){return ie.bitNotDependencies}}),Object.defineProperty(t,"bitOrDependencies",{enumerable:!0,get:function(){return se.bitOrDependencies}}),Object.defineProperty(t,"bitOrTransformDependencies",{enumerable:!0,get:function(){return oe.bitOrTransformDependencies}}),Object.defineProperty(t,"bitXorDependencies",{enumerable:!0,get:function(){return ae.bitXorDependencies}}),Object.defineProperty(t,"bohrMagnetonDependencies",{enumerable:!0,get:function(){return ce.bohrMagnetonDependencies}}),Object.defineProperty(t,"bohrRadiusDependencies",{enumerable:!0,get:function(){return ue.bohrRadiusDependencies}}),Object.defineProperty(t,"boltzmannDependencies",{enumerable:!0,get:function(){return de.boltzmannDependencies}}),Object.defineProperty(t,"booleanDependencies",{enumerable:!0,get:function(){return he.booleanDependencies}}),Object.defineProperty(t,"catalanDependencies",{enumerable:!0,get:function(){return pe.catalanDependencies}}),Object.defineProperty(t,"cbrtDependencies",{enumerable:!0,get:function(){return me.cbrtDependencies}}),Object.defineProperty(t,"ceilDependencies",{enumerable:!0,get:function(){return fe.ceilDependencies}}),Object.defineProperty(t,"chainDependencies",{enumerable:!0,get:function(){return ge.chainDependencies}}),Object.defineProperty(t,"classicalElectronRadiusDependencies",{enumerable:!0,get:function(){return be.classicalElectronRadiusDependencies}}),Object.defineProperty(t,"cloneDependencies",{enumerable:!0,get:function(){return ve.cloneDependencies}}),Object.defineProperty(t,"columnDependencies",{enumerable:!0,get:function(){return _e.columnDependencies}}),Object.defineProperty(t,"columnTransformDependencies",{enumerable:!0,get:function(){return xe.columnTransformDependencies}}),Object.defineProperty(t,"combinationsDependencies",{enumerable:!0,get:function(){return we.combinationsDependencies}}),Object.defineProperty(t,"combinationsWithRepDependencies",{enumerable:!0,get:function(){return Se.combinationsWithRepDependencies}}),Object.defineProperty(t,"compareDependencies",{enumerable:!0,get:function(){return Pe.compareDependencies}}),Object.defineProperty(t,"compareNaturalDependencies",{enumerable:!0,get:function(){return Te.compareNaturalDependencies}}),Object.defineProperty(t,"compareTextDependencies",{enumerable:!0,get:function(){return Re.compareTextDependencies}}),Object.defineProperty(t,"compileDependencies",{enumerable:!0,get:function(){return ke.compileDependencies}}),Object.defineProperty(t,"complexDependencies",{enumerable:!0,get:function(){return Ie.complexDependencies}}),Object.defineProperty(t,"compositionDependencies",{enumerable:!0,get:function(){return He.compositionDependencies}}),Object.defineProperty(t,"concatDependencies",{enumerable:!0,get:function(){return ze.concatDependencies}}),Object.defineProperty(t,"concatTransformDependencies",{enumerable:!0,get:function(){return Ge.concatTransformDependencies}}),Object.defineProperty(t,"conductanceQuantumDependencies",{enumerable:!0,get:function(){return Ve.conductanceQuantumDependencies}}),Object.defineProperty(t,"conjDependencies",{enumerable:!0,get:function(){return qe.conjDependencies}}),Object.defineProperty(t,"corrDependencies",{enumerable:!0,get:function(){return Xe.corrDependencies}}),Object.defineProperty(t,"cosDependencies",{enumerable:!0,get:function(){return Ye.cosDependencies}}),Object.defineProperty(t,"coshDependencies",{enumerable:!0,get:function(){return Qe.coshDependencies}}),Object.defineProperty(t,"cotDependencies",{enumerable:!0,get:function(){return et.cotDependencies}}),Object.defineProperty(t,"cothDependencies",{enumerable:!0,get:function(){return tt.cothDependencies}}),Object.defineProperty(t,"coulombDependencies",{enumerable:!0,get:function(){return rt.coulombDependencies}}),Object.defineProperty(t,"countDependencies",{enumerable:!0,get:function(){return nt.countDependencies}}),Object.defineProperty(t,"createUnitDependencies",{enumerable:!0,get:function(){return it.createUnitDependencies}}),Object.defineProperty(t,"crossDependencies",{enumerable:!0,get:function(){return st.crossDependencies}}),Object.defineProperty(t,"cscDependencies",{enumerable:!0,get:function(){return ot.cscDependencies}}),Object.defineProperty(t,"cschDependencies",{enumerable:!0,get:function(){return at.cschDependencies}}),Object.defineProperty(t,"ctransposeDependencies",{enumerable:!0,get:function(){return lt.ctransposeDependencies}}),Object.defineProperty(t,"cubeDependencies",{enumerable:!0,get:function(){return ct.cubeDependencies}}),Object.defineProperty(t,"cumsumDependencies",{enumerable:!0,get:function(){return ut.cumsumDependencies}}),Object.defineProperty(t,"cumsumTransformDependencies",{enumerable:!0,get:function(){return dt.cumsumTransformDependencies}}),Object.defineProperty(t,"deepEqualDependencies",{enumerable:!0,get:function(){return ht.deepEqualDependencies}}),Object.defineProperty(t,"derivativeDependencies",{enumerable:!0,get:function(){return mt.derivativeDependencies}}),Object.defineProperty(t,"detDependencies",{enumerable:!0,get:function(){return ft.detDependencies}}),Object.defineProperty(t,"deuteronMassDependencies",{enumerable:!0,get:function(){return gt.deuteronMassDependencies}}),Object.defineProperty(t,"diagDependencies",{enumerable:!0,get:function(){return yt.diagDependencies}}),Object.defineProperty(t,"diffDependencies",{enumerable:!0,get:function(){return bt.diffDependencies}}),Object.defineProperty(t,"diffTransformDependencies",{enumerable:!0,get:function(){return vt.diffTransformDependencies}}),Object.defineProperty(t,"distanceDependencies",{enumerable:!0,get:function(){return _t.distanceDependencies}}),Object.defineProperty(t,"divideDependencies",{enumerable:!0,get:function(){return xt.divideDependencies}}),Object.defineProperty(t,"divideScalarDependencies",{enumerable:!0,get:function(){return wt.divideScalarDependencies}}),Object.defineProperty(t,"dotDependencies",{enumerable:!0,get:function(){return St.dotDependencies}}),Object.defineProperty(t,"dotDivideDependencies",{enumerable:!0,get:function(){return Pt.dotDivideDependencies}}),Object.defineProperty(t,"dotMultiplyDependencies",{enumerable:!0,get:function(){return Et.dotMultiplyDependencies}}),Object.defineProperty(t,"dotPowDependencies",{enumerable:!0,get:function(){return Mt.dotPowDependencies}}),Object.defineProperty(t,"eDependencies",{enumerable:!0,get:function(){return Ct.eDependencies}}),Object.defineProperty(t,"efimovFactorDependencies",{enumerable:!0,get:function(){return At.efimovFactorDependencies}}),Object.defineProperty(t,"eigsDependencies",{enumerable:!0,get:function(){return Tt.eigsDependencies}}),Object.defineProperty(t,"electricConstantDependencies",{enumerable:!0,get:function(){return Dt.electricConstantDependencies}}),Object.defineProperty(t,"electronMassDependencies",{enumerable:!0,get:function(){return Ot.electronMassDependencies}}),Object.defineProperty(t,"elementaryChargeDependencies",{enumerable:!0,get:function(){return Rt.elementaryChargeDependencies}}),Object.defineProperty(t,"equalDependencies",{enumerable:!0,get:function(){return Lt.equalDependencies}}),Object.defineProperty(t,"equalScalarDependencies",{enumerable:!0,get:function(){return kt.equalScalarDependencies}}),Object.defineProperty(t,"equalTextDependencies",{enumerable:!0,get:function(){return Nt.equalTextDependencies}}),Object.defineProperty(t,"erfDependencies",{enumerable:!0,get:function(){return Ft.erfDependencies}}),Object.defineProperty(t,"evaluateDependencies",{enumerable:!0,get:function(){return It.evaluateDependencies}}),Object.defineProperty(t,"expDependencies",{enumerable:!0,get:function(){return Bt.expDependencies}}),Object.defineProperty(t,"expm1Dependencies",{enumerable:!0,get:function(){return Ht.expm1Dependencies}}),Object.defineProperty(t,"expmDependencies",{enumerable:!0,get:function(){return jt.expmDependencies}}),Object.defineProperty(t,"factorialDependencies",{enumerable:!0,get:function(){return Ut.factorialDependencies}}),Object.defineProperty(t,"falseDependencies",{enumerable:!0,get:function(){return zt.falseDependencies}}),Object.defineProperty(t,"faradayDependencies",{enumerable:!0,get:function(){return Gt.faradayDependencies}}),Object.defineProperty(t,"fermiCouplingDependencies",{enumerable:!0,get:function(){return Wt.fermiCouplingDependencies}}),Object.defineProperty(t,"fftDependencies",{enumerable:!0,get:function(){return Vt.fftDependencies}}),Object.defineProperty(t,"filterDependencies",{enumerable:!0,get:function(){return $t.filterDependencies}}),Object.defineProperty(t,"filterTransformDependencies",{enumerable:!0,get:function(){return Zt.filterTransformDependencies}}),Object.defineProperty(t,"fineStructureDependencies",{enumerable:!0,get:function(){return Kt.fineStructureDependencies}}),Object.defineProperty(t,"firstRadiationDependencies",{enumerable:!0,get:function(){return Xt.firstRadiationDependencies}}),Object.defineProperty(t,"fixDependencies",{enumerable:!0,get:function(){return Yt.fixDependencies}}),Object.defineProperty(t,"flattenDependencies",{enumerable:!0,get:function(){return Jt.flattenDependencies}}),Object.defineProperty(t,"floorDependencies",{enumerable:!0,get:function(){return Qt.floorDependencies}}),Object.defineProperty(t,"forEachDependencies",{enumerable:!0,get:function(){return er.forEachDependencies}}),Object.defineProperty(t,"forEachTransformDependencies",{enumerable:!0,get:function(){return tr.forEachTransformDependencies}}),Object.defineProperty(t,"formatDependencies",{enumerable:!0,get:function(){return rr.formatDependencies}}),Object.defineProperty(t,"fractionDependencies",{enumerable:!0,get:function(){return nr.fractionDependencies}}),Object.defineProperty(t,"freqzDependencies",{enumerable:!0,get:function(){return sr.freqzDependencies}}),Object.defineProperty(t,"gammaDependencies",{enumerable:!0,get:function(){return lr.gammaDependencies}}),Object.defineProperty(t,"gasConstantDependencies",{enumerable:!0,get:function(){return cr.gasConstantDependencies}}),Object.defineProperty(t,"gcdDependencies",{enumerable:!0,get:function(){return ur.gcdDependencies}}),Object.defineProperty(t,"getMatrixDataTypeDependencies",{enumerable:!0,get:function(){return dr.getMatrixDataTypeDependencies}}),Object.defineProperty(t,"gravitationConstantDependencies",{enumerable:!0,get:function(){return hr.gravitationConstantDependencies}}),Object.defineProperty(t,"gravityDependencies",{enumerable:!0,get:function(){return pr.gravityDependencies}}),Object.defineProperty(t,"hartreeEnergyDependencies",{enumerable:!0,get:function(){return mr.hartreeEnergyDependencies}}),Object.defineProperty(t,"hasNumericValueDependencies",{enumerable:!0,get:function(){return fr.hasNumericValueDependencies}}),Object.defineProperty(t,"helpDependencies",{enumerable:!0,get:function(){return gr.helpDependencies}}),Object.defineProperty(t,"hexDependencies",{enumerable:!0,get:function(){return br.hexDependencies}}),Object.defineProperty(t,"hypotDependencies",{enumerable:!0,get:function(){return vr.hypotDependencies}}),Object.defineProperty(t,"iDependencies",{enumerable:!0,get:function(){return _r.iDependencies}}),Object.defineProperty(t,"identityDependencies",{enumerable:!0,get:function(){return xr.identityDependencies}}),Object.defineProperty(t,"ifftDependencies",{enumerable:!0,get:function(){return wr.ifftDependencies}}),Object.defineProperty(t,"imDependencies",{enumerable:!0,get:function(){return Sr.imDependencies}}),Object.defineProperty(t,"indexDependencies",{enumerable:!0,get:function(){return Er.indexDependencies}}),Object.defineProperty(t,"indexTransformDependencies",{enumerable:!0,get:function(){return Ar.indexTransformDependencies}}),Object.defineProperty(t,"intersectDependencies",{enumerable:!0,get:function(){return Dr.intersectDependencies}}),Object.defineProperty(t,"invDependencies",{enumerable:!0,get:function(){return Or.invDependencies}}),Object.defineProperty(t,"inverseConductanceQuantumDependencies",{enumerable:!0,get:function(){return Rr.inverseConductanceQuantumDependencies}}),Object.defineProperty(t,"invmodDependencies",{enumerable:!0,get:function(){return Lr.invmodDependencies}}),Object.defineProperty(t,"isIntegerDependencies",{enumerable:!0,get:function(){return kr.isIntegerDependencies}}),Object.defineProperty(t,"isNaNDependencies",{enumerable:!0,get:function(){return Nr.isNaNDependencies}}),Object.defineProperty(t,"isNegativeDependencies",{enumerable:!0,get:function(){return Fr.isNegativeDependencies}}),Object.defineProperty(t,"isNumericDependencies",{enumerable:!0,get:function(){return Ir.isNumericDependencies}}),Object.defineProperty(t,"isPositiveDependencies",{enumerable:!0,get:function(){return Br.isPositiveDependencies}}),Object.defineProperty(t,"isPrimeDependencies",{enumerable:!0,get:function(){return jr.isPrimeDependencies}}),Object.defineProperty(t,"isZeroDependencies",{enumerable:!0,get:function(){return Hr.isZeroDependencies}}),Object.defineProperty(t,"kldivergenceDependencies",{enumerable:!0,get:function(){return Ur.kldivergenceDependencies}}),Object.defineProperty(t,"klitzingDependencies",{enumerable:!0,get:function(){return zr.klitzingDependencies}}),Object.defineProperty(t,"kronDependencies",{enumerable:!0,get:function(){return Gr.kronDependencies}}),Object.defineProperty(t,"largerDependencies",{enumerable:!0,get:function(){return Zr.largerDependencies}}),Object.defineProperty(t,"largerEqDependencies",{enumerable:!0,get:function(){return Kr.largerEqDependencies}}),Object.defineProperty(t,"lcmDependencies",{enumerable:!0,get:function(){return Xr.lcmDependencies}}),Object.defineProperty(t,"leafCountDependencies",{enumerable:!0,get:function(){return Yr.leafCountDependencies}}),Object.defineProperty(t,"leftShiftDependencies",{enumerable:!0,get:function(){return Jr.leftShiftDependencies}}),Object.defineProperty(t,"lgammaDependencies",{enumerable:!0,get:function(){return Qr.lgammaDependencies}}),Object.defineProperty(t,"log10Dependencies",{enumerable:!0,get:function(){return tn.log10Dependencies}}),Object.defineProperty(t,"log1pDependencies",{enumerable:!0,get:function(){return rn.log1pDependencies}}),Object.defineProperty(t,"log2Dependencies",{enumerable:!0,get:function(){return nn.log2Dependencies}}),Object.defineProperty(t,"logDependencies",{enumerable:!0,get:function(){return en.logDependencies}}),Object.defineProperty(t,"loschmidtDependencies",{enumerable:!0,get:function(){return sn.loschmidtDependencies}}),Object.defineProperty(t,"lsolveAllDependencies",{enumerable:!0,get:function(){return an.lsolveAllDependencies}}),Object.defineProperty(t,"lsolveDependencies",{enumerable:!0,get:function(){return on.lsolveDependencies}}),Object.defineProperty(t,"lupDependencies",{enumerable:!0,get:function(){return ln.lupDependencies}}),Object.defineProperty(t,"lusolveDependencies",{enumerable:!0,get:function(){return cn.lusolveDependencies}}),Object.defineProperty(t,"lyapDependencies",{enumerable:!0,get:function(){return un.lyapDependencies}}),Object.defineProperty(t,"madDependencies",{enumerable:!0,get:function(){return dn.madDependencies}}),Object.defineProperty(t,"magneticConstantDependencies",{enumerable:!0,get:function(){return hn.magneticConstantDependencies}}),Object.defineProperty(t,"magneticFluxQuantumDependencies",{enumerable:!0,get:function(){return pn.magneticFluxQuantumDependencies}}),Object.defineProperty(t,"mapDependencies",{enumerable:!0,get:function(){return mn.mapDependencies}}),Object.defineProperty(t,"mapTransformDependencies",{enumerable:!0,get:function(){return fn.mapTransformDependencies}}),Object.defineProperty(t,"matrixDependencies",{enumerable:!0,get:function(){return gn.matrixDependencies}}),Object.defineProperty(t,"matrixFromColumnsDependencies",{enumerable:!0,get:function(){return bn.matrixFromColumnsDependencies}}),Object.defineProperty(t,"matrixFromFunctionDependencies",{enumerable:!0,get:function(){return vn.matrixFromFunctionDependencies}}),Object.defineProperty(t,"matrixFromRowsDependencies",{enumerable:!0,get:function(){return _n.matrixFromRowsDependencies}}),Object.defineProperty(t,"maxDependencies",{enumerable:!0,get:function(){return xn.maxDependencies}}),Object.defineProperty(t,"maxTransformDependencies",{enumerable:!0,get:function(){return wn.maxTransformDependencies}}),Object.defineProperty(t,"meanDependencies",{enumerable:!0,get:function(){return Sn.meanDependencies}}),Object.defineProperty(t,"meanTransformDependencies",{enumerable:!0,get:function(){return Pn.meanTransformDependencies}}),Object.defineProperty(t,"medianDependencies",{enumerable:!0,get:function(){return En.medianDependencies}}),Object.defineProperty(t,"minDependencies",{enumerable:!0,get:function(){return Mn.minDependencies}}),Object.defineProperty(t,"minTransformDependencies",{enumerable:!0,get:function(){return Cn.minTransformDependencies}}),Object.defineProperty(t,"modDependencies",{enumerable:!0,get:function(){return An.modDependencies}}),Object.defineProperty(t,"modeDependencies",{enumerable:!0,get:function(){return Tn.modeDependencies}}),Object.defineProperty(t,"molarMassC12Dependencies",{enumerable:!0,get:function(){return On.molarMassC12Dependencies}}),Object.defineProperty(t,"molarMassDependencies",{enumerable:!0,get:function(){return Dn.molarMassDependencies}}),Object.defineProperty(t,"molarPlanckConstantDependencies",{enumerable:!0,get:function(){return Rn.molarPlanckConstantDependencies}}),Object.defineProperty(t,"molarVolumeDependencies",{enumerable:!0,get:function(){return Ln.molarVolumeDependencies}}),Object.defineProperty(t,"multinomialDependencies",{enumerable:!0,get:function(){return kn.multinomialDependencies}}),Object.defineProperty(t,"multiplyDependencies",{enumerable:!0,get:function(){return Nn.multiplyDependencies}}),Object.defineProperty(t,"multiplyScalarDependencies",{enumerable:!0,get:function(){return Fn.multiplyScalarDependencies}}),Object.defineProperty(t,"neutronMassDependencies",{enumerable:!0,get:function(){return Bn.neutronMassDependencies}}),Object.defineProperty(t,"normDependencies",{enumerable:!0,get:function(){return Hn.normDependencies}}),Object.defineProperty(t,"notDependencies",{enumerable:!0,get:function(){return Un.notDependencies}}),Object.defineProperty(t,"nthRootDependencies",{enumerable:!0,get:function(){return zn.nthRootDependencies}}),Object.defineProperty(t,"nthRootsDependencies",{enumerable:!0,get:function(){return Gn.nthRootsDependencies}}),Object.defineProperty(t,"nuclearMagnetonDependencies",{enumerable:!0,get:function(){return Wn.nuclearMagnetonDependencies}}),Object.defineProperty(t,"nullDependencies",{enumerable:!0,get:function(){return Vn.nullDependencies}}),Object.defineProperty(t,"numberDependencies",{enumerable:!0,get:function(){return qn.numberDependencies}}),Object.defineProperty(t,"numericDependencies",{enumerable:!0,get:function(){return $n.numericDependencies}}),Object.defineProperty(t,"octDependencies",{enumerable:!0,get:function(){return Kn.octDependencies}}),Object.defineProperty(t,"onesDependencies",{enumerable:!0,get:function(){return Xn.onesDependencies}}),Object.defineProperty(t,"orDependencies",{enumerable:!0,get:function(){return Jn.orDependencies}}),Object.defineProperty(t,"orTransformDependencies",{enumerable:!0,get:function(){return Qn.orTransformDependencies}}),Object.defineProperty(t,"parseDependencies",{enumerable:!0,get:function(){return ti.parseDependencies}}),Object.defineProperty(t,"parserDependencies",{enumerable:!0,get:function(){return ri.parserDependencies}}),Object.defineProperty(t,"partitionSelectDependencies",{enumerable:!0,get:function(){return ii.partitionSelectDependencies}}),Object.defineProperty(t,"permutationsDependencies",{enumerable:!0,get:function(){return si.permutationsDependencies}}),Object.defineProperty(t,"phiDependencies",{enumerable:!0,get:function(){return oi.phiDependencies}}),Object.defineProperty(t,"piDependencies",{enumerable:!0,get:function(){return ai.piDependencies}}),Object.defineProperty(t,"pickRandomDependencies",{enumerable:!0,get:function(){return li.pickRandomDependencies}}),Object.defineProperty(t,"pinvDependencies",{enumerable:!0,get:function(){return ci.pinvDependencies}}),Object.defineProperty(t,"planckChargeDependencies",{enumerable:!0,get:function(){return ui.planckChargeDependencies}}),Object.defineProperty(t,"planckConstantDependencies",{enumerable:!0,get:function(){return di.planckConstantDependencies}}),Object.defineProperty(t,"planckLengthDependencies",{enumerable:!0,get:function(){return hi.planckLengthDependencies}}),Object.defineProperty(t,"planckMassDependencies",{enumerable:!0,get:function(){return pi.planckMassDependencies}}),Object.defineProperty(t,"planckTemperatureDependencies",{enumerable:!0,get:function(){return mi.planckTemperatureDependencies}}),Object.defineProperty(t,"planckTimeDependencies",{enumerable:!0,get:function(){return fi.planckTimeDependencies}}),Object.defineProperty(t,"polynomialRootDependencies",{enumerable:!0,get:function(){return gi.polynomialRootDependencies}}),Object.defineProperty(t,"powDependencies",{enumerable:!0,get:function(){return yi.powDependencies}}),Object.defineProperty(t,"printDependencies",{enumerable:!0,get:function(){return bi.printDependencies}}),Object.defineProperty(t,"printTransformDependencies",{enumerable:!0,get:function(){return vi.printTransformDependencies}}),Object.defineProperty(t,"prodDependencies",{enumerable:!0,get:function(){return _i.prodDependencies}}),Object.defineProperty(t,"protonMassDependencies",{enumerable:!0,get:function(){return xi.protonMassDependencies}}),Object.defineProperty(t,"qrDependencies",{enumerable:!0,get:function(){return wi.qrDependencies}}),Object.defineProperty(t,"quantileSeqDependencies",{enumerable:!0,get:function(){return Ei.quantileSeqDependencies}}),Object.defineProperty(t,"quantileSeqTransformDependencies",{enumerable:!0,get:function(){return Ci.quantileSeqTransformDependencies}}),Object.defineProperty(t,"quantumOfCirculationDependencies",{enumerable:!0,get:function(){return Ti.quantumOfCirculationDependencies}}),Object.defineProperty(t,"randomDependencies",{enumerable:!0,get:function(){return Di.randomDependencies}}),Object.defineProperty(t,"randomIntDependencies",{enumerable:!0,get:function(){return Oi.randomIntDependencies}}),Object.defineProperty(t,"rangeDependencies",{enumerable:!0,get:function(){return Ri.rangeDependencies}}),Object.defineProperty(t,"rangeTransformDependencies",{enumerable:!0,get:function(){return ji.rangeTransformDependencies}}),Object.defineProperty(t,"rationalizeDependencies",{enumerable:!0,get:function(){return Hi.rationalizeDependencies}}),Object.defineProperty(t,"reDependencies",{enumerable:!0,get:function(){return Ui.reDependencies}}),Object.defineProperty(t,"reducedPlanckConstantDependencies",{enumerable:!0,get:function(){return zi.reducedPlanckConstantDependencies}}),Object.defineProperty(t,"replacerDependencies",{enumerable:!0,get:function(){return $i.replacerDependencies}}),Object.defineProperty(t,"reshapeDependencies",{enumerable:!0,get:function(){return Ji.reshapeDependencies}}),Object.defineProperty(t,"resizeDependencies",{enumerable:!0,get:function(){return Qi.resizeDependencies}}),Object.defineProperty(t,"resolveDependencies",{enumerable:!0,get:function(){return es.resolveDependencies}}),Object.defineProperty(t,"reviverDependencies",{enumerable:!0,get:function(){return rs.reviverDependencies}}),Object.defineProperty(t,"rightArithShiftDependencies",{enumerable:!0,get:function(){return ns.rightArithShiftDependencies}}),Object.defineProperty(t,"rightLogShiftDependencies",{enumerable:!0,get:function(){return is.rightLogShiftDependencies}}),Object.defineProperty(t,"rotateDependencies",{enumerable:!0,get:function(){return ss.rotateDependencies}}),Object.defineProperty(t,"rotationMatrixDependencies",{enumerable:!0,get:function(){return os.rotationMatrixDependencies}}),Object.defineProperty(t,"roundDependencies",{enumerable:!0,get:function(){return as.roundDependencies}}),Object.defineProperty(t,"rowDependencies",{enumerable:!0,get:function(){return ls.rowDependencies}}),Object.defineProperty(t,"rowTransformDependencies",{enumerable:!0,get:function(){return cs.rowTransformDependencies}}),Object.defineProperty(t,"rydbergDependencies",{enumerable:!0,get:function(){return us.rydbergDependencies}}),Object.defineProperty(t,"sackurTetrodeDependencies",{enumerable:!0,get:function(){return ps.sackurTetrodeDependencies}}),Object.defineProperty(t,"schurDependencies",{enumerable:!0,get:function(){return ms.schurDependencies}}),Object.defineProperty(t,"secDependencies",{enumerable:!0,get:function(){return fs.secDependencies}}),Object.defineProperty(t,"sechDependencies",{enumerable:!0,get:function(){return gs.sechDependencies}}),Object.defineProperty(t,"secondRadiationDependencies",{enumerable:!0,get:function(){return ys.secondRadiationDependencies}}),Object.defineProperty(t,"setCartesianDependencies",{enumerable:!0,get:function(){return bs.setCartesianDependencies}}),Object.defineProperty(t,"setDifferenceDependencies",{enumerable:!0,get:function(){return vs.setDifferenceDependencies}}),Object.defineProperty(t,"setDistinctDependencies",{enumerable:!0,get:function(){return _s.setDistinctDependencies}}),Object.defineProperty(t,"setIntersectDependencies",{enumerable:!0,get:function(){return xs.setIntersectDependencies}}),Object.defineProperty(t,"setIsSubsetDependencies",{enumerable:!0,get:function(){return ws.setIsSubsetDependencies}}),Object.defineProperty(t,"setMultiplicityDependencies",{enumerable:!0,get:function(){return Ss.setMultiplicityDependencies}}),Object.defineProperty(t,"setPowersetDependencies",{enumerable:!0,get:function(){return Ps.setPowersetDependencies}}),Object.defineProperty(t,"setSizeDependencies",{enumerable:!0,get:function(){return Es.setSizeDependencies}}),Object.defineProperty(t,"setSymDifferenceDependencies",{enumerable:!0,get:function(){return Ms.setSymDifferenceDependencies}}),Object.defineProperty(t,"setUnionDependencies",{enumerable:!0,get:function(){return Cs.setUnionDependencies}}),Object.defineProperty(t,"signDependencies",{enumerable:!0,get:function(){return As.signDependencies}}),Object.defineProperty(t,"simplifyConstantDependencies",{enumerable:!0,get:function(){return Ds.simplifyConstantDependencies}}),Object.defineProperty(t,"simplifyCoreDependencies",{enumerable:!0,get:function(){return Os.simplifyCoreDependencies}}),Object.defineProperty(t,"simplifyDependencies",{enumerable:!0,get:function(){return Ts.simplifyDependencies}}),Object.defineProperty(t,"sinDependencies",{enumerable:!0,get:function(){return Rs.sinDependencies}}),Object.defineProperty(t,"sinhDependencies",{enumerable:!0,get:function(){return Ls.sinhDependencies}}),Object.defineProperty(t,"sizeDependencies",{enumerable:!0,get:function(){return ks.sizeDependencies}}),Object.defineProperty(t,"sluDependencies",{enumerable:!0,get:function(){return Ns.sluDependencies}}),Object.defineProperty(t,"smallerDependencies",{enumerable:!0,get:function(){return Fs.smallerDependencies}}),Object.defineProperty(t,"smallerEqDependencies",{enumerable:!0,get:function(){return Is.smallerEqDependencies}}),Object.defineProperty(t,"solveODEDependencies",{enumerable:!0,get:function(){return Bs.solveODEDependencies}}),Object.defineProperty(t,"sortDependencies",{enumerable:!0,get:function(){return js.sortDependencies}}),Object.defineProperty(t,"sparseDependencies",{enumerable:!0,get:function(){return Us.sparseDependencies}}),Object.defineProperty(t,"speedOfLightDependencies",{enumerable:!0,get:function(){return Gs.speedOfLightDependencies}}),Object.defineProperty(t,"splitUnitDependencies",{enumerable:!0,get:function(){return Ws.splitUnitDependencies}}),Object.defineProperty(t,"sqrtDependencies",{enumerable:!0,get:function(){return Vs.sqrtDependencies}}),Object.defineProperty(t,"sqrtmDependencies",{enumerable:!0,get:function(){return qs.sqrtmDependencies}}),Object.defineProperty(t,"squareDependencies",{enumerable:!0,get:function(){return $s.squareDependencies}}),Object.defineProperty(t,"squeezeDependencies",{enumerable:!0,get:function(){return Zs.squeezeDependencies}}),Object.defineProperty(t,"stdDependencies",{enumerable:!0,get:function(){return Ks.stdDependencies}}),Object.defineProperty(t,"stdTransformDependencies",{enumerable:!0,get:function(){return Xs.stdTransformDependencies}}),Object.defineProperty(t,"stefanBoltzmannDependencies",{enumerable:!0,get:function(){return Ys.stefanBoltzmannDependencies}}),Object.defineProperty(t,"stirlingS2Dependencies",{enumerable:!0,get:function(){return Js.stirlingS2Dependencies}}),Object.defineProperty(t,"stringDependencies",{enumerable:!0,get:function(){return Qs.stringDependencies}}),Object.defineProperty(t,"subsetDependencies",{enumerable:!0,get:function(){return eo.subsetDependencies}}),Object.defineProperty(t,"subsetTransformDependencies",{enumerable:!0,get:function(){return to.subsetTransformDependencies}}),Object.defineProperty(t,"subtractDependencies",{enumerable:!0,get:function(){return ro.subtractDependencies}}),Object.defineProperty(t,"subtractScalarDependencies",{enumerable:!0,get:function(){return no.subtractScalarDependencies}}),Object.defineProperty(t,"sumDependencies",{enumerable:!0,get:function(){return io.sumDependencies}}),Object.defineProperty(t,"sumTransformDependencies",{enumerable:!0,get:function(){return so.sumTransformDependencies}}),Object.defineProperty(t,"sylvesterDependencies",{enumerable:!0,get:function(){return oo.sylvesterDependencies}}),Object.defineProperty(t,"symbolicEqualDependencies",{enumerable:!0,get:function(){return lo.symbolicEqualDependencies}}),Object.defineProperty(t,"tanDependencies",{enumerable:!0,get:function(){return co.tanDependencies}}),Object.defineProperty(t,"tanhDependencies",{enumerable:!0,get:function(){return uo.tanhDependencies}}),Object.defineProperty(t,"tauDependencies",{enumerable:!0,get:function(){return ho.tauDependencies}}),Object.defineProperty(t,"thomsonCrossSectionDependencies",{enumerable:!0,get:function(){return po.thomsonCrossSectionDependencies}}),Object.defineProperty(t,"toDependencies",{enumerable:!0,get:function(){return mo.toDependencies}}),Object.defineProperty(t,"traceDependencies",{enumerable:!0,get:function(){return fo.traceDependencies}}),Object.defineProperty(t,"transposeDependencies",{enumerable:!0,get:function(){return go.transposeDependencies}}),Object.defineProperty(t,"trueDependencies",{enumerable:!0,get:function(){return yo.trueDependencies}}),Object.defineProperty(t,"typeOfDependencies",{enumerable:!0,get:function(){return bo.typeOfDependencies}}),Object.defineProperty(t,"typedDependencies",{enumerable:!0,get:function(){return vo.typedDependencies}}),Object.defineProperty(t,"unaryMinusDependencies",{enumerable:!0,get:function(){return _o.unaryMinusDependencies}}),Object.defineProperty(t,"unaryPlusDependencies",{enumerable:!0,get:function(){return xo.unaryPlusDependencies}}),Object.defineProperty(t,"unequalDependencies",{enumerable:!0,get:function(){return wo.unequalDependencies}}),Object.defineProperty(t,"unitDependencies",{enumerable:!0,get:function(){return Po.unitDependencies}}),Object.defineProperty(t,"usolveAllDependencies",{enumerable:!0,get:function(){return Ao.usolveAllDependencies}}),Object.defineProperty(t,"usolveDependencies",{enumerable:!0,get:function(){return Co.usolveDependencies}}),Object.defineProperty(t,"vacuumImpedanceDependencies",{enumerable:!0,get:function(){return To.vacuumImpedanceDependencies}}),Object.defineProperty(t,"varianceDependencies",{enumerable:!0,get:function(){return Do.varianceDependencies}}),Object.defineProperty(t,"varianceTransformDependencies",{enumerable:!0,get:function(){return Oo.varianceTransformDependencies}}),Object.defineProperty(t,"versionDependencies",{enumerable:!0,get:function(){return Ro.versionDependencies}}),Object.defineProperty(t,"weakMixingAngleDependencies",{enumerable:!0,get:function(){return Lo.weakMixingAngleDependencies}}),Object.defineProperty(t,"wienDisplacementDependencies",{enumerable:!0,get:function(){return ko.wienDisplacementDependencies}}),Object.defineProperty(t,"xgcdDependencies",{enumerable:!0,get:function(){return No.xgcdDependencies}}),Object.defineProperty(t,"xorDependencies",{enumerable:!0,get:function(){return Fo.xorDependencies}}),Object.defineProperty(t,"zerosDependencies",{enumerable:!0,get:function(){return Io.zerosDependencies}}),Object.defineProperty(t,"zetaDependencies",{enumerable:!0,get:function(){return Bo.zetaDependencies}}),Object.defineProperty(t,"zpk2tfDependencies",{enumerable:!0,get:function(){return jo.zpk2tfDependencies}});var n=r(26077),i=r(8832),s=r(58977),o=r(51343),a=r(49168),l=r(10416),c=r(130),u=r(75851),d=r(60318),h=r(2838),p=r(73848),m=r(8124),f=r(21381),g=r(26615),y=r(26857),b=r(57384),v=r(85275),_=r(65485),x=r(10456),w=r(33688),R=r(56270),k=r(51337),j=r(42225),z=r(76311),q=r(8806),$=r(81600),Z=r(40072),X=r(31914),Y=r(62088),ee=r(10074),te=r(87868),re=r(89259),ne=r(54113),ie=r(21207),se=r(90943),oe=r(49877),ae=r(50675),le=r(19156),ce=r(29157),ue=r(35484),de=r(2228),he=r(98377),pe=r(79099),me=r(23188),fe=r(3130),ge=r(67972),ye=r(61468),be=r(62464),ve=r(49812),_e=r(41041),xe=r(91107),we=r(99951),Se=r(87734),Pe=r(8882),Te=r(24651),Re=r(59921),ke=r(80412),Ie=r(74361),je=r(3495),He=r(21951),ze=r(19367),Ge=r(77917),We=r(3577),Ve=r(9411),qe=r(65921),$e=r(93755),Xe=r(7597),Ye=r(35290),Qe=r(8510),et=r(94903),tt=r(5377),rt=r(68090),nt=r(26674),it=r(79006),st=r(55001),ot=r(24182),at=r(99698),lt=r(46403),ct=r(90574),ut=r(88545),dt=r(94483),ht=r(30619),pt=r(34593),mt=r(66666),ft=r(59776),gt=r(4339),yt=r(52676),bt=r(12028),vt=r(36304),_t=r(84704),xt=r(45242),wt=r(63882),St=r(53814),Pt=r(59895),Et=r(81150),Mt=r(38356),Ct=r(44962),At=r(40036),Tt=r(59519),Dt=r(72568),Ot=r(82725),Rt=r(40373),Lt=r(58609),kt=r(22433),Nt=r(47034),Ft=r(28642),It=r(56584),Bt=r(70106),jt=r(50165),Ht=r(13760),Ut=r(15698),zt=r(52418),Gt=r(49019),Wt=r(46581),Vt=r(52045),qt=r(9201),$t=r(62013),Zt=r(27407),Kt=r(14628),Xt=r(15042),Yt=r(93958),Jt=r(65183),Qt=r(96867),er=r(74183),tr=r(59069),rr=r(54032),nr=r(96381),ir=r(16027),sr=r(78685),or=r(28110),ar=r(44543),lr=r(69700),cr=r(13636),ur=r(52327),dr=r(13800),hr=r(92589),pr=r(74119),mr=r(40866),fr=r(62077),gr=r(24252),yr=r(94388),br=r(464),vr=r(19551),_r=r(30774),xr=r(23389),wr=r(74410),Sr=r(45457),Pr=r(79815),Er=r(90529),Mr=r(17775),Cr=r(33609),Ar=r(79923),Tr=r(80751),Dr=r(60420),Or=r(64898),Rr=r(87893),Lr=r(39134),kr=r(76363),Nr=r(8828),Fr=r(16396),Ir=r(53530),Br=r(49828),jr=r(12202),Hr=r(99201),Ur=r(21598),zr=r(92947),Gr=r(4555),Wr=r(42148),Vr=r(20265),qr=r(87429),$r=r(90722),Zr=r(19688),Kr=r(55166),Xr=r(57477),Yr=r(65286),Jr=r(84018),Qr=r(78562),en=r(26831),tn=r(89346),rn=r(6114),nn=r(79548),sn=r(19518),on=r(68660),an=r(92679),ln=r(8564),cn=r(85031),un=r(70101),dn=r(70147),hn=r(5621),pn=r(98811),mn=r(78271),fn=r(39381),gn=r(71038),yn=r(99486),bn=r(75457),vn=r(26702),_n=r(80027),xn=r(73943),wn=r(87725),Sn=r(57446),Pn=r(19710),En=r(42793),Mn=r(52485),Cn=r(39639),An=r(32054),Tn=r(74032),Dn=r(97854),On=r(60580),Rn=r(74563),Ln=r(86012),kn=r(48816),Nn=r(93879),Fn=r(81563),In=r(16360),Bn=r(57594),jn=r(82751),Hn=r(19585),Un=r(20376),zn=r(51603),Gn=r(29864),Wn=r(19136),Vn=r(51598),qn=r(18418),$n=r(70758),Zn=r(1576),Kn=r(48975),Xn=r(47598),Yn=r(66527),Jn=r(88498),Qn=r(57210),ei=r(94189),ti=r(75534),ri=r(368),ni=r(97432),ii=r(74120),si=r(78494),oi=r(77222),ai=r(43516),li=r(54425),ci=r(30264),ui=r(67442),di=r(72930),hi=r(55358),pi=r(80226),mi=r(63924),fi=r(83807),gi=r(58797),yi=r(32755),bi=r(4754),vi=r(56410),_i=r(55610),xi=r(45907),wi=r(71312),Ei=r(40125),Ci=r(77103),Ti=r(50044),Di=r(90856),Oi=r(47501),Ri=r(40820),ki=r(7116),Bi=r(8584),ji=r(77768),Hi=r(15885),Ui=r(95746),zi=r(78578),qi=r(11237),$i=r(28397),Ji=r(92419),Qi=r(63335),es=r(90045),ts=r(27610),rs=r(66084),ns=r(91781),is=r(80861),ss=r(26860),os=r(88344),as=r(87025),ls=r(89073),cs=r(8579),us=r(54864),ds=r(28409),hs=r(45701),ps=r(54059),ms=r(65724),fs=r(60936),gs=r(46984),ys=r(3702),bs=r(16097),vs=r(3134),_s=r(2753),xs=r(15442),ws=r(16139),Ss=r(20262),Ps=r(97474),Es=r(52780),Ms=r(86511),Cs=r(99060),As=r(6278),Ts=r(24124),Ds=r(57816),Os=r(42307),Rs=r(10723),Ls=r(2357),ks=r(32274),Ns=r(20831),Fs=r(84421),Is=r(15167),Bs=r(24748),js=r(23463),Hs=r(30037),Us=r(24979),zs=r(95618),Gs=r(55457),Ws=r(27519),Vs=r(18645),qs=r(60756),$s=r(59120),Zs=r(27369),Ks=r(98068),Xs=r(52200),Ys=r(70253),Js=r(50034),Qs=r(48734),eo=r(64205),to=r(12255),ro=r(81067),no=r(51623),io=r(78542),so=r(84166),oo=r(50764),ao=r(90703),lo=r(16717),co=r(94702),uo=r(69354),ho=r(25527),po=r(57566),mo=r(89126),fo=r(30468),go=r(73014),yo=r(4995),bo=r(78534),vo=r(76125),_o=r(41662),xo=r(21542),wo=r(5088),So=r(24783),Po=r(93549),Eo=r(61024),Mo=r(27398),Co=r(87053),Ao=r(74896),To=r(40988),Do=r(24032),Oo=r(53764),Ro=r(49581),Lo=r(1512),ko=r(51711),No=r(54357),Fo=r(64836),Io=r(81346),Bo=r(15321),jo=r(70306),Ho=r(23272)},26077:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.absDependencies=void 0;var n=r(76125),i=r(62882);t.absDependencies={typedDependencies:n.typedDependencies,createAbs:i.createAbs}},8832:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AccessorNodeDependencies=void 0;var n=r(82751),i=r(64205),s=r(62882);t.AccessorNodeDependencies={NodeDependencies:n.NodeDependencies,subsetDependencies:i.subsetDependencies,createAccessorNode:s.createAccessorNode}},58977:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.acosDependencies=void 0;var n=r(3495),i=r(76125),s=r(62882);t.acosDependencies={ComplexDependencies:n.ComplexDependencies,typedDependencies:i.typedDependencies,createAcos:s.createAcos}},51343:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.acoshDependencies=void 0;var n=r(3495),i=r(76125),s=r(62882);t.acoshDependencies={ComplexDependencies:n.ComplexDependencies,typedDependencies:i.typedDependencies,createAcosh:s.createAcosh}},49168:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.acotDependencies=void 0;var n=r(31914),i=r(76125),s=r(62882);t.acotDependencies={BigNumberDependencies:n.BigNumberDependencies,typedDependencies:i.typedDependencies,createAcot:s.createAcot}},10416:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.acothDependencies=void 0;var n=r(31914),i=r(3495),s=r(76125),o=r(62882);t.acothDependencies={BigNumberDependencies:n.BigNumberDependencies,ComplexDependencies:i.ComplexDependencies,typedDependencies:s.typedDependencies,createAcoth:o.createAcoth}},130:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.acscDependencies=void 0;var n=r(31914),i=r(3495),s=r(76125),o=r(62882);t.acscDependencies={BigNumberDependencies:n.BigNumberDependencies,ComplexDependencies:i.ComplexDependencies,typedDependencies:s.typedDependencies,createAcsc:o.createAcsc}},75851:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.acschDependencies=void 0;var n=r(31914),i=r(76125),s=r(62882);t.acschDependencies={BigNumberDependencies:n.BigNumberDependencies,typedDependencies:i.typedDependencies,createAcsch:s.createAcsch}},60318:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addDependencies=void 0;var n=r(34593),i=r(95618),s=r(2838),o=r(19367),a=r(22433),l=r(71038),c=r(76125),u=r(62882);t.addDependencies={DenseMatrixDependencies:n.DenseMatrixDependencies,SparseMatrixDependencies:i.SparseMatrixDependencies,addScalarDependencies:s.addScalarDependencies,concatDependencies:o.concatDependencies,equalScalarDependencies:a.equalScalarDependencies,matrixDependencies:l.matrixDependencies,typedDependencies:c.typedDependencies,createAdd:u.createAdd}},2838:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addScalarDependencies=void 0;var n=r(76125),i=r(62882);t.addScalarDependencies={typedDependencies:n.typedDependencies,createAddScalar:i.createAddScalar}},73848:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.andDependencies=void 0;var n=r(19367),i=r(22433),s=r(71038),o=r(20376),a=r(76125),l=r(81346),c=r(62882);t.andDependencies={concatDependencies:n.concatDependencies,equalScalarDependencies:i.equalScalarDependencies,matrixDependencies:s.matrixDependencies,notDependencies:o.notDependencies,typedDependencies:a.typedDependencies,zerosDependencies:l.zerosDependencies,createAnd:c.createAnd}},8124:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.andTransformDependencies=void 0;var n=r(60318),i=r(19367),s=r(22433),o=r(71038),a=r(20376),l=r(76125),c=r(81346),u=r(62882);t.andTransformDependencies={addDependencies:n.addDependencies,concatDependencies:i.concatDependencies,equalScalarDependencies:s.equalScalarDependencies,matrixDependencies:o.matrixDependencies,notDependencies:a.notDependencies,typedDependencies:l.typedDependencies,zerosDependencies:c.zerosDependencies,createAndTransform:u.createAndTransform}},21381:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.applyDependencies=void 0;var n=r(76363),i=r(76125),s=r(62882);t.applyDependencies={isIntegerDependencies:n.isIntegerDependencies,typedDependencies:i.typedDependencies,createApply:s.createApply}},26615:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.applyTransformDependencies=void 0;var n=r(76363),i=r(76125),s=r(62882);t.applyTransformDependencies={isIntegerDependencies:n.isIntegerDependencies,typedDependencies:i.typedDependencies,createApplyTransform:s.createApplyTransform}},26857:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.argDependencies=void 0;var n=r(76125),i=r(62882);t.argDependencies={typedDependencies:n.typedDependencies,createArg:i.createArg}},57384:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArrayNodeDependencies=void 0;var n=r(82751),i=r(62882);t.ArrayNodeDependencies={NodeDependencies:n.NodeDependencies,createArrayNode:i.createArrayNode}},85275:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.asecDependencies=void 0;var n=r(31914),i=r(3495),s=r(76125),o=r(62882);t.asecDependencies={BigNumberDependencies:n.BigNumberDependencies,ComplexDependencies:i.ComplexDependencies,typedDependencies:s.typedDependencies,createAsec:o.createAsec}},65485:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.asechDependencies=void 0;var n=r(31914),i=r(3495),s=r(76125),o=r(62882);t.asechDependencies={BigNumberDependencies:n.BigNumberDependencies,ComplexDependencies:i.ComplexDependencies,typedDependencies:s.typedDependencies,createAsech:o.createAsech}},10456:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.asinDependencies=void 0;var n=r(3495),i=r(76125),s=r(62882);t.asinDependencies={ComplexDependencies:n.ComplexDependencies,typedDependencies:i.typedDependencies,createAsin:s.createAsin}},33688:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.asinhDependencies=void 0;var n=r(76125),i=r(62882);t.asinhDependencies={typedDependencies:n.typedDependencies,createAsinh:i.createAsinh}},56270:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AssignmentNodeDependencies=void 0;var n=r(71038),i=r(82751),s=r(64205),o=r(62882);t.AssignmentNodeDependencies={matrixDependencies:n.matrixDependencies,NodeDependencies:i.NodeDependencies,subsetDependencies:s.subsetDependencies,createAssignmentNode:o.createAssignmentNode}},51337:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.atanDependencies=void 0;var n=r(76125),i=r(62882);t.atanDependencies={typedDependencies:n.typedDependencies,createAtan:i.createAtan}},42225:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.atan2Dependencies=void 0;var n=r(31914),i=r(34593),s=r(19367),o=r(22433),a=r(71038),l=r(76125),c=r(62882);t.atan2Dependencies={BigNumberDependencies:n.BigNumberDependencies,DenseMatrixDependencies:i.DenseMatrixDependencies,concatDependencies:s.concatDependencies,equalScalarDependencies:o.equalScalarDependencies,matrixDependencies:a.matrixDependencies,typedDependencies:l.typedDependencies,createAtan2:c.createAtan2}},76311:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.atanhDependencies=void 0;var n=r(3495),i=r(76125),s=r(62882);t.atanhDependencies={ComplexDependencies:n.ComplexDependencies,typedDependencies:i.typedDependencies,createAtanh:s.createAtanh}},8806:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.atomicMassDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.atomicMassDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createAtomicMass:s.createAtomicMass}},81600:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.avogadroDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.avogadroDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createAvogadro:s.createAvogadro}},40072:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bellNumbersDependencies=void 0;var n=r(2838),i=r(76363),s=r(16396),o=r(50034),a=r(76125),l=r(62882);t.bellNumbersDependencies={addScalarDependencies:n.addScalarDependencies,isIntegerDependencies:i.isIntegerDependencies,isNegativeDependencies:s.isNegativeDependencies,stirlingS2Dependencies:o.stirlingS2Dependencies,typedDependencies:a.typedDependencies,createBellNumbers:l.createBellNumbers}},31914:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BigNumberDependencies=void 0;var n=r(62882);t.BigNumberDependencies={createBigNumberClass:n.createBigNumberClass}},62088:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bigintDependencies=void 0;var n=r(76125),i=r(62882);t.bigintDependencies={typedDependencies:n.typedDependencies,createBigint:i.createBigint}},10074:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bignumberDependencies=void 0;var n=r(31914),i=r(76125),s=r(62882);t.bignumberDependencies={BigNumberDependencies:n.BigNumberDependencies,typedDependencies:i.typedDependencies,createBignumber:s.createBignumber}},87868:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.binDependencies=void 0;var n=r(54032),i=r(76125),s=r(62882);t.binDependencies={formatDependencies:n.formatDependencies,typedDependencies:i.typedDependencies,createBin:s.createBin}},89259:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bitAndDependencies=void 0;var n=r(19367),i=r(22433),s=r(71038),o=r(76125),a=r(62882);t.bitAndDependencies={concatDependencies:n.concatDependencies,equalScalarDependencies:i.equalScalarDependencies,matrixDependencies:s.matrixDependencies,typedDependencies:o.typedDependencies,createBitAnd:a.createBitAnd}},54113:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bitAndTransformDependencies=void 0;var n=r(60318),i=r(19367),s=r(22433),o=r(71038),a=r(20376),l=r(76125),c=r(81346),u=r(62882);t.bitAndTransformDependencies={addDependencies:n.addDependencies,concatDependencies:i.concatDependencies,equalScalarDependencies:s.equalScalarDependencies,matrixDependencies:o.matrixDependencies,notDependencies:a.notDependencies,typedDependencies:l.typedDependencies,zerosDependencies:c.zerosDependencies,createBitAndTransform:u.createBitAndTransform}},21207:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bitNotDependencies=void 0;var n=r(76125),i=r(62882);t.bitNotDependencies={typedDependencies:n.typedDependencies,createBitNot:i.createBitNot}},90943:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bitOrDependencies=void 0;var n=r(34593),i=r(19367),s=r(22433),o=r(71038),a=r(76125),l=r(62882);t.bitOrDependencies={DenseMatrixDependencies:n.DenseMatrixDependencies,concatDependencies:i.concatDependencies,equalScalarDependencies:s.equalScalarDependencies,matrixDependencies:o.matrixDependencies,typedDependencies:a.typedDependencies,createBitOr:l.createBitOr}},49877:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bitOrTransformDependencies=void 0;var n=r(34593),i=r(19367),s=r(22433),o=r(71038),a=r(76125),l=r(62882);t.bitOrTransformDependencies={DenseMatrixDependencies:n.DenseMatrixDependencies,concatDependencies:i.concatDependencies,equalScalarDependencies:s.equalScalarDependencies,matrixDependencies:o.matrixDependencies,typedDependencies:a.typedDependencies,createBitOrTransform:l.createBitOrTransform}},50675:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bitXorDependencies=void 0;var n=r(34593),i=r(19367),s=r(71038),o=r(76125),a=r(62882);t.bitXorDependencies={DenseMatrixDependencies:n.DenseMatrixDependencies,concatDependencies:i.concatDependencies,matrixDependencies:s.matrixDependencies,typedDependencies:o.typedDependencies,createBitXor:a.createBitXor}},19156:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BlockNodeDependencies=void 0;var n=r(82751),i=r(27610),s=r(62882);t.BlockNodeDependencies={NodeDependencies:n.NodeDependencies,ResultSetDependencies:i.ResultSetDependencies,createBlockNode:s.createBlockNode}},29157:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bohrMagnetonDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.bohrMagnetonDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createBohrMagneton:s.createBohrMagneton}},35484:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bohrRadiusDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.bohrRadiusDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createBohrRadius:s.createBohrRadius}},2228:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boltzmannDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.boltzmannDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createBoltzmann:s.createBoltzmann}},98377:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.booleanDependencies=void 0;var n=r(76125),i=r(62882);t.booleanDependencies={typedDependencies:n.typedDependencies,createBoolean:i.createBoolean}},79099:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.catalanDependencies=void 0;var n=r(2838),i=r(99951),s=r(63882),o=r(76363),a=r(16396),l=r(81563),c=r(76125),u=r(62882);t.catalanDependencies={addScalarDependencies:n.addScalarDependencies,combinationsDependencies:i.combinationsDependencies,divideScalarDependencies:s.divideScalarDependencies,isIntegerDependencies:o.isIntegerDependencies,isNegativeDependencies:a.isNegativeDependencies,multiplyScalarDependencies:l.multiplyScalarDependencies,typedDependencies:c.typedDependencies,createCatalan:u.createCatalan}},23188:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cbrtDependencies=void 0;var n=r(31914),i=r(3495),s=r(16027),o=r(16396),a=r(71038),l=r(76125),c=r(41662),u=r(62882);t.cbrtDependencies={BigNumberDependencies:n.BigNumberDependencies,ComplexDependencies:i.ComplexDependencies,FractionDependencies:s.FractionDependencies,isNegativeDependencies:o.isNegativeDependencies,matrixDependencies:a.matrixDependencies,typedDependencies:l.typedDependencies,unaryMinusDependencies:c.unaryMinusDependencies,createCbrt:u.createCbrt}},3130:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ceilDependencies=void 0;var n=r(34593),i=r(22433),s=r(71038),o=r(87025),a=r(76125),l=r(81346),c=r(62882);t.ceilDependencies={DenseMatrixDependencies:n.DenseMatrixDependencies,equalScalarDependencies:i.equalScalarDependencies,matrixDependencies:s.matrixDependencies,roundDependencies:o.roundDependencies,typedDependencies:a.typedDependencies,zerosDependencies:l.zerosDependencies,createCeil:c.createCeil}},67972:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.chainDependencies=void 0;var n=r(61468),i=r(76125),s=r(62882);t.chainDependencies={ChainDependencies:n.ChainDependencies,typedDependencies:i.typedDependencies,createChain:s.createChain}},61468:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChainDependencies=void 0;var n=r(76125),i=r(62882);t.ChainDependencies={typedDependencies:n.typedDependencies,createChainClass:i.createChainClass}},62464:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.classicalElectronRadiusDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.classicalElectronRadiusDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createClassicalElectronRadius:s.createClassicalElectronRadius}},49812:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cloneDependencies=void 0;var n=r(76125),i=r(62882);t.cloneDependencies={typedDependencies:n.typedDependencies,createClone:i.createClone}},41041:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.columnDependencies=void 0;var n=r(17775),i=r(71038),s=r(40820),o=r(76125),a=r(62882);t.columnDependencies={IndexDependencies:n.IndexDependencies,matrixDependencies:i.matrixDependencies,rangeDependencies:s.rangeDependencies,typedDependencies:o.typedDependencies,createColumn:a.createColumn}},91107:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.columnTransformDependencies=void 0;var n=r(17775),i=r(71038),s=r(40820),o=r(76125),a=r(62882);t.columnTransformDependencies={IndexDependencies:n.IndexDependencies,matrixDependencies:i.matrixDependencies,rangeDependencies:s.rangeDependencies,typedDependencies:o.typedDependencies,createColumnTransform:a.createColumnTransform}},99951:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combinationsDependencies=void 0;var n=r(76125),i=r(62882);t.combinationsDependencies={typedDependencies:n.typedDependencies,createCombinations:i.createCombinations}},87734:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combinationsWithRepDependencies=void 0;var n=r(76125),i=r(62882);t.combinationsWithRepDependencies={typedDependencies:n.typedDependencies,createCombinationsWithRep:i.createCombinationsWithRep}},8882:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compareDependencies=void 0;var n=r(31914),i=r(34593),s=r(16027),o=r(19367),a=r(22433),l=r(71038),c=r(76125),u=r(62882);t.compareDependencies={BigNumberDependencies:n.BigNumberDependencies,DenseMatrixDependencies:i.DenseMatrixDependencies,FractionDependencies:s.FractionDependencies,concatDependencies:o.concatDependencies,equalScalarDependencies:a.equalScalarDependencies,matrixDependencies:l.matrixDependencies,typedDependencies:c.typedDependencies,createCompare:u.createCompare}},24651:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compareNaturalDependencies=void 0;var n=r(8882),i=r(76125),s=r(62882);t.compareNaturalDependencies={compareDependencies:n.compareDependencies,typedDependencies:i.typedDependencies,createCompareNatural:s.createCompareNatural}},59921:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compareTextDependencies=void 0;var n=r(19367),i=r(71038),s=r(76125),o=r(62882);t.compareTextDependencies={concatDependencies:n.concatDependencies,matrixDependencies:i.matrixDependencies,typedDependencies:s.typedDependencies,createCompareText:o.createCompareText}},80412:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compileDependencies=void 0;var n=r(75534),i=r(76125),s=r(62882);t.compileDependencies={parseDependencies:n.parseDependencies,typedDependencies:i.typedDependencies,createCompile:s.createCompile}},74361:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.complexDependencies=void 0;var n=r(3495),i=r(76125),s=r(62882);t.complexDependencies={ComplexDependencies:n.ComplexDependencies,typedDependencies:i.typedDependencies,createComplex:s.createComplex}},3495:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ComplexDependencies=void 0;var n=r(62882);t.ComplexDependencies={createComplexClass:n.createComplexClass}},21951:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compositionDependencies=void 0;var n=r(2838),i=r(99951),s=r(76363),o=r(16396),a=r(49828),l=r(19688),c=r(76125),u=r(62882);t.compositionDependencies={addScalarDependencies:n.addScalarDependencies,combinationsDependencies:i.combinationsDependencies,isIntegerDependencies:s.isIntegerDependencies,isNegativeDependencies:o.isNegativeDependencies,isPositiveDependencies:a.isPositiveDependencies,largerDependencies:l.largerDependencies,typedDependencies:c.typedDependencies,createComposition:u.createComposition}},19367:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatDependencies=void 0;var n=r(76363),i=r(71038),s=r(76125),o=r(62882);t.concatDependencies={isIntegerDependencies:n.isIntegerDependencies,matrixDependencies:i.matrixDependencies,typedDependencies:s.typedDependencies,createConcat:o.createConcat}},77917:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatTransformDependencies=void 0;var n=r(76363),i=r(71038),s=r(76125),o=r(62882);t.concatTransformDependencies={isIntegerDependencies:n.isIntegerDependencies,matrixDependencies:i.matrixDependencies,typedDependencies:s.typedDependencies,createConcatTransform:o.createConcatTransform}},3577:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConditionalNodeDependencies=void 0;var n=r(82751),i=r(62882);t.ConditionalNodeDependencies={NodeDependencies:n.NodeDependencies,createConditionalNode:i.createConditionalNode}},9411:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.conductanceQuantumDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.conductanceQuantumDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createConductanceQuantum:s.createConductanceQuantum}},65921:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.conjDependencies=void 0;var n=r(76125),i=r(62882);t.conjDependencies={typedDependencies:n.typedDependencies,createConj:i.createConj}},93755:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConstantNodeDependencies=void 0;var n=r(82751),i=r(62882);t.ConstantNodeDependencies={NodeDependencies:n.NodeDependencies,createConstantNode:i.createConstantNode}},7597:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.corrDependencies=void 0;var n=r(60318),i=r(45242),s=r(71038),o=r(57446),a=r(93879),l=r(32755),c=r(18645),u=r(81067),d=r(78542),h=r(76125),p=r(62882);t.corrDependencies={addDependencies:n.addDependencies,divideDependencies:i.divideDependencies,matrixDependencies:s.matrixDependencies,meanDependencies:o.meanDependencies,multiplyDependencies:a.multiplyDependencies,powDependencies:l.powDependencies,sqrtDependencies:c.sqrtDependencies,subtractDependencies:u.subtractDependencies,sumDependencies:d.sumDependencies,typedDependencies:h.typedDependencies,createCorr:p.createCorr}},35290:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cosDependencies=void 0;var n=r(76125),i=r(62882);t.cosDependencies={typedDependencies:n.typedDependencies,createCos:i.createCos}},8510:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.coshDependencies=void 0;var n=r(76125),i=r(62882);t.coshDependencies={typedDependencies:n.typedDependencies,createCosh:i.createCosh}},94903:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cotDependencies=void 0;var n=r(31914),i=r(76125),s=r(62882);t.cotDependencies={BigNumberDependencies:n.BigNumberDependencies,typedDependencies:i.typedDependencies,createCot:s.createCot}},5377:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cothDependencies=void 0;var n=r(31914),i=r(76125),s=r(62882);t.cothDependencies={BigNumberDependencies:n.BigNumberDependencies,typedDependencies:i.typedDependencies,createCoth:s.createCoth}},68090:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.coulombDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.coulombDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createCoulomb:s.createCoulomb}},26674:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.countDependencies=void 0;var n=r(55610),i=r(32274),s=r(76125),o=r(62882);t.countDependencies={prodDependencies:n.prodDependencies,sizeDependencies:i.sizeDependencies,typedDependencies:s.typedDependencies,createCount:o.createCount}},79006:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createUnitDependencies=void 0;var n=r(24783),i=r(76125),s=r(62882);t.createUnitDependencies={UnitDependencies:n.UnitDependencies,typedDependencies:i.typedDependencies,createCreateUnit:s.createCreateUnit}},55001:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crossDependencies=void 0;var n=r(71038),i=r(93879),s=r(81067),o=r(76125),a=r(62882);t.crossDependencies={matrixDependencies:n.matrixDependencies,multiplyDependencies:i.multiplyDependencies,subtractDependencies:s.subtractDependencies,typedDependencies:o.typedDependencies,createCross:a.createCross}},24182:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cscDependencies=void 0;var n=r(31914),i=r(76125),s=r(62882);t.cscDependencies={BigNumberDependencies:n.BigNumberDependencies,typedDependencies:i.typedDependencies,createCsc:s.createCsc}},99698:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cschDependencies=void 0;var n=r(31914),i=r(76125),s=r(62882);t.cschDependencies={BigNumberDependencies:n.BigNumberDependencies,typedDependencies:i.typedDependencies,createCsch:s.createCsch}},46403:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ctransposeDependencies=void 0;var n=r(65921),i=r(73014),s=r(76125),o=r(62882);t.ctransposeDependencies={conjDependencies:n.conjDependencies,transposeDependencies:i.transposeDependencies,typedDependencies:s.typedDependencies,createCtranspose:o.createCtranspose}},90574:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cubeDependencies=void 0;var n=r(76125),i=r(62882);t.cubeDependencies={typedDependencies:n.typedDependencies,createCube:i.createCube}},88545:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cumsumDependencies=void 0;var n=r(60318),i=r(76125),s=r(21542),o=r(62882);t.cumsumDependencies={addDependencies:n.addDependencies,typedDependencies:i.typedDependencies,unaryPlusDependencies:s.unaryPlusDependencies,createCumSum:o.createCumSum}},94483:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cumsumTransformDependencies=void 0;var n=r(60318),i=r(76125),s=r(21542),o=r(62882);t.cumsumTransformDependencies={addDependencies:n.addDependencies,typedDependencies:i.typedDependencies,unaryPlusDependencies:s.unaryPlusDependencies,createCumSumTransform:o.createCumSumTransform}},30619:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deepEqualDependencies=void 0;var n=r(58609),i=r(76125),s=r(62882);t.deepEqualDependencies={equalDependencies:n.equalDependencies,typedDependencies:i.typedDependencies,createDeepEqual:s.createDeepEqual}},34593:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DenseMatrixDependencies=void 0;var n=r(99486),i=r(62882);t.DenseMatrixDependencies={MatrixDependencies:n.MatrixDependencies,createDenseMatrixClass:i.createDenseMatrixClass}},66666:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.derivativeDependencies=void 0;var n=r(93755),i=r(44543),s=r(66527),o=r(94189),a=r(90703),l=r(58609),c=r(99201),u=r(70758),d=r(75534),h=r(24124),p=r(76125),m=r(62882);t.derivativeDependencies={ConstantNodeDependencies:n.ConstantNodeDependencies,FunctionNodeDependencies:i.FunctionNodeDependencies,OperatorNodeDependencies:s.OperatorNodeDependencies,ParenthesisNodeDependencies:o.ParenthesisNodeDependencies,SymbolNodeDependencies:a.SymbolNodeDependencies,equalDependencies:l.equalDependencies,isZeroDependencies:c.isZeroDependencies,numericDependencies:u.numericDependencies,parseDependencies:d.parseDependencies,simplifyDependencies:h.simplifyDependencies,typedDependencies:p.typedDependencies,createDerivative:m.createDerivative}},59776:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.detDependencies=void 0;var n=r(63882),i=r(99201),s=r(71038),o=r(93879),a=r(51623),l=r(76125),c=r(41662),u=r(62882);t.detDependencies={divideScalarDependencies:n.divideScalarDependencies,isZeroDependencies:i.isZeroDependencies,matrixDependencies:s.matrixDependencies,multiplyDependencies:o.multiplyDependencies,subtractScalarDependencies:a.subtractScalarDependencies,typedDependencies:l.typedDependencies,unaryMinusDependencies:c.unaryMinusDependencies,createDet:u.createDet}},4339:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deuteronMassDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.deuteronMassDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createDeuteronMass:s.createDeuteronMass}},52676:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.diagDependencies=void 0;var n=r(34593),i=r(95618),s=r(71038),o=r(76125),a=r(62882);t.diagDependencies={DenseMatrixDependencies:n.DenseMatrixDependencies,SparseMatrixDependencies:i.SparseMatrixDependencies,matrixDependencies:s.matrixDependencies,typedDependencies:o.typedDependencies,createDiag:a.createDiag}},12028:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.diffDependencies=void 0;var n=r(71038),i=r(18418),s=r(81067),o=r(76125),a=r(62882);t.diffDependencies={matrixDependencies:n.matrixDependencies,numberDependencies:i.numberDependencies,subtractDependencies:s.subtractDependencies,typedDependencies:o.typedDependencies,createDiff:a.createDiff}},36304:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.diffTransformDependencies=void 0;var n=r(10074),i=r(71038),s=r(18418),o=r(81067),a=r(76125),l=r(62882);t.diffTransformDependencies={bignumberDependencies:n.bignumberDependencies,matrixDependencies:i.matrixDependencies,numberDependencies:s.numberDependencies,subtractDependencies:o.subtractDependencies,typedDependencies:a.typedDependencies,createDiffTransform:l.createDiffTransform}},84704:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.distanceDependencies=void 0;var n=r(26077),i=r(2838),s=r(30619),o=r(63882),a=r(81563),l=r(18645),c=r(51623),u=r(76125),d=r(62882);t.distanceDependencies={absDependencies:n.absDependencies,addScalarDependencies:i.addScalarDependencies,deepEqualDependencies:s.deepEqualDependencies,divideScalarDependencies:o.divideScalarDependencies,multiplyScalarDependencies:a.multiplyScalarDependencies,sqrtDependencies:l.sqrtDependencies,subtractScalarDependencies:c.subtractScalarDependencies,typedDependencies:u.typedDependencies,createDistance:d.createDistance}},45242:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.divideDependencies=void 0;var n=r(63882),i=r(22433),s=r(64898),o=r(71038),a=r(93879),l=r(76125),c=r(62882);t.divideDependencies={divideScalarDependencies:n.divideScalarDependencies,equalScalarDependencies:i.equalScalarDependencies,invDependencies:s.invDependencies,matrixDependencies:o.matrixDependencies,multiplyDependencies:a.multiplyDependencies,typedDependencies:l.typedDependencies,createDivide:c.createDivide}},63882:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.divideScalarDependencies=void 0;var n=r(70758),i=r(76125),s=r(62882);t.divideScalarDependencies={numericDependencies:n.numericDependencies,typedDependencies:i.typedDependencies,createDivideScalar:s.createDivideScalar}},53814:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dotDependencies=void 0;var n=r(2838),i=r(65921),s=r(81563),o=r(32274),a=r(76125),l=r(62882);t.dotDependencies={addScalarDependencies:n.addScalarDependencies,conjDependencies:i.conjDependencies,multiplyScalarDependencies:s.multiplyScalarDependencies,sizeDependencies:o.sizeDependencies,typedDependencies:a.typedDependencies,createDot:l.createDot}},59895:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dotDivideDependencies=void 0;var n=r(34593),i=r(19367),s=r(63882),o=r(22433),a=r(71038),l=r(76125),c=r(62882);t.dotDivideDependencies={DenseMatrixDependencies:n.DenseMatrixDependencies,concatDependencies:i.concatDependencies,divideScalarDependencies:s.divideScalarDependencies,equalScalarDependencies:o.equalScalarDependencies,matrixDependencies:a.matrixDependencies,typedDependencies:l.typedDependencies,createDotDivide:c.createDotDivide}},81150:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dotMultiplyDependencies=void 0;var n=r(19367),i=r(22433),s=r(71038),o=r(81563),a=r(76125),l=r(62882);t.dotMultiplyDependencies={concatDependencies:n.concatDependencies,equalScalarDependencies:i.equalScalarDependencies,matrixDependencies:s.matrixDependencies,multiplyScalarDependencies:o.multiplyScalarDependencies,typedDependencies:a.typedDependencies,createDotMultiply:l.createDotMultiply}},38356:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dotPowDependencies=void 0;var n=r(34593),i=r(19367),s=r(22433),o=r(71038),a=r(32755),l=r(76125),c=r(62882);t.dotPowDependencies={DenseMatrixDependencies:n.DenseMatrixDependencies,concatDependencies:i.concatDependencies,equalScalarDependencies:s.equalScalarDependencies,matrixDependencies:o.matrixDependencies,powDependencies:a.powDependencies,typedDependencies:l.typedDependencies,createDotPow:c.createDotPow}},44962:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.eDependencies=void 0;var n=r(31914),i=r(62882);t.eDependencies={BigNumberDependencies:n.BigNumberDependencies,createE:i.createE}},40036:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.efimovFactorDependencies=void 0;var n=r(31914),i=r(62882);t.efimovFactorDependencies={BigNumberDependencies:n.BigNumberDependencies,createEfimovFactor:i.createEfimovFactor}},59519:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.eigsDependencies=void 0;var n=r(26077),i=r(60318),s=r(2838),o=r(51337),a=r(10074),l=r(41041),c=r(74361),u=r(35290),d=r(52676),h=r(63882),p=r(53814),m=r(58609),f=r(65183),g=r(45457),y=r(64898),b=r(19688),v=r(71038),_=r(75457),x=r(93879),w=r(81563),R=r(18418),k=r(71312),j=r(95746),z=r(92419),q=r(10723),$=r(32274),Z=r(84421),X=r(18645),Y=r(81067),ee=r(76125),te=r(87053),re=r(74896),ne=r(62882);t.eigsDependencies={absDependencies:n.absDependencies,addDependencies:i.addDependencies,addScalarDependencies:s.addScalarDependencies,atanDependencies:o.atanDependencies,bignumberDependencies:a.bignumberDependencies,columnDependencies:l.columnDependencies,complexDependencies:c.complexDependencies,cosDependencies:u.cosDependencies,diagDependencies:d.diagDependencies,divideScalarDependencies:h.divideScalarDependencies,dotDependencies:p.dotDependencies,equalDependencies:m.equalDependencies,flattenDependencies:f.flattenDependencies,imDependencies:g.imDependencies,invDependencies:y.invDependencies,largerDependencies:b.largerDependencies,matrixDependencies:v.matrixDependencies,matrixFromColumnsDependencies:_.matrixFromColumnsDependencies,multiplyDependencies:x.multiplyDependencies,multiplyScalarDependencies:w.multiplyScalarDependencies,numberDependencies:R.numberDependencies,qrDependencies:k.qrDependencies,reDependencies:j.reDependencies,reshapeDependencies:z.reshapeDependencies,sinDependencies:q.sinDependencies,sizeDependencies:$.sizeDependencies,smallerDependencies:Z.smallerDependencies,sqrtDependencies:X.sqrtDependencies,subtractDependencies:Y.subtractDependencies,typedDependencies:ee.typedDependencies,usolveDependencies:te.usolveDependencies,usolveAllDependencies:re.usolveAllDependencies,createEigs:ne.createEigs}},72568:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.electricConstantDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.electricConstantDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createElectricConstant:s.createElectricConstant}},82725:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.electronMassDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.electronMassDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createElectronMass:s.createElectronMass}},40373:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.elementaryChargeDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.elementaryChargeDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createElementaryCharge:s.createElementaryCharge}},58609:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.equalDependencies=void 0;var n=r(34593),i=r(19367),s=r(22433),o=r(71038),a=r(76125),l=r(62882);t.equalDependencies={DenseMatrixDependencies:n.DenseMatrixDependencies,concatDependencies:i.concatDependencies,equalScalarDependencies:s.equalScalarDependencies,matrixDependencies:o.matrixDependencies,typedDependencies:a.typedDependencies,createEqual:l.createEqual}},22433:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.equalScalarDependencies=void 0;var n=r(76125),i=r(62882);t.equalScalarDependencies={typedDependencies:n.typedDependencies,createEqualScalar:i.createEqualScalar}},47034:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.equalTextDependencies=void 0;var n=r(59921),i=r(99201),s=r(76125),o=r(62882);t.equalTextDependencies={compareTextDependencies:n.compareTextDependencies,isZeroDependencies:i.isZeroDependencies,typedDependencies:s.typedDependencies,createEqualText:o.createEqualText}},28642:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.erfDependencies=void 0;var n=r(76125),i=r(62882);t.erfDependencies={typedDependencies:n.typedDependencies,createErf:i.createErf}},56584:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateDependencies=void 0;var n=r(75534),i=r(76125),s=r(62882);t.evaluateDependencies={parseDependencies:n.parseDependencies,typedDependencies:i.typedDependencies,createEvaluate:s.createEvaluate}},70106:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.expDependencies=void 0;var n=r(76125),i=r(62882);t.expDependencies={typedDependencies:n.typedDependencies,createExp:i.createExp}},50165:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.expmDependencies=void 0;var n=r(26077),i=r(60318),s=r(23389),o=r(64898),a=r(93879),l=r(76125),c=r(62882);t.expmDependencies={absDependencies:n.absDependencies,addDependencies:i.addDependencies,identityDependencies:s.identityDependencies,invDependencies:o.invDependencies,multiplyDependencies:a.multiplyDependencies,typedDependencies:l.typedDependencies,createExpm:c.createExpm}},13760:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.expm1Dependencies=void 0;var n=r(3495),i=r(76125),s=r(62882);t.expm1Dependencies={ComplexDependencies:n.ComplexDependencies,typedDependencies:i.typedDependencies,createExpm1:s.createExpm1}},15698:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.factorialDependencies=void 0;var n=r(69700),i=r(76125),s=r(62882);t.factorialDependencies={gammaDependencies:n.gammaDependencies,typedDependencies:i.typedDependencies,createFactorial:s.createFactorial}},52418:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.falseDependencies=void 0;var n=r(62882);t.falseDependencies={createFalse:n.createFalse}},49019:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.faradayDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.faradayDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createFaraday:s.createFaraday}},46581:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fermiCouplingDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.fermiCouplingDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createFermiCoupling:s.createFermiCoupling}},52045:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fftDependencies=void 0;var n=r(2838),i=r(3130),s=r(65921),o=r(63882),a=r(59895),l=r(70106),c=r(30774),u=r(79548),d=r(71038),h=r(81563),p=r(32755),m=r(25527),f=r(76125),g=r(62882);t.fftDependencies={addScalarDependencies:n.addScalarDependencies,ceilDependencies:i.ceilDependencies,conjDependencies:s.conjDependencies,divideScalarDependencies:o.divideScalarDependencies,dotDivideDependencies:a.dotDivideDependencies,expDependencies:l.expDependencies,iDependencies:c.iDependencies,log2Dependencies:u.log2Dependencies,matrixDependencies:d.matrixDependencies,multiplyScalarDependencies:h.multiplyScalarDependencies,powDependencies:p.powDependencies,tauDependencies:m.tauDependencies,typedDependencies:f.typedDependencies,createFft:g.createFft}},9201:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FibonacciHeapDependencies=void 0;var n=r(19688),i=r(84421),s=r(62882);t.FibonacciHeapDependencies={largerDependencies:n.largerDependencies,smallerDependencies:i.smallerDependencies,createFibonacciHeapClass:s.createFibonacciHeapClass}},62013:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.filterDependencies=void 0;var n=r(76125),i=r(62882);t.filterDependencies={typedDependencies:n.typedDependencies,createFilter:i.createFilter}},27407:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.filterTransformDependencies=void 0;var n=r(76125),i=r(62882);t.filterTransformDependencies={typedDependencies:n.typedDependencies,createFilterTransform:i.createFilterTransform}},14628:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fineStructureDependencies=void 0;var n=r(31914),i=r(62882);t.fineStructureDependencies={BigNumberDependencies:n.BigNumberDependencies,createFineStructure:i.createFineStructure}},15042:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.firstRadiationDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.firstRadiationDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createFirstRadiation:s.createFirstRadiation}},93958:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fixDependencies=void 0;var n=r(3495),i=r(34593),s=r(3130),o=r(22433),a=r(96867),l=r(71038),c=r(76125),u=r(81346),d=r(62882);t.fixDependencies={ComplexDependencies:n.ComplexDependencies,DenseMatrixDependencies:i.DenseMatrixDependencies,ceilDependencies:s.ceilDependencies,equalScalarDependencies:o.equalScalarDependencies,floorDependencies:a.floorDependencies,matrixDependencies:l.matrixDependencies,typedDependencies:c.typedDependencies,zerosDependencies:u.zerosDependencies,createFix:d.createFix}},65183:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flattenDependencies=void 0;var n=r(76125),i=r(62882);t.flattenDependencies={typedDependencies:n.typedDependencies,createFlatten:i.createFlatten}},96867:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.floorDependencies=void 0;var n=r(34593),i=r(22433),s=r(71038),o=r(87025),a=r(76125),l=r(81346),c=r(62882);t.floorDependencies={DenseMatrixDependencies:n.DenseMatrixDependencies,equalScalarDependencies:i.equalScalarDependencies,matrixDependencies:s.matrixDependencies,roundDependencies:o.roundDependencies,typedDependencies:a.typedDependencies,zerosDependencies:l.zerosDependencies,createFloor:c.createFloor}},74183:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.forEachDependencies=void 0;var n=r(76125),i=r(62882);t.forEachDependencies={typedDependencies:n.typedDependencies,createForEach:i.createForEach}},59069:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.forEachTransformDependencies=void 0;var n=r(76125),i=r(62882);t.forEachTransformDependencies={typedDependencies:n.typedDependencies,createForEachTransform:i.createForEachTransform}},54032:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatDependencies=void 0;var n=r(76125),i=r(62882);t.formatDependencies={typedDependencies:n.typedDependencies,createFormat:i.createFormat}},96381:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fractionDependencies=void 0;var n=r(16027),i=r(76125),s=r(62882);t.fractionDependencies={FractionDependencies:n.FractionDependencies,typedDependencies:i.typedDependencies,createFraction:s.createFraction}},16027:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FractionDependencies=void 0;var n=r(62882);t.FractionDependencies={createFractionClass:n.createFractionClass}},78685:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.freqzDependencies=void 0;var n=r(3495),i=r(60318),s=r(45242),o=r(71038),a=r(93879),l=r(76125),c=r(62882);t.freqzDependencies={ComplexDependencies:n.ComplexDependencies,addDependencies:i.addDependencies,divideDependencies:s.divideDependencies,matrixDependencies:o.matrixDependencies,multiplyDependencies:a.multiplyDependencies,typedDependencies:l.typedDependencies,createFreqz:c.createFreqz}},28110:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FunctionAssignmentNodeDependencies=void 0;var n=r(82751),i=r(76125),s=r(62882);t.FunctionAssignmentNodeDependencies={NodeDependencies:n.NodeDependencies,typedDependencies:i.typedDependencies,createFunctionAssignmentNode:s.createFunctionAssignmentNode}},44543:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FunctionNodeDependencies=void 0;var n=r(82751),i=r(90703),s=r(62882);t.FunctionNodeDependencies={NodeDependencies:n.NodeDependencies,SymbolNodeDependencies:i.SymbolNodeDependencies,createFunctionNode:s.createFunctionNode}},69700:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gammaDependencies=void 0;var n=r(31914),i=r(3495),s=r(81563),o=r(32755),a=r(76125),l=r(62882);t.gammaDependencies={BigNumberDependencies:n.BigNumberDependencies,ComplexDependencies:i.ComplexDependencies,multiplyScalarDependencies:s.multiplyScalarDependencies,powDependencies:o.powDependencies,typedDependencies:a.typedDependencies,createGamma:l.createGamma}},13636:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gasConstantDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.gasConstantDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createGasConstant:s.createGasConstant}},52327:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gcdDependencies=void 0;var n=r(31914),i=r(34593),s=r(19367),o=r(22433),a=r(71038),l=r(87025),c=r(76125),u=r(81346),d=r(62882);t.gcdDependencies={BigNumberDependencies:n.BigNumberDependencies,DenseMatrixDependencies:i.DenseMatrixDependencies,concatDependencies:s.concatDependencies,equalScalarDependencies:o.equalScalarDependencies,matrixDependencies:a.matrixDependencies,roundDependencies:l.roundDependencies,typedDependencies:c.typedDependencies,zerosDependencies:u.zerosDependencies,createGcd:d.createGcd}},13800:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMatrixDataTypeDependencies=void 0;var n=r(76125),i=r(62882);t.getMatrixDataTypeDependencies={typedDependencies:n.typedDependencies,createGetMatrixDataType:i.createGetMatrixDataType}},92589:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gravitationConstantDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.gravitationConstantDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createGravitationConstant:s.createGravitationConstant}},74119:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gravityDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.gravityDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createGravity:s.createGravity}},40866:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hartreeEnergyDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.hartreeEnergyDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createHartreeEnergy:s.createHartreeEnergy}},62077:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasNumericValueDependencies=void 0;var n=r(53530),i=r(76125),s=r(62882);t.hasNumericValueDependencies={isNumericDependencies:n.isNumericDependencies,typedDependencies:i.typedDependencies,createHasNumericValue:s.createHasNumericValue}},24252:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.helpDependencies=void 0;var n=r(94388),i=r(76125),s=r(62882);t.helpDependencies={HelpDependencies:n.HelpDependencies,typedDependencies:i.typedDependencies,createHelp:s.createHelp}},94388:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HelpDependencies=void 0;var n=r(56584),i=r(62882);t.HelpDependencies={evaluateDependencies:n.evaluateDependencies,createHelpClass:i.createHelpClass}},464:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hexDependencies=void 0;var n=r(54032),i=r(76125),s=r(62882);t.hexDependencies={formatDependencies:n.formatDependencies,typedDependencies:i.typedDependencies,createHex:s.createHex}},19551:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hypotDependencies=void 0;var n=r(26077),i=r(2838),s=r(63882),o=r(49828),a=r(81563),l=r(84421),c=r(18645),u=r(76125),d=r(62882);t.hypotDependencies={absDependencies:n.absDependencies,addScalarDependencies:i.addScalarDependencies,divideScalarDependencies:s.divideScalarDependencies,isPositiveDependencies:o.isPositiveDependencies,multiplyScalarDependencies:a.multiplyScalarDependencies,smallerDependencies:l.smallerDependencies,sqrtDependencies:c.sqrtDependencies,typedDependencies:u.typedDependencies,createHypot:d.createHypot}},30774:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.iDependencies=void 0;var n=r(3495),i=r(62882);t.iDependencies={ComplexDependencies:n.ComplexDependencies,createI:i.createI}},23389:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.identityDependencies=void 0;var n=r(31914),i=r(34593),s=r(95618),o=r(71038),a=r(76125),l=r(62882);t.identityDependencies={BigNumberDependencies:n.BigNumberDependencies,DenseMatrixDependencies:i.DenseMatrixDependencies,SparseMatrixDependencies:s.SparseMatrixDependencies,matrixDependencies:o.matrixDependencies,typedDependencies:a.typedDependencies,createIdentity:l.createIdentity}},74410:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ifftDependencies=void 0;var n=r(65921),i=r(59895),s=r(52045),o=r(76125),a=r(62882);t.ifftDependencies={conjDependencies:n.conjDependencies,dotDivideDependencies:i.dotDivideDependencies,fftDependencies:s.fftDependencies,typedDependencies:o.typedDependencies,createIfft:a.createIfft}},45457:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.imDependencies=void 0;var n=r(76125),i=r(62882);t.imDependencies={typedDependencies:n.typedDependencies,createIm:i.createIm}},79815:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImmutableDenseMatrixDependencies=void 0;var n=r(34593),i=r(84421),s=r(62882);t.ImmutableDenseMatrixDependencies={DenseMatrixDependencies:n.DenseMatrixDependencies,smallerDependencies:i.smallerDependencies,createImmutableDenseMatrixClass:s.createImmutableDenseMatrixClass}},90529:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.indexDependencies=void 0;var n=r(17775),i=r(76125),s=r(62882);t.indexDependencies={IndexDependencies:n.IndexDependencies,typedDependencies:i.typedDependencies,createIndex:s.createIndex}},17775:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IndexDependencies=void 0;var n=r(79815),i=r(13800),s=r(62882);t.IndexDependencies={ImmutableDenseMatrixDependencies:n.ImmutableDenseMatrixDependencies,getMatrixDataTypeDependencies:i.getMatrixDataTypeDependencies,createIndexClass:s.createIndexClass}},33609:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IndexNodeDependencies=void 0;var n=r(82751),i=r(32274),s=r(62882);t.IndexNodeDependencies={NodeDependencies:n.NodeDependencies,sizeDependencies:i.sizeDependencies,createIndexNode:s.createIndexNode}},79923:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.indexTransformDependencies=void 0;var n=r(17775),i=r(13800),s=r(62882);t.indexTransformDependencies={IndexDependencies:n.IndexDependencies,getMatrixDataTypeDependencies:i.getMatrixDataTypeDependencies,createIndexTransform:s.createIndexTransform}},80751:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InfinityDependencies=void 0;var n=r(31914),i=r(62882);t.InfinityDependencies={BigNumberDependencies:n.BigNumberDependencies,createInfinity:i.createInfinity}},60420:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.intersectDependencies=void 0;var n=r(26077),i=r(60318),s=r(2838),o=r(63882),a=r(22433),l=r(65183),c=r(53530),u=r(99201),d=r(71038),h=r(93879),p=r(81563),m=r(84421),f=r(81067),g=r(76125),y=r(62882);t.intersectDependencies={absDependencies:n.absDependencies,addDependencies:i.addDependencies,addScalarDependencies:s.addScalarDependencies,divideScalarDependencies:o.divideScalarDependencies,equalScalarDependencies:a.equalScalarDependencies,flattenDependencies:l.flattenDependencies,isNumericDependencies:c.isNumericDependencies,isZeroDependencies:u.isZeroDependencies,matrixDependencies:d.matrixDependencies,multiplyDependencies:h.multiplyDependencies,multiplyScalarDependencies:p.multiplyScalarDependencies,smallerDependencies:m.smallerDependencies,subtractDependencies:f.subtractDependencies,typedDependencies:g.typedDependencies,createIntersect:y.createIntersect}},64898:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.invDependencies=void 0;var n=r(26077),i=r(2838),s=r(59776),o=r(63882),a=r(23389),l=r(71038),c=r(93879),u=r(76125),d=r(41662),h=r(62882);t.invDependencies={absDependencies:n.absDependencies,addScalarDependencies:i.addScalarDependencies,detDependencies:s.detDependencies,divideScalarDependencies:o.divideScalarDependencies,identityDependencies:a.identityDependencies,matrixDependencies:l.matrixDependencies,multiplyDependencies:c.multiplyDependencies,typedDependencies:u.typedDependencies,unaryMinusDependencies:d.unaryMinusDependencies,createInv:h.createInv}},87893:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.inverseConductanceQuantumDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.inverseConductanceQuantumDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createInverseConductanceQuantum:s.createInverseConductanceQuantum}},39134:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.invmodDependencies=void 0;var n=r(31914),i=r(60318),s=r(58609),o=r(76363),a=r(32054),l=r(84421),c=r(76125),u=r(54357),d=r(62882);t.invmodDependencies={BigNumberDependencies:n.BigNumberDependencies,addDependencies:i.addDependencies,equalDependencies:s.equalDependencies,isIntegerDependencies:o.isIntegerDependencies,modDependencies:a.modDependencies,smallerDependencies:l.smallerDependencies,typedDependencies:c.typedDependencies,xgcdDependencies:u.xgcdDependencies,createInvmod:d.createInvmod}},76363:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isIntegerDependencies=void 0;var n=r(76125),i=r(62882);t.isIntegerDependencies={typedDependencies:n.typedDependencies,createIsInteger:i.createIsInteger}},8828:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNaNDependencies=void 0;var n=r(76125),i=r(62882);t.isNaNDependencies={typedDependencies:n.typedDependencies,createIsNaN:i.createIsNaN}},16396:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNegativeDependencies=void 0;var n=r(76125),i=r(62882);t.isNegativeDependencies={typedDependencies:n.typedDependencies,createIsNegative:i.createIsNegative}},53530:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNumericDependencies=void 0;var n=r(76125),i=r(62882);t.isNumericDependencies={typedDependencies:n.typedDependencies,createIsNumeric:i.createIsNumeric}},49828:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPositiveDependencies=void 0;var n=r(76125),i=r(62882);t.isPositiveDependencies={typedDependencies:n.typedDependencies,createIsPositive:i.createIsPositive}},12202:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPrimeDependencies=void 0;var n=r(76125),i=r(62882);t.isPrimeDependencies={typedDependencies:n.typedDependencies,createIsPrime:i.createIsPrime}},99201:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isZeroDependencies=void 0;var n=r(22433),i=r(76125),s=r(62882);t.isZeroDependencies={equalScalarDependencies:n.equalScalarDependencies,typedDependencies:i.typedDependencies,createIsZero:s.createIsZero}},21598:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.kldivergenceDependencies=void 0;var n=r(45242),i=r(59895),s=r(53530),o=r(26831),a=r(78271),l=r(71038),c=r(93879),u=r(78542),d=r(76125),h=r(62882);t.kldivergenceDependencies={divideDependencies:n.divideDependencies,dotDivideDependencies:i.dotDivideDependencies,isNumericDependencies:s.isNumericDependencies,logDependencies:o.logDependencies,mapDependencies:a.mapDependencies,matrixDependencies:l.matrixDependencies,multiplyDependencies:c.multiplyDependencies,sumDependencies:u.sumDependencies,typedDependencies:d.typedDependencies,createKldivergence:h.createKldivergence}},92947:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.klitzingDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.klitzingDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createKlitzing:s.createKlitzing}},4555:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.kronDependencies=void 0;var n=r(71038),i=r(81563),s=r(76125),o=r(62882);t.kronDependencies={matrixDependencies:n.matrixDependencies,multiplyScalarDependencies:i.multiplyScalarDependencies,typedDependencies:s.typedDependencies,createKron:o.createKron}},42148:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LN10Dependencies=void 0;var n=r(31914),i=r(62882);t.LN10Dependencies={BigNumberDependencies:n.BigNumberDependencies,createLN10:i.createLN10}},20265:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LN2Dependencies=void 0;var n=r(31914),i=r(62882);t.LN2Dependencies={BigNumberDependencies:n.BigNumberDependencies,createLN2:i.createLN2}},87429:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LOG10EDependencies=void 0;var n=r(31914),i=r(62882);t.LOG10EDependencies={BigNumberDependencies:n.BigNumberDependencies,createLOG10E:i.createLOG10E}},90722:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LOG2EDependencies=void 0;var n=r(31914),i=r(62882);t.LOG2EDependencies={BigNumberDependencies:n.BigNumberDependencies,createLOG2E:i.createLOG2E}},19688:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.largerDependencies=void 0;var n=r(34593),i=r(19367),s=r(71038),o=r(76125),a=r(62882);t.largerDependencies={DenseMatrixDependencies:n.DenseMatrixDependencies,concatDependencies:i.concatDependencies,matrixDependencies:s.matrixDependencies,typedDependencies:o.typedDependencies,createLarger:a.createLarger}},55166:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.largerEqDependencies=void 0;var n=r(34593),i=r(19367),s=r(71038),o=r(76125),a=r(62882);t.largerEqDependencies={DenseMatrixDependencies:n.DenseMatrixDependencies,concatDependencies:i.concatDependencies,matrixDependencies:s.matrixDependencies,typedDependencies:o.typedDependencies,createLargerEq:a.createLargerEq}},57477:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lcmDependencies=void 0;var n=r(19367),i=r(22433),s=r(71038),o=r(76125),a=r(62882);t.lcmDependencies={concatDependencies:n.concatDependencies,equalScalarDependencies:i.equalScalarDependencies,matrixDependencies:s.matrixDependencies,typedDependencies:o.typedDependencies,createLcm:a.createLcm}},65286:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.leafCountDependencies=void 0;var n=r(75534),i=r(76125),s=r(62882);t.leafCountDependencies={parseDependencies:n.parseDependencies,typedDependencies:i.typedDependencies,createLeafCount:s.createLeafCount}},84018:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.leftShiftDependencies=void 0;var n=r(34593),i=r(19367),s=r(22433),o=r(71038),a=r(76125),l=r(81346),c=r(62882);t.leftShiftDependencies={DenseMatrixDependencies:n.DenseMatrixDependencies,concatDependencies:i.concatDependencies,equalScalarDependencies:s.equalScalarDependencies,matrixDependencies:o.matrixDependencies,typedDependencies:a.typedDependencies,zerosDependencies:l.zerosDependencies,createLeftShift:c.createLeftShift}},78562:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lgammaDependencies=void 0;var n=r(3495),i=r(76125),s=r(62882);t.lgammaDependencies={ComplexDependencies:n.ComplexDependencies,typedDependencies:i.typedDependencies,createLgamma:s.createLgamma}},26831:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logDependencies=void 0;var n=r(3495),i=r(63882),s=r(76125),o=r(62882);t.logDependencies={ComplexDependencies:n.ComplexDependencies,divideScalarDependencies:i.divideScalarDependencies,typedDependencies:s.typedDependencies,createLog:o.createLog}},89346:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.log10Dependencies=void 0;var n=r(3495),i=r(76125),s=r(62882);t.log10Dependencies={ComplexDependencies:n.ComplexDependencies,typedDependencies:i.typedDependencies,createLog10:s.createLog10}},6114:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.log1pDependencies=void 0;var n=r(3495),i=r(63882),s=r(26831),o=r(76125),a=r(62882);t.log1pDependencies={ComplexDependencies:n.ComplexDependencies,divideScalarDependencies:i.divideScalarDependencies,logDependencies:s.logDependencies,typedDependencies:o.typedDependencies,createLog1p:a.createLog1p}},79548:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.log2Dependencies=void 0;var n=r(3495),i=r(76125),s=r(62882);t.log2Dependencies={ComplexDependencies:n.ComplexDependencies,typedDependencies:i.typedDependencies,createLog2:s.createLog2}},19518:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loschmidtDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.loschmidtDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createLoschmidt:s.createLoschmidt}},68660:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lsolveDependencies=void 0;var n=r(34593),i=r(63882),s=r(22433),o=r(71038),a=r(81563),l=r(51623),c=r(76125),u=r(62882);t.lsolveDependencies={DenseMatrixDependencies:n.DenseMatrixDependencies,divideScalarDependencies:i.divideScalarDependencies,equalScalarDependencies:s.equalScalarDependencies,matrixDependencies:o.matrixDependencies,multiplyScalarDependencies:a.multiplyScalarDependencies,subtractScalarDependencies:l.subtractScalarDependencies,typedDependencies:c.typedDependencies,createLsolve:u.createLsolve}},92679:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lsolveAllDependencies=void 0;var n=r(34593),i=r(63882),s=r(22433),o=r(71038),a=r(81563),l=r(51623),c=r(76125),u=r(62882);t.lsolveAllDependencies={DenseMatrixDependencies:n.DenseMatrixDependencies,divideScalarDependencies:i.divideScalarDependencies,equalScalarDependencies:s.equalScalarDependencies,matrixDependencies:o.matrixDependencies,multiplyScalarDependencies:a.multiplyScalarDependencies,subtractScalarDependencies:l.subtractScalarDependencies,typedDependencies:c.typedDependencies,createLsolveAll:u.createLsolveAll}},8564:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lupDependencies=void 0;var n=r(34593),i=r(30037),s=r(95618),o=r(26077),a=r(2838),l=r(63882),c=r(22433),u=r(19688),d=r(71038),h=r(81563),p=r(51623),m=r(76125),f=r(41662),g=r(62882);t.lupDependencies={DenseMatrixDependencies:n.DenseMatrixDependencies,SpaDependencies:i.SpaDependencies,SparseMatrixDependencies:s.SparseMatrixDependencies,absDependencies:o.absDependencies,addScalarDependencies:a.addScalarDependencies,divideScalarDependencies:l.divideScalarDependencies,equalScalarDependencies:c.equalScalarDependencies,largerDependencies:u.largerDependencies,matrixDependencies:d.matrixDependencies,multiplyScalarDependencies:h.multiplyScalarDependencies,subtractScalarDependencies:p.subtractScalarDependencies,typedDependencies:m.typedDependencies,unaryMinusDependencies:f.unaryMinusDependencies,createLup:g.createLup}},85031:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lusolveDependencies=void 0;var n=r(34593),i=r(68660),s=r(8564),o=r(71038),a=r(20831),l=r(76125),c=r(87053),u=r(62882);t.lusolveDependencies={DenseMatrixDependencies:n.DenseMatrixDependencies,lsolveDependencies:i.lsolveDependencies,lupDependencies:s.lupDependencies,matrixDependencies:o.matrixDependencies,sluDependencies:a.sluDependencies,typedDependencies:l.typedDependencies,usolveDependencies:c.usolveDependencies,createLusolve:u.createLusolve}},70101:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lyapDependencies=void 0;var n=r(71038),i=r(93879),s=r(50764),o=r(73014),a=r(76125),l=r(62882);t.lyapDependencies={matrixDependencies:n.matrixDependencies,multiplyDependencies:i.multiplyDependencies,sylvesterDependencies:s.sylvesterDependencies,transposeDependencies:o.transposeDependencies,typedDependencies:a.typedDependencies,createLyap:l.createLyap}},70147:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.madDependencies=void 0;var n=r(26077),i=r(78271),s=r(42793),o=r(81067),a=r(76125),l=r(62882);t.madDependencies={absDependencies:n.absDependencies,mapDependencies:i.mapDependencies,medianDependencies:s.medianDependencies,subtractDependencies:o.subtractDependencies,typedDependencies:a.typedDependencies,createMad:l.createMad}},5621:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.magneticConstantDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.magneticConstantDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createMagneticConstant:s.createMagneticConstant}},98811:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.magneticFluxQuantumDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.magneticFluxQuantumDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createMagneticFluxQuantum:s.createMagneticFluxQuantum}},78271:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mapDependencies=void 0;var n=r(76125),i=r(62882);t.mapDependencies={typedDependencies:n.typedDependencies,createMap:i.createMap}},39381:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mapTransformDependencies=void 0;var n=r(76125),i=r(62882);t.mapTransformDependencies={typedDependencies:n.typedDependencies,createMapTransform:i.createMapTransform}},71038:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.matrixDependencies=void 0;var n=r(34593),i=r(99486),s=r(95618),o=r(76125),a=r(62882);t.matrixDependencies={DenseMatrixDependencies:n.DenseMatrixDependencies,MatrixDependencies:i.MatrixDependencies,SparseMatrixDependencies:s.SparseMatrixDependencies,typedDependencies:o.typedDependencies,createMatrix:a.createMatrix}},99486:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MatrixDependencies=void 0;var n=r(62882);t.MatrixDependencies={createMatrixClass:n.createMatrixClass}},75457:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.matrixFromColumnsDependencies=void 0;var n=r(65183),i=r(71038),s=r(32274),o=r(76125),a=r(62882);t.matrixFromColumnsDependencies={flattenDependencies:n.flattenDependencies,matrixDependencies:i.matrixDependencies,sizeDependencies:s.sizeDependencies,typedDependencies:o.typedDependencies,createMatrixFromColumns:a.createMatrixFromColumns}},26702:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.matrixFromFunctionDependencies=void 0;var n=r(99201),i=r(71038),s=r(76125),o=r(62882);t.matrixFromFunctionDependencies={isZeroDependencies:n.isZeroDependencies,matrixDependencies:i.matrixDependencies,typedDependencies:s.typedDependencies,createMatrixFromFunction:o.createMatrixFromFunction}},80027:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.matrixFromRowsDependencies=void 0;var n=r(65183),i=r(71038),s=r(32274),o=r(76125),a=r(62882);t.matrixFromRowsDependencies={flattenDependencies:n.flattenDependencies,matrixDependencies:i.matrixDependencies,sizeDependencies:s.sizeDependencies,typedDependencies:o.typedDependencies,createMatrixFromRows:a.createMatrixFromRows}},73943:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.maxDependencies=void 0;var n=r(19688),i=r(70758),s=r(76125),o=r(62882);t.maxDependencies={largerDependencies:n.largerDependencies,numericDependencies:i.numericDependencies,typedDependencies:s.typedDependencies,createMax:o.createMax}},87725:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.maxTransformDependencies=void 0;var n=r(19688),i=r(70758),s=r(76125),o=r(62882);t.maxTransformDependencies={largerDependencies:n.largerDependencies,numericDependencies:i.numericDependencies,typedDependencies:s.typedDependencies,createMaxTransform:o.createMaxTransform}},57446:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.meanDependencies=void 0;var n=r(60318),i=r(45242),s=r(76125),o=r(62882);t.meanDependencies={addDependencies:n.addDependencies,divideDependencies:i.divideDependencies,typedDependencies:s.typedDependencies,createMean:o.createMean}},19710:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.meanTransformDependencies=void 0;var n=r(60318),i=r(45242),s=r(76125),o=r(62882);t.meanTransformDependencies={addDependencies:n.addDependencies,divideDependencies:i.divideDependencies,typedDependencies:s.typedDependencies,createMeanTransform:o.createMeanTransform}},42793:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.medianDependencies=void 0;var n=r(60318),i=r(8882),s=r(45242),o=r(74120),a=r(76125),l=r(62882);t.medianDependencies={addDependencies:n.addDependencies,compareDependencies:i.compareDependencies,divideDependencies:s.divideDependencies,partitionSelectDependencies:o.partitionSelectDependencies,typedDependencies:a.typedDependencies,createMedian:l.createMedian}},52485:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.minDependencies=void 0;var n=r(70758),i=r(84421),s=r(76125),o=r(62882);t.minDependencies={numericDependencies:n.numericDependencies,smallerDependencies:i.smallerDependencies,typedDependencies:s.typedDependencies,createMin:o.createMin}},39639:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.minTransformDependencies=void 0;var n=r(70758),i=r(84421),s=r(76125),o=r(62882);t.minTransformDependencies={numericDependencies:n.numericDependencies,smallerDependencies:i.smallerDependencies,typedDependencies:s.typedDependencies,createMinTransform:o.createMinTransform}},32054:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.modDependencies=void 0;var n=r(34593),i=r(19367),s=r(22433),o=r(71038),a=r(87025),l=r(76125),c=r(81346),u=r(62882);t.modDependencies={DenseMatrixDependencies:n.DenseMatrixDependencies,concatDependencies:i.concatDependencies,equalScalarDependencies:s.equalScalarDependencies,matrixDependencies:o.matrixDependencies,roundDependencies:a.roundDependencies,typedDependencies:l.typedDependencies,zerosDependencies:c.zerosDependencies,createMod:u.createMod}},74032:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.modeDependencies=void 0;var n=r(8828),i=r(53530),s=r(76125),o=r(62882);t.modeDependencies={isNaNDependencies:n.isNaNDependencies,isNumericDependencies:i.isNumericDependencies,typedDependencies:s.typedDependencies,createMode:o.createMode}},97854:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.molarMassDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.molarMassDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createMolarMass:s.createMolarMass}},60580:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.molarMassC12Dependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.molarMassC12Dependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createMolarMassC12:s.createMolarMassC12}},74563:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.molarPlanckConstantDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.molarPlanckConstantDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createMolarPlanckConstant:s.createMolarPlanckConstant}},86012:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.molarVolumeDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.molarVolumeDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createMolarVolume:s.createMolarVolume}},48816:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.multinomialDependencies=void 0;var n=r(60318),i=r(45242),s=r(15698),o=r(76363),a=r(49828),l=r(93879),c=r(76125),u=r(62882);t.multinomialDependencies={addDependencies:n.addDependencies,divideDependencies:i.divideDependencies,factorialDependencies:s.factorialDependencies,isIntegerDependencies:o.isIntegerDependencies,isPositiveDependencies:a.isPositiveDependencies,multiplyDependencies:l.multiplyDependencies,typedDependencies:c.typedDependencies,createMultinomial:u.createMultinomial}},93879:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.multiplyDependencies=void 0;var n=r(2838),i=r(53814),s=r(22433),o=r(71038),a=r(81563),l=r(76125),c=r(62882);t.multiplyDependencies={addScalarDependencies:n.addScalarDependencies,dotDependencies:i.dotDependencies,equalScalarDependencies:s.equalScalarDependencies,matrixDependencies:o.matrixDependencies,multiplyScalarDependencies:a.multiplyScalarDependencies,typedDependencies:l.typedDependencies,createMultiply:c.createMultiply}},81563:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.multiplyScalarDependencies=void 0;var n=r(76125),i=r(62882);t.multiplyScalarDependencies={typedDependencies:n.typedDependencies,createMultiplyScalar:i.createMultiplyScalar}},16360:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NaNDependencies=void 0;var n=r(31914),i=r(62882);t.NaNDependencies={BigNumberDependencies:n.BigNumberDependencies,createNaN:i.createNaN}},57594:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.neutronMassDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.neutronMassDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createNeutronMass:s.createNeutronMass}},82751:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeDependencies=void 0;var n=r(62882);t.NodeDependencies={createNode:n.createNode}},19585:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normDependencies=void 0;var n=r(26077),i=r(60318),s=r(65921),o=r(46403),a=r(59519),l=r(22433),c=r(19688),u=r(71038),d=r(93879),h=r(32755),p=r(84421),m=r(18645),f=r(76125),g=r(62882);t.normDependencies={absDependencies:n.absDependencies,addDependencies:i.addDependencies,conjDependencies:s.conjDependencies,ctransposeDependencies:o.ctransposeDependencies,eigsDependencies:a.eigsDependencies,equalScalarDependencies:l.equalScalarDependencies,largerDependencies:c.largerDependencies,matrixDependencies:u.matrixDependencies,multiplyDependencies:d.multiplyDependencies,powDependencies:h.powDependencies,smallerDependencies:p.smallerDependencies,sqrtDependencies:m.sqrtDependencies,typedDependencies:f.typedDependencies,createNorm:g.createNorm}},20376:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.notDependencies=void 0;var n=r(76125),i=r(62882);t.notDependencies={typedDependencies:n.typedDependencies,createNot:i.createNot}},51603:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nthRootDependencies=void 0;var n=r(31914),i=r(19367),s=r(22433),o=r(71038),a=r(76125),l=r(62882);t.nthRootDependencies={BigNumberDependencies:n.BigNumberDependencies,concatDependencies:i.concatDependencies,equalScalarDependencies:s.equalScalarDependencies,matrixDependencies:o.matrixDependencies,typedDependencies:a.typedDependencies,createNthRoot:l.createNthRoot}},29864:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nthRootsDependencies=void 0;var n=r(3495),i=r(63882),s=r(76125),o=r(62882);t.nthRootsDependencies={ComplexDependencies:n.ComplexDependencies,divideScalarDependencies:i.divideScalarDependencies,typedDependencies:s.typedDependencies,createNthRoots:o.createNthRoots}},19136:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nuclearMagnetonDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.nuclearMagnetonDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createNuclearMagneton:s.createNuclearMagneton}},51598:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nullDependencies=void 0;var n=r(62882);t.nullDependencies={createNull:n.createNull}},18418:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.numberDependencies=void 0;var n=r(76125),i=r(62882);t.numberDependencies={typedDependencies:n.typedDependencies,createNumber:i.createNumber}},70758:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.numericDependencies=void 0;var n=r(10074),i=r(96381),s=r(18418),o=r(62882);t.numericDependencies={bignumberDependencies:n.bignumberDependencies,fractionDependencies:i.fractionDependencies,numberDependencies:s.numberDependencies,createNumeric:o.createNumeric}},1576:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectNodeDependencies=void 0;var n=r(82751),i=r(62882);t.ObjectNodeDependencies={NodeDependencies:n.NodeDependencies,createObjectNode:i.createObjectNode}},48975:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.octDependencies=void 0;var n=r(54032),i=r(76125),s=r(62882);t.octDependencies={formatDependencies:n.formatDependencies,typedDependencies:i.typedDependencies,createOct:s.createOct}},47598:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.onesDependencies=void 0;var n=r(31914),i=r(71038),s=r(76125),o=r(62882);t.onesDependencies={BigNumberDependencies:n.BigNumberDependencies,matrixDependencies:i.matrixDependencies,typedDependencies:s.typedDependencies,createOnes:o.createOnes}},66527:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OperatorNodeDependencies=void 0;var n=r(82751),i=r(62882);t.OperatorNodeDependencies={NodeDependencies:n.NodeDependencies,createOperatorNode:i.createOperatorNode}},88498:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.orDependencies=void 0;var n=r(34593),i=r(19367),s=r(22433),o=r(71038),a=r(76125),l=r(62882);t.orDependencies={DenseMatrixDependencies:n.DenseMatrixDependencies,concatDependencies:i.concatDependencies,equalScalarDependencies:s.equalScalarDependencies,matrixDependencies:o.matrixDependencies,typedDependencies:a.typedDependencies,createOr:l.createOr}},57210:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.orTransformDependencies=void 0;var n=r(34593),i=r(19367),s=r(22433),o=r(71038),a=r(76125),l=r(62882);t.orTransformDependencies={DenseMatrixDependencies:n.DenseMatrixDependencies,concatDependencies:i.concatDependencies,equalScalarDependencies:s.equalScalarDependencies,matrixDependencies:o.matrixDependencies,typedDependencies:a.typedDependencies,createOrTransform:l.createOrTransform}},94189:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ParenthesisNodeDependencies=void 0;var n=r(82751),i=r(62882);t.ParenthesisNodeDependencies={NodeDependencies:n.NodeDependencies,createParenthesisNode:i.createParenthesisNode}},75534:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseDependencies=void 0;var n=r(8832),i=r(57384),s=r(56270),o=r(19156),a=r(3577),l=r(93755),c=r(28110),u=r(44543),d=r(33609),h=r(1576),p=r(66527),m=r(94189),f=r(8584),g=r(11237),y=r(90703),b=r(70758),v=r(76125),_=r(62882);t.parseDependencies={AccessorNodeDependencies:n.AccessorNodeDependencies,ArrayNodeDependencies:i.ArrayNodeDependencies,AssignmentNodeDependencies:s.AssignmentNodeDependencies,BlockNodeDependencies:o.BlockNodeDependencies,ConditionalNodeDependencies:a.ConditionalNodeDependencies,ConstantNodeDependencies:l.ConstantNodeDependencies,FunctionAssignmentNodeDependencies:c.FunctionAssignmentNodeDependencies,FunctionNodeDependencies:u.FunctionNodeDependencies,IndexNodeDependencies:d.IndexNodeDependencies,ObjectNodeDependencies:h.ObjectNodeDependencies,OperatorNodeDependencies:p.OperatorNodeDependencies,ParenthesisNodeDependencies:m.ParenthesisNodeDependencies,RangeNodeDependencies:f.RangeNodeDependencies,RelationalNodeDependencies:g.RelationalNodeDependencies,SymbolNodeDependencies:y.SymbolNodeDependencies,numericDependencies:b.numericDependencies,typedDependencies:v.typedDependencies,createParse:_.createParse}},368:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parserDependencies=void 0;var n=r(97432),i=r(76125),s=r(62882);t.parserDependencies={ParserDependencies:n.ParserDependencies,typedDependencies:i.typedDependencies,createParser:s.createParser}},97432:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ParserDependencies=void 0;var n=r(56584),i=r(62882);t.ParserDependencies={evaluateDependencies:n.evaluateDependencies,createParserClass:i.createParserClass}},74120:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.partitionSelectDependencies=void 0;var n=r(8882),i=r(8828),s=r(53530),o=r(76125),a=r(62882);t.partitionSelectDependencies={compareDependencies:n.compareDependencies,isNaNDependencies:i.isNaNDependencies,isNumericDependencies:s.isNumericDependencies,typedDependencies:o.typedDependencies,createPartitionSelect:a.createPartitionSelect}},78494:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.permutationsDependencies=void 0;var n=r(15698),i=r(76125),s=r(62882);t.permutationsDependencies={factorialDependencies:n.factorialDependencies,typedDependencies:i.typedDependencies,createPermutations:s.createPermutations}},77222:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.phiDependencies=void 0;var n=r(31914),i=r(62882);t.phiDependencies={BigNumberDependencies:n.BigNumberDependencies,createPhi:i.createPhi}},43516:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.piDependencies=void 0;var n=r(31914),i=r(62882);t.piDependencies={BigNumberDependencies:n.BigNumberDependencies,createPi:i.createPi}},54425:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pickRandomDependencies=void 0;var n=r(76125),i=r(62882);t.pickRandomDependencies={typedDependencies:n.typedDependencies,createPickRandom:i.createPickRandom}},30264:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pinvDependencies=void 0;var n=r(3495),i=r(60318),s=r(46403),o=r(30619),a=r(63882),l=r(53814),c=r(59895),u=r(58609),d=r(64898),h=r(71038),p=r(93879),m=r(76125),f=r(62882);t.pinvDependencies={ComplexDependencies:n.ComplexDependencies,addDependencies:i.addDependencies,ctransposeDependencies:s.ctransposeDependencies,deepEqualDependencies:o.deepEqualDependencies,divideScalarDependencies:a.divideScalarDependencies,dotDependencies:l.dotDependencies,dotDivideDependencies:c.dotDivideDependencies,equalDependencies:u.equalDependencies,invDependencies:d.invDependencies,matrixDependencies:h.matrixDependencies,multiplyDependencies:p.multiplyDependencies,typedDependencies:m.typedDependencies,createPinv:f.createPinv}},67442:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.planckChargeDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.planckChargeDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createPlanckCharge:s.createPlanckCharge}},72930:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.planckConstantDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.planckConstantDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createPlanckConstant:s.createPlanckConstant}},55358:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.planckLengthDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.planckLengthDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createPlanckLength:s.createPlanckLength}},80226:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.planckMassDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.planckMassDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createPlanckMass:s.createPlanckMass}},63924:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.planckTemperatureDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.planckTemperatureDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createPlanckTemperature:s.createPlanckTemperature}},83807:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.planckTimeDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.planckTimeDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createPlanckTime:s.createPlanckTime}},58797:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.polynomialRootDependencies=void 0;var n=r(60318),i=r(23188),s=r(45242),o=r(22433),a=r(45457),l=r(99201),c=r(93879),u=r(95746),d=r(18645),h=r(81067),p=r(78534),m=r(76125),f=r(41662),g=r(62882);t.polynomialRootDependencies={addDependencies:n.addDependencies,cbrtDependencies:i.cbrtDependencies,divideDependencies:s.divideDependencies,equalScalarDependencies:o.equalScalarDependencies,imDependencies:a.imDependencies,isZeroDependencies:l.isZeroDependencies,multiplyDependencies:c.multiplyDependencies,reDependencies:u.reDependencies,sqrtDependencies:d.sqrtDependencies,subtractDependencies:h.subtractDependencies,typeOfDependencies:p.typeOfDependencies,typedDependencies:m.typedDependencies,unaryMinusDependencies:f.unaryMinusDependencies,createPolynomialRoot:g.createPolynomialRoot}},32755:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.powDependencies=void 0;var n=r(3495),i=r(96381),s=r(23389),o=r(64898),a=r(71038),l=r(93879),c=r(18418),u=r(76125),d=r(62882);t.powDependencies={ComplexDependencies:n.ComplexDependencies,fractionDependencies:i.fractionDependencies,identityDependencies:s.identityDependencies,invDependencies:o.invDependencies,matrixDependencies:a.matrixDependencies,multiplyDependencies:l.multiplyDependencies,numberDependencies:c.numberDependencies,typedDependencies:u.typedDependencies,createPow:d.createPow}},4754:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.printDependencies=void 0;var n=r(76125),i=r(62882);t.printDependencies={typedDependencies:n.typedDependencies,createPrint:i.createPrint}},56410:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.printTransformDependencies=void 0;var n=r(60318),i=r(71038),s=r(76125),o=r(81346),a=r(62882);t.printTransformDependencies={addDependencies:n.addDependencies,matrixDependencies:i.matrixDependencies,typedDependencies:s.typedDependencies,zerosDependencies:o.zerosDependencies,createPrintTransform:a.createPrintTransform}},55610:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.prodDependencies=void 0;var n=r(81563),i=r(70758),s=r(76125),o=r(62882);t.prodDependencies={multiplyScalarDependencies:n.multiplyScalarDependencies,numericDependencies:i.numericDependencies,typedDependencies:s.typedDependencies,createProd:o.createProd}},45907:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.protonMassDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.protonMassDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createProtonMass:s.createProtonMass}},71312:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.qrDependencies=void 0;var n=r(2838),i=r(74361),s=r(65921),o=r(63882),a=r(58609),l=r(23389),c=r(99201),u=r(71038),d=r(81563),h=r(6278),p=r(18645),m=r(51623),f=r(76125),g=r(41662),y=r(81346),b=r(62882);t.qrDependencies={addScalarDependencies:n.addScalarDependencies,complexDependencies:i.complexDependencies,conjDependencies:s.conjDependencies,divideScalarDependencies:o.divideScalarDependencies,equalDependencies:a.equalDependencies,identityDependencies:l.identityDependencies,isZeroDependencies:c.isZeroDependencies,matrixDependencies:u.matrixDependencies,multiplyScalarDependencies:d.multiplyScalarDependencies,signDependencies:h.signDependencies,sqrtDependencies:p.sqrtDependencies,subtractScalarDependencies:m.subtractScalarDependencies,typedDependencies:f.typedDependencies,unaryMinusDependencies:g.unaryMinusDependencies,zerosDependencies:y.zerosDependencies,createQr:b.createQr}},40125:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.quantileSeqDependencies=void 0;var n=r(10074),i=r(60318),s=r(8882),o=r(45242),a=r(76363),l=r(19688),c=r(93879),u=r(74120),d=r(84421),h=r(15167),p=r(81067),m=r(76125),f=r(62882);t.quantileSeqDependencies={bignumberDependencies:n.bignumberDependencies,addDependencies:i.addDependencies,compareDependencies:s.compareDependencies,divideDependencies:o.divideDependencies,isIntegerDependencies:a.isIntegerDependencies,largerDependencies:l.largerDependencies,multiplyDependencies:c.multiplyDependencies,partitionSelectDependencies:u.partitionSelectDependencies,smallerDependencies:d.smallerDependencies,smallerEqDependencies:h.smallerEqDependencies,subtractDependencies:p.subtractDependencies,typedDependencies:m.typedDependencies,createQuantileSeq:f.createQuantileSeq}},77103:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.quantileSeqTransformDependencies=void 0;var n=r(60318),i=r(10074),s=r(8882),o=r(45242),a=r(76363),l=r(19688),c=r(93879),u=r(74120),d=r(84421),h=r(15167),p=r(81067),m=r(76125),f=r(62882);t.quantileSeqTransformDependencies={addDependencies:n.addDependencies,bignumberDependencies:i.bignumberDependencies,compareDependencies:s.compareDependencies,divideDependencies:o.divideDependencies,isIntegerDependencies:a.isIntegerDependencies,largerDependencies:l.largerDependencies,multiplyDependencies:c.multiplyDependencies,partitionSelectDependencies:u.partitionSelectDependencies,smallerDependencies:d.smallerDependencies,smallerEqDependencies:h.smallerEqDependencies,subtractDependencies:p.subtractDependencies,typedDependencies:m.typedDependencies,createQuantileSeqTransform:f.createQuantileSeqTransform}},50044:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.quantumOfCirculationDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.quantumOfCirculationDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createQuantumOfCirculation:s.createQuantumOfCirculation}},90856:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomDependencies=void 0;var n=r(76125),i=r(62882);t.randomDependencies={typedDependencies:n.typedDependencies,createRandom:i.createRandom}},47501:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomIntDependencies=void 0;var n=r(76125),i=r(62882);t.randomIntDependencies={typedDependencies:n.typedDependencies,createRandomInt:i.createRandomInt}},40820:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rangeDependencies=void 0;var n=r(10074),i=r(71038),s=r(60318),o=r(49828),a=r(19688),l=r(55166),c=r(84421),u=r(15167),d=r(76125),h=r(62882);t.rangeDependencies={bignumberDependencies:n.bignumberDependencies,matrixDependencies:i.matrixDependencies,addDependencies:s.addDependencies,isPositiveDependencies:o.isPositiveDependencies,largerDependencies:a.largerDependencies,largerEqDependencies:l.largerEqDependencies,smallerDependencies:c.smallerDependencies,smallerEqDependencies:u.smallerEqDependencies,typedDependencies:d.typedDependencies,createRange:h.createRange}},7116:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RangeDependencies=void 0;var n=r(62882);t.RangeDependencies={createRangeClass:n.createRangeClass}},8584:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RangeNodeDependencies=void 0;var n=r(82751),i=r(62882);t.RangeNodeDependencies={NodeDependencies:n.NodeDependencies,createRangeNode:i.createRangeNode}},77768:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rangeTransformDependencies=void 0;var n=r(10074),i=r(71038),s=r(60318),o=r(49828),a=r(19688),l=r(55166),c=r(84421),u=r(15167),d=r(76125),h=r(62882);t.rangeTransformDependencies={bignumberDependencies:n.bignumberDependencies,matrixDependencies:i.matrixDependencies,addDependencies:s.addDependencies,isPositiveDependencies:o.isPositiveDependencies,largerDependencies:a.largerDependencies,largerEqDependencies:l.largerEqDependencies,smallerDependencies:c.smallerDependencies,smallerEqDependencies:u.smallerEqDependencies,typedDependencies:d.typedDependencies,createRangeTransform:h.createRangeTransform}},15885:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rationalizeDependencies=void 0;var n=r(10074),i=r(96381),s=r(8832),o=r(57384),a=r(93755),l=r(44543),c=r(33609),u=r(1576),d=r(66527),h=r(94189),p=r(90703),m=r(60318),f=r(45242),g=r(58609),y=r(99201),b=r(71038),v=r(93879),_=r(75534),x=r(32755),w=r(24124),R=r(57816),k=r(42307),j=r(81067),z=r(76125),q=r(62882);t.rationalizeDependencies={bignumberDependencies:n.bignumberDependencies,fractionDependencies:i.fractionDependencies,AccessorNodeDependencies:s.AccessorNodeDependencies,ArrayNodeDependencies:o.ArrayNodeDependencies,ConstantNodeDependencies:a.ConstantNodeDependencies,FunctionNodeDependencies:l.FunctionNodeDependencies,IndexNodeDependencies:c.IndexNodeDependencies,ObjectNodeDependencies:u.ObjectNodeDependencies,OperatorNodeDependencies:d.OperatorNodeDependencies,ParenthesisNodeDependencies:h.ParenthesisNodeDependencies,SymbolNodeDependencies:p.SymbolNodeDependencies,addDependencies:m.addDependencies,divideDependencies:f.divideDependencies,equalDependencies:g.equalDependencies,isZeroDependencies:y.isZeroDependencies,matrixDependencies:b.matrixDependencies,multiplyDependencies:v.multiplyDependencies,parseDependencies:_.parseDependencies,powDependencies:x.powDependencies,simplifyDependencies:w.simplifyDependencies,simplifyConstantDependencies:R.simplifyConstantDependencies,simplifyCoreDependencies:k.simplifyCoreDependencies,subtractDependencies:j.subtractDependencies,typedDependencies:z.typedDependencies,createRationalize:q.createRationalize}},95746:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reDependencies=void 0;var n=r(76125),i=r(62882);t.reDependencies={typedDependencies:n.typedDependencies,createRe:i.createRe}},78578:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reducedPlanckConstantDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.reducedPlanckConstantDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createReducedPlanckConstant:s.createReducedPlanckConstant}},11237:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RelationalNodeDependencies=void 0;var n=r(82751),i=r(62882);t.RelationalNodeDependencies={NodeDependencies:n.NodeDependencies,createRelationalNode:i.createRelationalNode}},28397:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.replacerDependencies=void 0;var n=r(62882);t.replacerDependencies={createReplacer:n.createReplacer}},92419:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reshapeDependencies=void 0;var n=r(76363),i=r(71038),s=r(76125),o=r(62882);t.reshapeDependencies={isIntegerDependencies:n.isIntegerDependencies,matrixDependencies:i.matrixDependencies,typedDependencies:s.typedDependencies,createReshape:o.createReshape}},63335:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resizeDependencies=void 0;var n=r(71038),i=r(62882);t.resizeDependencies={matrixDependencies:n.matrixDependencies,createResize:i.createResize}},90045:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveDependencies=void 0;var n=r(93755),i=r(44543),s=r(66527),o=r(94189),a=r(75534),l=r(76125),c=r(62882);t.resolveDependencies={ConstantNodeDependencies:n.ConstantNodeDependencies,FunctionNodeDependencies:i.FunctionNodeDependencies,OperatorNodeDependencies:s.OperatorNodeDependencies,ParenthesisNodeDependencies:o.ParenthesisNodeDependencies,parseDependencies:a.parseDependencies,typedDependencies:l.typedDependencies,createResolve:c.createResolve}},27610:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResultSetDependencies=void 0;var n=r(62882);t.ResultSetDependencies={createResultSet:n.createResultSet}},66084:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reviverDependencies=void 0;var n=r(62882);t.reviverDependencies={createReviver:n.createReviver}},91781:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rightArithShiftDependencies=void 0;var n=r(34593),i=r(19367),s=r(22433),o=r(71038),a=r(76125),l=r(81346),c=r(62882);t.rightArithShiftDependencies={DenseMatrixDependencies:n.DenseMatrixDependencies,concatDependencies:i.concatDependencies,equalScalarDependencies:s.equalScalarDependencies,matrixDependencies:o.matrixDependencies,typedDependencies:a.typedDependencies,zerosDependencies:l.zerosDependencies,createRightArithShift:c.createRightArithShift}},80861:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rightLogShiftDependencies=void 0;var n=r(34593),i=r(19367),s=r(22433),o=r(71038),a=r(76125),l=r(81346),c=r(62882);t.rightLogShiftDependencies={DenseMatrixDependencies:n.DenseMatrixDependencies,concatDependencies:i.concatDependencies,equalScalarDependencies:s.equalScalarDependencies,matrixDependencies:o.matrixDependencies,typedDependencies:a.typedDependencies,zerosDependencies:l.zerosDependencies,createRightLogShift:c.createRightLogShift}},26860:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rotateDependencies=void 0;var n=r(93879),i=r(88344),s=r(76125),o=r(62882);t.rotateDependencies={multiplyDependencies:n.multiplyDependencies,rotationMatrixDependencies:i.rotationMatrixDependencies,typedDependencies:s.typedDependencies,createRotate:o.createRotate}},88344:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rotationMatrixDependencies=void 0;var n=r(31914),i=r(34593),s=r(95618),o=r(2838),a=r(35290),l=r(71038),c=r(81563),u=r(19585),d=r(10723),h=r(76125),p=r(41662),m=r(62882);t.rotationMatrixDependencies={BigNumberDependencies:n.BigNumberDependencies,DenseMatrixDependencies:i.DenseMatrixDependencies,SparseMatrixDependencies:s.SparseMatrixDependencies,addScalarDependencies:o.addScalarDependencies,cosDependencies:a.cosDependencies,matrixDependencies:l.matrixDependencies,multiplyScalarDependencies:c.multiplyScalarDependencies,normDependencies:u.normDependencies,sinDependencies:d.sinDependencies,typedDependencies:h.typedDependencies,unaryMinusDependencies:p.unaryMinusDependencies,createRotationMatrix:m.createRotationMatrix}},87025:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.roundDependencies=void 0;var n=r(31914),i=r(34593),s=r(22433),o=r(71038),a=r(76125),l=r(81346),c=r(62882);t.roundDependencies={BigNumberDependencies:n.BigNumberDependencies,DenseMatrixDependencies:i.DenseMatrixDependencies,equalScalarDependencies:s.equalScalarDependencies,matrixDependencies:o.matrixDependencies,typedDependencies:a.typedDependencies,zerosDependencies:l.zerosDependencies,createRound:c.createRound}},89073:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rowDependencies=void 0;var n=r(17775),i=r(71038),s=r(40820),o=r(76125),a=r(62882);t.rowDependencies={IndexDependencies:n.IndexDependencies,matrixDependencies:i.matrixDependencies,rangeDependencies:s.rangeDependencies,typedDependencies:o.typedDependencies,createRow:a.createRow}},8579:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rowTransformDependencies=void 0;var n=r(17775),i=r(71038),s=r(40820),o=r(76125),a=r(62882);t.rowTransformDependencies={IndexDependencies:n.IndexDependencies,matrixDependencies:i.matrixDependencies,rangeDependencies:s.rangeDependencies,typedDependencies:o.typedDependencies,createRowTransform:a.createRowTransform}},54864:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rydbergDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.rydbergDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createRydberg:s.createRydberg}},28409:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SQRT1_2Dependencies=void 0;var n=r(31914),i=r(62882);t.SQRT1_2Dependencies={BigNumberDependencies:n.BigNumberDependencies,createSQRT1_2:i.createSQRT1_2}},45701:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SQRT2Dependencies=void 0;var n=r(31914),i=r(62882);t.SQRT2Dependencies={BigNumberDependencies:n.BigNumberDependencies,createSQRT2:i.createSQRT2}},54059:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sackurTetrodeDependencies=void 0;var n=r(31914),i=r(62882);t.sackurTetrodeDependencies={BigNumberDependencies:n.BigNumberDependencies,createSackurTetrode:i.createSackurTetrode}},65724:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.schurDependencies=void 0;var n=r(23389),i=r(71038),s=r(93879),o=r(19585),a=r(71312),l=r(81067),c=r(76125),u=r(62882);t.schurDependencies={identityDependencies:n.identityDependencies,matrixDependencies:i.matrixDependencies,multiplyDependencies:s.multiplyDependencies,normDependencies:o.normDependencies,qrDependencies:a.qrDependencies,subtractDependencies:l.subtractDependencies,typedDependencies:c.typedDependencies,createSchur:u.createSchur}},60936:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.secDependencies=void 0;var n=r(31914),i=r(76125),s=r(62882);t.secDependencies={BigNumberDependencies:n.BigNumberDependencies,typedDependencies:i.typedDependencies,createSec:s.createSec}},46984:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sechDependencies=void 0;var n=r(31914),i=r(76125),s=r(62882);t.sechDependencies={BigNumberDependencies:n.BigNumberDependencies,typedDependencies:i.typedDependencies,createSech:s.createSech}},3702:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.secondRadiationDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.secondRadiationDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createSecondRadiation:s.createSecondRadiation}},16097:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setCartesianDependencies=void 0;var n=r(34593),i=r(17775),s=r(24651),o=r(32274),a=r(64205),l=r(76125),c=r(62882);t.setCartesianDependencies={DenseMatrixDependencies:n.DenseMatrixDependencies,IndexDependencies:i.IndexDependencies,compareNaturalDependencies:s.compareNaturalDependencies,sizeDependencies:o.sizeDependencies,subsetDependencies:a.subsetDependencies,typedDependencies:l.typedDependencies,createSetCartesian:c.createSetCartesian}},3134:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setDifferenceDependencies=void 0;var n=r(34593),i=r(17775),s=r(24651),o=r(32274),a=r(64205),l=r(76125),c=r(62882);t.setDifferenceDependencies={DenseMatrixDependencies:n.DenseMatrixDependencies,IndexDependencies:i.IndexDependencies,compareNaturalDependencies:s.compareNaturalDependencies,sizeDependencies:o.sizeDependencies,subsetDependencies:a.subsetDependencies,typedDependencies:l.typedDependencies,createSetDifference:c.createSetDifference}},2753:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setDistinctDependencies=void 0;var n=r(34593),i=r(17775),s=r(24651),o=r(32274),a=r(64205),l=r(76125),c=r(62882);t.setDistinctDependencies={DenseMatrixDependencies:n.DenseMatrixDependencies,IndexDependencies:i.IndexDependencies,compareNaturalDependencies:s.compareNaturalDependencies,sizeDependencies:o.sizeDependencies,subsetDependencies:a.subsetDependencies,typedDependencies:l.typedDependencies,createSetDistinct:c.createSetDistinct}},15442:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setIntersectDependencies=void 0;var n=r(34593),i=r(17775),s=r(24651),o=r(32274),a=r(64205),l=r(76125),c=r(62882);t.setIntersectDependencies={DenseMatrixDependencies:n.DenseMatrixDependencies,IndexDependencies:i.IndexDependencies,compareNaturalDependencies:s.compareNaturalDependencies,sizeDependencies:o.sizeDependencies,subsetDependencies:a.subsetDependencies,typedDependencies:l.typedDependencies,createSetIntersect:c.createSetIntersect}},16139:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setIsSubsetDependencies=void 0;var n=r(17775),i=r(24651),s=r(32274),o=r(64205),a=r(76125),l=r(62882);t.setIsSubsetDependencies={IndexDependencies:n.IndexDependencies,compareNaturalDependencies:i.compareNaturalDependencies,sizeDependencies:s.sizeDependencies,subsetDependencies:o.subsetDependencies,typedDependencies:a.typedDependencies,createSetIsSubset:l.createSetIsSubset}},20262:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setMultiplicityDependencies=void 0;var n=r(17775),i=r(24651),s=r(32274),o=r(64205),a=r(76125),l=r(62882);t.setMultiplicityDependencies={IndexDependencies:n.IndexDependencies,compareNaturalDependencies:i.compareNaturalDependencies,sizeDependencies:s.sizeDependencies,subsetDependencies:o.subsetDependencies,typedDependencies:a.typedDependencies,createSetMultiplicity:l.createSetMultiplicity}},97474:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setPowersetDependencies=void 0;var n=r(17775),i=r(24651),s=r(32274),o=r(64205),a=r(76125),l=r(62882);t.setPowersetDependencies={IndexDependencies:n.IndexDependencies,compareNaturalDependencies:i.compareNaturalDependencies,sizeDependencies:s.sizeDependencies,subsetDependencies:o.subsetDependencies,typedDependencies:a.typedDependencies,createSetPowerset:l.createSetPowerset}},52780:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setSizeDependencies=void 0;var n=r(24651),i=r(76125),s=r(62882);t.setSizeDependencies={compareNaturalDependencies:n.compareNaturalDependencies,typedDependencies:i.typedDependencies,createSetSize:s.createSetSize}},86511:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setSymDifferenceDependencies=void 0;var n=r(17775),i=r(19367),s=r(3134),o=r(32274),a=r(64205),l=r(76125),c=r(62882);t.setSymDifferenceDependencies={IndexDependencies:n.IndexDependencies,concatDependencies:i.concatDependencies,setDifferenceDependencies:s.setDifferenceDependencies,sizeDependencies:o.sizeDependencies,subsetDependencies:a.subsetDependencies,typedDependencies:l.typedDependencies,createSetSymDifference:c.createSetSymDifference}},99060:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setUnionDependencies=void 0;var n=r(17775),i=r(19367),s=r(15442),o=r(86511),a=r(32274),l=r(64205),c=r(76125),u=r(62882);t.setUnionDependencies={IndexDependencies:n.IndexDependencies,concatDependencies:i.concatDependencies,setIntersectDependencies:s.setIntersectDependencies,setSymDifferenceDependencies:o.setSymDifferenceDependencies,sizeDependencies:a.sizeDependencies,subsetDependencies:l.subsetDependencies,typedDependencies:c.typedDependencies,createSetUnion:u.createSetUnion}},6278:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.signDependencies=void 0;var n=r(31914),i=r(16027),s=r(74361),o=r(76125),a=r(62882);t.signDependencies={BigNumberDependencies:n.BigNumberDependencies,FractionDependencies:i.FractionDependencies,complexDependencies:s.complexDependencies,typedDependencies:o.typedDependencies,createSign:a.createSign}},24124:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplifyDependencies=void 0;var n=r(10074),i=r(96381),s=r(8832),o=r(57384),a=r(93755),l=r(44543),c=r(33609),u=r(1576),d=r(66527),h=r(94189),p=r(90703),m=r(60318),f=r(45242),g=r(58609),y=r(99201),b=r(71038),v=r(93879),_=r(75534),x=r(32755),w=r(90045),R=r(57816),k=r(42307),j=r(81067),z=r(76125),q=r(62882);t.simplifyDependencies={bignumberDependencies:n.bignumberDependencies,fractionDependencies:i.fractionDependencies,AccessorNodeDependencies:s.AccessorNodeDependencies,ArrayNodeDependencies:o.ArrayNodeDependencies,ConstantNodeDependencies:a.ConstantNodeDependencies,FunctionNodeDependencies:l.FunctionNodeDependencies,IndexNodeDependencies:c.IndexNodeDependencies,ObjectNodeDependencies:u.ObjectNodeDependencies,OperatorNodeDependencies:d.OperatorNodeDependencies,ParenthesisNodeDependencies:h.ParenthesisNodeDependencies,SymbolNodeDependencies:p.SymbolNodeDependencies,addDependencies:m.addDependencies,divideDependencies:f.divideDependencies,equalDependencies:g.equalDependencies,isZeroDependencies:y.isZeroDependencies,matrixDependencies:b.matrixDependencies,multiplyDependencies:v.multiplyDependencies,parseDependencies:_.parseDependencies,powDependencies:x.powDependencies,resolveDependencies:w.resolveDependencies,simplifyConstantDependencies:R.simplifyConstantDependencies,simplifyCoreDependencies:k.simplifyCoreDependencies,subtractDependencies:j.subtractDependencies,typedDependencies:z.typedDependencies,createSimplify:q.createSimplify}},57816:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplifyConstantDependencies=void 0;var n=r(10074),i=r(96381),s=r(8832),o=r(57384),a=r(93755),l=r(44543),c=r(33609),u=r(1576),d=r(66527),h=r(90703),p=r(71038),m=r(76125),f=r(62882);t.simplifyConstantDependencies={bignumberDependencies:n.bignumberDependencies,fractionDependencies:i.fractionDependencies,AccessorNodeDependencies:s.AccessorNodeDependencies,ArrayNodeDependencies:o.ArrayNodeDependencies,ConstantNodeDependencies:a.ConstantNodeDependencies,FunctionNodeDependencies:l.FunctionNodeDependencies,IndexNodeDependencies:c.IndexNodeDependencies,ObjectNodeDependencies:u.ObjectNodeDependencies,OperatorNodeDependencies:d.OperatorNodeDependencies,SymbolNodeDependencies:h.SymbolNodeDependencies,matrixDependencies:p.matrixDependencies,typedDependencies:m.typedDependencies,createSimplifyConstant:f.createSimplifyConstant}},42307:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplifyCoreDependencies=void 0;var n=r(8832),i=r(57384),s=r(93755),o=r(44543),a=r(33609),l=r(1576),c=r(66527),u=r(94189),d=r(90703),h=r(60318),p=r(45242),m=r(58609),f=r(99201),g=r(93879),y=r(75534),b=r(32755),v=r(81067),_=r(76125),x=r(62882);t.simplifyCoreDependencies={AccessorNodeDependencies:n.AccessorNodeDependencies,ArrayNodeDependencies:i.ArrayNodeDependencies,ConstantNodeDependencies:s.ConstantNodeDependencies,FunctionNodeDependencies:o.FunctionNodeDependencies,IndexNodeDependencies:a.IndexNodeDependencies,ObjectNodeDependencies:l.ObjectNodeDependencies,OperatorNodeDependencies:c.OperatorNodeDependencies,ParenthesisNodeDependencies:u.ParenthesisNodeDependencies,SymbolNodeDependencies:d.SymbolNodeDependencies,addDependencies:h.addDependencies,divideDependencies:p.divideDependencies,equalDependencies:m.equalDependencies,isZeroDependencies:f.isZeroDependencies,multiplyDependencies:g.multiplyDependencies,parseDependencies:y.parseDependencies,powDependencies:b.powDependencies,subtractDependencies:v.subtractDependencies,typedDependencies:_.typedDependencies,createSimplifyCore:x.createSimplifyCore}},10723:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sinDependencies=void 0;var n=r(76125),i=r(62882);t.sinDependencies={typedDependencies:n.typedDependencies,createSin:i.createSin}},2357:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sinhDependencies=void 0;var n=r(76125),i=r(62882);t.sinhDependencies={typedDependencies:n.typedDependencies,createSinh:i.createSinh}},32274:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sizeDependencies=void 0;var n=r(71038),i=r(76125),s=r(62882);t.sizeDependencies={matrixDependencies:n.matrixDependencies,typedDependencies:i.typedDependencies,createSize:s.createSize}},20831:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sluDependencies=void 0;var n=r(95618),i=r(26077),s=r(60318),o=r(63882),a=r(19688),l=r(55166),c=r(93879),u=r(81067),d=r(73014),h=r(76125),p=r(62882);t.sluDependencies={SparseMatrixDependencies:n.SparseMatrixDependencies,absDependencies:i.absDependencies,addDependencies:s.addDependencies,divideScalarDependencies:o.divideScalarDependencies,largerDependencies:a.largerDependencies,largerEqDependencies:l.largerEqDependencies,multiplyDependencies:c.multiplyDependencies,subtractDependencies:u.subtractDependencies,transposeDependencies:d.transposeDependencies,typedDependencies:h.typedDependencies,createSlu:p.createSlu}},84421:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.smallerDependencies=void 0;var n=r(34593),i=r(19367),s=r(71038),o=r(76125),a=r(62882);t.smallerDependencies={DenseMatrixDependencies:n.DenseMatrixDependencies,concatDependencies:i.concatDependencies,matrixDependencies:s.matrixDependencies,typedDependencies:o.typedDependencies,createSmaller:a.createSmaller}},15167:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.smallerEqDependencies=void 0;var n=r(34593),i=r(19367),s=r(71038),o=r(76125),a=r(62882);t.smallerEqDependencies={DenseMatrixDependencies:n.DenseMatrixDependencies,concatDependencies:i.concatDependencies,matrixDependencies:s.matrixDependencies,typedDependencies:o.typedDependencies,createSmallerEq:a.createSmallerEq}},24748:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.solveODEDependencies=void 0;var n=r(26077),i=r(60318),s=r(10074),o=r(45242),a=r(16396),l=r(49828),c=r(19688),u=r(78271),d=r(71038),h=r(73943),p=r(93879),m=r(84421),f=r(81067),g=r(76125),y=r(41662),b=r(62882);t.solveODEDependencies={absDependencies:n.absDependencies,addDependencies:i.addDependencies,bignumberDependencies:s.bignumberDependencies,divideDependencies:o.divideDependencies,isNegativeDependencies:a.isNegativeDependencies,isPositiveDependencies:l.isPositiveDependencies,largerDependencies:c.largerDependencies,mapDependencies:u.mapDependencies,matrixDependencies:d.matrixDependencies,maxDependencies:h.maxDependencies,multiplyDependencies:p.multiplyDependencies,smallerDependencies:m.smallerDependencies,subtractDependencies:f.subtractDependencies,typedDependencies:g.typedDependencies,unaryMinusDependencies:y.unaryMinusDependencies,createSolveODE:b.createSolveODE}},23463:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sortDependencies=void 0;var n=r(8882),i=r(24651),s=r(71038),o=r(76125),a=r(62882);t.sortDependencies={compareDependencies:n.compareDependencies,compareNaturalDependencies:i.compareNaturalDependencies,matrixDependencies:s.matrixDependencies,typedDependencies:o.typedDependencies,createSort:a.createSort}},30037:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpaDependencies=void 0;var n=r(9201),i=r(2838),s=r(22433),o=r(62882);t.SpaDependencies={FibonacciHeapDependencies:n.FibonacciHeapDependencies,addScalarDependencies:i.addScalarDependencies,equalScalarDependencies:s.equalScalarDependencies,createSpaClass:o.createSpaClass}},24979:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sparseDependencies=void 0;var n=r(95618),i=r(76125),s=r(62882);t.sparseDependencies={SparseMatrixDependencies:n.SparseMatrixDependencies,typedDependencies:i.typedDependencies,createSparse:s.createSparse}},95618:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SparseMatrixDependencies=void 0;var n=r(99486),i=r(22433),s=r(76125),o=r(62882);t.SparseMatrixDependencies={MatrixDependencies:n.MatrixDependencies,equalScalarDependencies:i.equalScalarDependencies,typedDependencies:s.typedDependencies,createSparseMatrixClass:o.createSparseMatrixClass}},55457:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.speedOfLightDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.speedOfLightDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createSpeedOfLight:s.createSpeedOfLight}},27519:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.splitUnitDependencies=void 0;var n=r(76125),i=r(62882);t.splitUnitDependencies={typedDependencies:n.typedDependencies,createSplitUnit:i.createSplitUnit}},18645:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sqrtDependencies=void 0;var n=r(3495),i=r(76125),s=r(62882);t.sqrtDependencies={ComplexDependencies:n.ComplexDependencies,typedDependencies:i.typedDependencies,createSqrt:s.createSqrt}},60756:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sqrtmDependencies=void 0;var n=r(26077),i=r(60318),s=r(23389),o=r(64898),a=r(78271),l=r(73943),c=r(93879),u=r(32274),d=r(18645),h=r(81067),p=r(76125),m=r(62882);t.sqrtmDependencies={absDependencies:n.absDependencies,addDependencies:i.addDependencies,identityDependencies:s.identityDependencies,invDependencies:o.invDependencies,mapDependencies:a.mapDependencies,maxDependencies:l.maxDependencies,multiplyDependencies:c.multiplyDependencies,sizeDependencies:u.sizeDependencies,sqrtDependencies:d.sqrtDependencies,subtractDependencies:h.subtractDependencies,typedDependencies:p.typedDependencies,createSqrtm:m.createSqrtm}},59120:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.squareDependencies=void 0;var n=r(76125),i=r(62882);t.squareDependencies={typedDependencies:n.typedDependencies,createSquare:i.createSquare}},27369:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.squeezeDependencies=void 0;var n=r(76125),i=r(62882);t.squeezeDependencies={typedDependencies:n.typedDependencies,createSqueeze:i.createSqueeze}},98068:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stdDependencies=void 0;var n=r(78271),i=r(18645),s=r(76125),o=r(24032),a=r(62882);t.stdDependencies={mapDependencies:n.mapDependencies,sqrtDependencies:i.sqrtDependencies,typedDependencies:s.typedDependencies,varianceDependencies:o.varianceDependencies,createStd:a.createStd}},52200:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stdTransformDependencies=void 0;var n=r(78271),i=r(18645),s=r(76125),o=r(24032),a=r(62882);t.stdTransformDependencies={mapDependencies:n.mapDependencies,sqrtDependencies:i.sqrtDependencies,typedDependencies:s.typedDependencies,varianceDependencies:o.varianceDependencies,createStdTransform:a.createStdTransform}},70253:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stefanBoltzmannDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.stefanBoltzmannDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createStefanBoltzmann:s.createStefanBoltzmann}},50034:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stirlingS2Dependencies=void 0;var n=r(10074),i=r(2838),s=r(99951),o=r(63882),a=r(15698),l=r(76363),c=r(16396),u=r(19688),d=r(81563),h=r(18418),p=r(32755),m=r(51623),f=r(76125),g=r(62882);t.stirlingS2Dependencies={bignumberDependencies:n.bignumberDependencies,addScalarDependencies:i.addScalarDependencies,combinationsDependencies:s.combinationsDependencies,divideScalarDependencies:o.divideScalarDependencies,factorialDependencies:a.factorialDependencies,isIntegerDependencies:l.isIntegerDependencies,isNegativeDependencies:c.isNegativeDependencies,largerDependencies:u.largerDependencies,multiplyScalarDependencies:d.multiplyScalarDependencies,numberDependencies:h.numberDependencies,powDependencies:p.powDependencies,subtractScalarDependencies:m.subtractScalarDependencies,typedDependencies:f.typedDependencies,createStirlingS2:g.createStirlingS2}},48734:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stringDependencies=void 0;var n=r(76125),i=r(62882);t.stringDependencies={typedDependencies:n.typedDependencies,createString:i.createString}},64205:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subsetDependencies=void 0;var n=r(60318),i=r(71038),s=r(76125),o=r(81346),a=r(62882);t.subsetDependencies={addDependencies:n.addDependencies,matrixDependencies:i.matrixDependencies,typedDependencies:s.typedDependencies,zerosDependencies:o.zerosDependencies,createSubset:a.createSubset}},12255:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subsetTransformDependencies=void 0;var n=r(60318),i=r(71038),s=r(76125),o=r(81346),a=r(62882);t.subsetTransformDependencies={addDependencies:n.addDependencies,matrixDependencies:i.matrixDependencies,typedDependencies:s.typedDependencies,zerosDependencies:o.zerosDependencies,createSubsetTransform:a.createSubsetTransform}},81067:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subtractDependencies=void 0;var n=r(34593),i=r(19367),s=r(22433),o=r(71038),a=r(51623),l=r(76125),c=r(41662),u=r(62882);t.subtractDependencies={DenseMatrixDependencies:n.DenseMatrixDependencies,concatDependencies:i.concatDependencies,equalScalarDependencies:s.equalScalarDependencies,matrixDependencies:o.matrixDependencies,subtractScalarDependencies:a.subtractScalarDependencies,typedDependencies:l.typedDependencies,unaryMinusDependencies:c.unaryMinusDependencies,createSubtract:u.createSubtract}},51623:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subtractScalarDependencies=void 0;var n=r(76125),i=r(62882);t.subtractScalarDependencies={typedDependencies:n.typedDependencies,createSubtractScalar:i.createSubtractScalar}},78542:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sumDependencies=void 0;var n=r(60318),i=r(70758),s=r(76125),o=r(62882);t.sumDependencies={addDependencies:n.addDependencies,numericDependencies:i.numericDependencies,typedDependencies:s.typedDependencies,createSum:o.createSum}},84166:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sumTransformDependencies=void 0;var n=r(60318),i=r(70758),s=r(76125),o=r(62882);t.sumTransformDependencies={addDependencies:n.addDependencies,numericDependencies:i.numericDependencies,typedDependencies:s.typedDependencies,createSumTransform:o.createSumTransform}},50764:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sylvesterDependencies=void 0;var n=r(26077),i=r(60318),s=r(19367),o=r(23389),a=r(90529),l=r(85031),c=r(71038),u=r(75457),d=r(93879),h=r(40820),p=r(65724),m=r(64205),f=r(81067),g=r(73014),y=r(76125),b=r(62882);t.sylvesterDependencies={absDependencies:n.absDependencies,addDependencies:i.addDependencies,concatDependencies:s.concatDependencies,identityDependencies:o.identityDependencies,indexDependencies:a.indexDependencies,lusolveDependencies:l.lusolveDependencies,matrixDependencies:c.matrixDependencies,matrixFromColumnsDependencies:u.matrixFromColumnsDependencies,multiplyDependencies:d.multiplyDependencies,rangeDependencies:h.rangeDependencies,schurDependencies:p.schurDependencies,subsetDependencies:m.subsetDependencies,subtractDependencies:f.subtractDependencies,transposeDependencies:g.transposeDependencies,typedDependencies:y.typedDependencies,createSylvester:b.createSylvester}},90703:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SymbolNodeDependencies=void 0;var n=r(24783),i=r(82751),s=r(62882);t.SymbolNodeDependencies={UnitDependencies:n.UnitDependencies,NodeDependencies:i.NodeDependencies,createSymbolNode:s.createSymbolNode}},16717:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.symbolicEqualDependencies=void 0;var n=r(66527),i=r(75534),s=r(24124),o=r(76125),a=r(62882);t.symbolicEqualDependencies={OperatorNodeDependencies:n.OperatorNodeDependencies,parseDependencies:i.parseDependencies,simplifyDependencies:s.simplifyDependencies,typedDependencies:o.typedDependencies,createSymbolicEqual:a.createSymbolicEqual}},94702:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tanDependencies=void 0;var n=r(76125),i=r(62882);t.tanDependencies={typedDependencies:n.typedDependencies,createTan:i.createTan}},69354:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tanhDependencies=void 0;var n=r(76125),i=r(62882);t.tanhDependencies={typedDependencies:n.typedDependencies,createTanh:i.createTanh}},25527:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tauDependencies=void 0;var n=r(31914),i=r(62882);t.tauDependencies={BigNumberDependencies:n.BigNumberDependencies,createTau:i.createTau}},57566:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.thomsonCrossSectionDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.thomsonCrossSectionDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createThomsonCrossSection:s.createThomsonCrossSection}},89126:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toDependencies=void 0;var n=r(19367),i=r(71038),s=r(76125),o=r(62882);t.toDependencies={concatDependencies:n.concatDependencies,matrixDependencies:i.matrixDependencies,typedDependencies:s.typedDependencies,createTo:o.createTo}},30468:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.traceDependencies=void 0;var n=r(60318),i=r(71038),s=r(76125),o=r(62882);t.traceDependencies={addDependencies:n.addDependencies,matrixDependencies:i.matrixDependencies,typedDependencies:s.typedDependencies,createTrace:o.createTrace}},73014:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.transposeDependencies=void 0;var n=r(71038),i=r(76125),s=r(62882);t.transposeDependencies={matrixDependencies:n.matrixDependencies,typedDependencies:i.typedDependencies,createTranspose:s.createTranspose}},4995:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.trueDependencies=void 0;var n=r(62882);t.trueDependencies={createTrue:n.createTrue}},78534:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.typeOfDependencies=void 0;var n=r(76125),i=r(62882);t.typeOfDependencies={typedDependencies:n.typedDependencies,createTypeOf:i.createTypeOf}},76125:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.typedDependencies=void 0;var n=r(31914),i=r(3495),s=r(34593),o=r(16027),a=r(62882);t.typedDependencies={BigNumberDependencies:n.BigNumberDependencies,ComplexDependencies:i.ComplexDependencies,DenseMatrixDependencies:s.DenseMatrixDependencies,FractionDependencies:o.FractionDependencies,createTyped:a.createTyped}},41662:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unaryMinusDependencies=void 0;var n=r(76125),i=r(62882);t.unaryMinusDependencies={typedDependencies:n.typedDependencies,createUnaryMinus:i.createUnaryMinus}},21542:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unaryPlusDependencies=void 0;var n=r(70758),i=r(76125),s=r(62882);t.unaryPlusDependencies={numericDependencies:n.numericDependencies,typedDependencies:i.typedDependencies,createUnaryPlus:s.createUnaryPlus}},5088:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unequalDependencies=void 0;var n=r(34593),i=r(19367),s=r(22433),o=r(71038),a=r(76125),l=r(62882);t.unequalDependencies={DenseMatrixDependencies:n.DenseMatrixDependencies,concatDependencies:i.concatDependencies,equalScalarDependencies:s.equalScalarDependencies,matrixDependencies:o.matrixDependencies,typedDependencies:a.typedDependencies,createUnequal:l.createUnequal}},24783:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnitDependencies=void 0;var n=r(31914),i=r(3495),s=r(16027),o=r(26077),a=r(2838),l=r(63882),c=r(58609),u=r(93958),d=r(54032),h=r(53530),p=r(81563),m=r(18418),f=r(32755),g=r(87025),y=r(51623),b=r(62882);t.UnitDependencies={BigNumberDependencies:n.BigNumberDependencies,ComplexDependencies:i.ComplexDependencies,FractionDependencies:s.FractionDependencies,absDependencies:o.absDependencies,addScalarDependencies:a.addScalarDependencies,divideScalarDependencies:l.divideScalarDependencies,equalDependencies:c.equalDependencies,fixDependencies:u.fixDependencies,formatDependencies:d.formatDependencies,isNumericDependencies:h.isNumericDependencies,multiplyScalarDependencies:p.multiplyScalarDependencies,numberDependencies:m.numberDependencies,powDependencies:f.powDependencies,roundDependencies:g.roundDependencies,subtractScalarDependencies:y.subtractScalarDependencies,createUnitClass:b.createUnitClass}},93549:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unitDependencies=void 0;var n=r(24783),i=r(76125),s=r(62882);t.unitDependencies={UnitDependencies:n.UnitDependencies,typedDependencies:i.typedDependencies,createUnitFunction:s.createUnitFunction}},61024:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EDependencies=void 0;var n=r(44962),i=r(62882);t.EDependencies={eDependencies:n.eDependencies,createUppercaseE:i.createUppercaseE}},27398:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PIDependencies=void 0;var n=r(43516),i=r(62882);t.PIDependencies={piDependencies:n.piDependencies,createUppercasePi:i.createUppercasePi}},87053:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.usolveDependencies=void 0;var n=r(34593),i=r(63882),s=r(22433),o=r(71038),a=r(81563),l=r(51623),c=r(76125),u=r(62882);t.usolveDependencies={DenseMatrixDependencies:n.DenseMatrixDependencies,divideScalarDependencies:i.divideScalarDependencies,equalScalarDependencies:s.equalScalarDependencies,matrixDependencies:o.matrixDependencies,multiplyScalarDependencies:a.multiplyScalarDependencies,subtractScalarDependencies:l.subtractScalarDependencies,typedDependencies:c.typedDependencies,createUsolve:u.createUsolve}},74896:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.usolveAllDependencies=void 0;var n=r(34593),i=r(63882),s=r(22433),o=r(71038),a=r(81563),l=r(51623),c=r(76125),u=r(62882);t.usolveAllDependencies={DenseMatrixDependencies:n.DenseMatrixDependencies,divideScalarDependencies:i.divideScalarDependencies,equalScalarDependencies:s.equalScalarDependencies,matrixDependencies:o.matrixDependencies,multiplyScalarDependencies:a.multiplyScalarDependencies,subtractScalarDependencies:l.subtractScalarDependencies,typedDependencies:c.typedDependencies,createUsolveAll:u.createUsolveAll}},40988:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.vacuumImpedanceDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.vacuumImpedanceDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createVacuumImpedance:s.createVacuumImpedance}},24032:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.varianceDependencies=void 0;var n=r(60318),i=r(21381),s=r(45242),o=r(8828),a=r(93879),l=r(81067),c=r(76125),u=r(62882);t.varianceDependencies={addDependencies:n.addDependencies,applyDependencies:i.applyDependencies,divideDependencies:s.divideDependencies,isNaNDependencies:o.isNaNDependencies,multiplyDependencies:a.multiplyDependencies,subtractDependencies:l.subtractDependencies,typedDependencies:c.typedDependencies,createVariance:u.createVariance}},53764:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.varianceTransformDependencies=void 0;var n=r(60318),i=r(21381),s=r(45242),o=r(8828),a=r(93879),l=r(81067),c=r(76125),u=r(62882);t.varianceTransformDependencies={addDependencies:n.addDependencies,applyDependencies:i.applyDependencies,divideDependencies:s.divideDependencies,isNaNDependencies:o.isNaNDependencies,multiplyDependencies:a.multiplyDependencies,subtractDependencies:l.subtractDependencies,typedDependencies:c.typedDependencies,createVarianceTransform:u.createVarianceTransform}},49581:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.versionDependencies=void 0;var n=r(62882);t.versionDependencies={createVersion:n.createVersion}},1512:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.weakMixingAngleDependencies=void 0;var n=r(31914),i=r(62882);t.weakMixingAngleDependencies={BigNumberDependencies:n.BigNumberDependencies,createWeakMixingAngle:i.createWeakMixingAngle}},51711:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wienDisplacementDependencies=void 0;var n=r(31914),i=r(24783),s=r(62882);t.wienDisplacementDependencies={BigNumberDependencies:n.BigNumberDependencies,UnitDependencies:i.UnitDependencies,createWienDisplacement:s.createWienDisplacement}},54357:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.xgcdDependencies=void 0;var n=r(31914),i=r(71038),s=r(76125),o=r(62882);t.xgcdDependencies={BigNumberDependencies:n.BigNumberDependencies,matrixDependencies:i.matrixDependencies,typedDependencies:s.typedDependencies,createXgcd:o.createXgcd}},64836:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.xorDependencies=void 0;var n=r(34593),i=r(19367),s=r(71038),o=r(76125),a=r(62882);t.xorDependencies={DenseMatrixDependencies:n.DenseMatrixDependencies,concatDependencies:i.concatDependencies,matrixDependencies:s.matrixDependencies,typedDependencies:o.typedDependencies,createXor:a.createXor}},81346:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.zerosDependencies=void 0;var n=r(31914),i=r(71038),s=r(76125),o=r(62882);t.zerosDependencies={BigNumberDependencies:n.BigNumberDependencies,matrixDependencies:i.matrixDependencies,typedDependencies:s.typedDependencies,createZeros:o.createZeros}},15321:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.zetaDependencies=void 0;var n=r(31914),i=r(3495),s=r(60318),o=r(45242),a=r(58609),l=r(15698),c=r(69700),u=r(16396),d=r(93879),h=r(43516),p=r(32755),m=r(10723),f=r(15167),g=r(81067),y=r(76125),b=r(62882);t.zetaDependencies={BigNumberDependencies:n.BigNumberDependencies,ComplexDependencies:i.ComplexDependencies,addDependencies:s.addDependencies,divideDependencies:o.divideDependencies,equalDependencies:a.equalDependencies,factorialDependencies:l.factorialDependencies,gammaDependencies:c.gammaDependencies,isNegativeDependencies:u.isNegativeDependencies,multiplyDependencies:d.multiplyDependencies,piDependencies:h.piDependencies,powDependencies:p.powDependencies,sinDependencies:m.sinDependencies,smallerEqDependencies:f.smallerEqDependencies,subtractDependencies:g.subtractDependencies,typedDependencies:y.typedDependencies,createZeta:b.createZeta}},70306:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.zpk2tfDependencies=void 0;var n=r(3495),i=r(60318),s=r(93879),o=r(18418),a=r(76125),l=r(62882);t.zpk2tfDependencies={ComplexDependencies:n.ComplexDependencies,addDependencies:i.addDependencies,multiplyDependencies:s.multiplyDependencies,numberDependencies:o.numberDependencies,typedDependencies:a.typedDependencies,createZpk2tf:l.createZpk2tf}},97573:(e,t,r)=>{"use strict";var n=r(87929);Object.defineProperty(t,"__esModule",{value:!0}),t.derivative=t.compile=t.chain=t.SymbolNode=t.RelationalNode=t.RangeNode=t.Parser=t.ParenthesisNode=t.OperatorNode=t.ObjectNode=t.Node=t.IndexNode=t.Help=t.FunctionNode=t.FunctionAssignmentNode=t.ConstantNode=t.ConditionalNode=t.Chain=t.BlockNode=t.AssignmentNode=t.ArrayNode=t.AccessorNode=void 0,Object.defineProperty(t,"docs",{enumerable:!0,get:function(){return l.embeddedDocs}}),t.symbolicEqual=t.simplifyCore=t.simplifyConstant=t.simplify=t.reviver=t.resolve=t.rationalize=t.parser=t.parse=t.leafCount=t.help=t.evaluate=void 0;var i=n(r(37693)),s=r(87651),o=r(62882),a=r(97103),l=r(8356);const c={},u={},d={},h=t.Node=(0,o.createNode)({mathWithTransform:u}),p=t.ObjectNode=(0,o.createObjectNode)({Node:h}),m=t.OperatorNode=(0,o.createOperatorNode)({Node:h}),f=t.ParenthesisNode=(0,o.createParenthesisNode)({Node:h}),g=t.RelationalNode=(0,o.createRelationalNode)({Node:h}),y=t.ArrayNode=(0,o.createArrayNode)({Node:h}),b=t.BlockNode=(0,o.createBlockNode)({Node:h,ResultSet:a.ResultSet}),v=t.ConditionalNode=(0,o.createConditionalNode)({Node:h}),_=t.ConstantNode=(0,o.createConstantNode)({Node:h}),x=t.RangeNode=(0,o.createRangeNode)({Node:h}),w=t.reviver=(0,o.createReviver)({classes:d}),R=t.Chain=(0,o.createChainClass)({math:c,typed:a.typed}),k=t.FunctionAssignmentNode=(0,o.createFunctionAssignmentNode)({Node:h,typed:a.typed}),j=t.chain=(0,o.createChain)({Chain:R,typed:a.typed}),z=t.IndexNode=(0,o.createIndexNode)({Node:h,size:a.size}),q=t.AccessorNode=(0,o.createAccessorNode)({Node:h,subset:a.subset}),$=t.AssignmentNode=(0,o.createAssignmentNode)({matrix:a.matrix,Node:h,subset:a.subset}),Z=t.SymbolNode=(0,o.createSymbolNode)({Unit:a.Unit,Node:h,math:c}),X=t.FunctionNode=(0,o.createFunctionNode)({Node:h,SymbolNode:Z,math:c}),Y=t.parse=(0,o.createParse)({AccessorNode:q,ArrayNode:y,AssignmentNode:$,BlockNode:b,ConditionalNode:v,ConstantNode:_,FunctionAssignmentNode:k,FunctionNode:X,IndexNode:z,ObjectNode:p,OperatorNode:m,ParenthesisNode:f,RangeNode:x,RelationalNode:g,SymbolNode:Z,config:s.config,numeric:a.numeric,typed:a.typed}),ee=t.resolve=(0,o.createResolve)({ConstantNode:_,FunctionNode:X,OperatorNode:m,ParenthesisNode:f,parse:Y,typed:a.typed}),te=t.simplifyConstant=(0,o.createSimplifyConstant)({bignumber:a.bignumber,fraction:a.fraction,AccessorNode:q,ArrayNode:y,ConstantNode:_,FunctionNode:X,IndexNode:z,ObjectNode:p,OperatorNode:m,SymbolNode:Z,config:s.config,mathWithTransform:u,matrix:a.matrix,typed:a.typed}),re=t.compile=(0,o.createCompile)({parse:Y,typed:a.typed}),ne=t.simplifyCore=(0,o.createSimplifyCore)({AccessorNode:q,ArrayNode:y,ConstantNode:_,FunctionNode:X,IndexNode:z,ObjectNode:p,OperatorNode:m,ParenthesisNode:f,SymbolNode:Z,add:a.add,divide:a.divide,equal:a.equal,isZero:a.isZero,multiply:a.multiply,parse:Y,pow:a.pow,subtract:a.subtract,typed:a.typed}),ie=t.evaluate=(0,o.createEvaluate)({parse:Y,typed:a.typed}),se=t.Help=(0,o.createHelpClass)({evaluate:ie}),oe=t.Parser=(0,o.createParserClass)({evaluate:ie}),ae=t.simplify=(0,o.createSimplify)({bignumber:a.bignumber,fraction:a.fraction,AccessorNode:q,ArrayNode:y,ConstantNode:_,FunctionNode:X,IndexNode:z,ObjectNode:p,OperatorNode:m,ParenthesisNode:f,SymbolNode:Z,add:a.add,config:s.config,divide:a.divide,equal:a.equal,isZero:a.isZero,mathWithTransform:u,matrix:a.matrix,multiply:a.multiply,parse:Y,pow:a.pow,resolve:ee,simplifyConstant:te,simplifyCore:ne,subtract:a.subtract,typed:a.typed}),le=t.symbolicEqual=(0,o.createSymbolicEqual)({OperatorNode:m,parse:Y,simplify:ae,typed:a.typed}),ce=t.leafCount=(0,o.createLeafCount)({parse:Y,typed:a.typed}),ue=t.parser=(0,o.createParser)({Parser:oe,typed:a.typed}),de=t.rationalize=(0,o.createRationalize)({bignumber:a.bignumber,fraction:a.fraction,AccessorNode:q,ArrayNode:y,ConstantNode:_,FunctionNode:X,IndexNode:z,ObjectNode:p,OperatorNode:m,ParenthesisNode:f,SymbolNode:Z,add:a.add,config:s.config,divide:a.divide,equal:a.equal,isZero:a.isZero,mathWithTransform:u,matrix:a.matrix,multiply:a.multiply,parse:Y,pow:a.pow,simplify:ae,simplifyConstant:te,simplifyCore:ne,subtract:a.subtract,typed:a.typed}),he=t.derivative=(0,o.createDerivative)({ConstantNode:_,FunctionNode:X,OperatorNode:m,ParenthesisNode:f,SymbolNode:Z,config:s.config,equal:a.equal,isZero:a.isZero,numeric:a.numeric,parse:Y,simplify:ae,typed:a.typed}),pe=t.help=(0,o.createHelp)({Help:se,mathWithTransform:u,typed:a.typed});(0,i.default)(c,{e:a.e,false:a._false,fineStructure:a.fineStructure,i:a.i,Infinity:a._Infinity,LN10:a.LN10,LOG10E:a.LOG10E,NaN:a._NaN,null:a._null,phi:a.phi,SQRT1_2:a.SQRT1_2,sackurTetrode:a.sackurTetrode,tau:a.tau,true:a._true,E:a.e,version:a.version,efimovFactor:a.efimovFactor,LN2:a.LN2,pi:a.pi,replacer:a.replacer,reviver:w,SQRT2:a.SQRT2,typed:a.typed,PI:a.pi,weakMixingAngle:a.weakMixingAngle,abs:a.abs,acos:a.acos,acot:a.acot,acsc:a.acsc,addScalar:a.addScalar,arg:a.arg,asech:a.asech,asinh:a.asinh,atan:a.atan,atanh:a.atanh,bigint:a.bigint,bitNot:a.bitNot,boolean:a.boolean,clone:a.clone,combinations:a.combinations,complex:a.complex,conj:a.conj,cos:a.cos,cot:a.cot,csc:a.csc,cube:a.cube,equalScalar:a.equalScalar,erf:a.erf,exp:a.exp,expm1:a.expm1,filter:a.filter,flatten:a.flatten,forEach:a.forEach,format:a.format,getMatrixDataType:a.getMatrixDataType,hex:a.hex,im:a.im,isInteger:a.isInteger,isNegative:a.isNegative,isPositive:a.isPositive,isZero:a.isZero,LOG2E:a.LOG2E,lgamma:a.lgamma,log10:a.log10,log2:a.log2,map:a.map,multiplyScalar:a.multiplyScalar,not:a.not,number:a.number,oct:a.oct,pickRandom:a.pickRandom,print:a.print,random:a.random,re:a.re,sec:a.sec,sign:a.sign,sin:a.sin,splitUnit:a.splitUnit,square:a.square,string:a.string,subtractScalar:a.subtractScalar,tan:a.tan,typeOf:a.typeOf,acosh:a.acosh,acsch:a.acsch,apply:a.apply,asec:a.asec,bignumber:a.bignumber,chain:j,combinationsWithRep:a.combinationsWithRep,cosh:a.cosh,csch:a.csch,isNaN:a.isNaN,isPrime:a.isPrime,randomInt:a.randomInt,sech:a.sech,sinh:a.sinh,sparse:a.sparse,sqrt:a.sqrt,squeeze:a.squeeze,tanh:a.tanh,unaryMinus:a.unaryMinus,acoth:a.acoth,bin:a.bin,coth:a.coth,fraction:a.fraction,isNumeric:a.isNumeric,matrix:a.matrix,matrixFromFunction:a.matrixFromFunction,mode:a.mode,numeric:a.numeric,prod:a.prod,reshape:a.reshape,size:a.size,transpose:a.transpose,xgcd:a.xgcd,zeros:a.zeros,asin:a.asin,cbrt:a.cbrt,concat:a.concat,count:a.count,ctranspose:a.ctranspose,diag:a.diag,divideScalar:a.divideScalar,dotDivide:a.dotDivide,equal:a.equal,hasNumericValue:a.hasNumericValue,identity:a.identity,kron:a.kron,largerEq:a.largerEq,leftShift:a.leftShift,lsolve:a.lsolve,matrixFromColumns:a.matrixFromColumns,nthRoot:a.nthRoot,ones:a.ones,qr:a.qr,resize:a.resize,rightArithShift:a.rightArithShift,round:a.round,smaller:a.smaller,subtract:a.subtract,to:a.to,unaryPlus:a.unaryPlus,usolve:a.usolve,xor:a.xor,add:a.add,atan2:a.atan2,bitAnd:a.bitAnd,bitOr:a.bitOr,bitXor:a.bitXor,catalan:a.catalan,compare:a.compare,compareText:a.compareText,cumsum:a.cumsum,deepEqual:a.deepEqual,diff:a.diff,distance:a.distance,dot:a.dot,equalText:a.equalText,floor:a.floor,gcd:a.gcd,hypot:a.hypot,larger:a.larger,log:a.log,lsolveAll:a.lsolveAll,matrixFromRows:a.matrixFromRows,min:a.min,mod:a.mod,multiply:a.multiply,nthRoots:a.nthRoots,or:a.or,partitionSelect:a.partitionSelect,rightLogShift:a.rightLogShift,slu:a.slu,subset:a.subset,sum:a.sum,trace:a.trace,usolveAll:a.usolveAll,zpk2tf:a.zpk2tf,ceil:a.ceil,compareNatural:a.compareNatural,composition:a.composition,cross:a.cross,det:a.det,dotMultiply:a.dotMultiply,fix:a.fix,index:a.index,intersect:a.intersect,invmod:a.invmod,lcm:a.lcm,log1p:a.log1p,max:a.max,setCartesian:a.setCartesian,setDistinct:a.setDistinct,setIsSubset:a.setIsSubset,setPowerset:a.setPowerset,smallerEq:a.smallerEq,sort:a.sort,unequal:a.unequal,and:a.and,range:a.range,row:a.row,setDifference:a.setDifference,setMultiplicity:a.setMultiplicity,setSymDifference:a.setSymDifference,column:a.column,inv:a.inv,lup:a.lup,pinv:a.pinv,pow:a.pow,setIntersect:a.setIntersect,setUnion:a.setUnion,sqrtm:a.sqrtm,vacuumImpedance:a.vacuumImpedance,wienDisplacement:a.wienDisplacement,atomicMass:a.atomicMass,bohrMagneton:a.bohrMagneton,boltzmann:a.boltzmann,conductanceQuantum:a.conductanceQuantum,coulomb:a.coulomb,deuteronMass:a.deuteronMass,dotPow:a.dotPow,electricConstant:a.electricConstant,elementaryCharge:a.elementaryCharge,expm:a.expm,faraday:a.faraday,fft:a.fft,gamma:a.gamma,gravitationConstant:a.gravitationConstant,hartreeEnergy:a.hartreeEnergy,ifft:a.ifft,klitzing:a.klitzing,loschmidt:a.loschmidt,magneticConstant:a.magneticConstant,molarMass:a.molarMass,molarPlanckConstant:a.molarPlanckConstant,neutronMass:a.neutronMass,nuclearMagneton:a.nuclearMagneton,planckCharge:a.planckCharge,planckLength:a.planckLength,planckTemperature:a.planckTemperature,protonMass:a.protonMass,quantumOfCirculation:a.quantumOfCirculation,reducedPlanckConstant:a.reducedPlanckConstant,rydberg:a.rydberg,secondRadiation:a.secondRadiation,speedOfLight:a.speedOfLight,stefanBoltzmann:a.stefanBoltzmann,thomsonCrossSection:a.thomsonCrossSection,avogadro:a.avogadro,bohrRadius:a.bohrRadius,createUnit:a.createUnit,divide:a.divide,electronMass:a.electronMass,factorial:a.factorial,firstRadiation:a.firstRadiation,gravity:a.gravity,inverseConductanceQuantum:a.inverseConductanceQuantum,lusolve:a.lusolve,magneticFluxQuantum:a.magneticFluxQuantum,molarMassC12:a.molarMassC12,multinomial:a.multinomial,parse:Y,permutations:a.permutations,planckMass:a.planckMass,polynomialRoot:a.polynomialRoot,resolve:ee,setSize:a.setSize,simplifyConstant:te,solveODE:a.solveODE,stirlingS2:a.stirlingS2,unit:a.unit,bellNumbers:a.bellNumbers,compile:re,eigs:a.eigs,fermiCoupling:a.fermiCoupling,gasConstant:a.gasConstant,kldivergence:a.kldivergence,mean:a.mean,molarVolume:a.molarVolume,planckConstant:a.planckConstant,quantileSeq:a.quantileSeq,simplifyCore:ne,variance:a.variance,classicalElectronRadius:a.classicalElectronRadius,evaluate:ie,median:a.median,simplify:ae,symbolicEqual:le,corr:a.corr,freqz:a.freqz,leafCount:ce,mad:a.mad,parser:ue,rationalize:de,std:a.std,zeta:a.zeta,derivative:he,norm:a.norm,rotationMatrix:a.rotationMatrix,help:pe,planckTime:a.planckTime,schur:a.schur,rotate:a.rotate,sylvester:a.sylvester,lyap:a.lyap,config:s.config}),(0,i.default)(u,c,{filter:(0,o.createFilterTransform)({typed:a.typed}),forEach:(0,o.createForEachTransform)({typed:a.typed}),map:(0,o.createMapTransform)({typed:a.typed}),apply:(0,o.createApplyTransform)({isInteger:a.isInteger,typed:a.typed}),or:(0,o.createOrTransform)({DenseMatrix:a.DenseMatrix,concat:a.concat,equalScalar:a.equalScalar,matrix:a.matrix,typed:a.typed}),and:(0,o.createAndTransform)({add:a.add,concat:a.concat,equalScalar:a.equalScalar,matrix:a.matrix,not:a.not,typed:a.typed,zeros:a.zeros}),concat:(0,o.createConcatTransform)({isInteger:a.isInteger,matrix:a.matrix,typed:a.typed}),max:(0,o.createMaxTransform)({config:s.config,larger:a.larger,numeric:a.numeric,typed:a.typed}),print:(0,o.createPrintTransform)({add:a.add,matrix:a.matrix,typed:a.typed,zeros:a.zeros}),bitAnd:(0,o.createBitAndTransform)({add:a.add,concat:a.concat,equalScalar:a.equalScalar,matrix:a.matrix,not:a.not,typed:a.typed,zeros:a.zeros}),diff:(0,o.createDiffTransform)({bignumber:a.bignumber,matrix:a.matrix,number:a.number,subtract:a.subtract,typed:a.typed}),min:(0,o.createMinTransform)({config:s.config,numeric:a.numeric,smaller:a.smaller,typed:a.typed}),subset:(0,o.createSubsetTransform)({add:a.add,matrix:a.matrix,typed:a.typed,zeros:a.zeros}),bitOr:(0,o.createBitOrTransform)({DenseMatrix:a.DenseMatrix,concat:a.concat,equalScalar:a.equalScalar,matrix:a.matrix,typed:a.typed}),cumsum:(0,o.createCumSumTransform)({add:a.add,typed:a.typed,unaryPlus:a.unaryPlus}),index:(0,o.createIndexTransform)({Index:a.Index,getMatrixDataType:a.getMatrixDataType}),sum:(0,o.createSumTransform)({add:a.add,config:s.config,numeric:a.numeric,typed:a.typed}),range:(0,o.createRangeTransform)({bignumber:a.bignumber,matrix:a.matrix,add:a.add,config:s.config,isPositive:a.isPositive,larger:a.larger,largerEq:a.largerEq,smaller:a.smaller,smallerEq:a.smallerEq,typed:a.typed}),row:(0,o.createRowTransform)({Index:a.Index,matrix:a.matrix,range:a.range,typed:a.typed}),column:(0,o.createColumnTransform)({Index:a.Index,matrix:a.matrix,range:a.range,typed:a.typed}),mean:(0,o.createMeanTransform)({add:a.add,divide:a.divide,typed:a.typed}),quantileSeq:(0,o.createQuantileSeqTransform)({add:a.add,bignumber:a.bignumber,compare:a.compare,divide:a.divide,isInteger:a.isInteger,larger:a.larger,multiply:a.multiply,partitionSelect:a.partitionSelect,smaller:a.smaller,smallerEq:a.smallerEq,subtract:a.subtract,typed:a.typed}),variance:(0,o.createVarianceTransform)({add:a.add,apply:a.apply,divide:a.divide,isNaN:a.isNaN,multiply:a.multiply,subtract:a.subtract,typed:a.typed}),std:(0,o.createStdTransform)({map:a.map,sqrt:a.sqrt,typed:a.typed,variance:a.variance})}),(0,i.default)(d,{BigNumber:a.BigNumber,Complex:a.Complex,Fraction:a.Fraction,Matrix:a.Matrix,Node:h,ObjectNode:p,OperatorNode:m,ParenthesisNode:f,Range:a.Range,RelationalNode:g,ResultSet:a.ResultSet,ArrayNode:y,BlockNode:b,ConditionalNode:v,ConstantNode:_,DenseMatrix:a.DenseMatrix,RangeNode:x,Chain:R,FunctionAssignmentNode:k,SparseMatrix:a.SparseMatrix,IndexNode:z,ImmutableDenseMatrix:a.ImmutableDenseMatrix,Index:a.Index,AccessorNode:q,AssignmentNode:$,FibonacciHeap:a.FibonacciHeap,Spa:a.Spa,Unit:a.Unit,SymbolNode:Z,FunctionNode:X,Help:se,Parser:oe}),R.createProxy(c)},38042:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={config:!0,IndexError:!0,DimensionError:!0,ArgumentsError:!0,create:!0,factory:!0};Object.defineProperty(t,"ArgumentsError",{enumerable:!0,get:function(){return u.ArgumentsError}}),Object.defineProperty(t,"DimensionError",{enumerable:!0,get:function(){return c.DimensionError}}),Object.defineProperty(t,"IndexError",{enumerable:!0,get:function(){return l.IndexError}}),Object.defineProperty(t,"config",{enumerable:!0,get:function(){return i.config}}),Object.defineProperty(t,"create",{enumerable:!0,get:function(){return p.create}}),Object.defineProperty(t,"factory",{enumerable:!0,get:function(){return m.factory}});var i=r(87651),s=r(97103);Object.keys(s).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===s[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}}))}));var o=r(97573);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))}));var a=r(63606);Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===a[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}}))}));var l=r(17967),c=r(6523),u=r(11563),d=r(19213);Object.keys(d).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===d[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return d[e]}}))}));var h=r(62882);Object.keys(h).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===h[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return h[e]}}))}));var p=r(86856),m=r(66212)},97103:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.e=t.dotPow=t.dotMultiply=t.dotDivide=t.dot=t.divideScalar=t.divide=t.distance=t.diff=t.diag=t.deuteronMass=t.det=t.deepEqual=t.cumsum=t.cube=t.ctranspose=t.csch=t.csc=t.cross=t.createUnit=t.count=t.coulomb=t.coth=t.cot=t.cosh=t.cos=t.corr=t.conj=t.conductanceQuantum=t.concat=t.composition=t.complex=t.compareText=t.compareNatural=t.compare=t.combinationsWithRep=t.combinations=t.column=t.clone=t.classicalElectronRadius=t.ceil=t.cbrt=t.catalan=t.boolean=t.boltzmann=t.bohrRadius=t.bohrMagneton=t.bitXor=t.bitOr=t.bitNot=t.bitAnd=t.bin=t.bignumber=t.bigint=t.bellNumbers=t.avogadro=t.atomicMass=t.atanh=t.atan2=t.atan=t.asinh=t.asin=t.asech=t.asec=t.arg=t.apply=t.and=t.addScalar=t.add=t.acsch=t.acsc=t.acoth=t.acot=t.acosh=t.acos=t.abs=t._true=t._null=t._false=t._NaN=t._Infinity=t.Unit=t.SparseMatrix=t.Spa=t.SQRT2=t.SQRT1_2=t.ResultSet=t.Range=t.Matrix=t.LOG2E=t.LOG10E=t.LN2=t.LN10=t.Index=t.ImmutableDenseMatrix=t.Fraction=t.FibonacciHeap=t.DenseMatrix=t.Complex=t.BigNumber=void 0,t.oct=t.numeric=t.number=t.nuclearMagneton=t.nthRoots=t.nthRoot=t.not=t.norm=t.neutronMass=t.multiplyScalar=t.multiply=t.multinomial=t.molarVolume=t.molarPlanckConstant=t.molarMassC12=t.molarMass=t.mode=t.mod=t.min=t.median=t.mean=t.max=t.matrixFromRows=t.matrixFromFunction=t.matrixFromColumns=t.matrix=t.map=t.magneticFluxQuantum=t.magneticConstant=t.mad=t.lyap=t.lusolve=t.lup=t.lsolveAll=t.lsolve=t.loschmidt=t.log2=t.log1p=t.log10=t.log=t.lgamma=t.leftShift=t.lcm=t.largerEq=t.larger=t.kron=t.klitzing=t.kldivergence=t.isZero=t.isPrime=t.isPositive=t.isNumeric=t.isNegative=t.isNaN=t.isInteger=t.invmod=t.inverseConductanceQuantum=t.inv=t.intersect=t.index=t.im=t.ifft=t.identity=t.i=t.hypot=t.hex=t.hasNumericValue=t.hartreeEnergy=t.gravity=t.gravitationConstant=t.getMatrixDataType=t.gcd=t.gasConstant=t.gamma=t.freqz=t.fraction=t.format=t.forEach=t.floor=t.flatten=t.fix=t.firstRadiation=t.fineStructure=t.filter=t.fft=t.fermiCoupling=t.faraday=t.factorial=t.expm1=t.expm=t.exp=t.erf=t.equalText=t.equalScalar=t.equal=t.elementaryCharge=t.electronMass=t.electricConstant=t.eigs=t.efimovFactor=void 0,t.zeros=t.xor=t.xgcd=t.wienDisplacement=t.weakMixingAngle=t.version=t.variance=t.vacuumImpedance=t.usolveAll=t.usolve=t.unit=t.unequal=t.unaryPlus=t.unaryMinus=t.typed=t.typeOf=t.transpose=t.trace=t.to=t.thomsonCrossSection=t.tau=t.tanh=t.tan=t.sylvester=t.sum=t.subtractScalar=t.subtract=t.subset=t.string=t.stirlingS2=t.stefanBoltzmann=t.std=t.squeeze=t.square=t.sqrtm=t.sqrt=t.splitUnit=t.speedOfLight=t.sparse=t.sort=t.solveODE=t.smallerEq=t.smaller=t.slu=t.size=t.sinh=t.sin=t.sign=t.setUnion=t.setSymDifference=t.setSize=t.setPowerset=t.setMultiplicity=t.setIsSubset=t.setIntersect=t.setDistinct=t.setDifference=t.setCartesian=t.secondRadiation=t.sech=t.sec=t.schur=t.sackurTetrode=t.rydberg=t.row=t.round=t.rotationMatrix=t.rotate=t.rightLogShift=t.rightArithShift=t.resize=t.reshape=t.replacer=t.reducedPlanckConstant=t.re=t.range=t.randomInt=t.random=t.quantumOfCirculation=t.quantileSeq=t.qr=t.protonMass=t.prod=t.print=t.pow=t.polynomialRoot=t.planckTime=t.planckTemperature=t.planckMass=t.planckLength=t.planckConstant=t.planckCharge=t.pinv=t.pickRandom=t.pi=t.phi=t.permutations=t.partitionSelect=t.or=t.ones=void 0,t.zpk2tf=t.zeta=void 0;var n=r(87651),i=r(62882);const s=t.BigNumber=(0,i.createBigNumberClass)({config:n.config}),o=t.Complex=(0,i.createComplexClass)({}),a=(t.e=(0,i.createE)({BigNumber:s,config:n.config}),t._false=(0,i.createFalse)({}),t.fineStructure=(0,i.createFineStructure)({BigNumber:s,config:n.config}),t.Fraction=(0,i.createFractionClass)({})),l=t.i=(0,i.createI)({Complex:o}),c=(t._Infinity=(0,i.createInfinity)({BigNumber:s,config:n.config}),t.LN10=(0,i.createLN10)({BigNumber:s,config:n.config}),t.LOG10E=(0,i.createLOG10E)({BigNumber:s,config:n.config}),t.Matrix=(0,i.createMatrixClass)({})),u=(t._NaN=(0,i.createNaN)({BigNumber:s,config:n.config}),t._null=(0,i.createNull)({}),t.phi=(0,i.createPhi)({BigNumber:s,config:n.config}),t.Range=(0,i.createRangeClass)({}),t.ResultSet=(0,i.createResultSet)({}),t.SQRT1_2=(0,i.createSQRT1_2)({BigNumber:s,config:n.config}),t.sackurTetrode=(0,i.createSackurTetrode)({BigNumber:s,config:n.config}),t.tau=(0,i.createTau)({BigNumber:s,config:n.config})),d=(t._true=(0,i.createTrue)({}),t.version=(0,i.createVersion)({}),t.DenseMatrix=(0,i.createDenseMatrixClass)({Matrix:c})),h=(t.efimovFactor=(0,i.createEfimovFactor)({BigNumber:s,config:n.config}),t.LN2=(0,i.createLN2)({BigNumber:s,config:n.config}),t.pi=(0,i.createPi)({BigNumber:s,config:n.config})),p=(t.replacer=(0,i.createReplacer)({}),t.SQRT2=(0,i.createSQRT2)({BigNumber:s,config:n.config}),t.typed=(0,i.createTyped)({BigNumber:s,Complex:o,DenseMatrix:d,Fraction:a})),m=(t.weakMixingAngle=(0,i.createWeakMixingAngle)({BigNumber:s,config:n.config}),t.abs=(0,i.createAbs)({typed:p})),f=(t.acos=(0,i.createAcos)({Complex:o,config:n.config,typed:p}),t.acot=(0,i.createAcot)({BigNumber:s,typed:p}),t.acsc=(0,i.createAcsc)({BigNumber:s,Complex:o,config:n.config,typed:p}),t.addScalar=(0,i.createAddScalar)({typed:p})),g=(t.arg=(0,i.createArg)({typed:p}),t.asech=(0,i.createAsech)({BigNumber:s,Complex:o,config:n.config,typed:p}),t.asinh=(0,i.createAsinh)({typed:p}),t.atan=(0,i.createAtan)({typed:p})),y=(t.atanh=(0,i.createAtanh)({Complex:o,config:n.config,typed:p}),t.bigint=(0,i.createBigint)({typed:p}),t.bitNot=(0,i.createBitNot)({typed:p}),t.boolean=(0,i.createBoolean)({typed:p}),t.clone=(0,i.createClone)({typed:p}),t.combinations=(0,i.createCombinations)({typed:p})),b=t.complex=(0,i.createComplex)({Complex:o,typed:p}),v=t.conj=(0,i.createConj)({typed:p}),_=t.cos=(0,i.createCos)({typed:p}),x=(t.cot=(0,i.createCot)({BigNumber:s,typed:p}),t.csc=(0,i.createCsc)({BigNumber:s,typed:p}),t.cube=(0,i.createCube)({typed:p}),t.equalScalar=(0,i.createEqualScalar)({config:n.config,typed:p})),w=(t.erf=(0,i.createErf)({typed:p}),t.exp=(0,i.createExp)({typed:p})),R=(t.expm1=(0,i.createExpm1)({Complex:o,typed:p}),t.filter=(0,i.createFilter)({typed:p}),t.flatten=(0,i.createFlatten)({typed:p})),k=(t.forEach=(0,i.createForEach)({typed:p}),t.format=(0,i.createFormat)({typed:p})),j=t.getMatrixDataType=(0,i.createGetMatrixDataType)({typed:p}),z=(t.hex=(0,i.createHex)({format:k,typed:p}),t.im=(0,i.createIm)({typed:p})),q=t.isInteger=(0,i.createIsInteger)({typed:p}),$=t.isNegative=(0,i.createIsNegative)({config:n.config,typed:p}),Z=t.isPositive=(0,i.createIsPositive)({config:n.config,typed:p}),X=t.isZero=(0,i.createIsZero)({equalScalar:x,typed:p}),Y=(t.LOG2E=(0,i.createLOG2E)({BigNumber:s,config:n.config}),t.lgamma=(0,i.createLgamma)({Complex:o,typed:p}),t.log10=(0,i.createLog10)({Complex:o,config:n.config,typed:p}),t.log2=(0,i.createLog2)({Complex:o,config:n.config,typed:p})),ee=t.map=(0,i.createMap)({typed:p}),te=t.multiplyScalar=(0,i.createMultiplyScalar)({typed:p}),re=t.not=(0,i.createNot)({typed:p}),ne=t.number=(0,i.createNumber)({typed:p}),ie=(t.oct=(0,i.createOct)({format:k,typed:p}),t.pickRandom=(0,i.createPickRandom)({config:n.config,typed:p}),t.print=(0,i.createPrint)({typed:p}),t.random=(0,i.createRandom)({config:n.config,typed:p}),t.re=(0,i.createRe)({typed:p})),se=(t.sec=(0,i.createSec)({BigNumber:s,typed:p}),t.sign=(0,i.createSign)({BigNumber:s,Fraction:a,complex:b,typed:p})),oe=t.sin=(0,i.createSin)({typed:p}),ae=t.SparseMatrix=(0,i.createSparseMatrixClass)({Matrix:c,equalScalar:x,typed:p}),le=(t.splitUnit=(0,i.createSplitUnit)({typed:p}),t.square=(0,i.createSquare)({typed:p}),t.string=(0,i.createString)({typed:p}),t.subtractScalar=(0,i.createSubtractScalar)({typed:p})),ce=(t.tan=(0,i.createTan)({typed:p}),t.typeOf=(0,i.createTypeOf)({typed:p})),ue=(t.acosh=(0,i.createAcosh)({Complex:o,config:n.config,typed:p}),t.acsch=(0,i.createAcsch)({BigNumber:s,typed:p}),t.apply=(0,i.createApply)({isInteger:q,typed:p})),de=(t.asec=(0,i.createAsec)({BigNumber:s,Complex:o,config:n.config,typed:p}),t.bignumber=(0,i.createBignumber)({BigNumber:s,typed:p})),he=(t.combinationsWithRep=(0,i.createCombinationsWithRep)({typed:p}),t.cosh=(0,i.createCosh)({typed:p}),t.csch=(0,i.createCsch)({BigNumber:s,typed:p}),t.isNaN=(0,i.createIsNaN)({typed:p})),pe=(t.isPrime=(0,i.createIsPrime)({typed:p}),t.randomInt=(0,i.createRandomInt)({config:n.config,typed:p}),t.sech=(0,i.createSech)({BigNumber:s,typed:p}),t.sinh=(0,i.createSinh)({typed:p}),t.sparse=(0,i.createSparse)({SparseMatrix:ae,typed:p}),t.sqrt=(0,i.createSqrt)({Complex:o,config:n.config,typed:p})),me=(t.squeeze=(0,i.createSqueeze)({typed:p}),t.tanh=(0,i.createTanh)({typed:p}),t.unaryMinus=(0,i.createUnaryMinus)({typed:p})),fe=(t.acoth=(0,i.createAcoth)({BigNumber:s,Complex:o,config:n.config,typed:p}),t.bin=(0,i.createBin)({format:k,typed:p}),t.coth=(0,i.createCoth)({BigNumber:s,typed:p}),t.fraction=(0,i.createFraction)({Fraction:a,typed:p})),ge=t.isNumeric=(0,i.createIsNumeric)({typed:p}),ye=t.matrix=(0,i.createMatrix)({DenseMatrix:d,Matrix:c,SparseMatrix:ae,typed:p}),be=(t.matrixFromFunction=(0,i.createMatrixFromFunction)({isZero:X,matrix:ye,typed:p}),t.mode=(0,i.createMode)({isNaN:he,isNumeric:ge,typed:p}),t.numeric=(0,i.createNumeric)({bignumber:de,fraction:fe,number:ne})),ve=t.prod=(0,i.createProd)({config:n.config,multiplyScalar:te,numeric:be,typed:p}),_e=t.reshape=(0,i.createReshape)({isInteger:q,matrix:ye,typed:p}),xe=t.size=(0,i.createSize)({matrix:ye,config:n.config,typed:p}),we=t.transpose=(0,i.createTranspose)({matrix:ye,typed:p}),Se=t.xgcd=(0,i.createXgcd)({BigNumber:s,config:n.config,matrix:ye,typed:p}),Pe=t.zeros=(0,i.createZeros)({BigNumber:s,config:n.config,matrix:ye,typed:p}),Te=(t.asin=(0,i.createAsin)({Complex:o,config:n.config,typed:p}),t.cbrt=(0,i.createCbrt)({BigNumber:s,Complex:o,Fraction:a,config:n.config,isNegative:$,matrix:ye,typed:p,unaryMinus:me})),Re=t.concat=(0,i.createConcat)({isInteger:q,matrix:ye,typed:p}),ke=(t.count=(0,i.createCount)({prod:ve,size:xe,typed:p}),t.ctranspose=(0,i.createCtranspose)({conj:v,transpose:we,typed:p})),Ie=t.diag=(0,i.createDiag)({DenseMatrix:d,SparseMatrix:ae,matrix:ye,typed:p}),je=t.divideScalar=(0,i.createDivideScalar)({numeric:be,typed:p}),He=t.dotDivide=(0,i.createDotDivide)({DenseMatrix:d,concat:Re,divideScalar:je,equalScalar:x,matrix:ye,typed:p}),ze=t.equal=(0,i.createEqual)({DenseMatrix:d,concat:Re,equalScalar:x,matrix:ye,typed:p}),Ge=(t.hasNumericValue=(0,i.createHasNumericValue)({isNumeric:ge,typed:p}),t.identity=(0,i.createIdentity)({BigNumber:s,DenseMatrix:d,SparseMatrix:ae,config:n.config,matrix:ye,typed:p})),We=(t.kron=(0,i.createKron)({matrix:ye,multiplyScalar:te,typed:p}),t.largerEq=(0,i.createLargerEq)({DenseMatrix:d,concat:Re,config:n.config,matrix:ye,typed:p})),Ve=(t.leftShift=(0,i.createLeftShift)({DenseMatrix:d,concat:Re,equalScalar:x,matrix:ye,typed:p,zeros:Pe}),t.lsolve=(0,i.createLsolve)({DenseMatrix:d,divideScalar:je,equalScalar:x,matrix:ye,multiplyScalar:te,subtractScalar:le,typed:p})),qe=t.matrixFromColumns=(0,i.createMatrixFromColumns)({flatten:R,matrix:ye,size:xe,typed:p}),$e=(t.nthRoot=(0,i.createNthRoot)({BigNumber:s,concat:Re,equalScalar:x,matrix:ye,typed:p}),t.ones=(0,i.createOnes)({BigNumber:s,config:n.config,matrix:ye,typed:p}),t.qr=(0,i.createQr)({addScalar:f,complex:b,conj:v,divideScalar:je,equal:ze,identity:Ge,isZero:X,matrix:ye,multiplyScalar:te,sign:se,sqrt:pe,subtractScalar:le,typed:p,unaryMinus:me,zeros:Pe})),Xe=(t.resize=(0,i.createResize)({config:n.config,matrix:ye}),t.rightArithShift=(0,i.createRightArithShift)({DenseMatrix:d,concat:Re,equalScalar:x,matrix:ye,typed:p,zeros:Pe}),t.round=(0,i.createRound)({BigNumber:s,DenseMatrix:d,config:n.config,equalScalar:x,matrix:ye,typed:p,zeros:Pe})),Ye=t.smaller=(0,i.createSmaller)({DenseMatrix:d,concat:Re,config:n.config,matrix:ye,typed:p}),Qe=t.subtract=(0,i.createSubtract)({DenseMatrix:d,concat:Re,equalScalar:x,matrix:ye,subtractScalar:le,typed:p,unaryMinus:me}),et=(t.to=(0,i.createTo)({concat:Re,matrix:ye,typed:p}),t.unaryPlus=(0,i.createUnaryPlus)({config:n.config,numeric:be,typed:p})),tt=t.usolve=(0,i.createUsolve)({DenseMatrix:d,divideScalar:je,equalScalar:x,matrix:ye,multiplyScalar:te,subtractScalar:le,typed:p}),rt=(t.xor=(0,i.createXor)({DenseMatrix:d,concat:Re,matrix:ye,typed:p}),t.add=(0,i.createAdd)({DenseMatrix:d,SparseMatrix:ae,addScalar:f,concat:Re,equalScalar:x,matrix:ye,typed:p})),nt=(t.atan2=(0,i.createAtan2)({BigNumber:s,DenseMatrix:d,concat:Re,equalScalar:x,matrix:ye,typed:p}),t.bitAnd=(0,i.createBitAnd)({concat:Re,equalScalar:x,matrix:ye,typed:p}),t.bitOr=(0,i.createBitOr)({DenseMatrix:d,concat:Re,equalScalar:x,matrix:ye,typed:p}),t.bitXor=(0,i.createBitXor)({DenseMatrix:d,concat:Re,matrix:ye,typed:p}),t.catalan=(0,i.createCatalan)({addScalar:f,combinations:y,divideScalar:je,isInteger:q,isNegative:$,multiplyScalar:te,typed:p}),t.compare=(0,i.createCompare)({BigNumber:s,DenseMatrix:d,Fraction:a,concat:Re,config:n.config,equalScalar:x,matrix:ye,typed:p})),it=t.compareText=(0,i.createCompareText)({concat:Re,matrix:ye,typed:p}),st=(t.cumsum=(0,i.createCumSum)({add:rt,typed:p,unaryPlus:et}),t.deepEqual=(0,i.createDeepEqual)({equal:ze,typed:p})),ot=(t.diff=(0,i.createDiff)({matrix:ye,number:ne,subtract:Qe,typed:p}),t.distance=(0,i.createDistance)({abs:m,addScalar:f,deepEqual:st,divideScalar:je,multiplyScalar:te,sqrt:pe,subtractScalar:le,typed:p}),t.dot=(0,i.createDot)({addScalar:f,conj:v,multiplyScalar:te,size:xe,typed:p})),at=(t.equalText=(0,i.createEqualText)({compareText:it,isZero:X,typed:p}),t.floor=(0,i.createFloor)({DenseMatrix:d,config:n.config,equalScalar:x,matrix:ye,round:Xe,typed:p,zeros:Pe})),lt=(t.gcd=(0,i.createGcd)({BigNumber:s,DenseMatrix:d,concat:Re,config:n.config,equalScalar:x,matrix:ye,round:Xe,typed:p,zeros:Pe}),t.hypot=(0,i.createHypot)({abs:m,addScalar:f,divideScalar:je,isPositive:Z,multiplyScalar:te,smaller:Ye,sqrt:pe,typed:p}),t.ImmutableDenseMatrix=(0,i.createImmutableDenseMatrixClass)({DenseMatrix:d,smaller:Ye})),ct=t.Index=(0,i.createIndexClass)({ImmutableDenseMatrix:lt,getMatrixDataType:j}),ut=t.larger=(0,i.createLarger)({DenseMatrix:d,concat:Re,config:n.config,matrix:ye,typed:p}),dt=t.log=(0,i.createLog)({Complex:o,config:n.config,divideScalar:je,typed:p}),ht=(t.lsolveAll=(0,i.createLsolveAll)({DenseMatrix:d,divideScalar:je,equalScalar:x,matrix:ye,multiplyScalar:te,subtractScalar:le,typed:p}),t.matrixFromRows=(0,i.createMatrixFromRows)({flatten:R,matrix:ye,size:xe,typed:p}),t.min=(0,i.createMin)({config:n.config,numeric:be,smaller:Ye,typed:p}),t.mod=(0,i.createMod)({DenseMatrix:d,concat:Re,config:n.config,equalScalar:x,matrix:ye,round:Xe,typed:p,zeros:Pe})),pt=t.multiply=(0,i.createMultiply)({addScalar:f,dot:ot,equalScalar:x,matrix:ye,multiplyScalar:te,typed:p}),mt=(t.nthRoots=(0,i.createNthRoots)({Complex:o,config:n.config,divideScalar:je,typed:p}),t.or=(0,i.createOr)({DenseMatrix:d,concat:Re,equalScalar:x,matrix:ye,typed:p}),t.partitionSelect=(0,i.createPartitionSelect)({compare:nt,isNaN:he,isNumeric:ge,typed:p})),ft=(t.rightLogShift=(0,i.createRightLogShift)({DenseMatrix:d,concat:Re,equalScalar:x,matrix:ye,typed:p,zeros:Pe}),t.slu=(0,i.createSlu)({SparseMatrix:ae,abs:m,add:rt,divideScalar:je,larger:ut,largerEq:We,multiply:pt,subtract:Qe,transpose:we,typed:p})),gt=t.subset=(0,i.createSubset)({add:rt,matrix:ye,typed:p,zeros:Pe}),yt=t.sum=(0,i.createSum)({add:rt,config:n.config,numeric:be,typed:p}),bt=(t.trace=(0,i.createTrace)({add:rt,matrix:ye,typed:p}),t.usolveAll=(0,i.createUsolveAll)({DenseMatrix:d,divideScalar:je,equalScalar:x,matrix:ye,multiplyScalar:te,subtractScalar:le,typed:p})),vt=(t.zpk2tf=(0,i.createZpk2tf)({Complex:o,add:rt,multiply:pt,number:ne,typed:p}),t.ceil=(0,i.createCeil)({DenseMatrix:d,config:n.config,equalScalar:x,matrix:ye,round:Xe,typed:p,zeros:Pe})),_t=t.compareNatural=(0,i.createCompareNatural)({compare:nt,typed:p}),xt=(t.composition=(0,i.createComposition)({addScalar:f,combinations:y,isInteger:q,isNegative:$,isPositive:Z,larger:ut,typed:p}),t.cross=(0,i.createCross)({matrix:ye,multiply:pt,subtract:Qe,typed:p}),t.det=(0,i.createDet)({divideScalar:je,isZero:X,matrix:ye,multiply:pt,subtractScalar:le,typed:p,unaryMinus:me})),wt=(t.dotMultiply=(0,i.createDotMultiply)({concat:Re,equalScalar:x,matrix:ye,multiplyScalar:te,typed:p}),t.FibonacciHeap=(0,i.createFibonacciHeapClass)({larger:ut,smaller:Ye})),St=t.fix=(0,i.createFix)({Complex:o,DenseMatrix:d,ceil:vt,equalScalar:x,floor:at,matrix:ye,typed:p,zeros:Pe}),Pt=t.index=(0,i.createIndex)({Index:ct,typed:p}),Et=(t.intersect=(0,i.createIntersect)({abs:m,add:rt,addScalar:f,config:n.config,divideScalar:je,equalScalar:x,flatten:R,isNumeric:ge,isZero:X,matrix:ye,multiply:pt,multiplyScalar:te,smaller:Ye,subtract:Qe,typed:p}),t.invmod=(0,i.createInvmod)({BigNumber:s,add:rt,config:n.config,equal:ze,isInteger:q,mod:ht,smaller:Ye,typed:p,xgcd:Se}),t.lcm=(0,i.createLcm)({concat:Re,equalScalar:x,matrix:ye,typed:p}),t.log1p=(0,i.createLog1p)({Complex:o,config:n.config,divideScalar:je,log:dt,typed:p}),t.max=(0,i.createMax)({config:n.config,larger:ut,numeric:be,typed:p})),Mt=(t.setCartesian=(0,i.createSetCartesian)({DenseMatrix:d,Index:ct,compareNatural:_t,size:xe,subset:gt,typed:p}),t.setDistinct=(0,i.createSetDistinct)({DenseMatrix:d,Index:ct,compareNatural:_t,size:xe,subset:gt,typed:p}),t.setIsSubset=(0,i.createSetIsSubset)({Index:ct,compareNatural:_t,size:xe,subset:gt,typed:p}),t.setPowerset=(0,i.createSetPowerset)({Index:ct,compareNatural:_t,size:xe,subset:gt,typed:p}),t.smallerEq=(0,i.createSmallerEq)({DenseMatrix:d,concat:Re,config:n.config,matrix:ye,typed:p})),Ct=(t.sort=(0,i.createSort)({compare:nt,compareNatural:_t,matrix:ye,typed:p}),t.unequal=(0,i.createUnequal)({DenseMatrix:d,concat:Re,config:n.config,equalScalar:x,matrix:ye,typed:p}),t.and=(0,i.createAnd)({concat:Re,equalScalar:x,matrix:ye,not:re,typed:p,zeros:Pe}),t.range=(0,i.createRange)({bignumber:de,matrix:ye,add:rt,config:n.config,isPositive:Z,larger:ut,largerEq:We,smaller:Ye,smallerEq:Mt,typed:p})),At=(t.row=(0,i.createRow)({Index:ct,matrix:ye,range:Ct,typed:p}),t.setDifference=(0,i.createSetDifference)({DenseMatrix:d,Index:ct,compareNatural:_t,size:xe,subset:gt,typed:p})),Tt=(t.setMultiplicity=(0,i.createSetMultiplicity)({Index:ct,compareNatural:_t,size:xe,subset:gt,typed:p}),t.setSymDifference=(0,i.createSetSymDifference)({Index:ct,concat:Re,setDifference:At,size:xe,subset:gt,typed:p})),Dt=t.Spa=(0,i.createSpaClass)({FibonacciHeap:wt,addScalar:f,equalScalar:x}),Ot=t.column=(0,i.createColumn)({Index:ct,matrix:ye,range:Ct,typed:p}),Rt=t.inv=(0,i.createInv)({abs:m,addScalar:f,det:xt,divideScalar:je,identity:Ge,matrix:ye,multiply:pt,typed:p,unaryMinus:me}),Lt=t.lup=(0,i.createLup)({DenseMatrix:d,Spa:Dt,SparseMatrix:ae,abs:m,addScalar:f,divideScalar:je,equalScalar:x,larger:ut,matrix:ye,multiplyScalar:te,subtractScalar:le,typed:p,unaryMinus:me}),kt=(t.pinv=(0,i.createPinv)({Complex:o,add:rt,ctranspose:ke,deepEqual:st,divideScalar:je,dot:ot,dotDivide:He,equal:ze,inv:Rt,matrix:ye,multiply:pt,typed:p}),t.pow=(0,i.createPow)({Complex:o,config:n.config,fraction:fe,identity:Ge,inv:Rt,matrix:ye,multiply:pt,number:ne,typed:p})),Nt=t.setIntersect=(0,i.createSetIntersect)({DenseMatrix:d,Index:ct,compareNatural:_t,size:xe,subset:gt,typed:p}),Ft=(t.setUnion=(0,i.createSetUnion)({Index:ct,concat:Re,setIntersect:Nt,setSymDifference:Tt,size:xe,subset:gt,typed:p}),t.sqrtm=(0,i.createSqrtm)({abs:m,add:rt,identity:Ge,inv:Rt,map:ee,max:Et,multiply:pt,size:xe,sqrt:pe,subtract:Qe,typed:p}),t.Unit=(0,i.createUnitClass)({BigNumber:s,Complex:o,Fraction:a,abs:m,addScalar:f,config:n.config,divideScalar:je,equal:ze,fix:St,format:k,isNumeric:ge,multiplyScalar:te,number:ne,pow:kt,round:Xe,subtractScalar:le})),It=(t.vacuumImpedance=(0,i.createVacuumImpedance)({BigNumber:s,Unit:Ft,config:n.config}),t.wienDisplacement=(0,i.createWienDisplacement)({BigNumber:s,Unit:Ft,config:n.config}),t.atomicMass=(0,i.createAtomicMass)({BigNumber:s,Unit:Ft,config:n.config}),t.bohrMagneton=(0,i.createBohrMagneton)({BigNumber:s,Unit:Ft,config:n.config}),t.boltzmann=(0,i.createBoltzmann)({BigNumber:s,Unit:Ft,config:n.config}),t.conductanceQuantum=(0,i.createConductanceQuantum)({BigNumber:s,Unit:Ft,config:n.config}),t.coulomb=(0,i.createCoulomb)({BigNumber:s,Unit:Ft,config:n.config}),t.deuteronMass=(0,i.createDeuteronMass)({BigNumber:s,Unit:Ft,config:n.config}),t.dotPow=(0,i.createDotPow)({DenseMatrix:d,concat:Re,equalScalar:x,matrix:ye,pow:kt,typed:p}),t.electricConstant=(0,i.createElectricConstant)({BigNumber:s,Unit:Ft,config:n.config}),t.elementaryCharge=(0,i.createElementaryCharge)({BigNumber:s,Unit:Ft,config:n.config}),t.expm=(0,i.createExpm)({abs:m,add:rt,identity:Ge,inv:Rt,multiply:pt,typed:p}),t.faraday=(0,i.createFaraday)({BigNumber:s,Unit:Ft,config:n.config}),t.fft=(0,i.createFft)({addScalar:f,ceil:vt,conj:v,divideScalar:je,dotDivide:He,exp:w,i:l,log2:Y,matrix:ye,multiplyScalar:te,pow:kt,tau:u,typed:p})),Bt=t.gamma=(0,i.createGamma)({BigNumber:s,Complex:o,config:n.config,multiplyScalar:te,pow:kt,typed:p}),jt=(t.gravitationConstant=(0,i.createGravitationConstant)({BigNumber:s,Unit:Ft,config:n.config}),t.hartreeEnergy=(0,i.createHartreeEnergy)({BigNumber:s,Unit:Ft,config:n.config}),t.ifft=(0,i.createIfft)({conj:v,dotDivide:He,fft:It,typed:p}),t.klitzing=(0,i.createKlitzing)({BigNumber:s,Unit:Ft,config:n.config}),t.loschmidt=(0,i.createLoschmidt)({BigNumber:s,Unit:Ft,config:n.config}),t.magneticConstant=(0,i.createMagneticConstant)({BigNumber:s,Unit:Ft,config:n.config}),t.molarMass=(0,i.createMolarMass)({BigNumber:s,Unit:Ft,config:n.config}),t.molarPlanckConstant=(0,i.createMolarPlanckConstant)({BigNumber:s,Unit:Ft,config:n.config}),t.neutronMass=(0,i.createNeutronMass)({BigNumber:s,Unit:Ft,config:n.config}),t.nuclearMagneton=(0,i.createNuclearMagneton)({BigNumber:s,Unit:Ft,config:n.config}),t.planckCharge=(0,i.createPlanckCharge)({BigNumber:s,Unit:Ft,config:n.config}),t.planckLength=(0,i.createPlanckLength)({BigNumber:s,Unit:Ft,config:n.config}),t.planckTemperature=(0,i.createPlanckTemperature)({BigNumber:s,Unit:Ft,config:n.config}),t.protonMass=(0,i.createProtonMass)({BigNumber:s,Unit:Ft,config:n.config}),t.quantumOfCirculation=(0,i.createQuantumOfCirculation)({BigNumber:s,Unit:Ft,config:n.config}),t.reducedPlanckConstant=(0,i.createReducedPlanckConstant)({BigNumber:s,Unit:Ft,config:n.config}),t.rydberg=(0,i.createRydberg)({BigNumber:s,Unit:Ft,config:n.config}),t.secondRadiation=(0,i.createSecondRadiation)({BigNumber:s,Unit:Ft,config:n.config}),t.speedOfLight=(0,i.createSpeedOfLight)({BigNumber:s,Unit:Ft,config:n.config}),t.stefanBoltzmann=(0,i.createStefanBoltzmann)({BigNumber:s,Unit:Ft,config:n.config}),t.thomsonCrossSection=(0,i.createThomsonCrossSection)({BigNumber:s,Unit:Ft,config:n.config}),t.avogadro=(0,i.createAvogadro)({BigNumber:s,Unit:Ft,config:n.config}),t.bohrRadius=(0,i.createBohrRadius)({BigNumber:s,Unit:Ft,config:n.config}),t.createUnit=(0,i.createCreateUnit)({Unit:Ft,typed:p}),t.divide=(0,i.createDivide)({divideScalar:je,equalScalar:x,inv:Rt,matrix:ye,multiply:pt,typed:p})),Ht=(t.electronMass=(0,i.createElectronMass)({BigNumber:s,Unit:Ft,config:n.config}),t.factorial=(0,i.createFactorial)({gamma:Bt,typed:p})),Ut=(t.firstRadiation=(0,i.createFirstRadiation)({BigNumber:s,Unit:Ft,config:n.config}),t.gravity=(0,i.createGravity)({BigNumber:s,Unit:Ft,config:n.config}),t.inverseConductanceQuantum=(0,i.createInverseConductanceQuantum)({BigNumber:s,Unit:Ft,config:n.config}),t.lusolve=(0,i.createLusolve)({DenseMatrix:d,lsolve:Ve,lup:Lt,matrix:ye,slu:ft,typed:p,usolve:tt})),zt=(t.magneticFluxQuantum=(0,i.createMagneticFluxQuantum)({BigNumber:s,Unit:Ft,config:n.config}),t.molarMassC12=(0,i.createMolarMassC12)({BigNumber:s,Unit:Ft,config:n.config}),t.multinomial=(0,i.createMultinomial)({add:rt,divide:jt,factorial:Ht,isInteger:q,isPositive:Z,multiply:pt,typed:p}),t.permutations=(0,i.createPermutations)({factorial:Ht,typed:p}),t.planckMass=(0,i.createPlanckMass)({BigNumber:s,Unit:Ft,config:n.config}),t.polynomialRoot=(0,i.createPolynomialRoot)({add:rt,cbrt:Te,divide:jt,equalScalar:x,im:z,isZero:X,multiply:pt,re:ie,sqrt:pe,subtract:Qe,typeOf:ce,typed:p,unaryMinus:me}),t.setSize=(0,i.createSetSize)({compareNatural:_t,typed:p}),t.solveODE=(0,i.createSolveODE)({abs:m,add:rt,bignumber:de,divide:jt,isNegative:$,isPositive:Z,larger:ut,map:ee,matrix:ye,max:Et,multiply:pt,smaller:Ye,subtract:Qe,typed:p,unaryMinus:me}),t.stirlingS2=(0,i.createStirlingS2)({bignumber:de,addScalar:f,combinations:y,divideScalar:je,factorial:Ht,isInteger:q,isNegative:$,larger:ut,multiplyScalar:te,number:ne,pow:kt,subtractScalar:le,typed:p})),Gt=(t.unit=(0,i.createUnitFunction)({Unit:Ft,typed:p}),t.bellNumbers=(0,i.createBellNumbers)({addScalar:f,isInteger:q,isNegative:$,stirlingS2:zt,typed:p}),t.eigs=(0,i.createEigs)({abs:m,add:rt,addScalar:f,atan:g,bignumber:de,column:Ot,complex:b,config:n.config,cos:_,diag:Ie,divideScalar:je,dot:ot,equal:ze,flatten:R,im:z,inv:Rt,larger:ut,matrix:ye,matrixFromColumns:qe,multiply:pt,multiplyScalar:te,number:ne,qr:$e,re:ie,reshape:_e,sin:oe,size:xe,smaller:Ye,sqrt:pe,subtract:Qe,typed:p,usolve:tt,usolveAll:bt})),Wt=(t.fermiCoupling=(0,i.createFermiCoupling)({BigNumber:s,Unit:Ft,config:n.config}),t.gasConstant=(0,i.createGasConstant)({BigNumber:s,Unit:Ft,config:n.config}),t.kldivergence=(0,i.createKldivergence)({divide:jt,dotDivide:He,isNumeric:ge,log:dt,map:ee,matrix:ye,multiply:pt,sum:yt,typed:p}),t.mean=(0,i.createMean)({add:rt,divide:jt,typed:p})),Vt=(t.molarVolume=(0,i.createMolarVolume)({BigNumber:s,Unit:Ft,config:n.config}),t.planckConstant=(0,i.createPlanckConstant)({BigNumber:s,Unit:Ft,config:n.config}),t.quantileSeq=(0,i.createQuantileSeq)({bignumber:de,add:rt,compare:nt,divide:jt,isInteger:q,larger:ut,multiply:pt,partitionSelect:mt,smaller:Ye,smallerEq:Mt,subtract:Qe,typed:p}),t.variance=(0,i.createVariance)({add:rt,apply:ue,divide:jt,isNaN:he,multiply:pt,subtract:Qe,typed:p})),qt=(t.classicalElectronRadius=(0,i.createClassicalElectronRadius)({BigNumber:s,Unit:Ft,config:n.config}),t.median=(0,i.createMedian)({add:rt,compare:nt,divide:jt,partitionSelect:mt,typed:p})),$t=(t.corr=(0,i.createCorr)({add:rt,divide:jt,matrix:ye,mean:Wt,multiply:pt,pow:kt,sqrt:pe,subtract:Qe,sum:yt,typed:p}),t.freqz=(0,i.createFreqz)({Complex:o,add:rt,divide:jt,matrix:ye,multiply:pt,typed:p}),t.mad=(0,i.createMad)({abs:m,map:ee,median:qt,subtract:Qe,typed:p}),t.std=(0,i.createStd)({map:ee,sqrt:pe,typed:p,variance:Vt}),t.zeta=(0,i.createZeta)({BigNumber:s,Complex:o,add:rt,config:n.config,divide:jt,equal:ze,factorial:Ht,gamma:Bt,isNegative:$,multiply:pt,pi:h,pow:kt,sin:oe,smallerEq:Mt,subtract:Qe,typed:p}),t.norm=(0,i.createNorm)({abs:m,add:rt,conj:v,ctranspose:ke,eigs:Gt,equalScalar:x,larger:ut,matrix:ye,multiply:pt,pow:kt,smaller:Ye,sqrt:pe,typed:p})),Zt=t.rotationMatrix=(0,i.createRotationMatrix)({BigNumber:s,DenseMatrix:d,SparseMatrix:ae,addScalar:f,config:n.config,cos:_,matrix:ye,multiplyScalar:te,norm:$t,sin:oe,typed:p,unaryMinus:me}),Kt=(t.planckTime=(0,i.createPlanckTime)({BigNumber:s,Unit:Ft,config:n.config}),t.schur=(0,i.createSchur)({identity:Ge,matrix:ye,multiply:pt,norm:$t,qr:$e,subtract:Qe,typed:p})),Xt=(t.rotate=(0,i.createRotate)({multiply:pt,rotationMatrix:Zt,typed:p}),t.sylvester=(0,i.createSylvester)({abs:m,add:rt,concat:Re,identity:Ge,index:Pt,lusolve:Ut,matrix:ye,matrixFromColumns:qe,multiply:pt,range:Ct,schur:Kt,subset:gt,subtract:Qe,transpose:we,typed:p}));t.lyap=(0,i.createLyap)({matrix:ye,multiply:pt,sylvester:Xt,transpose:we,typed:p})},63606:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isAccessorNode",{enumerable:!0,get:function(){return n.isAccessorNode}}),Object.defineProperty(t,"isArray",{enumerable:!0,get:function(){return n.isArray}}),Object.defineProperty(t,"isArrayNode",{enumerable:!0,get:function(){return n.isArrayNode}}),Object.defineProperty(t,"isAssignmentNode",{enumerable:!0,get:function(){return n.isAssignmentNode}}),Object.defineProperty(t,"isBigInt",{enumerable:!0,get:function(){return n.isBigInt}}),Object.defineProperty(t,"isBigNumber",{enumerable:!0,get:function(){return n.isBigNumber}}),Object.defineProperty(t,"isBlockNode",{enumerable:!0,get:function(){return n.isBlockNode}}),Object.defineProperty(t,"isBoolean",{enumerable:!0,get:function(){return n.isBoolean}}),Object.defineProperty(t,"isChain",{enumerable:!0,get:function(){return n.isChain}}),Object.defineProperty(t,"isCollection",{enumerable:!0,get:function(){return n.isCollection}}),Object.defineProperty(t,"isComplex",{enumerable:!0,get:function(){return n.isComplex}}),Object.defineProperty(t,"isConditionalNode",{enumerable:!0,get:function(){return n.isConditionalNode}}),Object.defineProperty(t,"isConstantNode",{enumerable:!0,get:function(){return n.isConstantNode}}),Object.defineProperty(t,"isDate",{enumerable:!0,get:function(){return n.isDate}}),Object.defineProperty(t,"isDenseMatrix",{enumerable:!0,get:function(){return n.isDenseMatrix}}),Object.defineProperty(t,"isFraction",{enumerable:!0,get:function(){return n.isFraction}}),Object.defineProperty(t,"isFunction",{enumerable:!0,get:function(){return n.isFunction}}),Object.defineProperty(t,"isFunctionAssignmentNode",{enumerable:!0,get:function(){return n.isFunctionAssignmentNode}}),Object.defineProperty(t,"isFunctionNode",{enumerable:!0,get:function(){return n.isFunctionNode}}),Object.defineProperty(t,"isHelp",{enumerable:!0,get:function(){return n.isHelp}}),Object.defineProperty(t,"isIndex",{enumerable:!0,get:function(){return n.isIndex}}),Object.defineProperty(t,"isIndexNode",{enumerable:!0,get:function(){return n.isIndexNode}}),Object.defineProperty(t,"isMap",{enumerable:!0,get:function(){return n.isMap}}),Object.defineProperty(t,"isMatrix",{enumerable:!0,get:function(){return n.isMatrix}}),Object.defineProperty(t,"isNode",{enumerable:!0,get:function(){return n.isNode}}),Object.defineProperty(t,"isNull",{enumerable:!0,get:function(){return n.isNull}}),Object.defineProperty(t,"isNumber",{enumerable:!0,get:function(){return n.isNumber}}),Object.defineProperty(t,"isObject",{enumerable:!0,get:function(){return n.isObject}}),Object.defineProperty(t,"isObjectNode",{enumerable:!0,get:function(){return n.isObjectNode}}),Object.defineProperty(t,"isObjectWrappingMap",{enumerable:!0,get:function(){return n.isObjectWrappingMap}}),Object.defineProperty(t,"isOperatorNode",{enumerable:!0,get:function(){return n.isOperatorNode}}),Object.defineProperty(t,"isParenthesisNode",{enumerable:!0,get:function(){return n.isParenthesisNode}}),Object.defineProperty(t,"isPartitionedMap",{enumerable:!0,get:function(){return n.isPartitionedMap}}),Object.defineProperty(t,"isRange",{enumerable:!0,get:function(){return n.isRange}}),Object.defineProperty(t,"isRangeNode",{enumerable:!0,get:function(){return n.isRangeNode}}),Object.defineProperty(t,"isRegExp",{enumerable:!0,get:function(){return n.isRegExp}}),Object.defineProperty(t,"isRelationalNode",{enumerable:!0,get:function(){return n.isRelationalNode}}),Object.defineProperty(t,"isResultSet",{enumerable:!0,get:function(){return n.isResultSet}}),Object.defineProperty(t,"isSparseMatrix",{enumerable:!0,get:function(){return n.isSparseMatrix}}),Object.defineProperty(t,"isString",{enumerable:!0,get:function(){return n.isString}}),Object.defineProperty(t,"isSymbolNode",{enumerable:!0,get:function(){return n.isSymbolNode}}),Object.defineProperty(t,"isUndefined",{enumerable:!0,get:function(){return n.isUndefined}}),Object.defineProperty(t,"isUnit",{enumerable:!0,get:function(){return n.isUnit}});var n=r(91612)},11563:(e,t)=>{"use strict";function ArgumentsError(e,t,r,n){if(!(this instanceof ArgumentsError))throw new SyntaxError("Constructor must be called with the new operator");this.fn=e,this.count=t,this.min=r,this.max=n,this.message="Wrong number of arguments in function "+e+" ("+t+" provided, "+r+(null!=n?"-"+n:"")+" expected)",this.stack=(new Error).stack}Object.defineProperty(t,"__esModule",{value:!0}),t.ArgumentsError=ArgumentsError,ArgumentsError.prototype=new Error,ArgumentsError.prototype.constructor=Error,ArgumentsError.prototype.name="ArgumentsError",ArgumentsError.prototype.isArgumentsError=!0},6523:(e,t)=>{"use strict";function DimensionError(e,t,r){if(!(this instanceof DimensionError))throw new SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=t,this.relation=r,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(t)?"["+t.join(", ")+"]":t)+")",this.stack=(new Error).stack}Object.defineProperty(t,"__esModule",{value:!0}),t.DimensionError=DimensionError,DimensionError.prototype=new RangeError,DimensionError.prototype.constructor=RangeError,DimensionError.prototype.name="DimensionError",DimensionError.prototype.isDimensionError=!0},17967:(e,t)=>{"use strict";function IndexError(e,t,r){if(!(this instanceof IndexError))throw new SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=t):(this.min=t,this.max=r),void 0!==this.min&&this.index<this.min?this.message="Index out of range ("+this.index+" < "+this.min+")":void 0!==this.max&&this.index>=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=(new Error).stack}Object.defineProperty(t,"__esModule",{value:!0}),t.IndexError=IndexError,IndexError.prototype=new RangeError,IndexError.prototype.constructor=RangeError,IndexError.prototype.name="IndexError",IndexError.prototype.isIndexError=!0},43892:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createHelpClass=void 0;var n=r(91612),i=r(61175),s=r(7041),o=r(66212);const a=["evaluate"];t.createHelpClass=(0,o.factory)("Help",a,(e=>{let{evaluate:t}=e;function Help(e){if(!(this instanceof Help))throw new SyntaxError("Constructor must be called with the new operator");if(!e)throw new Error('Argument "doc" missing');this.doc=e}return Help.prototype.type="Help",Help.prototype.isHelp=!0,Help.prototype.toString=function(){const e=this.doc||{};let r="\n";if(e.name&&(r+="Name: "+e.name+"\n\n"),e.category&&(r+="Category: "+e.category+"\n\n"),e.description&&(r+="Description:\n    "+e.description+"\n\n"),e.syntax&&(r+="Syntax:\n    "+e.syntax.join("\n    ")+"\n\n"),e.examples){r+="Examples:\n";let i=!1;const o=t("config()"),a={config:e=>(i=!0,t("config(newConfig)",{newConfig:e}))};for(let i=0;i<e.examples.length;i++){const o=e.examples[i];let l;r+="    "+o+"\n";try{l=t(o,a)}catch(e){l=e}void 0===l||(0,n.isHelp)(l)||(r+="        "+(0,s.format)(l,{precision:14})+"\n")}r+="\n",i&&t("config(originalConfig)",{originalConfig:o})}return e.mayThrow&&e.mayThrow.length&&(r+="Throws: "+e.mayThrow.join(", ")+"\n\n"),e.seealso&&e.seealso.length&&(r+="See also: "+e.seealso.join(", ")+"\n"),r},Help.prototype.toJSON=function(){const e=(0,i.clone)(this.doc);return e.mathjs="Help",e},Help.fromJSON=function(e){const t={};return Object.keys(e).filter((e=>"mathjs"!==e)).forEach((r=>{t[r]=e[r]})),new Help(t)},Help.prototype.valueOf=Help.prototype.toString,Help}),{isClass:!0})},85776:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createParserClass=void 0;var n=r(66212),i=r(81072);const s=["evaluate"];t.createParserClass=(0,n.factory)("Parser",s,(e=>{let{evaluate:t}=e;function Parser(){if(!(this instanceof Parser))throw new SyntaxError("Constructor must be called with the new operator");Object.defineProperty(this,"scope",{value:(0,i.createEmptyMap)(),writable:!1})}return Parser.prototype.type="Parser",Parser.prototype.isParser=!0,Parser.prototype.evaluate=function(e){return t(e,this.scope)},Parser.prototype.get=function(e){if(this.scope.has(e))return this.scope.get(e)},Parser.prototype.getAll=function(){return(0,i.toObject)(this.scope)},Parser.prototype.getAllAsMap=function(){return this.scope},Parser.prototype.set=function(e,t){return this.scope.set(e,t),t},Parser.prototype.remove=function(e){this.scope.delete(e)},Parser.prototype.clear=function(){this.scope.clear()},Parser}),{isClass:!0})},58471:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InfinityDocs=void 0;t.InfinityDocs={name:"Infinity",category:"Constants",syntax:["Infinity"],description:"Infinity, a number which is larger than the maximum number that can be handled by a floating point number.",examples:["Infinity","1 / 0"],seealso:[]}},62880:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LN10Docs=void 0;t.LN10Docs={name:"LN10",category:"Constants",syntax:["LN10"],description:"Returns the natural logarithm of 10, approximately equal to 2.302",examples:["LN10","log(10)"],seealso:[]}},88535:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LN2Docs=void 0;t.LN2Docs={name:"LN2",category:"Constants",syntax:["LN2"],description:"Returns the natural logarithm of 2, approximately equal to 0.693",examples:["LN2","log(2)"],seealso:[]}},77929:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LOG10EDocs=void 0;t.LOG10EDocs={name:"LOG10E",category:"Constants",syntax:["LOG10E"],description:"Returns the base-10 logarithm of E, approximately equal to 0.434",examples:["LOG10E","log(e, 10)"],seealso:[]}},79480:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LOG2EDocs=void 0;t.LOG2EDocs={name:"LOG2E",category:"Constants",syntax:["LOG2E"],description:"Returns the base-2 logarithm of E, approximately equal to 1.442",examples:["LOG2E","log(e, 2)"],seealso:[]}},52026:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NaNDocs=void 0;t.NaNDocs={name:"NaN",category:"Constants",syntax:["NaN"],description:"Not a number",examples:["NaN","0 / 0"],seealso:[]}},59583:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SQRT12Docs=void 0;t.SQRT12Docs={name:"SQRT1_2",category:"Constants",syntax:["SQRT1_2"],description:"Returns the square root of 1/2, approximately equal to 0.707",examples:["SQRT1_2","sqrt(1/2)"],seealso:[]}},89767:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SQRT2Docs=void 0;t.SQRT2Docs={name:"SQRT2",category:"Constants",syntax:["SQRT2"],description:"Returns the square root of 2, approximately equal to 1.414",examples:["SQRT2","sqrt(2)"],seealso:[]}},39912:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.eDocs=void 0;t.eDocs={name:"e",category:"Constants",syntax:["e"],description:"Euler's number, the base of the natural logarithm. Approximately equal to 2.71828",examples:["e","e ^ 2","exp(2)","log(e)"],seealso:["exp"]}},12052:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.falseDocs=void 0;t.falseDocs={name:"false",category:"Constants",syntax:["false"],description:"Boolean value false",examples:["false"],seealso:["true"]}},60812:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.iDocs=void 0;t.iDocs={name:"i",category:"Constants",syntax:["i"],description:"Imaginary unit, defined as i*i=-1. A complex number is described as a + b*i, where a is the real part, and b is the imaginary part.",examples:["i","i * i","sqrt(-1)"],seealso:[]}},18074:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nullDocs=void 0;t.nullDocs={name:"null",category:"Constants",syntax:["null"],description:"Value null",examples:["null"],seealso:["true","false"]}},80980:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.phiDocs=void 0;t.phiDocs={name:"phi",category:"Constants",syntax:["phi"],description:"Phi is the golden ratio. Two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Phi is defined as `(1 + sqrt(5)) / 2` and is approximately 1.618034...",examples:["phi"],seealso:[]}},54172:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.piDocs=void 0;t.piDocs={name:"pi",category:"Constants",syntax:["pi"],description:"The number pi is a mathematical constant that is the ratio of a circle's circumference to its diameter, and is approximately equal to 3.14159",examples:["pi","sin(pi/2)"],seealso:["tau"]}},98733:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tauDocs=void 0;t.tauDocs={name:"tau",category:"Constants",syntax:["tau"],description:"Tau is the ratio constant of a circle's circumference to radius, equal to 2 * pi, approximately 6.2832.",examples:["tau","2 * pi"],seealso:["pi"]}},12947:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.trueDocs=void 0;t.trueDocs={name:"true",category:"Constants",syntax:["true"],description:"Boolean value true",examples:["true"],seealso:["false"]}},1279:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.versionDocs=void 0;t.versionDocs={name:"version",category:"Constants",syntax:["version"],description:"A string with the version number of math.js",examples:["version"],seealso:[]}},44556:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bigintDocs=void 0;t.bigintDocs={name:"bigint",category:"Construction",syntax:["bigint(x)"],description:"Create a bigint, an integer with an arbitrary number of digits, from a number or string.",examples:["123123123123123123 # a large number will lose digits",'bigint("123123123123123123")','bignumber(["1", "3", "5"])'],seealso:["boolean","bignumber","number","complex","fraction","index","matrix","string","unit"]}},39048:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bignumberDocs=void 0;t.bignumberDocs={name:"bignumber",category:"Construction",syntax:["bignumber(x)"],description:"Create a big number from a number or string.",examples:["0.1 + 0.2","bignumber(0.1) + bignumber(0.2)",'bignumber("7.2")','bignumber("7.2e500")',"bignumber([0.1, 0.2, 0.3])"],seealso:["boolean","bigint","complex","fraction","index","matrix","string","unit"]}},48155:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.booleanDocs=void 0;t.booleanDocs={name:"boolean",category:"Construction",syntax:["x","boolean(x)"],description:"Convert a string or number into a boolean.",examples:["boolean(0)","boolean(1)","boolean(3)",'boolean("true")','boolean("false")',"boolean([1, 0, 1, 1])"],seealso:["bignumber","complex","index","matrix","number","string","unit"]}},16915:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.complexDocs=void 0;t.complexDocs={name:"complex",category:"Construction",syntax:["complex()","complex(re, im)","complex(string)"],description:"Create a complex number.",examples:["complex()","complex(2, 3)",'complex("7 - 2i")'],seealso:["bignumber","boolean","index","matrix","number","string","unit"]}},94229:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createUnitDocs=void 0;t.createUnitDocs={name:"createUnit",category:"Construction",syntax:["createUnit(definitions)","createUnit(name, definition)"],description:"Create a user-defined unit and register it with the Unit type.",examples:['createUnit("foo")','createUnit("knot", {definition: "0.514444444 m/s", aliases: ["knots", "kt", "kts"]})','createUnit("mph", "1 mile/hour")'],seealso:["unit","splitUnit"]}},45381:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fractionDocs=void 0;t.fractionDocs={name:"fraction",category:"Construction",syntax:["fraction(num)","fraction(matrix)","fraction(num,den)","fraction({n: num, d: den})"],description:"Create a fraction from a number or from integer numerator and denominator.",examples:["fraction(0.125)","fraction(1, 3) + fraction(2, 5)","fraction({n: 333, d: 53})","fraction([sqrt(9), sqrt(10), sqrt(11)])"],seealso:["bignumber","boolean","complex","index","matrix","string","unit"]}},27963:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.indexDocs=void 0;t.indexDocs={name:"index",category:"Construction",syntax:["[start]","[start:end]","[start:step:end]","[start1, start 2, ...]","[start1:end1, start2:end2, ...]","[start1:step1:end1, start2:step2:end2, ...]"],description:"Create an index to get or replace a subset of a matrix",examples:["A = [1, 2, 3; 4, 5, 6]","A[1, :]","A[1, 2] = 50","A[1:2, 1:2] = 1","B = [1, 2, 3]","B[B>1 and B<3]"],seealso:["bignumber","boolean","complex","matrix,","number","range","string","unit"]}},39434:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.matrixDocs=void 0;t.matrixDocs={name:"matrix",category:"Construction",syntax:["[]","[a1, b1, ...; a2, b2, ...]","matrix()",'matrix("dense")',"matrix([...])"],description:"Create a matrix.",examples:["[]","[1, 2, 3]","[1, 2, 3; 4, 5, 6]","matrix()","matrix([3, 4])",'matrix([3, 4; 5, 6], "sparse")','matrix([3, 4; 5, 6], "sparse", "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","sparse"]}},25634:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.numberDocs=void 0;t.numberDocs={name:"number",category:"Construction",syntax:["x","number(x)","number(unit, valuelessUnit)"],description:"Create a number or convert a string or boolean into a number.",examples:["2","2e3","4.05","number(2)",'number("7.2")',"number(true)","number([true, false, true, true])",'number(unit("52cm"), "m")'],seealso:["bignumber","bigint","boolean","complex","fraction","index","matrix","string","unit"]}},10703:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sparseDocs=void 0;t.sparseDocs={name:"sparse",category:"Construction",syntax:["sparse()","sparse([a1, b1, ...; a1, b2, ...])",'sparse([a1, b1, ...; a1, b2, ...], "number")'],description:"Create a sparse matrix.",examples:["sparse()","sparse([3, 4; 5, 6])",'sparse([3, 0; 5, 0], "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","matrix"]}},36593:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.splitUnitDocs=void 0;t.splitUnitDocs={name:"splitUnit",category:"Construction",syntax:["splitUnit(unit: Unit, parts: Unit[])"],description:"Split a unit in an array of units whose sum is equal to the original unit.",examples:['splitUnit(1 m, ["feet", "inch"])'],seealso:["unit","createUnit"]}},99282:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stringDocs=void 0;t.stringDocs={name:"string",category:"Construction",syntax:['"text"',"string(x)"],description:"Create a string or convert a value to a string",examples:['"Hello World!"',"string(4.2)","string(3 + 2i)"],seealso:["bignumber","boolean","complex","index","matrix","number","unit"]}},25209:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unitDocs=void 0;t.unitDocs={name:"unit",category:"Construction",syntax:["value unit","unit(value, unit)","unit(string)"],description:"Create a unit.",examples:["5.5 mm","3 inch",'unit(7.1, "kilogram")','unit("23 deg")'],seealso:["bignumber","boolean","complex","index","matrix","number","string"]}},65175:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.configDocs=void 0;t.configDocs={name:"config",category:"Core",syntax:["config()","config(options)"],description:"Get configuration or change configuration.",examples:["config()","1/3 + 1/4",'config({number: "Fraction"})',"1/3 + 1/4"],seealso:[]}},42432:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.importDocs=void 0;t.importDocs={name:"import",category:"Core",syntax:["import(functions)","import(functions, options)"],description:"Import functions or constants from an object.",examples:["import({myFn: f(x)=x^2, myConstant: 32 })","myFn(2)","myConstant"],seealso:[]}},71065:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.typedDocs=void 0;t.typedDocs={name:"typed",category:"Core",syntax:["typed(signatures)","typed(name, signatures)"],description:"Create a typed function.",examples:['double = typed({ "number": f(x)=x+x, "string": f(x)=concat(x,x) })',"double(2)",'double("hello")'],seealso:[]}},8356:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.embeddedDocs=void 0;var n=r(39912),i=r(12052),s=r(60812),o=r(58471),a=r(62880),l=r(88535),c=r(77929),u=r(79480),d=r(52026),h=r(18074),p=r(80980),m=r(54172),f=r(59583),g=r(89767),y=r(98733),b=r(12947),v=r(1279),_=r(39048),x=r(44556),w=r(48155),R=r(16915),k=r(94229),j=r(45381),z=r(27963),q=r(39434),$=r(25634),Z=r(10703),X=r(36593),Y=r(99282),ee=r(25209),te=r(65175),re=r(42432),ne=r(71065),ie=r(2920),se=r(74522),oe=r(70010),ae=r(87727),le=r(75800),ce=r(45739),ue=r(28868),de=r(97422),he=r(92433),pe=r(42345),me=r(14722),fe=r(15586),ge=r(99877),ye=r(78075),be=r(93681),ve=r(49827),_e=r(95756),xe=r(30983),we=r(29472),Se=r(21084),Pe=r(60954),Te=r(43670),Re=r(2706),ke=r(56585),Ie=r(3740),je=r(62040),He=r(93756),ze=r(70641),Ge=r(31822),We=r(21056),Ve=r(91161),qe=r(51085),$e=r(88685),Xe=r(35466),Ye=r(9519),Qe=r(86661),et=r(48016),tt=r(6416),rt=r(39335),nt=r(41259),it=r(21543),st=r(46129),ot=r(78021),at=r(88656),lt=r(83697),ct=r(76799),ut=r(36378),dt=r(50977),ht=r(46874),pt=r(5176),mt=r(28912),ft=r(14747),gt=r(27564),yt=r(11515),bt=r(76462),vt=r(93952),_t=r(95773),xt=r(15188),wt=r(34264),St=r(14328),Pt=r(92644),Et=r(58133),Mt=r(26350),Ct=r(71158),At=r(16515),Tt=r(18716),Dt=r(57704),Ot=r(31197),Rt=r(88205),Lt=r(39755),kt=r(49675),Nt=r(14492),Ft=r(17078),It=r(92322),Bt=r(94812),jt=r(26762),Ht=r(28159),Ut=r(57167),zt=r(60633),Gt=r(70699),Wt=r(65789),Vt=r(74504),qt=r(7501),$t=r(62522),Zt=r(2316),Kt=r(95059),Xt=r(35063),Yt=r(61725),Jt=r(40217),Qt=r(10632),er=r(64110),tr=r(20544),rr=r(29056),nr=r(98955),ir=r(71750),sr=r(44605),or=r(79339),ar=r(30420),lr=r(12984),cr=r(88154),ur=r(20537),dr=r(73980),hr=r(33401),pr=r(28444),mr=r(91095),fr=r(39652),gr=r(37808),yr=r(2383),br=r(259),vr=r(77354),_r=r(41117),xr=r(65648),wr=r(80325),Sr=r(62982),Pr=r(4063),Er=r(7377),Mr=r(23741),Cr=r(37758),Ar=r(16645),Tr=r(94448),Dr=r(77457),Or=r(44709),Rr=r(53839),Lr=r(28541),kr=r(36633),Nr=r(70195),Fr=r(64974),Ir=r(76706),Br=r(78531),jr=r(4590),Hr=r(94469),Ur=r(85484),zr=r(58906),Gr=r(15116),Wr=r(44258),Vr=r(33765),qr=r(74307),$r=r(43681),Zr=r(90670),Kr=r(97976),Xr=r(7731),Yr=r(12547),Jr=r(89002),Qr=r(55782),en=r(60576),tn=r(77163),rn=r(26118),nn=r(45042),sn=r(2360),on=r(57409),an=r(37874),ln=r(21166),cn=r(54475),un=r(50329),dn=r(77742),hn=r(90262),pn=r(20610),mn=r(26227),fn=r(8196),gn=r(93484),yn=r(34885),bn=r(16491),vn=r(32384),_n=r(29677),xn=r(6616),wn=r(25119),Sn=r(28209),Pn=r(37852),En=r(4920),Mn=r(69746),Cn=r(45773),An=r(85289),Tn=r(19292),Dn=r(50830),On=r(72566),Rn=r(80636),Ln=r(78605),kn=r(9673),Nn=r(18840),Fn=r(34192),In=r(87954),Bn=r(39263),jn=r(47807),Hn=r(67998),Un=r(4484),zn=r(96603),Gn=r(31347),Wn=r(36945),Vn=r(27381),qn=r(31370),$n=r(89336),Zn=r(48931),Kn=r(53915),Xn=r(2545),Yn=r(96461),Jn=r(84377),Qn=r(71497),ei=r(1856),ti=r(90097),ri=r(92970),ni=r(14113),ii=r(23793),si=r(28139),oi=r(87649),ai=r(66707),li=r(524),ci=r(56715),ui=r(91446),di=r(62555),hi=r(57859),pi=r(99127);t.embeddedDocs={bignumber:_.bignumberDocs,bigint:x.bigintDocs,boolean:w.booleanDocs,complex:R.complexDocs,createUnit:k.createUnitDocs,fraction:j.fractionDocs,index:z.indexDocs,matrix:q.matrixDocs,number:$.numberDocs,sparse:Z.sparseDocs,splitUnit:X.splitUnitDocs,string:Y.stringDocs,unit:ee.unitDocs,e:n.eDocs,E:n.eDocs,false:i.falseDocs,i:s.iDocs,Infinity:o.InfinityDocs,LN2:l.LN2Docs,LN10:a.LN10Docs,LOG2E:u.LOG2EDocs,LOG10E:c.LOG10EDocs,NaN:d.NaNDocs,null:h.nullDocs,pi:m.piDocs,PI:m.piDocs,phi:p.phiDocs,SQRT1_2:f.SQRT12Docs,SQRT2:g.SQRT2Docs,tau:y.tauDocs,true:b.trueDocs,version:v.versionDocs,speedOfLight:{description:"Speed of light in vacuum",examples:["speedOfLight"]},gravitationConstant:{description:"Newtonian constant of gravitation",examples:["gravitationConstant"]},planckConstant:{description:"Planck constant",examples:["planckConstant"]},reducedPlanckConstant:{description:"Reduced Planck constant",examples:["reducedPlanckConstant"]},magneticConstant:{description:"Magnetic constant (vacuum permeability)",examples:["magneticConstant"]},electricConstant:{description:"Electric constant (vacuum permeability)",examples:["electricConstant"]},vacuumImpedance:{description:"Characteristic impedance of vacuum",examples:["vacuumImpedance"]},coulomb:{description:"Coulomb's constant",examples:["coulomb"]},elementaryCharge:{description:"Elementary charge",examples:["elementaryCharge"]},bohrMagneton:{description:"Bohr magneton",examples:["bohrMagneton"]},conductanceQuantum:{description:"Conductance quantum",examples:["conductanceQuantum"]},inverseConductanceQuantum:{description:"Inverse conductance quantum",examples:["inverseConductanceQuantum"]},magneticFluxQuantum:{description:"Magnetic flux quantum",examples:["magneticFluxQuantum"]},nuclearMagneton:{description:"Nuclear magneton",examples:["nuclearMagneton"]},klitzing:{description:"Von Klitzing constant",examples:["klitzing"]},bohrRadius:{description:"Bohr radius",examples:["bohrRadius"]},classicalElectronRadius:{description:"Classical electron radius",examples:["classicalElectronRadius"]},electronMass:{description:"Electron mass",examples:["electronMass"]},fermiCoupling:{description:"Fermi coupling constant",examples:["fermiCoupling"]},fineStructure:{description:"Fine-structure constant",examples:["fineStructure"]},hartreeEnergy:{description:"Hartree energy",examples:["hartreeEnergy"]},protonMass:{description:"Proton mass",examples:["protonMass"]},deuteronMass:{description:"Deuteron Mass",examples:["deuteronMass"]},neutronMass:{description:"Neutron mass",examples:["neutronMass"]},quantumOfCirculation:{description:"Quantum of circulation",examples:["quantumOfCirculation"]},rydberg:{description:"Rydberg constant",examples:["rydberg"]},thomsonCrossSection:{description:"Thomson cross section",examples:["thomsonCrossSection"]},weakMixingAngle:{description:"Weak mixing angle",examples:["weakMixingAngle"]},efimovFactor:{description:"Efimov factor",examples:["efimovFactor"]},atomicMass:{description:"Atomic mass constant",examples:["atomicMass"]},avogadro:{description:"Avogadro's number",examples:["avogadro"]},boltzmann:{description:"Boltzmann constant",examples:["boltzmann"]},faraday:{description:"Faraday constant",examples:["faraday"]},firstRadiation:{description:"First radiation constant",examples:["firstRadiation"]},loschmidt:{description:"Loschmidt constant at T=273.15 K and p=101.325 kPa",examples:["loschmidt"]},gasConstant:{description:"Gas constant",examples:["gasConstant"]},molarPlanckConstant:{description:"Molar Planck constant",examples:["molarPlanckConstant"]},molarVolume:{description:"Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa",examples:["molarVolume"]},sackurTetrode:{description:"Sackur-Tetrode constant at T=1 K and p=101.325 kPa",examples:["sackurTetrode"]},secondRadiation:{description:"Second radiation constant",examples:["secondRadiation"]},stefanBoltzmann:{description:"Stefan-Boltzmann constant",examples:["stefanBoltzmann"]},wienDisplacement:{description:"Wien displacement law constant",examples:["wienDisplacement"]},molarMass:{description:"Molar mass constant",examples:["molarMass"]},molarMassC12:{description:"Molar mass constant of carbon-12",examples:["molarMassC12"]},gravity:{description:"Standard acceleration of gravity (standard acceleration of free-fall on Earth)",examples:["gravity"]},planckLength:{description:"Planck length",examples:["planckLength"]},planckMass:{description:"Planck mass",examples:["planckMass"]},planckTime:{description:"Planck time",examples:["planckTime"]},planckCharge:{description:"Planck charge",examples:["planckCharge"]},planckTemperature:{description:"Planck temperature",examples:["planckTemperature"]},derivative:ie.derivativeDocs,lsolve:oe.lsolveDocs,lsolveAll:ae.lsolveAllDocs,lup:le.lupDocs,lusolve:ce.lusolveDocs,leafCount:se.leafCountDocs,polynomialRoot:ue.polynomialRootDocs,resolve:pe.resolveDocs,simplify:me.simplifyDocs,simplifyConstant:fe.simplifyConstantDocs,simplifyCore:ge.simplifyCoreDocs,symbolicEqual:be.symbolicEqualDocs,rationalize:he.rationalizeDocs,slu:ye.sluDocs,usolve:ve.usolveDocs,usolveAll:_e.usolveAllDocs,qr:de.qrDocs,abs:xe.absDocs,add:we.addDocs,cbrt:Se.cbrtDocs,ceil:Pe.ceilDocs,cube:Te.cubeDocs,divide:Re.divideDocs,dotDivide:ke.dotDivideDocs,dotMultiply:Ie.dotMultiplyDocs,dotPow:je.dotPowDocs,exp:He.expDocs,expm:ze.expmDocs,expm1:Ge.expm1Docs,fix:We.fixDocs,floor:Ve.floorDocs,gcd:qe.gcdDocs,hypot:$e.hypotDocs,lcm:Ye.lcmDocs,log:Qe.logDocs,log2:rt.log2Docs,log1p:tt.log1pDocs,log10:et.log10Docs,mod:nt.modDocs,multiply:it.multiplyDocs,norm:st.normDocs,nthRoot:ot.nthRootDocs,nthRoots:at.nthRootsDocs,pow:lt.powDocs,round:ct.roundDocs,sign:ut.signDocs,sqrt:dt.sqrtDocs,sqrtm:ht.sqrtmDocs,square:gt.squareDocs,subtract:yt.subtractDocs,unaryMinus:bt.unaryMinusDocs,unaryPlus:vt.unaryPlusDocs,xgcd:_t.xgcdDocs,invmod:Xe.invmodDocs,bitAnd:xt.bitAndDocs,bitNot:wt.bitNotDocs,bitOr:St.bitOrDocs,bitXor:Pt.bitXorDocs,leftShift:Et.leftShiftDocs,rightArithShift:Mt.rightArithShiftDocs,rightLogShift:Ct.rightLogShiftDocs,bellNumbers:At.bellNumbersDocs,catalan:Tt.catalanDocs,composition:Dt.compositionDocs,stirlingS2:Ot.stirlingS2Docs,config:te.configDocs,import:re.importDocs,typed:ne.typedDocs,arg:Rt.argDocs,conj:Lt.conjDocs,re:Nt.reDocs,im:kt.imDocs,evaluate:Ft.evaluateDocs,help:It.helpDocs,distance:Bt.distanceDocs,intersect:jt.intersectDocs,and:Ht.andDocs,not:Ut.notDocs,or:zt.orDocs,xor:Gt.xorDocs,concat:Vt.concatDocs,count:qt.countDocs,cross:$t.crossDocs,column:Wt.columnDocs,ctranspose:Zt.ctransposeDocs,det:Kt.detDocs,diag:Xt.diagDocs,diff:Yt.diffDocs,dot:Jt.dotDocs,getMatrixDataType:nr.getMatrixDataTypeDocs,identity:ir.identityDocs,filter:er.filterDocs,flatten:tr.flattenDocs,forEach:rr.forEachDocs,inv:sr.invDocs,pinv:or.pinvDocs,eigs:Qt.eigsDocs,kron:ar.kronDocs,matrixFromFunction:ur.matrixFromFunctionDocs,matrixFromRows:dr.matrixFromRowsDocs,matrixFromColumns:cr.matrixFromColumnsDocs,map:lr.mapDocs,ones:hr.onesDocs,partitionSelect:pr.partitionSelectDocs,range:mr.rangeDocs,resize:gr.resizeDocs,reshape:fr.reshapeDocs,rotate:yr.rotateDocs,rotationMatrix:br.rotationMatrixDocs,row:vr.rowDocs,size:_r.sizeDocs,sort:xr.sortDocs,squeeze:wr.squeezeDocs,subset:Sr.subsetDocs,trace:Pr.traceDocs,transpose:Er.transposeDocs,zeros:Mr.zerosDocs,fft:Cr.fftDocs,ifft:Ar.ifftDocs,sylvester:pt.sylvesterDocs,schur:mt.schurDocs,lyap:ft.lyapDocs,solveODE:pi.solveODEDocs,combinations:Tr.combinationsDocs,combinationsWithRep:Dr.combinationsWithRepDocs,factorial:Or.factorialDocs,gamma:Rr.gammaDocs,kldivergence:kr.kldivergenceDocs,lgamma:Lr.lgammaDocs,multinomial:Nr.multinomialDocs,permutations:Fr.permutationsDocs,pickRandom:Ir.pickRandomDocs,random:Br.randomDocs,randomInt:jr.randomIntDocs,compare:Hr.compareDocs,compareNatural:Ur.compareNaturalDocs,compareText:zr.compareTextDocs,deepEqual:Gr.deepEqualDocs,equal:Wr.equalDocs,equalText:Vr.equalTextDocs,larger:qr.largerDocs,largerEq:$r.largerEqDocs,smaller:Zr.smallerDocs,smallerEq:Kr.smallerEqDocs,unequal:Xr.unequalDocs,setCartesian:Yr.setCartesianDocs,setDifference:Jr.setDifferenceDocs,setDistinct:Qr.setDistinctDocs,setIntersect:en.setIntersectDocs,setIsSubset:tn.setIsSubsetDocs,setMultiplicity:rn.setMultiplicityDocs,setPowerset:nn.setPowersetDocs,setSize:sn.setSizeDocs,setSymDifference:on.setSymDifferenceDocs,setUnion:an.setUnionDocs,zpk2tf:ln.zpk2tfDocs,freqz:cn.freqzDocs,erf:un.erfDocs,zeta:dn.zetaDocs,cumsum:xn.cumSumDocs,mad:hn.madDocs,max:pn.maxDocs,mean:mn.meanDocs,median:fn.medianDocs,min:gn.minDocs,mode:yn.modeDocs,prod:bn.prodDocs,quantileSeq:vn.quantileSeqDocs,std:_n.stdDocs,sum:wn.sumDocs,variance:Sn.varianceDocs,corr:Pn.corrDocs,acos:En.acosDocs,acosh:Mn.acoshDocs,acot:Cn.acotDocs,acoth:An.acothDocs,acsc:Tn.acscDocs,acsch:Dn.acschDocs,asec:On.asecDocs,asech:Rn.asechDocs,asin:Ln.asinDocs,asinh:kn.asinhDocs,atan:Nn.atanDocs,atanh:In.atanhDocs,atan2:Fn.atan2Docs,cos:Bn.cosDocs,cosh:jn.coshDocs,cot:Hn.cotDocs,coth:Un.cothDocs,csc:zn.cscDocs,csch:Gn.cschDocs,sec:Wn.secDocs,sech:Vn.sechDocs,sin:qn.sinDocs,sinh:$n.sinhDocs,tan:Zn.tanDocs,tanh:Kn.tanhDocs,to:Xn.toDocs,clone:Jn.cloneDocs,format:Qn.formatDocs,bin:Yn.binDocs,oct:ui.octDocs,hex:ti.hexDocs,isNaN:ni.isNaNDocs,isInteger:ri.isIntegerDocs,isNegative:ii.isNegativeDocs,isNumeric:si.isNumericDocs,hasNumericValue:ei.hasNumericValueDocs,isPositive:oi.isPositiveDocs,isPrime:ai.isPrimeDocs,isZero:li.isZeroDocs,print:di.printDocs,typeOf:hi.typeOfDocs,numeric:ci.numericDocs}},2920:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.derivativeDocs=void 0;t.derivativeDocs={name:"derivative",category:"Algebra",syntax:["derivative(expr, variable)","derivative(expr, variable, {simplify: boolean})"],description:"Takes the derivative of an expression expressed in parser Nodes. The derivative will be taken over the supplied variable in the second parameter. If there are multiple variables in the expression, it will return a partial derivative.",examples:['derivative("2x^3", "x")','derivative("2x^3", "x", {simplify: false})','derivative("2x^2 + 3x + 4", "x")','derivative("sin(2x)", "x")','f = parse("x^2 + x")','x = parse("x")',"df = derivative(f, x)","df.evaluate({x: 3})"],seealso:["simplify","parse","evaluate"]}},74522:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.leafCountDocs=void 0;t.leafCountDocs={name:"leafCount",category:"Algebra",syntax:["leafCount(expr)"],description:"Computes the number of leaves in the parse tree of the given expression",examples:['leafCount("e^(i*pi)-1")','leafCount(parse("{a: 22/7, b: 10^(1/2)}"))'],seealso:["simplify"]}},70010:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lsolveDocs=void 0;t.lsolveDocs={name:"lsolve",category:"Algebra",syntax:["x=lsolve(L, b)"],description:"Finds one solution of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolveAll","lup","lusolve","usolve","matrix","sparse"]}},87727:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lsolveAllDocs=void 0;t.lsolveAllDocs={name:"lsolveAll",category:"Algebra",syntax:["x=lsolveAll(L, b)"],description:"Finds all solutions of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolve","lup","lusolve","usolve","matrix","sparse"]}},75800:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lupDocs=void 0;t.lupDocs={name:"lup",category:"Algebra",syntax:["lup(m)"],description:"Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in three matrices (L, U, P) where P * A = L * U",examples:["lup([[2, 1], [1, 4]])","lup(matrix([[2, 1], [1, 4]]))","lup(sparse([[2, 1], [1, 4]]))"],seealso:["lusolve","lsolve","usolve","matrix","sparse","slu","qr"]}},45739:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lusolveDocs=void 0;t.lusolveDocs={name:"lusolve",category:"Algebra",syntax:["x=lusolve(A, b)","x=lusolve(lu, b)"],description:"Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lusolve(a, b)"],seealso:["lup","slu","lsolve","usolve","matrix","sparse"]}},14747:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lyapDocs=void 0;t.lyapDocs={name:"lyap",category:"Algebra",syntax:["lyap(A,Q)"],description:"Solves the Continuous-time Lyapunov equation AP+PA'+Q=0 for P",examples:["lyap([[-2, 0], [1, -4]], [[3, 1], [1, 3]])","A = [[-2, 0], [1, -4]]","Q = [[3, 1], [1, 3]]","lyap(A,Q)"],seealso:["schur","sylvester"]}},28868:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.polynomialRootDocs=void 0;t.polynomialRootDocs={name:"polynomialRoot",category:"Algebra",syntax:["x=polynomialRoot(-6, 3)","x=polynomialRoot(4, -4, 1)","x=polynomialRoot(-8, 12, -6, 1)"],description:"Finds the roots of a univariate polynomial given by its coefficients starting from constant, linear, and so on, increasing in degree.",examples:["a = polynomialRoot(-6, 11, -6, 1)"],seealso:["cbrt","sqrt"]}},97422:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.qrDocs=void 0;t.qrDocs={name:"qr",category:"Algebra",syntax:["qr(A)"],description:"Calculates the Matrix QR decomposition. Matrix `A` is decomposed in two matrices (`Q`, `R`) where `Q` is an orthogonal matrix and `R` is an upper triangular matrix.",examples:["qr([[1, -1,  4], [1,  4, -2], [1,  4,  2], [1,  -1, 0]])"],seealso:["lup","slu","matrix"]}},92433:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rationalizeDocs=void 0;t.rationalizeDocs={name:"rationalize",category:"Algebra",syntax:["rationalize(expr)","rationalize(expr, scope)","rationalize(expr, scope, detailed)"],description:"Transform a rationalizable expression in a rational fraction. If rational fraction is one variable polynomial then converts the numerator and denominator in canonical form, with decreasing exponents, returning the coefficients of numerator.",examples:['rationalize("2x/y - y/(x+1)")','rationalize("2x/y - y/(x+1)", true)'],seealso:["simplify"]}},42345:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveDocs=void 0;t.resolveDocs={name:"resolve",category:"Algebra",syntax:["resolve(node, scope)"],description:"Recursively substitute variables in an expression tree.",examples:['resolve(parse("1 + x"), { x: 7 })','resolve(parse("size(text)"), { text: "Hello World" })','resolve(parse("x + y"), { x: parse("3z") })','resolve(parse("3x"), { x: parse("y+z"), z: parse("w^y") })'],seealso:["simplify","evaluate"],mayThrow:["ReferenceError"]}},28912:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.schurDocs=void 0;t.schurDocs={name:"schur",category:"Algebra",syntax:["schur(A)"],description:"Performs a real Schur decomposition of the real matrix A = UTU'",examples:["schur([[1, 0], [-4, 3]])","A = [[1, 0], [-4, 3]]","schur(A)"],seealso:["lyap","sylvester"]}},14722:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplifyDocs=void 0;t.simplifyDocs={name:"simplify",category:"Algebra",syntax:["simplify(expr)","simplify(expr, rules)"],description:"Simplify an expression tree.",examples:['simplify("3 + 2 / 4")','simplify("2x + x")','f = parse("x * (x + 2 + x)")',"simplified = simplify(f)","simplified.evaluate({x: 2})"],seealso:["simplifyCore","derivative","evaluate","parse","rationalize","resolve"]}},15586:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplifyConstantDocs=void 0;t.simplifyConstantDocs={name:"simplifyConstant",category:"Algebra",syntax:["simplifyConstant(expr)","simplifyConstant(expr, options)"],description:"Replace constant subexpressions of node with their values.",examples:['simplifyConstant("(3-3)*x")','simplifyConstant(parse("z-cos(tau/8)"))'],seealso:["simplify","simplifyCore","evaluate"]}},99877:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplifyCoreDocs=void 0;t.simplifyCoreDocs={name:"simplifyCore",category:"Algebra",syntax:["simplifyCore(node)"],description:"Perform simple one-pass simplifications on an expression tree.",examples:['simplifyCore(parse("0*x"))','simplifyCore(parse("(x+0)*2"))'],seealso:["simplify","simplifyConstant","evaluate"]}},78075:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sluDocs=void 0;t.sluDocs={name:"slu",category:"Algebra",syntax:["slu(A, order, threshold)"],description:"Calculate the Matrix LU decomposition with full pivoting. Matrix A is decomposed in two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U",examples:["slu(sparse([4.5, 0, 3.2, 0; 3.1, 2.9, 0, 0.9; 0, 1.7, 3, 0; 3.5, 0.4, 0, 1]), 1, 0.001)"],seealso:["lusolve","lsolve","usolve","matrix","sparse","lup","qr"]}},5176:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sylvesterDocs=void 0;t.sylvesterDocs={name:"sylvester",category:"Algebra",syntax:["sylvester(A,B,C)"],description:"Solves the real-valued Sylvester equation AX+XB=C for X",examples:["sylvester([[-1, -2], [1, 1]], [[-2, 1], [-1, 2]], [[-3, 2], [3, 0]])","A = [[-1, -2], [1, 1]]; B = [[2, -1], [1, -2]]; C = [[-3, 2], [3, 0]]","sylvester(A, B, C)"],seealso:["schur","lyap"]}},93681:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.symbolicEqualDocs=void 0;t.symbolicEqualDocs={name:"symbolicEqual",category:"Algebra",syntax:["symbolicEqual(expr1, expr2)","symbolicEqual(expr1, expr2, options)"],description:"Returns true if the difference of the expressions simplifies to 0",examples:['symbolicEqual("x*y","y*x")','symbolicEqual("abs(x^2)", "x^2")','symbolicEqual("abs(x)", "x", {context: {abs: {trivial: true}}})'],seealso:["simplify","evaluate"]}},49827:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.usolveDocs=void 0;t.usolveDocs={name:"usolve",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds one solution of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolveAll","lup","lusolve","lsolve","matrix","sparse"]}},95756:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.usolveAllDocs=void 0;t.usolveAllDocs={name:"usolveAll",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds all solutions of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolve","lup","lusolve","lsolve","matrix","sparse"]}},30983:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.absDocs=void 0;t.absDocs={name:"abs",category:"Arithmetic",syntax:["abs(x)"],description:"Compute the absolute value.",examples:["abs(3.5)","abs(-4.2)"],seealso:["sign"]}},29472:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addDocs=void 0;t.addDocs={name:"add",category:"Operators",syntax:["x + y","add(x, y)"],description:"Add two values.",examples:["a = 2.1 + 3.6","a - 3.6","3 + 2i","3 cm + 2 inch",'"2.3" + "4"'],seealso:["subtract"]}},21084:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cbrtDocs=void 0;t.cbrtDocs={name:"cbrt",category:"Arithmetic",syntax:["cbrt(x)","cbrt(x, allRoots)"],description:"Compute the cubic root value. If x = y * y * y, then y is the cubic root of x. When `x` is a number or complex number, an optional second argument `allRoots` can be provided to return all three cubic roots. If not provided, the principal root is returned",examples:["cbrt(64)","cube(4)","cbrt(-8)","cbrt(2 + 3i)","cbrt(8i)","cbrt(8i, true)","cbrt(27 m^3)"],seealso:["square","sqrt","cube","multiply"]}},60954:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ceilDocs=void 0;t.ceilDocs={name:"ceil",category:"Arithmetic",syntax:["ceil(x)"],description:"Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.",examples:["ceil(3.2)","ceil(3.8)","ceil(-4.2)"],seealso:["floor","fix","round"]}},43670:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cubeDocs=void 0;t.cubeDocs={name:"cube",category:"Arithmetic",syntax:["cube(x)"],description:"Compute the cube of a value. The cube of x is x * x * x.",examples:["cube(2)","2^3","2 * 2 * 2"],seealso:["multiply","square","pow"]}},2706:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.divideDocs=void 0;t.divideDocs={name:"divide",category:"Operators",syntax:["x / y","divide(x, y)"],description:"Divide two values.",examples:["a = 2 / 3","a * 3","4.5 / 2","3 + 4 / 2","(3 + 4) / 2","18 km / 4.5"],seealso:["multiply"]}},56585:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dotDivideDocs=void 0;t.dotDivideDocs={name:"dotDivide",category:"Operators",syntax:["x ./ y","dotDivide(x, y)"],description:"Divide two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a ./ b"],seealso:["multiply","dotMultiply","divide"]}},3740:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dotMultiplyDocs=void 0;t.dotMultiplyDocs={name:"dotMultiply",category:"Operators",syntax:["x .* y","dotMultiply(x, y)"],description:"Multiply two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a .* b"],seealso:["multiply","divide","dotDivide"]}},62040:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dotPowDocs=void 0;t.dotPowDocs={name:"dotPow",category:"Operators",syntax:["x .^ y","dotPow(x, y)"],description:"Calculates the power of x to y element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","a .^ 2"],seealso:["pow"]}},93756:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.expDocs=void 0;t.expDocs={name:"exp",category:"Arithmetic",syntax:["exp(x)"],description:"Calculate the exponent of a value.",examples:["exp(1.3)","e ^ 1.3","log(exp(1.3))","x = 2.4","(exp(i*x) == cos(x) + i*sin(x))   # Euler's formula"],seealso:["expm","expm1","pow","log"]}},70641:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.expmDocs=void 0;t.expmDocs={name:"expm",category:"Arithmetic",syntax:["exp(x)"],description:"Compute the matrix exponential, expm(A) = e^A. The matrix must be square. Not to be confused with exp(a), which performs element-wise exponentiation.",examples:["expm([[0,2],[0,0]])"],seealso:["exp"]}},31822:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.expm1Docs=void 0;t.expm1Docs={name:"expm1",category:"Arithmetic",syntax:["expm1(x)"],description:"Calculate the value of subtracting 1 from the exponential value.",examples:["expm1(2)","pow(e, 2) - 1","log(expm1(2) + 1)"],seealso:["exp","pow","log"]}},21056:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fixDocs=void 0;t.fixDocs={name:"fix",category:"Arithmetic",syntax:["fix(x)"],description:"Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.",examples:["fix(3.2)","fix(3.8)","fix(-4.2)","fix(-4.8)"],seealso:["ceil","floor","round"]}},91161:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.floorDocs=void 0;t.floorDocs={name:"floor",category:"Arithmetic",syntax:["floor(x)"],description:"Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.",examples:["floor(3.2)","floor(3.8)","floor(-4.2)"],seealso:["ceil","fix","round"]}},51085:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gcdDocs=void 0;t.gcdDocs={name:"gcd",category:"Arithmetic",syntax:["gcd(a, b)","gcd(a, b, c, ...)"],description:"Compute the greatest common divisor.",examples:["gcd(8, 12)","gcd(-4, 6)","gcd(25, 15, -10)"],seealso:["lcm","xgcd"]}},88685:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hypotDocs=void 0;t.hypotDocs={name:"hypot",category:"Arithmetic",syntax:["hypot(a, b, c, ...)","hypot([a, b, c, ...])"],description:"Calculate the hypotenuse of a list with values.",examples:["hypot(3, 4)","sqrt(3^2 + 4^2)","hypot(-2)","hypot([3, 4, 5])"],seealso:["abs","norm"]}},35466:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.invmodDocs=void 0;t.invmodDocs={name:"invmod",category:"Arithmetic",syntax:["invmod(a, b)"],description:"Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation ax ≣ 1 (mod b)",examples:["invmod(8, 12)","invmod(7, 13)","invmod(15151, 15122)"],seealso:["gcd","xgcd"]}},9519:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lcmDocs=void 0;t.lcmDocs={name:"lcm",category:"Arithmetic",syntax:["lcm(x, y)"],description:"Compute the least common multiple.",examples:["lcm(4, 6)","lcm(6, 21)","lcm(6, 21, 5)"],seealso:["gcd"]}},86661:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logDocs=void 0;t.logDocs={name:"log",category:"Arithmetic",syntax:["log(x)","log(x, base)"],description:"Compute the logarithm of a value. If no base is provided, the natural logarithm of x is calculated. If base if provided, the logarithm is calculated for the specified base. log(x, base) is defined as log(x) / log(base).",examples:["log(3.5)","a = log(2.4)","exp(a)","10 ^ 4","log(10000, 10)","log(10000) / log(10)","b = log(1024, 2)","2 ^ b"],seealso:["exp","log1p","log2","log10"]}},48016:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.log10Docs=void 0;t.log10Docs={name:"log10",category:"Arithmetic",syntax:["log10(x)"],description:"Compute the 10-base logarithm of a value.",examples:["log10(0.00001)","log10(10000)","10 ^ 4","log(10000) / log(10)","log(10000, 10)"],seealso:["exp","log"]}},6416:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.log1pDocs=void 0;t.log1pDocs={name:"log1p",category:"Arithmetic",syntax:["log1p(x)","log1p(x, base)"],description:"Calculate the logarithm of a `value+1`",examples:["log1p(2.5)","exp(log1p(1.4))","pow(10, 4)","log1p(9999, 10)","log1p(9999) / log(10)"],seealso:["exp","log","log2","log10"]}},39335:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.log2Docs=void 0;t.log2Docs={name:"log2",category:"Arithmetic",syntax:["log2(x)"],description:"Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`.",examples:["log2(0.03125)","log2(16)","log2(16) / log2(2)","pow(2, 4)"],seealso:["exp","log1p","log","log10"]}},41259:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.modDocs=void 0;t.modDocs={name:"mod",category:"Operators",syntax:["x % y","x mod y","mod(x, y)"],description:"Calculates the modulus, the remainder of an integer division.",examples:["7 % 3","11 % 2","10 mod 4","isOdd(x) = x % 2","isOdd(2)","isOdd(3)"],seealso:["divide"]}},21543:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.multiplyDocs=void 0;t.multiplyDocs={name:"multiply",category:"Operators",syntax:["x * y","multiply(x, y)"],description:"multiply two values.",examples:["a = 2.1 * 3.4","a / 3.4","2 * 3 + 4","2 * (3 + 4)","3 * 2.1 km"],seealso:["divide"]}},46129:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normDocs=void 0;t.normDocs={name:"norm",category:"Arithmetic",syntax:["norm(x)","norm(x, p)"],description:"Calculate the norm of a number, vector or matrix.",examples:["abs(-3.5)","norm(-3.5)","norm(3 - 4i)","norm([1, 2, -3], Infinity)","norm([1, 2, -3], -Infinity)","norm([3, 4], 2)","norm([[1, 2], [3, 4]], 1)",'norm([[1, 2], [3, 4]], "inf")','norm([[1, 2], [3, 4]], "fro")']}},78021:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nthRootDocs=void 0;t.nthRootDocs={name:"nthRoot",category:"Arithmetic",syntax:["nthRoot(a)","nthRoot(a, root)"],description:'Calculate the nth root of a value. The principal nth root of a positive real number A, is the positive real solution of the equation "x^root = A".',examples:["4 ^ 3","nthRoot(64, 3)","nthRoot(9, 2)","sqrt(9)"],seealso:["nthRoots","pow","sqrt"]}},88656:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nthRootsDocs=void 0;t.nthRootsDocs={name:"nthRoots",category:"Arithmetic",syntax:["nthRoots(A)","nthRoots(A, root)"],description:'Calculate the nth roots of a value. An nth root of a positive real number A, is a positive real solution of the equation "x^root = A". This function returns an array of complex values.',examples:["nthRoots(1)","nthRoots(1, 3)"],seealso:["sqrt","pow","nthRoot"]}},83697:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.powDocs=void 0;t.powDocs={name:"pow",category:"Operators",syntax:["x ^ y","pow(x, y)"],description:"Calculates the power of x to y, x^y.",examples:["2^3","2*2*2","1 + e ^ (pi * i)","pow([[1, 2], [4, 3]], 2)","pow([[1, 2], [4, 3]], -1)"],seealso:["multiply","nthRoot","nthRoots","sqrt"]}},76799:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.roundDocs=void 0;t.roundDocs={name:"round",category:"Arithmetic",syntax:["round(x)","round(x, n)","round(unit, valuelessUnit)","round(unit, n, valuelessUnit)"],description:"round a value towards the nearest integer.If x is complex, both real and imaginary part are rounded towards the nearest integer. When n is specified, the value is rounded to n decimals.",examples:["round(3.2)","round(3.8)","round(-4.2)","round(-4.8)","round(pi, 3)","round(123.45678, 2)","round(3.241cm, 2, cm)","round([3.2, 3.8, -4.7])"],seealso:["ceil","floor","fix"]}},36378:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.signDocs=void 0;t.signDocs={name:"sign",category:"Arithmetic",syntax:["sign(x)"],description:"Compute the sign of a value. The sign of a value x is 1 when x>1, -1 when x<0, and 0 when x=0.",examples:["sign(3.5)","sign(-4.2)","sign(0)"],seealso:["abs"]}},50977:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sqrtDocs=void 0;t.sqrtDocs={name:"sqrt",category:"Arithmetic",syntax:["sqrt(x)"],description:"Compute the square root value. If x = y * y, then y is the square root of x.",examples:["sqrt(25)","5 * 5","sqrt(-1)"],seealso:["square","sqrtm","multiply","nthRoot","nthRoots","pow"]}},46874:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sqrtmDocs=void 0;t.sqrtmDocs={name:"sqrtm",category:"Arithmetic",syntax:["sqrtm(x)"],description:"Calculate the principal square root of a square matrix. The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.",examples:["sqrtm([[33, 24], [48, 57]])"],seealso:["sqrt","abs","square","multiply"]}},27564:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.squareDocs=void 0;t.squareDocs={name:"square",category:"Arithmetic",syntax:["square(x)"],description:"Compute the square of a value. The square of x is x * x.",examples:["square(3)","sqrt(9)","3^2","3 * 3"],seealso:["multiply","pow","sqrt","cube"]}},11515:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subtractDocs=void 0;t.subtractDocs={name:"subtract",category:"Operators",syntax:["x - y","subtract(x, y)"],description:"subtract two values.",examples:["a = 5.3 - 2","a + 2","2/3 - 1/6","2 * 3 - 3","2.1 km - 500m"],seealso:["add"]}},76462:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unaryMinusDocs=void 0;t.unaryMinusDocs={name:"unaryMinus",category:"Operators",syntax:["-x","unaryMinus(x)"],description:"Inverse the sign of a value. Converts booleans and strings to numbers.",examples:["-4.5","-(-5.6)",'-"22"'],seealso:["add","subtract","unaryPlus"]}},93952:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unaryPlusDocs=void 0;t.unaryPlusDocs={name:"unaryPlus",category:"Operators",syntax:["+x","unaryPlus(x)"],description:"Converts booleans and strings to numbers.",examples:["+true",'+"2"'],seealso:["add","subtract","unaryMinus"]}},95773:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.xgcdDocs=void 0;t.xgcdDocs={name:"xgcd",category:"Arithmetic",syntax:["xgcd(a, b)"],description:"Calculate the extended greatest common divisor for two values. The result is an array [d, x, y] with 3 entries, where d is the greatest common divisor, and d = x * a + y * b.",examples:["xgcd(8, 12)","gcd(8, 12)","xgcd(36163, 21199)"],seealso:["gcd","lcm"]}},15188:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bitAndDocs=void 0;t.bitAndDocs={name:"bitAnd",category:"Bitwise",syntax:["x & y","bitAnd(x, y)"],description:"Bitwise AND operation. Performs the logical AND operation on each pair of the corresponding bits of the two given values by multiplying them. If both bits in the compared position are 1, the bit in the resulting binary representation is 1, otherwise, the result is 0",examples:["5 & 3","bitAnd(53, 131)","[1, 12, 31] & 42"],seealso:["bitNot","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]}},34264:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bitNotDocs=void 0;t.bitNotDocs={name:"bitNot",category:"Bitwise",syntax:["~x","bitNot(x)"],description:"Bitwise NOT operation. Performs a logical negation on each bit of the given value. Bits that are 0 become 1, and those that are 1 become 0.",examples:["~1","~2","bitNot([2, -3, 4])"],seealso:["bitAnd","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]}},14328:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bitOrDocs=void 0;t.bitOrDocs={name:"bitOr",category:"Bitwise",syntax:["x | y","bitOr(x, y)"],description:"Bitwise OR operation. Performs the logical inclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1, otherwise, the result is 0.",examples:["5 | 3","bitOr([1, 2, 3], 4)"],seealso:["bitAnd","bitNot","bitXor","leftShift","rightArithShift","rightLogShift"]}},92644:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bitXorDocs=void 0;t.bitXorDocs={name:"bitXor",category:"Bitwise",syntax:["bitXor(x, y)"],description:"Bitwise XOR operation, exclusive OR. Performs the logical exclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1.",examples:["bitOr(1, 2)","bitXor([2, 3, 4], 4)"],seealso:["bitAnd","bitNot","bitOr","leftShift","rightArithShift","rightLogShift"]}},58133:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.leftShiftDocs=void 0;t.leftShiftDocs={name:"leftShift",category:"Bitwise",syntax:["x << y","leftShift(x, y)"],description:"Bitwise left logical shift of a value x by y number of bits.",examples:["4 << 1","8 >> 1"],seealso:["bitAnd","bitNot","bitOr","bitXor","rightArithShift","rightLogShift"]}},26350:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rightArithShiftDocs=void 0;t.rightArithShiftDocs={name:"rightArithShift",category:"Bitwise",syntax:["x >> y","rightArithShift(x, y)"],description:"Bitwise right arithmetic shift of a value x by y number of bits.",examples:["8 >> 1","4 << 1","-12 >> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightLogShift"]}},71158:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rightLogShiftDocs=void 0;t.rightLogShiftDocs={name:"rightLogShift",category:"Bitwise",syntax:["x >>> y","rightLogShift(x, y)"],description:"Bitwise right logical shift of a value x by y number of bits.",examples:["8 >>> 1","4 << 1","-12 >>> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightArithShift"]}},16515:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bellNumbersDocs=void 0;t.bellNumbersDocs={name:"bellNumbers",category:"Combinatorics",syntax:["bellNumbers(n)"],description:"The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. `bellNumbers` only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["bellNumbers(3)","bellNumbers(8)"],seealso:["stirlingS2"]}},18716:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.catalanDocs=void 0;t.catalanDocs={name:"catalan",category:"Combinatorics",syntax:["catalan(n)"],description:"The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["catalan(3)","catalan(8)"],seealso:["bellNumbers"]}},57704:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compositionDocs=void 0;t.compositionDocs={name:"composition",category:"Combinatorics",syntax:["composition(n, k)"],description:"The composition counts of n into k parts. composition only takes integer arguments. The following condition must be enforced: k <= n.",examples:["composition(5, 3)"],seealso:["combinations"]}},31197:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stirlingS2Docs=void 0;t.stirlingS2Docs={name:"stirlingS2",category:"Combinatorics",syntax:["stirlingS2(n, k)"],description:"he Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. `stirlingS2` only takes integer arguments. The following condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = 1.",examples:["stirlingS2(5, 3)"],seealso:["bellNumbers"]}},88205:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.argDocs=void 0;t.argDocs={name:"arg",category:"Complex",syntax:["arg(x)"],description:"Compute the argument of a complex value. If x = a+bi, the argument is computed as atan2(b, a).",examples:["arg(2 + 2i)","atan2(3, 2)","arg(2 + 3i)"],seealso:["re","im","conj","abs"]}},39755:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.conjDocs=void 0;t.conjDocs={name:"conj",category:"Complex",syntax:["conj(x)"],description:"Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate is a-bi.",examples:["conj(2 + 3i)","conj(2 - 3i)","conj(-5.2i)"],seealso:["re","im","abs","arg"]}},49675:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.imDocs=void 0;t.imDocs={name:"im",category:"Complex",syntax:["im(x)"],description:"Get the imaginary part of a complex number.",examples:["im(2 + 3i)","re(2 + 3i)","im(-5.2i)","im(2.4)"],seealso:["re","conj","abs","arg"]}},14492:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reDocs=void 0;t.reDocs={name:"re",category:"Complex",syntax:["re(x)"],description:"Get the real part of a complex number.",examples:["re(2 + 3i)","im(2 + 3i)","re(-5.2i)","re(2.4)"],seealso:["im","conj","abs","arg"]}},17078:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateDocs=void 0;t.evaluateDocs={name:"evaluate",category:"Expression",syntax:["evaluate(expression)","evaluate(expression, scope)","evaluate([expr1, expr2, expr3, ...])","evaluate([expr1, expr2, expr3, ...], scope)"],description:"Evaluate an expression or an array with expressions.",examples:['evaluate("2 + 3")','evaluate("sqrt(16)")','evaluate("2 inch to cm")','evaluate("sin(x * pi)", { "x": 1/2 })','evaluate(["width=2", "height=4","width*height"])'],seealso:[]}},92322:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.helpDocs=void 0;t.helpDocs={name:"help",category:"Expression",syntax:["help(object)","help(string)"],description:"Display documentation on a function or data type.",examples:["help(sqrt)",'help("complex")'],seealso:[]}},94812:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.distanceDocs=void 0;t.distanceDocs={name:"distance",category:"Geometry",syntax:["distance([x1, y1], [x2, y2])","distance([[x1, y1], [x2, y2]])"],description:"Calculates the Euclidean distance between two points.",examples:["distance([0,0], [4,4])","distance([[0,0], [4,4]])"],seealso:[]}},26762:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.intersectDocs=void 0;t.intersectDocs={name:"intersect",category:"Geometry",syntax:["intersect(expr1, expr2, expr3, expr4)","intersect(expr1, expr2, expr3)"],description:"Computes the intersection point of lines and/or planes.",examples:["intersect([0, 0], [10, 10], [10, 0], [0, 10])","intersect([1, 0, 1],  [4, -2, 2], [1, 1, 1, 6])"],seealso:[]}},28159:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.andDocs=void 0;t.andDocs={name:"and",category:"Logical",syntax:["x and y","and(x, y)"],description:"Logical and. Test whether two values are both defined with a nonzero/nonempty value.",examples:["true and false","true and true","2 and 4"],seealso:["not","or","xor"]}},57167:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.notDocs=void 0;t.notDocs={name:"not",category:"Logical",syntax:["not x","not(x)"],description:"Logical not. Flips the boolean value of given argument.",examples:["not true","not false","not 2","not 0"],seealso:["and","or","xor"]}},60633:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.orDocs=void 0;t.orDocs={name:"or",category:"Logical",syntax:["x or y","or(x, y)"],description:"Logical or. Test if at least one value is defined with a nonzero/nonempty value.",examples:["true or false","false or false","0 or 4"],seealso:["not","and","xor"]}},70699:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.xorDocs=void 0;t.xorDocs={name:"xor",category:"Logical",syntax:["x xor y","xor(x, y)"],description:"Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.",examples:["true xor false","false xor false","true xor true","0 xor 4"],seealso:["not","and","or"]}},65789:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.columnDocs=void 0;t.columnDocs={name:"column",category:"Matrix",syntax:["column(x, index)"],description:"Return a column from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","column(A, 1)","column(A, 2)"],seealso:["row","matrixFromColumns"]}},74504:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatDocs=void 0;t.concatDocs={name:"concat",category:"Matrix",syntax:["concat(A, B, C, ...)","concat(A, B, C, ..., dim)"],description:"Concatenate matrices. By default, the matrices are concatenated by the last dimension. The dimension on which to concatenate can be provided as last argument.",examples:["A = [1, 2; 5, 6]","B = [3, 4; 7, 8]","concat(A, B)","concat(A, B, 1)","concat(A, B, 2)"],seealso:["det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]}},7501:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.countDocs=void 0;t.countDocs={name:"count",category:"Matrix",syntax:["count(x)"],description:"Count the number of elements of a matrix, array or string.",examples:["a = [1, 2; 3, 4; 5, 6]","count(a)","size(a)",'count("hello world")'],seealso:["size"]}},62522:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crossDocs=void 0;t.crossDocs={name:"cross",category:"Matrix",syntax:["cross(A, B)"],description:"Calculate the cross product for two vectors in three dimensional space.",examples:["cross([1, 1, 0],  [0, 1, 1])","cross([3, -3, 1], [4, 9, 2])","cross([2, 3, 4],  [5, 6, 7])"],seealso:["multiply","dot"]}},2316:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ctransposeDocs=void 0;t.ctransposeDocs={name:"ctranspose",category:"Matrix",syntax:["x'","ctranspose(x)"],description:"Complex Conjugate and Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","ctranspose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]}},95059:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.detDocs=void 0;t.detDocs={name:"det",category:"Matrix",syntax:["det(x)"],description:"Calculate the determinant of a matrix",examples:["det([1, 2; 3, 4])","det([-2, 2, 3; -1, 1, 3; 2, 0, -1])"],seealso:["concat","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]}},35063:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.diagDocs=void 0;t.diagDocs={name:"diag",category:"Matrix",syntax:["diag(x)","diag(x, k)"],description:"Create a diagonal matrix or retrieve the diagonal of a matrix. When x is a vector, a matrix with the vector values on the diagonal will be returned. When x is a matrix, a vector with the diagonal values of the matrix is returned. When k is provided, the k-th diagonal will be filled in or retrieved, if k is positive, the values are placed on the super diagonal. When k is negative, the values are placed on the sub diagonal.",examples:["diag(1:3)","diag(1:3, 1)","a = [1, 2, 3; 4, 5, 6; 7, 8, 9]","diag(a)"],seealso:["concat","det","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]}},61725:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.diffDocs=void 0;t.diffDocs={name:"diff",category:"Matrix",syntax:["diff(arr)","diff(arr, dim)"],description:["Create a new matrix or array with the difference of the passed matrix or array.","Dim parameter is optional and used to indicate the dimension of the array/matrix to apply the difference","If no dimension parameter is passed it is assumed as dimension 0","Dimension is zero-based in javascript and one-based in the parser","Arrays must be 'rectangular' meaning arrays like [1, 2]","If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays"],examples:["A = [1, 2, 4, 7, 0]","diff(A)","diff(A, 1)","B = [[1, 2], [3, 4]]","diff(B)","diff(B, 1)","diff(B, 2)","diff(B, bignumber(2))","diff([[1, 2], matrix([3, 4])], 2)"],seealso:["subtract","partitionSelect"]}},40217:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dotDocs=void 0;t.dotDocs={name:"dot",category:"Matrix",syntax:["dot(A, B)","A * B"],description:"Calculate the dot product of two vectors. The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] is defined as dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn",examples:["dot([2, 4, 1], [2, 2, 3])","[2, 4, 1] * [2, 2, 3]"],seealso:["multiply","cross"]}},10632:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.eigsDocs=void 0;t.eigsDocs={name:"eigs",category:"Matrix",syntax:["eigs(x)"],description:"Calculate the eigenvalues and optionally eigenvectors of a square matrix",examples:["eigs([[5, 2.3], [2.3, 1]])","eigs([[1, 2, 3], [4, 5, 6], [7, 8, 9]], { precision: 1e-6, eigenvectors: false })"],seealso:["inv"]}},37758:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fftDocs=void 0;t.fftDocs={name:"fft",category:"Matrix",syntax:["fft(x)"],description:"Calculate N-dimensional Fourier transform",examples:["fft([[1, 0], [1, 0]])"],seealso:["ifft"]}},64110:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.filterDocs=void 0;t.filterDocs={name:"filter",category:"Matrix",syntax:["filter(x, test)"],description:"Filter items in a matrix.",examples:["isPositive(x) = x > 0","filter([6, -2, -1, 4, 3], isPositive)","filter([6, -2, 0, 1, 0], x != 0)"],seealso:["sort","map","forEach"]}},20544:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flattenDocs=void 0;t.flattenDocs={name:"flatten",category:"Matrix",syntax:["flatten(x)"],description:"Flatten a multi dimensional matrix into a single dimensional matrix.",examples:["a = [1, 2, 3; 4, 5, 6]","size(a)","b = flatten(a)","size(b)"],seealso:["concat","resize","size","squeeze"]}},29056:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.forEachDocs=void 0;t.forEachDocs={name:"forEach",category:"Matrix",syntax:["forEach(x, callback)"],description:"Iterates over all elements of a matrix/array, and executes the given callback function.",examples:["numberOfPets = {}","addPet(n) = numberOfPets[n] = (numberOfPets[n] ? numberOfPets[n]:0 ) + 1;",'forEach(["Dog","Cat","Cat"], addPet)',"numberOfPets"],seealso:["map","sort","filter"]}},98955:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMatrixDataTypeDocs=void 0;t.getMatrixDataTypeDocs={name:"getMatrixDataType",category:"Matrix",syntax:["getMatrixDataType(x)"],description:'Find the data type of all elements in a matrix or array, for example "number" if all items are a number and "Complex" if all values are complex numbers. If a matrix contains more than one data type, it will return "mixed".',examples:["getMatrixDataType([1, 2, 3])","getMatrixDataType([[5 cm], [2 inch]])",'getMatrixDataType([1, "text"])',"getMatrixDataType([1, bignumber(4)])"],seealso:["matrix","sparse","typeOf"]}},71750:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.identityDocs=void 0;t.identityDocs={name:"identity",category:"Matrix",syntax:["identity(n)","identity(m, n)","identity([m, n])"],description:"Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.",examples:["identity(3)","identity(3, 5)","a = [1, 2, 3; 4, 5, 6]","identity(size(a))"],seealso:["concat","det","diag","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]}},16645:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ifftDocs=void 0;t.ifftDocs={name:"ifft",category:"Matrix",syntax:["ifft(x)"],description:"Calculate N-dimensional inverse Fourier transform",examples:["ifft([[2, 2], [0, 0]])"],seealso:["fft"]}},44605:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.invDocs=void 0;t.invDocs={name:"inv",category:"Matrix",syntax:["inv(x)"],description:"Calculate the inverse of a matrix",examples:["inv([1, 2; 3, 4])","inv(4)","1 / 4"],seealso:["concat","det","diag","identity","ones","range","size","squeeze","subset","trace","transpose","zeros"]}},30420:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.kronDocs=void 0;t.kronDocs={name:"kron",category:"Matrix",syntax:["kron(x, y)"],description:"Calculates the Kronecker product of 2 matrices or vectors.",examples:["kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])","kron([1,1], [2,3,4])"],seealso:["multiply","dot","cross"]}},12984:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mapDocs=void 0;t.mapDocs={name:"map",category:"Matrix",syntax:["map(x, callback)","map(x, y, ..., callback)"],description:"Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array or the matrices/arrays.",examples:["map([1, 2, 3], square)","map([1, 2], [3, 4], f(a,b) = a + b)"],seealso:["filter","forEach"]}},88154:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.matrixFromColumnsDocs=void 0;t.matrixFromColumnsDocs={name:"matrixFromColumns",category:"Matrix",syntax:["matrixFromColumns(...arr)","matrixFromColumns(row1, row2)","matrixFromColumns(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual columns.",examples:["matrixFromColumns([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromRows","matrixFromFunction","zeros"]}},20537:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.matrixFromFunctionDocs=void 0;t.matrixFromFunctionDocs={name:"matrixFromFunction",category:"Matrix",syntax:["matrixFromFunction(size, fn)","matrixFromFunction(size, fn, format)","matrixFromFunction(size, fn, format, datatype)","matrixFromFunction(size, format, fn)","matrixFromFunction(size, format, datatype, fn)"],description:"Create a matrix by evaluating a generating function at each index.",examples:["f(I) = I[1] - I[2]","matrixFromFunction([3,3], f)","g(I) = I[1] - I[2] == 1 ? 4 : 0",'matrixFromFunction([100, 100], "sparse", g)',"matrixFromFunction([5], random)"],seealso:["matrix","matrixFromRows","matrixFromColumns","zeros"]}},73980:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.matrixFromRowsDocs=void 0;t.matrixFromRowsDocs={name:"matrixFromRows",category:"Matrix",syntax:["matrixFromRows(...arr)","matrixFromRows(row1, row2)","matrixFromRows(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual rows.",examples:["matrixFromRows([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromColumns","matrixFromFunction","zeros"]}},33401:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.onesDocs=void 0;t.onesDocs={name:"ones",category:"Matrix",syntax:["ones(m)","ones(m, n)","ones(m, n, p, ...)","ones([m])","ones([m, n])","ones([m, n, p, ...])"],description:"Create a matrix containing ones.",examples:["ones(3)","ones(3, 5)","ones([2,3]) * 4.5","a = [1, 2, 3; 4, 5, 6]","ones(size(a))"],seealso:["concat","det","diag","identity","inv","range","size","squeeze","subset","trace","transpose","zeros"]}},28444:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.partitionSelectDocs=void 0;t.partitionSelectDocs={name:"partitionSelect",category:"Matrix",syntax:["partitionSelect(x, k)","partitionSelect(x, k, compare)"],description:"Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.",examples:["partitionSelect([5, 10, 1], 2)",'partitionSelect(["C", "B", "A", "D"], 1, compareText)',"arr = [5, 2, 1]","partitionSelect(arr, 0) # returns 1, arr is now: [1, 2, 5]","arr","partitionSelect(arr, 1, 'desc') # returns 2, arr is now: [5, 2, 1]","arr"],seealso:["sort"]}},79339:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pinvDocs=void 0;t.pinvDocs={name:"pinv",category:"Matrix",syntax:["pinv(x)"],description:"Calculate the Moore–Penrose inverse of a matrix",examples:["pinv([1, 2; 3, 4])","pinv([[1, 0], [0, 1], [0, 1]])","pinv(4)"],seealso:["inv"]}},91095:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rangeDocs=void 0;t.rangeDocs={name:"range",category:"Type",syntax:["start:end","start:step:end","range(start, end)","range(start, end, step)","range(string)"],description:"Create a range. Lower bound of the range is included, upper bound is excluded.",examples:["1:5","3:-1:-3","range(3, 7)","range(0, 12, 2)",'range("4:10")',"range(1m, 1m, 3m)","a = [1, 2, 3, 4; 5, 6, 7, 8]","a[1:2, 1:2]"],seealso:["concat","det","diag","identity","inv","ones","size","squeeze","subset","trace","transpose","zeros"]}},39652:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reshapeDocs=void 0;t.reshapeDocs={name:"reshape",category:"Matrix",syntax:["reshape(x, sizes)"],description:"Reshape a multi dimensional array to fit the specified dimensions.",examples:["reshape([1, 2, 3, 4, 5, 6], [2, 3])","reshape([[1, 2], [3, 4]], [1, 4])","reshape([[1, 2], [3, 4]], [4])","reshape([1, 2, 3, 4], [-1, 2])"],seealso:["size","squeeze","resize"]}},37808:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resizeDocs=void 0;t.resizeDocs={name:"resize",category:"Matrix",syntax:["resize(x, size)","resize(x, size, defaultValue)"],description:"Resize a matrix.",examples:["resize([1,2,3,4,5], [3])","resize([1,2,3], [5])","resize([1,2,3], [5], -1)","resize(2, [2, 3])",'resize("hello", [8], "!")'],seealso:["size","subset","squeeze","reshape"]}},2383:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rotateDocs=void 0;t.rotateDocs={name:"rotate",category:"Matrix",syntax:["rotate(w, theta)","rotate(w, theta, v)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotate([1, 0], pi / 2)",'rotate(matrix([1, 0]), unit("35deg"))','rotate([1, 0, 0], unit("90deg"), [0, 0, 1])','rotate(matrix([1, 0, 0]), unit("90deg"), matrix([0, 0, 1]))'],seealso:["matrix","rotationMatrix"]}},259:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rotationMatrixDocs=void 0;t.rotationMatrixDocs={name:"rotationMatrix",category:"Matrix",syntax:["rotationMatrix(theta)","rotationMatrix(theta, v)","rotationMatrix(theta, v, format)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotationMatrix(pi / 2)",'rotationMatrix(unit("45deg"), [0, 0, 1])','rotationMatrix(1, matrix([0, 0, 1]), "sparse")'],seealso:["cos","sin"]}},77354:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rowDocs=void 0;t.rowDocs={name:"row",category:"Matrix",syntax:["row(x, index)"],description:"Return a row from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","row(A, 1)","row(A, 2)"],seealso:["column","matrixFromRows"]}},41117:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sizeDocs=void 0;t.sizeDocs={name:"size",category:"Matrix",syntax:["size(x)"],description:"Calculate the size of a matrix.",examples:["size(2.3)",'size("hello world")',"a = [1, 2; 3, 4; 5, 6]","size(a)","size(1:6)"],seealso:["concat","count","det","diag","identity","inv","ones","range","squeeze","subset","trace","transpose","zeros"]}},65648:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sortDocs=void 0;t.sortDocs={name:"sort",category:"Matrix",syntax:["sort(x)","sort(x, compare)"],description:'Sort the items in a matrix. Compare can be a string "asc", "desc", "natural", or a custom sort function.',examples:["sort([5, 10, 1])",'sort(["C", "B", "A", "D"], "natural")',"sortByLength(a, b) = size(a)[1] - size(b)[1]",'sort(["Langdon", "Tom", "Sara"], sortByLength)','sort(["10", "1", "2"], "natural")'],seealso:["map","filter","forEach"]}},80325:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.squeezeDocs=void 0;t.squeezeDocs={name:"squeeze",category:"Matrix",syntax:["squeeze(x)"],description:"Remove inner and outer singleton dimensions from a matrix.",examples:["a = zeros(3,2,1)","size(squeeze(a))","b = zeros(1,1,3)","size(squeeze(b))"],seealso:["concat","det","diag","identity","inv","ones","range","size","subset","trace","transpose","zeros"]}},62982:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subsetDocs=void 0;t.subsetDocs={name:"subset",category:"Matrix",syntax:["value(index)","value(index) = replacement","subset(value, [index])","subset(value, [index], replacement)"],description:"Get or set a subset of the entries of a matrix or characters of a string. Indexes are one-based. There should be one index specification for each dimension of the target. Each specification can be a single index, a list of indices, or a range in colon notation `l:u`. In a range, both the lower bound l and upper bound u are included; and if a bound is omitted it defaults to the most extreme valid value. The cartesian product of the indices specified in each dimension determines the target of the operation.",examples:["d = [1, 2; 3, 4]","e = []","e[1, 1:2] = [5, 6]","e[2, :] = [7, 8]","f = d * e","f[2, 1]","f[:, 1]","f[[1,2], [1,3]] = [9, 10; 11, 12]","f"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","trace","transpose","zeros"]}},4063:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.traceDocs=void 0;t.traceDocs={name:"trace",category:"Matrix",syntax:["trace(A)"],description:"Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.",examples:["A = [1, 2, 3; -1, 2, 3; 2, 0, 3]","trace(A)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","transpose","zeros"]}},7377:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.transposeDocs=void 0;t.transposeDocs={name:"transpose",category:"Matrix",syntax:["x'","transpose(x)"],description:"Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","transpose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]}},23741:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.zerosDocs=void 0;t.zerosDocs={name:"zeros",category:"Matrix",syntax:["zeros(m)","zeros(m, n)","zeros(m, n, p, ...)","zeros([m])","zeros([m, n])","zeros([m, n, p, ...])"],description:"Create a matrix containing zeros.",examples:["zeros(3)","zeros(3, 5)","a = [1, 2, 3; 4, 5, 6]","zeros(size(a))"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose"]}},99127:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.solveODEDocs=void 0;t.solveODEDocs={name:"solveODE",category:"Numeric",syntax:["solveODE(func, tspan, y0)","solveODE(func, tspan, y0, options)"],description:"Numerical Integration of Ordinary Differential Equations.",examples:["f(t,y) = y","tspan = [0, 4]","solveODE(f, tspan, 1)","solveODE(f, tspan, [1, 2])",'solveODE(f, tspan, 1, { method:"RK23", maxStep:0.1 })'],seealso:["derivative","simplifyCore"]}},94448:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combinationsDocs=void 0;t.combinationsDocs={name:"combinations",category:"Probability",syntax:["combinations(n, k)"],description:"Compute the number of combinations of n items taken k at a time",examples:["combinations(7, 5)"],seealso:["combinationsWithRep","permutations","factorial"]}},77457:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combinationsWithRepDocs=void 0;t.combinationsWithRepDocs={name:"combinationsWithRep",category:"Probability",syntax:["combinationsWithRep(n, k)"],description:"Compute the number of combinations of n items taken k at a time with replacements.",examples:["combinationsWithRep(7, 5)"],seealso:["combinations","permutations","factorial"]}},44709:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.factorialDocs=void 0;t.factorialDocs={name:"factorial",category:"Probability",syntax:["n!","factorial(n)"],description:"Compute the factorial of a value",examples:["5!","5 * 4 * 3 * 2 * 1","3!"],seealso:["combinations","combinationsWithRep","permutations","gamma"]}},53839:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gammaDocs=void 0;t.gammaDocs={name:"gamma",category:"Probability",syntax:["gamma(n)"],description:"Compute the gamma function. For small values, the Lanczos approximation is used, and for large values the extended Stirling approximation.",examples:["gamma(4)","3!","gamma(1/2)","sqrt(pi)"],seealso:["factorial"]}},36633:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.kldivergenceDocs=void 0;t.kldivergenceDocs={name:"kldivergence",category:"Probability",syntax:["kldivergence(x, y)"],description:"Calculate the Kullback-Leibler (KL) divergence  between two distributions.",examples:["kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5])"],seealso:[]}},28541:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lgammaDocs=void 0;t.lgammaDocs={name:"lgamma",category:"Probability",syntax:["lgamma(n)"],description:"Logarithm of the gamma function for real, positive numbers and complex numbers, using Lanczos approximation for numbers and Stirling series for complex numbers.",examples:["lgamma(4)","lgamma(1/2)","lgamma(i)","lgamma(complex(1.1, 2))"],seealso:["gamma"]}},70195:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.multinomialDocs=void 0;t.multinomialDocs={name:"multinomial",category:"Probability",syntax:["multinomial(A)"],description:"Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from `n` possibilities. multinomial takes one array of integers as an argument. The following condition must be enforced: every ai > 0.",examples:["multinomial([1, 2, 1])"],seealso:["combinations","factorial"]}},64974:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.permutationsDocs=void 0;t.permutationsDocs={name:"permutations",category:"Probability",syntax:["permutations(n)","permutations(n, k)"],description:"Compute the number of permutations of n items taken k at a time",examples:["permutations(5)","permutations(5, 3)"],seealso:["combinations","combinationsWithRep","factorial"]}},76706:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pickRandomDocs=void 0;t.pickRandomDocs={name:"pickRandom",category:"Probability",syntax:["pickRandom(array)","pickRandom(array, number)","pickRandom(array, weights)","pickRandom(array, number, weights)","pickRandom(array, weights, number)"],description:"Pick a random entry from a given array.",examples:["pickRandom(0:10)","pickRandom([1, 3, 1, 6])","pickRandom([1, 3, 1, 6], 2)","pickRandom([1, 3, 1, 6], [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], 2, [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], [2, 3, 2, 1], 2)"],seealso:["random","randomInt"]}},78531:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomDocs=void 0;t.randomDocs={name:"random",category:"Probability",syntax:["random()","random(max)","random(min, max)","random(size)","random(size, max)","random(size, min, max)"],description:"Return a random number.",examples:["random()","random(10, 20)","random([2, 3])"],seealso:["pickRandom","randomInt"]}},4590:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomIntDocs=void 0;t.randomIntDocs={name:"randomInt",category:"Probability",syntax:["randomInt(max)","randomInt(min, max)","randomInt(size)","randomInt(size, max)","randomInt(size, min, max)"],description:"Return a random integer number",examples:["randomInt(10, 20)","randomInt([2, 3], 10)"],seealso:["pickRandom","random"]}},94469:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compareDocs=void 0;t.compareDocs={name:"compare",category:"Relational",syntax:["compare(x, y)"],description:"Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compare(2, 3)","compare(3, 2)","compare(2, 2)","compare(5cm, 40mm)","compare(2, [1, 2, 3])"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compareNatural","compareText"]}},85484:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compareNaturalDocs=void 0;t.compareNaturalDocs={name:"compareNatural",category:"Relational",syntax:["compareNatural(x, y)"],description:"Compare two values of any type in a deterministic, natural way. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compareNatural(2, 3)","compareNatural(3, 2)","compareNatural(2, 2)","compareNatural(5cm, 40mm)",'compareNatural("2", "10")',"compareNatural(2 + 3i, 2 + 4i)","compareNatural([1, 2, 4], [1, 2, 3])","compareNatural([1, 5], [1, 2, 3])","compareNatural([1, 2], [1, 2])","compareNatural({a: 2}, {a: 4})"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare","compareText"]}},58906:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compareTextDocs=void 0;t.compareTextDocs={name:"compareText",category:"Relational",syntax:["compareText(x, y)"],description:"Compare two strings lexically. Comparison is case sensitive. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:['compareText("B", "A")','compareText("A", "B")','compareText("A", "A")','compareText("2", "10")','compare("2", "10")',"compare(2, 10)",'compareNatural("2", "10")','compareText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural"]}},15116:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deepEqualDocs=void 0;t.deepEqualDocs={name:"deepEqual",category:"Relational",syntax:["deepEqual(x, y)"],description:"Check equality of two matrices element wise. Returns true if the size of both matrices is equal and when and each of the elements are equal.",examples:["deepEqual([1,3,4], [1,3,4])","deepEqual([1,3,4], [1,3])"],seealso:["equal","unequal","smaller","larger","smallerEq","largerEq","compare"]}},44258:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.equalDocs=void 0;t.equalDocs={name:"equal",category:"Relational",syntax:["x == y","equal(x, y)"],description:"Check equality of two values. Returns true if the values are equal, and false if not.",examples:["2+2 == 3","2+2 == 4","a = 3.2","b = 6-2.8","a == b","50cm == 0.5m"],seealso:["unequal","smaller","larger","smallerEq","largerEq","compare","deepEqual","equalText"]}},33765:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.equalTextDocs=void 0;t.equalTextDocs={name:"equalText",category:"Relational",syntax:["equalText(x, y)"],description:"Check equality of two strings. Comparison is case sensitive. Returns true if the values are equal, and false if not.",examples:['equalText("Hello", "Hello")','equalText("a", "A")','equal("2e3", "2000")','equalText("2e3", "2000")','equalText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural","compareText","equal"]}},74307:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.largerDocs=void 0;t.largerDocs={name:"larger",category:"Relational",syntax:["x > y","larger(x, y)"],description:"Check if value x is larger than y. Returns true if x is larger than y, and false if not.",examples:["2 > 3","5 > 2*2","a = 3.3","b = 6-2.8","(a > b)","(b < a)","5 cm > 2 inch"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare"]}},43681:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.largerEqDocs=void 0;t.largerEqDocs={name:"largerEq",category:"Relational",syntax:["x >= y","largerEq(x, y)"],description:"Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.",examples:["2 >= 1+1","2 > 1+1","a = 3.2","b = 6-2.8","(a >= b)"],seealso:["equal","unequal","smallerEq","smaller","compare"]}},90670:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.smallerDocs=void 0;t.smallerDocs={name:"smaller",category:"Relational",syntax:["x < y","smaller(x, y)"],description:"Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not.",examples:["2 < 3","5 < 2*2","a = 3.3","b = 6-2.8","(a < b)","5 cm < 2 inch"],seealso:["equal","unequal","larger","smallerEq","largerEq","compare"]}},97976:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.smallerEqDocs=void 0;t.smallerEqDocs={name:"smallerEq",category:"Relational",syntax:["x <= y","smallerEq(x, y)"],description:"Check if value x is smaller or equal to value y. Returns true if x is smaller than y, and false if not.",examples:["2 <= 1+1","2 < 1+1","a = 3.2","b = 6-2.8","(a <= b)"],seealso:["equal","unequal","larger","smaller","largerEq","compare"]}},7731:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unequalDocs=void 0;t.unequalDocs={name:"unequal",category:"Relational",syntax:["x != y","unequal(x, y)"],description:"Check unequality of two values. Returns true if the values are unequal, and false if they are equal.",examples:["2+2 != 3","2+2 != 4","a = 3.2","b = 6-2.8","a != b","50cm != 0.5m","5 cm != 2 inch"],seealso:["equal","smaller","larger","smallerEq","largerEq","compare","deepEqual"]}},12547:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setCartesianDocs=void 0;t.setCartesianDocs={name:"setCartesian",category:"Set",syntax:["setCartesian(set1, set2)"],description:"Create the cartesian product of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays and the values will be sorted in ascending order before the operation.",examples:["setCartesian([1, 2], [3, 4])"],seealso:["setUnion","setIntersect","setDifference","setPowerset"]}},89002:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setDifferenceDocs=void 0;t.setDifferenceDocs={name:"setDifference",category:"Set",syntax:["setDifference(set1, set2)"],description:"Create the difference of two (multi)sets: every element of set1, that is not the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setDifference([1, 2, 3, 4], [3, 4, 5, 6])","setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setSymDifference"]}},55782:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setDistinctDocs=void 0;t.setDistinctDocs={name:"setDistinct",category:"Set",syntax:["setDistinct(set)"],description:"Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setDistinct([1, 1, 1, 2, 2, 3])"],seealso:["setMultiplicity"]}},60576:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setIntersectDocs=void 0;t.setIntersectDocs={name:"setIntersect",category:"Set",syntax:["setIntersect(set1, set2)"],description:"Create the intersection of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIntersect([1, 2, 3, 4], [3, 4, 5, 6])","setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setDifference"]}},77163:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setIsSubsetDocs=void 0;t.setIsSubsetDocs={name:"setIsSubset",category:"Set",syntax:["setIsSubset(set1, set2)"],description:"Check whether a (multi)set is a subset of another (multi)set: every element of set1 is the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIsSubset([1, 2], [3, 4, 5, 6])","setIsSubset([3, 4], [3, 4, 5, 6])"],seealso:["setUnion","setIntersect","setDifference"]}},26118:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setMultiplicityDocs=void 0;t.setMultiplicityDocs={name:"setMultiplicity",category:"Set",syntax:["setMultiplicity(element, set)"],description:"Count the multiplicity of an element in a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setMultiplicity(1, [1, 2, 2, 4])","setMultiplicity(2, [1, 2, 2, 4])"],seealso:["setDistinct","setSize"]}},45042:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setPowersetDocs=void 0;t.setPowersetDocs={name:"setPowerset",category:"Set",syntax:["setPowerset(set)"],description:"Create the powerset of a (multi)set: the powerset contains very possible subsets of a (multi)set. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setPowerset([1, 2, 3])"],seealso:["setCartesian"]}},2360:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setSizeDocs=void 0;t.setSizeDocs={name:"setSize",category:"Set",syntax:["setSize(set)","setSize(set, unique)"],description:'Count the number of elements of a (multi)set. When the second parameter "unique" is true, count only the unique values. A multi-dimension array will be converted to a single-dimension array before the operation.',examples:["setSize([1, 2, 2, 4])","setSize([1, 2, 2, 4], true)"],seealso:["setUnion","setIntersect","setDifference"]}},57409:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setSymDifferenceDocs=void 0;t.setSymDifferenceDocs={name:"setSymDifference",category:"Set",syntax:["setSymDifference(set1, set2)"],description:"Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])","setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setDifference"]}},37874:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setUnionDocs=void 0;t.setUnionDocs={name:"setUnion",category:"Set",syntax:["setUnion(set1, set2)"],description:"Create the union of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setUnion([1, 2, 3, 4], [3, 4, 5, 6])","setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setIntersect","setDifference"]}},54475:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.freqzDocs=void 0;t.freqzDocs={name:"freqz",category:"Signal",syntax:["freqz(b, a)","freqz(b, a, w)"],description:"Calculates the frequency response of a filter given its numerator and denominator coefficients.",examples:["freqz([1, 2], [1, 2, 3])","freqz([1, 2], [1, 2, 3], [0, 1])","freqz([1, 2], [1, 2, 3], 512)"],seealso:[]}},21166:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.zpk2tfDocs=void 0;t.zpk2tfDocs={name:"zpk2tf",category:"Signal",syntax:["zpk2tf(z, p, k)"],description:"Compute the transfer function of a zero-pole-gain model.",examples:["zpk2tf([1, 2], [-1, -2], 1)","zpk2tf([1, 2], [-1, -2])","zpk2tf([1 - 3i, 2 + 2i], [-1, -2])"],seealso:[]}},50329:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.erfDocs=void 0;t.erfDocs={name:"erf",category:"Special",syntax:["erf(x)"],description:"Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x",examples:["erf(0.2)","erf(-0.5)","erf(4)"],seealso:[]}},77742:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.zetaDocs=void 0;t.zetaDocs={name:"zeta",category:"Special",syntax:["zeta(s)"],description:"Compute the Riemann Zeta Function using an infinite series and Riemann's Functional Equation for the entire complex plane",examples:["zeta(0.2)","zeta(-0.5)","zeta(4)"],seealso:[]}},37852:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.corrDocs=void 0;t.corrDocs={name:"corr",category:"Statistics",syntax:["corr(A,B)"],description:"Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated.",examples:["corr([2, 4, 6, 8],[1, 2, 3, 6])","corr(matrix([[1, 2.2, 3, 4.8, 5], [1, 2, 3, 4, 5]]), matrix([[4, 5.3, 6.6, 7, 8], [1, 2, 3, 4, 5]]))"],seealso:["max","mean","min","median","min","prod","std","sum"]}},6616:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cumSumDocs=void 0;t.cumSumDocs={name:"cumsum",category:"Statistics",syntax:["cumsum(a, b, c, ...)","cumsum(A)"],description:"Compute the cumulative sum of all values.",examples:["cumsum(2, 3, 4, 1)","cumsum([2, 3, 4, 1])","cumsum([1, 2; 3, 4])","cumsum([1, 2; 3, 4], 1)","cumsum([1, 2; 3, 4], 2)"],seealso:["max","mean","median","min","prod","std","sum","variance"]}},90262:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.madDocs=void 0;t.madDocs={name:"mad",category:"Statistics",syntax:["mad(a, b, c, ...)","mad(A)"],description:"Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.",examples:["mad(10, 20, 30)","mad([1, 2, 3])"],seealso:["mean","median","std","abs"]}},20610:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.maxDocs=void 0;t.maxDocs={name:"max",category:"Statistics",syntax:["max(a, b, c, ...)","max(A)","max(A, dimension)"],description:"Compute the maximum value of a list of values.",examples:["max(2, 3, 4, 1)","max([2, 3, 4, 1])","max([2, 5; 4, 3])","max([2, 5; 4, 3], 1)","max([2, 5; 4, 3], 2)","max(2.7, 7.1, -4.5, 2.0, 4.1)","min(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["mean","median","min","prod","std","sum","variance"]}},26227:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.meanDocs=void 0;t.meanDocs={name:"mean",category:"Statistics",syntax:["mean(a, b, c, ...)","mean(A)","mean(A, dimension)"],description:"Compute the arithmetic mean of a list of values.",examples:["mean(2, 3, 4, 1)","mean([2, 3, 4, 1])","mean([2, 5; 4, 3])","mean([2, 5; 4, 3], 1)","mean([2, 5; 4, 3], 2)","mean([1.0, 2.7, 3.2, 4.0])"],seealso:["max","median","min","prod","std","sum","variance"]}},8196:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.medianDocs=void 0;t.medianDocs={name:"median",category:"Statistics",syntax:["median(a, b, c, ...)","median(A)"],description:"Compute the median of all values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned.",examples:["median(5, 2, 7)","median([3, -1, 5, 7])"],seealso:["max","mean","min","prod","std","sum","variance","quantileSeq"]}},93484:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.minDocs=void 0;t.minDocs={name:"min",category:"Statistics",syntax:["min(a, b, c, ...)","min(A)","min(A, dimension)"],description:"Compute the minimum value of a list of values.",examples:["min(2, 3, 4, 1)","min([2, 3, 4, 1])","min([2, 5; 4, 3])","min([2, 5; 4, 3], 1)","min([2, 5; 4, 3], 2)","min(2.7, 7.1, -4.5, 2.0, 4.1)","max(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["max","mean","median","prod","std","sum","variance"]}},34885:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.modeDocs=void 0;t.modeDocs={name:"mode",category:"Statistics",syntax:["mode(a, b, c, ...)","mode(A)","mode(A, a, b, B, c, ...)"],description:"Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.",examples:["mode(2, 1, 4, 3, 1)","mode([1, 2.7, 3.2, 4, 2.7])","mode(1, 4, 6, 1, 6)"],seealso:["max","mean","min","median","prod","std","sum","variance"]}},16491:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.prodDocs=void 0;t.prodDocs={name:"prod",category:"Statistics",syntax:["prod(a, b, c, ...)","prod(A)"],description:"Compute the product of all values.",examples:["prod(2, 3, 4)","prod([2, 3, 4])","prod([2, 5; 4, 3])"],seealso:["max","mean","min","median","min","std","sum","variance"]}},32384:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.quantileSeqDocs=void 0;t.quantileSeqDocs={name:"quantileSeq",category:"Statistics",syntax:["quantileSeq(A, prob[, sorted])","quantileSeq(A, [prob1, prob2, ...][, sorted])","quantileSeq(A, N[, sorted])"],description:"Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probability are: Number, BigNumber. \n\nIn case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.",examples:["quantileSeq([3, -1, 5, 7], 0.5)","quantileSeq([3, -1, 5, 7], [1/3, 2/3])","quantileSeq([3, -1, 5, 7], 2)","quantileSeq([-1, 3, 5, 7], 0.5, true)"],seealso:["mean","median","min","max","prod","std","sum","variance"]}},29677:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stdDocs=void 0;t.stdDocs={name:"std",category:"Statistics",syntax:["std(a, b, c, ...)","std(A)","std(A, dimension)","std(A, normalization)","std(A, dimension, normalization)"],description:'Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["std(2, 4, 6)","std([2, 4, 6, 8])",'std([2, 4, 6, 8], "uncorrected")','std([2, 4, 6, 8], "biased")',"std([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","prod","sum","variance"]}},25119:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sumDocs=void 0;t.sumDocs={name:"sum",category:"Statistics",syntax:["sum(a, b, c, ...)","sum(A)","sum(A, dimension)"],description:"Compute the sum of all values.",examples:["sum(2, 3, 4, 1)","sum([2, 3, 4, 1])","sum([2, 5; 4, 3])"],seealso:["max","mean","median","min","prod","std","sum","variance"]}},28209:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.varianceDocs=void 0;t.varianceDocs={name:"variance",category:"Statistics",syntax:["variance(a, b, c, ...)","variance(A)","variance(A, dimension)","variance(A, normalization)","variance(A, dimension, normalization)"],description:'Compute the variance of all values. Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["variance(2, 4, 6)","variance([2, 4, 6, 8])",'variance([2, 4, 6, 8], "uncorrected")','variance([2, 4, 6, 8], "biased")',"variance([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","min","prod","std","sum"]}},4920:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.acosDocs=void 0;t.acosDocs={name:"acos",category:"Trigonometry",syntax:["acos(x)"],description:"Compute the inverse cosine of a value in radians.",examples:["acos(0.5)","acos(cos(2.3))"],seealso:["cos","atan","asin"]}},69746:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.acoshDocs=void 0;t.acoshDocs={name:"acosh",category:"Trigonometry",syntax:["acosh(x)"],description:"Calculate the hyperbolic arccos of a value, defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`.",examples:["acosh(1.5)"],seealso:["cosh","asinh","atanh"]}},45773:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.acotDocs=void 0;t.acotDocs={name:"acot",category:"Trigonometry",syntax:["acot(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acot(0.5)","acot(cot(0.5))","acot(2)"],seealso:["cot","atan"]}},85289:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.acothDocs=void 0;t.acothDocs={name:"acoth",category:"Trigonometry",syntax:["acoth(x)"],description:"Calculate the inverse hyperbolic tangent of a value, defined as `acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.",examples:["acoth(2)","acoth(0.5)"],seealso:["acsch","asech"]}},19292:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.acscDocs=void 0;t.acscDocs={name:"acsc",category:"Trigonometry",syntax:["acsc(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acsc(2)","acsc(csc(0.5))","acsc(0.5)"],seealso:["csc","asin","asec"]}},50830:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.acschDocs=void 0;t.acschDocs={name:"acsch",category:"Trigonometry",syntax:["acsch(x)"],description:"Calculate the inverse hyperbolic cosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.",examples:["acsch(0.5)"],seealso:["asech","acoth"]}},72566:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.asecDocs=void 0;t.asecDocs={name:"asec",category:"Trigonometry",syntax:["asec(x)"],description:"Calculate the inverse secant of a value.",examples:["asec(0.5)","asec(sec(0.5))","asec(2)"],seealso:["acos","acot","acsc"]}},80636:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.asechDocs=void 0;t.asechDocs={name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant of a value.",examples:["asech(0.5)"],seealso:["acsch","acoth"]}},78605:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.asinDocs=void 0;t.asinDocs={name:"asin",category:"Trigonometry",syntax:["asin(x)"],description:"Compute the inverse sine of a value in radians.",examples:["asin(0.5)","asin(sin(0.5))"],seealso:["sin","acos","atan"]}},9673:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.asinhDocs=void 0;t.asinhDocs={name:"asinh",category:"Trigonometry",syntax:["asinh(x)"],description:"Calculate the hyperbolic arcsine of a value, defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`.",examples:["asinh(0.5)"],seealso:["acosh","atanh"]}},18840:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.atanDocs=void 0;t.atanDocs={name:"atan",category:"Trigonometry",syntax:["atan(x)"],description:"Compute the inverse tangent of a value in radians.",examples:["atan(0.5)","atan(tan(0.5))"],seealso:["tan","acos","asin"]}},34192:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.atan2Docs=void 0;t.atan2Docs={name:"atan2",category:"Trigonometry",syntax:["atan2(y, x)"],description:"Computes the principal value of the arc tangent of y/x in radians.",examples:["atan2(2, 2) / pi","angle = 60 deg in rad","x = cos(angle)","y = sin(angle)","atan2(y, x)"],seealso:["sin","cos","tan"]}},87954:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.atanhDocs=void 0;t.atanhDocs={name:"atanh",category:"Trigonometry",syntax:["atanh(x)"],description:"Calculate the hyperbolic arctangent of a value, defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`.",examples:["atanh(0.5)"],seealso:["acosh","asinh"]}},39263:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cosDocs=void 0;t.cosDocs={name:"cos",category:"Trigonometry",syntax:["cos(x)"],description:"Compute the cosine of x in radians.",examples:["cos(2)","cos(pi / 4) ^ 2","cos(180 deg)","cos(60 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["acos","sin","tan"]}},47807:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.coshDocs=void 0;t.coshDocs={name:"cosh",category:"Trigonometry",syntax:["cosh(x)"],description:"Compute the hyperbolic cosine of x in radians.",examples:["cosh(0.5)"],seealso:["sinh","tanh","coth"]}},67998:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cotDocs=void 0;t.cotDocs={name:"cot",category:"Trigonometry",syntax:["cot(x)"],description:"Compute the cotangent of x in radians. Defined as 1/tan(x)",examples:["cot(2)","1 / tan(2)"],seealso:["sec","csc","tan"]}},4484:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cothDocs=void 0;t.cothDocs={name:"coth",category:"Trigonometry",syntax:["coth(x)"],description:"Compute the hyperbolic cotangent of x in radians.",examples:["coth(2)","1 / tanh(2)"],seealso:["sech","csch","tanh"]}},96603:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cscDocs=void 0;t.cscDocs={name:"csc",category:"Trigonometry",syntax:["csc(x)"],description:"Compute the cosecant of x in radians. Defined as 1/sin(x)",examples:["csc(2)","1 / sin(2)"],seealso:["sec","cot","sin"]}},31347:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cschDocs=void 0;t.cschDocs={name:"csch",category:"Trigonometry",syntax:["csch(x)"],description:"Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)",examples:["csch(2)","1 / sinh(2)"],seealso:["sech","coth","sinh"]}},36945:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.secDocs=void 0;t.secDocs={name:"sec",category:"Trigonometry",syntax:["sec(x)"],description:"Compute the secant of x in radians. Defined as 1/cos(x)",examples:["sec(2)","1 / cos(2)"],seealso:["cot","csc","cos"]}},27381:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sechDocs=void 0;t.sechDocs={name:"sech",category:"Trigonometry",syntax:["sech(x)"],description:"Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)",examples:["sech(2)","1 / cosh(2)"],seealso:["coth","csch","cosh"]}},31370:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sinDocs=void 0;t.sinDocs={name:"sin",category:"Trigonometry",syntax:["sin(x)"],description:"Compute the sine of x in radians.",examples:["sin(2)","sin(pi / 4) ^ 2","sin(90 deg)","sin(30 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["asin","cos","tan"]}},89336:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sinhDocs=void 0;t.sinhDocs={name:"sinh",category:"Trigonometry",syntax:["sinh(x)"],description:"Compute the hyperbolic sine of x in radians.",examples:["sinh(0.5)"],seealso:["cosh","tanh"]}},48931:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tanDocs=void 0;t.tanDocs={name:"tan",category:"Trigonometry",syntax:["tan(x)"],description:"Compute the tangent of x in radians.",examples:["tan(0.5)","sin(0.5) / cos(0.5)","tan(pi / 4)","tan(45 deg)"],seealso:["atan","sin","cos"]}},53915:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tanhDocs=void 0;t.tanhDocs={name:"tanh",category:"Trigonometry",syntax:["tanh(x)"],description:"Compute the hyperbolic tangent of x in radians.",examples:["tanh(0.5)","sinh(0.5) / cosh(0.5)"],seealso:["sinh","cosh"]}},2545:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toDocs=void 0;t.toDocs={name:"to",category:"Units",syntax:["x to unit","to(x, unit)"],description:"Change the unit of a value.",examples:["5 inch to cm","3.2kg to g","16 bytes in bits"],seealso:[]}},96461:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.binDocs=void 0;t.binDocs={name:"bin",category:"Utils",syntax:["bin(value)"],description:"Format a number as binary",examples:["bin(2)"],seealso:["oct","hex"]}},84377:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cloneDocs=void 0;t.cloneDocs={name:"clone",category:"Utils",syntax:["clone(x)"],description:"Clone a variable. Creates a copy of primitive variables, and a deep copy of matrices",examples:["clone(3.5)","clone(2 - 4i)","clone(45 deg)","clone([1, 2; 3, 4])",'clone("hello world")'],seealso:[]}},71497:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatDocs=void 0;t.formatDocs={name:"format",category:"Utils",syntax:["format(value)","format(value, precision)"],description:"Format a value of any type as string.",examples:["format(2.3)","format(3 - 4i)","format([])","format(pi, 3)"],seealso:["print"]}},1856:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasNumericValueDocs=void 0;t.hasNumericValueDocs={name:"hasNumericValue",category:"Utils",syntax:["hasNumericValue(x)"],description:"Test whether a value is an numeric value. In case of a string, true is returned if the string contains a numeric value.",examples:["hasNumericValue(2)",'hasNumericValue("2")','isNumeric("2")',"hasNumericValue(0)","hasNumericValue(bignumber(500))","hasNumericValue(fraction(0.125))","hasNumericValue(2 + 3i)",'hasNumericValue([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","isNumeric"]}},90097:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hexDocs=void 0;t.hexDocs={name:"hex",category:"Utils",syntax:["hex(value)"],description:"Format a number as hexadecimal",examples:["hex(240)"],seealso:["bin","oct"]}},92970:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isIntegerDocs=void 0;t.isIntegerDocs={name:"isInteger",category:"Utils",syntax:["isInteger(x)"],description:"Test whether a value is an integer number.",examples:["isInteger(2)","isInteger(3.5)","isInteger([3, 0.5, -2])"],seealso:["isNegative","isNumeric","isPositive","isZero"]}},14113:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNaNDocs=void 0;t.isNaNDocs={name:"isNaN",category:"Utils",syntax:["isNaN(x)"],description:"Test whether a value is NaN (not a number)",examples:["isNaN(2)","isNaN(0 / 0)","isNaN(NaN)","isNaN(Infinity)"],seealso:["isNegative","isNumeric","isPositive","isZero"]}},23793:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNegativeDocs=void 0;t.isNegativeDocs={name:"isNegative",category:"Utils",syntax:["isNegative(x)"],description:"Test whether a value is negative: smaller than zero.",examples:["isNegative(2)","isNegative(0)","isNegative(-4)","isNegative([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isPositive","isZero"]}},28139:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNumericDocs=void 0;t.isNumericDocs={name:"isNumeric",category:"Utils",syntax:["isNumeric(x)"],description:"Test whether a value is a numeric value. Returns true when the input is a number, BigNumber, Fraction, or boolean.",examples:["isNumeric(2)",'isNumeric("2")','hasNumericValue("2")',"isNumeric(0)","isNumeric(bignumber(500))","isNumeric(fraction(0.125))","isNumeric(2 + 3i)",'isNumeric([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","hasNumericValue"]}},87649:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPositiveDocs=void 0;t.isPositiveDocs={name:"isPositive",category:"Utils",syntax:["isPositive(x)"],description:"Test whether a value is positive: larger than zero.",examples:["isPositive(2)","isPositive(0)","isPositive(-4)","isPositive([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isNegative","isZero"]}},66707:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPrimeDocs=void 0;t.isPrimeDocs={name:"isPrime",category:"Utils",syntax:["isPrime(x)"],description:"Test whether a value is prime: has no divisors other than itself and one.",examples:["isPrime(3)","isPrime(-2)","isPrime([2, 17, 100])"],seealso:["isInteger","isNumeric","isNegative","isZero"]}},524:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isZeroDocs=void 0;t.isZeroDocs={name:"isZero",category:"Utils",syntax:["isZero(x)"],description:"Test whether a value is zero.",examples:["isZero(2)","isZero(0)","isZero(-4)","isZero([3, 0, -2, 0])"],seealso:["isInteger","isNumeric","isNegative","isPositive"]}},56715:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.numericDocs=void 0;t.numericDocs={name:"numeric",category:"Utils",syntax:["numeric(x)"],description:"Convert a numeric input to a specific numeric type: number, BigNumber, bigint, or Fraction.",examples:['numeric("4")','numeric("4", "number")','numeric("4", "bigint")','numeric("4", "BigNumber")','numeric("4", "Fraction")','numeric(4, "Fraction")','numeric(fraction(2, 5), "number")'],seealso:["number","bigint","fraction","bignumber","string","format"]}},91446:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.octDocs=void 0;t.octDocs={name:"oct",category:"Utils",syntax:["oct(value)"],description:"Format a number as octal",examples:["oct(56)"],seealso:["bin","hex"]}},62555:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.printDocs=void 0;t.printDocs={name:"print",category:"Utils",syntax:["print(template, values)","print(template, values, precision)"],description:"Interpolate values into a string template.",examples:['print("Lucy is $age years old", {age: 5})','print("The value of pi is $pi", {pi: pi}, 3)','print("Hello, $user.name!", {user: {name: "John"}})','print("Values: $1, $2, $3", [6, 9, 4])'],seealso:["format"]}},57859:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.typeOfDocs=void 0;t.typeOfDocs={name:"typeOf",category:"Utils",syntax:["typeOf(x)"],description:"Get the type of a variable.",examples:["typeOf(3.5)","typeOf(2 - 4i)","typeOf(45 deg)",'typeOf("hello world")'],seealso:["getMatrixDataType"]}},73173:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCompile=void 0;var n=r(16624),i=r(66212);const s="compile",o=["typed","parse"];t.createCompile=(0,i.factory)(s,o,(e=>{let{typed:t,parse:r}=e;return t(s,{string:function(e){return r(e).compile()},"Array | Matrix":function(e){return(0,n.deepMap)(e,(function(e){return r(e).compile()}))}})}))},47161:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createEvaluate=void 0;var n=r(16624),i=r(66212),s=r(81072);const o="evaluate",a=["typed","parse"];t.createEvaluate=(0,i.factory)(o,a,(e=>{let{typed:t,parse:r}=e;return t(o,{string:function(e){const t=(0,s.createEmptyMap)();return r(e).compile().evaluate(t)},"string, Map | Object":function(e,t){return r(e).compile().evaluate(t)},"Array | Matrix":function(e){const t=(0,s.createEmptyMap)();return(0,n.deepMap)(e,(function(e){return r(e).compile().evaluate(t)}))},"Array | Matrix, Map | Object":function(e,t){return(0,n.deepMap)(e,(function(e){return r(e).compile().evaluate(t)}))}})}))},57897:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createHelp=void 0;var n=r(66212),i=r(98770),s=r(8356),o=r(61175);const a="help",l=["typed","mathWithTransform","Help"];t.createHelp=(0,n.factory)(a,l,(e=>{let{typed:t,mathWithTransform:r,Help:n}=e;return t(a,{any:function(e){let t,a=e;if("string"!=typeof e)for(t in r)if((0,o.hasOwnProperty)(r,t)&&e===r[t]){a=t;break}const l=(0,i.getSafeProperty)(s.embeddedDocs,a);if(!l){const e="function"==typeof a?a.name:a;throw new Error('No documentation found on "'+e+'"')}return new n(l)}})}))},33417:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createParser=void 0;var n=r(66212);const i="parser",s=["typed","Parser"];t.createParser=(0,n.factory)(i,s,(e=>{let{typed:t,Parser:r}=e;return t(i,{"":function(){return new r}})}))},69723:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.keywords=void 0;t.keywords=new Set(["end"])},35993:(e,t,r)=>{"use strict";var n=r(87929);Object.defineProperty(t,"__esModule",{value:!0}),t.createAccessorNode=void 0;var i=n(r(55288)),s=r(91612),o=r(98770),a=r(66212),l=r(74498);const c="AccessorNode",u=["subset","Node"];t.createAccessorNode=(0,a.factory)(c,u,(e=>{let{subset:t,Node:r}=e;const n=(0,l.accessFactory)({subset:t});function a(e){return!((0,s.isAccessorNode)(e)||(0,s.isArrayNode)(e)||(0,s.isConstantNode)(e)||(0,s.isFunctionNode)(e)||(0,s.isObjectNode)(e)||(0,s.isParenthesisNode)(e)||(0,s.isSymbolNode)(e))}class AccessorNode extends r{constructor(e,t){if(super(),!(0,s.isNode)(e))throw new TypeError('Node expected for parameter "object"');if(!(0,s.isIndexNode)(t))throw new TypeError('IndexNode expected for parameter "index"');this.object=e,this.index=t}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return c}get isAccessorNode(){return!0}_compile(e,t){const r=this.object._compile(e,t),i=this.index._compile(e,t);if(this.index.isObjectProperty()){const e=this.index.getObjectProperty();return function(t,n,i){return(0,o.getSafeProperty)(r(t,n,i),e)}}return function(e,t,s){const o=r(e,t,s),a=i(e,t,o);return n(o,a)}}forEach(e){e(this.object,"object",this),e(this.index,"index",this)}map(e){return new AccessorNode(this._ifNode(e(this.object,"object",this)),this._ifNode(e(this.index,"index",this)))}clone(){return new AccessorNode(this.object,this.index)}_toString(e){let t=this.object.toString(e);return a(this.object)&&(t="("+t+")"),t+this.index.toString(e)}_toHTML(e){let t=this.object.toHTML(e);return a(this.object)&&(t='<span class="math-parenthesis math-round-parenthesis">(</span>'+t+'<span class="math-parenthesis math-round-parenthesis">)</span>'),t+this.index.toHTML(e)}_toTex(e){let t=this.object.toTex(e);return a(this.object)&&(t="\\left(' + object + '\\right)"),t+this.index.toTex(e)}toJSON(){return{mathjs:c,object:this.object,index:this.index}}static fromJSON(e){return new AccessorNode(e.object,e.index)}}return(0,i.default)(AccessorNode,"name",c),AccessorNode}),{isClass:!0,isNode:!0})},93013:(e,t,r)=>{"use strict";var n=r(87929);Object.defineProperty(t,"__esModule",{value:!0}),t.createArrayNode=void 0;var i=n(r(55288)),s=r(91612),o=r(34487),a=r(66212);const l="ArrayNode",c=["Node"];t.createArrayNode=(0,a.factory)(l,c,(e=>{let{Node:t}=e;class ArrayNode extends t{constructor(e){if(super(),this.items=e||[],!Array.isArray(this.items)||!this.items.every(s.isNode))throw new TypeError("Array containing Nodes expected")}get type(){return l}get isArrayNode(){return!0}_compile(e,t){const r=(0,o.map)(this.items,(function(r){return r._compile(e,t)}));if("Array"!==e.config.matrix){const t=e.matrix;return function(e,n,i){return t((0,o.map)(r,(function(t){return t(e,n,i)})))}}return function(e,t,n){return(0,o.map)(r,(function(r){return r(e,t,n)}))}}forEach(e){for(let t=0;t<this.items.length;t++){e(this.items[t],"items["+t+"]",this)}}map(e){const t=[];for(let r=0;r<this.items.length;r++)t[r]=this._ifNode(e(this.items[r],"items["+r+"]",this));return new ArrayNode(t)}clone(){return new ArrayNode(this.items.slice(0))}_toString(e){return"["+this.items.map((function(t){return t.toString(e)})).join(", ")+"]"}toJSON(){return{mathjs:l,items:this.items}}static fromJSON(e){return new ArrayNode(e.items)}_toHTML(e){return'<span class="math-parenthesis math-square-parenthesis">[</span>'+this.items.map((function(t){return t.toHTML(e)})).join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-square-parenthesis">]</span>'}_toTex(e){return function t(r,n){const i=r.some(s.isArrayNode)&&!r.every(s.isArrayNode),o=n||i,a=o?"&":"\\\\",l=r.map((function(r){return r.items?t(r.items,!n):r.toTex(e)})).join(a);return i||!o||o&&!n?"\\begin{bmatrix}"+l+"\\end{bmatrix}":l}(this.items,!1)}}return(0,i.default)(ArrayNode,"name",l),ArrayNode}),{isClass:!0,isNode:!0})},71515:(e,t,r)=>{"use strict";var n=r(87929);Object.defineProperty(t,"__esModule",{value:!0}),t.createAssignmentNode=void 0;var i=n(r(55288)),s=r(91612),o=r(98770),a=r(66212),l=r(74498),c=r(11445),u=r(7806);const d="AssignmentNode",h=["subset","?matrix","Node"];t.createAssignmentNode=(0,a.factory)(d,h,(e=>{let{subset:t,matrix:r,Node:n}=e;const a=(0,l.accessFactory)({subset:t}),h=(0,c.assignFactory)({subset:t,matrix:r});function p(e,t,r){t||(t="keep");const n=(0,u.getPrecedence)(e,t,r),i=(0,u.getPrecedence)(e.value,t,r);return"all"===t||null!==i&&i<=n}class AssignmentNode extends n{constructor(e,t,r){if(super(),this.object=e,this.index=r?t:null,this.value=r||t,!(0,s.isSymbolNode)(e)&&!(0,s.isAccessorNode)(e))throw new TypeError('SymbolNode or AccessorNode expected as "object"');if((0,s.isSymbolNode)(e)&&"end"===e.name)throw new Error('Cannot assign to symbol "end"');if(this.index&&!(0,s.isIndexNode)(this.index))throw new TypeError('IndexNode expected as "index"');if(!(0,s.isNode)(this.value))throw new TypeError('Node expected as "value"')}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return d}get isAssignmentNode(){return!0}_compile(e,t){const r=this.object._compile(e,t),n=this.index?this.index._compile(e,t):null,i=this.value._compile(e,t),l=this.object.name;if(this.index){if(this.index.isObjectProperty()){const e=this.index.getObjectProperty();return function(t,n,s){const a=r(t,n,s),l=i(t,n,s);return(0,o.setSafeProperty)(a,e,l),l}}if((0,s.isSymbolNode)(this.object))return function(e,t,s){const o=r(e,t,s),a=i(e,t,s),c=n(e,t,o);return e.set(l,h(o,c,a)),a};{const r=this.object.object._compile(e,t);if(this.object.index.isObjectProperty()){const e=this.object.index.getObjectProperty();return function(t,s,a){const l=r(t,s,a),c=(0,o.getSafeProperty)(l,e),u=n(t,s,c),d=i(t,s,a);return(0,o.setSafeProperty)(l,e,h(c,u,d)),d}}{const s=this.object.index._compile(e,t);return function(e,t,o){const l=r(e,t,o),c=s(e,t,l),u=a(l,c),d=n(e,t,u),p=i(e,t,o);return h(l,c,h(u,d,p)),p}}}}if(!(0,s.isSymbolNode)(this.object))throw new TypeError("SymbolNode expected as object");return function(e,t,r){const n=i(e,t,r);return e.set(l,n),n}}forEach(e){e(this.object,"object",this),this.index&&e(this.index,"index",this),e(this.value,"value",this)}map(e){const t=this._ifNode(e(this.object,"object",this)),r=this.index?this._ifNode(e(this.index,"index",this)):null,n=this._ifNode(e(this.value,"value",this));return new AssignmentNode(t,r,n)}clone(){return new AssignmentNode(this.object,this.index,this.value)}_toString(e){const t=this.object.toString(e),r=this.index?this.index.toString(e):"";let n=this.value.toString(e);return p(this,e&&e.parenthesis,e&&e.implicit)&&(n="("+n+")"),t+r+" = "+n}toJSON(){return{mathjs:d,object:this.object,index:this.index,value:this.value}}static fromJSON(e){return new AssignmentNode(e.object,e.index,e.value)}_toHTML(e){const t=this.object.toHTML(e),r=this.index?this.index.toHTML(e):"";let n=this.value.toHTML(e);return p(this,e&&e.parenthesis,e&&e.implicit)&&(n='<span class="math-paranthesis math-round-parenthesis">(</span>'+n+'<span class="math-paranthesis math-round-parenthesis">)</span>'),t+r+'<span class="math-operator math-assignment-operator math-variable-assignment-operator math-binary-operator">=</span>'+n}_toTex(e){const t=this.object.toTex(e),r=this.index?this.index.toTex(e):"";let n=this.value.toTex(e);return p(this,e&&e.parenthesis,e&&e.implicit)&&(n=`\\left(${n}\\right)`),t+r+"="+n}}return(0,i.default)(AssignmentNode,"name",d),AssignmentNode}),{isClass:!0,isNode:!0})},8905:(e,t,r)=>{"use strict";var n=r(87929);Object.defineProperty(t,"__esModule",{value:!0}),t.createBlockNode=void 0;var i=n(r(55288)),s=r(91612),o=r(34487),a=r(66212);const l="BlockNode",c=["ResultSet","Node"];t.createBlockNode=(0,a.factory)(l,c,(e=>{let{ResultSet:t,Node:r}=e;class BlockNode extends r{constructor(e){if(super(),!Array.isArray(e))throw new Error("Array expected");this.blocks=e.map((function(e){const t=e&&e.node,r=!e||void 0===e.visible||e.visible;if(!(0,s.isNode)(t))throw new TypeError('Property "node" must be a Node');if("boolean"!=typeof r)throw new TypeError('Property "visible" must be a boolean');return{node:t,visible:r}}))}get type(){return l}get isBlockNode(){return!0}_compile(e,r){const n=(0,o.map)(this.blocks,(function(t){return{evaluate:t.node._compile(e,r),visible:t.visible}}));return function(e,r,i){const s=[];return(0,o.forEach)(n,(function(t){const n=t.evaluate(e,r,i);t.visible&&s.push(n)})),new t(s)}}forEach(e){for(let t=0;t<this.blocks.length;t++)e(this.blocks[t].node,"blocks["+t+"].node",this)}map(e){const t=[];for(let r=0;r<this.blocks.length;r++){const n=this.blocks[r],i=this._ifNode(e(n.node,"blocks["+r+"].node",this));t[r]={node:i,visible:n.visible}}return new BlockNode(t)}clone(){const e=this.blocks.map((function(e){return{node:e.node,visible:e.visible}}));return new BlockNode(e)}_toString(e){return this.blocks.map((function(t){return t.node.toString(e)+(t.visible?"":";")})).join("\n")}toJSON(){return{mathjs:l,blocks:this.blocks}}static fromJSON(e){return new BlockNode(e.blocks)}_toHTML(e){return this.blocks.map((function(t){return t.node.toHTML(e)+(t.visible?"":'<span class="math-separator">;</span>')})).join('<span class="math-separator"><br /></span>')}_toTex(e){return this.blocks.map((function(t){return t.node.toTex(e)+(t.visible?"":";")})).join("\\;\\;\n")}}return(0,i.default)(BlockNode,"name",l),BlockNode}),{isClass:!0,isNode:!0})},33504:(e,t,r)=>{"use strict";var n=r(87929);Object.defineProperty(t,"__esModule",{value:!0}),t.createConditionalNode=void 0;var i=n(r(55288)),s=r(91612),o=r(66212),a=r(7806);const l="ConditionalNode",c=["Node"];t.createConditionalNode=(0,o.factory)(l,c,(e=>{let{Node:t}=e;class ConditionalNode extends t{constructor(e,t,r){if(super(),!(0,s.isNode)(e))throw new TypeError("Parameter condition must be a Node");if(!(0,s.isNode)(t))throw new TypeError("Parameter trueExpr must be a Node");if(!(0,s.isNode)(r))throw new TypeError("Parameter falseExpr must be a Node");this.condition=e,this.trueExpr=t,this.falseExpr=r}get type(){return l}get isConditionalNode(){return!0}_compile(e,t){const r=this.condition._compile(e,t),n=this.trueExpr._compile(e,t),i=this.falseExpr._compile(e,t);return function(e,t,o){return function(e){if("number"==typeof e||"boolean"==typeof e||"string"==typeof e)return!!e;if(e){if((0,s.isBigNumber)(e))return!e.isZero();if((0,s.isComplex)(e))return!(!e.re&&!e.im);if((0,s.isUnit)(e))return!!e.value}if(null==e)return!1;throw new TypeError('Unsupported type of condition "'+(0,s.typeOf)(e)+'"')}(r(e,t,o))?n(e,t,o):i(e,t,o)}}forEach(e){e(this.condition,"condition",this),e(this.trueExpr,"trueExpr",this),e(this.falseExpr,"falseExpr",this)}map(e){return new ConditionalNode(this._ifNode(e(this.condition,"condition",this)),this._ifNode(e(this.trueExpr,"trueExpr",this)),this._ifNode(e(this.falseExpr,"falseExpr",this)))}clone(){return new ConditionalNode(this.condition,this.trueExpr,this.falseExpr)}_toString(e){const t=e&&e.parenthesis?e.parenthesis:"keep",r=(0,a.getPrecedence)(this,t,e&&e.implicit);let n=this.condition.toString(e);const i=(0,a.getPrecedence)(this.condition,t,e&&e.implicit);("all"===t||"OperatorNode"===this.condition.type||null!==i&&i<=r)&&(n="("+n+")");let s=this.trueExpr.toString(e);const o=(0,a.getPrecedence)(this.trueExpr,t,e&&e.implicit);("all"===t||"OperatorNode"===this.trueExpr.type||null!==o&&o<=r)&&(s="("+s+")");let l=this.falseExpr.toString(e);const c=(0,a.getPrecedence)(this.falseExpr,t,e&&e.implicit);return("all"===t||"OperatorNode"===this.falseExpr.type||null!==c&&c<=r)&&(l="("+l+")"),n+" ? "+s+" : "+l}toJSON(){return{mathjs:l,condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}}static fromJSON(e){return new ConditionalNode(e.condition,e.trueExpr,e.falseExpr)}_toHTML(e){const t=e&&e.parenthesis?e.parenthesis:"keep",r=(0,a.getPrecedence)(this,t,e&&e.implicit);let n=this.condition.toHTML(e);const i=(0,a.getPrecedence)(this.condition,t,e&&e.implicit);("all"===t||"OperatorNode"===this.condition.type||null!==i&&i<=r)&&(n='<span class="math-parenthesis math-round-parenthesis">(</span>'+n+'<span class="math-parenthesis math-round-parenthesis">)</span>');let s=this.trueExpr.toHTML(e);const o=(0,a.getPrecedence)(this.trueExpr,t,e&&e.implicit);("all"===t||"OperatorNode"===this.trueExpr.type||null!==o&&o<=r)&&(s='<span class="math-parenthesis math-round-parenthesis">(</span>'+s+'<span class="math-parenthesis math-round-parenthesis">)</span>');let l=this.falseExpr.toHTML(e);const c=(0,a.getPrecedence)(this.falseExpr,t,e&&e.implicit);return("all"===t||"OperatorNode"===this.falseExpr.type||null!==c&&c<=r)&&(l='<span class="math-parenthesis math-round-parenthesis">(</span>'+l+'<span class="math-parenthesis math-round-parenthesis">)</span>'),n+'<span class="math-operator math-conditional-operator">?</span>'+s+'<span class="math-operator math-conditional-operator">:</span>'+l}_toTex(e){return"\\begin{cases} {"+this.trueExpr.toTex(e)+"}, &\\quad{\\text{if }\\;"+this.condition.toTex(e)+"}\\\\{"+this.falseExpr.toTex(e)+"}, &\\quad{\\text{otherwise}}\\end{cases}"}}return(0,i.default)(ConditionalNode,"name",l),ConditionalNode}),{isClass:!0,isNode:!0})},51118:(e,t,r)=>{"use strict";var n=r(87929);Object.defineProperty(t,"__esModule",{value:!0}),t.createConstantNode=void 0;var i=n(r(55288)),s=r(7041),o=r(91612),a=r(60654),l=r(66212);const c="ConstantNode",u=["Node"];t.createConstantNode=(0,l.factory)(c,u,(e=>{let{Node:t}=e;class ConstantNode extends t{constructor(e){super(),this.value=e}get type(){return c}get isConstantNode(){return!0}_compile(e,t){const r=this.value;return function(){return r}}forEach(e){}map(e){return this.clone()}clone(){return new ConstantNode(this.value)}_toString(e){return(0,s.format)(this.value,e)}_toHTML(e){const t=this._toString(e);switch((0,o.typeOf)(this.value)){case"number":case"bigint":case"BigNumber":case"Fraction":return'<span class="math-number">'+t+"</span>";case"string":return'<span class="math-string">'+t+"</span>";case"boolean":return'<span class="math-boolean">'+t+"</span>";case"null":return'<span class="math-null-symbol">'+t+"</span>";case"undefined":return'<span class="math-undefined">'+t+"</span>";default:return'<span class="math-symbol">'+t+"</span>"}}toJSON(){return{mathjs:c,value:this.value}}static fromJSON(e){return new ConstantNode(e.value)}_toTex(e){const t=this._toString(e),r=(0,o.typeOf)(this.value);switch(r){case"string":return"\\mathtt{"+(0,a.escapeLatex)(t)+"}";case"number":case"BigNumber":{if(!("BigNumber"===r?this.value.isFinite():isFinite(this.value)))return this.value.valueOf()<0?"-\\infty":"\\infty";const e=t.toLowerCase().indexOf("e");return-1!==e?t.substring(0,e)+"\\cdot10^{"+t.substring(e+1)+"}":t}case"bigint":return t.toString();case"Fraction":return this.value.toLatex();default:return t}}}return(0,i.default)(ConstantNode,"name",c),ConstantNode}),{isClass:!0,isNode:!0})},55687:(e,t,r)=>{"use strict";var n=r(87929);Object.defineProperty(t,"__esModule",{value:!0}),t.createFunctionAssignmentNode=void 0;var i=n(r(55288)),s=r(91612),o=r(69723),a=r(7041),l=r(34487),c=r(60654),u=r(7806),d=r(66212);const h="FunctionAssignmentNode",p=["typed","Node"];t.createFunctionAssignmentNode=(0,d.factory)(h,p,(e=>{let{typed:t,Node:r}=e;function n(e,t,r){const n=(0,u.getPrecedence)(e,t,r),i=(0,u.getPrecedence)(e.expr,t,r);return"all"===t||null!==i&&i<=n}class FunctionAssignmentNode extends r{constructor(e,t,r){if(super(),"string"!=typeof e)throw new TypeError('String expected for parameter "name"');if(!Array.isArray(t))throw new TypeError('Array containing strings or objects expected for parameter "params"');if(!(0,s.isNode)(r))throw new TypeError('Node expected for parameter "expr"');if(o.keywords.has(e))throw new Error('Illegal function name, "'+e+'" is a reserved keyword');const n=new Set;for(const e of t){const t="string"==typeof e?e:e.name;if(n.has(t))throw new Error(`Duplicate parameter name "${t}"`);n.add(t)}this.name=e,this.params=t.map((function(e){return e&&e.name||e})),this.types=t.map((function(e){return e&&e.type||"any"})),this.expr=r}get type(){return h}get isFunctionAssignmentNode(){return!0}_compile(e,r){const n=Object.create(r);(0,l.forEach)(this.params,(function(e){n[e]=!0}));const i=this.expr._compile(e,n),s=this.name,o=this.params,a=(0,l.join)(this.types,","),c=s+"("+(0,l.join)(this.params,", ")+")";return function(e,r,n){const l={};l[a]=function(){const t=Object.create(r);for(let e=0;e<o.length;e++)t[o[e]]=arguments[e];return i(e,t,n)};const u=t(s,l);return u.syntax=c,e.set(s,u),u}}forEach(e){e(this.expr,"expr",this)}map(e){const t=this._ifNode(e(this.expr,"expr",this));return new FunctionAssignmentNode(this.name,this.params.slice(0),t)}clone(){return new FunctionAssignmentNode(this.name,this.params.slice(0),this.expr)}_toString(e){const t=e&&e.parenthesis?e.parenthesis:"keep";let r=this.expr.toString(e);return n(this,t,e&&e.implicit)&&(r="("+r+")"),this.name+"("+this.params.join(", ")+") = "+r}toJSON(){const e=this.types;return{mathjs:h,name:this.name,params:this.params.map((function(t,r){return{name:t,type:e[r]}})),expr:this.expr}}static fromJSON(e){return new FunctionAssignmentNode(e.name,e.params,e.expr)}_toHTML(e){const t=e&&e.parenthesis?e.parenthesis:"keep",r=[];for(let e=0;e<this.params.length;e++)r.push('<span class="math-symbol math-parameter">'+(0,a.escape)(this.params[e])+"</span>");let i=this.expr.toHTML(e);return n(this,t,e&&e.implicit)&&(i='<span class="math-parenthesis math-round-parenthesis">(</span>'+i+'<span class="math-parenthesis math-round-parenthesis">)</span>'),'<span class="math-function">'+(0,a.escape)(this.name)+'</span><span class="math-parenthesis math-round-parenthesis">(</span>'+r.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-round-parenthesis">)</span><span class="math-operator math-assignment-operator math-variable-assignment-operator math-binary-operator">=</span>'+i}_toTex(e){const t=e&&e.parenthesis?e.parenthesis:"keep";let r=this.expr.toTex(e);return n(this,t,e&&e.implicit)&&(r=`\\left(${r}\\right)`),"\\mathrm{"+this.name+"}\\left("+this.params.map(c.toSymbol).join(",")+"\\right)="+r}}return(0,i.default)(FunctionAssignmentNode,"name",h),FunctionAssignmentNode}),{isClass:!0,isNode:!0})},67922:(e,t,r)=>{"use strict";var n=r(87929);Object.defineProperty(t,"__esModule",{value:!0}),t.createFunctionNode=void 0;var i=n(r(55288)),s=r(91612),o=r(7041),a=r(61175),l=r(98770),c=r(52434),u=r(66212),d=r(60654);const h="FunctionNode",p=["math","Node","SymbolNode"];t.createFunctionNode=(0,u.factory)(h,p,(e=>{var t;let{math:r,Node:n,SymbolNode:u}=e;const p=e=>(0,o.format)(e,{truncate:78});function m(e,t,r){let n="";const i=/\$(?:\{([a-z_][a-z_0-9]*)(?:\[([0-9]+)\])?\}|\$)/gi;let o,a=0;for(;null!==(o=i.exec(e));)if(n+=e.substring(a,o.index),a=o.index,"$$"===o[0])n+="$",a++;else{a+=o[0].length;const e=t[o[1]];if(!e)throw new ReferenceError("Template: Property "+o[1]+" does not exist.");if(void 0===o[2])switch(typeof e){case"string":n+=e;break;case"object":if((0,s.isNode)(e))n+=e.toTex(r);else{if(!Array.isArray(e))throw new TypeError("Template: "+o[1]+" has to be a Node, String or array of Nodes");n+=e.map((function(e,t){if((0,s.isNode)(e))return e.toTex(r);throw new TypeError("Template: "+o[1]+"["+t+"] is not a Node.")})).join(",")}break;default:throw new TypeError("Template: "+o[1]+" has to be a Node, String or array of Nodes")}else{if(!(0,s.isNode)(e[o[2]]&&e[o[2]]))throw new TypeError("Template: "+o[1]+"["+o[2]+"] is not a Node.");n+=e[o[2]].toTex(r)}}return n+=e.slice(a),n}class FunctionNode extends n{constructor(e,t){if(super(),"string"==typeof e&&(e=new u(e)),!(0,s.isNode)(e))throw new TypeError('Node expected as parameter "fn"');if(!Array.isArray(t)||!t.every(s.isNode))throw new TypeError('Array containing Nodes expected for parameter "args"');this.fn=e,this.args=t||[]}get name(){return this.fn.name||""}get type(){return h}get isFunctionNode(){return!0}_compile(e,t){const r=this.args.map((r=>r._compile(e,t)));if(!(0,s.isSymbolNode)(this.fn)){if((0,s.isAccessorNode)(this.fn)&&(0,s.isIndexNode)(this.fn.index)&&this.fn.index.isObjectProperty()){const n=this.fn.object._compile(e,t),i=this.fn.index.getObjectProperty(),s=this.args;return function(t,o,a){const u=n(t,o,a),d=(0,l.getSafeMethod)(u,i);if(null!=d&&d.rawArgs)return d(s,e,(0,c.createSubScope)(t,o));{const e=r.map((e=>e(t,o,a)));return d.apply(u,e)}}}{const n=this.fn.toString(),i=this.fn._compile(e,t),s=this.args;return function(t,o,a){const l=i(t,o,a);if("function"!=typeof l)throw new TypeError(`Expression '${n}' did not evaluate to a function; value is:\n  ${p(l)}`);if(l.rawArgs)return l(s,e,(0,c.createSubScope)(t,o));{const e=r.map((e=>e(t,o,a)));return l.apply(l,e)}}}}{const n=this.fn.name;if(t[n]){const t=this.args;return function(i,s,o){const a=(0,l.getSafeProperty)(s,n);if("function"!=typeof a)throw new TypeError(`Argument '${n}' was not a function; received: ${p(a)}`);if(a.rawArgs)return a(t,e,(0,c.createSubScope)(i,s));{const e=r.map((e=>e(i,s,o)));return a.apply(a,e)}}}{const t=n in e?(0,l.getSafeProperty)(e,n):void 0,i="function"==typeof t&&!0===t.rawArgs,s=t=>{let r;if(t.has(n))r=t.get(n);else{if(!(n in e))return FunctionNode.onUndefinedFunction(n);r=(0,l.getSafeProperty)(e,n)}if("function"==typeof r)return r;throw new TypeError(`'${n}' is not a function; its value is:\n  ${p(r)}`)};if(i){const t=this.args;return function(n,i,o){const a=s(n);if(!0===a.rawArgs)return a(t,e,(0,c.createSubScope)(n,i));return a(...r.map((e=>e(n,i,o))))}}switch(r.length){case 0:return function(e,t,r){return s(e)()};case 1:return function(e,t,n){return s(e)((0,r[0])(e,t,n))};case 2:return function(e,t,n){const i=s(e),o=r[0],a=r[1];return i(o(e,t,n),a(e,t,n))};default:return function(e,t,n){return s(e)(...r.map((r=>r(e,t,n))))}}}}}forEach(e){e(this.fn,"fn",this);for(let t=0;t<this.args.length;t++)e(this.args[t],"args["+t+"]",this)}map(e){const t=this._ifNode(e(this.fn,"fn",this)),r=[];for(let t=0;t<this.args.length;t++)r[t]=this._ifNode(e(this.args[t],"args["+t+"]",this));return new FunctionNode(t,r)}clone(){return new FunctionNode(this.fn,this.args.slice(0))}toString(e){let t;const r=this.fn.toString(e);return e&&"object"==typeof e.handler&&(0,a.hasOwnProperty)(e.handler,r)&&(t=e.handler[r](this,e)),void 0!==t?t:super.toString(e)}_toString(e){const t=this.args.map((function(t){return t.toString(e)}));return((0,s.isFunctionAssignmentNode)(this.fn)?"("+this.fn.toString(e)+")":this.fn.toString(e))+"("+t.join(", ")+")"}toJSON(){return{mathjs:h,fn:this.fn,args:this.args}}_toHTML(e){const t=this.args.map((function(t){return t.toHTML(e)}));return'<span class="math-function">'+(0,o.escape)(this.fn)+'</span><span class="math-paranthesis math-round-parenthesis">(</span>'+t.join('<span class="math-separator">,</span>')+'<span class="math-paranthesis math-round-parenthesis">)</span>'}toTex(e){let t;return e&&"object"==typeof e.handler&&(0,a.hasOwnProperty)(e.handler,this.name)&&(t=e.handler[this.name](this,e)),void 0!==t?t:super.toTex(e)}_toTex(e){const t=this.args.map((function(t){return t.toTex(e)}));let n,i;switch(d.latexFunctions[this.name]&&(n=d.latexFunctions[this.name]),!r[this.name]||"function"!=typeof r[this.name].toTex&&"object"!=typeof r[this.name].toTex&&"string"!=typeof r[this.name].toTex||(n=r[this.name].toTex),typeof n){case"function":i=n(this,e);break;case"string":i=m(n,this,e);break;case"object":switch(typeof n[t.length]){case"function":i=n[t.length](this,e);break;case"string":i=m(n[t.length],this,e)}}return void 0!==i?i:m(d.defaultTemplate,this,e)}getIdentifier(){return this.type+":"+this.name}}return t=FunctionNode,(0,i.default)(FunctionNode,"name",h),(0,i.default)(FunctionNode,"onUndefinedFunction",(function(e){throw new Error("Undefined function "+e)})),(0,i.default)(FunctionNode,"fromJSON",(function(e){return new t(e.fn,e.args)})),FunctionNode}),{isClass:!0,isNode:!0})},59128:(e,t,r)=>{"use strict";var n=r(87929);Object.defineProperty(t,"__esModule",{value:!0}),t.createIndexNode=void 0;var i=n(r(55288)),s=r(34487),o=r(98770),a=r(66212),l=r(91612),c=r(7041);const u="IndexNode",d=["Node","size"];t.createIndexNode=(0,a.factory)(u,d,(e=>{let{Node:t,size:r}=e;class IndexNode extends t{constructor(e,t){if(super(),this.dimensions=e,this.dotNotation=t||!1,!Array.isArray(e)||!e.every(l.isNode))throw new TypeError('Array containing Nodes expected for parameter "dimensions"');if(this.dotNotation&&!this.isObjectProperty())throw new Error("dotNotation only applicable for object properties")}get type(){return u}get isIndexNode(){return!0}_compile(e,t){const n=(0,s.map)(this.dimensions,(function(n,i){if(n.filter((e=>e.isSymbolNode&&"end"===e.name)).length>0){const s=Object.create(t);s.end=!0;const o=n._compile(e,s);return function(e,t,n){if(!(0,l.isMatrix)(n)&&!(0,l.isArray)(n)&&!(0,l.isString)(n))throw new TypeError('Cannot resolve "end": context must be a Matrix, Array, or string but is '+(0,l.typeOf)(n));const s=r(n).valueOf(),a=Object.create(t);return a.end=s[i],o(e,a,n)}}return n._compile(e,t)})),i=(0,o.getSafeProperty)(e,"index");return function(e,t,r){const o=(0,s.map)(n,(function(n){return n(e,t,r)}));return i(...o)}}forEach(e){for(let t=0;t<this.dimensions.length;t++)e(this.dimensions[t],"dimensions["+t+"]",this)}map(e){const t=[];for(let r=0;r<this.dimensions.length;r++)t[r]=this._ifNode(e(this.dimensions[r],"dimensions["+r+"]",this));return new IndexNode(t,this.dotNotation)}clone(){return new IndexNode(this.dimensions.slice(0),this.dotNotation)}isObjectProperty(){return 1===this.dimensions.length&&(0,l.isConstantNode)(this.dimensions[0])&&"string"==typeof this.dimensions[0].value}getObjectProperty(){return this.isObjectProperty()?this.dimensions[0].value:null}_toString(e){return this.dotNotation?"."+this.getObjectProperty():"["+this.dimensions.join(", ")+"]"}toJSON(){return{mathjs:u,dimensions:this.dimensions,dotNotation:this.dotNotation}}static fromJSON(e){return new IndexNode(e.dimensions,e.dotNotation)}_toHTML(e){const t=[];for(let e=0;e<this.dimensions.length;e++)t[e]=this.dimensions[e].toHTML();return this.dotNotation?'<span class="math-operator math-accessor-operator">.</span><span class="math-symbol math-property">'+(0,c.escape)(this.getObjectProperty())+"</span>":'<span class="math-parenthesis math-square-parenthesis">[</span>'+t.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-square-parenthesis">]</span>'}_toTex(e){const t=this.dimensions.map((function(t){return t.toTex(e)}));return this.dotNotation?"."+this.getObjectProperty():"_{"+t.join(",")+"}"}}return(0,i.default)(IndexNode,"name",u),IndexNode}),{isClass:!0,isNode:!0})},16006:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createNode=void 0;var n=r(91612),i=r(69723),s=r(61175),o=r(66212),a=r(81072);const l=["mathWithTransform"];t.createNode=(0,o.factory)("Node",l,(e=>{let{mathWithTransform:t}=e;return class Node{get type(){return"Node"}get isNode(){return!0}evaluate(e){return this.compile().evaluate(e)}compile(){const e=this._compile(t,{}),r={};return{evaluate:function(t){const n=(0,a.createMap)(t);return function(e){for(const t of[...i.keywords])if(e.has(t))throw new Error('Scope contains an illegal symbol, "'+t+'" is a reserved keyword')}(n),e(n,r,null)}}}_compile(e,t){throw new Error("Method _compile must be implemented by type "+this.type)}forEach(e){throw new Error("Cannot run forEach on a Node interface")}map(e){throw new Error("Cannot run map on a Node interface")}_ifNode(e){if(!(0,n.isNode)(e))throw new TypeError("Callback function must return a Node");return e}traverse(e){e(this,null,null),function e(t,r){t.forEach((function(t,n,i){r(t,n,i),e(t,r)}))}(this,e)}transform(e){return function t(r,n,i){const s=e(r,n,i);return s!==r?s:r.map(t)}(this,null,null)}filter(e){const t=[];return this.traverse((function(r,n,i){e(r,n,i)&&t.push(r)})),t}clone(){throw new Error("Cannot clone a Node interface")}cloneDeep(){return this.map((function(e){return e.cloneDeep()}))}equals(e){return!!e&&(this.type===e.type&&(0,s.deepStrictEqual)(this,e))}toString(e){const t=this._getCustomString(e);return void 0!==t?t:this._toString(e)}_toString(){throw new Error("_toString not implemented for "+this.type)}toJSON(){throw new Error("Cannot serialize object: toJSON not implemented by "+this.type)}toHTML(e){const t=this._getCustomString(e);return void 0!==t?t:this._toHTML(e)}_toHTML(){throw new Error("_toHTML not implemented for "+this.type)}toTex(e){const t=this._getCustomString(e);return void 0!==t?t:this._toTex(e)}_toTex(e){throw new Error("_toTex not implemented for "+this.type)}_getCustomString(e){if(e&&"object"==typeof e)switch(typeof e.handler){case"object":case"undefined":return;case"function":return e.handler(this,e);default:throw new TypeError("Object or function expected as callback")}}getIdentifier(){return this.type}getContent(){return this}}}),{isClass:!0,isNode:!0})},94961:(e,t,r)=>{"use strict";var n=r(87929);Object.defineProperty(t,"__esModule",{value:!0}),t.createObjectNode=void 0;var i=n(r(55288)),s=r(98770),o=r(66212),a=r(91612),l=r(61175),c=r(7041);const u="ObjectNode",d=["Node"];t.createObjectNode=(0,o.factory)(u,d,(e=>{let{Node:t}=e;class ObjectNode extends t{constructor(e){if(super(),this.properties=e||{},e&&("object"!=typeof e||!Object.keys(e).every((function(t){return(0,a.isNode)(e[t])}))))throw new TypeError("Object containing Nodes expected")}get type(){return u}get isObjectNode(){return!0}_compile(e,t){const r={};for(const n in this.properties)if((0,l.hasOwnProperty)(this.properties,n)){const i=(0,c.stringify)(n),o=JSON.parse(i),a=(0,s.getSafeProperty)(this.properties,n);r[o]=a._compile(e,t)}return function(e,t,n){const i={};for(const s in r)(0,l.hasOwnProperty)(r,s)&&(i[s]=r[s](e,t,n));return i}}forEach(e){for(const t in this.properties)(0,l.hasOwnProperty)(this.properties,t)&&e(this.properties[t],"properties["+(0,c.stringify)(t)+"]",this)}map(e){const t={};for(const r in this.properties)(0,l.hasOwnProperty)(this.properties,r)&&(t[r]=this._ifNode(e(this.properties[r],"properties["+(0,c.stringify)(r)+"]",this)));return new ObjectNode(t)}clone(){const e={};for(const t in this.properties)(0,l.hasOwnProperty)(this.properties,t)&&(e[t]=this.properties[t]);return new ObjectNode(e)}_toString(e){const t=[];for(const r in this.properties)(0,l.hasOwnProperty)(this.properties,r)&&t.push((0,c.stringify)(r)+": "+this.properties[r].toString(e));return"{"+t.join(", ")+"}"}toJSON(){return{mathjs:u,properties:this.properties}}static fromJSON(e){return new ObjectNode(e.properties)}_toHTML(e){const t=[];for(const r in this.properties)(0,l.hasOwnProperty)(this.properties,r)&&t.push('<span class="math-symbol math-property">'+(0,c.escape)(r)+'</span><span class="math-operator math-assignment-operator math-property-assignment-operator math-binary-operator">:</span>'+this.properties[r].toHTML(e));return'<span class="math-parenthesis math-curly-parenthesis">{</span>'+t.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-curly-parenthesis">}</span>'}_toTex(e){const t=[];for(const r in this.properties)(0,l.hasOwnProperty)(this.properties,r)&&t.push("\\mathbf{"+r+":} & "+this.properties[r].toTex(e)+"\\\\");return"\\left\\{\\begin{array}{ll}"+t.join("\n")+"\\end{array}\\right\\}"}}return(0,i.default)(ObjectNode,"name",u),ObjectNode}),{isClass:!0,isNode:!0})},42190:(e,t,r)=>{"use strict";var n=r(87929);Object.defineProperty(t,"__esModule",{value:!0}),t.createOperatorNode=void 0;var i=n(r(55288)),s=r(91612),o=r(34487),a=r(52434),l=r(7041),c=r(98770),u=r(7806),d=r(60654),h=r(66212);const p="OperatorNode",m=["Node"];t.createOperatorNode=(0,h.factory)(p,m,(e=>{let{Node:t}=e;function r(e,t){let n=e;if("auto"===t)for(;(0,s.isParenthesisNode)(n);)n=n.content;return!!(0,s.isConstantNode)(n)||!!(0,s.isOperatorNode)(n)&&r(n.args[0],t)}function n(e,t,n,i,o){const a=(0,u.getPrecedence)(e,t,n),l=(0,u.getAssociativity)(e,t);if("all"===t||i.length>2&&"OperatorNode:add"!==e.getIdentifier()&&"OperatorNode:multiply"!==e.getIdentifier())return i.map((function(e){switch(e.getContent().type){case"ArrayNode":case"ConstantNode":case"SymbolNode":case"ParenthesisNode":return!1;default:return!0}}));let c;switch(i.length){case 0:c=[];break;case 1:{const r=(0,u.getPrecedence)(i[0],t,n,e);if(o&&null!==r){let n,s;if("keep"===t?(n=i[0].getIdentifier(),s=e.getIdentifier()):(n=i[0].getContent().getIdentifier(),s=e.getContent().getIdentifier()),!1===u.properties[a][s].latexLeftParens){c=[!1];break}if(!1===u.properties[r][n].latexParens){c=[!1];break}}if(null===r){c=[!1];break}if(r<=a){c=[!0];break}c=[!1]}break;case 2:{let r;const s=(0,u.getPrecedence)(i[0],t,n,e),d=(0,u.isAssociativeWith)(e,i[0],t);let h;r=null!==s&&(s===a&&"right"===l&&!d||s<a);const p=(0,u.getPrecedence)(i[1],t,n,e),m=(0,u.isAssociativeWith)(e,i[1],t);if(h=null!==p&&(p===a&&"left"===l&&!m||p<a),o){let n,i,o;"keep"===t?(n=e.getIdentifier(),i=e.args[0].getIdentifier(),o=e.args[1].getIdentifier()):(n=e.getContent().getIdentifier(),i=e.args[0].getContent().getIdentifier(),o=e.args[1].getContent().getIdentifier()),null!==s&&(!1===u.properties[a][n].latexLeftParens&&(r=!1),!1===u.properties[s][i].latexParens&&(r=!1)),null!==p&&(!1===u.properties[a][n].latexRightParens&&(h=!1),!1===u.properties[p][o].latexParens&&(h=!1))}c=[r,h]}break;default:"OperatorNode:add"!==e.getIdentifier()&&"OperatorNode:multiply"!==e.getIdentifier()||(c=i.map((function(r){const i=(0,u.getPrecedence)(r,t,n,e),s=(0,u.isAssociativeWith)(e,r,t),o=(0,u.getAssociativity)(r,t);return null!==i&&(a===i&&l===o&&!s||i<a)})))}if(i.length>=2&&"OperatorNode:multiply"===e.getIdentifier()&&e.implicit&&"all"!==t&&"hide"===n)for(let e=1;e<c.length;++e)!r(i[e],t)||c[e-1]||"keep"===t&&(0,s.isParenthesisNode)(i[e-1])||(c[e]=!0);return c}class OperatorNode extends t{constructor(e,t,r,n,i){if(super(),"string"!=typeof e)throw new TypeError('string expected for parameter "op"');if("string"!=typeof t)throw new TypeError('string expected for parameter "fn"');if(!Array.isArray(r)||!r.every(s.isNode))throw new TypeError('Array containing Nodes expected for parameter "args"');this.implicit=!0===n,this.isPercentage=!0===i,this.op=e,this.fn=t,this.args=r||[]}get type(){return p}get isOperatorNode(){return!0}_compile(e,t){if("string"!=typeof this.fn||!(0,c.isSafeMethod)(e,this.fn))throw e[this.fn]?new Error('No access to function "'+this.fn+'"'):new Error("Function "+this.fn+' missing in provided namespace "math"');const r=(0,c.getSafeProperty)(e,this.fn),n=(0,o.map)(this.args,(function(r){return r._compile(e,t)}));if("function"==typeof r&&!0===r.rawArgs){const t=this.args;return function(n,i,s){return r(t,e,(0,a.createSubScope)(n,i))}}if(1===n.length){const e=n[0];return function(t,n,i){return r(e(t,n,i))}}if(2===n.length){const e=n[0],t=n[1];return function(n,i,s){return r(e(n,i,s),t(n,i,s))}}return function(e,t,i){return r.apply(null,(0,o.map)(n,(function(r){return r(e,t,i)})))}}forEach(e){for(let t=0;t<this.args.length;t++)e(this.args[t],"args["+t+"]",this)}map(e){const t=[];for(let r=0;r<this.args.length;r++)t[r]=this._ifNode(e(this.args[r],"args["+r+"]",this));return new OperatorNode(this.op,this.fn,t,this.implicit,this.isPercentage)}clone(){return new OperatorNode(this.op,this.fn,this.args.slice(0),this.implicit,this.isPercentage)}isUnary(){return 1===this.args.length}isBinary(){return 2===this.args.length}_toString(e){const t=e&&e.parenthesis?e.parenthesis:"keep",r=e&&e.implicit?e.implicit:"hide",i=this.args,s=n(this,t,r,i,!1);if(1===i.length){const r=(0,u.getAssociativity)(this,t);let n=i[0].toString(e);s[0]&&(n="("+n+")");const o=/[a-zA-Z]+/.test(this.op);return"right"===r?this.op+(o?" ":"")+n:"left"===r?n+(o?" ":"")+this.op:n+this.op}if(2===i.length){let t=i[0].toString(e),n=i[1].toString(e);return s[0]&&(t="("+t+")"),s[1]&&(n="("+n+")"),this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===r?t+" "+n:t+" "+this.op+" "+n}if(i.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())){const t=i.map((function(t,r){return t=t.toString(e),s[r]&&(t="("+t+")"),t}));return this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===r?t.join(" "):t.join(" "+this.op+" ")}return this.fn+"("+this.args.join(", ")+")"}toJSON(){return{mathjs:p,op:this.op,fn:this.fn,args:this.args,implicit:this.implicit,isPercentage:this.isPercentage}}static fromJSON(e){return new OperatorNode(e.op,e.fn,e.args,e.implicit,e.isPercentage)}_toHTML(e){const t=e&&e.parenthesis?e.parenthesis:"keep",r=e&&e.implicit?e.implicit:"hide",i=this.args,s=n(this,t,r,i,!1);if(1===i.length){const r=(0,u.getAssociativity)(this,t);let n=i[0].toHTML(e);return s[0]&&(n='<span class="math-parenthesis math-round-parenthesis">(</span>'+n+'<span class="math-parenthesis math-round-parenthesis">)</span>'),"right"===r?'<span class="math-operator math-unary-operator math-lefthand-unary-operator">'+(0,l.escape)(this.op)+"</span>"+n:n+'<span class="math-operator math-unary-operator math-righthand-unary-operator">'+(0,l.escape)(this.op)+"</span>"}if(2===i.length){let t=i[0].toHTML(e),n=i[1].toHTML(e);return s[0]&&(t='<span class="math-parenthesis math-round-parenthesis">(</span>'+t+'<span class="math-parenthesis math-round-parenthesis">)</span>'),s[1]&&(n='<span class="math-parenthesis math-round-parenthesis">(</span>'+n+'<span class="math-parenthesis math-round-parenthesis">)</span>'),this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===r?t+'<span class="math-operator math-binary-operator math-implicit-binary-operator"></span>'+n:t+'<span class="math-operator math-binary-operator math-explicit-binary-operator">'+(0,l.escape)(this.op)+"</span>"+n}{const t=i.map((function(t,r){return t=t.toHTML(e),s[r]&&(t='<span class="math-parenthesis math-round-parenthesis">(</span>'+t+'<span class="math-parenthesis math-round-parenthesis">)</span>'),t}));return i.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())?this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===r?t.join('<span class="math-operator math-binary-operator math-implicit-binary-operator"></span>'):t.join('<span class="math-operator math-binary-operator math-explicit-binary-operator">'+(0,l.escape)(this.op)+"</span>"):'<span class="math-function">'+(0,l.escape)(this.fn)+'</span><span class="math-paranthesis math-round-parenthesis">(</span>'+t.join('<span class="math-separator">,</span>')+'<span class="math-paranthesis math-round-parenthesis">)</span>'}}_toTex(e){const t=e&&e.parenthesis?e.parenthesis:"keep",r=e&&e.implicit?e.implicit:"hide",i=this.args,s=n(this,t,r,i,!0);let o=d.latexOperators[this.fn];if(o=void 0===o?this.op:o,1===i.length){const r=(0,u.getAssociativity)(this,t);let n=i[0].toTex(e);return s[0]&&(n=`\\left(${n}\\right)`),"right"===r?o+n:n+o}if(2===i.length){const n=i[0];let a=n.toTex(e);s[0]&&(a=`\\left(${a}\\right)`);let l,c=i[1].toTex(e);switch(s[1]&&(c=`\\left(${c}\\right)`),l="keep"===t?n.getIdentifier():n.getContent().getIdentifier(),this.getIdentifier()){case"OperatorNode:divide":return o+"{"+a+"}{"+c+"}";case"OperatorNode:pow":switch(a="{"+a+"}",c="{"+c+"}",l){case"ConditionalNode":case"OperatorNode:divide":a=`\\left(${a}\\right)`}break;case"OperatorNode:multiply":if(this.implicit&&"hide"===r)return a+"~"+c}return a+o+c}if(i.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())){const t=i.map((function(t,r){return t=t.toTex(e),s[r]&&(t=`\\left(${t}\\right)`),t}));return"OperatorNode:multiply"===this.getIdentifier()&&this.implicit&&"hide"===r?t.join("~"):t.join(o)}return"\\mathrm{"+this.fn+"}\\left("+i.map((function(t){return t.toTex(e)})).join(",")+"\\right)"}getIdentifier(){return this.type+":"+this.fn}}return(0,i.default)(OperatorNode,"name",p),OperatorNode}),{isClass:!0,isNode:!0})},95456:(e,t,r)=>{"use strict";var n=r(87929);Object.defineProperty(t,"__esModule",{value:!0}),t.createParenthesisNode=void 0;var i=n(r(55288)),s=r(91612),o=r(66212);const a="ParenthesisNode",l=["Node"];t.createParenthesisNode=(0,o.factory)(a,l,(e=>{let{Node:t}=e;class ParenthesisNode extends t{constructor(e){if(super(),!(0,s.isNode)(e))throw new TypeError('Node expected for parameter "content"');this.content=e}get type(){return a}get isParenthesisNode(){return!0}_compile(e,t){return this.content._compile(e,t)}getContent(){return this.content.getContent()}forEach(e){e(this.content,"content",this)}map(e){const t=e(this.content,"content",this);return new ParenthesisNode(t)}clone(){return new ParenthesisNode(this.content)}_toString(e){return!e||e&&!e.parenthesis||e&&"keep"===e.parenthesis?"("+this.content.toString(e)+")":this.content.toString(e)}toJSON(){return{mathjs:a,content:this.content}}static fromJSON(e){return new ParenthesisNode(e.content)}_toHTML(e){return!e||e&&!e.parenthesis||e&&"keep"===e.parenthesis?'<span class="math-parenthesis math-round-parenthesis">(</span>'+this.content.toHTML(e)+'<span class="math-parenthesis math-round-parenthesis">)</span>':this.content.toHTML(e)}_toTex(e){return!e||e&&!e.parenthesis||e&&"keep"===e.parenthesis?`\\left(${this.content.toTex(e)}\\right)`:this.content.toTex(e)}}return(0,i.default)(ParenthesisNode,"name",a),ParenthesisNode}),{isClass:!0,isNode:!0})},9377:(e,t,r)=>{"use strict";var n=r(87929);Object.defineProperty(t,"__esModule",{value:!0}),t.createRangeNode=void 0;var i=n(r(55288)),s=r(91612),o=r(66212),a=r(7806);const l="RangeNode",c=["Node"];t.createRangeNode=(0,o.factory)(l,c,(e=>{let{Node:t}=e;function r(e,t,r){const n=(0,a.getPrecedence)(e,t,r),i={},s=(0,a.getPrecedence)(e.start,t,r);if(i.start=null!==s&&s<=n||"all"===t,e.step){const s=(0,a.getPrecedence)(e.step,t,r);i.step=null!==s&&s<=n||"all"===t}const o=(0,a.getPrecedence)(e.end,t,r);return i.end=null!==o&&o<=n||"all"===t,i}class RangeNode extends t{constructor(e,t,r){if(super(),!(0,s.isNode)(e))throw new TypeError("Node expected");if(!(0,s.isNode)(t))throw new TypeError("Node expected");if(r&&!(0,s.isNode)(r))throw new TypeError("Node expected");if(arguments.length>3)throw new Error("Too many arguments");this.start=e,this.end=t,this.step=r||null}get type(){return l}get isRangeNode(){return!0}needsEnd(){return this.filter((function(e){return(0,s.isSymbolNode)(e)&&"end"===e.name})).length>0}_compile(e,t){const r=e.range,n=this.start._compile(e,t),i=this.end._compile(e,t);if(this.step){const s=this.step._compile(e,t);return function(e,t,o){return r(n(e,t,o),i(e,t,o),s(e,t,o))}}return function(e,t,s){return r(n(e,t,s),i(e,t,s))}}forEach(e){e(this.start,"start",this),e(this.end,"end",this),this.step&&e(this.step,"step",this)}map(e){return new RangeNode(this._ifNode(e(this.start,"start",this)),this._ifNode(e(this.end,"end",this)),this.step&&this._ifNode(e(this.step,"step",this)))}clone(){return new RangeNode(this.start,this.end,this.step&&this.step)}_toString(e){const t=r(this,e&&e.parenthesis?e.parenthesis:"keep",e&&e.implicit);let n,i=this.start.toString(e);if(t.start&&(i="("+i+")"),n=i,this.step){let r=this.step.toString(e);t.step&&(r="("+r+")"),n+=":"+r}let s=this.end.toString(e);return t.end&&(s="("+s+")"),n+=":"+s,n}toJSON(){return{mathjs:l,start:this.start,end:this.end,step:this.step}}static fromJSON(e){return new RangeNode(e.start,e.end,e.step)}_toHTML(e){const t=r(this,e&&e.parenthesis?e.parenthesis:"keep",e&&e.implicit);let n,i=this.start.toHTML(e);if(t.start&&(i='<span class="math-parenthesis math-round-parenthesis">(</span>'+i+'<span class="math-parenthesis math-round-parenthesis">)</span>'),n=i,this.step){let r=this.step.toHTML(e);t.step&&(r='<span class="math-parenthesis math-round-parenthesis">(</span>'+r+'<span class="math-parenthesis math-round-parenthesis">)</span>'),n+='<span class="math-operator math-range-operator">:</span>'+r}let s=this.end.toHTML(e);return t.end&&(s='<span class="math-parenthesis math-round-parenthesis">(</span>'+s+'<span class="math-parenthesis math-round-parenthesis">)</span>'),n+='<span class="math-operator math-range-operator">:</span>'+s,n}_toTex(e){const t=r(this,e&&e.parenthesis?e.parenthesis:"keep",e&&e.implicit);let n=this.start.toTex(e);if(t.start&&(n=`\\left(${n}\\right)`),this.step){let r=this.step.toTex(e);t.step&&(r=`\\left(${r}\\right)`),n+=":"+r}let i=this.end.toTex(e);return t.end&&(i=`\\left(${i}\\right)`),n+=":"+i,n}}return(0,i.default)(RangeNode,"name",l),RangeNode}),{isClass:!0,isNode:!0})},76487:(e,t,r)=>{"use strict";var n=r(87929);Object.defineProperty(t,"__esModule",{value:!0}),t.createRelationalNode=void 0;var i=n(r(55288)),s=r(7806),o=r(7041),a=r(98770),l=r(60654),c=r(66212);const u="RelationalNode",d=["Node"];t.createRelationalNode=(0,c.factory)(u,d,(e=>{let{Node:t}=e;const r={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="};class RelationalNode extends t{constructor(e,t){if(super(),!Array.isArray(e))throw new TypeError("Parameter conditionals must be an array");if(!Array.isArray(t))throw new TypeError("Parameter params must be an array");if(e.length!==t.length-1)throw new TypeError("Parameter params must contain exactly one more element than parameter conditionals");this.conditionals=e,this.params=t}get type(){return u}get isRelationalNode(){return!0}_compile(e,t){const r=this,n=this.params.map((r=>r._compile(e,t)));return function(t,i,s){let o,l=n[0](t,i,s);for(let c=0;c<r.conditionals.length;c++){o=l,l=n[c+1](t,i,s);if(!(0,a.getSafeProperty)(e,r.conditionals[c])(o,l))return!1}return!0}}forEach(e){this.params.forEach(((t,r)=>e(t,"params["+r+"]",this)),this)}map(e){return new RelationalNode(this.conditionals.slice(),this.params.map(((t,r)=>this._ifNode(e(t,"params["+r+"]",this))),this))}clone(){return new RelationalNode(this.conditionals,this.params)}_toString(e){const t=e&&e.parenthesis?e.parenthesis:"keep",n=(0,s.getPrecedence)(this,t,e&&e.implicit),i=this.params.map((function(r,i){const o=(0,s.getPrecedence)(r,t,e&&e.implicit);return"all"===t||null!==o&&o<=n?"("+r.toString(e)+")":r.toString(e)}));let o=i[0];for(let e=0;e<this.conditionals.length;e++)o+=" "+r[this.conditionals[e]],o+=" "+i[e+1];return o}toJSON(){return{mathjs:u,conditionals:this.conditionals,params:this.params}}static fromJSON(e){return new RelationalNode(e.conditionals,e.params)}_toHTML(e){const t=e&&e.parenthesis?e.parenthesis:"keep",n=(0,s.getPrecedence)(this,t,e&&e.implicit),i=this.params.map((function(r,i){const o=(0,s.getPrecedence)(r,t,e&&e.implicit);return"all"===t||null!==o&&o<=n?'<span class="math-parenthesis math-round-parenthesis">(</span>'+r.toHTML(e)+'<span class="math-parenthesis math-round-parenthesis">)</span>':r.toHTML(e)}));let a=i[0];for(let e=0;e<this.conditionals.length;e++)a+='<span class="math-operator math-binary-operator math-explicit-binary-operator">'+(0,o.escape)(r[this.conditionals[e]])+"</span>"+i[e+1];return a}_toTex(e){const t=e&&e.parenthesis?e.parenthesis:"keep",r=(0,s.getPrecedence)(this,t,e&&e.implicit),n=this.params.map((function(n,i){const o=(0,s.getPrecedence)(n,t,e&&e.implicit);return"all"===t||null!==o&&o<=r?"\\left("+n.toTex(e)+"\right)":n.toTex(e)}));let i=n[0];for(let e=0;e<this.conditionals.length;e++)i+=l.latexOperators[this.conditionals[e]]+n[e+1];return i}}return(0,i.default)(RelationalNode,"name",u),RelationalNode}),{isClass:!0,isNode:!0})},74530:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSymbolNode=void 0;var n=r(7041),i=r(98770),s=r(66212),o=r(60654);const a=["math","?Unit","Node"];t.createSymbolNode=(0,s.factory)("SymbolNode",a,(e=>{let{math:t,Unit:r,Node:s}=e;function a(e){return!!r&&r.isValuelessUnit(e)}class SymbolNode extends s{constructor(e){if(super(),"string"!=typeof e)throw new TypeError('String expected for parameter "name"');this.name=e}get type(){return"SymbolNode"}get isSymbolNode(){return!0}_compile(e,t){const n=this.name;if(!0===t[n])return function(e,t,r){return(0,i.getSafeProperty)(t,n)};if(n in e)return function(t,r,s){return t.has(n)?t.get(n):(0,i.getSafeProperty)(e,n)};{const e=a(n);return function(t,i,s){return t.has(n)?t.get(n):e?new r(null,n):SymbolNode.onUndefinedSymbol(n)}}}forEach(e){}map(e){return this.clone()}static onUndefinedSymbol(e){throw new Error("Undefined symbol "+e)}clone(){return new SymbolNode(this.name)}_toString(e){return this.name}_toHTML(e){const t=(0,n.escape)(this.name);return"true"===t||"false"===t?'<span class="math-symbol math-boolean">'+t+"</span>":"i"===t?'<span class="math-symbol math-imaginary-symbol">'+t+"</span>":"Infinity"===t?'<span class="math-symbol math-infinity-symbol">'+t+"</span>":"NaN"===t?'<span class="math-symbol math-nan-symbol">'+t+"</span>":"null"===t?'<span class="math-symbol math-null-symbol">'+t+"</span>":"undefined"===t?'<span class="math-symbol math-undefined-symbol">'+t+"</span>":'<span class="math-symbol">'+t+"</span>"}toJSON(){return{mathjs:"SymbolNode",name:this.name}}static fromJSON(e){return new SymbolNode(e.name)}_toTex(e){let r=!1;void 0===t[this.name]&&a(this.name)&&(r=!0);const n=(0,o.toSymbol)(this.name,r);return"\\"===n[0]?n:" "+n}}return SymbolNode}),{isClass:!0,isNode:!0})},74498:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.accessFactory=function(e){let{subset:t}=e;return function(e,r){try{if(Array.isArray(e))return t(e,r);if(e&&"function"==typeof e.subset)return e.subset(r);if("string"==typeof e)return t(e,r);if("object"==typeof e){if(!r.isObjectProperty())throw new TypeError("Cannot apply a numeric index as object property");return(0,i.getSafeProperty)(e,r.getObjectProperty())}throw new TypeError("Cannot apply index: unsupported type of object")}catch(e){throw(0,n.errorTransform)(e)}}};var n=r(88990),i=r(98770)},11445:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assignFactory=function(e){let{subset:t,matrix:r}=e;return function(e,s,o){try{if(Array.isArray(e)){return r(e).subset(s,o).valueOf().forEach(((t,r)=>{e[r]=t})),e}if(e&&"function"==typeof e.subset)return e.subset(s,o);if("string"==typeof e)return t(e,s,o);if("object"==typeof e){if(!s.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return(0,i.setSafeProperty)(e,s.getObjectProperty(),o),e}throw new TypeError("Cannot apply index: unsupported type of object")}catch(e){throw(0,n.errorTransform)(e)}}};var n=r(88990),i=r(98770)},7806:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getAssociativity=function(e,t){let r=e;"keep"!==t&&(r=e.getContent());const i=r.getIdentifier(),o=a(r,t);if(null===o)return null;const l=s[o][i];if((0,n.hasOwnProperty)(l,"associativity")){if("left"===l.associativity)return"left";if("right"===l.associativity)return"right";throw Error("'"+i+"' has the invalid associativity '"+l.associativity+"'.")}return null},t.getOperator=function(e){const t="OperatorNode:"+e;for(const e of s)if(t in e)return e[t].op;return null},t.getPrecedence=a,t.isAssociativeWith=function(e,t,r){const i="keep"!==r?e.getContent():e,o="keep"!==r?e.getContent():t,l=i.getIdentifier(),c=o.getIdentifier(),u=a(i,r);if(null===u)return null;const d=s[u][l];if((0,n.hasOwnProperty)(d,"associativeWith")&&d.associativeWith instanceof Array){for(let e=0;e<d.associativeWith.length;e++)if(d.associativeWith[e]===c)return!0;return!1}return null},t.properties=void 0;var n=r(61175),i=r(91612);const s=t.properties=[{AssignmentNode:{},FunctionAssignmentNode:{}},{ConditionalNode:{latexLeftParens:!1,latexRightParens:!1,latexParens:!1}},{"OperatorNode:or":{op:"or",associativity:"left",associativeWith:[]}},{"OperatorNode:xor":{op:"xor",associativity:"left",associativeWith:[]}},{"OperatorNode:and":{op:"and",associativity:"left",associativeWith:[]}},{"OperatorNode:bitOr":{op:"|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitXor":{op:"^|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitAnd":{op:"&",associativity:"left",associativeWith:[]}},{"OperatorNode:equal":{op:"==",associativity:"left",associativeWith:[]},"OperatorNode:unequal":{op:"!=",associativity:"left",associativeWith:[]},"OperatorNode:smaller":{op:"<",associativity:"left",associativeWith:[]},"OperatorNode:larger":{op:">",associativity:"left",associativeWith:[]},"OperatorNode:smallerEq":{op:"<=",associativity:"left",associativeWith:[]},"OperatorNode:largerEq":{op:">=",associativity:"left",associativeWith:[]},RelationalNode:{associativity:"left",associativeWith:[]}},{"OperatorNode:leftShift":{op:"<<",associativity:"left",associativeWith:[]},"OperatorNode:rightArithShift":{op:">>",associativity:"left",associativeWith:[]},"OperatorNode:rightLogShift":{op:">>>",associativity:"left",associativeWith:[]}},{"OperatorNode:to":{op:"to",associativity:"left",associativeWith:[]}},{RangeNode:{}},{"OperatorNode:add":{op:"+",associativity:"left",associativeWith:["OperatorNode:add","OperatorNode:subtract"]},"OperatorNode:subtract":{op:"-",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{op:"*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]},"OperatorNode:divide":{op:"/",associativity:"left",associativeWith:[],latexLeftParens:!1,latexRightParens:!1,latexParens:!1},"OperatorNode:dotMultiply":{op:".*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","OperatorNode:dotMultiply","OperatorNode:doDivide"]},"OperatorNode:dotDivide":{op:"./",associativity:"left",associativeWith:[]},"OperatorNode:mod":{op:"mod",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]}},{"OperatorNode:unaryPlus":{op:"+",associativity:"right"},"OperatorNode:unaryMinus":{op:"-",associativity:"right"},"OperatorNode:bitNot":{op:"~",associativity:"right"},"OperatorNode:not":{op:"not",associativity:"right"}},{"OperatorNode:pow":{op:"^",associativity:"right",associativeWith:[],latexRightParens:!1},"OperatorNode:dotPow":{op:".^",associativity:"right",associativeWith:[]}},{"OperatorNode:factorial":{op:"!",associativity:"left"}},{"OperatorNode:ctranspose":{op:"'",associativity:"left"}}];function o(e,t){if(!t||"auto"!==t)return e;let r=e;for(;(0,i.isParenthesisNode)(r);)r=r.content;return r}function a(e,t,r,n){let a=e;"keep"!==t&&(a=e.getContent());const l=a.getIdentifier();let c=null;for(let e=0;e<s.length;e++)if(l in s[e]){c=e;break}if("OperatorNode:multiply"===l&&a.implicit&&"show"!==r){const e=o(a.args[0],t);(0,i.isConstantNode)(e)&&n&&"OperatorNode:divide"===n.getIdentifier()&&(0,i.rule2Node)(o(n.args[0],t))||"OperatorNode:divide"===e.getIdentifier()&&(0,i.rule2Node)(o(e.args[0],t))&&(0,i.isConstantNode)(o(e.args[1]))||(c+=1)}return c}},55800:(e,t,r)=>{"use strict";var n=r(87929);Object.defineProperty(t,"__esModule",{value:!0}),t.createParse=void 0;var i=n(r(37693)),s=r(66212),o=r(91612),a=r(16624),l=r(34749),c=r(61175);const u="parse",d=["typed","numeric","config","AccessorNode","ArrayNode","AssignmentNode","BlockNode","ConditionalNode","ConstantNode","FunctionAssignmentNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","RangeNode","RelationalNode","SymbolNode"];t.createParse=(0,s.factory)(u,d,(e=>{let{typed:t,numeric:r,config:n,AccessorNode:s,ArrayNode:d,AssignmentNode:h,BlockNode:p,ConditionalNode:m,ConstantNode:f,FunctionAssignmentNode:g,FunctionNode:y,IndexNode:b,ObjectNode:v,OperatorNode:_,ParenthesisNode:x,RangeNode:w,RelationalNode:R,SymbolNode:k}=e;const j=t(u,{string:function(e){return ue(e,{})},"Array | Matrix":function(e){return z(e,{})},"string, Object":function(e,t){return ue(e,void 0!==t.nodes?t.nodes:{})},"Array | Matrix, Object":z});function z(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=void 0!==t.nodes?t.nodes:{};return(0,a.deepMap)(e,(function(e){if("string"!=typeof e)throw new TypeError("String expected");return ue(e,r)}))}const q={NULL:0,DELIMITER:1,NUMBER:2,SYMBOL:3,UNKNOWN:4},$={",":!0,"(":!0,")":!0,"[":!0,"]":!0,"{":!0,"}":!0,'"':!0,"'":!0,";":!0,"+":!0,"-":!0,"*":!0,".*":!0,"/":!0,"./":!0,"%":!0,"^":!0,".^":!0,"~":!0,"!":!0,"&":!0,"|":!0,"^|":!0,"=":!0,":":!0,"?":!0,"==":!0,"!=":!0,"<":!0,">":!0,"<=":!0,">=":!0,"<<":!0,">>":!0,">>>":!0},Z={mod:!0,to:!0,in:!0,and:!0,xor:!0,or:!0,not:!0},X={true:!0,false:!1,null:null,undefined:void 0},Y=["NaN","Infinity"],ee={'"':'"',"'":"'","\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function te(e,t){return e.expression.substr(e.index,t)}function re(e){return te(e,1)}function ne(e){e.index++}function ie(e){return e.expression.charAt(e.index-1)}function se(e){return e.expression.charAt(e.index+1)}function oe(e){for(e.tokenType=q.NULL,e.token="",e.comment="";;){if("#"===re(e))for(;"\n"!==re(e)&&""!==re(e);)e.comment+=re(e),ne(e);if(!j.isWhitespace(re(e),e.nestingLevel))break;ne(e)}if(""===re(e))return void(e.tokenType=q.DELIMITER);if("\n"===re(e)&&!e.nestingLevel)return e.tokenType=q.DELIMITER,e.token=re(e),void ne(e);const t=re(e),r=te(e,2),n=te(e,3);if(3===n.length&&$[n])return e.tokenType=q.DELIMITER,e.token=n,ne(e),ne(e),void ne(e);if(2===r.length&&$[r])return e.tokenType=q.DELIMITER,e.token=r,ne(e),void ne(e);if($[t])return e.tokenType=q.DELIMITER,e.token=t,void ne(e);if(j.isDigitDot(t)){e.tokenType=q.NUMBER;const t=te(e,2);if("0b"===t||"0o"===t||"0x"===t){for(e.token+=re(e),ne(e),e.token+=re(e),ne(e);j.isHexDigit(re(e));)e.token+=re(e),ne(e);if("."===re(e))for(e.token+=".",ne(e);j.isHexDigit(re(e));)e.token+=re(e),ne(e);else if("i"===re(e))for(e.token+="i",ne(e);j.isDigit(re(e));)e.token+=re(e),ne(e);return}if("."===re(e)){if(e.token+=re(e),ne(e),!j.isDigit(re(e)))return void(e.tokenType=q.DELIMITER)}else{for(;j.isDigit(re(e));)e.token+=re(e),ne(e);j.isDecimalMark(re(e),se(e))&&(e.token+=re(e),ne(e))}for(;j.isDigit(re(e));)e.token+=re(e),ne(e);if("E"===re(e)||"e"===re(e))if(j.isDigit(se(e))||"-"===se(e)||"+"===se(e)){if(e.token+=re(e),ne(e),"+"!==re(e)&&"-"!==re(e)||(e.token+=re(e),ne(e)),!j.isDigit(re(e)))throw ze(e,'Digit expected, got "'+re(e)+'"');for(;j.isDigit(re(e));)e.token+=re(e),ne(e);if(j.isDecimalMark(re(e),se(e)))throw ze(e,'Digit expected, got "'+re(e)+'"')}else if("."===se(e))throw ne(e),ze(e,'Digit expected, got "'+re(e)+'"')}else{if(!j.isAlpha(re(e),ie(e),se(e))){for(e.tokenType=q.UNKNOWN;""!==re(e);)e.token+=re(e),ne(e);throw ze(e,'Syntax error in part "'+e.token+'"')}for(;j.isAlpha(re(e),ie(e),se(e))||j.isDigit(re(e));)e.token+=re(e),ne(e);(0,c.hasOwnProperty)(Z,e.token)?e.tokenType=q.DELIMITER:e.tokenType=q.SYMBOL}}function ae(e){do{oe(e)}while("\n"===e.token)}function le(e){e.nestingLevel++}function ce(e){e.nestingLevel--}function ue(e,t){const r={extraNodes:{},expression:"",comment:"",index:0,token:"",tokenType:q.NULL,nestingLevel:0,conditionalLevel:null};(0,i.default)(r,{expression:e,extraNodes:t}),oe(r);const n=function(e){let t;const r=[];let n;""!==e.token&&"\n"!==e.token&&";"!==e.token&&(t=de(e),e.comment&&(t.comment=e.comment));for(;"\n"===e.token||";"===e.token;)0===r.length&&t&&(n=";"!==e.token,r.push({node:t,visible:n})),oe(e),"\n"!==e.token&&";"!==e.token&&""!==e.token&&(t=de(e),e.comment&&(t.comment=e.comment),n=";"!==e.token,r.push({node:t,visible:n}));return r.length>0?new p(r):(t||(t=new f(void 0),e.comment&&(t.comment=e.comment)),t)}(r);if(""!==r.token)throw r.tokenType===q.DELIMITER?Ge(r,"Unexpected operator "+r.token):ze(r,'Unexpected part "'+r.token+'"');return n}function de(e){let t,r,n,i;const s=function(e){let t=function(e){let t=he(e);for(;"or"===e.token;)ae(e),t=new _("or","or",[t,he(e)]);return t}(e);for(;"?"===e.token;){const r=e.conditionalLevel;e.conditionalLevel=e.nestingLevel,ae(e);const n=t,i=de(e);if(":"!==e.token)throw ze(e,"False part of conditional expression expected");e.conditionalLevel=null,ae(e);const s=de(e);t=new m(n,i,s),e.conditionalLevel=r}return t}(e);if("="===e.token){if((0,o.isSymbolNode)(s))return t=s.name,ae(e),n=de(e),new h(new k(t),n);if((0,o.isAccessorNode)(s))return ae(e),n=de(e),new h(s.object,s.index,n);if((0,o.isFunctionNode)(s)&&(0,o.isSymbolNode)(s.fn)&&(i=!0,r=[],t=s.name,s.args.forEach((function(e,t){(0,o.isSymbolNode)(e)?r[t]=e.name:i=!1})),i))return ae(e),n=de(e),new g(t,r,n);throw ze(e,"Invalid left hand side of assignment operator =")}return s}function he(e){let t=pe(e);for(;"xor"===e.token;)ae(e),t=new _("xor","xor",[t,pe(e)]);return t}function pe(e){let t=me(e);for(;"and"===e.token;)ae(e),t=new _("and","and",[t,me(e)]);return t}function me(e){let t=fe(e);for(;"|"===e.token;)ae(e),t=new _("|","bitOr",[t,fe(e)]);return t}function fe(e){let t=ge(e);for(;"^|"===e.token;)ae(e),t=new _("^|","bitXor",[t,ge(e)]);return t}function ge(e){let t=ye(e);for(;"&"===e.token;)ae(e),t=new _("&","bitAnd",[t,ye(e)]);return t}function ye(e){const t=[be(e)],r=[],n={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};for(;(0,c.hasOwnProperty)(n,e.token);){const i={name:e.token,fn:n[e.token]};r.push(i),ae(e),t.push(be(e))}return 1===t.length?t[0]:2===t.length?new _(r[0].name,r[0].fn,t):new R(r.map((e=>e.fn)),t)}function be(e){let t,r,n,i;t=ve(e);const s={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};for(;(0,c.hasOwnProperty)(s,e.token);)r=e.token,n=s[r],ae(e),i=[t,ve(e)],t=new _(r,n,i);return t}function ve(e){let t,r,n,i;t=_e(e);const s={to:"to",in:"to"};for(;(0,c.hasOwnProperty)(s,e.token);)r=e.token,n=s[r],ae(e),"in"===r&&""===e.token?t=new _("*","multiply",[t,new k("in")],!0):(i=[t,_e(e)],t=new _(r,n,i));return t}function _e(e){let t;const r=[];if(t=":"===e.token?new f(1):xe(e),":"===e.token&&e.conditionalLevel!==e.nestingLevel){for(r.push(t);":"===e.token&&r.length<3;)ae(e),")"===e.token||"]"===e.token||","===e.token||""===e.token?r.push(new k("end")):r.push(xe(e));t=3===r.length?new w(r[0],r[2],r[1]):new w(r[0],r[1])}return t}function xe(e){let t,r,n,i;t=we(e);const s={"+":"add","-":"subtract"};for(;(0,c.hasOwnProperty)(s,e.token);){r=e.token,n=s[r],ae(e);const o=we(e);i=o.isPercentage?[t,new _("*","multiply",[t,o])]:[t,o],t=new _(r,n,i)}return t}function we(e){let t,r,n,i;t=Se(e),r=t;const s={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide"};for(;(0,c.hasOwnProperty)(s,e.token);)n=e.token,i=s[n],ae(e),r=Se(e),t=new _(n,i,[t,r]);return t}function Se(e){let t,r;for(t=Pe(e),r=t;e.tokenType===q.SYMBOL||"in"===e.token&&(0,o.isConstantNode)(t)||!(e.tokenType!==q.NUMBER||(0,o.isConstantNode)(r)||(0,o.isOperatorNode)(r)&&"!"!==r.op)||"("===e.token;)r=Pe(e),t=new _("*","multiply",[t,r],!0);return t}function Pe(e){let t=Te(e),r=t;const n=[];for(;"/"===e.token&&(0,o.rule2Node)(r);){if(n.push((0,i.default)({},e)),ae(e),e.tokenType!==q.NUMBER){(0,i.default)(e,n.pop());break}if(n.push((0,i.default)({},e)),ae(e),e.tokenType!==q.SYMBOL&&"("!==e.token){n.pop(),(0,i.default)(e,n.pop());break}(0,i.default)(e,n.pop()),n.pop(),r=Te(e),t=new _("/","divide",[t,r])}return t}function Te(e){let t,r,n,i;t=Re(e);const s={"%":"mod",mod:"mod"};for(;(0,c.hasOwnProperty)(s,e.token);)r=e.token,n=s[r],ae(e),"%"===r&&e.tokenType===q.DELIMITER&&"("!==e.token?t=new _("/","divide",[t,new f(100)],!1,!0):(i=[t,Re(e)],t=new _(r,n,i));return t}function Re(e){let t,i,s;const o={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return(0,c.hasOwnProperty)(o,e.token)?(s=o[e.token],t=e.token,ae(e),i=[Re(e)],new _(t,s,i)):function(e){let t,i,s,o;t=function(e){let t,i,s,o;t=function(e){let t=[];if(e.tokenType===q.SYMBOL&&(0,c.hasOwnProperty)(e.extraNodes,e.token)){const r=e.extraNodes[e.token];if(oe(e),"("===e.token){if(t=[],le(e),oe(e),")"!==e.token)for(t.push(de(e));","===e.token;)oe(e),t.push(de(e));if(")"!==e.token)throw ze(e,"Parenthesis ) expected");ce(e),oe(e)}return new r(t)}return function(e){let t,i;if(e.tokenType===q.SYMBOL||e.tokenType===q.DELIMITER&&e.token in Z)return i=e.token,oe(e),t=(0,c.hasOwnProperty)(X,i)?new f(X[i]):Y.includes(i)?new f(r(i,"number")):new k(i),t=ke(e,t),t;return function(e){let t,i;if('"'===e.token||"'"===e.token)return i=Ie(e,e.token),t=new f(i),t=ke(e,t),t;return function(e){let t,i,s,o;if("["===e.token){if(le(e),oe(e),"]"!==e.token){const r=je(e);if(";"===e.token){for(s=1,i=[r];";"===e.token;)oe(e),"]"!==e.token&&(i[s]=je(e),s++);if("]"!==e.token)throw ze(e,"End of matrix ] expected");ce(e),oe(e),o=i[0].items.length;for(let t=1;t<s;t++)if(i[t].items.length!==o)throw Ge(e,"Column dimensions mismatch ("+i[t].items.length+" !== "+o+")");t=new d(i)}else{if("]"!==e.token)throw ze(e,"End of matrix ] expected");ce(e),oe(e),t=r}}else ce(e),oe(e),t=new d([]);return ke(e,t)}return function(e){if("{"===e.token){let t;le(e);const r={};do{if(oe(e),"}"!==e.token){if('"'===e.token||"'"===e.token)t=Ie(e,e.token);else{if(!(e.tokenType===q.SYMBOL||e.tokenType===q.DELIMITER&&e.token in Z))throw ze(e,"Symbol or string expected as object key");t=e.token,oe(e)}if(":"!==e.token)throw ze(e,"Colon : expected after object key");oe(e),r[t]=de(e)}}while(","===e.token);if("}"!==e.token)throw ze(e,"Comma , or bracket } expected after object value");ce(e),oe(e);let n=new v(r);return n=ke(e,n),n}return function(e){let t;if(e.tokenType===q.NUMBER){t=e.token,oe(e);const i=(0,l.safeNumberType)(t,n),s=r(t,i);return new f(s)}return function(e){let t;if("("===e.token){if(le(e),oe(e),t=de(e),")"!==e.token)throw ze(e,"Parenthesis ) expected");return ce(e),oe(e),t=new x(t),t=ke(e,t),t}return function(e){throw""===e.token?ze(e,"Unexpected end of expression"):ze(e,"Value expected")}(e)}(e)}(e)}(e)}(e)}(e)}(e)}(e);const a={"!":"factorial","'":"ctranspose"};for(;(0,c.hasOwnProperty)(a,e.token);)i=e.token,s=a[i],oe(e),o=[t],t=new _(i,s,o),t=ke(e,t);return t}(e),("^"===e.token||".^"===e.token)&&(i=e.token,s="^"===i?"pow":"dotPow",ae(e),o=[t,Re(e)],t=new _(i,s,o));return t}(e)}function ke(e,t,r){let n;for(;("("===e.token||"["===e.token||"."===e.token)&&(!r||r.includes(e.token));)if(n=[],"("===e.token){if(!(0,o.isSymbolNode)(t)&&!(0,o.isAccessorNode)(t))return t;if(le(e),oe(e),")"!==e.token)for(n.push(de(e));","===e.token;)oe(e),n.push(de(e));if(")"!==e.token)throw ze(e,"Parenthesis ) expected");ce(e),oe(e),t=new y(t,n)}else if("["===e.token){if(le(e),oe(e),"]"!==e.token)for(n.push(de(e));","===e.token;)oe(e),n.push(de(e));if("]"!==e.token)throw ze(e,"Parenthesis ] expected");ce(e),oe(e),t=new s(t,new b(n))}else{oe(e);if(!(e.tokenType===q.SYMBOL||e.tokenType===q.DELIMITER&&e.token in Z))throw ze(e,"Property name expected after dot");n.push(new f(e.token)),oe(e);t=new s(t,new b(n,!0))}return t}function Ie(e,t){let r="";for(;""!==re(e)&&re(e)!==t;)if("\\"===re(e)){ne(e);const t=re(e),n=ee[t];if(void 0!==n)r+=n,e.index+=1;else{if("u"!==t)throw ze(e,`Bad escape character \\${t}`);{const t=e.expression.slice(e.index+1,e.index+5);if(!/^[0-9A-Fa-f]{4}$/.test(t))throw ze(e,`Invalid unicode character \\u${t}`);r+=String.fromCharCode(parseInt(t,16)),e.index+=5}}}else r+=re(e),ne(e);if(oe(e),e.token!==t)throw ze(e,`End of string ${t} expected`);return oe(e),r}function je(e){const t=[de(e)];let r=1;for(;","===e.token;)oe(e),"]"!==e.token&&";"!==e.token&&(t[r]=de(e),r++);return new d(t)}function He(e){return e.index-e.token.length+1}function ze(e,t){const r=He(e),n=new SyntaxError(t+" (char "+r+")");return n.char=r,n}function Ge(e,t){const r=He(e),n=new SyntaxError(t+" (char "+r+")");return n.char=r,n}return j.isAlpha=function(e,t,r){return j.isValidLatinOrGreek(e)||j.isValidMathSymbol(e,r)||j.isValidMathSymbol(t,e)},j.isValidLatinOrGreek=function(e){return/^[a-zA-Z_$\u00C0-\u02AF\u0370-\u03FF\u2100-\u214F]$/.test(e)},j.isValidMathSymbol=function(e,t){return/^[\uD835]$/.test(e)&&/^[\uDC00-\uDFFF]$/.test(t)&&/^[^\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]$/.test(t)},j.isWhitespace=function(e,t){return" "===e||"\t"===e||"\n"===e&&t>0},j.isDecimalMark=function(e,t){return"."===e&&"/"!==t&&"*"!==t&&"^"!==t},j.isDigitDot=function(e){return e>="0"&&e<="9"||"."===e},j.isDigit=function(e){return e>="0"&&e<="9"},j.isHexDigit=function(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"},t.addConversion({from:"string",to:"Node",convert:j}),j}))},66603:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAndTransform=void 0;var n=r(91732),i=r(66212),s=r(91612);const o=["typed","matrix","zeros","add","equalScalar","not","concat"];t.createAndTransform=(0,i.factory)("and",o,(e=>{let{typed:t,matrix:r,equalScalar:i,zeros:o,not:a,concat:l}=e;const c=(0,n.createAnd)({typed:t,matrix:r,equalScalar:i,zeros:o,not:a,concat:l});function u(e,t,r){const n=e[0].compile().evaluate(r);if(!(0,s.isCollection)(n)&&!c(n,!0))return!1;const i=e[1].compile().evaluate(r);return c(n,i)}return u.rawArgs=!0,u}),{isTransformFunction:!0})},69682:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createApplyTransform=void 0;var n=r(88990),i=r(66212),s=r(92595),o=r(91612);const a=["typed","isInteger"];t.createApplyTransform=(0,i.factory)("apply",a,(e=>{let{typed:t,isInteger:r}=e;const i=(0,s.createApply)({typed:t,isInteger:r});return t("apply",{"...any":function(e){const t=e[1];(0,o.isNumber)(t)?e[1]=t-1:(0,o.isBigNumber)(t)&&(e[1]=t.minus(1));try{return i.apply(null,e)}catch(e){throw(0,n.errorTransform)(e)}}})}),{isTransformFunction:!0})},97472:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createBitAndTransform=void 0;var n=r(97765),i=r(66212),s=r(91612);const o=["typed","matrix","zeros","add","equalScalar","not","concat"];t.createBitAndTransform=(0,i.factory)("bitAnd",o,(e=>{let{typed:t,matrix:r,equalScalar:i,zeros:o,not:a,concat:l}=e;const c=(0,n.createBitAnd)({typed:t,matrix:r,equalScalar:i,zeros:o,not:a,concat:l});function u(e,t,r){const n=e[0].compile().evaluate(r);if(!(0,s.isCollection)(n)){if(isNaN(n))return NaN;if(0===n||!1===n)return 0}const i=e[1].compile().evaluate(r);return c(n,i)}return u.rawArgs=!0,u}),{isTransformFunction:!0})},49612:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createBitOrTransform=void 0;var n=r(39439),i=r(66212),s=r(91612);const o=["typed","matrix","equalScalar","DenseMatrix","concat"];t.createBitOrTransform=(0,i.factory)("bitOr",o,(e=>{let{typed:t,matrix:r,equalScalar:i,DenseMatrix:o,concat:a}=e;const l=(0,n.createBitOr)({typed:t,matrix:r,equalScalar:i,DenseMatrix:o,concat:a});function c(e,t,r){const n=e[0].compile().evaluate(r);if(!(0,s.isCollection)(n)){if(isNaN(n))return NaN;if(-1===n)return-1;if(!0===n)return 1}const i=e[1].compile().evaluate(r);return l(n,i)}return c.rawArgs=!0,c}),{isTransformFunction:!0})},16926:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createColumnTransform=void 0;var n=r(88990),i=r(66212),s=r(72669),o=r(91612);const a=["typed","Index","matrix","range"];t.createColumnTransform=(0,i.factory)("column",a,(e=>{let{typed:t,Index:r,matrix:i,range:a}=e;const l=(0,s.createColumn)({typed:t,Index:r,matrix:i,range:a});return t("column",{"...any":function(e){const t=e.length-1,r=e[t];(0,o.isNumber)(r)&&(e[t]=r-1);try{return l.apply(null,e)}catch(e){throw(0,n.errorTransform)(e)}}})}),{isTransformFunction:!0})},69868:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createConcatTransform=void 0;var n=r(91612),i=r(88990),s=r(66212),o=r(52359);const a=["typed","matrix","isInteger"];t.createConcatTransform=(0,s.factory)("concat",a,(e=>{let{typed:t,matrix:r,isInteger:s}=e;const a=(0,o.createConcat)({typed:t,matrix:r,isInteger:s});return t("concat",{"...any":function(e){const t=e.length-1,r=e[t];(0,n.isNumber)(r)?e[t]=r-1:(0,n.isBigNumber)(r)&&(e[t]=r.minus(1));try{return a.apply(null,e)}catch(e){throw(0,i.errorTransform)(e)}}})}),{isTransformFunction:!0})},17722:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCumSumTransform=void 0;var n=r(91612),i=r(66212),s=r(88990),o=r(54131);const a="cumsum",l=["typed","add","unaryPlus"];t.createCumSumTransform=(0,i.factory)(a,l,(e=>{let{typed:t,add:r,unaryPlus:i}=e;const l=(0,o.createCumSum)({typed:t,add:r,unaryPlus:i});return t(a,{"...any":function(e){if(2===e.length&&(0,n.isCollection)(e[0])){const t=e[1];(0,n.isNumber)(t)?e[1]=t-1:(0,n.isBigNumber)(t)&&(e[1]=t.minus(1))}try{return l.apply(null,e)}catch(e){throw(0,s.errorTransform)(e)}}})}),{isTransformFunction:!0})},33879:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDiffTransform=void 0;var n=r(66212),i=r(88990),s=r(20948),o=r(49506);const a="diff",l=["typed","matrix","subtract","number","bignumber"];t.createDiffTransform=(0,n.factory)(a,l,(e=>{let{typed:t,matrix:r,subtract:n,number:l,bignumber:c}=e;const u=(0,s.createDiff)({typed:t,matrix:r,subtract:n,number:l,bignumber:c});return t(a,{"...any":function(e){e=(0,o.lastDimToZeroBase)(e);try{return u.apply(null,e)}catch(e){throw(0,i.errorTransform)(e)}}})}),{isTransformFunction:!0})},57702:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createFilterTransform=void 0;var n=r(68457),i=r(34487),s=r(66212),o=r(91612),a=r(65576);const l=["typed"];t.createFilterTransform=(0,s.factory)("filter",l,(e=>{let{typed:t}=e;function r(e,t,r){let i,s;return e[0]&&(i=e[0].compile().evaluate(r)),e[1]&&(s=(0,o.isSymbolNode)(e[1])||(0,o.isFunctionAssignmentNode)(e[1])?e[1].compile().evaluate(r):(0,a.compileInlineExpression)(e[1],t,r)),n(i,s)}r.rawArgs=!0;const n=t("filter",{"Array, function":c,"Matrix, function":function(e,t){return e.create(c(e.toArray(),t),e.datatype())},"Array, RegExp":i.filterRegExp,"Matrix, RegExp":function(e,t){return e.create((0,i.filterRegExp)(e.toArray(),t),e.datatype())}});return r}),{isTransformFunction:!0});function c(e,t){return(0,i.filter)(e,(function(e,r,i){return(0,n.applyCallback)(t,e,[r+1],i,"filter")}))}},73704:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createForEachTransform=void 0;var n=r(68457),i=r(34487),s=r(66212),o=r(91612),a=r(65576);const l=["typed"];t.createForEachTransform=(0,s.factory)("forEach",l,(e=>{let{typed:t}=e;function r(e,t,r){let n,i;return e[0]&&(n=e[0].compile().evaluate(r)),e[1]&&(i=(0,o.isSymbolNode)(e[1])||(0,o.isFunctionAssignmentNode)(e[1])?e[1].compile().evaluate(r):(0,a.compileInlineExpression)(e[1],t,r)),s(n,i)}r.rawArgs=!0;const s=t("forEach",{"Array | Matrix, function":function(e,t){const r=function(s,o){if(!Array.isArray(s))return(0,n.applyCallback)(t,s,o,e,"forEach");(0,i.forEach)(s,(function(e,t){r(e,o.concat(t+1))}))};r(e.valueOf(),[])}});return r}),{isTransformFunction:!0})},43922:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createIndexTransform=void 0;var n=r(91612),i=r(66212);const s=["Index","getMatrixDataType"];t.createIndexTransform=(0,i.factory)("index",s,(e=>{let{Index:t,getMatrixDataType:r}=e;return function(){const e=[];for(let t=0,i=arguments.length;t<i;t++){let i=arguments[t];if((0,n.isRange)(i))i.start--,i.end-=i.step>0?0:2;else if(i&&!0===i.isSet)i=i.map((function(e){return e-1}));else if((0,n.isArray)(i)||(0,n.isMatrix)(i))"boolean"!==r(i)&&(i=i.map((function(e){return e-1})));else if((0,n.isNumber)(i))i--;else if((0,n.isBigNumber)(i))i=i.toNumber()-1;else if("string"!=typeof i)throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");e[t]=i}const i=new t;return t.apply(i,e),i}}),{isTransformFunction:!0})},23024:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMapTransform=void 0;var n=r(66212),i=r(91612),s=r(15177),o=r(65576);const a=["typed"];t.createMapTransform=(0,n.factory)("map",a,(e=>{let{typed:t}=e;const r=(0,s.createMap)({typed:t});function n(e,n,s){if(0===e.length)return r();if(1===e.length)return r(e[0]);const c=e.length-1;let u,d;return d=e[c],u=e.slice(0,c),u=u.map((e=>h(e,s))),d&&(d=(0,i.isSymbolNode)(d)||(0,i.isFunctionAssignmentNode)(d)?h(d,s):(0,o.compileInlineExpression)(d,n,s)),r(...u,function(e,r){return t.isTypedFunction(e)?a(e,r):l(e,e.length,r)}(d,c));function h(e,t){return e.compile().evaluate(t)}}return n.rawArgs=!0,n;function a(e,r){const n=Object.fromEntries(Object.entries(e.signatures).map((e=>{let[n,i]=e;const s=n.split(",").length;return t.isTypedFunction(i)?[n,a(i,r)]:[n,l(i,s,r)]})));return"string"==typeof e.name?t(e.name,n):t(n)}}),{isTransformFunction:!0});function l(e,t,r){return t===r?e:t===r+1?function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];const s=n.slice(0,r),o=c(n[r]);return e(...s,o)}:t>r+1?function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];const s=n.slice(0,r),o=c(n[r]),a=n.slice(r+1);return e(...s,o,...a)}:e}function c(e){return e.map((e=>e.isBigNumber?e.plus(1):e+1))}},50504:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMaxTransform=void 0;var n=r(66212),i=r(88990),s=r(79343),o=r(49506);const a=["typed","config","numeric","larger"];t.createMaxTransform=(0,n.factory)("max",a,(e=>{let{typed:t,config:r,numeric:n,larger:a}=e;const l=(0,s.createMax)({typed:t,config:r,numeric:n,larger:a});return t("max",{"...any":function(e){e=(0,o.lastDimToZeroBase)(e);try{return l.apply(null,e)}catch(e){throw(0,i.errorTransform)(e)}}})}),{isTransformFunction:!0})},98337:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMeanTransform=void 0;var n=r(66212),i=r(88990),s=r(4656),o=r(49506);const a=["typed","add","divide"];t.createMeanTransform=(0,n.factory)("mean",a,(e=>{let{typed:t,add:r,divide:n}=e;const a=(0,s.createMean)({typed:t,add:r,divide:n});return t("mean",{"...any":function(e){e=(0,o.lastDimToZeroBase)(e);try{return a.apply(null,e)}catch(e){throw(0,i.errorTransform)(e)}}})}),{isTransformFunction:!0})},16174:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMinTransform=void 0;var n=r(66212),i=r(88990),s=r(93781),o=r(49506);const a=["typed","config","numeric","smaller"];t.createMinTransform=(0,n.factory)("min",a,(e=>{let{typed:t,config:r,numeric:n,smaller:a}=e;const l=(0,s.createMin)({typed:t,config:r,numeric:n,smaller:a});return t("min",{"...any":function(e){e=(0,o.lastDimToZeroBase)(e);try{return l.apply(null,e)}catch(e){throw(0,i.errorTransform)(e)}}})}),{isTransformFunction:!0})},27633:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createOrTransform=void 0;var n=r(98456),i=r(66212),s=r(91612);const o=["typed","matrix","equalScalar","DenseMatrix","concat"];t.createOrTransform=(0,i.factory)("or",o,(e=>{let{typed:t,matrix:r,equalScalar:i,DenseMatrix:o,concat:a}=e;const l=(0,n.createOr)({typed:t,matrix:r,equalScalar:i,DenseMatrix:o,concat:a});function c(e,t,r){const n=e[0].compile().evaluate(r);if(!(0,s.isCollection)(n)&&l(n,!1))return!0;const i=e[1].compile().evaluate(r);return l(n,i)}return c.rawArgs=!0,c}),{isTransformFunction:!0})},37597:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createPrintTransform=void 0;var n=r(43160),i=r(66212),s=r(34933);const o="print",a=["typed","matrix","zeros","add"];t.createPrintTransform=(0,i.factory)(o,a,(e=>{let{typed:t,matrix:r,zeros:i,add:a}=e;const l=(0,n.createPrint)({typed:t,matrix:r,zeros:i,add:a});return t(o,{"string, Object | Array":function(e,t){return l(c(e),t)},"string, Object | Array, number | Object":function(e,t,r){return l(c(e),t,r)}});function c(e){return e.replace(s.printTemplate,(e=>"$"+e.slice(1).split(".").map((function(e){return!isNaN(e)&&e.length>0?parseInt(e)-1:e})).join(".")))}}),{isTransformFunction:!0})},3874:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createQuantileSeqTransform=void 0;var n=r(66212),i=r(83933),s=r(49506);const o=["typed","bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"];t.createQuantileSeqTransform=(0,n.factory)("quantileSeq",o,(e=>{let{typed:t,bignumber:r,add:n,subtract:o,divide:a,multiply:l,partitionSelect:c,compare:u,isInteger:d,smaller:h,smallerEq:p,larger:m}=e;const f=(0,i.createQuantileSeq)({typed:t,bignumber:r,add:n,subtract:o,divide:a,multiply:l,partitionSelect:c,compare:u,isInteger:d,smaller:h,smallerEq:p,larger:m});return t("quantileSeq",{"Array | Matrix, number | BigNumber":f,"Array | Matrix, number | BigNumber, number":(e,t,r)=>f(e,t,g(r)),"Array | Matrix, number | BigNumber, boolean":f,"Array | Matrix, number | BigNumber, boolean, number":(e,t,r,n)=>f(e,t,r,g(n)),"Array | Matrix, Array | Matrix":f,"Array | Matrix, Array | Matrix, number":(e,t,r)=>f(e,t,g(r)),"Array | Matrix, Array | Matrix, boolean":f,"Array | Matrix, Array | Matrix, boolean, number":(e,t,r,n)=>f(e,t,r,g(n))});function g(e){return(0,s.lastDimToZeroBase)([[],e])[1]}}),{isTransformFunction:!0})},54903:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRangeTransform=void 0;var n=r(66212),i=r(36542);const s=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"];t.createRangeTransform=(0,n.factory)("range",s,(e=>{let{typed:t,config:r,matrix:n,bignumber:s,smaller:o,smallerEq:a,larger:l,largerEq:c,add:u,isPositive:d}=e;const h=(0,i.createRange)({typed:t,config:r,matrix:n,bignumber:s,smaller:o,smallerEq:a,larger:l,largerEq:c,add:u,isPositive:d});return t("range",{"...any":function(e){return"boolean"!=typeof e[e.length-1]&&e.push(!0),h.apply(null,e)}})}),{isTransformFunction:!0})},29306:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRowTransform=void 0;var n=r(66212),i=r(45515),s=r(88990),o=r(91612);const a=["typed","Index","matrix","range"];t.createRowTransform=(0,n.factory)("row",a,(e=>{let{typed:t,Index:r,matrix:n,range:a}=e;const l=(0,i.createRow)({typed:t,Index:r,matrix:n,range:a});return t("row",{"...any":function(e){const t=e.length-1,r=e[t];(0,o.isNumber)(r)&&(e[t]=r-1);try{return l.apply(null,e)}catch(e){throw(0,s.errorTransform)(e)}}})}),{isTransformFunction:!0})},34207:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createStdTransform=void 0;var n=r(66212),i=r(94620),s=r(88990),o=r(49506);const a=["typed","map","sqrt","variance"];t.createStdTransform=(0,n.factory)("std",a,(e=>{let{typed:t,map:r,sqrt:n,variance:a}=e;const l=(0,i.createStd)({typed:t,map:r,sqrt:n,variance:a});return t("std",{"...any":function(e){e=(0,o.lastDimToZeroBase)(e);try{return l.apply(null,e)}catch(e){throw(0,s.errorTransform)(e)}}})}),{isTransformFunction:!0})},48322:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSubsetTransform=void 0;var n=r(66212),i=r(88990),s=r(68933);const o=["typed","matrix","zeros","add"];t.createSubsetTransform=(0,n.factory)("subset",o,(e=>{let{typed:t,matrix:r,zeros:n,add:o}=e;const a=(0,s.createSubset)({typed:t,matrix:r,zeros:n,add:o});return t("subset",{"...any":function(e){try{return a.apply(null,e)}catch(e){throw(0,i.errorTransform)(e)}}})}),{isTransformFunction:!0})},49949:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSumTransform=void 0;var n=r(66212),i=r(88990),s=r(40850),o=r(49506);const a=["typed","config","add","numeric"];t.createSumTransform=(0,n.factory)("sum",a,(e=>{let{typed:t,config:r,add:n,numeric:a}=e;const l=(0,s.createSum)({typed:t,config:r,add:n,numeric:a});return t("sum",{"...any":function(e){e=(0,o.lastDimToZeroBase)(e);try{return l.apply(null,e)}catch(e){throw(0,i.errorTransform)(e)}}})}),{isTransformFunction:!0})},65576:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compileInlineExpression=function(e,t,r){const s=e.filter((function(e){return(0,n.isSymbolNode)(e)&&!(e.name in t)&&!r.has(e.name)}))[0];if(!s)throw new Error('No undefined variable found in inline expression "'+e+'"');const o=s.name,a=new Map,l=new i.PartitionedMap(r,a,new Set([o])),c=e.compile();return function(e){return a.set(o,e),c.evaluate(l)}};var n=r(91612),i=r(81072)},77650:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dimToZeroBase=function(e){return(0,n.isNumber)(e)?e-1:(0,n.isBigNumber)(e)?e.minus(1):e},t.isNumberOrBigNumber=function(e){return(0,n.isNumber)(e)||(0,n.isBigNumber)(e)};var n=r(91612)},88990:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorTransform=function(e){if(e&&e.isIndexError)return new n.IndexError(e.index+1,e.min+1,void 0!==e.max?e.max+1:void 0);return e};var n=r(17967)},49506:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lastDimToZeroBase=function(e){if(2===e.length&&(0,n.isCollection)(e[0])){const t=(e=e.slice())[1];(0,i.isNumberOrBigNumber)(t)&&(e[1]=(0,i.dimToZeroBase)(t))}return e};var n=r(91612),i=r(77650)},59411:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createVarianceTransform=void 0;var n=r(66212),i=r(88990),s=r(22058),o=r(49506);const a="variance",l=["typed","add","subtract","multiply","divide","apply","isNaN"];t.createVarianceTransform=(0,n.factory)(a,l,(e=>{let{typed:t,add:r,subtract:n,multiply:l,divide:c,apply:u,isNaN:d}=e;const h=(0,s.createVariance)({typed:t,add:r,subtract:n,multiply:l,divide:c,apply:u,isNaN:d});return t(a,{"...any":function(e){e=(0,o.lastDimToZeroBase)(e);try{return h.apply(null,e)}catch(e){throw(0,i.errorTransform)(e)}}})}),{isTransformFunction:!0})},62882:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createAbs",{enumerable:!0,get:function(){return ie.createAbs}}),Object.defineProperty(t,"createAccessorNode",{enumerable:!0,get:function(){return gn.createAccessorNode}}),Object.defineProperty(t,"createAcos",{enumerable:!0,get:function(){return Cr.createAcos}}),Object.defineProperty(t,"createAcosh",{enumerable:!0,get:function(){return Ar.createAcosh}}),Object.defineProperty(t,"createAcot",{enumerable:!0,get:function(){return Tr.createAcot}}),Object.defineProperty(t,"createAcoth",{enumerable:!0,get:function(){return Dr.createAcoth}}),Object.defineProperty(t,"createAcsc",{enumerable:!0,get:function(){return Or.createAcsc}}),Object.defineProperty(t,"createAcsch",{enumerable:!0,get:function(){return Rr.createAcsch}}),Object.defineProperty(t,"createAdd",{enumerable:!0,get:function(){return cn.createAdd}}),Object.defineProperty(t,"createAddScalar",{enumerable:!0,get:function(){return oe.createAddScalar}}),Object.defineProperty(t,"createAnd",{enumerable:!0,get:function(){return nr.createAnd}}),Object.defineProperty(t,"createAndTransform",{enumerable:!0,get:function(){return ws.createAndTransform}}),Object.defineProperty(t,"createApply",{enumerable:!0,get:function(){return se.createApply}}),Object.defineProperty(t,"createApplyTransform",{enumerable:!0,get:function(){return rs.createApplyTransform}}),Object.defineProperty(t,"createArg",{enumerable:!0,get:function(){return Ve.createArg}}),Object.defineProperty(t,"createArrayNode",{enumerable:!0,get:function(){return yn.createArrayNode}}),Object.defineProperty(t,"createAsec",{enumerable:!0,get:function(){return Lr.createAsec}}),Object.defineProperty(t,"createAsech",{enumerable:!0,get:function(){return kr.createAsech}}),Object.defineProperty(t,"createAsin",{enumerable:!0,get:function(){return Nr.createAsin}}),Object.defineProperty(t,"createAsinh",{enumerable:!0,get:function(){return Fr.createAsinh}}),Object.defineProperty(t,"createAssignmentNode",{enumerable:!0,get:function(){return bn.createAssignmentNode}}),Object.defineProperty(t,"createAtan",{enumerable:!0,get:function(){return Ir.createAtan}}),Object.defineProperty(t,"createAtan2",{enumerable:!0,get:function(){return Br.createAtan2}}),Object.defineProperty(t,"createAtanh",{enumerable:!0,get:function(){return jr.createAtanh}}),Object.defineProperty(t,"createAtomicMass",{enumerable:!0,get:function(){return ts.createAtomicMass}}),Object.defineProperty(t,"createAvogadro",{enumerable:!0,get:function(){return ts.createAvogadro}}),Object.defineProperty(t,"createBellNumbers",{enumerable:!0,get:function(){return Ci.createBellNumbers}}),Object.defineProperty(t,"createBigNumberClass",{enumerable:!0,get:function(){return s.createBigNumberClass}}),Object.defineProperty(t,"createBigint",{enumerable:!0,get:function(){return R.createBigint}}),Object.defineProperty(t,"createBignumber",{enumerable:!0,get:function(){return z.createBignumber}}),Object.defineProperty(t,"createBin",{enumerable:!0,get:function(){return Nt.createBin}}),Object.defineProperty(t,"createBitAnd",{enumerable:!0,get:function(){return He.createBitAnd}}),Object.defineProperty(t,"createBitAndTransform",{enumerable:!0,get:function(){return Ps.createBitAndTransform}}),Object.defineProperty(t,"createBitNot",{enumerable:!0,get:function(){return ze.createBitNot}}),Object.defineProperty(t,"createBitOr",{enumerable:!0,get:function(){return Ge.createBitOr}}),Object.defineProperty(t,"createBitOrTransform",{enumerable:!0,get:function(){return Es.createBitOrTransform}}),Object.defineProperty(t,"createBitXor",{enumerable:!0,get:function(){return We.createBitXor}}),Object.defineProperty(t,"createBlockNode",{enumerable:!0,get:function(){return vn.createBlockNode}}),Object.defineProperty(t,"createBohrMagneton",{enumerable:!0,get:function(){return ts.createBohrMagneton}}),Object.defineProperty(t,"createBohrRadius",{enumerable:!0,get:function(){return ts.createBohrRadius}}),Object.defineProperty(t,"createBoltzmann",{enumerable:!0,get:function(){return ts.createBoltzmann}}),Object.defineProperty(t,"createBoolean",{enumerable:!0,get:function(){return j.createBoolean}}),Object.defineProperty(t,"createCatalan",{enumerable:!0,get:function(){return Ti.createCatalan}}),Object.defineProperty(t,"createCbrt",{enumerable:!0,get:function(){return le.createCbrt}}),Object.defineProperty(t,"createCeil",{enumerable:!0,get:function(){return ce.createCeil}}),Object.defineProperty(t,"createChain",{enumerable:!0,get:function(){return Wn.createChain}}),Object.defineProperty(t,"createChainClass",{enumerable:!0,get:function(){return zn.createChainClass}}),Object.defineProperty(t,"createClassicalElectronRadius",{enumerable:!0,get:function(){return ts.createClassicalElectronRadius}}),Object.defineProperty(t,"createClone",{enumerable:!0,get:function(){return d.createClone}}),Object.defineProperty(t,"createColumn",{enumerable:!0,get:function(){return rt.createColumn}}),Object.defineProperty(t,"createColumnTransform",{enumerable:!0,get:function(){return ns.createColumnTransform}}),Object.defineProperty(t,"createCombinations",{enumerable:!0,get:function(){return hi.createCombinations}}),Object.defineProperty(t,"createCombinationsWithRep",{enumerable:!0,get:function(){return pi.createCombinationsWithRep}}),Object.defineProperty(t,"createCompare",{enumerable:!0,get:function(){return ir.createCompare}}),Object.defineProperty(t,"createCompareNatural",{enumerable:!0,get:function(){return sr.createCompareNatural}}),Object.defineProperty(t,"createCompareText",{enumerable:!0,get:function(){return or.createCompareText}}),Object.defineProperty(t,"createCompile",{enumerable:!0,get:function(){return Rn.createCompile}}),Object.defineProperty(t,"createComplex",{enumerable:!0,get:function(){return q.createComplex}}),Object.defineProperty(t,"createComplexClass",{enumerable:!0,get:function(){return o.createComplexClass}}),Object.defineProperty(t,"createComposition",{enumerable:!0,get:function(){return Di.createComposition}}),Object.defineProperty(t,"createConcat",{enumerable:!0,get:function(){return tt.createConcat}}),Object.defineProperty(t,"createConcatTransform",{enumerable:!0,get:function(){return ms.createConcatTransform}}),Object.defineProperty(t,"createConditionalNode",{enumerable:!0,get:function(){return _n.createConditionalNode}}),Object.defineProperty(t,"createConductanceQuantum",{enumerable:!0,get:function(){return ts.createConductanceQuantum}}),Object.defineProperty(t,"createConj",{enumerable:!0,get:function(){return qe.createConj}}),Object.defineProperty(t,"createConstantNode",{enumerable:!0,get:function(){return xn.createConstantNode}}),Object.defineProperty(t,"createCorr",{enumerable:!0,get:function(){return di.createCorr}}),Object.defineProperty(t,"createCos",{enumerable:!0,get:function(){return Hr.createCos}}),Object.defineProperty(t,"createCosh",{enumerable:!0,get:function(){return Ur.createCosh}}),Object.defineProperty(t,"createCot",{enumerable:!0,get:function(){return zr.createCot}}),Object.defineProperty(t,"createCoth",{enumerable:!0,get:function(){return Gr.createCoth}}),Object.defineProperty(t,"createCoulomb",{enumerable:!0,get:function(){return ts.createCoulomb}}),Object.defineProperty(t,"createCount",{enumerable:!0,get:function(){return nt.createCount}}),Object.defineProperty(t,"createCreateUnit",{enumerable:!0,get:function(){return Mr.createCreateUnit}}),Object.defineProperty(t,"createCross",{enumerable:!0,get:function(){return it.createCross}}),Object.defineProperty(t,"createCsc",{enumerable:!0,get:function(){return Wr.createCsc}}),Object.defineProperty(t,"createCsch",{enumerable:!0,get:function(){return Vr.createCsch}}),Object.defineProperty(t,"createCtranspose",{enumerable:!0,get:function(){return Et.createCtranspose}}),Object.defineProperty(t,"createCube",{enumerable:!0,get:function(){return ue.createCube}}),Object.defineProperty(t,"createCumSum",{enumerable:!0,get:function(){return ii.createCumSum}}),Object.defineProperty(t,"createCumSumTransform",{enumerable:!0,get:function(){return vs.createCumSumTransform}}),Object.defineProperty(t,"createDeepEqual",{enumerable:!0,get:function(){return pr.createDeepEqual}}),Object.defineProperty(t,"createDenseMatrixClass",{enumerable:!0,get:function(){return u.createDenseMatrixClass}}),Object.defineProperty(t,"createDerivative",{enumerable:!0,get:function(){return Ui.createDerivative}}),Object.defineProperty(t,"createDet",{enumerable:!0,get:function(){return Vn.createDet}}),Object.defineProperty(t,"createDeuteronMass",{enumerable:!0,get:function(){return ts.createDeuteronMass}}),Object.defineProperty(t,"createDiag",{enumerable:!0,get:function(){return st.createDiag}}),Object.defineProperty(t,"createDiff",{enumerable:!0,get:function(){return pt.createDiff}}),Object.defineProperty(t,"createDiffTransform",{enumerable:!0,get:function(){return fs.createDiffTransform}}),Object.defineProperty(t,"createDistance",{enumerable:!0,get:function(){return ti.createDistance}}),Object.defineProperty(t,"createDivide",{enumerable:!0,get:function(){return ei.createDivide}}),Object.defineProperty(t,"createDivideScalar",{enumerable:!0,get:function(){return zt.createDivideScalar}}),Object.defineProperty(t,"createDot",{enumerable:!0,get:function(){return hn.createDot}}),Object.defineProperty(t,"createDotDivide",{enumerable:!0,get:function(){return Kt.createDotDivide}}),Object.defineProperty(t,"createDotMultiply",{enumerable:!0,get:function(){return je.createDotMultiply}}),Object.defineProperty(t,"createDotPow",{enumerable:!0,get:function(){return Zt.createDotPow}}),Object.defineProperty(t,"createE",{enumerable:!0,get:function(){return es.createE}}),Object.defineProperty(t,"createEfimovFactor",{enumerable:!0,get:function(){return ts.createEfimovFactor}}),Object.defineProperty(t,"createEigs",{enumerable:!0,get:function(){return Zn.createEigs}}),Object.defineProperty(t,"createElectricConstant",{enumerable:!0,get:function(){return ts.createElectricConstant}}),Object.defineProperty(t,"createElectronMass",{enumerable:!0,get:function(){return ts.createElectronMass}}),Object.defineProperty(t,"createElementaryCharge",{enumerable:!0,get:function(){return ts.createElementaryCharge}}),Object.defineProperty(t,"createEqual",{enumerable:!0,get:function(){return ar.createEqual}}),Object.defineProperty(t,"createEqualScalar",{enumerable:!0,get:function(){return _.createEqualScalar}}),Object.defineProperty(t,"createEqualText",{enumerable:!0,get:function(){return lr.createEqualText}}),Object.defineProperty(t,"createErf",{enumerable:!0,get:function(){return Dt.createErf}}),Object.defineProperty(t,"createEvaluate",{enumerable:!0,get:function(){return Ln.createEvaluate}}),Object.defineProperty(t,"createExp",{enumerable:!0,get:function(){return de.createExp}}),Object.defineProperty(t,"createExpm",{enumerable:!0,get:function(){return Kn.createExpm}}),Object.defineProperty(t,"createExpm1",{enumerable:!0,get:function(){return he.createExpm1}}),Object.defineProperty(t,"createFactorial",{enumerable:!0,get:function(){return gi.createFactorial}}),Object.defineProperty(t,"createFalse",{enumerable:!0,get:function(){return es.createFalse}}),Object.defineProperty(t,"createFaraday",{enumerable:!0,get:function(){return ts.createFaraday}}),Object.defineProperty(t,"createFermiCoupling",{enumerable:!0,get:function(){return ts.createFermiCoupling}}),Object.defineProperty(t,"createFft",{enumerable:!0,get:function(){return Ct.createFft}}),Object.defineProperty(t,"createFibonacciHeapClass",{enumerable:!0,get:function(){return xr.createFibonacciHeapClass}}),Object.defineProperty(t,"createFilter",{enumerable:!0,get:function(){return ot.createFilter}}),Object.defineProperty(t,"createFilterTransform",{enumerable:!0,get:function(){return is.createFilterTransform}}),Object.defineProperty(t,"createFineStructure",{enumerable:!0,get:function(){return ts.createFineStructure}}),Object.defineProperty(t,"createFirstRadiation",{enumerable:!0,get:function(){return ts.createFirstRadiation}}),Object.defineProperty(t,"createFix",{enumerable:!0,get:function(){return pe.createFix}}),Object.defineProperty(t,"createFlatten",{enumerable:!0,get:function(){return at.createFlatten}}),Object.defineProperty(t,"createFloor",{enumerable:!0,get:function(){return me.createFloor}}),Object.defineProperty(t,"createForEach",{enumerable:!0,get:function(){return lt.createForEach}}),Object.defineProperty(t,"createForEachTransform",{enumerable:!0,get:function(){return ss.createForEachTransform}}),Object.defineProperty(t,"createFormat",{enumerable:!0,get:function(){return kt.createFormat}}),Object.defineProperty(t,"createFraction",{enumerable:!0,get:function(){return $.createFraction}}),Object.defineProperty(t,"createFractionClass",{enumerable:!0,get:function(){return a.createFractionClass}}),Object.defineProperty(t,"createFreqz",{enumerable:!0,get:function(){return $i.createFreqz}}),Object.defineProperty(t,"createFunctionAssignmentNode",{enumerable:!0,get:function(){return wn.createFunctionAssignmentNode}}),Object.defineProperty(t,"createFunctionNode",{enumerable:!0,get:function(){return Dn.createFunctionNode}}),Object.defineProperty(t,"createGamma",{enumerable:!0,get:function(){return mi.createGamma}}),Object.defineProperty(t,"createGasConstant",{enumerable:!0,get:function(){return ts.createGasConstant}}),Object.defineProperty(t,"createGcd",{enumerable:!0,get:function(){return fe.createGcd}}),Object.defineProperty(t,"createGetMatrixDataType",{enumerable:!0,get:function(){return ct.createGetMatrixDataType}}),Object.defineProperty(t,"createGravitationConstant",{enumerable:!0,get:function(){return ts.createGravitationConstant}}),Object.defineProperty(t,"createGravity",{enumerable:!0,get:function(){return ts.createGravity}}),Object.defineProperty(t,"createHartreeEnergy",{enumerable:!0,get:function(){return ts.createHartreeEnergy}}),Object.defineProperty(t,"createHasNumericValue",{enumerable:!0,get:function(){return f.createHasNumericValue}}),Object.defineProperty(t,"createHelp",{enumerable:!0,get:function(){return Gn.createHelp}}),Object.defineProperty(t,"createHelpClass",{enumerable:!0,get:function(){return Un.createHelpClass}}),Object.defineProperty(t,"createHex",{enumerable:!0,get:function(){return It.createHex}}),Object.defineProperty(t,"createHypot",{enumerable:!0,get:function(){return un.createHypot}}),Object.defineProperty(t,"createI",{enumerable:!0,get:function(){return es.createI}}),Object.defineProperty(t,"createIdentity",{enumerable:!0,get:function(){return ut.createIdentity}}),Object.defineProperty(t,"createIfft",{enumerable:!0,get:function(){return At.createIfft}}),Object.defineProperty(t,"createIm",{enumerable:!0,get:function(){return $e.createIm}}),Object.defineProperty(t,"createImmutableDenseMatrixClass",{enumerable:!0,get:function(){return vr.createImmutableDenseMatrixClass}}),Object.defineProperty(t,"createIndex",{enumerable:!0,get:function(){return mn.createIndex}}),Object.defineProperty(t,"createIndexClass",{enumerable:!0,get:function(){return _r.createIndexClass}}),Object.defineProperty(t,"createIndexNode",{enumerable:!0,get:function(){return Sn.createIndexNode}}),Object.defineProperty(t,"createIndexTransform",{enumerable:!0,get:function(){return os.createIndexTransform}}),Object.defineProperty(t,"createInfinity",{enumerable:!0,get:function(){return es.createInfinity}}),Object.defineProperty(t,"createIntersect",{enumerable:!0,get:function(){return ri.createIntersect}}),Object.defineProperty(t,"createInv",{enumerable:!0,get:function(){return qn.createInv}}),Object.defineProperty(t,"createInverseConductanceQuantum",{enumerable:!0,get:function(){return ts.createInverseConductanceQuantum}}),Object.defineProperty(t,"createInvmod",{enumerable:!0,get:function(){return Ie.createInvmod}}),Object.defineProperty(t,"createIsInteger",{enumerable:!0,get:function(){return h.createIsInteger}}),Object.defineProperty(t,"createIsNaN",{enumerable:!0,get:function(){return b.createIsNaN}}),Object.defineProperty(t,"createIsNegative",{enumerable:!0,get:function(){return p.createIsNegative}}),Object.defineProperty(t,"createIsNumeric",{enumerable:!0,get:function(){return m.createIsNumeric}}),Object.defineProperty(t,"createIsPositive",{enumerable:!0,get:function(){return g.createIsPositive}}),Object.defineProperty(t,"createIsPrime",{enumerable:!0,get:function(){return Ht.createIsPrime}}),Object.defineProperty(t,"createIsZero",{enumerable:!0,get:function(){return y.createIsZero}}),Object.defineProperty(t,"createKldivergence",{enumerable:!0,get:function(){return yi.createKldivergence}}),Object.defineProperty(t,"createKlitzing",{enumerable:!0,get:function(){return ts.createKlitzing}}),Object.defineProperty(t,"createKron",{enumerable:!0,get:function(){return dt.createKron}}),Object.defineProperty(t,"createLN10",{enumerable:!0,get:function(){return es.createLN10}}),Object.defineProperty(t,"createLN2",{enumerable:!0,get:function(){return es.createLN2}}),Object.defineProperty(t,"createLOG10E",{enumerable:!0,get:function(){return es.createLOG10E}}),Object.defineProperty(t,"createLOG2E",{enumerable:!0,get:function(){return es.createLOG2E}}),Object.defineProperty(t,"createLarger",{enumerable:!0,get:function(){return dr.createLarger}}),Object.defineProperty(t,"createLargerEq",{enumerable:!0,get:function(){return hr.createLargerEq}}),Object.defineProperty(t,"createLcm",{enumerable:!0,get:function(){return ge.createLcm}}),Object.defineProperty(t,"createLeafCount",{enumerable:!0,get:function(){return Oi.createLeafCount}}),Object.defineProperty(t,"createLeftShift",{enumerable:!0,get:function(){return er.createLeftShift}}),Object.defineProperty(t,"createLgamma",{enumerable:!0,get:function(){return fi.createLgamma}}),Object.defineProperty(t,"createLog",{enumerable:!0,get:function(){return Vt.createLog}}),Object.defineProperty(t,"createLog10",{enumerable:!0,get:function(){return ye.createLog10}}),Object.defineProperty(t,"createLog1p",{enumerable:!0,get:function(){return qt.createLog1p}}),Object.defineProperty(t,"createLog2",{enumerable:!0,get:function(){return be.createLog2}}),Object.defineProperty(t,"createLoschmidt",{enumerable:!0,get:function(){return ts.createLoschmidt}}),Object.defineProperty(t,"createLsolve",{enumerable:!0,get:function(){return Xt.createLsolve}}),Object.defineProperty(t,"createLsolveAll",{enumerable:!0,get:function(){return Jt.createLsolveAll}}),Object.defineProperty(t,"createLup",{enumerable:!0,get:function(){return Fn.createLup}}),Object.defineProperty(t,"createLusolve",{enumerable:!0,get:function(){return jn.createLusolve}}),Object.defineProperty(t,"createLyap",{enumerable:!0,get:function(){return Qn.createLyap}}),Object.defineProperty(t,"createMad",{enumerable:!0,get:function(){return ai.createMad}}),Object.defineProperty(t,"createMagneticConstant",{enumerable:!0,get:function(){return ts.createMagneticConstant}}),Object.defineProperty(t,"createMagneticFluxQuantum",{enumerable:!0,get:function(){return ts.createMagneticFluxQuantum}}),Object.defineProperty(t,"createMap",{enumerable:!0,get:function(){return ht.createMap}}),Object.defineProperty(t,"createMapTransform",{enumerable:!0,get:function(){return as.createMapTransform}}),Object.defineProperty(t,"createMatrix",{enumerable:!0,get:function(){return Z.createMatrix}}),Object.defineProperty(t,"createMatrixClass",{enumerable:!0,get:function(){return c.createMatrixClass}}),Object.defineProperty(t,"createMatrixFromColumns",{enumerable:!0,get:function(){return ee.createMatrixFromColumns}}),Object.defineProperty(t,"createMatrixFromFunction",{enumerable:!0,get:function(){return X.createMatrixFromFunction}}),Object.defineProperty(t,"createMatrixFromRows",{enumerable:!0,get:function(){return Y.createMatrixFromRows}}),Object.defineProperty(t,"createMax",{enumerable:!0,get:function(){return yr.createMax}}),Object.defineProperty(t,"createMaxTransform",{enumerable:!0,get:function(){return ls.createMaxTransform}}),Object.defineProperty(t,"createMean",{enumerable:!0,get:function(){return si.createMean}}),Object.defineProperty(t,"createMeanTransform",{enumerable:!0,get:function(){return cs.createMeanTransform}}),Object.defineProperty(t,"createMedian",{enumerable:!0,get:function(){return oi.createMedian}}),Object.defineProperty(t,"createMin",{enumerable:!0,get:function(){return br.createMin}}),Object.defineProperty(t,"createMinTransform",{enumerable:!0,get:function(){return us.createMinTransform}}),Object.defineProperty(t,"createMod",{enumerable:!0,get:function(){return ve.createMod}}),Object.defineProperty(t,"createMode",{enumerable:!0,get:function(){return Rt.createMode}}),Object.defineProperty(t,"createMolarMass",{enumerable:!0,get:function(){return ts.createMolarMass}}),Object.defineProperty(t,"createMolarMassC12",{enumerable:!0,get:function(){return ts.createMolarMassC12}}),Object.defineProperty(t,"createMolarPlanckConstant",{enumerable:!0,get:function(){return ts.createMolarPlanckConstant}}),Object.defineProperty(t,"createMolarVolume",{enumerable:!0,get:function(){return ts.createMolarVolume}}),Object.defineProperty(t,"createMultinomial",{enumerable:!0,get:function(){return bi.createMultinomial}}),Object.defineProperty(t,"createMultiply",{enumerable:!0,get:function(){return xe.createMultiply}}),Object.defineProperty(t,"createMultiplyScalar",{enumerable:!0,get:function(){return _e.createMultiplyScalar}}),Object.defineProperty(t,"createNaN",{enumerable:!0,get:function(){return es.createNaN}}),Object.defineProperty(t,"createNeutronMass",{enumerable:!0,get:function(){return ts.createNeutronMass}}),Object.defineProperty(t,"createNode",{enumerable:!0,get:function(){return fn.createNode}}),Object.defineProperty(t,"createNorm",{enumerable:!0,get:function(){return dn.createNorm}}),Object.defineProperty(t,"createNot",{enumerable:!0,get:function(){return Ye.createNot}}),Object.defineProperty(t,"createNthRoot",{enumerable:!0,get:function(){return we.createNthRoot}}),Object.defineProperty(t,"createNthRoots",{enumerable:!0,get:function(){return $t.createNthRoots}}),Object.defineProperty(t,"createNuclearMagneton",{enumerable:!0,get:function(){return ts.createNuclearMagneton}}),Object.defineProperty(t,"createNull",{enumerable:!0,get:function(){return es.createNull}}),Object.defineProperty(t,"createNumber",{enumerable:!0,get:function(){return w.createNumber}}),Object.defineProperty(t,"createNumeric",{enumerable:!0,get:function(){return Ut.createNumeric}}),Object.defineProperty(t,"createObjectNode",{enumerable:!0,get:function(){return Pn.createObjectNode}}),Object.defineProperty(t,"createOct",{enumerable:!0,get:function(){return Ft.createOct}}),Object.defineProperty(t,"createOnes",{enumerable:!0,get:function(){return mt.createOnes}}),Object.defineProperty(t,"createOperatorNode",{enumerable:!0,get:function(){return En.createOperatorNode}}),Object.defineProperty(t,"createOr",{enumerable:!0,get:function(){return Qe.createOr}}),Object.defineProperty(t,"createOrTransform",{enumerable:!0,get:function(){return Ss.createOrTransform}}),Object.defineProperty(t,"createParenthesisNode",{enumerable:!0,get:function(){return Mn.createParenthesisNode}}),Object.defineProperty(t,"createParse",{enumerable:!0,get:function(){return On.createParse}}),Object.defineProperty(t,"createParser",{enumerable:!0,get:function(){return Nn.createParser}}),Object.defineProperty(t,"createParserClass",{enumerable:!0,get:function(){return kn.createParserClass}}),Object.defineProperty(t,"createPartitionSelect",{enumerable:!0,get:function(){return fr.createPartitionSelect}}),Object.defineProperty(t,"createPermutations",{enumerable:!0,get:function(){return vi.createPermutations}}),Object.defineProperty(t,"createPhi",{enumerable:!0,get:function(){return es.createPhi}}),Object.defineProperty(t,"createPi",{enumerable:!0,get:function(){return es.createPi}}),Object.defineProperty(t,"createPickRandom",{enumerable:!0,get:function(){return _i.createPickRandom}}),Object.defineProperty(t,"createPinv",{enumerable:!0,get:function(){return $n.createPinv}}),Object.defineProperty(t,"createPlanckCharge",{enumerable:!0,get:function(){return ts.createPlanckCharge}}),Object.defineProperty(t,"createPlanckConstant",{enumerable:!0,get:function(){return ts.createPlanckConstant}}),Object.defineProperty(t,"createPlanckLength",{enumerable:!0,get:function(){return ts.createPlanckLength}}),Object.defineProperty(t,"createPlanckMass",{enumerable:!0,get:function(){return ts.createPlanckMass}}),Object.defineProperty(t,"createPlanckTemperature",{enumerable:!0,get:function(){return ts.createPlanckTemperature}}),Object.defineProperty(t,"createPlanckTime",{enumerable:!0,get:function(){return ts.createPlanckTime}}),Object.defineProperty(t,"createPolynomialRoot",{enumerable:!0,get:function(){return Hn.createPolynomialRoot}}),Object.defineProperty(t,"createPow",{enumerable:!0,get:function(){return Gt.createPow}}),Object.defineProperty(t,"createPrint",{enumerable:!0,get:function(){return Bt.createPrint}}),Object.defineProperty(t,"createPrintTransform",{enumerable:!0,get:function(){return xs.createPrintTransform}}),Object.defineProperty(t,"createProd",{enumerable:!0,get:function(){return Lt.createProd}}),Object.defineProperty(t,"createProtonMass",{enumerable:!0,get:function(){return ts.createProtonMass}}),Object.defineProperty(t,"createQr",{enumerable:!0,get:function(){return In.createQr}}),Object.defineProperty(t,"createQuantileSeq",{enumerable:!0,get:function(){return ci.createQuantileSeq}}),Object.defineProperty(t,"createQuantileSeqTransform",{enumerable:!0,get:function(){return bs.createQuantileSeqTransform}}),Object.defineProperty(t,"createQuantumOfCirculation",{enumerable:!0,get:function(){return ts.createQuantumOfCirculation}}),Object.defineProperty(t,"createRandom",{enumerable:!0,get:function(){return xi.createRandom}}),Object.defineProperty(t,"createRandomInt",{enumerable:!0,get:function(){return wi.createRandomInt}}),Object.defineProperty(t,"createRange",{enumerable:!0,get:function(){return ft.createRange}}),Object.defineProperty(t,"createRangeClass",{enumerable:!0,get:function(){return l.createRangeClass}}),Object.defineProperty(t,"createRangeNode",{enumerable:!0,get:function(){return Cn.createRangeNode}}),Object.defineProperty(t,"createRangeTransform",{enumerable:!0,get:function(){return ds.createRangeTransform}}),Object.defineProperty(t,"createRationalize",{enumerable:!0,get:function(){return zi.createRationalize}}),Object.defineProperty(t,"createRe",{enumerable:!0,get:function(){return Xe.createRe}}),Object.defineProperty(t,"createReducedPlanckConstant",{enumerable:!0,get:function(){return ts.createReducedPlanckConstant}}),Object.defineProperty(t,"createRelationalNode",{enumerable:!0,get:function(){return An.createRelationalNode}}),Object.defineProperty(t,"createReplacer",{enumerable:!0,get:function(){return Qi.createReplacer}}),Object.defineProperty(t,"createReshape",{enumerable:!0,get:function(){return gt.createReshape}}),Object.defineProperty(t,"createResize",{enumerable:!0,get:function(){return yt.createResize}}),Object.defineProperty(t,"createResolve",{enumerable:!0,get:function(){return ji.createResolve}}),Object.defineProperty(t,"createResultSet",{enumerable:!0,get:function(){return i.createResultSet}}),Object.defineProperty(t,"createReviver",{enumerable:!0,get:function(){return Ji.createReviver}}),Object.defineProperty(t,"createRightArithShift",{enumerable:!0,get:function(){return tr.createRightArithShift}}),Object.defineProperty(t,"createRightLogShift",{enumerable:!0,get:function(){return rr.createRightLogShift}}),Object.defineProperty(t,"createRotate",{enumerable:!0,get:function(){return bt.createRotate}}),Object.defineProperty(t,"createRotationMatrix",{enumerable:!0,get:function(){return vt.createRotationMatrix}}),Object.defineProperty(t,"createRound",{enumerable:!0,get:function(){return Wt.createRound}}),Object.defineProperty(t,"createRow",{enumerable:!0,get:function(){return _t.createRow}}),Object.defineProperty(t,"createRowTransform",{enumerable:!0,get:function(){return hs.createRowTransform}}),Object.defineProperty(t,"createRydberg",{enumerable:!0,get:function(){return ts.createRydberg}}),Object.defineProperty(t,"createSQRT1_2",{enumerable:!0,get:function(){return es.createSQRT1_2}}),Object.defineProperty(t,"createSQRT2",{enumerable:!0,get:function(){return es.createSQRT2}}),Object.defineProperty(t,"createSackurTetrode",{enumerable:!0,get:function(){return ts.createSackurTetrode}}),Object.defineProperty(t,"createSchur",{enumerable:!0,get:function(){return Jn.createSchur}}),Object.defineProperty(t,"createSec",{enumerable:!0,get:function(){return qr.createSec}}),Object.defineProperty(t,"createSech",{enumerable:!0,get:function(){return $r.createSech}}),Object.defineProperty(t,"createSecondRadiation",{enumerable:!0,get:function(){return ts.createSecondRadiation}}),Object.defineProperty(t,"createSetCartesian",{enumerable:!0,get:function(){return Jr.createSetCartesian}}),Object.defineProperty(t,"createSetDifference",{enumerable:!0,get:function(){return Qr.createSetDifference}}),Object.defineProperty(t,"createSetDistinct",{enumerable:!0,get:function(){return en.createSetDistinct}}),Object.defineProperty(t,"createSetIntersect",{enumerable:!0,get:function(){return tn.createSetIntersect}}),Object.defineProperty(t,"createSetIsSubset",{enumerable:!0,get:function(){return rn.createSetIsSubset}}),Object.defineProperty(t,"createSetMultiplicity",{enumerable:!0,get:function(){return nn.createSetMultiplicity}}),Object.defineProperty(t,"createSetPowerset",{enumerable:!0,get:function(){return sn.createSetPowerset}}),Object.defineProperty(t,"createSetSize",{enumerable:!0,get:function(){return on.createSetSize}}),Object.defineProperty(t,"createSetSymDifference",{enumerable:!0,get:function(){return an.createSetSymDifference}}),Object.defineProperty(t,"createSetUnion",{enumerable:!0,get:function(){return ln.createSetUnion}}),Object.defineProperty(t,"createSign",{enumerable:!0,get:function(){return Se.createSign}}),Object.defineProperty(t,"createSimplify",{enumerable:!0,get:function(){return Ri.createSimplify}}),Object.defineProperty(t,"createSimplifyConstant",{enumerable:!0,get:function(){return ki.createSimplifyConstant}}),Object.defineProperty(t,"createSimplifyCore",{enumerable:!0,get:function(){return Bi.createSimplifyCore}}),Object.defineProperty(t,"createSin",{enumerable:!0,get:function(){return Zr.createSin}}),Object.defineProperty(t,"createSinh",{enumerable:!0,get:function(){return Kr.createSinh}}),Object.defineProperty(t,"createSize",{enumerable:!0,get:function(){return xt.createSize}}),Object.defineProperty(t,"createSlu",{enumerable:!0,get:function(){return Bn.createSlu}}),Object.defineProperty(t,"createSmaller",{enumerable:!0,get:function(){return cr.createSmaller}}),Object.defineProperty(t,"createSmallerEq",{enumerable:!0,get:function(){return ur.createSmallerEq}}),Object.defineProperty(t,"createSolveODE",{enumerable:!0,get:function(){return Tt.createSolveODE}}),Object.defineProperty(t,"createSort",{enumerable:!0,get:function(){return gr.createSort}}),Object.defineProperty(t,"createSpaClass",{enumerable:!0,get:function(){return wr.createSpaClass}}),Object.defineProperty(t,"createSparse",{enumerable:!0,get:function(){return Er.createSparse}}),Object.defineProperty(t,"createSparseMatrixClass",{enumerable:!0,get:function(){return x.createSparseMatrixClass}}),Object.defineProperty(t,"createSpeedOfLight",{enumerable:!0,get:function(){return ts.createSpeedOfLight}}),Object.defineProperty(t,"createSplitUnit",{enumerable:!0,get:function(){return te.createSplitUnit}}),Object.defineProperty(t,"createSqrt",{enumerable:!0,get:function(){return Pe.createSqrt}}),Object.defineProperty(t,"createSqrtm",{enumerable:!0,get:function(){return Xn.createSqrtm}}),Object.defineProperty(t,"createSquare",{enumerable:!0,get:function(){return Te.createSquare}}),Object.defineProperty(t,"createSqueeze",{enumerable:!0,get:function(){return wt.createSqueeze}}),Object.defineProperty(t,"createStd",{enumerable:!0,get:function(){return ui.createStd}}),Object.defineProperty(t,"createStdTransform",{enumerable:!0,get:function(){return gs.createStdTransform}}),Object.defineProperty(t,"createStefanBoltzmann",{enumerable:!0,get:function(){return ts.createStefanBoltzmann}}),Object.defineProperty(t,"createStirlingS2",{enumerable:!0,get:function(){return Ei.createStirlingS2}}),Object.defineProperty(t,"createString",{enumerable:!0,get:function(){return k.createString}}),Object.defineProperty(t,"createSubset",{enumerable:!0,get:function(){return St.createSubset}}),Object.defineProperty(t,"createSubsetTransform",{enumerable:!0,get:function(){return ps.createSubsetTransform}}),Object.defineProperty(t,"createSubtract",{enumerable:!0,get:function(){return Re.createSubtract}}),Object.defineProperty(t,"createSubtractScalar",{enumerable:!0,get:function(){return ae.createSubtractScalar}}),Object.defineProperty(t,"createSum",{enumerable:!0,get:function(){return ni.createSum}}),Object.defineProperty(t,"createSumTransform",{enumerable:!0,get:function(){return ys.createSumTransform}}),Object.defineProperty(t,"createSylvester",{enumerable:!0,get:function(){return Yn.createSylvester}}),Object.defineProperty(t,"createSymbolNode",{enumerable:!0,get:function(){return Tn.createSymbolNode}}),Object.defineProperty(t,"createSymbolicEqual",{enumerable:!0,get:function(){return Hi.createSymbolicEqual}}),Object.defineProperty(t,"createTan",{enumerable:!0,get:function(){return Xr.createTan}}),Object.defineProperty(t,"createTanh",{enumerable:!0,get:function(){return Yr.createTanh}}),Object.defineProperty(t,"createTau",{enumerable:!0,get:function(){return es.createTau}}),Object.defineProperty(t,"createThomsonCrossSection",{enumerable:!0,get:function(){return ts.createThomsonCrossSection}}),Object.defineProperty(t,"createTo",{enumerable:!0,get:function(){return jt.createTo}}),Object.defineProperty(t,"createTrace",{enumerable:!0,get:function(){return pn.createTrace}}),Object.defineProperty(t,"createTranspose",{enumerable:!0,get:function(){return Pt.createTranspose}}),Object.defineProperty(t,"createTrue",{enumerable:!0,get:function(){return es.createTrue}}),Object.defineProperty(t,"createTypeOf",{enumerable:!0,get:function(){return v.createTypeOf}}),Object.defineProperty(t,"createTyped",{enumerable:!0,get:function(){return n.createTyped}}),Object.defineProperty(t,"createUnaryMinus",{enumerable:!0,get:function(){return re.createUnaryMinus}}),Object.defineProperty(t,"createUnaryPlus",{enumerable:!0,get:function(){return ne.createUnaryPlus}}),Object.defineProperty(t,"createUnequal",{enumerable:!0,get:function(){return mr.createUnequal}}),Object.defineProperty(t,"createUnitClass",{enumerable:!0,get:function(){return Sr.createUnitClass}}),Object.defineProperty(t,"createUnitFunction",{enumerable:!0,get:function(){return Pr.createUnitFunction}}),Object.defineProperty(t,"createUppercaseE",{enumerable:!0,get:function(){return es.createUppercaseE}}),Object.defineProperty(t,"createUppercasePi",{enumerable:!0,get:function(){return es.createUppercasePi}}),Object.defineProperty(t,"createUsolve",{enumerable:!0,get:function(){return Yt.createUsolve}}),Object.defineProperty(t,"createUsolveAll",{enumerable:!0,get:function(){return Qt.createUsolveAll}}),Object.defineProperty(t,"createVacuumImpedance",{enumerable:!0,get:function(){return ts.createVacuumImpedance}}),Object.defineProperty(t,"createVariance",{enumerable:!0,get:function(){return li.createVariance}}),Object.defineProperty(t,"createVarianceTransform",{enumerable:!0,get:function(){return _s.createVarianceTransform}}),Object.defineProperty(t,"createVersion",{enumerable:!0,get:function(){return es.createVersion}}),Object.defineProperty(t,"createWeakMixingAngle",{enumerable:!0,get:function(){return ts.createWeakMixingAngle}}),Object.defineProperty(t,"createWienDisplacement",{enumerable:!0,get:function(){return ts.createWienDisplacement}}),Object.defineProperty(t,"createXgcd",{enumerable:!0,get:function(){return ke.createXgcd}}),Object.defineProperty(t,"createXor",{enumerable:!0,get:function(){return et.createXor}}),Object.defineProperty(t,"createZeros",{enumerable:!0,get:function(){return Mt.createZeros}}),Object.defineProperty(t,"createZeta",{enumerable:!0,get:function(){return Ot.createZeta}}),Object.defineProperty(t,"createZpk2tf",{enumerable:!0,get:function(){return qi.createZpk2tf}});var n=r(19455),i=r(43542),s=r(43774),o=r(84362),a=r(36812),l=r(58794),c=r(22774),u=r(11589),d=r(39966),h=r(17533),p=r(32524),m=r(28824),f=r(98447),g=r(51080),y=r(45477),b=r(77174),v=r(35866),_=r(81643),x=r(57974),w=r(26960),R=r(78130),k=r(84),j=r(68049),z=r(80701),q=r(51367),$=r(98123),Z=r(93847),X=r(34150),Y=r(39707),ee=r(72983),te=r(74323),re=r(95825),ne=r(80617),ie=r(41886),se=r(92595),oe=r(80961),ae=r(33848),le=r(79367),ce=r(96149),ue=r(60713),de=r(65621),he=r(69507),pe=r(56625),me=r(65084),fe=r(33168),ge=r(47142),ye=r(85549),be=r(91512),ve=r(54066),_e=r(64636),xe=r(9728),we=r(55172),Se=r(45809),Pe=r(86134),Te=r(78187),Re=r(61668),ke=r(10654),Ie=r(55297),je=r(76705),He=r(97765),ze=r(44113),Ge=r(39439),We=r(71501),Ve=r(83694),qe=r(2886),$e=r(42502),Xe=r(68665),Ye=r(27160),Qe=r(98456),et=r(69188),tt=r(52359),rt=r(72669),nt=r(25580),it=r(76223),st=r(16204),ot=r(45069),at=r(817),lt=r(92265),ct=r(44150),ut=r(6149),dt=r(72243),ht=r(15177),pt=r(20948),mt=r(89990),ft=r(36542),gt=r(1005),yt=r(20319),bt=r(92756),vt=r(3016),_t=r(45515),xt=r(19034),wt=r(88315),St=r(68933),Pt=r(46236),Et=r(22763),Mt=r(77864),Ct=r(18975),At=r(29702),Tt=r(25198),Dt=r(27306),Ot=r(9463),Rt=r(2358),Lt=r(9384),kt=r(53052),Nt=r(90358),Ft=r(77777),It=r(31938),Bt=r(43160),jt=r(57151),Ht=r(78132),Ut=r(64720),zt=r(76269),Gt=r(21340),Wt=r(834),Vt=r(62672),qt=r(9325),$t=r(67211),Zt=r(4055),Kt=r(35128),Xt=r(3793),Yt=r(63128),Jt=r(18750),Qt=r(29129),er=r(17042),tr=r(34105),rr=r(17673),nr=r(91732),ir=r(63300),sr=r(51739),or=r(61559),ar=r(81039),lr=r(41948),cr=r(29411),ur=r(161),dr=r(6612),hr=r(3630),pr=r(39685),mr=r(58602),fr=r(84009),gr=r(81163),yr=r(79343),br=r(93781),vr=r(4161),_r=r(76944),xr=r(71129),wr=r(11517),Sr=r(56708),Pr=r(67595),Er=r(13274),Mr=r(52599),Cr=r(72171),Ar=r(51395),Tr=r(28738),Dr=r(40624),Or=r(72815),Rr=r(68655),Lr=r(12493),kr=r(2409),Nr=r(75126),Fr=r(23132),Ir=r(39815),Br=r(57825),jr=r(14439),Hr=r(33218),Ur=r(67920),zr=r(19179),Gr=r(97923),Wr=r(70638),Vr=r(41492),qr=r(49940),$r=r(77382),Zr=r(93083),Kr=r(57747),Xr=r(75826),Yr=r(59392),Jr=r(98062),Qr=r(4045),en=r(52110),tn=r(34785),rn=r(31280),nn=r(68469),sn=r(8145),on=r(7995),an=r(8788),ln=r(7811),cn=r(42593),un=r(36376),dn=r(3106),hn=r(4860),pn=r(74194),mn=r(40596),fn=r(16006),gn=r(35993),yn=r(93013),bn=r(71515),vn=r(8905),_n=r(33504),xn=r(51118),wn=r(55687),Sn=r(59128),Pn=r(94961),En=r(42190),Mn=r(95456),Cn=r(9377),An=r(76487),Tn=r(74530),Dn=r(67922),On=r(55800),Rn=r(73173),Ln=r(47161),kn=r(85776),Nn=r(33417),Fn=r(97151),In=r(70403),Bn=r(19328),jn=r(39110),Hn=r(91266),Un=r(43892),zn=r(52598),Gn=r(57897),Wn=r(42581),Vn=r(96614),qn=r(98704),$n=r(83704),Zn=r(69107),Kn=r(72793),Xn=r(23458),Yn=r(73715),Jn=r(55663),Qn=r(29066),ei=r(84485),ti=r(90243),ri=r(40247),ni=r(40850),ii=r(54131),si=r(4656),oi=r(88847),ai=r(80211),li=r(22058),ci=r(83933),ui=r(94620),di=r(24083),hi=r(46705),pi=r(60238),mi=r(37948),fi=r(82900),gi=r(75486),yi=r(85200),bi=r(90248),vi=r(97520),_i=r(19927),xi=r(68330),wi=r(84221),Ei=r(90192),Ci=r(12768),Ti=r(72779),Di=r(79987),Oi=r(36125),Ri=r(91779),ki=r(27391),Bi=r(22416),ji=r(90626),Hi=r(33938),Ui=r(95073),zi=r(75570),qi=r(15841),$i=r(81754),Ji=r(77910),Qi=r(66813),es=r(73549),ts=r(25014),rs=r(69682),ns=r(16926),is=r(57702),ss=r(73704),os=r(43922),as=r(23024),ls=r(50504),cs=r(98337),us=r(16174),ds=r(54903),hs=r(29306),ps=r(48322),ms=r(69868),fs=r(33879),gs=r(34207),ys=r(49949),bs=r(3874),vs=r(17722),_s=r(59411),xs=r(37597),ws=r(66603),Ss=r(27633),Ps=r(97472),Es=r(49612)},97151:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLup=void 0;var n=r(61175),i=r(66212);const s=["typed","matrix","abs","addScalar","divideScalar","multiplyScalar","subtractScalar","larger","equalScalar","unaryMinus","DenseMatrix","SparseMatrix","Spa"];t.createLup=(0,i.factory)("lup",s,(e=>{let{typed:t,matrix:r,abs:i,addScalar:s,divideScalar:o,multiplyScalar:a,subtractScalar:l,larger:c,equalScalar:u,unaryMinus:d,DenseMatrix:h,SparseMatrix:p,Spa:m}=e;return t("lup",{DenseMatrix:function(e){return f(e)},SparseMatrix:function(e){return function(e){const t=e._size[0],r=e._size[1],n=Math.min(t,r),s=e._values,l=e._index,h=e._ptr,f=[],g=[],y=[],b=[t,n],v=[],_=[],x=[],w=[n,r];let R,k,j;const z=[],q=[];for(R=0;R<t;R++)z[R]=R,q[R]=R;const $=function(e,t){const r=q[e],n=q[t];z[r]=t,z[n]=e,q[e]=n,q[t]=r};for(k=0;k<r;k++){const e=new m;k<t&&(y.push(f.length),f.push(1),g.push(k)),x.push(v.length);const r=h[k],n=h[k+1];for(j=r;j<n;j++)R=l[j],e.set(z[R],s[j]);k>0&&e.forEach(0,k-1,(function(t,r){p._forEachRow(t,f,g,y,(function(n,i){n>t&&e.accumulate(n,d(a(i,r)))}))}));let q=k,Z=e.get(k),X=i(Z);e.forEach(k+1,t-1,(function(e,t){const r=i(t);c(r,X)&&(q=e,X=r,Z=t)})),k!==q&&(p._swapRows(k,q,b[1],f,g,y),p._swapRows(k,q,w[1],v,_,x),e.swap(k,q),$(k,q)),e.forEach(0,t-1,(function(e,t){e<=k?(v.push(t),_.push(e)):(t=o(t,Z),u(t,0)||(f.push(t),g.push(e)))}))}return x.push(v.length),y.push(f.length),{L:new p({values:f,index:g,ptr:y,size:b}),U:new p({values:v,index:_,ptr:x,size:w}),p:z,toString:function(){return"L: "+this.L.toString()+"\nU: "+this.U.toString()+"\nP: "+this.p}}}(e)},Array:function(e){const t=f(r(e));return{L:t.L.valueOf(),U:t.U.valueOf(),p:t.p}}});function f(e){const t=e._size[0],r=e._size[1];let d=Math.min(t,r);const p=(0,n.clone)(e._data),m=[],f=[t,d],g=[],y=[d,r];let b,v,_;const x=[];for(b=0;b<t;b++)x[b]=b;for(v=0;v<r;v++){if(v>0)for(b=0;b<t;b++){const e=Math.min(b,v);let t=0;for(_=0;_<e;_++)t=s(t,a(p[b][_],p[_][v]));p[b][v]=l(p[b][v],t)}let e=v,r=0,n=0;for(b=v;b<t;b++){const t=p[b][v],s=i(t);c(s,r)&&(e=b,r=s,n=t)}if(v!==e&&(x[v]=[x[e],x[e]=x[v]][0],h._swapRows(v,e,p)),v<t)for(b=v+1;b<t;b++){const e=p[b][v];u(e,0)||(p[b][v]=o(p[b][v],n))}}for(v=0;v<r;v++)for(b=0;b<t;b++)0===v&&(b<r&&(g[b]=[]),m[b]=[]),b<v?(b<r&&(g[b][v]=p[b][v]),v<t&&(m[b][v]=0)):b!==v?(b<r&&(g[b][v]=0),v<t&&(m[b][v]=p[b][v])):(b<r&&(g[b][v]=p[b][v]),v<t&&(m[b][v]=1));const w=new h({data:m,size:f}),R=new h({data:g,size:y}),k=[];for(b=0,d=x.length;b<d;b++)k[x[b]]=b;return{L:w,U:R,p:k,toString:function(){return"L: "+this.L.toString()+"\nU: "+this.U.toString()+"\nP: "+this.p}}}}))},70403:(e,t,r)=>{"use strict";var n=r(87929);Object.defineProperty(t,"__esModule",{value:!0}),t.createQr=void 0;var i=n(r(37693)),s=r(66212);const o=["typed","matrix","zeros","identity","isZero","equal","sign","sqrt","conj","unaryMinus","addScalar","divideScalar","multiplyScalar","subtractScalar","complex"];t.createQr=(0,s.factory)("qr",o,(e=>{let{typed:t,matrix:r,zeros:n,identity:s,isZero:o,equal:a,sign:l,sqrt:c,conj:u,unaryMinus:d,addScalar:h,divideScalar:p,multiplyScalar:m,subtractScalar:f,complex:g}=e;return(0,i.default)(t("qr",{DenseMatrix:function(e){return b(e)},SparseMatrix:function(e){return function(e){throw new Error("qr not implemented for sparse matrices yet")}()},Array:function(e){const t=b(r(e));return{Q:t.Q.valueOf(),R:t.R.valueOf()}}}),{_denseQRimpl:y});function y(e){const t=e._size[0],r=e._size[1],i=s([t],"dense"),g=i._data,y=e.clone(),b=y._data;let v,_,x;const w=n([t],"");for(x=0;x<Math.min(r,t);++x){const e=b[x][x],n=d(a(e,0)?1:l(e)),i=u(n);let s=0;for(v=x;v<t;v++)s=h(s,m(b[v][x],u(b[v][x])));const y=m(n,c(s));if(!o(y)){const n=f(e,y);for(w[x]=1,v=x+1;v<t;v++)w[v]=p(b[v][x],n);const s=d(u(p(n,y)));let o;for(_=x;_<r;_++){for(o=0,v=x;v<t;v++)o=h(o,m(u(w[v]),b[v][_]));for(o=m(o,s),v=x;v<t;v++)b[v][_]=m(f(b[v][_],m(w[v],o)),i)}for(v=0;v<t;v++){for(o=0,_=x;_<t;_++)o=h(o,m(g[v][_],w[_]));for(o=m(o,s),_=x;_<t;++_)g[v][_]=p(f(g[v][_],m(o,u(w[_]))),i)}}}return{Q:i,R:y,toString:function(){return"Q: "+this.Q.toString()+"\nR: "+this.R.toString()}}}function b(e){const t=y(e),r=t.R._data;if(e._data.length>0){const e="Complex"===r[0][0].type?g(0):0;for(let t=0;t<r.length;++t)for(let n=0;n<t&&n<(r[0]||[]).length;++n)r[t][n]=e}return t}}))},55663:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSchur=void 0;var n=r(66212);const i="schur",s=["typed","matrix","identity","multiply","qr","norm","subtract"];t.createSchur=(0,n.factory)(i,s,(e=>{let{typed:t,matrix:r,identity:n,multiply:s,qr:o,norm:a,subtract:l}=e;return t(i,{Array:function(e){const t=c(r(e));return{U:t.U.valueOf(),T:t.T.valueOf()}},Matrix:function(e){return c(e)}});function c(e){const t=e.size()[0];let r,i=e,c=n(t),u=0;do{r=i;const e=o(i),t=e.Q,n=e.R;if(i=s(n,t),c=s(c,t),u++>100)break}while(a(l(i,r))>1e-4);return{U:c,T:i}}}))},19328:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSlu=void 0;var n=r(34749),i=r(66212),s=r(81875),o=r(35030);const a=["typed","abs","add","multiply","transpose","divideScalar","subtract","larger","largerEq","SparseMatrix"];t.createSlu=(0,i.factory)("slu",a,(e=>{let{typed:t,abs:r,add:i,multiply:a,transpose:l,divideScalar:c,subtract:u,larger:d,largerEq:h,SparseMatrix:p}=e;const m=(0,s.createCsSqr)({add:i,multiply:a,transpose:l}),f=(0,o.createCsLu)({abs:r,divideScalar:c,multiply:a,subtract:u,larger:d,largerEq:h,SparseMatrix:p});return t("slu",{"SparseMatrix, number, number":function(e,t,r){if(!(0,n.isInteger)(t)||t<0||t>3)throw new Error("Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]");if(r<0||r>1)throw new Error("Partial pivoting threshold must be a number from 0 to 1");const i=m(t,e,!1),s=f(e,i,r);return{L:s.L,U:s.U,p:s.pinv,q:i.q,toString:function(){return"L: "+this.L.toString()+"\nU: "+this.U.toString()+"\np: "+this.p.toString()+(this.q?"\nq: "+this.q.toString():"")+"\n"}}}})}))},95073:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDerivative=void 0;var n=r(91612),i=r(66212),s=r(34749);const o="derivative",a=["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"];t.createDerivative=(0,i.factory)(o,a,(e=>{let{typed:t,config:r,parse:i,simplify:a,equal:l,isZero:c,numeric:u,ConstantNode:d,FunctionNode:h,OperatorNode:p,ParenthesisNode:m,SymbolNode:f}=e;function g(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{simplify:!0};const n={};v(n,e,t.name);const i=_(e,n);return r.simplify?a(i):i}t.addConversion({from:"identifier",to:"SymbolNode",convert:i});const y=t(o,{"Node, SymbolNode":g,"Node, SymbolNode, Object":g});t.removeConversion({from:"identifier",to:"SymbolNode",convert:i}),y._simplify=!0,y.toTex=function(e){return b.apply(null,e.args)};const b=t("_derivTex",{"Node, SymbolNode":function(e,t){return(0,n.isConstantNode)(e)&&"string"===(0,n.typeOf)(e.value)?b(i(e.value).toString(),t.toString(),1):b(e.toTex(),t.toString(),1)},"Node, ConstantNode":function(e,t){if("string"===(0,n.typeOf)(t.value))return b(e,i(t.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(e,t,r){return b(e.toString(),t.name,r.value)},"string, string, number":function(e,t,r){let n;return n=1===r?"{d\\over d"+t+"}":"{d^{"+r+"}\\over d"+t+"^{"+r+"}}",n+`\\left[${e}\\right]`}}),v=t("constTag",{"Object, ConstantNode, string":function(e,t){return e[t]=!0,!0},"Object, SymbolNode, string":function(e,t,r){return t.name!==r&&(e[t]=!0,!0)},"Object, ParenthesisNode, string":function(e,t,r){return v(e,t.content,r)},"Object, FunctionAssignmentNode, string":function(e,t,r){return t.params.includes(r)?v(e,t.expr,r):(e[t]=!0,!0)},"Object, FunctionNode | OperatorNode, string":function(e,t,r){if(t.args.length>0){let n=v(e,t.args[0],r);for(let i=1;i<t.args.length;++i)n=v(e,t.args[i],r)&&n;if(n)return e[t]=!0,!0}return!1}}),_=t("_derivative",{"ConstantNode, Object":function(e){return x(0)},"SymbolNode, Object":function(e,t){return void 0!==t[e]?x(0):x(1)},"ParenthesisNode, Object":function(e,t){return new m(_(e.content,t))},"FunctionAssignmentNode, Object":function(e,t){return void 0!==t[e]?x(0):_(e.expr,t)},"FunctionNode, Object":function(e,t){if(void 0!==t[e])return x(0);const r=e.args[0];let n,i,s,o,a=!1,l=!1;switch(e.name){case"cbrt":a=!0,i=new p("*","multiply",[x(3),new p("^","pow",[r,new p("/","divide",[x(2),x(3)])])]);break;case"sqrt":case"nthRoot":if(1===e.args.length)a=!0,i=new p("*","multiply",[x(2),new h("sqrt",[r])]);else if(2===e.args.length)return n=new p("/","divide",[x(1),e.args[1]]),t[n]=t[e.args[1]],_(new p("^","pow",[r,n]),t);break;case"log10":n=x(10);case"log":if(n||1!==e.args.length){if(1===e.args.length&&n||2===e.args.length&&void 0!==t[e.args[1]])i=new p("*","multiply",[r.clone(),new h("log",[n||e.args[1]])]),a=!0;else if(2===e.args.length)return _(new p("/","divide",[new h("log",[r]),new h("log",[e.args[1]])]),t)}else i=r.clone(),a=!0;break;case"pow":if(2===e.args.length)return t[n]=t[e.args[1]],_(new p("^","pow",[r,e.args[1]]),t);break;case"exp":i=new h("exp",[r.clone()]);break;case"sin":i=new h("cos",[r.clone()]);break;case"cos":i=new p("-","unaryMinus",[new h("sin",[r.clone()])]);break;case"tan":i=new p("^","pow",[new h("sec",[r.clone()]),x(2)]);break;case"sec":i=new p("*","multiply",[e,new h("tan",[r.clone()])]);break;case"csc":l=!0,i=new p("*","multiply",[e,new h("cot",[r.clone()])]);break;case"cot":l=!0,i=new p("^","pow",[new h("csc",[r.clone()]),x(2)]);break;case"asin":a=!0,i=new h("sqrt",[new p("-","subtract",[x(1),new p("^","pow",[r.clone(),x(2)])])]);break;case"acos":a=!0,l=!0,i=new h("sqrt",[new p("-","subtract",[x(1),new p("^","pow",[r.clone(),x(2)])])]);break;case"atan":a=!0,i=new p("+","add",[new p("^","pow",[r.clone(),x(2)]),x(1)]);break;case"asec":a=!0,i=new p("*","multiply",[new h("abs",[r.clone()]),new h("sqrt",[new p("-","subtract",[new p("^","pow",[r.clone(),x(2)]),x(1)])])]);break;case"acsc":a=!0,l=!0,i=new p("*","multiply",[new h("abs",[r.clone()]),new h("sqrt",[new p("-","subtract",[new p("^","pow",[r.clone(),x(2)]),x(1)])])]);break;case"acot":a=!0,l=!0,i=new p("+","add",[new p("^","pow",[r.clone(),x(2)]),x(1)]);break;case"sinh":i=new h("cosh",[r.clone()]);break;case"cosh":i=new h("sinh",[r.clone()]);break;case"tanh":i=new p("^","pow",[new h("sech",[r.clone()]),x(2)]);break;case"sech":l=!0,i=new p("*","multiply",[e,new h("tanh",[r.clone()])]);break;case"csch":l=!0,i=new p("*","multiply",[e,new h("coth",[r.clone()])]);break;case"coth":l=!0,i=new p("^","pow",[new h("csch",[r.clone()]),x(2)]);break;case"asinh":a=!0,i=new h("sqrt",[new p("+","add",[new p("^","pow",[r.clone(),x(2)]),x(1)])]);break;case"acosh":a=!0,i=new h("sqrt",[new p("-","subtract",[new p("^","pow",[r.clone(),x(2)]),x(1)])]);break;case"atanh":a=!0,i=new p("-","subtract",[x(1),new p("^","pow",[r.clone(),x(2)])]);break;case"asech":a=!0,l=!0,i=new p("*","multiply",[r.clone(),new h("sqrt",[new p("-","subtract",[x(1),new p("^","pow",[r.clone(),x(2)])])])]);break;case"acsch":a=!0,l=!0,i=new p("*","multiply",[new h("abs",[r.clone()]),new h("sqrt",[new p("+","add",[new p("^","pow",[r.clone(),x(2)]),x(1)])])]);break;case"acoth":a=!0,l=!0,i=new p("-","subtract",[x(1),new p("^","pow",[r.clone(),x(2)])]);break;case"abs":i=new p("/","divide",[new h(new f("abs"),[r.clone()]),r.clone()]);break;default:throw new Error('Cannot process function "'+e.name+'" in derivative: the function is not supported, undefined, or the number of arguments passed to it are not supported')}a?(s="/",o="divide"):(s="*",o="multiply");let c=_(r,t);return l&&(c=new p("-","unaryMinus",[c])),new p(s,o,[c,i])},"OperatorNode, Object":function(e,t){if(void 0!==t[e])return x(0);if("+"===e.op)return new p(e.op,e.fn,e.args.map((function(e){return _(e,t)})));if("-"===e.op){if(e.isUnary())return new p(e.op,e.fn,[_(e.args[0],t)]);if(e.isBinary())return new p(e.op,e.fn,[_(e.args[0],t),_(e.args[1],t)])}if("*"===e.op){const r=e.args.filter((function(e){return void 0!==t[e]}));if(r.length>0){const n=e.args.filter((function(e){return void 0===t[e]})),i=1===n.length?n[0]:new p("*","multiply",n),s=r.concat(_(i,t));return new p("*","multiply",s)}return new p("+","add",e.args.map((function(r){return new p("*","multiply",e.args.map((function(e){return e===r?_(e,t):e.clone()})))})))}if("/"===e.op&&e.isBinary()){const r=e.args[0],n=e.args[1];return void 0!==t[n]?new p("/","divide",[_(r,t),n]):void 0!==t[r]?new p("*","multiply",[new p("-","unaryMinus",[r]),new p("/","divide",[_(n,t),new p("^","pow",[n.clone(),x(2)])])]):new p("/","divide",[new p("-","subtract",[new p("*","multiply",[_(r,t),n.clone()]),new p("*","multiply",[r.clone(),_(n,t)])]),new p("^","pow",[n.clone(),x(2)])])}if("^"===e.op&&e.isBinary()){const r=e.args[0],i=e.args[1];if(void 0!==t[r])return(0,n.isConstantNode)(r)&&(c(r.value)||l(r.value,1))?x(0):new p("*","multiply",[e,new p("*","multiply",[new h("log",[r.clone()]),_(i.clone(),t)])]);if(void 0!==t[i]){if((0,n.isConstantNode)(i)){if(c(i.value))return x(0);if(l(i.value,1))return _(r,t)}const e=new p("^","pow",[r.clone(),new p("-","subtract",[i,x(1)])]);return new p("*","multiply",[i.clone(),new p("*","multiply",[_(r,t),e])])}return new p("*","multiply",[new p("^","pow",[r.clone(),i.clone()]),new p("+","add",[new p("*","multiply",[_(r,t),new p("/","divide",[i.clone(),r.clone()])]),new p("*","multiply",[_(i,t),new h("log",[r.clone()])])])])}throw new Error('Cannot process operator "'+e.op+'" in derivative: the operator is not supported, undefined, or the number of arguments passed to it are not supported')}});function x(e,t){return new d(u(e,t||(0,s.safeNumberType)(String(e),r)))}return y}))},36125:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLeafCount=void 0;var n=r(66212);const i="leafCount",s=["parse","typed"];t.createLeafCount=(0,n.factory)(i,s,(e=>{let{parse:t,typed:r}=e;function n(e){let t=0;return e.forEach((e=>{t+=n(e)})),t||1}return r(i,{Node:function(e){return n(e)}})}))},29066:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLyap=void 0;var n=r(66212);const i="lyap",s=["typed","matrix","sylvester","multiply","transpose"];t.createLyap=(0,n.factory)(i,s,(e=>{let{typed:t,matrix:r,sylvester:n,multiply:s,transpose:o}=e;return t(i,{"Matrix, Matrix":function(e,t){return n(e,o(e),s(-1,t))},"Array, Matrix":function(e,t){return n(r(e),o(r(e)),s(-1,t))},"Matrix, Array":function(e,t){return n(e,o(r(e)),r(s(-1,t)))},"Array, Array":function(e,t){return n(r(e),o(r(e)),r(s(-1,t))).toArray()}})}))},91266:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createPolynomialRoot=void 0;var n=r(66212);const i="polynomialRoot",s=["typed","isZero","equalScalar","add","subtract","multiply","divide","sqrt","unaryMinus","cbrt","typeOf","im","re"];t.createPolynomialRoot=(0,n.factory)(i,s,(e=>{let{typed:t,isZero:r,equalScalar:n,add:s,subtract:o,multiply:a,divide:l,sqrt:c,unaryMinus:u,cbrt:d,typeOf:h,im:p,re:m}=e;return t(i,{"number|Complex, ...number|Complex":(e,t)=>{const i=[e,...t];for(;i.length>0&&r(i[i.length-1]);)i.pop();if(i.length<2)throw new RangeError(`Polynomial [${e}, ${t}] must have a non-zero non-constant coefficient`);switch(i.length){case 2:return[u(l(i[0],i[1]))];case 3:{const[e,t,r]=i,s=a(2,r),d=a(t,t),h=a(4,r,e);if(n(d,h))return[l(u(t),s)];const p=c(o(d,h));return[l(o(p,t),s),l(o(u(p),t),s)]}case 4:{const[e,t,r,f]=i,g=u(a(3,f)),y=a(r,r),b=a(3,f,t),v=s(a(2,r,r,r),a(27,f,f,e)),_=a(9,f,r,t);if(n(y,b)&&n(v,_))return[l(r,g)];const x=o(y,b),w=o(v,_),R=s(a(18,f,r,t,e),a(r,r,t,t)),k=s(a(4,r,r,r,e),a(4,f,t,t,t),a(27,f,f,e,e));if(n(R,k))return[l(o(a(4,f,r,t),s(a(9,f,f,e),a(r,r,r))),a(f,x)),l(o(a(9,f,e),a(r,t)),a(2,x))];let j;j=n(y,b)?w:l(s(w,c(o(a(w,w),a(4,x,x,x)))),2);return d(j,!0).toArray().map((e=>l(s(r,e,l(x,e)),g))).map((e=>"Complex"===h(e)&&n(m(e),m(e)+p(e))?m(e):e))}default:throw new RangeError(`only implemented for cubic or lower-order polynomials, not ${i}`)}}})}))},75570:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRationalize=void 0;var n=r(34749),i=r(66212);const s="rationalize",o=["config","typed","equal","isZero","add","subtract","multiply","divide","pow","parse","simplifyConstant","simplifyCore","simplify","?bignumber","?fraction","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode","ParenthesisNode"];t.createRationalize=(0,i.factory)(s,o,(e=>{let{config:t,typed:r,equal:i,isZero:o,add:a,subtract:l,multiply:c,divide:u,pow:d,parse:h,simplifyConstant:p,simplifyCore:m,simplify:f,fraction:g,bignumber:y,mathWithTransform:b,matrix:v,AccessorNode:_,ArrayNode:x,ConstantNode:w,FunctionNode:R,IndexNode:k,ObjectNode:j,OperatorNode:z,SymbolNode:q,ParenthesisNode:$}=e;function Z(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const i=function(){const e=[m,{l:"n+n",r:"2*n"},{l:"n+-n",r:"0"},p,{l:"n*(n1^-1)",r:"n/n1"},{l:"n*n1^-n2",r:"n/n1^n2"},{l:"n1^-1",r:"1/n1"},{l:"n*(n1/n2)",r:"(n*n1)/n2"},{l:"1*n",r:"n"}],t=[{l:"(-n1)/(-n2)",r:"n1/n2"},{l:"(-n1)*(-n2)",r:"n1*n2"},{l:"n1--n2",r:"n1+n2"},{l:"n1-n2",r:"n1+(-n2)"},{l:"(n1+n2)*n3",r:"(n1*n3 + n2*n3)"},{l:"n1*(n2+n3)",r:"(n1*n2+n1*n3)"},{l:"c1*n + c2*n",r:"(c1+c2)*n"},{l:"c1*n + n",r:"(c1+1)*n"},{l:"c1*n - c2*n",r:"(c1-c2)*n"},{l:"c1*n - n",r:"(c1-1)*n"},{l:"v/c",r:"(1/c)*v"},{l:"v/-c",r:"-(1/c)*v"},{l:"-v*-c",r:"c*v"},{l:"-v*c",r:"-c*v"},{l:"v*-c",r:"-c*v"},{l:"v*c",r:"c*v"},{l:"-(-n1*n2)",r:"(n1*n2)"},{l:"-(n1*n2)",r:"(-n1*n2)"},{l:"-(-n1+n2)",r:"(n1-n2)"},{l:"-(n1+n2)",r:"(-n1-n2)"},{l:"(n1^n2)^n3",r:"(n1^(n2*n3))"},{l:"-(-n1/n2)",r:"(n1/n2)"},{l:"-(n1/n2)",r:"(-n1/n2)"}],r=[{l:"(n1/n2 + n3/n4)",r:"((n1*n4 + n3*n2)/(n2*n4))"},{l:"(n1/n2 + n3)",r:"((n1 + n3*n2)/n2)"},{l:"(n1 + n2/n3)",r:"((n1*n3 + n2)/n3)"}],n=[{l:"(n1/(n2/n3))",r:"((n1*n3)/n2)"},{l:"(n1/n2/n3)",r:"(n1/(n2*n3))"}],i={};return i.firstRules=e.concat(t,n),i.distrDivRules=r,i.sucDivRules=n,i.firstRulesAgain=e.concat(t),i.finalRules=[m,{l:"n*-n",r:"-n^2"},{l:"n*n",r:"n^2"},p,{l:"n*-n^n1",r:"-n^(n1+1)"},{l:"n*n^n1",r:"n^(n1+1)"},{l:"n^n1*-n^n2",r:"-n^(n1+n2)"},{l:"n^n1*n^n2",r:"n^(n1+n2)"},{l:"n^n1*-n",r:"-n^(n1+1)"},{l:"n^n1*n",r:"n^(n1+1)"},{l:"n^n1/-n",r:"-n^(n1-1)"},{l:"n^n1/n",r:"n^(n1-1)"},{l:"n/-n^n1",r:"-n^(1-n1)"},{l:"n/n^n1",r:"n^(1-n1)"},{l:"n^n1/-n^n2",r:"n^(n1-n2)"},{l:"n^n1/n^n2",r:"n^(n1-n2)"},{l:"n1+(-n2*n3)",r:"n1-n2*n3"},{l:"v*(-c)",r:"-c*v"},{l:"n1+-n2",r:"n1-n2"},{l:"v*c",r:"c*v"},{l:"(n1^n2)^n3",r:"(n1^(n2*n3))"}],i}(),s=function(e,t,r,i){const s=[],o=f(e,i,t,{exactFractions:!1}),a="+-*"+((r=!!r)?"/":"");c(o);const l={};return l.expression=o,l.variables=s,l;function c(e){const t=e.type;if("FunctionNode"===t)throw new Error("There is an unsolved function call");if("OperatorNode"===t)if("^"===e.op){if("ConstantNode"!==e.args[1].type||!(0,n.isInteger)(parseFloat(e.args[1].value)))throw new Error("There is a non-integer exponent");c(e.args[0])}else{if(!a.includes(e.op))throw new Error("Operator "+e.op+" invalid in polynomial expression");for(let t=0;t<e.args.length;t++)c(e.args[t])}else if("SymbolNode"===t){const t=e.name;-1===s.indexOf(t)&&s.push(t)}else if("ParenthesisNode"===t)c(e.content);else if("ConstantNode"!==t)throw new Error("type "+t+" is not allowed in polynomial expression")}}(e,t,!0,i.firstRules),o=s.variables.length,a={exactFractions:!1},l={exactFractions:!0};if(e=s.expression,o>=1){let t,r;e=X(e);let n,s=!0,o=!1;for(e=f(e,i.firstRules,{},a);r=s?i.distrDivRules:i.sucDivRules,s=!s,n=(e=f(e,r,{},l)).toString(),n!==t;)o=!0,t=n;o&&(e=f(e,i.firstRulesAgain,{},a)),e=f(e,i.finalRules,{},a)}const c=[],u={};return"OperatorNode"===e.type&&e.isBinary()&&"/"===e.op?(1===o&&(e.args[0]=Y(e.args[0],c),e.args[1]=Y(e.args[1])),r&&(u.numerator=e.args[0],u.denominator=e.args[1])):(1===o&&(e=Y(e,c)),r&&(u.numerator=e,u.denominator=null)),r?(u.coefficients=c,u.variables=s.variables,u.expression=e,u):e}return r(s,{Node:Z,"Node, boolean":(e,t)=>Z(e,{},t),"Node, Object":Z,"Node, Object, boolean":Z});function X(e,t,r){const i=e.type,s=arguments.length>1;if("OperatorNode"===i&&e.isBinary()){let i,o=!1;if("^"===e.op&&("ParenthesisNode"!==e.args[0].type&&"OperatorNode"!==e.args[0].type||"ConstantNode"!==e.args[1].type||(i=parseFloat(e.args[1].value),o=i>=2&&(0,n.isInteger)(i))),o){if(i>2){const t=e.args[0],r=new z("^","pow",[e.args[0].cloneDeep(),new w(i-1)]);e=new z("*","multiply",[t,r])}else e=new z("*","multiply",[e.args[0],e.args[0].cloneDeep()]);s&&("content"===r?t.content=e:t.args[r]=e)}}if("ParenthesisNode"===i)X(e.content,e,"content");else if("ConstantNode"!==i&&"SymbolNode"!==i)for(let t=0;t<e.args.length;t++)X(e.args[t],e,t);if(!s)return e}function Y(e,t){void 0===t&&(t=[]),t[0]=0;const r={cte:1,oper:"+",fire:""};let i=0,s="";!function e(r,o,a){const l=r.type;if("FunctionNode"===l)throw new Error("There is an unsolved function call");if("OperatorNode"===l){if(!"+-*^".includes(r.op))throw new Error("Operator "+r.op+" invalid");if(null!==o){if(("unaryMinus"===r.fn||"pow"===r.fn)&&"add"!==o.fn&&"subtract"!==o.fn&&"multiply"!==o.fn)throw new Error("Invalid "+r.op+" placing");if(("subtract"===r.fn||"add"===r.fn||"multiply"===r.fn)&&"add"!==o.fn&&"subtract"!==o.fn)throw new Error("Invalid "+r.op+" placing");if(("subtract"===r.fn||"add"===r.fn||"unaryMinus"===r.fn)&&0!==a.noFil)throw new Error("Invalid "+r.op+" placing")}"^"!==r.op&&"*"!==r.op||(a.fire=r.op);for(let t=0;t<r.args.length;t++)"unaryMinus"===r.fn&&(a.oper="-"),"+"!==r.op&&"subtract"!==r.fn||(a.fire="",a.cte=1,a.oper=0===t?"+":r.op),a.noFil=t,e(r.args[t],r,a)}else if("SymbolNode"===l){if(r.name!==s&&""!==s)throw new Error("There is more than one variable");if(s=r.name,null===o)return void(t[1]=1);if("^"===o.op&&0!==a.noFil)throw new Error("In power the variable should be the first parameter");if("*"===o.op&&1!==a.noFil)throw new Error("In multiply the variable should be the second parameter");""!==a.fire&&"*"!==a.fire||(i<1&&(t[1]=0),t[1]+=a.cte*("+"===a.oper?1:-1),i=Math.max(1,i))}else{if("ConstantNode"!==l)throw new Error("Type "+l+" is not allowed");{const e=parseFloat(r.value);if(null===o)return void(t[0]=e);if("^"===o.op){if(1!==a.noFil)throw new Error("Constant cannot be powered");if(!(0,n.isInteger)(e)||e<=0)throw new Error("Non-integer exponent is not allowed");for(let r=i+1;r<e;r++)t[r]=0;return e>i&&(t[e]=0),t[e]+=a.cte*("+"===a.oper?1:-1),void(i=Math.max(e,i))}a.cte=e,""===a.fire&&(t[0]+=a.cte*("+"===a.oper?1:-1))}}}(e,null,r),i=t.length-1;let o,a=!0;for(let e=i;e>=0;e--){if(0===t[e])continue;let r=new w(a?t[e]:Math.abs(t[e]));const n=t[e]<0?"-":"+";if(e>0){let n=new q(s);if(e>1){const t=new w(e);n=new z("^","pow",[n,t])}r=-1===t[e]&&a?new z("-","unaryMinus",[n]):1===Math.abs(t[e])?n:new z("*","multiply",[r,n])}o=a?r:"+"===n?new z("+","add",[o,r]):new z("-","subtract",[o,r]),a=!1}return a?new w(0):o}}))},90626:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createResolve=void 0;var n=r(81072),i=r(91612),s=r(66212);const o=["typed","parse","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode"];t.createResolve=(0,s.factory)("resolve",o,(e=>{let{typed:t,parse:r,ConstantNode:s,FunctionNode:o,OperatorNode:a,ParenthesisNode:l}=e;function c(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set;if(!t)return e;if((0,i.isSymbolNode)(e)){if(n.has(e.name)){const e=Array.from(n).join(", ");throw new ReferenceError(`recursive loop of variable definitions among {${e}}`)}const o=t.get(e.name);if((0,i.isNode)(o)){const r=new Set(n);return r.add(e.name),c(o,t,r)}return"number"==typeof o?r(String(o)):void 0!==o?new s(o):e}if((0,i.isOperatorNode)(e)){const r=e.args.map((function(e){return c(e,t,n)}));return new a(e.op,e.fn,r,e.implicit)}if((0,i.isParenthesisNode)(e))return new l(c(e.content,t,n));if((0,i.isFunctionNode)(e)){const r=e.args.map((function(e){return c(e,t,n)}));return new o(e.name,r)}return e.map((e=>c(e,t,n)))}return t("resolve",{Node:c,"Node, Map | null | undefined":c,"Node, Object":(e,t)=>c(e,(0,n.createMap)(t)),"Array | Matrix":t.referToSelf((e=>t=>t.map((t=>e(t))))),"Array | Matrix, null | undefined":t.referToSelf((e=>t=>t.map((t=>e(t))))),"Array, Object":t.referTo("Array,Map",(e=>(t,r)=>e(t,(0,n.createMap)(r)))),"Matrix, Object":t.referTo("Matrix,Map",(e=>(t,r)=>e(t,(0,n.createMap)(r)))),"Array | Matrix, Map":t.referToSelf((e=>(t,r)=>t.map((t=>e(t,r)))))})}))},91779:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSimplify=void 0;var n=r(91612),i=r(47271),s=r(66212),o=r(30606),a=r(61175),l=r(81072);const c=["config","typed","parse","add","subtract","multiply","divide","pow","isZero","equal","resolve","simplifyConstant","simplifyCore","?fraction","?bignumber","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"];t.createSimplify=(0,s.factory)("simplify",c,(e=>{let{config:t,typed:r,parse:s,add:c,subtract:u,multiply:d,divide:h,pow:p,isZero:m,equal:f,resolve:g,simplifyConstant:y,simplifyCore:b,fraction:v,bignumber:_,mathWithTransform:x,matrix:w,AccessorNode:R,ArrayNode:k,ConstantNode:j,FunctionNode:z,IndexNode:q,ObjectNode:$,OperatorNode:Z,ParenthesisNode:X,SymbolNode:Y}=e;const{hasProperty:ee,isCommutative:te,isAssociative:re,mergeContext:ne,flatten:ie,unflattenr:se,unflattenl:oe,createMakeNodeFunction:ae,defaultContext:le,realContext:ce,positiveContext:ue}=(0,o.createUtil)({FunctionNode:z,OperatorNode:Z,SymbolNode:Y});r.addConversion({from:"Object",to:"Map",convert:l.createMap});const de=r("simplify",{Node:ye,"Node, Map":(e,t)=>ye(e,!1,t),"Node, Map, Object":(e,t,r)=>ye(e,!1,t,r),"Node, Array":ye,"Node, Array, Map":ye,"Node, Array, Map, Object":ye});function he(e){return e.transform((function(e,t,r){return(0,n.isParenthesisNode)(e)?he(e.content):e}))}r.removeConversion({from:"Object",to:"Map",convert:l.createMap}),de.defaultContext=le,de.realContext=ce,de.positiveContext=ue;const pe={true:!0,false:!0,e:!0,i:!0,Infinity:!0,LN2:!0,LN10:!0,LOG2E:!0,LOG10E:!0,NaN:!0,phi:!0,pi:!0,SQRT1_2:!0,SQRT2:!0,tau:!0};function me(e,t){const r={};if(e.s){const t=e.s.split("->");if(2!==t.length)throw SyntaxError("Could not parse rule: "+e.s);r.l=t[0],r.r=t[1]}else r.l=e.l,r.r=e.r;r.l=he(s(r.l)),r.r=he(s(r.r));for(const t of["imposeContext","repeat","assuming"])t in e&&(r[t]=e[t]);if(e.evaluate&&(r.evaluate=s(e.evaluate)),re(r.l,t)){const e=!te(r.l,t);let n;e&&(n=ge());const i=ae(r.l),s=ge();r.expanded={},r.expanded.l=i([r.l,s]),ie(r.expanded.l,t),se(r.expanded.l,t),r.expanded.r=i([r.r,s]),e&&(r.expandedNC1={},r.expandedNC1.l=i([n,r.l]),r.expandedNC1.r=i([n,r.r]),r.expandedNC2={},r.expandedNC2.l=i([n,r.expanded.l]),r.expandedNC2.r=i([n,r.expanded.r]))}return r}de.rules=[b,{l:"log(e)",r:"1"},{s:"n-n1 -> n+-n1",assuming:{subtract:{total:!0}}},{s:"n-n -> 0",assuming:{subtract:{total:!1}}},{s:"-(cl*v) -> v * (-cl)",assuming:{multiply:{commutative:!0},subtract:{total:!0}}},{s:"-(cl*v) -> (-cl) * v",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{s:"-(v*cl) -> v * (-cl)",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{l:"-(n1/n2)",r:"-n1/n2"},{l:"-v",r:"v * (-1)"},{l:"(n1 + n2)*(-1)",r:"n1*(-1) + n2*(-1)",repeat:!0},{l:"n/n1^n2",r:"n*n1^-n2"},{l:"n/n1",r:"n*n1^-1"},{s:"(n1*n2)^n3 -> n1^n3 * n2^n3",assuming:{multiply:{commutative:!0}}},{s:"(n1*n2)^(-1) -> n2^(-1) * n1^(-1)",assuming:{multiply:{commutative:!1}}},{s:"(n ^ n1) ^ n2 -> n ^ (n1 * n2)",assuming:{divide:{total:!0}}},{l:" vd   * ( vd   * n1 + n2)",r:"vd^2       * n1 +  vd   * n2"},{s:" vd   * (vd^n4 * n1 + n2)   ->  vd^(1+n4)  * n1 +  vd   * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * ( vd   * n1 + n2)   ->  vd^(n3+1)  * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * (vd^n4 * n1 + n2)   ->  vd^(n3+n4) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{l:"n*n",r:"n^2"},{s:"n * n^n1 -> n^(n1+1)",assuming:{divide:{total:!0}}},{s:"n^n1 * n^n2 -> n^(n1+n2)",assuming:{divide:{total:!0}}},y,{s:"n+n -> 2*n",assuming:{add:{total:!0}}},{l:"n+-n",r:"0"},{l:"vd*n + vd",r:"vd*(n+1)"},{l:"n3*n1 + n3*n2",r:"n3*(n1+n2)"},{l:"n3^(-n4)*n1 +   n3  * n2",r:"n3^(-n4)*(n1 + n3^(n4+1) *n2)"},{l:"n3^(-n4)*n1 + n3^n5 * n2",r:"n3^(-n4)*(n1 + n3^(n4+n5)*n2)"},{s:"n*vd + vd -> (n+1)*vd",assuming:{multiply:{commutative:!1}}},{s:"vd + n*vd -> (1+n)*vd",assuming:{multiply:{commutative:!1}}},{s:"n1*n3 + n2*n3 -> (n1+n2)*n3",assuming:{multiply:{commutative:!1}}},{s:"n^n1 * n -> n^(n1+1)",assuming:{divide:{total:!0},multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3    -> (n1 + n2*n3^(n4 +  1))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3^n5 -> (n1 + n2*n3^(n4 + n5))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{l:"n*cd + cd",r:"(n+1)*cd"},{s:"cd*n + cd -> cd*(n+1)",assuming:{multiply:{commutative:!1}}},{s:"cd + cd*n -> cd*(1+n)",assuming:{multiply:{commutative:!1}}},y,{s:"(-n)*n1 -> -(n*n1)",assuming:{subtract:{total:!0}}},{s:"n1*(-n) -> -(n1*n)",assuming:{subtract:{total:!0},multiply:{commutative:!1}}},{s:"ce+ve -> ve+ce",assuming:{add:{commutative:!0}},imposeContext:{add:{commutative:!1}}},{s:"vd*cd -> cd*vd",assuming:{multiply:{commutative:!0}},imposeContext:{multiply:{commutative:!1}}},{l:"n+-n1",r:"n-n1"},{l:"n+-(n1)",r:"n-(n1)"},{s:"n*(n1^-1) -> n/n1",assuming:{multiply:{commutative:!0}}},{s:"n*n1^-n2 -> n/n1^n2",assuming:{multiply:{commutative:!0}}},{s:"n^-1 -> 1/n",assuming:{multiply:{commutative:!0}}},{l:"n^1",r:"n"},{s:"n*(n1/n2) -> (n*n1)/n2",assuming:{multiply:{associative:!0}}},{s:"n-(n1+n2) -> n-n1-n2",assuming:{addition:{associative:!0,commutative:!0}}},{l:"1*n",r:"n",imposeContext:{multiply:{commutative:!0}}},{s:"n1/(n2/n3) -> (n1*n3)/n2",assuming:{multiply:{associative:!0}}},{l:"n1/(-n2)",r:"-n1/n2"}];let fe=0;function ge(){return new Y("_p"+fe++)}function ye(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:(0,l.createEmptyMap)(),n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=n.consoleDebug;t=function(e,t){const r=[];for(let n=0;n<e.length;n++){let i,s=e[n];const o=typeof s;switch(o){case"string":s={s};case"object":i=me(s,t);break;case"function":i=s;break;default:throw TypeError("Unsupported type of rule: "+o)}r.push(i)}return r}(t||de.rules,n.context);let s=g(e,r);s=he(s);const o={};let a=s.toString({parenthesis:"all"});for(;!o[a];){o[a]=!0,fe=0;let e=a;i&&console.log("Working on: ",a);for(let r=0;r<t.length;r++){let o="";if("function"==typeof t[r]?(s=t[r](s,n),i&&(o=t[r].name)):(ie(s,n.context),s=ve(s,t[r],n.context),i&&(o=`${t[r].l.toString()} -> ${t[r].r.toString()}`)),i){const t=s.toString({parenthesis:"all"});t!==e&&(console.log("Applying",o,"produced",t),e=t)}oe(s,n.context)}a=s.toString({parenthesis:"all"})}return s}function be(e,t,r){let n=e;if(e)for(let i=0;i<e.length;++i){const s=ve(e[i],t,r);s!==e[i]&&(n===e&&(n=e.slice()),n[i]=s)}return n}function ve(e,t,r){if(t.assuming)for(const n in t.assuming)for(const i in t.assuming[n])if(ee(n,i,r)!==t.assuming[n][i])return e;const n=ne(t.imposeContext,r);let i=e;if(i instanceof Z||i instanceof z){const e=be(i.args,t,r);e!==i.args&&(i=i.clone(),i.args=e)}else if(i instanceof X){if(i.content){const e=ve(i.content,t,r);e!==i.content&&(i=new X(e))}}else if(i instanceof k){const e=be(i.items,t,r);e!==i.items&&(i=new k(e))}else if(i instanceof R){let e=i.object;i.object&&(e=ve(i.object,t,r));let n=i.index;i.index&&(n=ve(i.index,t,r)),e===i.object&&n===i.index||(i=new R(e,n))}else if(i instanceof q){const e=be(i.dimensions,t,r);e!==i.dimensions&&(i=new q(e))}else if(i instanceof $){let e=!1;const n={};for(const s in i.properties)n[s]=ve(i.properties[s],t,r),n[s]!==i.properties[s]&&(e=!0);e&&(i=new $(n))}let s=t.r,o=we(t.l,i,n)[0];if(!o&&t.expanded&&(s=t.expanded.r,o=we(t.expanded.l,i,n)[0]),!o&&t.expandedNC1&&(s=t.expandedNC1.r,o=we(t.expandedNC1.l,i,n)[0],o||(s=t.expandedNC2.r,o=we(t.expandedNC2.l,i,n)[0])),o){const e=i.implicit;i=s.clone(),e&&"implicit"in s&&(i.implicit=!0),i=i.transform((function(e){return e.isSymbolNode&&(0,a.hasOwnProperty)(o.placeholders,e.name)?o.placeholders[e.name].clone():e}))}return t.repeat&&i!==e&&(i=ve(i,t,r)),i}function _e(e,t){const r={placeholders:{}};if(!e.placeholders&&!t.placeholders)return r;if(!e.placeholders)return t;if(!t.placeholders)return e;for(const n in e.placeholders)if((0,a.hasOwnProperty)(e.placeholders,n)&&(r.placeholders[n]=e.placeholders[n],(0,a.hasOwnProperty)(t.placeholders,n)&&!Se(e.placeholders[n],t.placeholders[n])))return null;for(const e in t.placeholders)(0,a.hasOwnProperty)(t.placeholders,e)&&(r.placeholders[e]=t.placeholders[e]);return r}function xe(e,t){const r=[];if(0===e.length||0===t.length)return r;let n;for(let i=0;i<e.length;i++)for(let s=0;s<t.length;s++)n=_e(e[i],t[s]),n&&r.push(n);return r}function we(e,t,r,n){let s=[{placeholders:{}}];if(e instanceof Z&&t instanceof Z||e instanceof z&&t instanceof z){if(e instanceof Z){if(e.op!==t.op||e.fn!==t.fn)return[]}else if(e instanceof z&&e.name!==t.name)return[];if(!(1===t.args.length&&1===e.args.length||!re(t,r)&&t.args.length===e.args.length||n)){if(t.args.length>=2&&2===e.args.length){const n=function(e,t){const r=[];let n,i;const s=ae(e);if(te(e,t))for(let t=0;t<e.args.length;t++)i=e.args.slice(0),i.splice(t,1),n=1===i.length?i[0]:s(i),r.push(s([e.args[t],n]));else for(let t=1;t<e.args.length;t++){let o=e.args[0];t>1&&(o=s(e.args.slice(0,t))),i=e.args.slice(t),n=1===i.length?i[0]:s(i),r.push(s([o,n]))}return r}(t,r);let i=[];for(let t=0;t<n.length;t++){const s=we(e,n[t],r,!0);i=i.concat(s)}return i}if(e.args.length>2)throw Error("Unexpected non-binary associative function: "+e.toString());return[]}{let n=[];for(let i=0;i<e.args.length;i++){const s=we(e.args[i],t.args[i],r);if(0===s.length)break;n.push(s)}if(n.length!==e.args.length){if(!te(t,r)||1===e.args.length)return[];if(e.args.length>2)throw new Error("permuting >2 commutative non-associative rule arguments not yet implemented");const i=we(e.args[0],t.args[1],r);if(0===i.length)return[];const s=we(e.args[1],t.args[0],r);if(0===s.length)return[];n=[i,s]}s=function(e){if(0===e.length)return e;const t=e.reduce(xe),r=[],n={};for(let e=0;e<t.length;e++){const i=JSON.stringify(t[e]);n[i]||(n[i]=!0,r.push(t[e]))}return r}(n)}}else if(e instanceof Y){if(0===e.name.length)throw new Error("Symbol in rule has 0 length...!?");if(pe[e.name]){if(e.name!==t.name)return[]}else switch(e.name[1]>="a"&&e.name[1]<="z"?e.name.substring(0,2):e.name[0]){case"n":case"_p":s[0].placeholders[e.name]=t;break;case"c":case"cl":if(!(0,i.isConstantNode)(t))return[];s[0].placeholders[e.name]=t;break;case"v":if((0,i.isConstantNode)(t))return[];s[0].placeholders[e.name]=t;break;case"vl":if(!(0,i.isVariableNode)(t))return[];s[0].placeholders[e.name]=t;break;case"cd":if(!(0,i.isNumericNode)(t))return[];s[0].placeholders[e.name]=t;break;case"vd":if((0,i.isNumericNode)(t))return[];s[0].placeholders[e.name]=t;break;case"ce":if(!(0,i.isConstantExpression)(t))return[];s[0].placeholders[e.name]=t;break;case"ve":if((0,i.isConstantExpression)(t))return[];s[0].placeholders[e.name]=t;break;default:throw new Error("Invalid symbol in rule: "+e.name)}}else{if(!(e instanceof j))return[];if(!f(e.value,t.value))return[]}return s}function Se(e,t){if(e instanceof j&&t instanceof j){if(!f(e.value,t.value))return!1}else if(e instanceof Y&&t instanceof Y){if(e.name!==t.name)return!1}else{if(!(e instanceof Z&&t instanceof Z||e instanceof z&&t instanceof z))return!1;if(e instanceof Z){if(e.op!==t.op||e.fn!==t.fn)return!1}else if(e instanceof z&&e.name!==t.name)return!1;if(e.args.length!==t.args.length)return!1;for(let r=0;r<e.args.length;r++)if(!Se(e.args[r],t.args[r]))return!1}return!0}return de}))},30606:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createUtil=void 0;var n=r(91612),i=r(66212),s=r(61175);const o=["FunctionNode","OperatorNode","SymbolNode"];t.createUtil=(0,i.factory)("simplifyUtil",o,(e=>{let{FunctionNode:t,OperatorNode:r,SymbolNode:i}=e;const o=!0,a=!1,l="defaultF",c={add:{trivial:o,total:o,commutative:o,associative:o},unaryPlus:{trivial:o,total:o,commutative:o,associative:o},subtract:{trivial:a,total:o,commutative:a,associative:a},multiply:{trivial:o,total:o,commutative:o,associative:o},divide:{trivial:a,total:o,commutative:a,associative:a},paren:{trivial:o,total:o,commutative:o,associative:a},defaultF:{trivial:a,total:o,commutative:a,associative:a}};function u(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c,i=l;if("string"==typeof e?i=e:(0,n.isOperatorNode)(e)?i=e.fn.toString():(0,n.isFunctionNode)(e)?i=e.name:(0,n.isParenthesisNode)(e)&&(i="paren"),(0,s.hasOwnProperty)(r,i)){const e=r[i];if((0,s.hasOwnProperty)(e,t))return e[t];if((0,s.hasOwnProperty)(c,i))return c[i][t]}if((0,s.hasOwnProperty)(r,l)){const e=r[l];return(0,s.hasOwnProperty)(e,t)?e[t]:c[l][t]}if((0,s.hasOwnProperty)(c,i)){const e=c[i];if((0,s.hasOwnProperty)(e,t))return e[t]}return c[l][t]}function d(e){return u(e,"associative",arguments.length>1&&void 0!==arguments[1]?arguments[1]:c)}function h(e,t){let r;const i=[],s=function(e){for(let t=0;t<e.args.length;t++){const o=e.args[t];(0,n.isOperatorNode)(o)&&r===o.op?s(o):i.push(o)}};return d(e,t)?(r=e.op,s(e),i):e.args}function p(e){return(0,n.isOperatorNode)(e)?function(t){try{return new r(e.op,e.fn,t,e.implicit)}catch(e){return console.error(e),[]}}:function(r){return new t(new i(e.name),r)}}return{createMakeNodeFunction:p,hasProperty:u,isCommutative:function(e){return u(e,"commutative",arguments.length>1&&void 0!==arguments[1]?arguments[1]:c)},isAssociative:d,mergeContext:function(e,t){const r={...e};for(const n in t)(0,s.hasOwnProperty)(e,n)?r[n]={...t[n],...e[n]}:r[n]=t[n];return r},flatten:function e(t,r){if(!t.args||0===t.args.length)return t;t.args=h(t,r);for(let n=0;n<t.args.length;n++)e(t.args[n],r)},allChildren:h,unflattenr:function e(t,r){if(!t.args||0===t.args.length)return;const n=p(t),i=t.args.length;for(let n=0;n<i;n++)e(t.args[n],r);if(i>2&&d(t,r)){let e=t.args.pop();for(;t.args.length>0;)e=n([t.args.pop(),e]);t.args=e.args}},unflattenl:function e(t,r){if(!t.args||0===t.args.length)return;const n=p(t),i=t.args.length;for(let n=0;n<i;n++)e(t.args[n],r);if(i>2&&d(t,r)){let e=t.args.shift();for(;t.args.length>0;)e=n([e,t.args.shift()]);t.args=e.args}},defaultContext:c,realContext:{divide:{total:a},log:{total:a}},positiveContext:{subtract:{total:a},abs:{trivial:o},log:{total:o}}}}))},47271:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isConstantExpression=function e(t){if((0,n.isConstantNode)(t))return!0;if(((0,n.isFunctionNode)(t)||(0,n.isOperatorNode)(t))&&t.args.every(e))return!0;if((0,n.isParenthesisNode)(t)&&e(t.content))return!0;return!1},Object.defineProperty(t,"isConstantNode",{enumerable:!0,get:function(){return n.isConstantNode}}),t.isNumericNode=function(e){return(0,n.isConstantNode)(e)||(0,n.isOperatorNode)(e)&&e.isUnary()&&(0,n.isConstantNode)(e.args[0])},Object.defineProperty(t,"isVariableNode",{enumerable:!0,get:function(){return n.isSymbolNode}});var n=r(91612)},27391:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSimplifyConstant=void 0;var n=r(91612),i=r(66212),s=r(34749),o=r(30606),a=r(10604);const l=["typed","config","mathWithTransform","matrix","?fraction","?bignumber","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode"];t.createSimplifyConstant=(0,i.factory)("simplifyConstant",l,(e=>{let{typed:t,config:r,mathWithTransform:i,matrix:l,fraction:c,bignumber:u,AccessorNode:d,ArrayNode:h,ConstantNode:p,FunctionNode:m,IndexNode:f,ObjectNode:g,OperatorNode:y,SymbolNode:b}=e;const{isCommutative:v,isAssociative:_,allChildren:x,createMakeNodeFunction:w}=(0,o.createUtil)({FunctionNode:m,OperatorNode:y,SymbolNode:b}),R=t("simplifyConstant",{Node:e=>q(ee(e,{})),"Node, Object":function(e,t){return q(ee(e,t))}});function k(e){return(0,n.isFraction)(e)?e.valueOf():e instanceof Array?e.map(k):(0,n.isMatrix)(e)?l(k(e.valueOf())):e}function j(e,t,r){try{return i[e].apply(null,t)}catch(n){return t=t.map(k),Z(i[e].apply(null,t),r)}}const z=t({Fraction:function(e){let t;const r=e.s*e.n;t=r<0?new y("-","unaryMinus",[new p(-r)]):new p(r);if(1===e.d)return t;return new y("/","divide",[t,new p(e.d)])},number:function(e){return e<0?X(new p(-e)):new p(e)},BigNumber:function(e){return e<0?X(new p(-e)):new p(e)},bigint:function(e){return e<0n?X(new p(-e)):new p(e)},Complex:function(e){throw new Error("Cannot convert Complex number to Node")},string:function(e){return new p(e)},Matrix:function(e){return new h(e.valueOf().map((e=>z(e))))}});function q(e){return(0,n.isNode)(e)?e:z(e)}function $(e,t){if(t&&!1!==t.exactFractions&&isFinite(e)&&c){const r=c(e),n=t&&"number"==typeof t.fractionsLimit?t.fractionsLimit:1/0;if(r.valueOf()===e&&r.n<n&&r.d<n)return r}return e}const Z=t({"string, Object":function(e,t){const n=(0,s.safeNumberType)(e,r);if("BigNumber"===n)return void 0===u&&(0,a.noBignumber)(),u(e);if("bigint"===n)return BigInt(e);if("Fraction"===n)return void 0===c&&(0,a.noFraction)(),c(e);return $(parseFloat(e),t)},"Fraction, Object":function(e,t){return e},"BigNumber, Object":function(e,t){return e},"number, Object":function(e,t){return $(e,t)},"bigint, Object":function(e,t){return e},"Complex, Object":function(e,t){return 0!==e.im?e:$(e.re,t)},"Matrix, Object":function(e,t){return l($(e.valueOf()))},"Array, Object":function(e,t){return e.map($)}});function X(e){return new y("-","unaryMinus",[e])}function Y(e,t,r,i){const s=t.shift(),o=t.reduce(((t,s)=>{if(!(0,n.isNode)(s)){const r=t.pop();if((0,n.isNode)(r))return[r,s];try{return t.push(j(e,[r,s],i)),t}catch(e){t.push(r)}}t.push(q(t.pop()));const o=1===t.length?t[0]:r(t);return[r([o,q(s)])]}),[s]);return 1===o.length?o[0]:r([o[0],z(o[1])])}function ee(e,t){switch(e.type){case"SymbolNode":return e;case"ConstantNode":switch(typeof e.value){case"number":case"bigint":return Z(e.value,t);case"string":return e.value;default:if(!isNaN(e.value))return Z(e.value,t)}return e;case"FunctionNode":if(i[e.name]&&i[e.name].rawArgs)return e;if(!["add","multiply"].includes(e.name)){const r=e.args.map((e=>ee(e,t)));if(!r.some(n.isNode))try{return j(e.name,r,t)}catch(e){}if("size"===e.name&&1===r.length&&(0,n.isArrayNode)(r[0])){const e=[];let t=r[0];for(;(0,n.isArrayNode)(t);)e.push(t.items.length),t=t.items[0];return l(e)}return new m(e.name,r.map(q))}case"OperatorNode":{const r=e.fn.toString();let i,s;const o=w(e);if((0,n.isOperatorNode)(e)&&e.isUnary())i=[ee(e.args[0],t)],s=(0,n.isNode)(i[0])?o(i):j(r,i,t);else if(_(e,t.context))if(i=x(e,t.context),i=i.map((e=>ee(e,t))),v(r,t.context)){const e=[],a=[];for(let t=0;t<i.length;t++)(0,n.isNode)(i[t])?a.push(i[t]):e.push(i[t]);e.length>1?(s=Y(r,e,o,t),a.unshift(s),s=Y(r,a,o,t)):s=Y(r,i,o,t)}else s=Y(r,i,o,t);else i=e.args.map((e=>ee(e,t))),s=Y(r,i,o,t);return s}case"ParenthesisNode":return ee(e.content,t);case"AccessorNode":return function(e,t,r){if(!(0,n.isIndexNode)(t))return new d(q(e),q(t));if((0,n.isArrayNode)(e)||(0,n.isMatrix)(e)){const i=Array.from(t.dimensions);for(;i.length>0;)if((0,n.isConstantNode)(i[0])&&"string"!=typeof i[0].value){const t=Z(i.shift().value,r);(0,n.isArrayNode)(e)?e=e.items[t-1]:(e=e.valueOf()[t-1])instanceof Array&&(e=l(e))}else{if(!(i.length>1&&(0,n.isConstantNode)(i[1])&&"string"!=typeof i[1].value))break;{const t=Z(i[1].value,r),s=[],o=(0,n.isArrayNode)(e)?e.items:e.valueOf();for(const r of o)if((0,n.isArrayNode)(r))s.push(r.items[t-1]);else{if(!(0,n.isMatrix)(e))break;s.push(r[t-1])}if(s.length!==o.length)break;e=(0,n.isArrayNode)(e)?new h(s):l(s),i.splice(1,1)}}return i.length===t.dimensions.length?new d(q(e),t):i.length>0?(t=new f(i),new d(q(e),t)):e}if((0,n.isObjectNode)(e)&&1===t.dimensions.length&&(0,n.isConstantNode)(t.dimensions[0])){const r=t.dimensions[0].value;return r in e.properties?e.properties[r]:new p}return new d(q(e),t)}(ee(e.object,t),ee(e.index,t),t);case"ArrayNode":{const r=e.items.map((e=>ee(e,t)));return r.some(n.isNode)?new h(r.map(q)):l(r)}case"IndexNode":return new f(e.dimensions.map((e=>R(e,t))));case"ObjectNode":{const r={};for(const n in e.properties)r[n]=R(e.properties[n],t);return new g(r)}default:throw new Error(`Unimplemented node type in simplifyConstant: ${e.type}`)}}return R}))},22416:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSimplifyCore=void 0;var n=r(91612),i=r(7806),s=r(30606),o=r(66212);const a="simplifyCore",l=["typed","parse","equal","isZero","add","subtract","multiply","divide","pow","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"];t.createSimplifyCore=(0,o.factory)(a,l,(e=>{let{typed:t,parse:r,equal:o,isZero:l,add:c,subtract:u,multiply:d,divide:h,pow:p,AccessorNode:m,ArrayNode:f,ConstantNode:g,FunctionNode:y,IndexNode:b,ObjectNode:v,OperatorNode:_,ParenthesisNode:x,SymbolNode:w}=e;const R=new g(0),k=new g(1),j=new g(!0),z=new g(!1);function q(e){return(0,n.isOperatorNode)(e)&&["and","not","or"].includes(e.op)}const{hasProperty:$,isCommutative:Z}=(0,s.createUtil)({FunctionNode:y,OperatorNode:_,SymbolNode:w});function X(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=t?t.context:void 0;if($(e,"trivial",r)){if((0,n.isFunctionNode)(e)&&1===e.args.length)return X(e.args[0],t);let r=!1,i=0;if(e.forEach((e=>{++i,1===i&&(r=X(e,t))})),1===i)return r}let s=e;if((0,n.isFunctionNode)(s)){const e=(0,i.getOperator)(s.name);if(!e)return new y(X(s.fn),s.args.map((e=>X(e,t))));if(s.args.length>2&&$(s,"associative",r))for(;s.args.length>2;){const t=s.args.pop(),r=s.args.pop();s.args.push(new _(e,s.name,[t,r]))}s=new _(e,s.name,s.args)}if((0,n.isOperatorNode)(s)&&s.isUnary()){const e=X(s.args[0],t);if("~"===s.op&&(0,n.isOperatorNode)(e)&&e.isUnary()&&"~"===e.op)return e.args[0];if("not"===s.op&&(0,n.isOperatorNode)(e)&&e.isUnary()&&"not"===e.op&&q(e.args[0]))return e.args[0];let r=!0;if("-"===s.op&&(0,n.isOperatorNode)(e)&&(e.isBinary()&&"subtract"===e.fn&&(s=new _("-","subtract",[e.args[1],e.args[0]]),r=!1),e.isUnary()&&"-"===e.op))return e.args[0];if(r)return new _(s.op,s.fn,[e])}if((0,n.isOperatorNode)(s)&&s.isBinary()){const e=X(s.args[0],t);let i=X(s.args[1],t);if("+"===s.op){if((0,n.isConstantNode)(e)&&l(e.value))return i;if((0,n.isConstantNode)(i)&&l(i.value))return e;(0,n.isOperatorNode)(i)&&i.isUnary()&&"-"===i.op&&(i=i.args[0],s=new _("-","subtract",[e,i]))}if("-"===s.op)return(0,n.isOperatorNode)(i)&&i.isUnary()&&"-"===i.op?X(new _("+","add",[e,i.args[0]]),t):(0,n.isConstantNode)(e)&&l(e.value)?X(new _("-","unaryMinus",[i])):(0,n.isConstantNode)(i)&&l(i.value)?e:new _(s.op,s.fn,[e,i]);if("*"===s.op){if((0,n.isConstantNode)(e)){if(l(e.value))return R;if(o(e.value,1))return i}if((0,n.isConstantNode)(i)){if(l(i.value))return R;if(o(i.value,1))return e;if(Z(s,r))return new _(s.op,s.fn,[i,e],s.implicit)}return new _(s.op,s.fn,[e,i],s.implicit)}if("/"===s.op)return(0,n.isConstantNode)(e)&&l(e.value)?R:(0,n.isConstantNode)(i)&&o(i.value,1)?e:new _(s.op,s.fn,[e,i]);if("^"===s.op&&(0,n.isConstantNode)(i)){if(l(i.value))return k;if(o(i.value,1))return e}if("and"===s.op){if((0,n.isConstantNode)(e)){if(!e.value)return z;if(q(i))return i;if((0,n.isConstantNode)(i))return i.value?j:z}if((0,n.isConstantNode)(i)){if(!i.value)return z;if(q(e))return e}}if("or"===s.op){if((0,n.isConstantNode)(e)){if(e.value)return j;if(q(i))return i}if((0,n.isConstantNode)(i)){if(i.value)return j;if(q(e))return e}}return new _(s.op,s.fn,[e,i])}if((0,n.isOperatorNode)(s))return new _(s.op,s.fn,s.args.map((e=>X(e,t))));if((0,n.isArrayNode)(s))return new f(s.items.map((e=>X(e,t))));if((0,n.isAccessorNode)(s))return new m(X(s.object,t),X(s.index,t));if((0,n.isIndexNode)(s))return new b(s.dimensions.map((e=>X(e,t))));if((0,n.isObjectNode)(s)){const e={};for(const r in s.properties)e[r]=X(s.properties[r],t);return new v(e)}return s}return t(a,{Node:X,"Node,Object":X})}))},3793:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLsolve=void 0;var n=r(66212),i=r(2318);const s="lsolve",o=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"];t.createLsolve=(0,n.factory)(s,o,(e=>{let{typed:t,matrix:r,divideScalar:n,multiplyScalar:o,subtractScalar:a,equalScalar:l,DenseMatrix:c}=e;const u=(0,i.createSolveValidation)({DenseMatrix:c});return t(s,{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){t=u(e,t,!0);const r=t._data,i=e._size[0],s=e._size[1],d=e._values,h=e._index,p=e._ptr,m=[];for(let e=0;e<s;e++){const t=r[e][0]||0;if(l(t,0))m[e]=[0];else{let i=0;const s=[],c=[],u=p[e],f=p[e+1];for(let t=u;t<f;t++){const r=h[t];r===e?i=d[t]:r>e&&(s.push(d[t]),c.push(r))}if(l(i,0))throw new Error("Linear system cannot be solved since matrix is singular");const g=n(t,i);for(let e=0,t=c.length;e<t;e++){const t=c[e];r[t]=[a(r[t][0]||0,o(g,s[e]))]}m[e]=[g]}}return new c({data:m,size:[i,1]})}(e,t)},"DenseMatrix, Array | Matrix":function(e,t){return d(e,t)},"Array, Array | Matrix":function(e,t){return d(r(e),t).valueOf()}});function d(e,t){const r=(t=u(e,t,!0))._data,i=e._size[0],s=e._size[1],d=[],h=e._data;for(let e=0;e<s;e++){const t=r[e][0]||0;let s;if(l(t,0))s=0;else{const c=h[e][e];if(l(c,0))throw new Error("Linear system cannot be solved since matrix is singular");s=n(t,c);for(let t=e+1;t<i;t++)r[t]=[a(r[t][0]||0,o(s,h[t][e]))]}d[e]=[s]}return new c({data:d,size:[i,1]})}}))},18750:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLsolveAll=void 0;var n=r(66212),i=r(2318);const s="lsolveAll",o=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"];t.createLsolveAll=(0,n.factory)(s,o,(e=>{let{typed:t,matrix:r,divideScalar:n,multiplyScalar:o,subtractScalar:a,equalScalar:l,DenseMatrix:c}=e;const u=(0,i.createSolveValidation)({DenseMatrix:c});return t(s,{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){const r=[u(e,t,!0)._data.map((e=>e[0]))],i=e._size[0],s=e._size[1],d=e._values,h=e._index,p=e._ptr;for(let e=0;e<s;e++){let t=r.length;for(let i=0;i<t;i++){const s=r[i],c=[],u=[],m=p[e],f=p[e+1];let g=0;for(let t=m;t<f;t++){const r=h[t];r===e?g=d[t]:r>e&&(c.push(d[t]),u.push(r))}if(l(g,0))if(l(s[e],0)){if(0===i){const t=[...s];t[e]=1;for(let e=0,r=u.length;e<r;e++){const r=u[e];t[r]=a(t[r],c[e])}r.push(t)}}else{if(0===i)return[];r.splice(i,1),i-=1,t-=1}else{s[e]=n(s[e],g);for(let t=0,r=u.length;t<r;t++){const r=u[t];s[r]=a(s[r],o(s[e],c[t]))}}}}return r.map((e=>new c({data:e.map((e=>[e])),size:[i,1]})))}(e,t)},"DenseMatrix, Array | Matrix":function(e,t){return d(e,t)},"Array, Array | Matrix":function(e,t){return d(r(e),t).map((e=>e.valueOf()))}});function d(e,t){const r=[u(e,t,!0)._data.map((e=>e[0]))],i=e._data,s=e._size[0],d=e._size[1];for(let e=0;e<d;e++){let t=r.length;for(let s=0;s<t;s++){const c=r[s];if(l(i[e][e],0))if(l(c[e],0)){if(0===s){const t=[...c];t[e]=1;for(let r=e+1;r<d;r++)t[r]=a(t[r],i[r][e]);r.push(t)}}else{if(0===s)return[];r.splice(s,1),s-=1,t-=1}else{c[e]=n(c[e],i[e][e]);for(let t=e+1;t<d;t++)c[t]=a(c[t],o(c[e],i[t][e]))}}}return r.map((e=>new c({data:e.map((e=>[e])),size:[s,1]})))}}))},39110:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLusolve=void 0;var n=r(91612),i=r(66212),s=r(2318),o=r(82420);const a="lusolve",l=["typed","matrix","lup","slu","usolve","lsolve","DenseMatrix"];t.createLusolve=(0,i.factory)(a,l,(e=>{let{typed:t,matrix:r,lup:i,slu:l,usolve:c,lsolve:u,DenseMatrix:d}=e;const h=(0,s.createSolveValidation)({DenseMatrix:d});return t(a,{"Array, Array | Matrix":function(e,t){e=r(e);const n=i(e);return m(n.L,n.U,n.p,null,t).valueOf()},"DenseMatrix, Array | Matrix":function(e,t){const r=i(e);return m(r.L,r.U,r.p,null,t)},"SparseMatrix, Array | Matrix":function(e,t){const r=i(e);return m(r.L,r.U,r.p,null,t)},"SparseMatrix, Array | Matrix, number, number":function(e,t,r,n){const i=l(e,r,n);return m(i.L,i.U,i.p,i.q,t)},"Object, Array | Matrix":function(e,t){return m(e.L,e.U,e.p,e.q,t)}});function p(e){if((0,n.isMatrix)(e))return e;if((0,n.isArray)(e))return r(e);throw new TypeError("Invalid Matrix LU decomposition")}function m(e,t,r,n,i){e=p(e),t=p(t),r&&((i=h(e,i,!0))._data=(0,o.csIpvec)(r,i._data));const s=u(e,i),a=c(t,s);return n&&(a._data=(0,o.csIpvec)(n,a._data)),a}}))},63128:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createUsolve=void 0;var n=r(66212),i=r(2318);const s="usolve",o=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"];t.createUsolve=(0,n.factory)(s,o,(e=>{let{typed:t,matrix:r,divideScalar:n,multiplyScalar:o,subtractScalar:a,equalScalar:l,DenseMatrix:c}=e;const u=(0,i.createSolveValidation)({DenseMatrix:c});return t(s,{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){t=u(e,t,!0);const r=t._data,i=e._size[0],s=e._size[1],d=e._values,h=e._index,p=e._ptr,m=[];for(let e=s-1;e>=0;e--){const t=r[e][0]||0;if(l(t,0))m[e]=[0];else{let i=0;const s=[],c=[],u=p[e];for(let t=p[e+1]-1;t>=u;t--){const r=h[t];r===e?i=d[t]:r<e&&(s.push(d[t]),c.push(r))}if(l(i,0))throw new Error("Linear system cannot be solved since matrix is singular");const f=n(t,i);for(let e=0,t=c.length;e<t;e++){const t=c[e];r[t]=[a(r[t][0],o(f,s[e]))]}m[e]=[f]}}return new c({data:m,size:[i,1]})}(e,t)},"DenseMatrix, Array | Matrix":function(e,t){return d(e,t)},"Array, Array | Matrix":function(e,t){return d(r(e),t).valueOf()}});function d(e,t){const r=(t=u(e,t,!0))._data,i=e._size[0],s=e._size[1],d=[],h=e._data;for(let e=s-1;e>=0;e--){const t=r[e][0]||0;let i;if(l(t,0))i=0;else{const s=h[e][e];if(l(s,0))throw new Error("Linear system cannot be solved since matrix is singular");i=n(t,s);for(let t=e-1;t>=0;t--)r[t]=[a(r[t][0]||0,o(i,h[t][e]))]}d[e]=[i]}return new c({data:d,size:[i,1]})}}))},29129:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createUsolveAll=void 0;var n=r(66212),i=r(2318);const s="usolveAll",o=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"];t.createUsolveAll=(0,n.factory)(s,o,(e=>{let{typed:t,matrix:r,divideScalar:n,multiplyScalar:o,subtractScalar:a,equalScalar:l,DenseMatrix:c}=e;const u=(0,i.createSolveValidation)({DenseMatrix:c});return t(s,{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){const r=[u(e,t,!0)._data.map((e=>e[0]))],i=e._size[0],s=e._size[1],d=e._values,h=e._index,p=e._ptr;for(let e=s-1;e>=0;e--){let t=r.length;for(let i=0;i<t;i++){const s=r[i],c=[],u=[],m=p[e];let f=0;for(let t=p[e+1]-1;t>=m;t--){const r=h[t];r===e?f=d[t]:r<e&&(c.push(d[t]),u.push(r))}if(l(f,0))if(l(s[e],0)){if(0===i){const t=[...s];t[e]=1;for(let e=0,r=u.length;e<r;e++){const r=u[e];t[r]=a(t[r],c[e])}r.push(t)}}else{if(0===i)return[];r.splice(i,1),i-=1,t-=1}else{s[e]=n(s[e],f);for(let t=0,r=u.length;t<r;t++){const r=u[t];s[r]=a(s[r],o(s[e],c[t]))}}}}return r.map((e=>new c({data:e.map((e=>[e])),size:[i,1]})))}(e,t)},"DenseMatrix, Array | Matrix":function(e,t){return d(e,t)},"Array, Array | Matrix":function(e,t){return d(r(e),t).map((e=>e.valueOf()))}});function d(e,t){const r=[u(e,t,!0)._data.map((e=>e[0]))],i=e._data,s=e._size[0];for(let t=e._size[1]-1;t>=0;t--){let e=r.length;for(let s=0;s<e;s++){const c=r[s];if(l(i[t][t],0))if(l(c[t],0)){if(0===s){const e=[...c];e[t]=1;for(let r=t-1;r>=0;r--)e[r]=a(e[r],i[r][t]);r.push(e)}}else{if(0===s)return[];r.splice(s,1),s-=1,e-=1}else{c[t]=n(c[t],i[t][t]);for(let e=t-1;e>=0;e--)c[e]=a(c[e],o(c[t],i[e][t]))}}}return r.map((e=>new c({data:e.map((e=>[e])),size:[s,1]})))}}))},2318:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSolveValidation=function(e){let{DenseMatrix:t}=e;return function(e,r,o){const a=e.size();if(2!==a.length)throw new RangeError("Matrix must be two dimensional (size: "+(0,s.format)(a)+")");const l=a[0];if(l!==a[1])throw new RangeError("Matrix must be square (size: "+(0,s.format)(a)+")");let c=[];if((0,n.isMatrix)(r)){const e=r.size(),i=r._data;if(1===e.length){if(e[0]!==l)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(let e=0;e<l;e++)c[e]=[i[e]];return new t({data:c,size:[l,1],datatype:r._datatype})}if(2===e.length){if(e[0]!==l||1!==e[1])throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");if((0,n.isDenseMatrix)(r)){if(o){c=[];for(let e=0;e<l;e++)c[e]=[i[e][0]];return new t({data:c,size:[l,1],datatype:r._datatype})}return r}if((0,n.isSparseMatrix)(r)){for(let e=0;e<l;e++)c[e]=[0];const e=r._values,n=r._index,i=r._ptr;for(let t=i[1],r=i[0];r<t;r++){c[n[r]][0]=e[r]}return new t({data:c,size:[l,1],datatype:r._datatype})}}throw new RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.")}if((0,n.isArray)(r)){const e=(0,i.arraySize)(r);if(1===e.length){if(e[0]!==l)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(let e=0;e<l;e++)c[e]=[r[e]];return new t({data:c,size:[l,1]})}if(2===e.length){if(e[0]!==l||1!==e[1])throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(let e=0;e<l;e++)c[e]=[r[e][0]];return new t({data:c,size:[l,1]})}throw new RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.")}}};var n=r(91612),i=r(34487),s=r(7041)},81511:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCsAmd=void 0;var n=r(66212),i=r(39862),s=r(5394),o=r(52062);const a=["add","multiply","transpose"];t.createCsAmd=(0,n.factory)("csAmd",a,(e=>{let{add:t,multiply:r,transpose:n}=e;return function(e,c){if(!c||e<=0||e>3)return null;const u=c._size,d=u[0],h=u[1];let p=0,m=Math.max(16,10*Math.sqrt(h));m=Math.min(h-2,m);const f=function(e,i,s,o,a){const l=n(i);if(1===e&&o===s)return t(i,l);if(2===e){const e=l._index,t=l._ptr;let o=0;for(let r=0;r<s;r++){let n=t[r];if(t[r]=o,!(t[r+1]-n>a))for(const i=t[r+1];n<i;n++)e[o++]=e[n]}return t[s]=o,i=n(l),r(l,i)}return r(l,i)}(e,c,d,h,m);(0,i.csFkeep)(f,l,null);const g=f._index,y=f._ptr;let b=y[h];const v=[],_=[],x=h+1,w=2*(h+1),R=3*(h+1),k=4*(h+1),j=5*(h+1),z=6*(h+1),q=7*(h+1),$=v;let Z,X,Y,ee,te,re,ne,ie,se,oe,ae,le,ce,ue,de,he,pe=function(e,t,r,n,i,s,o,l,c,u,d,h){for(let i=0;i<e;i++)r[n+i]=t[i+1]-t[i];r[n+e]=0;for(let t=0;t<=e;t++)r[i+t]=-1,s[t]=-1,r[o+t]=-1,r[l+t]=-1,r[c+t]=1,r[u+t]=1,r[d+t]=0,r[h+t]=r[n+t];const p=a(0,0,r,u,e);return r[d+e]=-2,t[e]=-1,r[u+e]=0,p}(h,y,_,0,R,$,w,q,x,z,k,j),me=function(e,t,r,n,i,o,a,l,c,u,d){let h=0;for(let p=0;p<e;p++){const m=r[n+p];if(0===m)r[i+p]=-2,h++,t[p]=-1,r[o+p]=0;else if(m>a)r[l+p]=0,r[i+p]=-1,h++,t[p]=(0,s.csFlip)(e),r[l+e]++;else{const e=r[c+m];-1!==e&&(u[e]=p),r[d+p]=r[c+m],r[c+m]=p}}return h}(h,y,_,j,k,z,m,x,R,$,w),fe=0;for(;me<h;){for(Y=-1;fe<h&&-1===(Y=_[R+fe]);fe++);-1!==_[w+Y]&&($[_[w+Y]]=-1),_[R+fe]=_[w+Y];const e=_[k+Y];let t=_[x+Y];me+=t;let r=0;_[x+Y]=-t;let n=y[Y];const i=0===e?n:b;let o=i;for(ee=1;ee<=e+1;ee++){for(ee>e?(re=Y,ne=n,ie=_[0+Y]-e):(re=g[n++],ne=y[re],ie=_[0+re]),te=1;te<=ie;te++)Z=g[ne++],(se=_[x+Z])<=0||(r+=se,_[x+Z]=-se,g[o++]=Z,-1!==_[w+Z]&&($[_[w+Z]]=$[Z]),-1!==$[Z]?_[w+$[Z]]=_[w+Z]:_[R+_[j+Z]]=_[w+Z]);re!==Y&&(y[re]=(0,s.csFlip)(Y),_[z+re]=0)}for(0!==e&&(b=o),_[j+Y]=r,y[Y]=i,_[0+Y]=o-i,_[k+Y]=-2,pe=a(pe,p,_,z,h),oe=i;oe<o;oe++){if(Z=g[oe],(ae=_[k+Z])<=0)continue;se=-_[x+Z];const e=pe-se;for(n=y[Z],le=y[Z]+ae-1;n<=le;n++)re=g[n],_[z+re]>=pe?_[z+re]-=se:0!==_[z+re]&&(_[z+re]=_[j+re]+e)}for(oe=i;oe<o;oe++){for(Z=g[oe],le=y[Z],ce=le+_[k+Z]-1,ue=le,de=0,he=0,n=le;n<=ce;n++)if(re=g[n],0!==_[z+re]){const e=_[z+re]-pe;e>0?(he+=e,g[ue++]=re,de+=re):(y[re]=(0,s.csFlip)(Y),_[z+re]=0)}_[k+Z]=ue-le+1;const e=ue,i=le+_[0+Z];for(n=ce+1;n<i;n++){X=g[n];const e=_[x+X];e<=0||(he+=e,g[ue++]=X,de+=X)}0===he?(y[Z]=(0,s.csFlip)(Y),se=-_[x+Z],r-=se,t+=se,me+=se,_[x+Z]=0,_[k+Z]=-1):(_[j+Z]=Math.min(_[j+Z],he),g[ue]=g[e],g[e]=g[le],g[le]=Y,_[0+Z]=ue-le+1,de=(de<0?-de:de)%h,_[w+Z]=_[q+de],_[q+de]=Z,$[Z]=de)}for(_[j+Y]=r,p=Math.max(p,r),pe=a(pe+p,p,_,z,h),oe=i;oe<o;oe++)if(Z=g[oe],!(_[x+Z]>=0))for(de=$[Z],Z=_[q+de],_[q+de]=-1;-1!==Z&&-1!==_[w+Z];Z=_[w+Z],pe++){for(ie=_[0+Z],ae=_[k+Z],n=y[Z]+1;n<=y[Z]+ie-1;n++)_[z+g[n]]=pe;let e=Z;for(X=_[w+Z];-1!==X;){let t=_[0+X]===ie&&_[k+X]===ae;for(n=y[X]+1;t&&n<=y[X]+ie-1;n++)_[z+g[n]]!==pe&&(t=0);t?(y[X]=(0,s.csFlip)(Z),_[x+Z]+=_[x+X],_[x+X]=0,_[k+X]=-1,X=_[w+X],_[w+e]=X):(e=X,X=_[w+X])}}for(n=i,oe=i;oe<o;oe++)Z=g[oe],(se=-_[x+Z])<=0||(_[x+Z]=se,he=_[j+Z]+r-se,he=Math.min(he,h-me-se),-1!==_[R+he]&&($[_[R+he]]=Z),_[w+Z]=_[R+he],$[Z]=-1,_[R+he]=Z,fe=Math.min(fe,he),_[j+Z]=he,g[n++]=Z);_[x+Y]=t,0==(_[0+Y]=n-i)&&(y[Y]=-1,_[z+Y]=0),0!==e&&(b=n)}for(Z=0;Z<h;Z++)y[Z]=(0,s.csFlip)(y[Z]);for(X=0;X<=h;X++)_[R+X]=-1;for(X=h;X>=0;X--)_[x+X]>0||(_[w+X]=_[R+y[X]],_[R+y[X]]=X);for(re=h;re>=0;re--)_[x+re]<=0||-1!==y[re]&&(_[w+re]=_[R+y[re]],_[R+y[re]]=re);for(Y=0,Z=0;Z<=h;Z++)-1===y[Z]&&(Y=(0,o.csTdfs)(Z,Y,_,R,w,v,z));return v.splice(v.length-1,1),v};function a(e,t,r,n,i){if(e<2||e+t<0){for(let e=0;e<i;e++)0!==r[n+e]&&(r[n+e]=1);e=2}return e}function l(e,t){return e!==t}}))},42209:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCsCounts=void 0;var n=r(66212),i=r(85281);const s=["transpose"];t.createCsCounts=(0,n.factory)("csCounts",s,(e=>{let{transpose:t}=e;return function(e,r,n,s){if(!e||!r||!n)return null;const o=e._size,a=o[0],l=o[1];let c,u,d,h,p,m,f;const g=4*l+(s?l+a+1:0),y=[],b=l,v=2*l,_=3*l,x=4*l,w=5*l+1;for(d=0;d<g;d++)y[d]=-1;const R=[],k=t(e),j=k._index,z=k._ptr;for(d=0;d<l;d++)for(u=n[d],R[u]=-1===y[_+u]?1:0;-1!==u&&-1===y[_+u];u=r[u])y[_+u]=d;if(s){for(d=0;d<l;d++)y[n[d]]=d;for(c=0;c<a;c++){for(d=l,m=z[c],f=z[c+1],p=m;p<f;p++)d=Math.min(d,y[j[p]]);y[w+c]=y[x+d],y[x+d]=c}}for(c=0;c<l;c++)y[0+c]=c;for(d=0;d<l;d++){for(u=n[d],-1!==r[u]&&R[r[u]]--,h=s?y[x+d]:u;-1!==h;h=s?y[w+h]:-1)for(p=z[h];p<z[h+1];p++){c=j[p];const e=(0,i.csLeaf)(c,u,y,_,b,v,0);e.jleaf>=1&&R[u]++,2===e.jleaf&&R[e.q]--}-1!==r[u]&&(y[0+u]=r[u])}for(u=0;u<l;u++)-1!==r[u]&&(R[r[u]]+=R[u]);return R}}))},28206:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.csDfs=function(e,t,r,o,a){const l=t._index,c=t._ptr,u=t._size[1];let d,h,p,m=0;o[0]=e;for(;m>=0;){e=o[m];const t=a?a[e]:e;(0,n.csMarked)(c,e)||((0,i.csMark)(c,e),o[u+m]=t<0?0:(0,s.csUnflip)(c[t]));let f=1;for(h=o[u+m],p=t<0?0:(0,s.csUnflip)(c[t+1]);h<p;h++)if(d=l[h],!(0,n.csMarked)(c,d)){o[u+m]=h,o[++m]=d,f=0;break}f&&(m--,o[--r]=e)}return r};var n=r(86925),i=r(65248),s=r(76253)},17046:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.csEtree=function(e,t){if(!e)return null;const r=e._index,n=e._ptr,i=e._size,s=i[0],o=i[1],a=[],l=[],c=o;let u,d;if(t)for(u=0;u<s;u++)l[c+u]=-1;for(let e=0;e<o;e++){a[e]=-1,l[0+e]=-1;for(let i=n[e],s=n[e+1],o=i;o<s;o++){const n=r[o];for(u=t?l[c+n]:n;-1!==u&&u<e;u=d)d=l[0+u],l[0+u]=e,-1===d&&(a[u]=e);t&&(l[c+n]=e)}}return a}},39862:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.csFkeep=function(e,t,r){const n=e._values,i=e._index,s=e._ptr,o=e._size[1];let a=0;for(let e=0;e<o;e++){let o=s[e];for(s[e]=a;o<s[e+1];o++)t(i[o],e,n?n[o]:1,r)&&(i[a]=i[o],n&&(n[a]=n[o]),a++)}s[o]=a,i.splice(a,i.length-a),n&&n.splice(a,n.length-a);return a}},5394:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.csFlip=function(e){return-e-2}},82420:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.csIpvec=function(e,t){let r;const n=t.length,i=[];if(e)for(r=0;r<n;r++)i[e[r]]=t[r];else for(r=0;r<n;r++)i[r]=t[r];return i}},85281:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.csLeaf=function(e,t,r,n,i,s,o){let a,l,c,u=0;if(e<=t||r[n+t]<=r[i+e])return-1;r[i+e]=r[n+t];const d=r[s+e];if(r[s+e]=t,-1===d)u=1,c=e;else{for(u=2,c=d;c!==r[o+c];c=r[o+c]);for(a=d;a!==c;a=l)l=r[o+a],r[o+a]=c}return{jleaf:u,q:c}}},35030:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCsLu=void 0;var n=r(66212),i=r(24323);const s=["abs","divideScalar","multiply","subtract","larger","largerEq","SparseMatrix"];t.createCsLu=(0,n.factory)("csLu",s,(e=>{let{abs:t,divideScalar:r,multiply:n,subtract:s,larger:o,largerEq:a,SparseMatrix:l}=e;const c=(0,i.createCsSpsolve)({divideScalar:r,multiply:n,subtract:s});return function(e,i,s){if(!e)return null;const u=e._size[1];let d,h=100,p=100;i&&(d=i.q,h=i.lnz||h,p=i.unz||p);const m=[],f=[],g=[],y=new l({values:m,index:f,ptr:g,size:[u,u]}),b=[],v=[],_=[],x=new l({values:b,index:v,ptr:_,size:[u,u]}),w=[];let R,k;const j=[],z=[];for(R=0;R<u;R++)j[R]=0,w[R]=-1,g[R+1]=0;h=0,p=0;for(let i=0;i<u;i++){g[i]=h,_[i]=p;const l=d?d[i]:i,x=c(y,e,l,z,j,w,1);let q=-1,$=-1;for(k=x;k<u;k++)if(R=z[k],w[R]<0){const e=t(j[R]);o(e,$)&&($=e,q=R)}else v[p]=w[R],b[p++]=j[R];if(-1===q||$<=0)return null;w[l]<0&&a(t(j[l]),n($,s))&&(q=l);const Z=j[q];for(v[p]=i,b[p++]=Z,w[q]=i,f[h]=q,m[h++]=1,k=x;k<u;k++)R=z[k],w[R]<0&&(f[h]=R,m[h++]=r(j[R],Z)),j[R]=0}for(g[u]=h,_[u]=p,k=0;k<h;k++)f[k]=w[f[k]];return m.splice(h,m.length-h),f.splice(h,f.length-h),b.splice(p,b.length-p),v.splice(p,v.length-p),{L:y,U:x,pinv:w}}}))},65248:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.csMark=function(e,t){e[t]=(0,n.csFlip)(e[t])};var n=r(5394)},86925:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.csMarked=function(e,t){return e[t]<0}},73879:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.csPermute=function(e,t,r,n){const i=e._values,s=e._index,o=e._ptr,a=e._size,l=e._datatype,c=a[0],u=a[1],d=n&&e._values?[]:null,h=[],p=[];let m=0;for(let e=0;e<u;e++){p[e]=m;const n=r?r[e]:e;for(let e=o[n],r=o[n+1],a=e;a<r;a++){const e=t?t[s[a]]:s[a];h[m]=e,d&&(d[m]=i[a]),m++}}return p[u]=m,e.createSparseMatrix({values:d,index:h,ptr:p,size:[c,u],datatype:l})}},27683:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.csPost=function(e,t){if(!e)return null;let r,i=0;const s=[],o=[],a=t,l=2*t;for(r=0;r<t;r++)o[0+r]=-1;for(r=t-1;r>=0;r--)-1!==e[r]&&(o[a+r]=o[0+e[r]],o[0+e[r]]=r);for(r=0;r<t;r++)-1===e[r]&&(i=(0,n.csTdfs)(r,i,o,0,a,s,l));return s};var n=r(52062)},86554:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.csReach=function(e,t,r,o,a){const l=e._ptr,c=e._size,u=t._index,d=t._ptr,h=c[1];let p,m,f,g=h;for(m=d[r],f=d[r+1],p=m;p<f;p++){const t=u[p];(0,n.csMarked)(l,t)||(g=(0,s.csDfs)(t,e,g,o,a))}for(p=g;p<h;p++)(0,i.csMark)(l,o[p]);return g};var n=r(86925),i=r(65248),s=r(28206)},24323:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCsSpsolve=void 0;var n=r(86554),i=r(66212);const s=["divideScalar","multiply","subtract"];t.createCsSpsolve=(0,i.factory)("csSpsolve",s,(e=>{let{divideScalar:t,multiply:r,subtract:i}=e;return function(e,s,o,a,l,c,u){const d=e._values,h=e._index,p=e._ptr,m=e._size[1],f=s._values,g=s._index,y=s._ptr;let b,v,_,x;const w=(0,n.csReach)(e,s,o,a,c);for(b=w;b<m;b++)l[a[b]]=0;for(v=y[o],_=y[o+1],b=v;b<_;b++)l[g[b]]=f[b];for(let e=w;e<m;e++){const n=a[e],s=c?c[n]:n;if(!(s<0))for(v=p[s],_=p[s+1],l[n]=t(l[n],d[u?v:_-1]),b=u?v+1:v,x=u?_:_-1;b<x;b++){const e=h[b];l[e]=i(l[e],r(d[b],l[n]))}}return w}}))},81875:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCsSqr=void 0;var n=r(73879),i=r(27683),s=r(17046),o=r(81511),a=r(42209),l=r(66212);const c=["add","multiply","transpose"];t.createCsSqr=(0,l.factory)("csSqr",c,(e=>{let{add:t,multiply:r,transpose:l}=e;const c=(0,o.createCsAmd)({add:t,multiply:r,transpose:l}),u=(0,a.createCsCounts)({transpose:l});return function(e,t,r){const o=t._ptr,a=t._size[1];let l;const d={};if(d.q=c(e,t),e&&!d.q)return null;if(r){const r=e?(0,n.csPermute)(t,null,d.q,0):t;d.parent=(0,s.csEtree)(r,1);const o=(0,i.csPost)(d.parent,a);if(d.cp=u(r,d.parent,o,1),r&&d.parent&&d.cp&&function(e,t){const r=e._ptr,n=e._index,i=e._size,s=i[0],o=i[1];t.pinv=[],t.leftmost=[];const a=t.parent,l=t.pinv,c=t.leftmost,u=[],d=0,h=s,p=s+o,m=s+2*o;let f,g,y,b,v;for(g=0;g<o;g++)u[h+g]=-1,u[p+g]=-1,u[m+g]=0;for(f=0;f<s;f++)c[f]=-1;for(g=o-1;g>=0;g--)for(b=r[g],v=r[g+1],y=b;y<v;y++)c[n[y]]=g;for(f=s-1;f>=0;f--)l[f]=-1,g=c[f],-1!==g&&(0==u[m+g]++&&(u[p+g]=f),u[d+f]=u[h+g],u[h+g]=f);for(t.lnz=0,t.m2=s,g=0;g<o;g++){if(f=u[h+g],t.lnz++,f<0&&(f=t.m2++),l[f]=g,--m[g]<=0)continue;t.lnz+=u[m+g];const e=a[g];-1!==e&&(0===u[m+e]&&(u[p+e]=u[p+g]),u[d+u[p+g]]=u[h+e],u[h+e]=u[d+f],u[m+e]+=u[m+g])}for(f=0;f<s;f++)l[f]<0&&(l[f]=g++);return!0}(r,d))for(d.unz=0,l=0;l<a;l++)d.unz+=d.cp[l]}else d.unz=4*o[a]+a,d.lnz=d.unz;return d}}))},52062:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.csTdfs=function(e,t,r,n,i,s,o){let a=0;r[o]=e;for(;a>=0;){const e=r[o+a],l=r[n+e];-1===l?(a--,s[t++]=e):(r[n+e]=r[i+l],++a,r[o+a]=l)}return t}},76253:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.csUnflip=function(e){return e<0?(0,n.csFlip)(e):e};var n=r(5394)},73715:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSylvester=void 0;var n=r(66212);const i="sylvester",s=["typed","schur","matrixFromColumns","matrix","multiply","range","concat","transpose","index","subset","add","subtract","identity","lusolve","abs"];t.createSylvester=(0,n.factory)(i,s,(e=>{let{typed:t,schur:r,matrixFromColumns:n,matrix:s,multiply:o,range:a,concat:l,transpose:c,index:u,subset:d,add:h,subtract:p,identity:m,lusolve:f,abs:g}=e;return t(i,{"Matrix, Matrix, Matrix":y,"Array, Matrix, Matrix":function(e,t,r){return y(s(e),t,r)},"Array, Array, Matrix":function(e,t,r){return y(s(e),s(t),r)},"Array, Matrix, Array":function(e,t,r){return y(s(e),t,s(r))},"Matrix, Array, Matrix":function(e,t,r){return y(e,s(t),r)},"Matrix, Array, Array":function(e,t,r){return y(e,s(t),s(r))},"Matrix, Matrix, Array":function(e,t,r){return y(e,t,s(r))},"Array, Array, Array":function(e,t,r){return y(s(e),s(t),s(r)).toArray()}});function y(e,t,i){const y=t.size()[0],b=e.size()[0],v=r(e),_=v.T,x=v.U,w=r(o(-1,t)),R=w.T,k=w.U,j=o(o(c(x),i),k),z=a(0,b),q=[],$=(e,t)=>l(e,t,1),Z=(e,t)=>l(e,t,0);for(let e=0;e<y;e++)if(e<y-1&&g(d(R,u(e+1,e)))>1e-5){let t=Z(d(j,u(z,e)),d(j,u(z,e+1)));for(let r=0;r<e;r++)t=h(t,Z(o(q[r],d(R,u(r,e))),o(q[r],d(R,u(r,e+1)))));const r=o(m(b),o(-1,d(R,u(e,e)))),n=o(m(b),o(-1,d(R,u(e+1,e)))),i=o(m(b),o(-1,d(R,u(e,e+1)))),s=o(m(b),o(-1,d(R,u(e+1,e+1)))),l=Z($(h(_,r),n),$(i,h(_,s))),c=f(l,t);q[e]=c.subset(u(a(0,b),0)),q[e+1]=c.subset(u(a(b,2*b),0)),e++}else{let t=d(j,u(z,e));for(let r=0;r<e;r++)t=h(t,o(q[r],d(R,u(r,e))));const r=d(R,u(e,e)),n=p(_,o(r,m(b)));q[e]=f(n,t)}const X=s(n(...q));return o(x,o(X,c(k)))}}))},33938:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSymbolicEqual=void 0;var n=r(91612),i=r(66212);const s="symbolicEqual",o=["parse","simplify","typed","OperatorNode"];t.createSymbolicEqual=(0,i.factory)(s,o,(e=>{let{parse:t,simplify:r,typed:i,OperatorNode:o}=e;function a(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const s=new o("-","subtract",[e,t]),a=r(s,{},i);return(0,n.isConstantNode)(a)&&!a.value}return i(s,{"Node, Node":a,"Node, Node, Object":a})}))},41886:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAbs=void 0;var n=r(66212),i=r(16624),s=r(30369);const o=["typed"];t.createAbs=(0,n.factory)("abs",o,(e=>{let{typed:t}=e;return t("abs",{number:s.absNumber,"Complex | BigNumber | Fraction | Unit":e=>e.abs(),bigint:e=>e<0n?-e:e,"Array | Matrix":t.referToSelf((e=>t=>(0,i.deepMap)(t,e,!0)))})}))},42593:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAdd=void 0;var n=r(66212),i=r(27935),s=r(26906),o=r(8896),a=r(11279);const l=["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"];t.createAdd=(0,n.factory)("add",l,(e=>{let{typed:t,matrix:r,addScalar:n,equalScalar:l,DenseMatrix:c,SparseMatrix:u,concat:d}=e;const h=(0,i.createMatAlgo01xDSid)({typed:t}),p=(0,s.createMatAlgo04xSidSid)({typed:t,equalScalar:l}),m=(0,o.createMatAlgo10xSids)({typed:t,DenseMatrix:c}),f=(0,a.createMatrixAlgorithmSuite)({typed:t,matrix:r,concat:d});return t("add",{"any, any":n,"any, any, ...any":t.referToSelf((e=>(t,r,n)=>{let i=e(t,r);for(let t=0;t<n.length;t++)i=e(i,n[t]);return i}))},f({elop:n,DS:h,SS:p,Ss:m}))}))},80961:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAddScalar=void 0;var n=r(66212),i=r(30369);const s="addScalar",o=["typed"];t.createAddScalar=(0,n.factory)(s,o,(e=>{let{typed:t}=e;return t(s,{"number, number":i.addNumber,"Complex, Complex":function(e,t){return e.add(t)},"BigNumber, BigNumber":function(e,t){return e.plus(t)},"bigint, bigint":function(e,t){return e+t},"Fraction, Fraction":function(e,t){return e.add(t)},"Unit, Unit":t.referToSelf((e=>(r,n)=>{if(null===r.value||void 0===r.value)throw new Error("Parameter x contains a unit with undefined value");if(null===n.value||void 0===n.value)throw new Error("Parameter y contains a unit with undefined value");if(!r.equalBase(n))throw new Error("Units do not match");const i=r.clone();return i.value=t.find(e,[i.valueType(),n.valueType()])(i.value,n.value),i.fixPrefix=!1,i}))})}))},79367:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCbrt=void 0;var n=r(66212),i=r(91612),s=r(30369);const o="cbrt",a=["config","typed","isNegative","unaryMinus","matrix","Complex","BigNumber","Fraction"];t.createCbrt=(0,n.factory)(o,a,(e=>{let{config:t,typed:r,isNegative:n,unaryMinus:a,matrix:l,Complex:c,BigNumber:u,Fraction:d}=e;return r(o,{number:s.cbrtNumber,Complex:h,"Complex, boolean":h,BigNumber:function(e){return e.cbrt()},Unit:function(e){if(e.value&&(0,i.isComplex)(e.value)){let t=e.clone();return t.value=1,t=t.pow(1/3),t.value=h(e.value),t}{const t=n(e.value);let r;t&&(e.value=a(e.value)),r=(0,i.isBigNumber)(e.value)?new u(1).div(3):(0,i.isFraction)(e.value)?new d(1,3):1/3;const s=e.pow(r);return t&&(s.value=a(s.value)),s}}});function h(e,r){const n=e.arg()/3,i=e.abs(),o=new c((0,s.cbrtNumber)(i),0).mul(new c(0,n).exp());if(r){const e=[o,new c((0,s.cbrtNumber)(i),0).mul(new c(0,n+2*Math.PI/3).exp()),new c((0,s.cbrtNumber)(i),0).mul(new c(0,n-2*Math.PI/3).exp())];return"Array"===t.matrix?e:l(e)}return o}}))},96149:(e,t,r)=>{"use strict";var n=r(87929);Object.defineProperty(t,"__esModule",{value:!0}),t.createCeilNumber=t.createCeil=void 0;var i=n(r(13944)),s=r(66212),o=r(16624),a=r(34749),l=r(67625),c=r(73670),u=r(47993),d=r(18568);const h="ceil",p=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],m=t.createCeilNumber=(0,s.factory)(h,["typed","config","round"],(e=>{let{typed:t,config:r,round:n}=e;return t(h,{number:function(e){return(0,a.nearlyEqual)(e,n(e),r.relTol,r.absTol)?n(e):Math.ceil(e)},"number, number":function(e,t){if((0,a.nearlyEqual)(e,n(e,t),r.relTol,r.absTol))return n(e,t);{let[r,n]=`${e}e`.split("e");const i=Math.ceil(Number(`${r}e${Number(n)+t}`));return[r,n]=`${i}e`.split("e"),Number(`${r}e${Number(n)-t}`)}}})}));t.createCeil=(0,s.factory)(h,p,(e=>{let{typed:t,config:r,round:n,matrix:s,equalScalar:a,zeros:h,DenseMatrix:p}=e;const f=(0,c.createMatAlgo11xS0s)({typed:t,equalScalar:a}),g=(0,u.createMatAlgo12xSfs)({typed:t,DenseMatrix:p}),y=(0,d.createMatAlgo14xDs)({typed:t}),b=m({typed:t,config:r,round:n});return t("ceil",{number:b.signatures.number,"number,number":b.signatures["number,number"],Complex:function(e){return e.ceil()},"Complex, number":function(e,t){return e.ceil(t)},"Complex, BigNumber":function(e,t){return e.ceil(t.toNumber())},BigNumber:function(e){return(0,l.nearlyEqual)(e,n(e),r.relTol,r.absTol)?n(e):e.ceil()},"BigNumber, BigNumber":function(e,t){return(0,l.nearlyEqual)(e,n(e,t),r.relTol,r.absTol)?n(e,t):e.toDecimalPlaces(t.toNumber(),i.default.ROUND_CEIL)},Fraction:function(e){return e.ceil()},"Fraction, number":function(e,t){return e.ceil(t)},"Fraction, BigNumber":function(e,t){return e.ceil(t.toNumber())},"Array | Matrix":t.referToSelf((e=>t=>(0,o.deepMap)(t,e,!0))),"Array, number | BigNumber":t.referToSelf((e=>(t,r)=>(0,o.deepMap)(t,(t=>e(t,r)),!0))),"SparseMatrix, number | BigNumber":t.referToSelf((e=>(t,r)=>f(t,r,e,!1))),"DenseMatrix, number | BigNumber":t.referToSelf((e=>(t,r)=>y(t,r,e,!1))),"number | Complex | Fraction | BigNumber, Array":t.referToSelf((e=>(t,r)=>y(s(r),t,e,!0).valueOf())),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf((e=>(t,r)=>a(t,0)?h(r.size(),r.storage()):"dense"===r.storage()?y(r,t,e,!0):g(r,t,e,!0)))})}))},60713:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCube=void 0;var n=r(66212),i=r(30369);const s="cube",o=["typed"];t.createCube=(0,n.factory)(s,o,(e=>{let{typed:t}=e;return t(s,{number:i.cubeNumber,Complex:function(e){return e.mul(e).mul(e)},BigNumber:function(e){return e.times(e).times(e)},bigint:function(e){return e*e*e},Fraction:function(e){return e.pow(3)},Unit:function(e){return e.pow(3)}})}))},84485:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDivide=void 0;var n=r(66212),i=r(61175),s=r(73670),o=r(18568);const a=["typed","matrix","multiply","equalScalar","divideScalar","inv"];t.createDivide=(0,n.factory)("divide",a,(e=>{let{typed:t,matrix:r,multiply:n,equalScalar:a,divideScalar:l,inv:c}=e;const u=(0,s.createMatAlgo11xS0s)({typed:t,equalScalar:a}),d=(0,o.createMatAlgo14xDs)({typed:t});return t("divide",(0,i.extend)({"Array | Matrix, Array | Matrix":function(e,t){return n(e,c(t))},"DenseMatrix, any":function(e,t){return d(e,t,l,!1)},"SparseMatrix, any":function(e,t){return u(e,t,l,!1)},"Array, any":function(e,t){return d(r(e),t,l,!1).valueOf()},"any, Array | Matrix":function(e,t){return n(e,c(t))}},l.signatures))}))},76269:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDivideScalar=void 0;var n=r(66212);const i="divideScalar",s=["typed","numeric"];t.createDivideScalar=(0,n.factory)(i,s,(e=>{let{typed:t,numeric:r}=e;return t(i,{"number, number":function(e,t){return e/t},"Complex, Complex":function(e,t){return e.div(t)},"BigNumber, BigNumber":function(e,t){return e.div(t)},"bigint, bigint":function(e,t){return e/t},"Fraction, Fraction":function(e,t){return e.div(t)},"Unit, number | Complex | Fraction | BigNumber | Unit":(e,t)=>e.divide(t),"number | Fraction | Complex | BigNumber, Unit":(e,t)=>t.divideInto(e)})}))},35128:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDotDivide=void 0;var n=r(66212),i=r(98225),s=r(89164),o=r(88177),a=r(73670),l=r(47993),c=r(11279);const u="dotDivide",d=["typed","matrix","equalScalar","divideScalar","DenseMatrix","concat"];t.createDotDivide=(0,n.factory)(u,d,(e=>{let{typed:t,matrix:r,equalScalar:n,divideScalar:d,DenseMatrix:h,concat:p}=e;const m=(0,i.createMatAlgo02xDS0)({typed:t,equalScalar:n}),f=(0,s.createMatAlgo03xDSf)({typed:t}),g=(0,o.createMatAlgo07xSSf)({typed:t,DenseMatrix:h}),y=(0,a.createMatAlgo11xS0s)({typed:t,equalScalar:n}),b=(0,l.createMatAlgo12xSfs)({typed:t,DenseMatrix:h}),v=(0,c.createMatrixAlgorithmSuite)({typed:t,matrix:r,concat:p});return t(u,v({elop:d,SS:g,DS:f,SD:m,Ss:y,sS:b}))}))},76705:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDotMultiply=void 0;var n=r(66212),i=r(98225),s=r(12485),o=r(73670),a=r(11279);const l="dotMultiply",c=["typed","matrix","equalScalar","multiplyScalar","concat"];t.createDotMultiply=(0,n.factory)(l,c,(e=>{let{typed:t,matrix:r,equalScalar:n,multiplyScalar:c,concat:u}=e;const d=(0,i.createMatAlgo02xDS0)({typed:t,equalScalar:n}),h=(0,s.createMatAlgo09xS0Sf)({typed:t,equalScalar:n}),p=(0,o.createMatAlgo11xS0s)({typed:t,equalScalar:n}),m=(0,a.createMatrixAlgorithmSuite)({typed:t,matrix:r,concat:u});return t(l,m({elop:c,SS:h,DS:d,Ss:p}))}))},4055:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDotPow=void 0;var n=r(66212),i=r(89164),s=r(88177),o=r(73670),a=r(47993),l=r(11279);const c="dotPow",u=["typed","equalScalar","matrix","pow","DenseMatrix","concat"];t.createDotPow=(0,n.factory)(c,u,(e=>{let{typed:t,equalScalar:r,matrix:n,pow:u,DenseMatrix:d,concat:h}=e;const p=(0,i.createMatAlgo03xDSf)({typed:t}),m=(0,s.createMatAlgo07xSSf)({typed:t,DenseMatrix:d}),f=(0,o.createMatAlgo11xS0s)({typed:t,equalScalar:r}),g=(0,a.createMatAlgo12xSfs)({typed:t,DenseMatrix:d}),y=(0,l.createMatrixAlgorithmSuite)({typed:t,matrix:n,concat:h}),b={};for(const e in u.signatures)Object.prototype.hasOwnProperty.call(u.signatures,e)&&(e.includes("Matrix")||e.includes("Array")||(b[e]=u.signatures[e]));const v=t(b);return t(c,y({elop:v,SS:m,DS:p,Ss:f,sS:g}))}))},65621:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createExp=void 0;var n=r(66212),i=r(30369);const s=["typed"];t.createExp=(0,n.factory)("exp",s,(e=>{let{typed:t}=e;return t("exp",{number:i.expNumber,Complex:function(e){return e.exp()},BigNumber:function(e){return e.exp()}})}))},69507:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createExpm1=void 0;var n=r(66212),i=r(30369);const s="expm1",o=["typed","Complex"];t.createExpm1=(0,n.factory)(s,o,(e=>{let{typed:t,Complex:r}=e;return t(s,{number:i.expm1Number,Complex:function(e){const t=Math.exp(e.re);return new r(t*Math.cos(e.im)-1,t*Math.sin(e.im))},BigNumber:function(e){return e.exp().minus(1)}})}))},56625:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createFixNumber=t.createFix=void 0;var n=r(66212),i=r(16624),s=r(47993),o=r(18568);const a="fix",l=["typed","Complex","matrix","ceil","floor","equalScalar","zeros","DenseMatrix"],c=t.createFixNumber=(0,n.factory)(a,["typed","ceil","floor"],(e=>{let{typed:t,ceil:r,floor:n}=e;return t(a,{number:function(e){return e>0?n(e):r(e)},"number, number":function(e,t){return e>0?n(e,t):r(e,t)}})}));t.createFix=(0,n.factory)(a,l,(e=>{let{typed:t,Complex:r,matrix:n,ceil:a,floor:l,equalScalar:u,zeros:d,DenseMatrix:h}=e;const p=(0,s.createMatAlgo12xSfs)({typed:t,DenseMatrix:h}),m=(0,o.createMatAlgo14xDs)({typed:t}),f=c({typed:t,ceil:a,floor:l});return t("fix",{number:f.signatures.number,"number, number | BigNumber":f.signatures["number,number"],Complex:function(e){return new r(e.re>0?Math.floor(e.re):Math.ceil(e.re),e.im>0?Math.floor(e.im):Math.ceil(e.im))},"Complex, number":function(e,t){return new r(e.re>0?l(e.re,t):a(e.re,t),e.im>0?l(e.im,t):a(e.im,t))},"Complex, BigNumber":function(e,t){const n=t.toNumber();return new r(e.re>0?l(e.re,n):a(e.re,n),e.im>0?l(e.im,n):a(e.im,n))},BigNumber:function(e){return e.isNegative()?a(e):l(e)},"BigNumber, number | BigNumber":function(e,t){return e.isNegative()?a(e,t):l(e,t)},Fraction:function(e){return e.s<0?e.ceil():e.floor()},"Fraction, number | BigNumber":function(e,t){return e.s<0?a(e,t):l(e,t)},"Array | Matrix":t.referToSelf((e=>t=>(0,i.deepMap)(t,e,!0))),"Array | Matrix, number | BigNumber":t.referToSelf((e=>(t,r)=>(0,i.deepMap)(t,(t=>e(t,r)),!0))),"number | Complex | Fraction | BigNumber, Array":t.referToSelf((e=>(t,r)=>m(n(r),t,e,!0).valueOf())),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf((e=>(t,r)=>u(t,0)?d(r.size(),r.storage()):"dense"===r.storage()?m(r,t,e,!0):p(r,t,e,!0)))})}))},65084:(e,t,r)=>{"use strict";var n=r(87929);Object.defineProperty(t,"__esModule",{value:!0}),t.createFloorNumber=t.createFloor=void 0;var i=n(r(13944)),s=r(66212),o=r(16624),a=r(34749),l=r(67625),c=r(73670),u=r(47993),d=r(18568);const h="floor",p=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],m=t.createFloorNumber=(0,s.factory)(h,["typed","config","round"],(e=>{let{typed:t,config:r,round:n}=e;return t(h,{number:function(e){return(0,a.nearlyEqual)(e,n(e),r.relTol,r.absTol)?n(e):Math.floor(e)},"number, number":function(e,t){if((0,a.nearlyEqual)(e,n(e,t),r.relTol,r.absTol))return n(e,t);{let[r,n]=`${e}e`.split("e");const i=Math.floor(Number(`${r}e${Number(n)+t}`));return[r,n]=`${i}e`.split("e"),Number(`${r}e${Number(n)-t}`)}}})}));t.createFloor=(0,s.factory)(h,p,(e=>{let{typed:t,config:r,round:n,matrix:s,equalScalar:a,zeros:h,DenseMatrix:p}=e;const f=(0,c.createMatAlgo11xS0s)({typed:t,equalScalar:a}),g=(0,u.createMatAlgo12xSfs)({typed:t,DenseMatrix:p}),y=(0,d.createMatAlgo14xDs)({typed:t}),b=m({typed:t,config:r,round:n});return t("floor",{number:b.signatures.number,"number,number":b.signatures["number,number"],Complex:function(e){return e.floor()},"Complex, number":function(e,t){return e.floor(t)},"Complex, BigNumber":function(e,t){return e.floor(t.toNumber())},BigNumber:function(e){return(0,l.nearlyEqual)(e,n(e),r.relTol,r.absTol)?n(e):e.floor()},"BigNumber, BigNumber":function(e,t){return(0,l.nearlyEqual)(e,n(e,t),r.relTol,r.absTol)?n(e,t):e.toDecimalPlaces(t.toNumber(),i.default.ROUND_FLOOR)},Fraction:function(e){return e.floor()},"Fraction, number":function(e,t){return e.floor(t)},"Fraction, BigNumber":function(e,t){return e.floor(t.toNumber())},"Array | Matrix":t.referToSelf((e=>t=>(0,o.deepMap)(t,e,!0))),"Array, number | BigNumber":t.referToSelf((e=>(t,r)=>(0,o.deepMap)(t,(t=>e(t,r)),!0))),"SparseMatrix, number | BigNumber":t.referToSelf((e=>(t,r)=>f(t,r,e,!1))),"DenseMatrix, number | BigNumber":t.referToSelf((e=>(t,r)=>y(t,r,e,!1))),"number | Complex | Fraction | BigNumber, Array":t.referToSelf((e=>(t,r)=>y(s(r),t,e,!0).valueOf())),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf((e=>(t,r)=>a(t,0)?h(r.size(),r.storage()):"dense"===r.storage()?y(r,t,e,!0):g(r,t,e,!0)))})}))},33168:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createGcd=void 0;var n=r(34749),i=r(66212),s=r(54066),o=r(27935),a=r(26906),l=r(8896),c=r(11279),u=r(11563);const d=["typed","config","round","matrix","equalScalar","zeros","BigNumber","DenseMatrix","concat"],h="number | BigNumber | Fraction | Matrix | Array",p=`${h}, ${h}, ...${h}`;function m(e){return!e.some((e=>Array.isArray(e)))}t.createGcd=(0,i.factory)("gcd",d,(e=>{let{typed:t,matrix:r,config:i,round:d,equalScalar:h,zeros:f,BigNumber:g,DenseMatrix:y,concat:b}=e;const v=(0,s.createMod)({typed:t,config:i,round:d,matrix:r,equalScalar:h,zeros:f,DenseMatrix:y,concat:b}),_=(0,o.createMatAlgo01xDSid)({typed:t}),x=(0,a.createMatAlgo04xSidSid)({typed:t,equalScalar:h}),w=(0,l.createMatAlgo10xSids)({typed:t,DenseMatrix:y});return t("gcd",{"number, number":function(e,t){if(!(0,n.isInteger)(e)||!(0,n.isInteger)(t))throw new Error("Parameters in function gcd must be integer numbers");let r;for(;0!==t;)r=v(e,t),e=t,t=r;return e<0?-e:e},"BigNumber, BigNumber":function(e,t){if(!e.isInt()||!t.isInt())throw new Error("Parameters in function gcd must be integer numbers");const r=new g(0);for(;!t.isZero();){const r=v(e,t);e=t,t=r}return e.lt(r)?e.neg():e},"Fraction, Fraction":(e,t)=>e.gcd(t)},(0,c.createMatrixAlgorithmSuite)({typed:t,matrix:r,concat:b})({SS:x,DS:_,Ss:w}),{[p]:t.referToSelf((e=>(t,r,n)=>{let i=e(t,r);for(let t=0;t<n.length;t++)i=e(i,n[t]);return i})),Array:t.referToSelf((e=>t=>{if(1===t.length&&Array.isArray(t[0])&&m(t[0]))return e(...t[0]);if(m(t))return e(...t);throw new u.ArgumentsError("gcd() supports only 1d matrices!")})),Matrix:t.referToSelf((e=>t=>e(t.toArray())))})}))},36376:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createHypot=void 0;var n=r(66212),i=r(34487),s=r(91612);const o="hypot",a=["typed","abs","addScalar","divideScalar","multiplyScalar","sqrt","smaller","isPositive"];t.createHypot=(0,n.factory)(o,a,(e=>{let{typed:t,abs:r,addScalar:n,divideScalar:a,multiplyScalar:l,sqrt:c,smaller:u,isPositive:d}=e;return t(o,{"... number | BigNumber":h,Array:h,Matrix:e=>h((0,i.flatten)(e.toArray()))});function h(e){let t=0,i=0;for(let o=0;o<e.length;o++){if((0,s.isComplex)(e[o]))throw new TypeError("Unexpected type of argument to hypot");const c=r(e[o]);u(i,c)?(t=l(t,l(a(i,c),a(i,c))),t=n(t,1),i=c):t=n(t,d(c)?l(a(c,i),a(c,i)):c)}return l(i,c(t))}}))},55297:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInvmod=void 0;var n=r(66212);const i="invmod",s=["typed","config","BigNumber","xgcd","equal","smaller","mod","add","isInteger"];t.createInvmod=(0,n.factory)(i,s,(e=>{let{typed:t,config:r,BigNumber:n,xgcd:s,equal:o,smaller:a,mod:l,add:c,isInteger:u}=e;return t(i,{"number, number":d,"BigNumber, BigNumber":d});function d(e,t){if(!u(e)||!u(t))throw new Error("Parameters in function invmod must be integer numbers");if(e=l(e,t),o(t,0))throw new Error("Divisor must be non zero");let r=s(e,t);r=r.valueOf();let[i,d]=r;return o(i,n(1))?(d=l(d,t),a(d,n(0))&&(d=c(d,t)),d):NaN}}))},47142:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLcm=void 0;var n=r(66212),i=r(98225),s=r(116),o=r(73670),a=r(11279),l=r(30369);const c=["typed","matrix","equalScalar","concat"];t.createLcm=(0,n.factory)("lcm",c,(e=>{let{typed:t,matrix:r,equalScalar:n,concat:c}=e;const u=(0,i.createMatAlgo02xDS0)({typed:t,equalScalar:n}),d=(0,s.createMatAlgo06xS0S0)({typed:t,equalScalar:n}),h=(0,o.createMatAlgo11xS0s)({typed:t,equalScalar:n}),p=(0,a.createMatrixAlgorithmSuite)({typed:t,matrix:r,concat:c}),m="number | BigNumber | Fraction | Matrix | Array",f={};return f[`${m}, ${m}, ...${m}`]=t.referToSelf((e=>(t,r,n)=>{let i=e(t,r);for(let t=0;t<n.length;t++)i=e(i,n[t]);return i})),t("lcm",{"number, number":l.lcmNumber,"BigNumber, BigNumber":function(e,t){if(!e.isInt()||!t.isInt())throw new Error("Parameters in function lcm must be integer numbers");if(e.isZero())return e;if(t.isZero())return t;const r=e.times(t);for(;!t.isZero();){const r=t;t=e.mod(r),e=r}return r.div(e).abs()},"Fraction, Fraction":(e,t)=>e.lcm(t)},p({SS:d,DS:u,Ss:h}),f)}))},62672:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLog=void 0;var n=r(66212),i=r(30369);const s=["config","typed","divideScalar","Complex"];t.createLog=(0,n.factory)("log",s,(e=>{let{typed:t,config:r,divideScalar:n,Complex:s}=e;return t("log",{number:function(e){return e>=0||r.predictable?(0,i.logNumber)(e):new s(e,0).log()},Complex:function(e){return e.log()},BigNumber:function(e){return!e.isNegative()||r.predictable?e.ln():new s(e.toNumber(),0).log()},"any, any":t.referToSelf((e=>(t,r)=>n(e(t),e(r))))})}))},85549:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLog10=void 0;var n=r(66212),i=r(16624),s=r(30369);const o="log10",a=["typed","config","Complex"];t.createLog10=(0,n.factory)(o,a,(e=>{let{typed:t,config:r,Complex:n}=e;return t(o,{number:function(e){return e>=0||r.predictable?(0,s.log10Number)(e):new n(e,0).log().div(Math.LN10)},Complex:function(e){return new n(e).log().div(Math.LN10)},BigNumber:function(e){return!e.isNegative()||r.predictable?e.log():new n(e.toNumber(),0).log().div(Math.LN10)},"Array | Matrix":t.referToSelf((e=>t=>(0,i.deepMap)(t,e)))})}))},9325:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLog1p=void 0;var n=r(66212),i=r(16624),s=r(34749);const o="log1p",a=["typed","config","divideScalar","log","Complex"];t.createLog1p=(0,n.factory)(o,a,(e=>{let{typed:t,config:r,divideScalar:n,log:a,Complex:l}=e;return t(o,{number:function(e){return e>=-1||r.predictable?(0,s.log1p)(e):c(new l(e,0))},Complex:c,BigNumber:function(e){const t=e.plus(1);return!t.isNegative()||r.predictable?t.ln():c(new l(e.toNumber(),0))},"Array | Matrix":t.referToSelf((e=>t=>(0,i.deepMap)(t,e))),"any, any":t.referToSelf((e=>(t,r)=>n(e(t),a(r))))});function c(e){const t=e.re+1;return new l(Math.log(Math.sqrt(t*t+e.im*e.im)),Math.atan2(e.im,t))}}))},91512:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLog2=void 0;var n=r(66212),i=r(16624),s=r(30369);const o="log2",a=["typed","config","Complex"];t.createLog2=(0,n.factory)(o,a,(e=>{let{typed:t,config:r,Complex:n}=e;return t(o,{number:function(e){return e>=0||r.predictable?(0,s.log2Number)(e):a(new n(e,0))},Complex:a,BigNumber:function(e){return!e.isNegative()||r.predictable?e.log(2):a(new n(e.toNumber(),0))},"Array | Matrix":t.referToSelf((e=>t=>(0,i.deepMap)(t,e)))});function a(e){const t=Math.sqrt(e.re*e.re+e.im*e.im);return new n(Math.log2?Math.log2(t):Math.log(t)/Math.LN2,Math.atan2(e.im,e.re)/Math.LN2)}}))},54066:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMod=void 0;var n=r(66212),i=r(65084),s=r(98225),o=r(89164),a=r(7367),l=r(73670),c=r(47993),u=r(11279);const d=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix","concat"];t.createMod=(0,n.factory)("mod",d,(e=>{let{typed:t,config:r,round:n,matrix:d,equalScalar:h,zeros:p,DenseMatrix:m,concat:f}=e;const g=(0,i.createFloor)({typed:t,config:r,round:n,matrix:d,equalScalar:h,zeros:p,DenseMatrix:m}),y=(0,s.createMatAlgo02xDS0)({typed:t,equalScalar:h}),b=(0,o.createMatAlgo03xDSf)({typed:t}),v=(0,a.createMatAlgo05xSfSf)({typed:t,equalScalar:h}),_=(0,l.createMatAlgo11xS0s)({typed:t,equalScalar:h}),x=(0,c.createMatAlgo12xSfs)({typed:t,DenseMatrix:m});return t("mod",{"number, number":function(e,t){return 0===t?e:e-t*g(e/t)},"BigNumber, BigNumber":function(e,t){return t.isZero()?e:e.sub(t.mul(g(e.div(t))))},"bigint, bigint":function(e,t){if(0n===t)return e;if(e<0){const r=e%t;return 0n===r?r:r+t}return e%t},"Fraction, Fraction":function(e,t){return t.equals(0)?e:e.sub(t.mul(g(e.div(t))))}},(0,u.createMatrixAlgorithmSuite)({typed:t,matrix:d,concat:f})({SS:v,DS:b,SD:y,Ss:_,sS:x}))}))},9728:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMultiply=void 0;var n=r(66212),i=r(91612),s=r(34487),o=r(73670),a=r(18568);const l="multiply",c=["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"];t.createMultiply=(0,n.factory)(l,c,(e=>{let{typed:t,matrix:r,addScalar:n,multiplyScalar:c,equalScalar:u,dot:d}=e;const h=(0,o.createMatAlgo11xS0s)({typed:t,equalScalar:u}),p=(0,a.createMatAlgo14xDs)({typed:t});function m(e,t){switch(e.length){case 1:switch(t.length){case 1:if(e[0]!==t[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(e[0]!==t[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+e[0]+") must match Matrix rows ("+t[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+t.length+" dimensions)")}break;case 2:switch(t.length){case 1:if(e[1]!==t[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+e[1]+") must match Vector length ("+t[0]+")");break;case 2:if(e[1]!==t[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+e[1]+") must match Matrix B rows ("+t[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+t.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+e.length+" dimensions)")}}function f(e,r){if("dense"!==r.storage())throw new Error("Support for SparseMatrix not implemented");return function(e,r){const i=e._data,s=e._size,o=e._datatype||e.getDataType(),a=r._data,l=r._size,u=r._datatype||r.getDataType(),d=s[0],h=l[1];let p,m=n,f=c;o&&u&&o===u&&"string"==typeof o&&"mixed"!==o&&(p=o,m=t.find(n,[p,p]),f=t.find(c,[p,p]));const g=[];for(let e=0;e<h;e++){let t=f(i[0],a[0][e]);for(let r=1;r<d;r++)t=m(t,f(i[r],a[r][e]));g[e]=t}return e.createDenseMatrix({data:g,size:[h],datatype:o===e._datatype&&u===r._datatype?p:void 0})}(e,r)}const g=t("_multiplyMatrixVector",{"DenseMatrix, any":function(e,r){const i=e._data,s=e._size,o=e._datatype||e.getDataType(),a=r._data,l=r._datatype||r.getDataType(),u=s[0],d=s[1];let h,p=n,m=c;o&&l&&o===l&&"string"==typeof o&&"mixed"!==o&&(h=o,p=t.find(n,[h,h]),m=t.find(c,[h,h]));const f=[];for(let e=0;e<u;e++){const t=i[e];let r=m(t[0],a[0]);for(let e=1;e<d;e++)r=p(r,m(t[e],a[e]));f[e]=r}return e.createDenseMatrix({data:f,size:[u],datatype:o===e._datatype&&l===r._datatype?h:void 0})},"SparseMatrix, any":function(e,r){const i=e._values,s=e._index,o=e._ptr,a=e._datatype||void 0===e._data?e._datatype:e.getDataType();if(!i)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");const l=r._data,d=r._datatype||r.getDataType(),h=e._size[0],p=r._size[0],m=[],f=[],g=[];let y,b=n,v=c,_=u,x=0;a&&d&&a===d&&"string"==typeof a&&"mixed"!==a&&(y=a,b=t.find(n,[y,y]),v=t.find(c,[y,y]),_=t.find(u,[y,y]),x=t.convert(0,y));const w=[],R=[];g[0]=0;for(let e=0;e<p;e++){const t=l[e];if(!_(t,x))for(let r=o[e],n=o[e+1],a=r;a<n;a++){const e=s[a];R[e]?w[e]=b(w[e],v(t,i[a])):(R[e]=!0,f.push(e),w[e]=v(t,i[a]))}}for(let e=f.length,t=0;t<e;t++){const e=f[t];m[t]=w[e]}return g[1]=f.length,e.createSparseMatrix({values:m,index:f,ptr:g,size:[h,1],datatype:a===e._datatype&&d===r._datatype?y:void 0})}}),y=t("_multiplyMatrixMatrix",{"DenseMatrix, DenseMatrix":function(e,r){const i=e._data,s=e._size,o=e._datatype||e.getDataType(),a=r._data,l=r._size,u=r._datatype||r.getDataType(),d=s[0],h=s[1],p=l[1];let m,f=n,g=c;o&&u&&o===u&&"string"==typeof o&&"mixed"!==o&&"mixed"!==o&&(m=o,f=t.find(n,[m,m]),g=t.find(c,[m,m]));const y=[];for(let e=0;e<d;e++){const t=i[e];y[e]=[];for(let r=0;r<p;r++){let n=g(t[0],a[0][r]);for(let e=1;e<h;e++)n=f(n,g(t[e],a[e][r]));y[e][r]=n}}return e.createDenseMatrix({data:y,size:[d,p],datatype:o===e._datatype&&u===r._datatype?m:void 0})},"DenseMatrix, SparseMatrix":function(e,r){const i=e._data,s=e._size,o=e._datatype||e.getDataType(),a=r._values,l=r._index,d=r._ptr,h=r._size,p=r._datatype||void 0===r._data?r._datatype:r.getDataType();if(!a)throw new Error("Cannot multiply Dense Matrix times Pattern only Matrix");const m=s[0],f=h[1];let g,y=n,b=c,v=u,_=0;o&&p&&o===p&&"string"==typeof o&&"mixed"!==o&&(g=o,y=t.find(n,[g,g]),b=t.find(c,[g,g]),v=t.find(u,[g,g]),_=t.convert(0,g));const x=[],w=[],R=[],k=r.createSparseMatrix({values:x,index:w,ptr:R,size:[m,f],datatype:o===e._datatype&&p===r._datatype?g:void 0});for(let e=0;e<f;e++){R[e]=w.length;const t=d[e],r=d[e+1];if(r>t){let e=0;for(let n=0;n<m;n++){const s=n+1;let o;for(let c=t;c<r;c++){const t=l[c];e!==s?(o=b(i[n][t],a[c]),e=s):o=y(o,b(i[n][t],a[c]))}e!==s||v(o,_)||(w.push(n),x.push(o))}}}return R[f]=w.length,k},"SparseMatrix, DenseMatrix":function(e,r){const i=e._values,s=e._index,o=e._ptr,a=e._datatype||void 0===e._data?e._datatype:e.getDataType();if(!i)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");const l=r._data,d=r._datatype||r.getDataType(),h=e._size[0],p=r._size[0],m=r._size[1];let f,g=n,y=c,b=u,v=0;a&&d&&a===d&&"string"==typeof a&&"mixed"!==a&&(f=a,g=t.find(n,[f,f]),y=t.find(c,[f,f]),b=t.find(u,[f,f]),v=t.convert(0,f));const _=[],x=[],w=[],R=e.createSparseMatrix({values:_,index:x,ptr:w,size:[h,m],datatype:a===e._datatype&&d===r._datatype?f:void 0}),k=[],j=[];for(let e=0;e<m;e++){w[e]=x.length;const t=e+1;for(let r=0;r<p;r++){const n=l[r][e];if(!b(n,v))for(let e=o[r],a=o[r+1],l=e;l<a;l++){const e=s[l];j[e]!==t?(j[e]=t,x.push(e),k[e]=y(n,i[l])):k[e]=g(k[e],y(n,i[l]))}}for(let t=w[e],r=x.length,n=t;n<r;n++){const e=x[n];_[n]=k[e]}}return w[m]=x.length,R},"SparseMatrix, SparseMatrix":function(e,r){const i=e._values,s=e._index,o=e._ptr,a=e._datatype||void 0===e._data?e._datatype:e.getDataType(),l=r._values,u=r._index,d=r._ptr,h=r._datatype||void 0===r._data?r._datatype:r.getDataType(),p=e._size[0],m=r._size[1],f=i&&l;let g,y=n,b=c;a&&h&&a===h&&"string"==typeof a&&"mixed"!==a&&(g=a,y=t.find(n,[g,g]),b=t.find(c,[g,g]));const v=f?[]:void 0,_=[],x=[],w=e.createSparseMatrix({values:v,index:_,ptr:x,size:[p,m],datatype:a===e._datatype&&h===r._datatype?g:void 0}),R=f?[]:void 0,k=[];let j,z,q,$,Z,X,Y,ee;for(let e=0;e<m;e++){x[e]=_.length;const t=e+1;for(Z=d[e],X=d[e+1],$=Z;$<X;$++)if(ee=u[$],f)for(z=o[ee],q=o[ee+1],j=z;j<q;j++)Y=s[j],k[Y]!==t?(k[Y]=t,_.push(Y),R[Y]=b(l[$],i[j])):R[Y]=y(R[Y],b(l[$],i[j]));else for(z=o[ee],q=o[ee+1],j=z;j<q;j++)Y=s[j],k[Y]!==t&&(k[Y]=t,_.push(Y));if(f)for(let t=x[e],r=_.length,n=t;n<r;n++){const e=_[n];v[n]=R[e]}}return x[m]=_.length,w}});return t(l,c,{"Array, Array":t.referTo("Matrix, Matrix",(e=>(t,n)=>{m((0,s.arraySize)(t),(0,s.arraySize)(n));const o=e(r(t),r(n));return(0,i.isMatrix)(o)?o.valueOf():o})),"Matrix, Matrix":function(e,t){const r=e.size(),n=t.size();return m(r,n),1===r.length?1===n.length?function(e,t,r){if(0===r)throw new Error("Cannot multiply two empty vectors");return d(e,t)}(e,t,r[0]):f(e,t):1===n.length?g(e,t):y(e,t)},"Matrix, Array":t.referTo("Matrix,Matrix",(e=>(t,n)=>e(t,r(n)))),"Array, Matrix":t.referToSelf((e=>(t,n)=>e(r(t,n.storage()),n))),"SparseMatrix, any":function(e,t){return h(e,t,c,!1)},"DenseMatrix, any":function(e,t){return p(e,t,c,!1)},"any, SparseMatrix":function(e,t){return h(t,e,c,!0)},"any, DenseMatrix":function(e,t){return p(t,e,c,!0)},"Array, any":function(e,t){return p(r(e),t,c,!1).valueOf()},"any, Array":function(e,t){return p(r(t),e,c,!0).valueOf()},"any, any":c,"any, any, ...any":t.referToSelf((e=>(t,r,n)=>{let i=e(t,r);for(let t=0;t<n.length;t++)i=e(i,n[t]);return i}))})}))},64636:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMultiplyScalar=void 0;var n=r(66212),i=r(30369);const s=["typed"];t.createMultiplyScalar=(0,n.factory)("multiplyScalar",s,(e=>{let{typed:t}=e;return t("multiplyScalar",{"number, number":i.multiplyNumber,"Complex, Complex":function(e,t){return e.mul(t)},"BigNumber, BigNumber":function(e,t){return e.times(t)},"bigint, bigint":function(e,t){return e*t},"Fraction, Fraction":function(e,t){return e.mul(t)},"number | Fraction | BigNumber | Complex, Unit":(e,t)=>t.multiply(e),"Unit, number | Fraction | BigNumber | Complex | Unit":(e,t)=>e.multiply(t)})}))},3106:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createNorm=void 0;var n=r(66212);const i="norm",s=["typed","abs","add","pow","conj","sqrt","multiply","equalScalar","larger","smaller","matrix","ctranspose","eigs"];t.createNorm=(0,n.factory)(i,s,(e=>{let{typed:t,abs:r,add:n,pow:s,conj:o,sqrt:a,multiply:l,equalScalar:c,larger:u,smaller:d,matrix:h,ctranspose:p,eigs:m}=e;return t(i,{number:Math.abs,Complex:function(e){return e.abs()},BigNumber:function(e){return e.abs()},boolean:function(e){return Math.abs(e)},Array:function(e){return y(h(e),2)},Matrix:function(e){return y(e,2)},"Array, number | BigNumber | string":function(e,t){return y(h(e),t)},"Matrix, number | BigNumber | string":function(e,t){return y(e,t)}});function f(e,t){if(t===Number.POSITIVE_INFINITY||"inf"===t)return function(e){let t=0;return e.forEach((function(e){const n=r(e);u(n,t)&&(t=n)}),!0),t}(e);if(t===Number.NEGATIVE_INFINITY||"-inf"===t)return function(e){let t;return e.forEach((function(e){const n=r(e);t&&!d(n,t)||(t=n)}),!0),t||0}(e);if("fro"===t)return y(e,2);if("number"==typeof t&&!isNaN(t)){if(!c(t,0)){let i=0;return e.forEach((function(e){i=n(s(r(e),t),i)}),!0),s(i,1/t)}return Number.POSITIVE_INFINITY}throw new Error("Unsupported parameter value")}function g(e,t){if(1===t)return function(e){const t=[];let i=0;return e.forEach((function(e,s){const o=s[1],a=n(t[o]||0,r(e));u(a,i)&&(i=a),t[o]=a}),!0),i}(e);if(t===Number.POSITIVE_INFINITY||"inf"===t)return function(e){const t=[];let i=0;return e.forEach((function(e,s){const o=s[0],a=n(t[o]||0,r(e));u(a,i)&&(i=a),t[o]=a}),!0),i}(e);if("fro"===t)return function(e){let t=0;return e.forEach((function(e,r){t=n(t,l(e,o(e)))})),r(a(t))}(e);if(2===t)return function(e){const t=e.size();if(t[0]!==t[1])throw new RangeError("Invalid matrix dimensions");const n=p(e),i=l(n,e),s=m(i).values.toArray(),o=s[s.length-1];return r(a(o))}(e);throw new Error("Unsupported parameter value "+t)}function y(e,t){const r=e.size();if(1===r.length)return f(e,t);if(2===r.length){if(r[0]&&r[1])return g(e,t);throw new RangeError("Invalid matrix dimensions")}}}))},55172:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createNthRootNumber=t.createNthRoot=void 0;var n=r(66212),i=r(27935),s=r(98225),o=r(116),a=r(73670),l=r(11279),c=r(30369);const u="nthRoot",d=["typed","matrix","equalScalar","BigNumber","concat"];t.createNthRoot=(0,n.factory)(u,d,(e=>{let{typed:t,matrix:r,equalScalar:n,BigNumber:d,concat:h}=e;const p=(0,i.createMatAlgo01xDSid)({typed:t}),m=(0,s.createMatAlgo02xDS0)({typed:t,equalScalar:n}),f=(0,o.createMatAlgo06xS0S0)({typed:t,equalScalar:n}),g=(0,a.createMatAlgo11xS0s)({typed:t,equalScalar:n}),y=(0,l.createMatrixAlgorithmSuite)({typed:t,matrix:r,concat:h});function b(){throw new Error("Complex number not supported in function nthRoot. Use nthRoots instead.")}return t(u,{number:c.nthRootNumber,"number, number":c.nthRootNumber,BigNumber:e=>v(e,new d(2)),"BigNumber, BigNumber":v,Complex:b,"Complex, number":b,Array:t.referTo("DenseMatrix,number",(e=>t=>e(r(t),2).valueOf())),DenseMatrix:t.referTo("DenseMatrix,number",(e=>t=>e(t,2))),SparseMatrix:t.referTo("SparseMatrix,number",(e=>t=>e(t,2))),"SparseMatrix, SparseMatrix":t.referToSelf((e=>(t,r)=>{if(1===r.density())return f(t,r,e);throw new Error("Root must be non-zero")})),"DenseMatrix, SparseMatrix":t.referToSelf((e=>(t,r)=>{if(1===r.density())return p(t,r,e,!1);throw new Error("Root must be non-zero")})),"Array, SparseMatrix":t.referTo("DenseMatrix,SparseMatrix",(e=>(t,n)=>e(r(t),n))),"number | BigNumber, SparseMatrix":t.referToSelf((e=>(t,r)=>{if(1===r.density())return g(r,t,e,!0);throw new Error("Root must be non-zero")}))},y({scalar:"number | BigNumber",SD:m,Ss:g,sS:!1}));function v(e,t){const r=d.precision,n=d.clone({precision:r+2}),i=new d(0),s=new n(1),o=t.isNegative();if(o&&(t=t.neg()),t.isZero())throw new Error("Root must be non-zero");if(e.isNegative()&&!t.abs().mod(2).equals(1))throw new Error("Root must be odd when a is negative.");if(e.isZero())return o?new n(1/0):0;if(!e.isFinite())return o?i:e;let a=e.abs().pow(s.div(t));return a=e.isNeg()?a.neg():a,new d((o?s.div(a):a).toPrecision(r))}})),t.createNthRootNumber=(0,n.factory)(u,["typed"],(e=>{let{typed:t}=e;return t(u,{number:c.nthRootNumber,"number, number":c.nthRootNumber})}))},67211:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createNthRoots=void 0;var n=r(66212);const i="nthRoots",s=["config","typed","divideScalar","Complex"];t.createNthRoots=(0,n.factory)(i,s,(e=>{let{typed:t,config:r,divideScalar:n,Complex:s}=e;const o=[function(e){return new s(e,0)},function(e){return new s(0,e)},function(e){return new s(-e,0)},function(e){return new s(0,-e)}];function a(e,t){if(t<0)throw new Error("Root must be greater than zero");if(0===t)throw new Error("Root must be non-zero");if(t%1!=0)throw new Error("Root must be an integer");if(0===e||0===e.abs())return[new s(0,0)];const r="number"==typeof e;let n;(r||0===e.re||0===e.im)&&(n=r?2*+(e<0):0===e.im?2*+(e.re<0):2*+(e.im<0)+1);const i=e.arg(),a=e.abs(),l=[],c=Math.pow(a,1/t);for(let e=0;e<t;e++){const r=(n+4*e)/t;r!==Math.round(r)?l.push(new s({r:c,phi:(i+2*Math.PI*e)/t})):l.push(o[r%4](c))}return l}return t(i,{Complex:function(e){return a(e,2)},"Complex, number":a})}))},21340:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createPow=void 0;var n=r(66212),i=r(34749),s=r(34487),o=r(30369);const a=["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"];t.createPow=(0,n.factory)("pow",a,(e=>{let{typed:t,config:r,identity:n,multiply:a,matrix:l,inv:c,number:u,fraction:d,Complex:h}=e;return t("pow",{"number, number":p,"Complex, Complex":function(e,t){return e.pow(t)},"BigNumber, BigNumber":function(e,t){return t.isInteger()||e>=0||r.predictable?e.pow(t):new h(e.toNumber(),0).pow(t.toNumber(),0)},"bigint, bigint":(e,t)=>e**t,"Fraction, Fraction":function(e,t){const n=e.pow(t);if(null!=n)return n;if(r.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return p(e.valueOf(),t.valueOf())},"Array, number":m,"Array, BigNumber":function(e,t){return m(e,t.toNumber())},"Matrix, number":f,"Matrix, BigNumber":function(e,t){return f(e,t.toNumber())},"Unit, number | BigNumber":function(e,t){return e.pow(t)}});function p(e,t){if(r.predictable&&!(0,i.isInteger)(t)&&e<0)try{const r=d(t),n=u(r);if((t===n||Math.abs((t-n)/t)<1e-14)&&r.d%2==1)return(r.n%2==0?1:-1)*Math.pow(-e,t)}catch(e){}return r.predictable&&(e<-1&&t===1/0||e>-1&&e<0&&t===-1/0)?NaN:(0,i.isInteger)(t)||e>=0||r.predictable?(0,o.powNumber)(e,t):e*e<1&&t===1/0||e*e>1&&t===-1/0?0:new h(e,0).pow(t,0)}function m(e,t){if(!(0,i.isInteger)(t))throw new TypeError("For A^b, b must be an integer (value is "+t+")");const r=(0,s.arraySize)(e);if(2!==r.length)throw new Error("For A^b, A must be 2 dimensional (A has "+r.length+" dimensions)");if(r[0]!==r[1])throw new Error("For A^b, A must be square (size is "+r[0]+"x"+r[1]+")");if(t<0)try{return m(c(e),-t)}catch(e){if("Cannot calculate inverse, determinant is zero"===e.message)throw new TypeError("For A^b, when A is not invertible, b must be a positive integer (value is "+t+")");throw e}let o=n(r[0]).valueOf(),l=e;for(;t>=1;)1==(1&t)&&(o=a(l,o)),t>>=1,l=a(l,l);return o}function f(e,t){return l(m(e.valueOf(),t))}}))},834:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRound=void 0;var n=r(66212),i=r(16624),s=r(34749),o=r(67625),a=r(73670),l=r(47993),c=r(18568),u=r(30369);const d="Number of decimals in function round must be an integer",h="round",p=["typed","config","matrix","equalScalar","zeros","BigNumber","DenseMatrix"];t.createRound=(0,n.factory)(h,p,(e=>{let{typed:t,config:r,matrix:n,equalScalar:p,zeros:m,BigNumber:f,DenseMatrix:g}=e;const y=(0,a.createMatAlgo11xS0s)({typed:t,equalScalar:p}),b=(0,l.createMatAlgo12xSfs)({typed:t,DenseMatrix:g}),v=(0,c.createMatAlgo14xDs)({typed:t});function _(e){return Math.abs((0,s.splitNumber)(e).exponent)}return t(h,{number:function(e){const t=(0,u.roundNumber)(e,_(r.relTol)),n=(0,s.nearlyEqual)(e,t,r.relTol,r.absTol)?t:e;return(0,u.roundNumber)(n)},"number, number":function(e,t){const n=_(r.relTol);if(t>=n)return(0,u.roundNumber)(e,t);const i=(0,u.roundNumber)(e,n),o=(0,s.nearlyEqual)(e,i,r.relTol,r.absTol)?i:e;return(0,u.roundNumber)(o,t)},"number, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(d);return new f(e).toDecimalPlaces(t.toNumber())},Complex:function(e){return e.round()},"Complex, number":function(e,t){if(t%1)throw new TypeError(d);return e.round(t)},"Complex, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(d);const r=t.toNumber();return e.round(r)},BigNumber:function(e){const t=new f(e).toDecimalPlaces(_(r.relTol));return((0,o.nearlyEqual)(e,t,r.relTol,r.absTol)?t:e).toDecimalPlaces(0)},"BigNumber, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(d);const n=_(r.relTol);if(t>=n)return e.toDecimalPlaces(t.toNumber());const i=e.toDecimalPlaces(n);return((0,o.nearlyEqual)(e,i,r.relTol,r.absTol)?i:e).toDecimalPlaces(t.toNumber())},Fraction:function(e){return e.round()},"Fraction, number":function(e,t){if(t%1)throw new TypeError(d);return e.round(t)},"Fraction, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(d);return e.round(t.toNumber())},"Unit, number, Unit":t.referToSelf((e=>function(t,r,n){const i=t.toNumeric(n);return n.multiply(e(i,r))})),"Unit, BigNumber, Unit":t.referToSelf((e=>(t,r,n)=>e(t,r.toNumber(),n))),"Unit, Unit":t.referToSelf((e=>(t,r)=>e(t,0,r))),"Array | Matrix, number, Unit":t.referToSelf((e=>(t,r,n)=>(0,i.deepMap)(t,(t=>e(t,r,n)),!0))),"Array | Matrix, BigNumber, Unit":t.referToSelf((e=>(t,r,n)=>e(t,r.toNumber(),n))),"Array | Matrix, Unit":t.referToSelf((e=>(t,r)=>e(t,0,r))),"Array | Matrix":t.referToSelf((e=>t=>(0,i.deepMap)(t,e,!0))),"SparseMatrix, number | BigNumber":t.referToSelf((e=>(t,r)=>y(t,r,e,!1))),"DenseMatrix, number | BigNumber":t.referToSelf((e=>(t,r)=>v(t,r,e,!1))),"Array, number | BigNumber":t.referToSelf((e=>(t,r)=>v(n(t),r,e,!1).valueOf())),"number | Complex | BigNumber | Fraction, SparseMatrix":t.referToSelf((e=>(t,r)=>p(t,0)?m(r.size(),r.storage()):b(r,t,e,!0))),"number | Complex | BigNumber | Fraction, DenseMatrix":t.referToSelf((e=>(t,r)=>p(t,0)?m(r.size(),r.storage()):v(r,t,e,!0))),"number | Complex | BigNumber | Fraction, Array":t.referToSelf((e=>(t,r)=>v(n(r),t,e,!0).valueOf()))})}))},45809:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSign=void 0;var n=r(66212),i=r(16624),s=r(30369);const o="sign",a=["typed","BigNumber","Fraction","complex"];t.createSign=(0,n.factory)(o,a,(e=>{let{typed:t,BigNumber:r,complex:n,Fraction:a}=e;return t(o,{number:s.signNumber,Complex:function(e){return 0===e.im?n((0,s.signNumber)(e.re)):e.sign()},BigNumber:function(e){return new r(e.cmp(0))},bigint:function(e){return e>0n?1n:e<0n?-1n:0n},Fraction:function(e){return new a(e.s,1)},"Array | Matrix":t.referToSelf((e=>t=>(0,i.deepMap)(t,e,!0))),Unit:t.referToSelf((e=>r=>{if(!r._isDerived()&&0!==r.units[0].unit.offset)throw new TypeError("sign is ambiguous for units with offset");return t.find(e,r.valueType())(r.value)}))})}))},86134:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSqrt=void 0;var n=r(66212);const i=["config","typed","Complex"];t.createSqrt=(0,n.factory)("sqrt",i,(e=>{let{config:t,typed:r,Complex:n}=e;return r("sqrt",{number:i,Complex:function(e){return e.sqrt()},BigNumber:function(e){return!e.isNegative()||t.predictable?e.sqrt():i(e.toNumber())},Unit:function(e){return e.pow(.5)}});function i(e){return isNaN(e)?NaN:e>=0||t.predictable?Math.sqrt(e):new n(e,0).sqrt()}}))},78187:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSquare=void 0;var n=r(66212),i=r(30369);const s="square",o=["typed"];t.createSquare=(0,n.factory)(s,o,(e=>{let{typed:t}=e;return t(s,{number:i.squareNumber,Complex:function(e){return e.mul(e)},BigNumber:function(e){return e.times(e)},bigint:function(e){return e*e},Fraction:function(e){return e.mul(e)},Unit:function(e){return e.pow(2)}})}))},61668:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSubtract=void 0;var n=r(66212),i=r(27935),s=r(89164),o=r(7367),a=r(8896),l=r(47993),c=r(11279);const u="subtract",d=["typed","matrix","equalScalar","subtractScalar","unaryMinus","DenseMatrix","concat"];t.createSubtract=(0,n.factory)(u,d,(e=>{let{typed:t,matrix:r,equalScalar:n,subtractScalar:d,unaryMinus:h,DenseMatrix:p,concat:m}=e;const f=(0,i.createMatAlgo01xDSid)({typed:t}),g=(0,s.createMatAlgo03xDSf)({typed:t}),y=(0,o.createMatAlgo05xSfSf)({typed:t,equalScalar:n}),b=(0,a.createMatAlgo10xSids)({typed:t,DenseMatrix:p}),v=(0,l.createMatAlgo12xSfs)({typed:t,DenseMatrix:p}),_=(0,c.createMatrixAlgorithmSuite)({typed:t,matrix:r,concat:m});return t(u,{"any, any":d},_({elop:d,SS:y,DS:f,SD:g,Ss:v,sS:b}))}))},33848:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSubtractScalar=void 0;var n=r(66212),i=r(30369);const s="subtractScalar",o=["typed"];t.createSubtractScalar=(0,n.factory)(s,o,(e=>{let{typed:t}=e;return t(s,{"number, number":i.subtractNumber,"Complex, Complex":function(e,t){return e.sub(t)},"BigNumber, BigNumber":function(e,t){return e.minus(t)},"bigint, bigint":function(e,t){return e-t},"Fraction, Fraction":function(e,t){return e.sub(t)},"Unit, Unit":t.referToSelf((e=>(r,n)=>{if(null===r.value||void 0===r.value)throw new Error("Parameter x contains a unit with undefined value");if(null===n.value||void 0===n.value)throw new Error("Parameter y contains a unit with undefined value");if(!r.equalBase(n))throw new Error("Units do not match");const i=r.clone();return i.value=t.find(e,[i.valueType(),n.valueType()])(i.value,n.value),i.fixPrefix=!1,i}))})}))},95825:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createUnaryMinus=void 0;var n=r(66212),i=r(16624),s=r(30369);const o="unaryMinus",a=["typed"];t.createUnaryMinus=(0,n.factory)(o,a,(e=>{let{typed:t}=e;return t(o,{number:s.unaryMinusNumber,"Complex | BigNumber | Fraction":e=>e.neg(),bigint:e=>-e,Unit:t.referToSelf((e=>r=>{const n=r.clone();return n.value=t.find(e,n.valueType())(r.value),n})),"Array | Matrix":t.referToSelf((e=>t=>(0,i.deepMap)(t,e,!0)))})}))},80617:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createUnaryPlus=void 0;var n=r(66212),i=r(16624),s=r(30369),o=r(34749);const a="unaryPlus",l=["typed","config","numeric"];t.createUnaryPlus=(0,n.factory)(a,l,(e=>{let{typed:t,config:r,numeric:n}=e;return t(a,{number:s.unaryPlusNumber,Complex:function(e){return e},BigNumber:function(e){return e},bigint:function(e){return e},Fraction:function(e){return e},Unit:function(e){return e.clone()},"Array | Matrix":t.referToSelf((e=>t=>(0,i.deepMap)(t,e,!0))),boolean:function(e){return n(e?1:0,r.number)},string:function(e){return n(e,(0,o.safeNumberType)(e,r))}})}))},10654:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createXgcd=void 0;var n=r(66212),i=r(30369);const s="xgcd",o=["typed","config","matrix","BigNumber"];t.createXgcd=(0,n.factory)(s,o,(e=>{let{typed:t,config:r,matrix:n,BigNumber:o}=e;return t(s,{"number, number":function(e,t){const s=(0,i.xgcdNumber)(e,t);return"Array"===r.matrix?s:n(s)},"BigNumber, BigNumber":function(e,t){let i,s,a;const l=new o(0),c=new o(1);let u,d=l,h=c,p=c,m=l;if(!e.isInt()||!t.isInt())throw new Error("Parameters in function xgcd must be integer numbers");for(;!t.isZero();)s=e.div(t).floor(),a=e.mod(t),i=d,d=h.minus(s.times(d)),h=i,i=p,p=m.minus(s.times(p)),m=i,e=t,t=a;u=e.lt(l)?[e.neg(),h.neg(),m.neg()]:[e,e.isZero()?0:h,m];return"Array"===r.matrix?u:n(u)}})}))},97765:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createBitAnd=void 0;var n=r(15333),i=r(98225),s=r(73670),o=r(116),a=r(66212),l=r(11279),c=r(30369);const u="bitAnd",d=["typed","matrix","equalScalar","concat"];t.createBitAnd=(0,a.factory)(u,d,(e=>{let{typed:t,matrix:r,equalScalar:a,concat:d}=e;const h=(0,i.createMatAlgo02xDS0)({typed:t,equalScalar:a}),p=(0,o.createMatAlgo06xS0S0)({typed:t,equalScalar:a}),m=(0,s.createMatAlgo11xS0s)({typed:t,equalScalar:a}),f=(0,l.createMatrixAlgorithmSuite)({typed:t,matrix:r,concat:d});return t(u,{"number, number":c.bitAndNumber,"BigNumber, BigNumber":n.bitAndBigNumber,"bigint, bigint":(e,t)=>e&t},f({SS:p,DS:h,Ss:m}))}))},44113:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createBitNot=void 0;var n=r(15333),i=r(16624),s=r(66212),o=r(30369);const a="bitNot",l=["typed"];t.createBitNot=(0,s.factory)(a,l,(e=>{let{typed:t}=e;return t(a,{number:o.bitNotNumber,BigNumber:n.bitNotBigNumber,bigint:e=>~e,"Array | Matrix":t.referToSelf((e=>t=>(0,i.deepMap)(t,e)))})}))},39439:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createBitOr=void 0;var n=r(15333),i=r(66212),s=r(8896),o=r(26906),a=r(27935),l=r(11279),c=r(30369);const u="bitOr",d=["typed","matrix","equalScalar","DenseMatrix","concat"];t.createBitOr=(0,i.factory)(u,d,(e=>{let{typed:t,matrix:r,equalScalar:i,DenseMatrix:d,concat:h}=e;const p=(0,a.createMatAlgo01xDSid)({typed:t}),m=(0,o.createMatAlgo04xSidSid)({typed:t,equalScalar:i}),f=(0,s.createMatAlgo10xSids)({typed:t,DenseMatrix:d}),g=(0,l.createMatrixAlgorithmSuite)({typed:t,matrix:r,concat:h});return t(u,{"number, number":c.bitOrNumber,"BigNumber, BigNumber":n.bitOrBigNumber,"bigint, bigint":(e,t)=>e|t},g({SS:m,DS:p,Ss:f}))}))},71501:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createBitXor=void 0;var n=r(15333),i=r(89164),s=r(88177),o=r(47993),a=r(66212),l=r(11279),c=r(30369);const u="bitXor",d=["typed","matrix","DenseMatrix","concat"];t.createBitXor=(0,a.factory)(u,d,(e=>{let{typed:t,matrix:r,DenseMatrix:a,concat:d}=e;const h=(0,i.createMatAlgo03xDSf)({typed:t}),p=(0,s.createMatAlgo07xSSf)({typed:t,DenseMatrix:a}),m=(0,o.createMatAlgo12xSfs)({typed:t,DenseMatrix:a}),f=(0,l.createMatrixAlgorithmSuite)({typed:t,matrix:r,concat:d});return t(u,{"number, number":c.bitXorNumber,"BigNumber, BigNumber":n.bitXor,"bigint, bigint":(e,t)=>e^t},f({SS:p,DS:h,Ss:m}))}))},17042:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLeftShift=void 0;var n=r(98225),i=r(73670),s=r(18568),o=r(27935),a=r(8896),l=r(15889),c=r(66212),u=r(11279),d=r(25463),h=r(30369),p=r(15333);const m="leftShift",f=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"];t.createLeftShift=(0,c.factory)(m,f,(e=>{let{typed:t,matrix:r,equalScalar:c,zeros:f,DenseMatrix:g,concat:y}=e;const b=(0,o.createMatAlgo01xDSid)({typed:t}),v=(0,n.createMatAlgo02xDS0)({typed:t,equalScalar:c}),_=(0,l.createMatAlgo08xS0Sid)({typed:t,equalScalar:c}),x=(0,a.createMatAlgo10xSids)({typed:t,DenseMatrix:g}),w=(0,i.createMatAlgo11xS0s)({typed:t,equalScalar:c}),R=(0,s.createMatAlgo14xDs)({typed:t}),k=(0,u.createMatrixAlgorithmSuite)({typed:t,matrix:r,concat:y}),j=(0,d.createUseMatrixForArrayScalar)({typed:t,matrix:r});return t(m,{"number, number":h.leftShiftNumber,"BigNumber, BigNumber":p.leftShiftBigNumber,"bigint, bigint":(e,t)=>e<<t,"SparseMatrix, number | BigNumber":t.referToSelf((e=>(t,r)=>c(r,0)?t.clone():w(t,r,e,!1))),"DenseMatrix, number | BigNumber":t.referToSelf((e=>(t,r)=>c(r,0)?t.clone():R(t,r,e,!1))),"number | BigNumber, SparseMatrix":t.referToSelf((e=>(t,r)=>c(t,0)?f(r.size(),r.storage()):x(r,t,e,!0))),"number | BigNumber, DenseMatrix":t.referToSelf((e=>(t,r)=>c(t,0)?f(r.size(),r.storage()):R(r,t,e,!0)))},j,k({SS:_,DS:b,SD:v}))}))},34105:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRightArithShift=void 0;var n=r(15333),i=r(98225),s=r(73670),o=r(18568),a=r(27935),l=r(8896),c=r(15889),u=r(66212),d=r(11279),h=r(25463),p=r(30369);const m="rightArithShift",f=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"];t.createRightArithShift=(0,u.factory)(m,f,(e=>{let{typed:t,matrix:r,equalScalar:u,zeros:f,DenseMatrix:g,concat:y}=e;const b=(0,a.createMatAlgo01xDSid)({typed:t}),v=(0,i.createMatAlgo02xDS0)({typed:t,equalScalar:u}),_=(0,c.createMatAlgo08xS0Sid)({typed:t,equalScalar:u}),x=(0,l.createMatAlgo10xSids)({typed:t,DenseMatrix:g}),w=(0,s.createMatAlgo11xS0s)({typed:t,equalScalar:u}),R=(0,o.createMatAlgo14xDs)({typed:t}),k=(0,d.createMatrixAlgorithmSuite)({typed:t,matrix:r,concat:y}),j=(0,h.createUseMatrixForArrayScalar)({typed:t,matrix:r});return t(m,{"number, number":p.rightArithShiftNumber,"BigNumber, BigNumber":n.rightArithShiftBigNumber,"bigint, bigint":(e,t)=>e>>t,"SparseMatrix, number | BigNumber":t.referToSelf((e=>(t,r)=>u(r,0)?t.clone():w(t,r,e,!1))),"DenseMatrix, number | BigNumber":t.referToSelf((e=>(t,r)=>u(r,0)?t.clone():R(t,r,e,!1))),"number | BigNumber, SparseMatrix":t.referToSelf((e=>(t,r)=>u(t,0)?f(r.size(),r.storage()):x(r,t,e,!0))),"number | BigNumber, DenseMatrix":t.referToSelf((e=>(t,r)=>u(t,0)?f(r.size(),r.storage()):R(r,t,e,!0)))},j,k({SS:_,DS:b,SD:v}))}))},17673:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRightLogShift=void 0;var n=r(98225),i=r(73670),s=r(18568),o=r(27935),a=r(8896),l=r(15889),c=r(66212),u=r(11279),d=r(30369),h=r(25463);const p="rightLogShift",m=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"];t.createRightLogShift=(0,c.factory)(p,m,(e=>{let{typed:t,matrix:r,equalScalar:c,zeros:m,DenseMatrix:f,concat:g}=e;const y=(0,o.createMatAlgo01xDSid)({typed:t}),b=(0,n.createMatAlgo02xDS0)({typed:t,equalScalar:c}),v=(0,l.createMatAlgo08xS0Sid)({typed:t,equalScalar:c}),_=(0,a.createMatAlgo10xSids)({typed:t,DenseMatrix:f}),x=(0,i.createMatAlgo11xS0s)({typed:t,equalScalar:c}),w=(0,s.createMatAlgo14xDs)({typed:t}),R=(0,u.createMatrixAlgorithmSuite)({typed:t,matrix:r,concat:g}),k=(0,h.createUseMatrixForArrayScalar)({typed:t,matrix:r});return t(p,{"number, number":d.rightLogShiftNumber,"SparseMatrix, number | BigNumber":t.referToSelf((e=>(t,r)=>c(r,0)?t.clone():x(t,r,e,!1))),"DenseMatrix, number | BigNumber":t.referToSelf((e=>(t,r)=>c(r,0)?t.clone():w(t,r,e,!1))),"number | BigNumber, SparseMatrix":t.referToSelf((e=>(t,r)=>c(t,0)?m(r.size(),r.storage()):_(r,t,e,!0))),"number | BigNumber, DenseMatrix":t.referToSelf((e=>(t,r)=>c(t,0)?m(r.size(),r.storage()):w(r,t,e,!0)))},k,R({SS:v,DS:y,SD:b}))}))},25463:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createUseMatrixForArrayScalar=void 0;var n=r(66212);t.createUseMatrixForArrayScalar=(0,n.factory)("useMatrixForArrayScalar",["typed","matrix"],(e=>{let{typed:t,matrix:r}=e;return{"Array, number":t.referTo("DenseMatrix, number",(e=>(t,n)=>e(r(t),n).valueOf())),"Array, BigNumber":t.referTo("DenseMatrix, BigNumber",(e=>(t,n)=>e(r(t),n).valueOf())),"number, Array":t.referTo("number, DenseMatrix",(e=>(t,n)=>e(t,r(n)).valueOf())),"BigNumber, Array":t.referTo("BigNumber, DenseMatrix",(e=>(t,n)=>e(t,r(n)).valueOf()))}}))},12768:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createBellNumbers=void 0;var n=r(66212);const i="bellNumbers",s=["typed","addScalar","isNegative","isInteger","stirlingS2"];t.createBellNumbers=(0,n.factory)(i,s,(e=>{let{typed:t,addScalar:r,isNegative:n,isInteger:s,stirlingS2:o}=e;return t(i,{"number | BigNumber":function(e){if(!s(e)||n(e))throw new TypeError("Non-negative integer value expected in function bellNumbers");let t=0;for(let n=0;n<=e;n++)t=r(t,o(e,n));return t}})}))},72779:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCatalan=void 0;var n=r(66212);const i="catalan",s=["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"];t.createCatalan=(0,n.factory)(i,s,(e=>{let{typed:t,addScalar:r,divideScalar:n,multiplyScalar:s,combinations:o,isNegative:a,isInteger:l}=e;return t(i,{"number | BigNumber":function(e){if(!l(e)||a(e))throw new TypeError("Non-negative integer value expected in function catalan");return n(o(s(e,2),e),r(e,1))}})}))},79987:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createComposition=void 0;var n=r(66212);const i="composition",s=["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"];t.createComposition=(0,n.factory)(i,s,(e=>{let{typed:t,addScalar:r,combinations:n,isPositive:s,isNegative:o,isInteger:a,larger:l}=e;return t(i,{"number | BigNumber, number | BigNumber":function(e,t){if(!(a(e)&&s(e)&&a(t)&&s(t)))throw new TypeError("Positive integer value expected in function composition");if(l(t,e))throw new TypeError("k must be less than or equal to n in function composition");return n(r(e,-1),r(t,-1))}})}))},90192:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createStirlingS2=void 0;var n=r(66212),i=r(91612);const s="stirlingS2",o=["typed","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","number","?bignumber","larger"];t.createStirlingS2=(0,n.factory)(s,o,(e=>{let{typed:t,addScalar:r,subtractScalar:n,multiplyScalar:o,divideScalar:a,pow:l,factorial:c,combinations:u,isNegative:d,isInteger:h,number:p,bignumber:m,larger:f}=e;const g=[],y=[];return t(s,{"number | BigNumber, number | BigNumber":function(e,t){if(!h(e)||d(e)||!h(t)||d(t))throw new TypeError("Non-negative integer value expected in function stirlingS2");if(f(t,e))throw new TypeError("k must be less than or equal to n in function stirlingS2");const n=!((0,i.isNumber)(e)&&(0,i.isNumber)(t)),s=n?y:g,a=n?m:p,l=p(e),c=p(t);if(s[l]&&s[l].length>c)return s[l][c];for(let e=0;e<=l;++e){if(s[e]||(s[e]=[a(0===e?1:0)]),0===e)continue;const t=s[e],n=s[e-1];for(let i=t.length;i<=e&&i<=c;++i)t[i]=i===e?1:r(o(a(i),n[i]),n[i-1])}return s[l][c]}})}))},83694:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createArg=void 0;var n=r(66212),i=r(16624);const s=["typed"];t.createArg=(0,n.factory)("arg",s,(e=>{let{typed:t}=e;return t("arg",{number:function(e){return Math.atan2(0,e)},BigNumber:function(e){return e.constructor.atan2(0,e)},Complex:function(e){return e.arg()},"Array | Matrix":t.referToSelf((e=>t=>(0,i.deepMap)(t,e)))})}))},2886:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createConj=void 0;var n=r(66212),i=r(16624);const s="conj",o=["typed"];t.createConj=(0,n.factory)(s,o,(e=>{let{typed:t}=e;return t(s,{"number | BigNumber | Fraction":e=>e,Complex:e=>e.conjugate(),"Array | Matrix":t.referToSelf((e=>t=>(0,i.deepMap)(t,e)))})}))},42502:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createIm=void 0;var n=r(66212),i=r(16624);const s=["typed"];t.createIm=(0,n.factory)("im",s,(e=>{let{typed:t}=e;return t("im",{number:()=>0,"BigNumber | Fraction":e=>e.mul(0),Complex:e=>e.im,"Array | Matrix":t.referToSelf((e=>t=>(0,i.deepMap)(t,e)))})}))},68665:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRe=void 0;var n=r(66212),i=r(16624);const s=["typed"];t.createRe=(0,n.factory)("re",s,(e=>{let{typed:t}=e;return t("re",{"number | BigNumber | Fraction":e=>e,Complex:e=>e.re,"Array | Matrix":t.referToSelf((e=>t=>(0,i.deepMap)(t,e)))})}))},90243:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDistance=void 0;var n=r(91612),i=r(66212);const s="distance",o=["typed","addScalar","subtractScalar","divideScalar","multiplyScalar","deepEqual","sqrt","abs"];t.createDistance=(0,i.factory)(s,o,(e=>{let{typed:t,addScalar:r,subtractScalar:i,multiplyScalar:o,divideScalar:a,deepEqual:l,sqrt:c,abs:u}=e;return t(s,{"Array, Array, Array":function(e,t,r){if(2===e.length&&2===t.length&&2===r.length){if(!h(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!h(t))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!h(r))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(l(t,r))throw new TypeError("LinePoint1 should not be same with LinePoint2");const n=i(r[1],t[1]),s=i(t[0],r[0]),a=i(o(r[0],t[1]),o(t[0],r[1]));return y(e[0],e[1],n,s,a)}throw new TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(e,t,r){if(2===Object.keys(e).length&&2===Object.keys(t).length&&2===Object.keys(r).length){if(!h(e))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!h(t))throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!h(r))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if(l(g(t),g(r)))throw new TypeError("LinePoint1 should not be same with LinePoint2");if("pointX"in e&&"pointY"in e&&"lineOnePtX"in t&&"lineOnePtY"in t&&"lineTwoPtX"in r&&"lineTwoPtY"in r){const n=i(r.lineTwoPtY,t.lineOnePtY),s=i(t.lineOnePtX,r.lineTwoPtX),a=i(o(r.lineTwoPtX,t.lineOnePtY),o(t.lineOnePtX,r.lineTwoPtY));return y(e.pointX,e.pointY,n,s,a)}throw new TypeError("Key names do not match")}throw new TypeError("Invalid Arguments: Try again")},"Array, Array":function(e,t){if(2===e.length&&3===t.length){if(!h(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!p(t))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return y(e[0],e[1],t[0],t[1],t[2])}if(3===e.length&&6===t.length){if(!p(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!f(t))throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return b(e[0],e[1],e[2],t[0],t[1],t[2],t[3],t[4],t[5])}if(e.length===t.length&&e.length>0){if(!m(e))throw new TypeError("All values of an array should be numbers or BigNumbers");if(!m(t))throw new TypeError("All values of an array should be numbers or BigNumbers");return v(e,t)}throw new TypeError("Invalid Arguments: Try again")},"Object, Object":function(e,t){if(2===Object.keys(e).length&&3===Object.keys(t).length){if(!h(e))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!p(t))throw new TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if("pointX"in e&&"pointY"in e&&"xCoeffLine"in t&&"yCoeffLine"in t&&"constant"in t)return y(e.pointX,e.pointY,t.xCoeffLine,t.yCoeffLine,t.constant);throw new TypeError("Key names do not match")}if(3===Object.keys(e).length&&6===Object.keys(t).length){if(!p(e))throw new TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if(!f(t))throw new TypeError("Values of x0, y0, z0, a, b and c should be numbers or BigNumbers");if("pointX"in e&&"pointY"in e&&"x0"in t&&"y0"in t&&"z0"in t&&"a"in t&&"b"in t&&"c"in t)return b(e.pointX,e.pointY,e.pointZ,t.x0,t.y0,t.z0,t.a,t.b,t.c);throw new TypeError("Key names do not match")}if(2===Object.keys(e).length&&2===Object.keys(t).length){if(!h(e))throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if(!h(t))throw new TypeError("Values of pointTwoX and pointTwoY should be numbers or BigNumbers");if("pointOneX"in e&&"pointOneY"in e&&"pointTwoX"in t&&"pointTwoY"in t)return v([e.pointOneX,e.pointOneY],[t.pointTwoX,t.pointTwoY]);throw new TypeError("Key names do not match")}if(3===Object.keys(e).length&&3===Object.keys(t).length){if(!p(e))throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!p(t))throw new TypeError("Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers");if("pointOneX"in e&&"pointOneY"in e&&"pointOneZ"in e&&"pointTwoX"in t&&"pointTwoY"in t&&"pointTwoZ"in t)return v([e.pointOneX,e.pointOneY,e.pointOneZ],[t.pointTwoX,t.pointTwoY,t.pointTwoZ]);throw new TypeError("Key names do not match")}throw new TypeError("Invalid Arguments: Try again")},Array:function(e){if(!function(e){if(2===e[0].length&&d(e[0][0])&&d(e[0][1])){if(e.some((e=>2!==e.length||!d(e[0])||!d(e[1]))))return!1}else{if(!(3===e[0].length&&d(e[0][0])&&d(e[0][1])&&d(e[0][2])))return!1;if(e.some((e=>3!==e.length||!d(e[0])||!d(e[1])||!d(e[2]))))return!1}return!0}(e))throw new TypeError("Incorrect array format entered for pairwise distance calculation");return function(e){const t=[];let r=[],n=[];for(let i=0;i<e.length-1;i++)for(let s=i+1;s<e.length;s++)2===e[0].length?(r=[e[i][0],e[i][1]],n=[e[s][0],e[s][1]]):3===e[0].length&&(r=[e[i][0],e[i][1],e[i][2]],n=[e[s][0],e[s][1],e[s][2]]),t.push(v(r,n));return t}(e)}});function d(e){return"number"==typeof e||(0,n.isBigNumber)(e)}function h(e){return e.constructor!==Array&&(e=g(e)),d(e[0])&&d(e[1])}function p(e){return e.constructor!==Array&&(e=g(e)),d(e[0])&&d(e[1])&&d(e[2])}function m(e){return Array.isArray(e)||(e=g(e)),e.every(d)}function f(e){return e.constructor!==Array&&(e=g(e)),d(e[0])&&d(e[1])&&d(e[2])&&d(e[3])&&d(e[4])&&d(e[5])}function g(e){const t=Object.keys(e),r=[];for(let n=0;n<t.length;n++)r.push(e[t[n]]);return r}function y(e,t,n,i,s){const l=u(r(r(o(n,e),o(i,t)),s)),d=c(r(o(n,n),o(i,i)));return a(l,d)}function b(e,t,n,s,l,u,d,h,p){let m=[i(o(i(l,t),p),o(i(u,n),h)),i(o(i(u,n),d),o(i(s,e),p)),i(o(i(s,e),h),o(i(l,t),d))];m=c(r(r(o(m[0],m[0]),o(m[1],m[1])),o(m[2],m[2])));const f=c(r(r(o(d,d),o(h,h)),o(p,p)));return a(m,f)}function v(e,t){const n=e.length;let s=0,a=0;for(let l=0;l<n;l++)a=i(e[l],t[l]),s=r(o(a,a),s);return c(s)}}))},40247:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createIntersect=void 0;var n=r(66212);const i=["typed","config","abs","add","addScalar","matrix","multiply","multiplyScalar","divideScalar","subtract","smaller","equalScalar","flatten","isZero","isNumeric"];t.createIntersect=(0,n.factory)("intersect",i,(e=>{let{typed:t,config:r,abs:n,add:i,addScalar:s,matrix:o,multiply:a,multiplyScalar:l,divideScalar:c,subtract:u,smaller:d,equalScalar:h,flatten:p,isZero:m,isNumeric:f}=e;return t("intersect",{"Array, Array, Array":g,"Array, Array, Array, Array":y,"Matrix, Matrix, Matrix":function(e,t,r){const n=g(e.valueOf(),t.valueOf(),r.valueOf());return null===n?null:o(n)},"Matrix, Matrix, Matrix, Matrix":function(e,t,r,n){const i=y(e.valueOf(),t.valueOf(),r.valueOf(),n.valueOf());return null===i?null:o(i)}});function g(e,t,r){if(e=b(e),t=b(t),r=b(r),!_(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!_(t))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!function(e){return 4===e.length&&f(e[0])&&f(e[1])&&f(e[2])&&f(e[3])}(r))throw new TypeError("Array with 4 numbers expected as third argument");return function(e,t,r,n,i,o,a,d,h,p){const m=l(e,a),f=l(n,a),g=l(t,d),y=l(i,d),b=l(r,h),v=l(o,h),_=u(u(u(p,m),g),b),x=u(u(u(s(s(f,y),v),m),g),b),w=c(_,x),R=s(e,l(w,u(n,e))),k=s(t,l(w,u(i,t))),j=s(r,l(w,u(o,r)));return[R,k,j]}(e[0],e[1],e[2],t[0],t[1],t[2],r[0],r[1],r[2],r[3])}function y(e,t,o,p){if(e=b(e),t=b(t),o=b(o),p=b(p),2===e.length){if(!v(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!v(t))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!v(o))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(!v(p))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return function(e,t,o,h){const p=e,f=o,g=u(p,t),y=u(f,h),b=u(l(g[0],y[1]),l(y[0],g[1]));if(m(b))return null;if(d(n(b),r.relTol))return null;const v=l(y[0],p[1]),_=l(y[1],p[0]),x=l(y[0],f[1]),w=l(y[1],f[0]),R=c(s(u(u(v,_),x),w),b);return i(a(g,R),p)}(e,t,o,p)}if(3===e.length){if(!_(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!_(t))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!_(o))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!_(p))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return function(e,t,r,n,i,o,a,d,p,f,g,y){const b=x(e,a,f,a,t,d,g,d,r,p,y,p),v=x(f,a,n,e,g,d,i,t,y,p,o,r),_=x(e,a,n,e,t,d,i,t,r,p,o,r),w=x(f,a,f,a,g,d,g,d,y,p,y,p),R=x(n,e,n,e,i,t,i,t,o,r,o,r),k=u(l(b,v),l(_,w)),j=u(l(R,w),l(v,v));if(m(j))return null;const z=c(k,j),q=c(s(b,l(z,v)),w),$=s(e,l(z,u(n,e))),Z=s(t,l(z,u(i,t))),X=s(r,l(z,u(o,r))),Y=s(a,l(q,u(f,a))),ee=s(d,l(q,u(g,d))),te=s(p,l(q,u(y,p)));return h($,Y)&&h(Z,ee)&&h(X,te)?[$,Z,X]:null}(e[0],e[1],e[2],t[0],t[1],t[2],o[0],o[1],o[2],p[0],p[1],p[2])}throw new TypeError("Arrays with two or thee dimensional points expected")}function b(e){return 1===e.length?e[0]:e.length>1&&Array.isArray(e[0])&&e.every((e=>Array.isArray(e)&&1===e.length))?p(e):e}function v(e){return 2===e.length&&f(e[0])&&f(e[1])}function _(e){return 3===e.length&&f(e[0])&&f(e[1])&&f(e[2])}function x(e,t,r,n,i,o,a,c,d,h,p,m){const f=l(u(e,t),u(r,n)),g=l(u(i,o),u(a,c)),y=l(u(d,h),u(p,m));return s(s(f,g),y)}}))},91732:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAnd=void 0;var n=r(98225),i=r(73670),s=r(18568),o=r(116),a=r(66212),l=r(11279),c=r(30369);const u=["typed","matrix","equalScalar","zeros","not","concat"];t.createAnd=(0,a.factory)("and",u,(e=>{let{typed:t,matrix:r,equalScalar:a,zeros:u,not:d,concat:h}=e;const p=(0,n.createMatAlgo02xDS0)({typed:t,equalScalar:a}),m=(0,o.createMatAlgo06xS0S0)({typed:t,equalScalar:a}),f=(0,i.createMatAlgo11xS0s)({typed:t,equalScalar:a}),g=(0,s.createMatAlgo14xDs)({typed:t}),y=(0,l.createMatrixAlgorithmSuite)({typed:t,matrix:r,concat:h});return t("and",{"number, number":c.andNumber,"Complex, Complex":function(e,t){return!(0===e.re&&0===e.im||0===t.re&&0===t.im)},"BigNumber, BigNumber":function(e,t){return!(e.isZero()||t.isZero()||e.isNaN()||t.isNaN())},"bigint, bigint":c.andNumber,"Unit, Unit":t.referToSelf((e=>(t,r)=>e(t.value||0,r.value||0))),"SparseMatrix, any":t.referToSelf((e=>(t,r)=>d(r)?u(t.size(),t.storage()):f(t,r,e,!1))),"DenseMatrix, any":t.referToSelf((e=>(t,r)=>d(r)?u(t.size(),t.storage()):g(t,r,e,!1))),"any, SparseMatrix":t.referToSelf((e=>(t,r)=>d(t)?u(t.size(),t.storage()):f(r,t,e,!0))),"any, DenseMatrix":t.referToSelf((e=>(t,r)=>d(t)?u(t.size(),t.storage()):g(r,t,e,!0))),"Array, any":t.referToSelf((e=>(t,n)=>e(r(t),n).valueOf())),"any, Array":t.referToSelf((e=>(t,n)=>e(t,r(n)).valueOf()))},y({SS:m,DS:p}))}))},27160:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createNot=void 0;var n=r(16624),i=r(66212),s=r(30369);const o=["typed"];t.createNot=(0,i.factory)("not",o,(e=>{let{typed:t}=e;return t("not",{"null | undefined":()=>!0,number:s.notNumber,Complex:function(e){return 0===e.re&&0===e.im},BigNumber:function(e){return e.isZero()||e.isNaN()},bigint:e=>!e,Unit:t.referToSelf((e=>r=>t.find(e,r.valueType())(r.value))),"Array | Matrix":t.referToSelf((e=>t=>(0,n.deepMap)(t,e)))})}))},98456:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createOr=void 0;var n=r(89164),i=r(47993),s=r(7367),o=r(66212),a=r(11279),l=r(30369);const c=["typed","matrix","equalScalar","DenseMatrix","concat"];t.createOr=(0,o.factory)("or",c,(e=>{let{typed:t,matrix:r,equalScalar:o,DenseMatrix:c,concat:u}=e;const d=(0,n.createMatAlgo03xDSf)({typed:t}),h=(0,s.createMatAlgo05xSfSf)({typed:t,equalScalar:o}),p=(0,i.createMatAlgo12xSfs)({typed:t,DenseMatrix:c}),m=(0,a.createMatrixAlgorithmSuite)({typed:t,matrix:r,concat:u});return t("or",{"number, number":l.orNumber,"Complex, Complex":function(e,t){return 0!==e.re||0!==e.im||0!==t.re||0!==t.im},"BigNumber, BigNumber":function(e,t){return!e.isZero()&&!e.isNaN()||!t.isZero()&&!t.isNaN()},"bigint, bigint":l.orNumber,"Unit, Unit":t.referToSelf((e=>(t,r)=>e(t.value||0,r.value||0)))},m({SS:h,DS:d,Ss:p}))}))},69188:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createXor=void 0;var n=r(89164),i=r(88177),s=r(47993),o=r(66212),a=r(11279),l=r(30369);const c=["typed","matrix","DenseMatrix","concat"];t.createXor=(0,o.factory)("xor",c,(e=>{let{typed:t,matrix:r,DenseMatrix:o,concat:c}=e;const u=(0,n.createMatAlgo03xDSf)({typed:t}),d=(0,i.createMatAlgo07xSSf)({typed:t,DenseMatrix:o}),h=(0,s.createMatAlgo12xSfs)({typed:t,DenseMatrix:o}),p=(0,a.createMatrixAlgorithmSuite)({typed:t,matrix:r,concat:c});return t("xor",{"number, number":l.xorNumber,"Complex, Complex":function(e,t){return(0!==e.re||0!==e.im)!=(0!==t.re||0!==t.im)},"bigint, bigint":l.xorNumber,"BigNumber, BigNumber":function(e,t){return(!e.isZero()&&!e.isNaN())!=(!t.isZero()&&!t.isNaN())},"Unit, Unit":t.referToSelf((e=>(t,r)=>e(t.value||0,r.value||0)))},p({SS:d,DS:u,Ss:h}))}))},92595:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createApply=void 0;var n=r(66212),i=r(34487),s=r(91612),o=r(17967);const a="apply",l=["typed","isInteger"];t.createApply=(0,n.factory)(a,l,(e=>{let{typed:t,isInteger:r}=e;return t(a,{"Array | Matrix, number | BigNumber, function":function(e,t,n){if(!r(t))throw new TypeError("Integer number expected for dimension");const a=Array.isArray(e)?(0,i.arraySize)(e):e.size();if(t<0||t>=a.length)throw new o.IndexError(t,a.length);return(0,s.isMatrix)(e)?e.create(c(e.valueOf(),t,n),e.datatype()):c(e,t,n)}})}));function c(e,t,r){let n,i,s;if(t<=0){if(Array.isArray(e[0])){for(s=function(e){const t=e.length,r=e[0].length;let n,i;const s=[];for(i=0;i<r;i++){const r=[];for(n=0;n<t;n++)r.push(e[n][i]);s.push(r)}return s}(e),i=[],n=0;n<s.length;n++)i[n]=c(s[n],t-1,r);return i}return r(e)}for(i=[],n=0;n<e.length;n++)i[n]=c(e[n],t-1,r);return i}},72669:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createColumn=void 0;var n=r(66212),i=r(91612),s=r(61175),o=r(34487);const a="column",l=["typed","Index","matrix","range"];t.createColumn=(0,n.factory)(a,l,(e=>{let{typed:t,Index:r,matrix:n,range:l}=e;return t(a,{"Matrix, number":c,"Array, number":function(e,t){return c(n((0,s.clone)(e)),t).valueOf()}});function c(e,t){if(2!==e.size().length)throw new Error("Only two dimensional matrix is supported");(0,o.validateIndex)(t,e.size()[1]);const s=l(0,e.size()[0]),a=new r(s,t),c=e.subset(a);return(0,i.isMatrix)(c)?c:n([[c]])}}))},52359:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createConcat=void 0;var n=r(91612),i=r(61175),s=r(34487),o=r(17967),a=r(6523),l=r(66212);const c="concat",u=["typed","matrix","isInteger"];t.createConcat=(0,l.factory)(c,u,(e=>{let{typed:t,matrix:r,isInteger:l}=e;return t(c,{"...Array | Matrix | number | BigNumber":function(e){let t;const c=e.length;let u,d=-1,h=!1;const p=[];for(t=0;t<c;t++){const r=e[t];if((0,n.isMatrix)(r)&&(h=!0),(0,n.isNumber)(r)||(0,n.isBigNumber)(r)){if(t!==c-1)throw new Error("Dimension must be specified as last argument");if(u=d,d=r.valueOf(),!l(d))throw new TypeError("Integer number expected for dimension");if(d<0||t>0&&d>u)throw new o.IndexError(d,u+1)}else{const e=(0,i.clone)(r).valueOf(),n=(0,s.arraySize)(e);if(p[t]=e,u=d,d=n.length-1,t>0&&d!==u)throw new a.DimensionError(u+1,d+1)}}if(0===p.length)throw new SyntaxError("At least one matrix expected");let m=p.shift();for(;p.length;)m=(0,s.concat)(m,p.shift(),d);return h?r(m):m},"...string":function(e){return e.join("")}})}))},25580:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCount=void 0;var n=r(66212);const i="count",s=["typed","size","prod"];t.createCount=(0,n.factory)(i,s,(e=>{let{typed:t,size:r,prod:n}=e;return t(i,{string:function(e){return e.length},"Matrix | Array":function(e){return n(r(e))}})}))},76223:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCross=void 0;var n=r(34487),i=r(66212);const s="cross",o=["typed","matrix","subtract","multiply"];t.createCross=(0,i.factory)(s,o,(e=>{let{typed:t,matrix:r,subtract:i,multiply:o}=e;return t(s,{"Matrix, Matrix":function(e,t){return r(a(e.toArray(),t.toArray()))},"Matrix, Array":function(e,t){return r(a(e.toArray(),t))},"Array, Matrix":function(e,t){return r(a(e,t.toArray()))},"Array, Array":a});function a(e,t){const r=Math.max((0,n.arraySize)(e).length,(0,n.arraySize)(t).length);e=(0,n.squeeze)(e),t=(0,n.squeeze)(t);const s=(0,n.arraySize)(e),a=(0,n.arraySize)(t);if(1!==s.length||1!==a.length||3!==s[0]||3!==a[0])throw new RangeError("Vectors with length 3 expected (Size A = ["+s.join(", ")+"], B = ["+a.join(", ")+"])");const l=[i(o(e[1],t[2]),o(e[2],t[1])),i(o(e[2],t[0]),o(e[0],t[2])),i(o(e[0],t[1]),o(e[1],t[0]))];return r>1?[l]:l}}))},22763:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCtranspose=void 0;var n=r(66212);const i="ctranspose",s=["typed","transpose","conj"];t.createCtranspose=(0,n.factory)(i,s,(e=>{let{typed:t,transpose:r,conj:n}=e;return t(i,{any:function(e){return n(r(e))}})}))},96614:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDet=void 0;var n=r(91612),i=r(61175),s=r(7041),o=r(66212);const a=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"];t.createDet=(0,o.factory)("det",a,(e=>{let{typed:t,matrix:r,subtractScalar:o,multiply:a,divideScalar:l,isZero:c,unaryMinus:u}=e;return t("det",{any:function(e){return(0,i.clone)(e)},"Array | Matrix":function(e){let t;switch(t=(0,n.isMatrix)(e)?e.size():Array.isArray(e)?(e=r(e)).size():[],t.length){case 0:return(0,i.clone)(e);case 1:if(1===t[0])return(0,i.clone)(e.valueOf()[0]);if(0===t[0])return 1;throw new RangeError("Matrix must be square (size: "+(0,s.format)(t)+")");case 2:{const r=t[0],n=t[1];if(r===n)return function(e,t,r){if(1===t)return(0,i.clone)(e[0][0]);if(2===t)return o(a(e[0][0],e[1][1]),a(e[1][0],e[0][1]));{let r=!1;const n=new Array(t).fill(0).map(((e,t)=>t));for(let i=0;i<t;i++){let s=n[i];if(c(e[s][i])){let o;for(o=i+1;o<t;o++)if(!c(e[n[o]][i])){s=n[o],n[o]=n[i],n[i]=s,r=!r;break}if(o===t)return e[s][i]}const u=e[s][i],d=0===i?1:e[n[i-1]][i-1];for(let r=i+1;r<t;r++){const c=n[r];for(let r=i+1;r<t;r++)e[c][r]=l(o(a(e[c][r],u),a(e[c][i],e[s][r])),d)}}const i=e[n[t-1]][t-1];return r?u(i):i}}(e.clone().valueOf(),r);if(0===n)return 1;throw new RangeError("Matrix must be square (size: "+(0,s.format)(t)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+(0,s.format)(t)+")")}}})}))},16204:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDiag=void 0;var n=r(91612),i=r(34487),s=r(34749),o=r(66212);const a="diag",l=["typed","matrix","DenseMatrix","SparseMatrix"];t.createDiag=(0,o.factory)(a,l,(e=>{let{typed:t,matrix:r,DenseMatrix:o,SparseMatrix:l}=e;return t(a,{Array:function(e){return c(e,0,(0,i.arraySize)(e),null)},"Array, number":function(e,t){return c(e,t,(0,i.arraySize)(e),null)},"Array, BigNumber":function(e,t){return c(e,t.toNumber(),(0,i.arraySize)(e),null)},"Array, string":function(e,t){return c(e,0,(0,i.arraySize)(e),t)},"Array, number, string":function(e,t,r){return c(e,t,(0,i.arraySize)(e),r)},"Array, BigNumber, string":function(e,t,r){return c(e,t.toNumber(),(0,i.arraySize)(e),r)},Matrix:function(e){return c(e,0,e.size(),e.storage())},"Matrix, number":function(e,t){return c(e,t,e.size(),e.storage())},"Matrix, BigNumber":function(e,t){return c(e,t.toNumber(),e.size(),e.storage())},"Matrix, string":function(e,t){return c(e,0,e.size(),t)},"Matrix, number, string":function(e,t,r){return c(e,t,e.size(),r)},"Matrix, BigNumber, string":function(e,t,r){return c(e,t.toNumber(),e.size(),r)}});function c(e,t,i,a){if(!(0,s.isInteger)(t))throw new TypeError("Second parameter in function diag must be an integer");const c=t>0?t:0,u=t<0?-t:0;switch(i.length){case 1:return function(e,t,r,n,i,s){const a=[n+i,n+s];if(r&&"sparse"!==r&&"dense"!==r)throw new TypeError(`Unknown matrix type ${r}"`);const c="sparse"===r?l.diagonal(a,e,t):o.diagonal(a,e,t);return null!==r?c:c.valueOf()}(e,t,a,i[0],u,c);case 2:return function(e,t,i,s,o,a){if((0,n.isMatrix)(e)){const n=e.diagonal(t);return null!==i?i!==n.storage()?r(n,i):n:n.valueOf()}const l=Math.min(s[0]-o,s[1]-a),c=[];for(let t=0;t<l;t++)c[t]=e[t+o][t+a];return null!==i?r(c):c}(e,t,a,i,u,c)}throw new RangeError("Matrix for function diag must be 2 dimensional")}}))},20948:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDiff=void 0;var n=r(66212),i=r(34749),s=r(91612);const o="diff",a=["typed","matrix","subtract","number"];t.createDiff=(0,n.factory)(o,a,(e=>{let{typed:t,matrix:r,subtract:n,number:a}=e;return t(o,{"Array | Matrix":function(e){return(0,s.isMatrix)(e)?r(c(e.toArray())):c(e)},"Array | Matrix, number":function(e,t){if(!(0,i.isInteger)(t))throw new RangeError("Dimension must be a whole number");return(0,s.isMatrix)(e)?r(l(e.toArray(),t)):l(e,t)},"Array, BigNumber":t.referTo("Array,number",(e=>(t,r)=>e(t,a(r)))),"Matrix, BigNumber":t.referTo("Matrix,number",(e=>(t,r)=>e(t,a(r))))});function l(e,t){if((0,s.isMatrix)(e)&&(e=e.toArray()),!Array.isArray(e))throw RangeError("Array/Matrix does not have that many dimensions");if(t>0){const r=[];return e.forEach((e=>{r.push(l(e,t-1))})),r}if(0===t)return c(e);throw RangeError("Cannot have negative dimension")}function c(e){const t=[],r=e.length;for(let n=1;n<r;n++)t.push(u(e[n-1],e[n]));return t}function u(e,t){(0,s.isMatrix)(e)&&(e=e.toArray()),(0,s.isMatrix)(t)&&(t=t.toArray());const r=Array.isArray(e),i=Array.isArray(t);if(r&&i)return function(e,t){if(e.length!==t.length)throw RangeError("Not all sub-arrays have the same length");const r=[],n=e.length;for(let i=0;i<n;i++)r.push(u(e[i],t[i]));return r}(e,t);if(!r&&!i)return n(t,e);throw TypeError("Cannot calculate difference between 1 array and 1 non-array")}}))},4860:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDot=void 0;var n=r(66212),i=r(91612);const s=["typed","addScalar","multiplyScalar","conj","size"];t.createDot=(0,n.factory)("dot",s,(e=>{let{typed:t,addScalar:r,multiplyScalar:n,conj:s,size:o}=e;return t("dot",{"Array | DenseMatrix, Array | DenseMatrix":function(e,o){const c=a(e,o),u=(0,i.isMatrix)(e)?e._data:e,d=(0,i.isMatrix)(e)?e._datatype||e.getDataType():void 0,h=(0,i.isMatrix)(o)?o._data:o,p=(0,i.isMatrix)(o)?o._datatype||o.getDataType():void 0,m=2===l(e).length,f=2===l(o).length;let g=r,y=n;if(d&&p&&d===p&&"string"==typeof d&&"mixed"!==d){const e=d;g=t.find(r,[e,e]),y=t.find(n,[e,e])}if(!m&&!f){let e=y(s(u[0]),h[0]);for(let t=1;t<c;t++)e=g(e,y(s(u[t]),h[t]));return e}if(!m&&f){let e=y(s(u[0]),h[0][0]);for(let t=1;t<c;t++)e=g(e,y(s(u[t]),h[t][0]));return e}if(m&&!f){let e=y(s(u[0][0]),h[0]);for(let t=1;t<c;t++)e=g(e,y(s(u[t][0]),h[t]));return e}if(m&&f){let e=y(s(u[0][0]),h[0][0]);for(let t=1;t<c;t++)e=g(e,y(s(u[t][0]),h[t][0]));return e}},"SparseMatrix, SparseMatrix":function(e,t){a(e,t);const i=e._index,s=e._values,o=t._index,l=t._values;let c=0;const u=r,d=n;let h=0,p=0;for(;h<i.length&&p<o.length;){const e=i[h],t=o[p];e<t?h++:e>t?p++:e===t&&(c=u(c,d(s[h],l[p])),h++,p++)}return c}});function a(e,t){const r=l(e),n=l(t);let i,s;if(1===r.length)i=r[0];else{if(2!==r.length||1!==r[1])throw new RangeError("Expected a column vector, instead got a matrix of size ("+r.join(", ")+")");i=r[0]}if(1===n.length)s=n[0];else{if(2!==n.length||1!==n[1])throw new RangeError("Expected a column vector, instead got a matrix of size ("+n.join(", ")+")");s=n[0]}if(i!==s)throw new RangeError("Vectors must have equal length ("+i+" != "+s+")");if(0===i)throw new RangeError("Cannot calculate the dot product of empty vectors");return i}function l(e){return(0,i.isMatrix)(e)?e.size():o(e)}}))},69107:(e,t,r)=>{"use strict";var n=r(87929);Object.defineProperty(t,"__esModule",{value:!0}),t.createEigs=void 0;var i=n(r(37693)),s=r(66212),o=r(7041),a=r(89712),l=r(74643),c=r(91612);const u=["config","typed","matrix","addScalar","equal","subtract","abs","atan","cos","sin","multiplyScalar","divideScalar","inv","bignumber","multiply","add","larger","column","flatten","number","complex","sqrt","diag","size","reshape","qr","usolve","usolveAll","im","re","smaller","matrixFromColumns","dot"];t.createEigs=(0,s.factory)("eigs",u,(e=>{let{config:t,typed:r,matrix:n,addScalar:s,subtract:u,equal:d,abs:h,atan:p,cos:m,sin:f,multiplyScalar:g,divideScalar:y,inv:b,bignumber:v,multiply:_,add:x,larger:w,column:R,flatten:k,number:j,complex:z,sqrt:q,diag:$,size:Z,reshape:X,qr:Y,usolve:ee,usolveAll:te,im:re,re:ne,smaller:ie,matrixFromColumns:se,dot:oe}=e;const ae=(0,l.createRealSymmetric)({config:t,addScalar:s,subtract:u,column:R,flatten:k,equal:d,abs:h,atan:p,cos:m,sin:f,multiplyScalar:g,inv:b,bignumber:v,complex:z,multiply:_,add:x}),le=(0,a.createComplexEigs)({config:t,addScalar:s,subtract:u,multiply:_,multiplyScalar:g,flatten:k,divideScalar:y,sqrt:q,abs:h,bignumber:v,diag:$,size:Z,reshape:X,qr:Y,inv:b,usolve:ee,usolveAll:te,equal:d,complex:z,larger:w,smaller:ie,matrixFromColumns:se,dot:oe});return r("eigs",{Array:function(e){return ce(n(e))},"Array, number|BigNumber":function(e,t){return ce(n(e),{precision:t})},"Array, Object":(e,t)=>ce(n(e),t),Matrix:function(e){return ce(e,{matricize:!0})},"Matrix, number|BigNumber":function(e,t){return ce(e,{precision:t,matricize:!0})},"Matrix, Object":function(e,t){const r={matricize:!0};return(0,i.default)(r,t),ce(e,r)}});function ce(e){var r;let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const s=!("eigenvectors"in i)||i.eigenvectors,a=function(e,t,r){const n=e.toArray(),i=e.size();if(2!==i.length||i[0]!==i[1])throw new RangeError(`Matrix must be square (size: ${(0,o.format)(i)})`);const s=i[0];if(function(e,t,r){for(let n=0;n<t;n++)for(let i=0;i<t;i++)if(w(v(h(re(e[n][i]))),r))return!1;return!0}(n,s,t)&&(function(e,t){for(let r=0;r<t;r++)for(let n=0;n<t;n++)e[r][n]=ne(e[r][n])}(n,s),function(e,t,r){for(let n=0;n<t;n++)for(let i=n;i<t;i++)if(w(v(h(u(e[n][i],e[i][n]))),r))return!1;return!0}(n,s,t))){const i=ue(e,n,s);return ae(n,s,t,i,r)}const a=ue(e,n,s);return le(n,s,t,a,r)}(e,null!==(r=i.precision)&&void 0!==r?r:t.relTol,s);return i.matricize&&(a.values=n(a.values),s&&(a.eigenvectors=a.eigenvectors.map((e=>{let{value:t,vector:r}=e;return{value:t,vector:n(r)}})))),s&&Object.defineProperty(a,"vectors",{enumerable:!1,get:()=>{throw new Error("eigs(M).vectors replaced with eigs(M).eigenvectors")}}),a}function ue(e,t,r){const n=e.datatype();if("number"===n||"BigNumber"===n||"Complex"===n)return n;let i=!1,s=!1,o=!1;for(let e=0;e<r;e++)for(let n=0;n<r;n++){const r=t[e][n];if((0,c.isNumber)(r)||(0,c.isFraction)(r))i=!0;else if((0,c.isBigNumber)(r))s=!0;else{if(!(0,c.isComplex)(r))throw TypeError("Unsupported type in Matrix: "+(0,c.typeOf)(r));o=!0}}if(s&&o&&console.warn("Complex BigNumbers not supported, this operation will lose precission."),o){for(let e=0;e<r;e++)for(let n=0;n<r;n++)t[e][n]=z(t[e][n]);return"Complex"}if(s){for(let e=0;e<r;e++)for(let n=0;n<r;n++)t[e][n]=v(t[e][n]);return"BigNumber"}if(i){for(let e=0;e<r;e++)for(let n=0;n<r;n++)t[e][n]=j(t[e][n]);return"number"}throw TypeError("Matrix contains unsupported types only.")}}))},89712:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createComplexEigs=function(e){let{addScalar:t,subtract:r,flatten:i,multiply:s,multiplyScalar:o,divideScalar:a,sqrt:l,abs:c,bignumber:u,diag:d,size:h,reshape:p,inv:m,qr:f,usolve:g,usolveAll:y,equal:b,complex:v,larger:_,smaller:x,matrixFromColumns:w,dot:R}=e;function k(e,n,i,s){const a=t(e,s),c=r(o(e,s),o(n,i)),u=o(a,.5),d=o(l(r(o(a,a),o(4,c))),.5);return[t(u,d),r(u,d)]}function j(e,t,n,i,s,o,a,l){const d="BigNumber"===l,h="Complex"===l,p=d?u(0):h?v(0):0,m=d?u(1):h?v(1):1;if(x(c(n),a))return[[m,p],[p,m]];if(_(c(r(s,o)),a))return[[r(s,i),r(o,i)],[n,n]];const f=r(e,s),g=r(i,s);return x(c(t),a)&&x(c(g),a)?[[f,m],[n,p]]:[[t,p],[g,m]]}function z(e,t){for(let r=0;r<e.length;r++)e[r].push(...Array(t-e[r].length).fill(0));for(let r=e.length;r<t;r++)e.push(Array(t).fill(0)),e[r][r]=1;return e}function q(e,t,r){for(let n=0;n<e.length;n++)if(r(e[n],t))return n;return-1}function $(e,t,r,n,i){const s="BigNumber"===i?u(1e3):1e3;let o,a=0;for(;a<5;++a){o=Z(t,r,i);try{o=g(e,o)}catch(e){continue}if(_(Y(o),s))break}if(a>=5)return null;for(a=0;;){const t=g(e,o);if(x(Y(X(o,[t])),n))break;if(++a>=10)return null;o=ee(t)}return o}function Z(e,t,r){const n="BigNumber"===r,i="Complex"===r;let s=Array(e).fill(0).map((e=>2*Math.random()-1));return n&&(s=s.map((e=>u(e)))),i&&(s=s.map((e=>v(e)))),s=X(s,t),ee(s,r)}function X(e,t){const n=h(e);for(let i of t)i=p(i,n),e=r(e,s(a(R(i,e),R(i,i)),i));return e}function Y(e){return c(l(R(e,e)))}function ee(e,t){const r="Complex"===t,n="BigNumber"===t?u(1):r?v(1):1;return s(a(n,Y(e)),e)}return function(e,l,h,p){let g=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];const w=function(e,r,n,i,s){const l="BigNumber"===i,h="Complex"===i,p=l?u(0):0,m=l?u(1):h?v(1):1,f=l?u(1):1,g=l?u(10):2,y=o(g,g);let w;s&&(w=Array(r).fill(m));let R=!1;for(;!R;){R=!0;for(let n=0;n<r;n++){let i=p,l=p;for(let s=0;s<r;s++)n!==s&&(i=t(i,c(e[s][n])),l=t(l,c(e[n][s])));if(!b(i,0)&&!b(l,0)){let c=f,u=i;const d=a(l,g),h=o(l,g);for(;x(u,d);)u=o(u,y),c=o(c,g);for(;_(u,h);)u=a(u,y),c=a(c,g);if(x(a(t(u,l),c),o(t(i,l),.95))){R=!1;const t=a(1,c);for(let i=0;i<r;i++)n!==i&&(e[n][i]=o(e[n][i],t),e[i][n]=o(e[i][n],c));s&&(w[n]=o(w[n],t))}}}}return s?d(w):null}(e,l,0,p,g);!function(e,n,i,s,l,d){const h="BigNumber"===s,p="Complex"===s,m=h?u(0):p?v(0):0;h&&(i=u(i));for(let s=0;s<n-2;s++){let u=0,h=m;for(let t=s+1;t<n;t++){const r=e[t][s];x(c(h),c(r))&&(h=r,u=t)}if(!x(c(h),i)){if(u!==s+1){const t=e[u];e[u]=e[s+1],e[s+1]=t;for(let t=0;t<n;t++){const r=e[t][u];e[t][u]=e[t][s+1],e[t][s+1]=r}if(l){const e=d[u];d[u]=d[s+1],d[s+1]=e}}for(let i=s+2;i<n;i++){const c=a(e[i][s],h);if(0!==c){for(let t=0;t<n;t++)e[i][t]=r(e[i][t],o(c,e[s+1][t]));for(let r=0;r<n;r++)e[r][s+1]=t(e[r][s+1],o(c,e[r][i]));if(l)for(let e=0;e<n;e++)d[i][e]=r(d[i][e],o(c,d[s+1][e]))}}}}}(e,l,h,p,g,w);const{values:R,C:Z}=function(e,i,o,a,l){const h="BigNumber"===a,p="Complex"===a,m=h?u(1):p?v(1):1;h&&(o=u(o));let g=(0,n.clone)(e);const y=[];let b=i;const _=[];let w=l?d(Array(i).fill(m)):void 0,R=l?d(Array(b).fill(m)):void 0,q=0;for(;q<=100;){q+=1;const e=g[b-1][b-1];for(let t=0;t<b;t++)g[t][t]=r(g[t][t],e);const{Q:n,R:u}=f(g);g=s(u,n);for(let r=0;r<b;r++)g[r][r]=t(g[r][r],e);if(l&&(R=s(R,n)),1===b||x(c(g[b-1][b-2]),o)){q=0,y.push(g[b-1][b-1]),l&&(_.unshift([[1]]),z(R,i),w=s(w,R),b>1&&(R=d(Array(b-1).fill(m)))),b-=1,g.pop();for(let e=0;e<b;e++)g[e].pop()}else if(2===b||x(c(g[b-2][b-3]),o)){q=0;const e=k(g[b-2][b-2],g[b-2][b-1],g[b-1][b-2],g[b-1][b-1]);y.push(...e),l&&(_.unshift(j(g[b-2][b-2],g[b-2][b-1],g[b-1][b-2],g[b-1][b-1],e[0],e[1],o,a)),z(R,i),w=s(w,R),b>2&&(R=d(Array(b-2).fill(m)))),b-=2,g.pop(),g.pop();for(let e=0;e<b;e++)g[e].pop(),g[e].pop()}if(0===b)break}if(y.sort(((e,t)=>+r(c(e),c(t)))),q>100){const e=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+y.join(", "));throw e.values=y,e.vectors=[],e}const $=l?s(w,function(e,t){const r=[];for(let e=0;e<t;e++)r[e]=Array(t).fill(0);let n=0;for(const t of e){const e=t.length;for(let i=0;i<e;i++)for(let s=0;s<e;s++)r[n+i][n+s]=t[i][s];n+=e}return r}(_,i)):void 0;return{values:y,C:$}}(e,l,h,p,g);if(g){const t=function(e,t,n,o,a,l,c){const h=m(n),p=s(h,e,n),f="BigNumber"===c,g="Complex"===c,_=f?u(0):g?v(0):0,x=f?u(1):g?v(1):1,w=[],R=[];for(const e of a){const t=q(w,e,b);-1===t?(w.push(e),R.push(1)):R[t]+=1}const k=[],j=w.length,z=Array(t).fill(_),Z=d(Array(t).fill(x));for(let e=0;e<j;e++){const a=w[e],u=r(p,s(a,Z));let d=y(u,z);for(d.shift();d.length<R[e];){const e=$(u,t,d,l,c);if(null===e)break;d.push(e)}const h=s(m(o),n);d=d.map((e=>s(h,e))),k.push(...d.map((e=>({value:a,vector:i(e)}))))}return k}(e,l,Z,w,R,h,p);return{values:R,eigenvectors:t}}return{values:R}}};var n=r(61175)},74643:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRealSymmetric=function(e){let{config:t,addScalar:r,subtract:i,abs:s,atan:o,cos:a,sin:l,multiplyScalar:c,inv:u,bignumber:d,multiply:h,add:p}=e;function m(e,r,n){const i=r-e;return Math.abs(i)<=t.relTol?Math.PI/4:.5*Math.atan(2*n/(r-e))}function f(e,r,n){const a=i(r,e);return s(a)<=t.relTol?d(-1).acos().div(4):c(.5,o(h(2,n,u(a))))}function Sij1(e,t,r,n){const i=e.length,s=Math.cos(t),o=Math.sin(t),a=Array(i).fill(0),l=Array(i).fill(0);for(let t=0;t<i;t++)a[t]=s*e[t][r]-o*e[t][n],l[t]=o*e[t][r]+s*e[t][n];for(let t=0;t<i;t++)e[t][r]=a[t],e[t][n]=l[t];return e}function Sij1Big(e,t,n,s){const o=e.length,u=a(t),h=l(t),p=Array(o).fill(d(0)),m=Array(o).fill(d(0));for(let t=0;t<o;t++)p[t]=i(c(u,e[t][n]),c(h,e[t][s])),m[t]=r(c(h,e[t][n]),c(u,e[t][s]));for(let t=0;t<o;t++)e[t][n]=p[t],e[t][s]=m[t];return e}function g(e,t,n,s){const o=e.length,u=d(a(t)),m=d(l(t)),f=c(u,u),g=c(m,m),y=Array(o).fill(d(0)),b=Array(o).fill(d(0)),v=h(d(2),u,m,e[n][s]),_=r(i(c(f,e[n][n]),v),c(g,e[s][s])),x=p(c(g,e[n][n]),v,c(f,e[s][s]));for(let t=0;t<o;t++)y[t]=i(c(u,e[n][t]),c(m,e[s][t])),b[t]=r(c(m,e[n][t]),c(u,e[s][t]));e[n][n]=_,e[s][s]=x,e[n][s]=d(0),e[s][n]=d(0);for(let t=0;t<o;t++)t!==n&&t!==s&&(e[n][t]=y[t],e[t][n]=y[t],e[s][t]=b[t],e[t][s]=b[t]);return e}function y(e,t,r,n){const i=e.length,s=Math.cos(t),o=Math.sin(t),a=s*s,l=o*o,c=Array(i).fill(0),u=Array(i).fill(0),d=a*e[r][r]-2*s*o*e[r][n]+l*e[n][n],h=l*e[r][r]+2*s*o*e[r][n]+a*e[n][n];for(let t=0;t<i;t++)c[t]=s*e[r][t]-o*e[n][t],u[t]=o*e[r][t]+s*e[n][t];e[r][r]=d,e[n][n]=h,e[r][n]=0,e[n][r]=0;for(let t=0;t<i;t++)t!==r&&t!==n&&(e[r][t]=c[t],e[t][r]=c[t],e[n][t]=u[t],e[t][n]=u[t]);return e}function b(e){const t=e.length;let r=0,n=[0,1];for(let i=0;i<t;i++)for(let s=i+1;s<t;s++)Math.abs(r)<Math.abs(e[i][s])&&(r=Math.abs(e[i][s]),n=[i,s]);return[n,r]}function v(e){const t=e.length;let r=0,n=[0,1];for(let i=0;i<t;i++)for(let o=i+1;o<t;o++)s(r)<s(e[i][o])&&(r=s(e[i][o]),n=[i,o]);return[n,r]}function _(e,t,r){const n=e.length,i=Array(n);let o;if(r){o=Array(n);for(let e=0;e<n;e++)o[e]=Array(n)}for(let a=0;a<n;a++){let l=0,c=e[0];for(let t=0;t<e.length;t++)s(e[t])<s(c)&&(l=t,c=e[l]);if(i[a]=e.splice(l,1)[0],r)for(let e=0;e<n;e++)o[a][e]=t[e][l],t[e].splice(l,1)}if(!r)return{values:i};const a=o.map(((e,t)=>({value:i[t],vector:e})));return{values:i,eigenvectors:a}}return function(e,r){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.relTol,o=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;if("number"===o)return function(e,t,r){const i=e.length,s=Math.abs(t/i);let o,a;if(r){a=new Array(i);for(let e=0;e<i;e++)a[e]=Array(i).fill(0),a[e][e]=1}let l=b(e);for(;Math.abs(l[1])>=Math.abs(s);){const t=l[0][0],n=l[0][1];o=m(e[t][t],e[n][n],e[t][n]),e=y(e,o,t,n),r&&(a=Sij1(a,o,t,n)),l=b(e)}const c=Array(i).fill(0);for(let t=0;t<i;t++)c[t]=e[t][t];return _((0,n.clone)(c),a,r)}(e,i,a);if("BigNumber"===o)return function(e,t,r){const i=e.length,o=s(t/i);let a,l;if(r){l=new Array(i);for(let e=0;e<i;e++)l[e]=Array(i).fill(0),l[e][e]=1}let c=v(e);for(;s(c[1])>=s(o);){const t=c[0][0],n=c[0][1];a=f(e[t][t],e[n][n],e[t][n]),e=g(e,a,t,n),r&&(l=Sij1Big(l,a,t,n)),c=v(e)}const u=Array(i).fill(0);for(let t=0;t<i;t++)u[t]=e[t][t];return _((0,n.clone)(u),l,r)}(e,i,a);throw TypeError("Unsupported data type: "+o)}};var n=r(61175)},72793:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createExpm=void 0;var n=r(91612),i=r(7041),s=r(66212);const o="expm",a=["typed","abs","add","identity","inv","multiply"];t.createExpm=(0,s.factory)(o,a,(e=>{let{typed:t,abs:r,add:s,identity:a,inv:l,multiply:c}=e;return t(o,{Matrix:function(e){const t=e.size();if(2!==t.length||t[0]!==t[1])throw new RangeError("Matrix must be square (size: "+(0,i.format)(t)+")");const o=t[0],d=function(e){const t=e.size()[0];let n=0;for(let i=0;i<t;i++){let s=0;for(let n=0;n<t;n++)s+=r(e.get([i,n]));n=Math.max(s,n)}return n}(e),h=function(e,t){const r=30;for(let n=0;n<r;n++)for(let r=0;r<=n;r++){const i=n-r;if(u(e,r,i)<t)return{q:r,j:i}}throw new Error("Could not find acceptable parameters to compute the matrix exponential (try increasing maxSearchSize in expm.js)")}(d,1e-15),p=h.q,m=h.j,f=c(e,Math.pow(2,-m));let g=a(o),y=a(o),b=1,v=f,_=-1;for(let e=1;e<=p;e++)e>1&&(v=c(v,f),_=-_),b=b*(p-e+1)/((2*p-e+1)*e),g=s(g,c(b,v)),y=s(y,c(b*_,v));let x=c(l(y),g);for(let e=0;e<m;e++)x=c(x,x);return(0,n.isSparseMatrix)(e)?e.createSparseMatrix(x):x}});function u(e,t,r){let n=1;for(let e=2;e<=t;e++)n*=e;let i=n;for(let e=t+1;e<=2*t;e++)i*=e;const s=i*(2*t+1);return 8*Math.pow(e/Math.pow(2,r),2*t)*n*n/(i*s)}}))},18975:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createFft=void 0;var n=r(34487),i=r(66212);const s=["typed","matrix","addScalar","multiplyScalar","divideScalar","exp","tau","i","dotDivide","conj","pow","ceil","log2"];t.createFft=(0,i.factory)("fft",s,(e=>{let{typed:t,matrix:r,addScalar:i,multiplyScalar:s,divideScalar:o,exp:a,tau:l,i:c,dotDivide:u,conj:d,pow:h,ceil:p,log2:m}=e;return t("fft",{Array:f,Matrix:function(e){return e.create(f(e.valueOf()),e.datatype())}});function f(e){const t=(0,n.arraySize)(e);return 1===t.length?y(e,t[0]):g(e.map((e=>f(e,t.slice(1)))),0)}function g(e,t){const r=(0,n.arraySize)(e);if(0!==t)return new Array(r[0]).fill(0).map(((r,n)=>g(e[n],t-1)));if(1===r.length)return y(e);function i(e){const t=(0,n.arraySize)(e);return new Array(t[1]).fill(0).map(((r,n)=>new Array(t[0]).fill(0).map(((t,r)=>e[r][n]))))}return i(g(i(e),1))}function y(e){const t=e.length;if(1===t)return[e[0]];if(t%2==0){const r=[...y(e.filter(((e,t)=>t%2==0))),...y(e.filter(((e,t)=>t%2==1)))];for(let e=0;e<t/2;e++){const n=r[e],u=s(r[e+t/2],a(s(s(l,c),o(-e,t))));r[e]=i(n,u),r[e+t/2]=i(n,s(-1,u))}return r}return function(e){const t=e.length,r=a(o(s(-1,s(c,l)),t)),n=[];for(let e=1-t;e<t;e++)n.push(h(r,o(h(e,2),2)));const i=h(2,p(m(t+t-1))),g=[...new Array(t).fill(0).map(((r,i)=>s(e[i],n[t-1+i]))),...new Array(i-t).fill(0)],b=[...new Array(t+t-1).fill(0).map(((e,t)=>o(1,n[t]))),...new Array(i-(t+t-1)).fill(0)],v=y(g),_=y(b),x=new Array(i).fill(0).map(((e,t)=>s(v[t],_[t]))),w=u(d(f(d(x))),i),R=[];for(let e=t-1;e<t+t-1;e++)R.push(s(w[e],n[e]));return R}(e)}}))},45069:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createFilter=void 0;var n=r(68457),i=r(34487),s=r(66212);const o=["typed"];t.createFilter=(0,s.factory)("filter",o,(e=>{let{typed:t}=e;return t("filter",{"Array, function":a,"Matrix, function":function(e,t){return e.create(a(e.valueOf(),t),e.datatype())},"Array, RegExp":i.filterRegExp,"Matrix, RegExp":function(e,t){return e.create((0,i.filterRegExp)(e.valueOf(),t),e.datatype())}})}));function a(e,t){return(0,i.filter)(e,(function(e,r,i){return(0,n.applyCallback)(t,e,[r],i,"filter")}))}},817:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createFlatten=void 0;var n=r(34487),i=r(66212);const s="flatten",o=["typed"];t.createFlatten=(0,i.factory)(s,o,(e=>{let{typed:t}=e;return t(s,{Array:function(e){return(0,n.flatten)(e)},Matrix:function(e){return e.create((0,n.flatten)(e.toArray()),e.datatype())}})}))},92265:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createForEach=void 0;var n=r(68457),i=r(34487),s=r(66212);const o="forEach",a=["typed"];t.createForEach=(0,s.factory)(o,a,(e=>{let{typed:t}=e;return t(o,{"Array, function":l,"Matrix, function":function(e,t){e.forEach(t)}})}));function l(e,t){const r=function(s,o){if(!Array.isArray(s))return(0,n.applyCallback)(t,s,o,e,"forEach");(0,i.forEach)(s,(function(e,t){r(e,o.concat(t))}))};r(e,[])}},44150:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createGetMatrixDataType=void 0;var n=r(66212),i=r(34487),s=r(91612);const o="getMatrixDataType",a=["typed"];t.createGetMatrixDataType=(0,n.factory)(o,a,(e=>{let{typed:t}=e;return t(o,{Array:function(e){return(0,i.getArrayDataType)(e,s.typeOf)},Matrix:function(e){return e.getDataType()}})}))},6149:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createIdentity=void 0;var n=r(91612),i=r(34487),s=r(34749),o=r(66212);const a="identity",l=["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"];t.createIdentity=(0,o.factory)(a,l,(e=>{let{typed:t,config:r,matrix:o,BigNumber:l,DenseMatrix:c,SparseMatrix:u}=e;return t(a,{"":function(){return"Matrix"===r.matrix?o([]):[]},string:function(e){return o(e)},"number | BigNumber":function(e){return h(e,e,"Matrix"===r.matrix?"dense":void 0)},"number | BigNumber, string":function(e,t){return h(e,e,t)},"number | BigNumber, number | BigNumber":function(e,t){return h(e,t,"Matrix"===r.matrix?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(e,t,r){return h(e,t,r)},Array:function(e){return d(e)},"Array, string":function(e,t){return d(e,t)},Matrix:function(e){return d(e.valueOf(),e.storage())},"Matrix, string":function(e,t){return d(e.valueOf(),t)}});function d(e,t){switch(e.length){case 0:return t?o(t):[];case 1:return h(e[0],e[0],t);case 2:return h(e[0],e[1],t);default:throw new Error("Vector containing two values expected")}}function h(e,t,r){const o=(0,n.isBigNumber)(e)||(0,n.isBigNumber)(t)?l:null;if((0,n.isBigNumber)(e)&&(e=e.toNumber()),(0,n.isBigNumber)(t)&&(t=t.toNumber()),!(0,s.isInteger)(e)||e<1)throw new Error("Parameters in function identity must be positive integers");if(!(0,s.isInteger)(t)||t<1)throw new Error("Parameters in function identity must be positive integers");const a=o?new l(1):1,d=o?new o(0):0,h=[e,t];if(r){if("sparse"===r)return u.diagonal(h,a,0,d);if("dense"===r)return c.diagonal(h,a,0,d);throw new TypeError(`Unknown matrix type "${r}"`)}const p=(0,i.resize)([],h,d),m=e<t?e:t;for(let e=0;e<m;e++)p[e][e]=a;return p}}))},29702:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createIfft=void 0;var n=r(34487),i=r(66212),s=r(91612);const o="ifft",a=["typed","fft","dotDivide","conj"];t.createIfft=(0,i.factory)(o,a,(e=>{let{typed:t,fft:r,dotDivide:i,conj:a}=e;return t(o,{"Array | Matrix":function(e){const t=(0,s.isMatrix)(e)?e.size():(0,n.arraySize)(e);return i(a(r(a(e))),t.reduce(((e,t)=>e*t),1))}})}))},98704:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInv=void 0;var n=r(91612),i=r(34487),s=r(66212),o=r(7041);const a=["typed","matrix","divideScalar","addScalar","multiply","unaryMinus","det","identity","abs"];t.createInv=(0,s.factory)("inv",a,(e=>{let{typed:t,matrix:r,divideScalar:s,addScalar:a,multiply:l,unaryMinus:c,det:u,identity:d,abs:h}=e;return t("inv",{"Array | Matrix":function(e){const t=(0,n.isMatrix)(e)?e.size():(0,i.arraySize)(e);switch(t.length){case 1:if(1===t[0])return(0,n.isMatrix)(e)?r([s(1,e.valueOf()[0])]):[s(1,e[0])];throw new RangeError("Matrix must be square (size: "+(0,o.format)(t)+")");case 2:{const i=t[0],s=t[1];if(i===s)return(0,n.isMatrix)(e)?r(p(e.valueOf(),i,s),e.storage()):p(e,i,s);throw new RangeError("Matrix must be square (size: "+(0,o.format)(t)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+(0,o.format)(t)+")")}},any:function(e){return s(1,e)}});function p(e,t,r){let n,i,o,p,m;if(1===t){if(p=e[0][0],0===p)throw Error("Cannot calculate inverse, determinant is zero");return[[s(1,p)]]}if(2===t){const t=u(e);if(0===t)throw Error("Cannot calculate inverse, determinant is zero");return[[s(e[1][1],t),s(c(e[0][1]),t)],[s(c(e[1][0]),t),s(e[0][0],t)]]}{const u=e.concat();for(n=0;n<t;n++)u[n]=u[n].concat();const p=d(t).valueOf();for(let e=0;e<r;e++){let d=h(u[e][e]),f=e;for(n=e+1;n<t;)h(u[n][e])>d&&(d=h(u[n][e]),f=n),n++;if(0===d)throw Error("Cannot calculate inverse, determinant is zero");n=f,n!==e&&(m=u[e],u[e]=u[n],u[n]=m,m=p[e],p[e]=p[n],p[n]=m);const g=u[e],y=p[e];for(n=0;n<t;n++){const t=u[n],d=p[n];if(n!==e){if(0!==t[e]){for(o=s(c(t[e]),g[e]),i=e;i<r;i++)t[i]=a(t[i],l(o,g[i]));for(i=0;i<r;i++)d[i]=a(d[i],l(o,y[i]))}}else{for(o=g[e],i=e;i<r;i++)t[i]=s(t[i],o);for(i=0;i<r;i++)d[i]=s(d[i],o)}}}return p}}}))},72243:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createKron=void 0;var n=r(34487),i=r(66212);const s="kron",o=["typed","matrix","multiplyScalar"];t.createKron=(0,i.factory)(s,o,(e=>{let{typed:t,matrix:r,multiplyScalar:i}=e;return t(s,{"Matrix, Matrix":function(e,t){return r(o(e.toArray(),t.toArray()))},"Matrix, Array":function(e,t){return r(o(e.toArray(),t))},"Array, Matrix":function(e,t){return r(o(e,t.toArray()))},"Array, Array":o});function o(e,t){if(1===(0,n.arraySize)(e).length&&(e=[e]),1===(0,n.arraySize)(t).length&&(t=[t]),(0,n.arraySize)(e).length>2||(0,n.arraySize)(t).length>2)throw new RangeError("Vectors with dimensions greater then 2 are not supported expected (Size x = "+JSON.stringify(e.length)+", y = "+JSON.stringify(t.length)+")");const r=[];let s=[];return e.map((function(e){return t.map((function(t){return s=[],r.push(s),e.map((function(e){return t.map((function(t){return s.push(i(e,t))}))}))}))}))&&r}}))},15177:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMap=void 0;var n=r(68457),i=r(34487),s=r(66212);const o=["typed"];t.createMap=(0,s.factory)("map",o,(e=>{let{typed:t}=e;return t("map",{"Array, function":a,"Matrix, function":function(e,t){return e.map(t)},"Array|Matrix, Array|Matrix, ...Array|Matrix|function":(e,r,n)=>function(e,r){if("function"!=typeof r)throw new Error("Last argument must be a callback function");const n=e[0].isMatrix,s=(0,i.broadcastSizes)(...e.map((e=>e.isMatrix?e.size():(0,i.arraySize)(e)))),o=n?(e,t)=>e.get(t):i.get,l=n?e.map((t=>t.isMatrix?t.create((0,i.broadcastTo)(t.toArray(),s),t.datatype()):e[0].create((0,i.broadcastTo)(t.valueOf(),s)))):e.map((e=>e.isMatrix?(0,i.broadcastTo)(e.toArray(),s):(0,i.broadcastTo)(e,s)));let c;if(t.isTypedFunction(r)){const e=s.map((()=>0)),t=l.map((t=>o(t,e))),n=p(r,t,e,l);c=d(n)}else{const t=e.length,n=h(r,t);c=d(n)}const u=(e,t)=>c([e,...l.slice(1).map((e=>o(e,t)))],t);return n?l[0].map(u):a(l[0],u);function d(e){switch(e){case 0:return e=>r(...e);case 1:return(e,t)=>r(...e,t);case 2:return(e,t)=>r(...e,t,...l)}}function h(e,t){return e.length>t+1?2:e.length===t+1?1:0}function p(e,r,n,i){return null!==t.resolve(e,[...r,n,...i])?2:null!==t.resolve(e,[...r,n])?1:(t.resolve(e,r),0)}}([e,r,...n.slice(0,n.length-1)],n[n.length-1])})}));function a(e,t){return l(e,[],e,t)}function l(e,t,r,i){return Array.isArray(e)?e.map((function(e,n){return l(e,t.concat(n),r,i)})):(0,n.applyCallback)(i,e,t,r,"map")}},72983:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMatrixFromColumns=void 0;var n=r(66212);const i="matrixFromColumns",s=["typed","matrix","flatten","size"];t.createMatrixFromColumns=(0,n.factory)(i,s,(e=>{let{typed:t,matrix:r,flatten:n,size:s}=e;return t(i,{"...Array":function(e){return o(e)},"...Matrix":function(e){return r(o(e.map((e=>e.toArray()))))}});function o(e){if(0===e.length)throw new TypeError("At least one column is needed to construct a matrix.");const t=a(e[0]),r=[];for(let e=0;e<t;e++)r[e]=[];for(const i of e){const e=a(i);if(e!==t)throw new TypeError("The vectors had different length: "+(0|t)+" ≠ "+(0|e));const s=n(i);for(let e=0;e<t;e++)r[e].push(s[e])}return r}function a(e){const t=s(e);if(1===t.length)return t[0];if(2===t.length){if(1===t[0])return t[1];if(1===t[1])return t[0];throw new TypeError("At least one of the arguments is not a vector.")}throw new TypeError("Only one- or two-dimensional vectors are supported.")}}))},34150:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMatrixFromFunction=void 0;var n=r(66212);const i="matrixFromFunction",s=["typed","matrix","isZero"];t.createMatrixFromFunction=(0,n.factory)(i,s,(e=>{let{typed:t,matrix:r,isZero:n}=e;return t(i,{"Array | Matrix, function, string, string":function(e,t,r,n){return s(e,t,r,n)},"Array | Matrix, function, string":function(e,t,r){return s(e,t,r)},"Matrix, function":function(e,t){return s(e,t,"dense")},"Array, function":function(e,t){return s(e,t,"dense").toArray()},"Array | Matrix, string, function":function(e,t,r){return s(e,r,t)},"Array | Matrix, string, string, function":function(e,t,r,n){return s(e,n,t,r)}});function s(e,t,i,s){let o;return o=void 0!==s?r(i,s):r(i),o.resize(e),o.forEach((function(e,r){const i=t(r);n(i)||o.set(r,i)})),o}}))},39707:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMatrixFromRows=void 0;var n=r(66212);const i="matrixFromRows",s=["typed","matrix","flatten","size"];t.createMatrixFromRows=(0,n.factory)(i,s,(e=>{let{typed:t,matrix:r,flatten:n,size:s}=e;return t(i,{"...Array":function(e){return o(e)},"...Matrix":function(e){return r(o(e.map((e=>e.toArray()))))}});function o(e){if(0===e.length)throw new TypeError("At least one row is needed to construct a matrix.");const t=a(e[0]),r=[];for(const i of e){const e=a(i);if(e!==t)throw new TypeError("The vectors had different length: "+(0|t)+" ≠ "+(0|e));r.push(n(i))}return r}function a(e){const t=s(e);if(1===t.length)return t[0];if(2===t.length){if(1===t[0])return t[1];if(1===t[1])return t[0];throw new TypeError("At least one of the arguments is not a vector.")}throw new TypeError("Only one- or two-dimensional vectors are supported.")}}))},89990:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createOnes=void 0;var n=r(91612),i=r(34749),s=r(34487),o=r(66212);const a=["typed","config","matrix","BigNumber"];t.createOnes=(0,o.factory)("ones",a,(e=>{let{typed:t,config:r,matrix:o,BigNumber:a}=e;return t("ones",{"":function(){return"Array"===r.matrix?l([]):l([],"default")},"...number | BigNumber | string":function(e){if("string"==typeof e[e.length-1]){const t=e.pop();return l(e,t)}return"Array"===r.matrix?l(e):l(e,"default")},Array:l,Matrix:function(e){const t=e.storage();return l(e.valueOf(),t)},"Array | Matrix, string":function(e,t){return l(e.valueOf(),t)}});function l(e,t){const r=function(e){let t=!1;return e.forEach((function(e,r,i){(0,n.isBigNumber)(e)&&(t=!0,i[r]=e.toNumber())})),t}(e),l=r?new a(1):1;if(function(e){e.forEach((function(e){if("number"!=typeof e||!(0,i.isInteger)(e)||e<0)throw new Error("Parameters in function ones must be positive integers")}))}(e),t){const r=o(t);return e.length>0?r.resize(e,l):r}{const t=[];return e.length>0?(0,s.resize)(t,e,l):t}}}))},84009:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createPartitionSelect=void 0;var n=r(91612),i=r(34749),s=r(66212);const o="partitionSelect",a=["typed","isNumeric","isNaN","compare"];t.createPartitionSelect=(0,s.factory)(o,a,(e=>{let{typed:t,isNumeric:r,isNaN:s,compare:a}=e;const l=a,c=(e,t)=>-a(e,t);return t(o,{"Array | Matrix, number":function(e,t){return u(e,t,l)},"Array | Matrix, number, string":function(e,t,r){if("asc"===r)return u(e,t,l);if("desc"===r)return u(e,t,c);throw new Error('Compare string must be "asc" or "desc"')},"Array | Matrix, number, function":u});function u(e,t,r){if(!(0,i.isInteger)(t)||t<0)throw new Error("k must be a non-negative integer");if((0,n.isMatrix)(e)){if(e.size().length>1)throw new Error("Only one dimensional matrices supported");return d(e.valueOf(),t,r)}if(Array.isArray(e))return d(e,t,r)}function d(e,t,n){if(t>=e.length)throw new Error("k out of bounds");for(let t=0;t<e.length;t++)if(r(e[t])&&s(e[t]))return e[t];let i=0,o=e.length-1;for(;i<o;){let r=i,s=o;const a=e[Math.floor(Math.random()*(o-i+1))+i];for(;r<s;)if(n(e[r],a)>=0){const t=e[s];e[s]=e[r],e[r]=t,--s}else++r;n(e[r],a)>0&&--r,t<=r?o=r:i=r+1}return e[t]}}))},83704:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createPinv=void 0;var n=r(91612),i=r(34487),s=r(66212),o=r(7041),a=r(61175);const l="pinv",c=["typed","matrix","inv","deepEqual","equal","dotDivide","dot","ctranspose","divideScalar","multiply","add","Complex"];t.createPinv=(0,s.factory)(l,c,(e=>{let{typed:t,matrix:r,inv:s,deepEqual:c,equal:u,dotDivide:d,dot:h,ctranspose:p,divideScalar:m,multiply:f,add:g,Complex:y}=e;return t(l,{"Array | Matrix":function(e){const t=(0,n.isMatrix)(e)?e.size():(0,i.arraySize)(e);switch(t.length){case 1:return _(e)?p(e):1===t[0]?s(e):d(p(e),h(e,e));case 2:{if(_(e))return p(e);const i=t[0],o=t[1];if(i===o)try{return s(e)}catch(e){if(!(e instanceof Error&&e.message.match(/Cannot calculate inverse, determinant is zero/)))throw e}return(0,n.isMatrix)(e)?r(b(e.valueOf(),i,o),e.storage()):b(e,i,o)}default:throw new RangeError("Matrix must be two dimensional (size: "+(0,o.format)(t)+")")}},any:function(e){return u(e,0)?(0,a.clone)(e):m(1,e)}});function b(e,t,r){const{C:n,F:i}=function(e,t,r){const n=function(e,t,r){const n=(0,a.clone)(e);let i=0;for(let e=0;e<t;e++){if(r<=i)return n;let s=e;for(;v(n[s][i]);)if(s++,t===s&&(s=e,i++,r===i))return n;[n[s],n[e]]=[n[e],n[s]];let o=n[e][i];for(let t=0;t<r;t++)n[e][t]=d(n[e][t],o);for(let s=0;s<t;s++)if(s!==e){o=n[s][i];for(let t=0;t<r;t++)n[s][t]=g(n[s][t],f(-1,f(o,n[e][t])))}i++}return n}(e,t,r),i=e.map(((e,r)=>e.filter(((e,r)=>r<t&&!v(h(n[r],n[r])))))),s=n.filter(((e,t)=>!v(h(n[t],n[t]))));return{C:i,F:s}}(e,t,r),o=f(s(f(p(n),n)),p(n)),l=f(p(i),s(f(i,p(i))));return f(l,o)}function v(e){return u(g(e,y(1,1)),g(0,y(1,1)))}function _(e){return c(g(e,y(1,1)),g(f(e,0),y(1,1)))}}))},36542:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRange=void 0;var n=r(66212),i=r(10604);const s="range",o=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"];t.createRange=(0,n.factory)(s,o,(e=>{let{typed:t,config:r,matrix:n,bignumber:o,smaller:a,smallerEq:l,larger:c,largerEq:u,add:d,isPositive:h}=e;return t(s,{string:m,"string, boolean":m,"number, number":function(e,t){return p(f(e,t,1,!1))},"number, number, number":function(e,t,r){return p(f(e,t,r,!1))},"number, number, boolean":function(e,t,r){return p(f(e,t,1,r))},"number, number, number, boolean":function(e,t,r,n){return p(f(e,t,r,n))},"BigNumber, BigNumber":function(e,t){return p(f(e,t,new(0,e.constructor)(1),!1))},"BigNumber, BigNumber, BigNumber":function(e,t,r){return p(f(e,t,r,!1))},"BigNumber, BigNumber, boolean":function(e,t,r){return p(f(e,t,new(0,e.constructor)(1),r))},"BigNumber, BigNumber, BigNumber, boolean":function(e,t,r,n){return p(f(e,t,r,n))},"Unit, Unit, Unit":function(e,t,r){return p(f(e,t,r,!1))},"Unit, Unit, Unit, boolean":function(e,t,r,n){return p(f(e,t,r,n))}});function p(e){return"Matrix"===r.matrix?n?n(e):(0,i.noMatrix)():e}function m(e,t){const n=function(e){const t=e.split(":"),r=t.map((function(e){return Number(e)}));if(r.some((function(e){return isNaN(e)})))return null;switch(r.length){case 2:return{start:r[0],end:r[1],step:1};case 3:return{start:r[0],end:r[2],step:r[1]};default:return null}}(e);if(!n)throw new SyntaxError('String "'+e+'" is no valid range');return"BigNumber"===r.number?(void 0===o&&(0,i.noBignumber)(),p(f(o(n.start),o(n.end),o(n.step)))):p(f(n.start,n.end,n.step,t))}function f(e,t,r,n){const i=[],s=h(r)?n?l:a:n?u:c;let o=e;for(;s(o,t);)i.push(o),o=d(o,r);return i}}))},1005:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createReshape=void 0;var n=r(34487),i=r(66212);const s="reshape",o=["typed","isInteger","matrix"];t.createReshape=(0,i.factory)(s,o,(e=>{let{typed:t,isInteger:r}=e;return t(s,{"Matrix, Array":function(e,t){return e.reshape(t,!0)},"Array, Array":function(e,t){return t.forEach((function(e){if(!r(e))throw new TypeError("Invalid size for dimension: "+e)})),(0,n.reshape)(e,t)}})}))},20319:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createResize=void 0;var n=r(91612),i=r(6523),s=r(11563),o=r(34749),a=r(7041),l=r(61175),c=r(34487),u=r(66212);const d=["config","matrix"];t.createResize=(0,u.factory)("resize",d,(e=>{let{config:t,matrix:r}=e;return function(e,u,d){if(2!==arguments.length&&3!==arguments.length)throw new s.ArgumentsError("resize",arguments.length,2,3);if((0,n.isMatrix)(u)&&(u=u.valueOf()),(0,n.isBigNumber)(u[0])&&(u=u.map((function(e){return(0,n.isBigNumber)(e)?e.toNumber():e}))),(0,n.isMatrix)(e))return e.resize(u,d,!0);if("string"==typeof e)return function(e,t,r){if(void 0!==r){if("string"!=typeof r||1!==r.length)throw new TypeError("Single character expected as defaultValue")}else r=" ";if(1!==t.length)throw new i.DimensionError(t.length,1);const n=t[0];if("number"!=typeof n||!(0,o.isInteger)(n))throw new TypeError("Invalid size, must contain positive integers (size: "+(0,a.format)(t)+")");if(e.length>n)return e.substring(0,n);if(e.length<n){let t=e;for(let i=0,s=n-e.length;i<s;i++)t+=r;return t}return e}(e,u,d);const h=!Array.isArray(e)&&"Array"!==t.matrix;if(0===u.length){for(;Array.isArray(e);)e=e[0];return(0,l.clone)(e)}{Array.isArray(e)||(e=[e]),e=(0,l.clone)(e);const t=(0,c.resize)(e,u,d);return h?r(t):t}}}))},92756:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRotate=void 0;var n=r(66212),i=r(34487);const s="rotate",o=["typed","multiply","rotationMatrix"];t.createRotate=(0,n.factory)(s,o,(e=>{let{typed:t,multiply:r,rotationMatrix:n}=e;return t(s,{"Array , number | BigNumber | Complex | Unit":function(e,t){o(e,2);return r(n(t),e).toArray()},"Matrix , number | BigNumber | Complex | Unit":function(e,t){return o(e,2),r(n(t),e)},"Array, number | BigNumber | Complex | Unit, Array | Matrix":function(e,t,i){o(e,3);return r(n(t,i),e)},"Matrix, number | BigNumber | Complex | Unit, Array | Matrix":function(e,t,i){return o(e,3),r(n(t,i),e)}});function o(e,t){const r=Array.isArray(e)?(0,i.arraySize)(e):e.size();if(r.length>2)throw new RangeError(`Vector must be of dimensions 1x${t}`);if(2===r.length&&1!==r[1])throw new RangeError(`Vector must be of dimensions 1x${t}`);if(r[0]!==t)throw new RangeError(`Vector must be of dimensions 1x${t}`)}}))},3016:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRotationMatrix=void 0;var n=r(91612),i=r(66212);const s="rotationMatrix",o=["typed","config","multiplyScalar","addScalar","unaryMinus","norm","matrix","BigNumber","DenseMatrix","SparseMatrix","cos","sin"];t.createRotationMatrix=(0,i.factory)(s,o,(e=>{let{typed:t,config:r,multiplyScalar:i,addScalar:o,unaryMinus:a,norm:l,BigNumber:c,matrix:u,DenseMatrix:d,SparseMatrix:h,cos:p,sin:m}=e;return t(s,{"":function(){return"Matrix"===r.matrix?u([]):[]},string:function(e){return u(e)},"number | BigNumber | Complex | Unit":function(e){return f(e,"Matrix"===r.matrix?"dense":void 0)},"number | BigNumber | Complex | Unit, string":function(e,t){return f(e,t)},"number | BigNumber | Complex | Unit, Array":function(e,t){const r=u(t);return g(r),v(e,r,void 0)},"number | BigNumber | Complex | Unit, Matrix":function(e,t){g(t);const n=t.storage()||("Matrix"===r.matrix?"dense":void 0);return v(e,t,n)},"number | BigNumber | Complex | Unit, Array, string":function(e,t,r){const n=u(t);return g(n),v(e,n,r)},"number | BigNumber | Complex | Unit, Matrix, string":function(e,t,r){return g(t),v(e,t,r)}});function f(e,t){const r=(0,n.isBigNumber)(e)?new c(-1):-1,s=p(e),o=m(e);return b([[s,i(r,o)],[o,s]],t)}function g(e){const t=e.size();if(t.length<1||3!==t[0])throw new RangeError("Vector must be of dimensions 1x3")}function y(e){return e.reduce(((e,t)=>i(e,t)))}function b(e,t){if(t){if("sparse"===t)return new h(e);if("dense"===t)return new d(e);throw new TypeError(`Unknown matrix type "${t}"`)}return e}function v(e,t,r){const i=l(t);if(0===i)throw new RangeError("Rotation around zero vector");const s=(0,n.isBigNumber)(e)?c:null,u=s?new s(1):1,d=s?new s(-1):-1,h=s?new s(t.get([0])/i):t.get([0])/i,f=s?new s(t.get([1])/i):t.get([1])/i,g=s?new s(t.get([2])/i):t.get([2])/i,v=p(e),_=o(u,a(v)),x=m(e);return b([[o(v,y([h,h,_])),o(y([h,f,_]),y([d,g,x])),o(y([h,g,_]),y([f,x]))],[o(y([h,f,_]),y([g,x])),o(v,y([f,f,_])),o(y([f,g,_]),y([d,h,x]))],[o(y([h,g,_]),y([d,f,x])),o(y([f,g,_]),y([h,x])),o(v,y([g,g,_]))]],r)}}))},45515:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRow=void 0;var n=r(66212),i=r(91612),s=r(61175),o=r(34487);const a=["typed","Index","matrix","range"];t.createRow=(0,n.factory)("row",a,(e=>{let{typed:t,Index:r,matrix:n,range:a}=e;return t("row",{"Matrix, number":l,"Array, number":function(e,t){return l(n((0,s.clone)(e)),t).valueOf()}});function l(e,t){if(2!==e.size().length)throw new Error("Only two dimensional matrix is supported");(0,o.validateIndex)(t,e.size()[0]);const s=a(0,e.size()[1]),l=new r(t,s),c=e.subset(l);return(0,i.isMatrix)(c)?c:n([[c]])}}))},19034:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSize=void 0;var n=r(34487),i=r(66212),s=r(10604);const o="size",a=["typed","config","?matrix"];t.createSize=(0,i.factory)(o,a,(e=>{let{typed:t,config:r,matrix:i}=e;return t(o,{Matrix:function(e){return e.create(e.size(),"number")},Array:n.arraySize,string:function(e){return"Array"===r.matrix?[e.length]:i([e.length],"dense","number")},"number | Complex | BigNumber | Unit | boolean | null":function(e){return"Array"===r.matrix?[]:i?i([],"dense","number"):(0,s.noMatrix)()}})}))},81163:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSort=void 0;var n=r(34487),i=r(66212);const s="sort",o=["typed","matrix","compare","compareNatural"];t.createSort=(0,i.factory)(s,o,(e=>{let{typed:t,matrix:r,compare:i,compareNatural:o}=e;const a=i,l=(e,t)=>-i(e,t);return t(s,{Array:function(e){return u(e),e.sort(a)},Matrix:function(e){return d(e),r(e.toArray().sort(a),e.storage())},"Array, function":function(e,t){return u(e),e.sort(t)},"Matrix, function":function(e,t){return d(e),r(e.toArray().sort(t),e.storage())},"Array, string":function(e,t){return u(e),e.sort(c(t))},"Matrix, string":function(e,t){return d(e),r(e.toArray().sort(c(t)),e.storage())}});function c(e){if("asc"===e)return a;if("desc"===e)return l;if("natural"===e)return o;throw new Error('String "asc", "desc", or "natural" expected')}function u(e){if(1!==(0,n.arraySize)(e).length)throw new Error("One dimensional array expected")}function d(e){if(1!==e.size().length)throw new Error("One dimensional matrix expected")}}))},23458:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSqrtm=void 0;var n=r(91612),i=r(7041),s=r(34487),o=r(66212);const a="sqrtm",l=["typed","abs","add","multiply","map","sqrt","subtract","inv","size","max","identity"];t.createSqrtm=(0,o.factory)(a,l,(e=>{let{typed:t,abs:r,add:o,multiply:l,map:c,sqrt:u,subtract:d,inv:h,size:p,max:m,identity:f}=e;const g=1e-6;return t(a,{"Array | Matrix":function(e){const t=(0,n.isMatrix)(e)?e.size():(0,s.arraySize)(e);switch(t.length){case 1:if(1===t[0])return c(e,u);throw new RangeError("Matrix must be square (size: "+(0,i.format)(t)+")");case 2:if(t[0]===t[1])return function(e){let t,n=0,i=e,s=f(p(e));do{const e=i;if(i=l(.5,o(e,h(s))),s=l(.5,o(s,h(e))),t=m(r(d(i,e))),t>g&&++n>1e3)throw new Error("computing square root of matrix: iterative method could not converge")}while(t>g);return i}(e);throw new RangeError("Matrix must be square (size: "+(0,i.format)(t)+")");default:throw new RangeError("Matrix must be at most two dimensional (size: "+(0,i.format)(t)+")")}}})}))},88315:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSqueeze=void 0;var n=r(61175),i=r(34487),s=r(66212);const o="squeeze",a=["typed"];t.createSqueeze=(0,s.factory)(o,a,(e=>{let{typed:t}=e;return t(o,{Array:function(e){return(0,i.squeeze)((0,n.clone)(e))},Matrix:function(e){const t=(0,i.squeeze)(e.toArray());return Array.isArray(t)?e.create(t,e.datatype()):t},any:function(e){return(0,n.clone)(e)}})}))},68933:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSubset=void 0;var n=r(91612),i=r(61175),s=r(34487),o=r(98770),a=r(6523),l=r(66212);const c="subset",u=["typed","matrix","zeros","add"];t.createSubset=(0,l.factory)(c,u,(e=>{let{typed:t,matrix:r,zeros:n,add:i}=e;return t(c,{"Matrix, Index":function(e,t){return(0,s.isEmptyIndex)(t)?r():((0,s.validateIndexSourceSize)(e,t),e.subset(t))},"Array, Index":t.referTo("Matrix, Index",(function(e){return function(t,n){const i=e(r(t),n);return n.isScalar()?i:i.valueOf()}})),"Object, Index":p,"string, Index":d,"Matrix, Index, any, any":function(e,t,r,o){return(0,s.isEmptyIndex)(t)?e:((0,s.validateIndexSourceSize)(e,t),e.clone().subset(t,function(e,t){if("string"==typeof e)throw new Error("can't boradcast a string");if(t._isScalar)return e;const r=t.size();if(!r.every((e=>e>0)))return e;try{return i(e,n(r))}catch(t){return e}}(r,t),o))},"Array, Index, any, any":t.referTo("Matrix, Index, any, any",(function(e){return function(t,n,i,s){const o=e(r(t),n,i,s);return o.isMatrix?o.valueOf():o}})),"Array, Index, any":t.referTo("Matrix, Index, any, any",(function(e){return function(t,n,i){return e(r(t),n,i,void 0).valueOf()}})),"Matrix, Index, any":t.referTo("Matrix, Index, any, any",(function(e){return function(t,r,n){return e(t,r,n,void 0)}})),"string, Index, string":h,"string, Index, string, string":h,"Object, Index, any":m})}));function d(e,t){if(!(0,n.isIndex)(t))throw new TypeError("Index expected");if((0,s.isEmptyIndex)(t))return"";if((0,s.validateIndexSourceSize)(Array.from(e),t),1!==t.size().length)throw new a.DimensionError(t.size().length,1);const r=e.length;(0,s.validateIndex)(t.min()[0],r),(0,s.validateIndex)(t.max()[0],r);const i=t.dimension(0);let o="";return i.forEach((function(t){o+=e.charAt(t)})),o}function h(e,t,r,n){if(!t||!0!==t.isIndex)throw new TypeError("Index expected");if((0,s.isEmptyIndex)(t))return e;if((0,s.validateIndexSourceSize)(Array.from(e),t),1!==t.size().length)throw new a.DimensionError(t.size().length,1);if(void 0!==n){if("string"!=typeof n||1!==n.length)throw new TypeError("Single character expected as defaultValue")}else n=" ";const i=t.dimension(0);if(i.size()[0]!==r.length)throw new a.DimensionError(i.size()[0],r.length);const o=e.length;(0,s.validateIndex)(t.min()[0]),(0,s.validateIndex)(t.max()[0]);const l=[];for(let t=0;t<o;t++)l[t]=e.charAt(t);if(i.forEach((function(e,t){l[e]=r.charAt(t[0])})),l.length>o)for(let e=o-1,t=l.length;e<t;e++)l[e]||(l[e]=n);return l.join("")}function p(e,t){if((0,s.isEmptyIndex)(t))return;if(1!==t.size().length)throw new a.DimensionError(t.size(),1);const r=t.dimension(0);if("string"!=typeof r)throw new TypeError("String expected as index to retrieve an object property");return(0,o.getSafeProperty)(e,r)}function m(e,t,r){if((0,s.isEmptyIndex)(t))return e;if(1!==t.size().length)throw new a.DimensionError(t.size(),1);const n=t.dimension(0);if("string"!=typeof n)throw new TypeError("String expected as index to retrieve an object property");const l=(0,i.clone)(e);return(0,o.setSafeProperty)(l,n,r),l}},74194:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createTrace=void 0;var n=r(61175),i=r(7041),s=r(66212);const o=["typed","matrix","add"];t.createTrace=(0,s.factory)("trace",o,(e=>{let{typed:t,matrix:r,add:s}=e;return t("trace",{Array:function(e){return o(r(e))},SparseMatrix:function(e){const t=e._values,r=e._index,n=e._ptr,o=e._size,a=o[0],l=o[1];if(a===l){let e=0;if(t.length>0)for(let i=0;i<l;i++){const o=n[i],a=n[i+1];for(let n=o;n<a;n++){const o=r[n];if(o===i){e=s(e,t[n]);break}if(o>i)break}}return e}throw new RangeError("Matrix must be square (size: "+(0,i.format)(o)+")")},DenseMatrix:o,any:n.clone});function o(e){const t=e._size,r=e._data;switch(t.length){case 1:if(1===t[0])return(0,n.clone)(r[0]);throw new RangeError("Matrix must be square (size: "+(0,i.format)(t)+")");case 2:{const e=t[0];if(e===t[1]){let t=0;for(let n=0;n<e;n++)t=s(t,r[n][n]);return t}throw new RangeError("Matrix must be square (size: "+(0,i.format)(t)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+(0,i.format)(t)+")")}}}))},46236:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createTranspose=void 0;var n=r(61175),i=r(7041),s=r(66212);const o="transpose",a=["typed","matrix"];t.createTranspose=(0,s.factory)(o,a,(e=>{let{typed:t,matrix:r}=e;return t(o,{Array:e=>s(r(e)).valueOf(),Matrix:s,any:n.clone});function s(e){const t=e.size();let r;switch(t.length){case 1:r=e.clone();break;case 2:{const s=t[0],o=t[1];if(0===o)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+(0,i.format)(t)+")");switch(e.storage()){case"dense":r=function(e,t,r){const i=e._data,s=[];let o;for(let e=0;e<r;e++){o=s[e]=[];for(let r=0;r<t;r++)o[r]=(0,n.clone)(i[r][e])}return e.createDenseMatrix({data:s,size:[r,t],datatype:e._datatype})}(e,s,o);break;case"sparse":r=function(e,t,r){const i=e._values,s=e._index,o=e._ptr,a=i?[]:void 0,l=[],c=[],u=[];for(let e=0;e<t;e++)u[e]=0;let d,h,p;for(d=0,h=s.length;d<h;d++)u[s[d]]++;let m=0;for(let e=0;e<t;e++)c.push(m),m+=u[e],u[e]=c[e];for(c.push(m),p=0;p<r;p++)for(let e=o[p],t=o[p+1],r=e;r<t;r++){const e=u[s[r]]++;l[e]=p,i&&(a[e]=(0,n.clone)(i[r]))}return e.createSparseMatrix({values:a,index:l,ptr:c,size:[r,t],datatype:e._datatype})}(e,s,o)}}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+(0,i.format)(t)+")")}return r}}))},77864:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createZeros=void 0;var n=r(91612),i=r(34749),s=r(34487),o=r(66212);const a="zeros",l=["typed","config","matrix","BigNumber"];t.createZeros=(0,o.factory)(a,l,(e=>{let{typed:t,config:r,matrix:o,BigNumber:l}=e;return t(a,{"":function(){return"Array"===r.matrix?c([]):c([],"default")},"...number | BigNumber | string":function(e){if("string"==typeof e[e.length-1]){const t=e.pop();return c(e,t)}return"Array"===r.matrix?c(e):c(e,"default")},Array:c,Matrix:function(e){const t=e.storage();return c(e.valueOf(),t)},"Array | Matrix, string":function(e,t){return c(e.valueOf(),t)}});function c(e,t){const r=function(e){let t=!1;return e.forEach((function(e,r,i){(0,n.isBigNumber)(e)&&(t=!0,i[r]=e.toNumber())})),t}(e),a=r?new l(0):0;if(function(e){e.forEach((function(e){if("number"!=typeof e||!(0,i.isInteger)(e)||e<0)throw new Error("Parameters in function zeros must be positive integers")}))}(e),t){const r=o(t);return e.length>0?r.resize(e,a):r}{const t=[];return e.length>0?(0,s.resize)(t,e,a):t}}}))},25198:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSolveODE=void 0;var n=r(91612),i=r(66212);const s=["typed","add","subtract","multiply","divide","max","map","abs","isPositive","isNegative","larger","smaller","matrix","bignumber","unaryMinus"];t.createSolveODE=(0,i.factory)("solveODE",s,(e=>{let{typed:t,add:r,subtract:i,multiply:s,divide:o,max:a,map:l,abs:c,isPositive:u,isNegative:d,larger:h,smaller:p,matrix:m,bignumber:f,unaryMinus:g}=e;function y(e){return function(t,m,y,b){if(!(2===m.length&&(m.every(x)||m.every(n.isUnit))))throw new Error('"tspan" must be an Array of two numeric values or two units [tStart, tEnd]');const v=m[0],_=m[1],w=h(_,v),R=b.firstStep;if(void 0!==R&&!u(R))throw new Error('"firstStep" must be positive');const k=b.maxStep;if(void 0!==k&&!u(k))throw new Error('"maxStep" must be positive');const j=b.minStep;if(j&&d(j))throw new Error('"minStep" must be positive or zero');const z=[v,_,R,j,k].filter((e=>void 0!==e));if(!z.every(x)&&!z.every(n.isUnit))throw new Error('Inconsistent type of "t" dependant variables');const q=b.tol?b.tol:1e-4,$=b.minDelta?b.minDelta:.2,Z=b.maxDelta?b.maxDelta:5,X=b.maxIter?b.maxIter:1e4,Y=[v,_,...y,k,j].some(n.isBigNumber),[ee,te,re,ne]=Y?[f(e.a),f(e.c),f(e.b),f(e.bp)]:[e.a,e.c,e.b,e.bp];let ie=R?w?R:g(R):o(i(_,v),1);const se=[v],oe=[y],ae=i(re,ne);let le=0,ce=0;const ue=function(e){return e?p:h}(w),de=function(e){const t=e?h:p;return function(e,n,s){const o=r(e,s);return t(o,n)?i(n,e):s}}(w);for(;ue(se[le],_);){const e=[];ie=de(se[le],_,ie),e.push(t(se[le],oe[le]));for(let n=1;n<te.length;++n)e.push(t(r(se[le],s(te[n],ie)),r(oe[le],s(ie,ee[n],e))));const i=a(c(l(s(ae,e),(e=>(0,n.isUnit)(e)?e.value:e))));i<q&&q/i>1/4&&(se.push(r(se[le],ie)),oe.push(r(oe[le],s(ie,re,e))),le++);let o=.84*(q/i)**.2;if(p(o,$)?o=$:h(o,Z)&&(o=Z),o=Y?f(o):o,ie=s(ie,o),k&&h(c(ie),k)?ie=w?k:g(k):j&&p(c(ie),j)&&(ie=w?j:g(j)),ce++,ce>X)throw new Error("Maximum number of iterations reached, try changing options")}return{t:se,y:oe}}}function b(e,t,r,n){return y({a:[[],[.5],[0,3/4],[2/9,1/3,4/9]],c:[null,.5,3/4,1],b:[2/9,1/3,4/9,0],bp:[7/24,1/4,1/3,1/8]})(e,t,r,n)}function v(e,t,r,n){return y({a:[[],[.2],[3/40,9/40],[44/45,-56/15,32/9],[19372/6561,-25360/2187,64448/6561,-212/729],[9017/3168,-355/33,46732/5247,49/176,-5103/18656],[35/384,0,500/1113,125/192,-2187/6784,11/84]],c:[null,.2,.3,.8,8/9,1,1],b:[35/384,0,500/1113,125/192,-2187/6784,11/84,0],bp:[5179/57600,0,7571/16695,393/640,-92097/339200,187/2100,1/40]})(e,t,r,n)}function _(e,t,r,n){const i=n.method?n.method:"RK45",s={RK23:b,RK45:v};if(i.toUpperCase()in s){const o={...n};return delete o.method,s[i.toUpperCase()](e,t,r,o)}{const e=Object.keys(s).map((e=>`"${e}"`)),t=`${e.slice(0,-1).join(", ")} and ${e.slice(-1)}`;throw new Error(`Unavailable method "${i}". Available methods are ${t}`)}}function x(e){return(0,n.isBigNumber)(e)||(0,n.isNumber)(e)}function w(e,t,r,n){const i=_(e,t.toArray(),r.toArray(),n);return{t:m(i.t),y:m(i.y)}}return t("solveODE",{"function, Array, Array, Object":_,"function, Matrix, Matrix, Object":w,"function, Array, Array":(e,t,r)=>_(e,t,r,{}),"function, Matrix, Matrix":(e,t,r)=>w(e,t,r,{}),"function, Array, number | BigNumber | Unit":(e,t,r)=>{const n=_(e,t,[r],{});return{t:n.t,y:n.y.map((e=>e[0]))}},"function, Matrix, number | BigNumber | Unit":(e,t,r)=>{const n=_(e,t.toArray(),[r],{});return{t:m(n.t),y:m(n.y.map((e=>e[0])))}},"function, Array, number | BigNumber | Unit, Object":(e,t,r,n)=>{const i=_(e,t,[r],n);return{t:i.t,y:i.y.map((e=>e[0]))}},"function, Matrix, number | BigNumber | Unit, Object":(e,t,r,n)=>{const i=_(e,t.toArray(),[r],n);return{t:m(i.t),y:m(i.y.map((e=>e[0])))}}})}))},46705:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCombinations=void 0;var n=r(66212),i=r(69717);const s="combinations",o=["typed"];t.createCombinations=(0,n.factory)(s,o,(e=>{let{typed:t}=e;return t(s,{"number, number":i.combinationsNumber,"BigNumber, BigNumber":function(e,t){const r=e.constructor;let n,i;const s=e.minus(t),o=new r(1);if(!a(e)||!a(t))throw new TypeError("Positive integer value expected in function combinations");if(t.gt(e))throw new TypeError("k must be less than n in function combinations");if(n=o,t.lt(s))for(i=o;i.lte(s);i=i.plus(o))n=n.times(t.plus(i)).dividedBy(i);else for(i=o;i.lte(t);i=i.plus(o))n=n.times(s.plus(i)).dividedBy(i);return n}})}));function a(e){return e.isInteger()&&e.gte(0)}},60238:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCombinationsWithRep=void 0;var n=r(66212),i=r(34749),s=r(98189);const o="combinationsWithRep",a=["typed"];t.createCombinationsWithRep=(0,n.factory)(o,a,(e=>{let{typed:t}=e;return t(o,{"number, number":function(e,t){if(!(0,i.isInteger)(e)||e<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(!(0,i.isInteger)(t)||t<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(e<1)throw new TypeError("k must be less than or equal to n + k - 1");if(t<e-1){return(0,s.product)(e,e+t-1)/(0,s.product)(1,t)}return(0,s.product)(t+1,e+t-1)/(0,s.product)(1,e-1)},"BigNumber, BigNumber":function(e,t){let r,n;const i=new(0,e.constructor)(1),s=e.minus(i);if(!l(e)||!l(t))throw new TypeError("Positive integer value expected in function combinationsWithRep");if(e.lt(i))throw new TypeError("k must be less than or equal to n + k - 1 in function combinationsWithRep");if(r=i,t.lt(s))for(n=i;n.lte(s);n=n.plus(i))r=r.times(t.plus(n)).dividedBy(n);else for(n=i;n.lte(t);n=n.plus(i))r=r.times(s.plus(n)).dividedBy(n);return r}})}));function l(e){return e.isInteger()&&e.gte(0)}},75486:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createFactorial=void 0;var n=r(16624),i=r(66212);const s="factorial",o=["typed","gamma"];t.createFactorial=(0,i.factory)(s,o,(e=>{let{typed:t,gamma:r}=e;return t(s,{number:function(e){if(e<0)throw new Error("Value must be non-negative");return r(e+1)},BigNumber:function(e){if(e.isNegative())throw new Error("Value must be non-negative");return r(e.plus(1))},"Array | Matrix":t.referToSelf((e=>t=>(0,n.deepMap)(t,e)))})}))},37948:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createGamma=void 0;var n=r(66212),i=r(30369);const s="gamma",o=["typed","config","multiplyScalar","pow","BigNumber","Complex"];t.createGamma=(0,n.factory)(s,o,(e=>{let{typed:t,config:r,multiplyScalar:n,pow:o,BigNumber:a,Complex:l}=e;return t(s,{number:i.gammaNumber,Complex:function e(t){if(0===t.im)return(0,i.gammaNumber)(t.re);if(t.re<.5){const r=new l(1-t.re,-t.im),n=new l(Math.PI*t.re,Math.PI*t.im);return new l(Math.PI).div(n.sin()).div(e(r))}t=new l(t.re-1,t.im);let r=new l(i.gammaP[0],0);for(let e=1;e<i.gammaP.length;++e){const n=new l(i.gammaP[e],0);r=r.add(n.div(t.add(e)))}const n=new l(t.re+i.gammaG+.5,t.im),s=Math.sqrt(2*Math.PI),o=n.pow(t.add(.5)),a=n.neg().exp();return r.mul(s).mul(o).mul(a)},BigNumber:function(e){if(e.isInteger())return e.isNegative()||e.isZero()?new a(1/0):c(e.minus(1));if(!e.isFinite())return new a(e.isNegative()?NaN:1/0);throw new Error("Integer BigNumber expected")}});function c(e){if(e<8)return new a([1,1,2,6,24,120,720,5040][e]);const t=r.precision+(0|Math.log(e.toNumber())),n=a.clone({precision:t});if(e%2==1)return e.times(c(new a(e-1)));let i=e,s=new n(e),o=e.toNumber();for(;i>2;)i-=2,o+=i,s=s.times(o);return new a(s.toPrecision(a.precision))}}))},85200:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createKldivergence=void 0;var n=r(66212);const i="kldivergence",s=["typed","matrix","divide","sum","multiply","map","dotDivide","log","isNumeric"];t.createKldivergence=(0,n.factory)(i,s,(e=>{let{typed:t,matrix:r,divide:n,sum:s,multiply:o,map:a,dotDivide:l,log:c,isNumeric:u}=e;return t(i,{"Array, Array":function(e,t){return d(r(e),r(t))},"Matrix, Array":function(e,t){return d(e,r(t))},"Array, Matrix":function(e,t){return d(r(e),t)},"Matrix, Matrix":function(e,t){return d(e,t)}});function d(e,t){const r=t.size().length,i=e.size().length;if(r>1)throw new Error("first object must be one dimensional");if(i>1)throw new Error("second object must be one dimensional");if(r!==i)throw new Error("Length of two vectors must be equal");if(0===s(e))throw new Error("Sum of elements in first object must be non zero");if(0===s(t))throw new Error("Sum of elements in second object must be non zero");const d=n(e,s(e)),h=n(t,s(t)),p=s(o(d,a(l(d,h),(e=>c(e)))));return u(p)?p:Number.NaN}}))},82900:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLgamma=void 0;var n=r(30369),i=r(66212),s=r(34749);const o="lgamma",a=["Complex","typed"];t.createLgamma=(0,i.factory)(o,a,(e=>{let{Complex:t,typed:r}=e;const i=7,a=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return r(o,{number:n.lgammaNumber,Complex:function e(r){if(r.isNaN())return new t(NaN,NaN);if(0===r.im)return new t((0,n.lgammaNumber)(r.re),0);if(r.re>=i||Math.abs(r.im)>=7)return l(r);if(r.re<=.1){const n=(0,s.copysign)(6.283185307179586,r.im)*Math.floor(.5*r.re+.25),i=r.mul(Math.PI).sin().log(),o=e(new t(1-r.re,-r.im));return new t(1.1447298858494002,n).sub(i).sub(o)}return r.im>=0?c(r):c(r.conjugate()).conjugate()},BigNumber:function(){throw new Error("mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber")}});function l(e){const r=e.sub(.5).mul(e.log()).sub(e).add(n.lnSqrt2PI),i=new t(1,0).div(e),s=i.div(e);let o=a[0],l=a[1];const c=2*s.re,u=s.re*s.re+s.im*s.im;for(let e=2;e<8;e++){const t=l;l=-u*o+a[e],o=c*o+t}const d=i.mul(s.mul(o).add(l));return r.add(d)}function c(e){let r=0,n=0,s=e;for(e=e.add(1);e.re<=i;){s=s.mul(e);const t=s.im<0?1:0;0!==t&&0===n&&r++,n=t,e=e.add(1)}return l(e).sub(s.log()).sub(new t(0,2*r*Math.PI*1))}}))},90248:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMultinomial=void 0;var n=r(16624),i=r(66212);const s="multinomial",o=["typed","add","divide","multiply","factorial","isInteger","isPositive"];t.createMultinomial=(0,i.factory)(s,o,(e=>{let{typed:t,add:r,divide:i,multiply:o,factorial:a,isInteger:l,isPositive:c}=e;return t(s,{"Array | Matrix":function(e){let t=0,s=1;return(0,n.deepForEach)(e,(function(e){if(!l(e)||!c(e))throw new TypeError("Positive integer value expected in function multinomial");t=r(t,e),s=o(s,a(e))})),i(a(t),s)}})}))},97520:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createPermutations=void 0;var n=r(34749),i=r(98189),s=r(66212);const o="permutations",a=["typed","factorial"];t.createPermutations=(0,s.factory)(o,a,(e=>{let{typed:t,factorial:r}=e;return t(o,{"number | BigNumber":r,"number, number":function(e,t){if(!(0,n.isInteger)(e)||e<0)throw new TypeError("Positive integer value expected in function permutations");if(!(0,n.isInteger)(t)||t<0)throw new TypeError("Positive integer value expected in function permutations");if(t>e)throw new TypeError("second argument k must be less than or equal to first argument n");return(0,i.product)(e-t+1,e)},"BigNumber, BigNumber":function(e,t){let r,n;if(!l(e)||!l(t))throw new TypeError("Positive integer value expected in function permutations");if(t.gt(e))throw new TypeError("second argument k must be less than or equal to first argument n");for(r=e.mul(0).add(1),n=e.minus(t).plus(1);n.lte(e);n=n.plus(1))r=r.times(n);return r}})}));function l(e){return e.isInteger()&&e.gte(0)}},19927:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createPickRandom=void 0;var n=r(34487),i=r(66212),s=r(91612),o=r(57967);const a="pickRandom",l=["typed","config","?on"];t.createPickRandom=(0,i.factory)(a,l,(e=>{let{typed:t,config:r,on:i}=e,l=(0,o.createRng)(r.randomSeed);return i&&i("config",(function(e,t){e.randomSeed!==t.randomSeed&&(l=(0,o.createRng)(e.randomSeed))})),t(a,{"Array | Matrix":function(e){return c(e,{})},"Array | Matrix, Object":function(e,t){return c(e,t)},"Array | Matrix, number":function(e,t){return c(e,{number:t})},"Array | Matrix, Array | Matrix":function(e,t){return c(e,{weights:t})},"Array | Matrix, Array | Matrix, number":function(e,t,r){return c(e,{number:r,weights:t})},"Array | Matrix, number, Array | Matrix":function(e,t,r){return c(e,{number:t,weights:r})}});function c(e,t){let{number:r,weights:i,elementWise:o=!0}=t;const a=void 0===r;a&&(r=1);const c=(0,s.isMatrix)(e)?e.create:(0,s.isMatrix)(i)?i.create:null;e=e.valueOf(),i&&(i=i.valueOf()),!0===o&&(e=(0,n.flatten)(e),i=(0,n.flatten)(i));let u=0;if(void 0!==i){if(i.length!==e.length)throw new Error("Weights must have the same length as possibles");for(let e=0,t=i.length;e<t;e++){if(!(0,s.isNumber)(i[e])||i[e]<0)throw new Error("Weights must be an array of positive numbers");u+=i[e]}}const d=e.length,h=[];let p;for(;h.length<r;){if(void 0===i)p=e[Math.floor(l()*d)];else{let t=l()*u;for(let r=0,n=e.length;r<n;r++)if(t-=i[r],t<0){p=e[r];break}}h.push(p)}return a?h[0]:c?c(h):h}}))},68330:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRandomNumber=t.createRandom=void 0;var n=r(66212),i=r(91612),s=r(57967),o=r(38786);const a="random",l=["typed","config","?on"];t.createRandom=(0,n.factory)(a,l,(e=>{let{typed:t,config:r,on:n}=e,l=(0,s.createRng)(r.randomSeed);return n&&n("config",(function(e,t){e.randomSeed!==t.randomSeed&&(l=(0,s.createRng)(e.randomSeed))})),t(a,{"":()=>u(0,1),number:e=>u(0,e),"number, number":(e,t)=>u(e,t),"Array | Matrix":e=>c(e,0,1),"Array | Matrix, number":(e,t)=>c(e,0,t),"Array | Matrix, number, number":(e,t,r)=>c(e,t,r)});function c(e,t,r){const n=(0,o.randomMatrix)(e.valueOf(),(()=>u(t,r)));return(0,i.isMatrix)(e)?e.create(n,"number"):n}function u(e,t){return e+l()*(t-e)}})),t.createRandomNumber=(0,n.factory)(a,["typed","config","?on"],(e=>{let{typed:t,config:r,on:n,matrix:i}=e,o=(0,s.createRng)(r.randomSeed);return n&&n("config",(function(e,t){e.randomSeed!==t.randomSeed&&(o=(0,s.createRng)(e.randomSeed))})),t(a,{"":()=>l(0,1),number:e=>l(0,e),"number, number":(e,t)=>l(e,t)});function l(e,t){return e+o()*(t-e)}}))},84221:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRandomInt=void 0;var n=r(66212),i=r(38786),s=r(57967),o=r(91612);const a="randomInt",l=["typed","config","?on"];t.createRandomInt=(0,n.factory)(a,l,(e=>{let{typed:t,config:r,on:n}=e,l=(0,s.createRng)(r.randomSeed);return n&&n("config",(function(e,t){e.randomSeed!==t.randomSeed&&(l=(0,s.createRng)(e.randomSeed))})),t(a,{"":()=>u(0,1),number:e=>u(0,e),"number, number":(e,t)=>u(e,t),"Array | Matrix":e=>c(e,0,1),"Array | Matrix, number":(e,t)=>c(e,0,t),"Array | Matrix, number, number":(e,t,r)=>c(e,t,r)});function c(e,t,r){const n=(0,i.randomMatrix)(e.valueOf(),(()=>u(t,r)));return(0,o.isMatrix)(e)?e.create(n,"number"):n}function u(e,t){return Math.floor(e+l()*(t-e))}}))},38786:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomMatrix=function e(t,r){const n=[];if((t=t.slice(0)).length>1)for(let i=0,s=t.shift();i<s;i++)n.push(e(t,r));else for(let e=0,i=t.shift();e<i;e++)n.push(r());return n}},57967:(e,t,r)=>{"use strict";var n=r(87929);Object.defineProperty(t,"__esModule",{value:!0}),t.createRng=function(e){let t;return function(e){t=null===e?s:(0,i.default)(String(e))}(e),function(){return t()}};var i=n(r(85817));const s=(0,i.default)(Date.now())},63300:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCompareNumber=t.createCompare=void 0;var n=r(67625),i=r(34749),s=r(66212),o=r(89164),a=r(47993),l=r(7367),c=r(11279),u=r(44373);const d="compare",h=["typed","config","matrix","equalScalar","BigNumber","Fraction","DenseMatrix","concat"],p=(t.createCompare=(0,s.factory)(d,h,(e=>{let{typed:t,config:r,equalScalar:i,matrix:s,BigNumber:h,Fraction:m,DenseMatrix:f,concat:g}=e;const y=(0,o.createMatAlgo03xDSf)({typed:t}),b=(0,l.createMatAlgo05xSfSf)({typed:t,equalScalar:i}),v=(0,a.createMatAlgo12xSfs)({typed:t,DenseMatrix:f}),_=(0,c.createMatrixAlgorithmSuite)({typed:t,matrix:s,concat:g}),x=(0,u.createCompareUnits)({typed:t});return t(d,p({typed:t,config:r}),{"boolean, boolean":function(e,t){return e===t?0:e>t?1:-1},"BigNumber, BigNumber":function(e,t){return(0,n.nearlyEqual)(e,t,r.relTol,r.absTol)?new h(0):new h(e.cmp(t))},"bigint, bigint":function(e,t){return e===t?0n:e>t?1n:-1n},"Fraction, Fraction":function(e,t){return new m(e.compare(t))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},x,_({SS:b,DS:y,Ss:v}))})),t.createCompareNumber=(0,s.factory)(d,["typed","config"],(e=>{let{typed:t,config:r}=e;return t(d,{"number, number":function(e,t){return(0,i.nearlyEqual)(e,t,r.relTol,r.absTol)?0:e>t?1:-1}})})))},51739:(e,t,r)=>{"use strict";var n=r(87929);Object.defineProperty(t,"__esModule",{value:!0}),t.createCompareNatural=void 0;var i=n(r(28214)),s=r(91612),o=r(66212);const a="compareNatural",l=["typed","compare"];t.createCompareNatural=(0,o.factory)(a,l,(e=>{let{typed:t,compare:r}=e;const n=r.signatures["boolean,boolean"];return t(a,{"any, any":function e(t,a){const c=(0,s.typeOf)(t),u=(0,s.typeOf)(a);let d;if(!("number"!==c&&"BigNumber"!==c&&"Fraction"!==c||"number"!==u&&"BigNumber"!==u&&"Fraction"!==u))return d=r(t,a),"0"!==d.toString()?d>0?1:-1:(0,i.default)(c,u);const h=["Array","DenseMatrix","SparseMatrix"];if(h.includes(c)||h.includes(u))return d=o(e,t,a),0!==d?d:(0,i.default)(c,u);if(c!==u)return(0,i.default)(c,u);if("Complex"===c)return function(e,t){if(e.re>t.re)return 1;if(e.re<t.re)return-1;if(e.im>t.im)return 1;if(e.im<t.im)return-1;return 0}(t,a);if("Unit"===c)return t.equalBase(a)?e(t.value,a.value):l(e,t.formatUnits(),a.formatUnits());if("boolean"===c)return n(t,a);if("string"===c)return(0,i.default)(t,a);if("Object"===c)return function(e,t,r){const n=Object.keys(t),s=Object.keys(r);n.sort(i.default),s.sort(i.default);const o=l(e,n,s);if(0!==o)return o;for(let i=0;i<n.length;i++){const o=e(t[n[i]],r[s[i]]);if(0!==o)return o}return 0}(e,t,a);if("null"===c)return 0;if("undefined"===c)return 0;throw new TypeError('Unsupported type of value "'+c+'"')}});function o(e,t,r){return(0,s.isSparseMatrix)(t)&&(0,s.isSparseMatrix)(r)?l(e,t.toJSON().values,r.toJSON().values):(0,s.isSparseMatrix)(t)?o(e,t.toArray(),r):(0,s.isSparseMatrix)(r)?o(e,t,r.toArray()):(0,s.isDenseMatrix)(t)?o(e,t.toJSON().data,r):(0,s.isDenseMatrix)(r)?o(e,t,r.toJSON().data):Array.isArray(t)?Array.isArray(r)?l(e,t,r):o(e,t,[r]):o(e,[t],r)}function l(e,t,r){for(let n=0,i=Math.min(t.length,r.length);n<i;n++){const i=e(t[n],r[n]);if(0!==i)return i}return t.length>r.length?1:t.length<r.length?-1:0}}))},61559:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCompareTextNumber=t.createCompareText=void 0;var n=r(7041),i=r(66212),s=r(11279);const o="compareText",a=["typed","matrix","concat"];n.compareText.signature="any, any";t.createCompareText=(0,i.factory)(o,a,(e=>{let{typed:t,matrix:r,concat:i}=e;const a=(0,s.createMatrixAlgorithmSuite)({typed:t,matrix:r,concat:i});return t(o,n.compareText,a({elop:n.compareText,Ds:!0}))})),t.createCompareTextNumber=(0,i.factory)(o,["typed"],(e=>{let{typed:t}=e;return t(o,n.compareText)}))},44373:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCompareUnits=void 0;var n=r(66212);t.createCompareUnits=(0,n.factory)("compareUnits",["typed"],(e=>{let{typed:t}=e;return{"Unit, Unit":t.referToSelf((e=>(r,n)=>{if(!r.equalBase(n))throw new Error("Cannot compare units with different base");return t.find(e,[r.valueType(),n.valueType()])(r.value,n.value)}))}}))},39685:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDeepEqual=void 0;var n=r(66212);const i="deepEqual",s=["typed","equal"];t.createDeepEqual=(0,n.factory)(i,s,(e=>{let{typed:t,equal:r}=e;return t(i,{"any, any":function(e,t){return n(e.valueOf(),t.valueOf())}});function n(e,t){if(Array.isArray(e)){if(Array.isArray(t)){const r=e.length;if(r!==t.length)return!1;for(let i=0;i<r;i++)if(!n(e[i],t[i]))return!1;return!0}return!1}return!Array.isArray(t)&&r(e,t)}}))},81039:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createEqualNumber=t.createEqual=void 0;var n=r(66212),i=r(89164),s=r(88177),o=r(47993),a=r(11279);const l="equal",c=["typed","matrix","equalScalar","DenseMatrix","concat"],u=(t.createEqual=(0,n.factory)(l,c,(e=>{let{typed:t,matrix:r,equalScalar:n,DenseMatrix:c,concat:d}=e;const h=(0,i.createMatAlgo03xDSf)({typed:t}),p=(0,s.createMatAlgo07xSSf)({typed:t,DenseMatrix:c}),m=(0,o.createMatAlgo12xSfs)({typed:t,DenseMatrix:c}),f=(0,a.createMatrixAlgorithmSuite)({typed:t,matrix:r,concat:d});return t(l,u({typed:t,equalScalar:n}),f({elop:n,SS:p,DS:h,Ss:m}))})),t.createEqualNumber=(0,n.factory)(l,["typed","equalScalar"],(e=>{let{typed:t,equalScalar:r}=e;return t(l,{"any, any":function(e,t){return null===e?null===t:null===t?null===e:void 0===e?void 0===t:void 0===t?void 0===e:r(e,t)}})})))},81643:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createEqualScalarNumber=t.createEqualScalar=void 0;var n=r(67625),i=r(34749),s=r(66212),o=r(90938),a=r(44373);const l="equalScalar",c=["typed","config"];t.createEqualScalar=(0,s.factory)(l,c,(e=>{let{typed:t,config:r}=e;const s=(0,a.createCompareUnits)({typed:t});return t(l,{"boolean, boolean":function(e,t){return e===t},"number, number":function(e,t){return(0,i.nearlyEqual)(e,t,r.relTol,r.absTol)},"BigNumber, BigNumber":function(e,t){return e.eq(t)||(0,n.nearlyEqual)(e,t,r.relTol,r.absTol)},"bigint, bigint":function(e,t){return e===t},"Fraction, Fraction":function(e,t){return e.equals(t)},"Complex, Complex":function(e,t){return(0,o.complexEquals)(e,t,r.relTol,r.absTol)}},s)})),t.createEqualScalarNumber=(0,s.factory)(l,["typed","config"],(e=>{let{typed:t,config:r}=e;return t(l,{"number, number":function(e,t){return(0,i.nearlyEqual)(e,t,r.relTol,r.absTol)}})}))},41948:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createEqualText=void 0;var n=r(66212);const i="equalText",s=["typed","compareText","isZero"];t.createEqualText=(0,n.factory)(i,s,(e=>{let{typed:t,compareText:r,isZero:n}=e;return t(i,{"any, any":function(e,t){return n(r(e,t))}})}))},6612:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLargerNumber=t.createLarger=void 0;var n=r(67625),i=r(34749),s=r(66212),o=r(89164),a=r(88177),l=r(47993),c=r(11279),u=r(44373);const d="larger",h=["typed","config","matrix","DenseMatrix","concat"],p=(t.createLarger=(0,s.factory)(d,h,(e=>{let{typed:t,config:r,matrix:i,DenseMatrix:s,concat:h}=e;const m=(0,o.createMatAlgo03xDSf)({typed:t}),f=(0,a.createMatAlgo07xSSf)({typed:t,DenseMatrix:s}),g=(0,l.createMatAlgo12xSfs)({typed:t,DenseMatrix:s}),y=(0,c.createMatrixAlgorithmSuite)({typed:t,matrix:i,concat:h}),b=(0,u.createCompareUnits)({typed:t});return t(d,p({typed:t,config:r}),{"boolean, boolean":(e,t)=>e>t,"BigNumber, BigNumber":function(e,t){return e.gt(t)&&!(0,n.nearlyEqual)(e,t,r.relTol,r.absTol)},"bigint, bigint":(e,t)=>e>t,"Fraction, Fraction":(e,t)=>1===e.compare(t),"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},b,y({SS:f,DS:m,Ss:g}))})),t.createLargerNumber=(0,s.factory)(d,["typed","config"],(e=>{let{typed:t,config:r}=e;return t(d,{"number, number":function(e,t){return e>t&&!(0,i.nearlyEqual)(e,t,r.relTol,r.absTol)}})})))},3630:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLargerEqNumber=t.createLargerEq=void 0;var n=r(67625),i=r(34749),s=r(66212),o=r(89164),a=r(88177),l=r(47993),c=r(11279),u=r(44373);const d="largerEq",h=["typed","config","matrix","DenseMatrix","concat"],p=(t.createLargerEq=(0,s.factory)(d,h,(e=>{let{typed:t,config:r,matrix:i,DenseMatrix:s,concat:h}=e;const m=(0,o.createMatAlgo03xDSf)({typed:t}),f=(0,a.createMatAlgo07xSSf)({typed:t,DenseMatrix:s}),g=(0,l.createMatAlgo12xSfs)({typed:t,DenseMatrix:s}),y=(0,c.createMatrixAlgorithmSuite)({typed:t,matrix:i,concat:h}),b=(0,u.createCompareUnits)({typed:t});return t(d,p({typed:t,config:r}),{"boolean, boolean":(e,t)=>e>=t,"BigNumber, BigNumber":function(e,t){return e.gte(t)||(0,n.nearlyEqual)(e,t,r.relTol,r.absTol)},"bigint, bigint":function(e,t){return e>=t},"Fraction, Fraction":(e,t)=>-1!==e.compare(t),"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},b,y({SS:f,DS:m,Ss:g}))})),t.createLargerEqNumber=(0,s.factory)(d,["typed","config"],(e=>{let{typed:t,config:r}=e;return t(d,{"number, number":function(e,t){return e>=t||(0,i.nearlyEqual)(e,t,r.relTol,r.absTol)}})})))},29411:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSmallerNumber=t.createSmaller=void 0;var n=r(67625),i=r(34749),s=r(66212),o=r(89164),a=r(88177),l=r(47993),c=r(11279),u=r(44373);const d="smaller",h=["typed","config","matrix","DenseMatrix","concat"],p=(t.createSmaller=(0,s.factory)(d,h,(e=>{let{typed:t,config:r,matrix:i,DenseMatrix:s,concat:h}=e;const m=(0,o.createMatAlgo03xDSf)({typed:t}),f=(0,a.createMatAlgo07xSSf)({typed:t,DenseMatrix:s}),g=(0,l.createMatAlgo12xSfs)({typed:t,DenseMatrix:s}),y=(0,c.createMatrixAlgorithmSuite)({typed:t,matrix:i,concat:h}),b=(0,u.createCompareUnits)({typed:t});return t(d,p({typed:t,config:r}),{"boolean, boolean":(e,t)=>e<t,"BigNumber, BigNumber":function(e,t){return e.lt(t)&&!(0,n.nearlyEqual)(e,t,r.relTol,r.absTol)},"bigint, bigint":(e,t)=>e<t,"Fraction, Fraction":(e,t)=>-1===e.compare(t),"Complex, Complex":function(e,t){throw new TypeError("No ordering relation is defined for complex numbers")}},b,y({SS:f,DS:m,Ss:g}))})),t.createSmallerNumber=(0,s.factory)(d,["typed","config"],(e=>{let{typed:t,config:r}=e;return t(d,{"number, number":function(e,t){return e<t&&!(0,i.nearlyEqual)(e,t,r.relTol,r.absTol)}})})))},161:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSmallerEqNumber=t.createSmallerEq=void 0;var n=r(67625),i=r(34749),s=r(66212),o=r(89164),a=r(88177),l=r(47993),c=r(11279),u=r(44373);const d="smallerEq",h=["typed","config","matrix","DenseMatrix","concat"],p=(t.createSmallerEq=(0,s.factory)(d,h,(e=>{let{typed:t,config:r,matrix:i,DenseMatrix:s,concat:h}=e;const m=(0,o.createMatAlgo03xDSf)({typed:t}),f=(0,a.createMatAlgo07xSSf)({typed:t,DenseMatrix:s}),g=(0,l.createMatAlgo12xSfs)({typed:t,DenseMatrix:s}),y=(0,c.createMatrixAlgorithmSuite)({typed:t,matrix:i,concat:h}),b=(0,u.createCompareUnits)({typed:t});return t(d,p({typed:t,config:r}),{"boolean, boolean":(e,t)=>e<=t,"BigNumber, BigNumber":function(e,t){return e.lte(t)||(0,n.nearlyEqual)(e,t,r.relTol,r.absTol)},"bigint, bigint":(e,t)=>e<=t,"Fraction, Fraction":(e,t)=>1!==e.compare(t),"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},b,y({SS:f,DS:m,Ss:g}))})),t.createSmallerEqNumber=(0,s.factory)(d,["typed","config"],(e=>{let{typed:t,config:r}=e;return t(d,{"number, number":function(e,t){return e<=t||(0,i.nearlyEqual)(e,t,r.relTol,r.absTol)}})})))},58602:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createUnequalNumber=t.createUnequal=void 0;var n=r(66212),i=r(89164),s=r(88177),o=r(47993),a=r(11279);const l="unequal",c=["typed","config","equalScalar","matrix","DenseMatrix","concat"],u=(t.createUnequal=(0,n.factory)(l,c,(e=>{let{typed:t,config:r,equalScalar:n,matrix:c,DenseMatrix:d,concat:h}=e;const p=(0,i.createMatAlgo03xDSf)({typed:t}),m=(0,s.createMatAlgo07xSSf)({typed:t,DenseMatrix:d}),f=(0,o.createMatAlgo12xSfs)({typed:t,DenseMatrix:d}),g=(0,a.createMatrixAlgorithmSuite)({typed:t,matrix:c,concat:h});return t(l,u({typed:t,equalScalar:n}),g({elop:function(e,t){return!n(e,t)},SS:m,DS:p,Ss:f}))})),t.createUnequalNumber=(0,n.factory)(l,["typed","equalScalar"],(e=>{let{typed:t,equalScalar:r}=e;return t(l,{"any, any":function(e,t){return null===e?null!==t:null===t?null!==e:void 0===e?void 0!==t:void 0===t?void 0!==e:!r(e,t)}})})))},98062:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSetCartesian=void 0;var n=r(34487),i=r(66212);const s="setCartesian",o=["typed","size","subset","compareNatural","Index","DenseMatrix"];t.createSetCartesian=(0,i.factory)(s,o,(e=>{let{typed:t,size:r,subset:i,compareNatural:o,Index:a,DenseMatrix:l}=e;return t(s,{"Array | Matrix, Array | Matrix":function(e,t){let s=[];if(0!==i(r(e),new a(0))&&0!==i(r(t),new a(0))){const r=(0,n.flatten)(Array.isArray(e)?e:e.toArray()).sort(o),i=(0,n.flatten)(Array.isArray(t)?t:t.toArray()).sort(o);s=[];for(let e=0;e<r.length;e++)for(let t=0;t<i.length;t++)s.push([r[e],i[t]])}return Array.isArray(e)&&Array.isArray(t)?s:new l(s)}})}))},4045:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSetDifference=void 0;var n=r(34487),i=r(66212);const s="setDifference",o=["typed","size","subset","compareNatural","Index","DenseMatrix"];t.createSetDifference=(0,i.factory)(s,o,(e=>{let{typed:t,size:r,subset:i,compareNatural:o,Index:a,DenseMatrix:l}=e;return t(s,{"Array | Matrix, Array | Matrix":function(e,t){let s;if(0===i(r(e),new a(0)))s=[];else{if(0===i(r(t),new a(0)))return(0,n.flatten)(e.toArray());{const r=(0,n.identify)((0,n.flatten)(Array.isArray(e)?e:e.toArray()).sort(o)),i=(0,n.identify)((0,n.flatten)(Array.isArray(t)?t:t.toArray()).sort(o));let a;s=[];for(let e=0;e<r.length;e++){a=!1;for(let t=0;t<i.length;t++)if(0===o(r[e].value,i[t].value)&&r[e].identifier===i[t].identifier){a=!0;break}a||s.push(r[e])}}}return Array.isArray(e)&&Array.isArray(t)?(0,n.generalize)(s):new l((0,n.generalize)(s))}})}))},52110:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSetDistinct=void 0;var n=r(34487),i=r(66212);const s="setDistinct",o=["typed","size","subset","compareNatural","Index","DenseMatrix"];t.createSetDistinct=(0,i.factory)(s,o,(e=>{let{typed:t,size:r,subset:i,compareNatural:o,Index:a,DenseMatrix:l}=e;return t(s,{"Array | Matrix":function(e){let t;if(0===i(r(e),new a(0)))t=[];else{const r=(0,n.flatten)(Array.isArray(e)?e:e.toArray()).sort(o);t=[],t.push(r[0]);for(let e=1;e<r.length;e++)0!==o(r[e],r[e-1])&&t.push(r[e])}return Array.isArray(e)?t:new l(t)}})}))},34785:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSetIntersect=void 0;var n=r(34487),i=r(66212);const s="setIntersect",o=["typed","size","subset","compareNatural","Index","DenseMatrix"];t.createSetIntersect=(0,i.factory)(s,o,(e=>{let{typed:t,size:r,subset:i,compareNatural:o,Index:a,DenseMatrix:l}=e;return t(s,{"Array | Matrix, Array | Matrix":function(e,t){let s;if(0===i(r(e),new a(0))||0===i(r(t),new a(0)))s=[];else{const r=(0,n.identify)((0,n.flatten)(Array.isArray(e)?e:e.toArray()).sort(o)),i=(0,n.identify)((0,n.flatten)(Array.isArray(t)?t:t.toArray()).sort(o));s=[];for(let e=0;e<r.length;e++)for(let t=0;t<i.length;t++)if(0===o(r[e].value,i[t].value)&&r[e].identifier===i[t].identifier){s.push(r[e]);break}}return Array.isArray(e)&&Array.isArray(t)?(0,n.generalize)(s):new l((0,n.generalize)(s))}})}))},31280:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSetIsSubset=void 0;var n=r(34487),i=r(66212);const s="setIsSubset",o=["typed","size","subset","compareNatural","Index"];t.createSetIsSubset=(0,i.factory)(s,o,(e=>{let{typed:t,size:r,subset:i,compareNatural:o,Index:a}=e;return t(s,{"Array | Matrix, Array | Matrix":function(e,t){if(0===i(r(e),new a(0)))return!0;if(0===i(r(t),new a(0)))return!1;const s=(0,n.identify)((0,n.flatten)(Array.isArray(e)?e:e.toArray()).sort(o)),l=(0,n.identify)((0,n.flatten)(Array.isArray(t)?t:t.toArray()).sort(o));let c;for(let e=0;e<s.length;e++){c=!1;for(let t=0;t<l.length;t++)if(0===o(s[e].value,l[t].value)&&s[e].identifier===l[t].identifier){c=!0;break}if(!1===c)return!1}return!0}})}))},68469:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSetMultiplicity=void 0;var n=r(34487),i=r(66212);const s="setMultiplicity",o=["typed","size","subset","compareNatural","Index"];t.createSetMultiplicity=(0,i.factory)(s,o,(e=>{let{typed:t,size:r,subset:i,compareNatural:o,Index:a}=e;return t(s,{"number | BigNumber | Fraction | Complex, Array | Matrix":function(e,t){if(0===i(r(t),new a(0)))return 0;const s=(0,n.flatten)(Array.isArray(t)?t:t.toArray());let l=0;for(let t=0;t<s.length;t++)0===o(s[t],e)&&l++;return l}})}))},8145:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSetPowerset=void 0;var n=r(34487),i=r(66212);const s="setPowerset",o=["typed","size","subset","compareNatural","Index"];t.createSetPowerset=(0,i.factory)(s,o,(e=>{let{typed:t,size:r,subset:i,compareNatural:o,Index:a}=e;return t(s,{"Array | Matrix":function(e){if(0===i(r(e),new a(0)))return[];const t=(0,n.flatten)(Array.isArray(e)?e:e.toArray()).sort(o),s=[];let c=0;for(;c.toString(2).length<=t.length;)s.push(l(t,c.toString(2).split("").reverse())),c++;return function(e){let t=[];for(let r=e.length-1;r>0;r--)for(let n=0;n<r;n++)e[n].length>e[n+1].length&&(t=e[n],e[n]=e[n+1],e[n+1]=t);return e}(s)}});function l(e,t){const r=[];for(let n=0;n<t.length;n++)"1"===t[n]&&r.push(e[n]);return r}}))},7995:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSetSize=void 0;var n=r(34487),i=r(66212);const s="setSize",o=["typed","compareNatural"];t.createSetSize=(0,i.factory)(s,o,(e=>{let{typed:t,compareNatural:r}=e;return t(s,{"Array | Matrix":function(e){return Array.isArray(e)?(0,n.flatten)(e).length:(0,n.flatten)(e.toArray()).length},"Array | Matrix, boolean":function(e,t){if(!1===t||0===e.length)return Array.isArray(e)?(0,n.flatten)(e).length:(0,n.flatten)(e.toArray()).length;{const t=(0,n.flatten)(Array.isArray(e)?e:e.toArray()).sort(r);let i=1;for(let e=1;e<t.length;e++)0!==r(t[e],t[e-1])&&i++;return i}}})}))},8788:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSetSymDifference=void 0;var n=r(34487),i=r(66212);const s="setSymDifference",o=["typed","size","concat","subset","setDifference","Index"];t.createSetSymDifference=(0,i.factory)(s,o,(e=>{let{typed:t,size:r,concat:i,subset:o,setDifference:a,Index:l}=e;return t(s,{"Array | Matrix, Array | Matrix":function(e,t){if(0===o(r(e),new l(0)))return(0,n.flatten)(t);if(0===o(r(t),new l(0)))return(0,n.flatten)(e);const s=(0,n.flatten)(e),c=(0,n.flatten)(t);return i(a(s,c),a(c,s))}})}))},7811:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSetUnion=void 0;var n=r(34487),i=r(66212);const s="setUnion",o=["typed","size","concat","subset","setIntersect","setSymDifference","Index"];t.createSetUnion=(0,i.factory)(s,o,(e=>{let{typed:t,size:r,concat:i,subset:o,setIntersect:a,setSymDifference:l,Index:c}=e;return t(s,{"Array | Matrix, Array | Matrix":function(e,t){if(0===o(r(e),new c(0)))return(0,n.flatten)(t);if(0===o(r(t),new c(0)))return(0,n.flatten)(e);const s=(0,n.flatten)(e),u=(0,n.flatten)(t);return i(l(s,u),a(s,u))}})}))},81754:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createFreqz=void 0;var n=r(66212);const i="freqz",s=["typed","add","multiply","Complex","divide","matrix"];t.createFreqz=(0,n.factory)(i,s,(e=>{let{typed:t,add:r,multiply:n,Complex:s,divide:o,matrix:a}=e;return t(i,{"Array, Array":function(e,t){return l(e,t,c(512))},"Array, Array, Array":function(e,t,r){return l(e,t,r)},"Array, Array, number":function(e,t,r){if(r<0)throw new Error("w must be a positive number");return l(e,t,c(r))},"Matrix, Matrix":function(e,t){const r=c(512),{w:n,h:i}=l(e.valueOf(),t.valueOf(),r);return{w:a(n),h:a(i)}},"Matrix, Matrix, Matrix":function(e,t,r){const{h:n}=l(e.valueOf(),t.valueOf(),r.valueOf());return{h:a(n),w:a(r)}},"Matrix, Matrix, number":function(e,t,r){if(r<0)throw new Error("w must be a positive number");const n=c(r),{h:i}=l(e.valueOf(),t.valueOf(),n);return{h:a(i),w:a(n)}}});function l(e,t,i){const a=[],l=[];for(let o=0;o<i.length;o++){let c=s(0,0),u=s(0,0);for(let t=0;t<e.length;t++)c=r(c,n(e[t],s(Math.cos(-t*i[o]),Math.sin(-t*i[o]))));for(let e=0;e<t.length;e++)u=r(u,n(t[e],s(Math.cos(-e*i[o]),Math.sin(-e*i[o]))));a.push(c),l.push(u)}const c=[];for(let e=0;e<a.length;e++)c.push(o(a[e],l[e]));return{h:c,w:i}}function c(e){const t=[];for(let r=0;r<e;r++)t.push(r/e*Math.PI);return t}}))},15841:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createZpk2tf=void 0;var n=r(66212);const i="zpk2tf",s=["typed","add","multiply","Complex","number"];t.createZpk2tf=(0,n.factory)(i,s,(e=>{let{typed:t,add:r,multiply:n,Complex:s,number:o}=e;return t(i,{"Array,Array,number":function(e,t,r){return a(e,t,r)},"Array,Array":function(e,t){return a(e,t,1)},"Matrix,Matrix,number":function(e,t,r){return a(e.valueOf(),t.valueOf(),r)},"Matrix,Matrix":function(e,t){return a(e.valueOf(),t.valueOf(),1)}});function a(e,t,r){e.some((e=>"BigNumber"===e.type))&&(e=e.map((e=>o(e)))),t.some((e=>"BigNumber"===e.type))&&(t=t.map((e=>o(e))));let i=[s(1,0)],a=[s(1,0)];for(let t=0;t<e.length;t++){let r=e[t];"number"==typeof r&&(r=s(r,0)),i=l(i,[s(1,0),s(-r.re,-r.im)])}for(let e=0;e<t.length;e++){let r=t[e];"number"==typeof r&&(r=s(r,0)),a=l(a,[s(1,0),s(-r.re,-r.im)])}for(let e=0;e<i.length;e++)i[e]=n(i[e],r);return[i,a]}function l(e,t){const i=[];for(let o=0;o<e.length+t.length-1;o++){i[o]=s(0,0);for(let s=0;s<e.length;s++)o-s>=0&&o-s<t.length&&(i[o]=r(i[o],n(e[s],t[o-s])))}return i}}))},27306:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createErf=void 0;var n=r(16624),i=r(34749),s=r(66212);const o=["typed"],a=(t.createErf=(0,s.factory)("erf",o,(e=>{let{typed:t}=e;return t("name",{number:function(e){const t=Math.abs(e);return t>=d?(0,i.sign)(e):t<=a?(0,i.sign)(e)*function(e){const t=e*e;let r,n=c[0][4]*t,i=t;for(r=0;r<3;r+=1)n=(n+c[0][r])*t,i=(i+u[0][r])*t;return e*(n+c[0][3])/(i+u[0][3])}(t):t<=4?(0,i.sign)(e)*(1-function(e){let t,r=c[1][8]*e,n=e;for(t=0;t<7;t+=1)r=(r+c[1][t])*e,n=(n+u[1][t])*e;const i=(r+c[1][7])/(n+u[1][7]),s=parseInt(16*e)/16,o=(e-s)*(e+s);return Math.exp(-s*s)*Math.exp(-o)*i}(t)):(0,i.sign)(e)*(1-function(e){let t,r=1/(e*e),n=c[2][5]*r,i=r;for(t=0;t<4;t+=1)n=(n+c[2][t])*r,i=(i+u[2][t])*r;let s=r*(n+c[2][4])/(i+u[2][4]);s=(l-s)/e,r=parseInt(16*e)/16;const o=(e-r)*(e+r);return Math.exp(-r*r)*Math.exp(-o)*s}(t))},"Array | Matrix":t.referToSelf((e=>t=>(0,n.deepMap)(t,e)))})})),.46875),l=.5641895835477563,c=[[3.1611237438705655,113.86415415105016,377.485237685302,3209.3775891384694,.18577770618460315],[.5641884969886701,8.883149794388377,66.11919063714163,298.6351381974001,881.952221241769,1712.0476126340707,2051.0783778260716,1230.3393547979972,2.1531153547440383e-8],[.30532663496123236,.36034489994980445,.12578172611122926,.016083785148742275,.0006587491615298378,.016315387137302097]],u=[[23.601290952344122,244.02463793444417,1282.6165260773723,2844.236833439171],[15.744926110709835,117.6939508913125,537.1811018620099,1621.3895745666903,3290.7992357334597,4362.619090143247,3439.3676741437216,1230.3393548037495],[2.568520192289822,1.8729528499234604,.5279051029514285,.06051834131244132,.0023352049762686918]],d=Math.pow(2,53)},9463:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createZeta=void 0;var n=r(66212);const i="zeta",s=["typed","config","multiply","pow","divide","factorial","equal","smallerEq","isNegative","gamma","sin","subtract","add","?Complex","?BigNumber","pi"];t.createZeta=(0,n.factory)(i,s,(e=>{let{typed:t,config:r,multiply:n,pow:s,divide:o,factorial:a,equal:l,smallerEq:c,isNegative:u,gamma:d,sin:h,subtract:p,add:m,Complex:f,BigNumber:g,pi:y}=e;return t(i,{number:e=>b(e,(e=>e),(()=>20)),BigNumber:e=>b(e,(e=>new g(e)),(()=>Math.abs(Math.log10(r.relTol)))),Complex:function(e){if(0===e.re&&0===e.im)return new f(-.5);if(1===e.re)return new f(NaN,NaN);if(e.re===1/0&&0===e.im)return new f(1);if(e.im===1/0||e.re===-1/0)return new f(NaN,NaN);return v(e,(e=>e),(e=>Math.round(19.5+.9*Math.abs(e.im))),(e=>e.re))}});function b(e,t,r){return l(e,0)?t(-.5):l(e,1)?t(NaN):isFinite(e)?v(e,t,r,(e=>e)):u(e)?t(NaN):t(1)}function v(e,t,r,i){const a=r(e);if(i(e)>-(a-1)/2)return function(e,t,r){const i=o(1,n(_(r(0),t),p(1,s(2,p(1,e)))));let a=r(0);for(let i=r(1);c(i,t);i=m(i,1))a=m(a,o(n((-1)**(i-1),_(i,t)),s(i,e)));return n(i,a)}(e,t(a),t);{let a=n(s(2,e),s(t(y),p(e,1)));return a=n(a,h(n(o(t(y),2),e))),a=n(a,d(p(1,e))),n(a,v(p(1,e),t,r,i))}}function _(e,t){let r=e;for(let i=e;c(i,t);i=m(i,1)){const e=o(n(a(m(t,p(i,1))),s(4,i)),n(a(p(t,i)),a(n(2,i))));r=m(r,e)}return n(t,r)}}))},24083:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCorr=void 0;var n=r(66212);const i="corr",s=["typed","matrix","mean","sqrt","sum","add","subtract","multiply","pow","divide"];t.createCorr=(0,n.factory)(i,s,(e=>{let{typed:t,matrix:r,sqrt:n,sum:s,add:o,subtract:a,multiply:l,pow:c,divide:u}=e;return t(i,{"Array, Array":function(e,t){return d(e,t)},"Matrix, Matrix":function(e,t){const n=d(e.toArray(),t.toArray());return Array.isArray(n)?r(n):n}});function d(e,t){const r=[];if(Array.isArray(e[0])&&Array.isArray(t[0])){if(e.length!==t.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same length.");for(let n=0;n<e.length;n++){if(e[n].length!==t[n].length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same number of elements.");r.push(h(e[n],t[n]))}return r}if(e.length!==t.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same number of elements.");return h(e,t)}function h(e,t){const r=e.length,i=s(e),d=s(t),h=e.reduce(((e,r,n)=>o(e,l(r,t[n]))),0),p=s(e.map((e=>c(e,2)))),m=s(t.map((e=>c(e,2)))),f=a(l(r,h),l(i,d)),g=n(l(a(l(r,p),c(i,2)),a(l(r,m),c(d,2))));return u(f,g)}}))},54131:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCumSum=void 0;var n=r(16624),i=r(66212),s=r(55408),o=r(60898),a=r(34487),l=r(17967);const c="cumsum",u=["typed","add","unaryPlus"];t.createCumSum=(0,i.factory)(c,u,(e=>{let{typed:t,add:r,unaryPlus:i}=e;return t(c,{Array:u,Matrix:function(e){return e.create(u(e.valueOf(),e.datatype()))},"Array, number | BigNumber":h,"Matrix, number | BigNumber":function(e,t){return e.create(h(e.valueOf(),t),e.datatype())},"...":function(e){if((0,n.containsCollections)(e))throw new TypeError("All values expected to be scalar in function cumsum");return u(e)}});function u(e){try{return d(e)}catch(e){throw(0,o.improveErrorMessage)(e,c)}}function d(e){if(0===e.length)return[];const t=[i(e[0])];for(let n=1;n<e.length;++n)t.push(r(t[n-1],e[n]));return t}function h(e,t){const r=(0,a.arraySize)(e);if(t<0||t>=r.length)throw new l.IndexError(t,r.length);try{return p(e,t)}catch(e){throw(0,o.improveErrorMessage)(e,c)}}function p(e,t){let r,n,i;if(t<=0){const o=e[0][0];if(Array.isArray(o)){for(i=(0,s._switch)(e),n=[],r=0;r<i.length;r++)n[r]=p(i[r],t-1);return n}return d(e)}for(n=[],r=0;r<e.length;r++)n[r]=p(e[r],t-1);return n}}))},80211:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMad=void 0;var n=r(34487),i=r(66212),s=r(60898);const o=["typed","abs","map","median","subtract"];t.createMad=(0,i.factory)("mad",o,(e=>{let{typed:t,abs:r,map:i,median:o,subtract:a}=e;return t("mad",{"Array | Matrix":l,"...":function(e){return l(e)}});function l(e){if(0===(e=(0,n.flatten)(e.valueOf())).length)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{const t=o(e);return o(i(e,(function(e){return r(a(e,t))})))}catch(e){throw e instanceof TypeError&&e.message.includes("median")?new TypeError(e.message.replace("median","mad")):(0,s.improveErrorMessage)(e,"mad")}}}))},79343:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMax=void 0;var n=r(16624),i=r(66212),s=r(34749),o=r(60898);const a=["typed","config","numeric","larger"];t.createMax=(0,i.factory)("max",a,(e=>{let{typed:t,config:r,numeric:i,larger:a}=e;return t("max",{"Array | Matrix":c,"Array | Matrix, number | BigNumber":function(e,t){return(0,n.reduce)(e,t.valueOf(),l)},"...":function(e){if((0,n.containsCollections)(e))throw new TypeError("Scalar values expected in function max");return c(e)}});function l(e,t){try{return a(e,t)?e:t}catch(e){throw(0,o.improveErrorMessage)(e,"max",t)}}function c(e){let t;if((0,n.deepForEach)(e,(function(e){try{isNaN(e)&&"number"==typeof e?t=NaN:(void 0===t||a(e,t))&&(t=e)}catch(t){throw(0,o.improveErrorMessage)(t,"max",e)}})),void 0===t)throw new Error("Cannot calculate max of an empty array");return"string"==typeof t&&(t=i(t,(0,s.safeNumberType)(t,r))),t}}))},4656:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMean=void 0;var n=r(16624),i=r(34487),s=r(66212),o=r(60898);const a="mean",l=["typed","add","divide"];t.createMean=(0,s.factory)(a,l,(e=>{let{typed:t,add:r,divide:s}=e;return t(a,{"Array | Matrix":l,"Array | Matrix, number | BigNumber":function(e,t){try{const o=(0,n.reduce)(e,t,r),a=Array.isArray(e)?(0,i.arraySize)(e):e.size();return s(o,a[t])}catch(e){throw(0,o.improveErrorMessage)(e,"mean")}},"...":function(e){if((0,n.containsCollections)(e))throw new TypeError("Scalar values expected in function mean");return l(e)}});function l(e){let t,i=0;if((0,n.deepForEach)(e,(function(e){try{t=void 0===t?e:r(t,e),i++}catch(t){throw(0,o.improveErrorMessage)(t,"mean",e)}})),0===i)throw new Error("Cannot calculate the mean of an empty array");return s(t,i)}}))},88847:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMedian=void 0;var n=r(16624),i=r(34487),s=r(66212),o=r(60898);const a="median",l=["typed","add","divide","compare","partitionSelect"];t.createMedian=(0,s.factory)(a,l,(e=>{let{typed:t,add:r,divide:s,compare:l,partitionSelect:c}=e;function u(e){try{const t=(e=(0,i.flatten)(e.valueOf())).length;if(0===t)throw new Error("Cannot calculate median of an empty array");if(t%2==0){const r=t/2-1,n=c(e,r+1);let i=e[r];for(let t=0;t<r;++t)l(e[t],i)>0&&(i=e[t]);return h(i,n)}{const r=c(e,(t-1)/2);return d(r)}}catch(e){throw(0,o.improveErrorMessage)(e,"median")}}const d=t({"number | BigNumber | Complex | Unit":function(e){return e}}),h=t({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(e,t){return s(r(e,t),2)}});return t(a,{"Array | Matrix":u,"Array | Matrix, number | BigNumber":function(e,t){throw new Error("median(A, dim) is not yet supported")},"...":function(e){if((0,n.containsCollections)(e))throw new TypeError("Scalar values expected in function median");return u(e)}})}))},93781:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMin=void 0;var n=r(16624),i=r(66212),s=r(34749),o=r(60898);const a=["typed","config","numeric","smaller"];t.createMin=(0,i.factory)("min",a,(e=>{let{typed:t,config:r,numeric:i,smaller:a}=e;return t("min",{"Array | Matrix":c,"Array | Matrix, number | BigNumber":function(e,t){return(0,n.reduce)(e,t.valueOf(),l)},"...":function(e){if((0,n.containsCollections)(e))throw new TypeError("Scalar values expected in function min");return c(e)}});function l(e,t){try{return a(e,t)?e:t}catch(e){throw(0,o.improveErrorMessage)(e,"min",t)}}function c(e){let t;if((0,n.deepForEach)(e,(function(e){try{isNaN(e)&&"number"==typeof e?t=NaN:(void 0===t||a(e,t))&&(t=e)}catch(t){throw(0,o.improveErrorMessage)(t,"min",e)}})),void 0===t)throw new Error("Cannot calculate min of an empty array");return"string"==typeof t&&(t=i(t,(0,s.safeNumberType)(t,r))),t}}))},2358:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMode=void 0;var n=r(34487),i=r(66212);const s="mode",o=["typed","isNaN","isNumeric"];t.createMode=(0,i.factory)(s,o,(e=>{let{typed:t,isNaN:r,isNumeric:i}=e;return t(s,{"Array | Matrix":o,"...":function(e){return o(e)}});function o(e){if(0===(e=(0,n.flatten)(e.valueOf())).length)throw new Error("Cannot calculate mode of an empty array");const t={};let s=[],o=0;for(let n=0;n<e.length;n++){const a=e[n];if(i(a)&&r(a))throw new Error("Cannot calculate mode of an array containing NaN values");a in t||(t[a]=0),t[a]++,t[a]===o?s.push(a):t[a]>o&&(o=t[a],s=[a])}return s}}))},9384:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createProd=void 0;var n=r(16624),i=r(66212),s=r(34749),o=r(60898);const a="prod",l=["typed","config","multiplyScalar","numeric"];t.createProd=(0,i.factory)(a,l,(e=>{let{typed:t,config:r,multiplyScalar:i,numeric:l}=e;return t(a,{"Array | Matrix":c,"Array | Matrix, number | BigNumber":function(e,t){throw new Error("prod(A, dim) is not yet supported")},"...":function(e){return c(e)}});function c(e){let t;if((0,n.deepForEach)(e,(function(e){try{t=void 0===t?e:i(t,e)}catch(t){throw(0,o.improveErrorMessage)(t,"prod",e)}})),"string"==typeof t&&(t=l(t,(0,s.safeNumberType)(t,r))),void 0===t)throw new Error("Cannot calculate prod of an empty array");return t}}))},83933:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createQuantileSeq=void 0;var n=r(91612),i=r(34487),s=r(66212),o=r(92595);const a="quantileSeq",l=["typed","?bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"];t.createQuantileSeq=(0,s.factory)(a,l,(e=>{let{typed:t,bignumber:r,add:s,subtract:l,divide:c,multiply:u,partitionSelect:d,compare:h,isInteger:p,smaller:m,smallerEq:f,larger:g}=e;const y=(0,o.createApply)({typed:t,isInteger:p});return t(a,{"Array | Matrix, number | BigNumber":(e,t)=>v(e,t,!1),"Array | Matrix, number | BigNumber, number":(e,t,r)=>b(e,t,!1,r,v),"Array | Matrix, number | BigNumber, boolean":v,"Array | Matrix, number | BigNumber, boolean, number":(e,t,r,n)=>b(e,t,r,n,v),"Array | Matrix, Array | Matrix":(e,t)=>_(e,t,!1),"Array | Matrix, Array | Matrix, number":(e,t,r)=>b(e,t,!1,r,_),"Array | Matrix, Array | Matrix, boolean":_,"Array | Matrix, Array | Matrix, boolean, number":(e,t,r,n)=>b(e,t,r,n,_)});function b(e,t,r,n,i){return y(e,n,(e=>i(e,t,r)))}function v(e,t,i){let o;const a=e.valueOf();if(m(t,0))throw new Error("N/prob must be non-negative");if(f(t,1))return(0,n.isNumber)(t)?x(a,t,i):r(x(a,t,i));if(g(t,1)){if(!p(t))throw new Error("N must be a positive integer");if(g(t,4294967295))throw new Error("N must be less than or equal to 2^32-1, as that is the maximum length of an Array");const e=s(t,1);o=[];for(let r=0;m(r,t);r++){const t=c(r+1,e);o.push(x(a,t,i))}return(0,n.isNumber)(t)?o:r(o)}}function _(e,t,r){const n=e.valueOf(),i=t.valueOf(),s=[];for(let e=0;e<i.length;++e)s.push(x(n,i[e],r));return s}function x(e,t,r){const o=(0,i.flatten)(e),a=o.length;if(0===a)throw new Error("Cannot calculate quantile of an empty sequence");const c=(0,n.isNumber)(t)?t*(a-1):t.times(a-1),m=(0,n.isNumber)(t)?Math.floor(c):c.floor().toNumber(),f=(0,n.isNumber)(t)?c%1:c.minus(m);if(p(c))return r?o[c]:d(o,(0,n.isNumber)(t)?c:c.valueOf());let g,y;if(r)g=o[m],y=o[m+1];else{y=d(o,m+1),g=o[m];for(let e=0;e<m;++e)h(o[e],g)>0&&(g=o[e])}return s(u(g,l(1,f)),u(y,f))}}))},94620:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createStd=void 0;var n=r(66212),i=r(91612);const s=["typed","map","sqrt","variance"];t.createStd=(0,n.factory)("std",s,(e=>{let{typed:t,map:r,sqrt:n,variance:s}=e;return t("std",{"Array | Matrix":o,"Array | Matrix, string":o,"Array | Matrix, number | BigNumber":o,"Array | Matrix, number | BigNumber, string":o,"...":function(e){return o(e)}});function o(e,t){if(0===e.length)throw new SyntaxError("Function std requires one or more parameters (0 provided)");try{const e=s.apply(null,arguments);return(0,i.isCollection)(e)?r(e,n):n(e)}catch(e){throw e instanceof TypeError&&e.message.includes(" variance")?new TypeError(e.message.replace(" variance"," std")):e}}}))},40850:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSum=void 0;var n=r(16624),i=r(66212),s=r(34749),o=r(60898);const a=["typed","config","add","numeric"];t.createSum=(0,i.factory)("sum",a,(e=>{let{typed:t,config:r,add:i,numeric:a}=e;return t("sum",{"Array | Matrix":l,"Array | Matrix, number | BigNumber":function(e,t){try{return(0,n.reduce)(e,t,i)}catch(e){throw(0,o.improveErrorMessage)(e,"sum")}},"...":function(e){if((0,n.containsCollections)(e))throw new TypeError("Scalar values expected in function sum");return l(e)}});function l(e){let t;return(0,n.deepForEach)(e,(function(e){try{t=void 0===t?e:i(t,e)}catch(t){throw(0,o.improveErrorMessage)(t,"sum",e)}})),void 0===t&&(t=a(0,r.number)),"string"==typeof t&&(t=a(t,(0,s.safeNumberType)(t,r))),t}}))},60898:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.improveErrorMessage=function(e,t,r){let i;if(String(e).includes("Unexpected type"))return i=arguments.length>2?" (type: "+(0,n.typeOf)(r)+", value: "+JSON.stringify(r)+")":" (type: "+e.data.actual+")",new TypeError("Cannot calculate "+t+", unexpected type of argument"+i);if(String(e).includes("complex numbers"))return i=arguments.length>2?" (type: "+(0,n.typeOf)(r)+", value: "+JSON.stringify(r)+")":"",new TypeError("Cannot calculate "+t+", no ordering relation is defined for complex numbers"+i);return e};var n=r(91612)},22058:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createVariance=void 0;var n=r(16624),i=r(91612),s=r(66212),o=r(60898);const a="unbiased",l="variance",c=["typed","add","subtract","multiply","divide","apply","isNaN"];t.createVariance=(0,s.factory)(l,c,(e=>{let{typed:t,add:r,subtract:s,multiply:c,divide:u,apply:d,isNaN:h}=e;return t(l,{"Array | Matrix":function(e){return p(e,a)},"Array | Matrix, string":p,"Array | Matrix, number | BigNumber":function(e,t){return m(e,t,a)},"Array | Matrix, number | BigNumber, string":m,"...":function(e){return p(e,a)}});function p(e,t){let a,l=0;if(0===e.length)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if((0,n.deepForEach)(e,(function(e){try{a=void 0===a?e:r(a,e),l++}catch(t){throw(0,o.improveErrorMessage)(t,"variance",e)}})),0===l)throw new Error("Cannot calculate variance of an empty array");const d=u(a,l);if(a=void 0,(0,n.deepForEach)(e,(function(e){const t=s(e,d);a=void 0===a?c(t,t):r(a,c(t,t))})),h(a))return a;switch(t){case"uncorrected":return u(a,l);case"biased":return u(a,l+1);case"unbiased":{const e=(0,i.isBigNumber)(a)?a.mul(0):0;return 1===l?e:u(a,l-1)}default:throw new Error('Unknown normalization "'+t+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function m(e,t,r){try{if(0===e.length)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return d(e,t,(e=>p(e,r)))}catch(e){throw(0,o.improveErrorMessage)(e,"variance")}}}))},90358:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createBin=void 0;var n=r(66212);t.createBin=(0,n.factory)("bin",["typed","format"],(e=>{let{typed:t,format:r}=e;return t("bin",{"number | BigNumber":function(e){return r(e,{notation:"bin"})},"number | BigNumber, number | BigNumber":function(e,t){return r(e,{notation:"bin",wordSize:t})}})}))},53052:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createFormat=void 0;var n=r(7041),i=r(66212);const s="format",o=["typed"];t.createFormat=(0,i.factory)(s,o,(e=>{let{typed:t}=e;return t(s,{any:n.format,"any, Object | function | number | BigNumber":n.format})}))},31938:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createHex=void 0;var n=r(66212);t.createHex=(0,n.factory)("hex",["typed","format"],(e=>{let{typed:t,format:r}=e;return t("hex",{"number | BigNumber":function(e){return r(e,{notation:"hex"})},"number | BigNumber, number | BigNumber":function(e,t){return r(e,{notation:"hex",wordSize:t})}})}))},77777:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createOct=void 0;var n=r(66212);t.createOct=(0,n.factory)("oct",["typed","format"],(e=>{let{typed:t,format:r}=e;return t("oct",{"number | BigNumber":function(e){return r(e,{notation:"oct"})},"number | BigNumber, number | BigNumber":function(e,t){return r(e,{notation:"oct",wordSize:t})}})}))},43160:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createPrint=void 0;var n=r(7041),i=r(91612),s=r(66212),o=r(34933);const a="print",l=["typed"];t.createPrint=(0,s.factory)(a,l,(e=>{let{typed:t}=e;return t(a,{"string, Object | Array":c,"string, Object | Array, number | Object":c})}));function c(e,t,r){return e.replace(o.printTemplate,(function(e,s){const o=s.split(".");let a=t[o.shift()];for(void 0!==a&&a.isMatrix&&(a=a.toArray());o.length&&void 0!==a;){const e=o.shift();a=e?a[e]:a+"."}return void 0!==a?(0,i.isString)(a)?a:(0,n.format)(a,r):e}))}},72171:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAcos=void 0;var n=r(66212);const i="acos",s=["typed","config","Complex"];t.createAcos=(0,n.factory)(i,s,(e=>{let{typed:t,config:r,Complex:n}=e;return t(i,{number:function(e){return e>=-1&&e<=1||r.predictable?Math.acos(e):new n(e,0).acos()},Complex:function(e){return e.acos()},BigNumber:function(e){return e.acos()}})}))},51395:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAcosh=void 0;var n=r(66212),i=r(30369);const s="acosh",o=["typed","config","Complex"];t.createAcosh=(0,n.factory)(s,o,(e=>{let{typed:t,config:r,Complex:n}=e;return t(s,{number:function(e){return e>=1||r.predictable?(0,i.acoshNumber)(e):e<=-1?new n(Math.log(Math.sqrt(e*e-1)-e),Math.PI):new n(e,0).acosh()},Complex:function(e){return e.acosh()},BigNumber:function(e){return e.acosh()}})}))},28738:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAcot=void 0;var n=r(66212),i=r(30369);const s="acot",o=["typed","BigNumber"];t.createAcot=(0,n.factory)(s,o,(e=>{let{typed:t,BigNumber:r}=e;return t(s,{number:i.acotNumber,Complex:function(e){return e.acot()},BigNumber:function(e){return new r(1).div(e).atan()}})}))},40624:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAcoth=void 0;var n=r(66212),i=r(30369);const s="acoth",o=["typed","config","Complex","BigNumber"];t.createAcoth=(0,n.factory)(s,o,(e=>{let{typed:t,config:r,Complex:n,BigNumber:o}=e;return t(s,{number:function(e){return e>=1||e<=-1||r.predictable?(0,i.acothNumber)(e):new n(e,0).acoth()},Complex:function(e){return e.acoth()},BigNumber:function(e){return new o(1).div(e).atanh()}})}))},72815:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAcsc=void 0;var n=r(66212),i=r(30369);const s="acsc",o=["typed","config","Complex","BigNumber"];t.createAcsc=(0,n.factory)(s,o,(e=>{let{typed:t,config:r,Complex:n,BigNumber:o}=e;return t(s,{number:function(e){return e<=-1||e>=1||r.predictable?(0,i.acscNumber)(e):new n(e,0).acsc()},Complex:function(e){return e.acsc()},BigNumber:function(e){return new o(1).div(e).asin()}})}))},68655:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAcsch=void 0;var n=r(66212),i=r(30369);const s="acsch",o=["typed","BigNumber"];t.createAcsch=(0,n.factory)(s,o,(e=>{let{typed:t,BigNumber:r}=e;return t(s,{number:i.acschNumber,Complex:function(e){return e.acsch()},BigNumber:function(e){return new r(1).div(e).asinh()}})}))},12493:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAsec=void 0;var n=r(66212),i=r(30369);const s="asec",o=["typed","config","Complex","BigNumber"];t.createAsec=(0,n.factory)(s,o,(e=>{let{typed:t,config:r,Complex:n,BigNumber:o}=e;return t(s,{number:function(e){return e<=-1||e>=1||r.predictable?(0,i.asecNumber)(e):new n(e,0).asec()},Complex:function(e){return e.asec()},BigNumber:function(e){return new o(1).div(e).acos()}})}))},2409:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAsech=void 0;var n=r(66212),i=r(30369);const s="asech",o=["typed","config","Complex","BigNumber"];t.createAsech=(0,n.factory)(s,o,(e=>{let{typed:t,config:r,Complex:n,BigNumber:o}=e;return t(s,{number:function(e){if(e<=1&&e>=-1||r.predictable){const t=1/e;if(t>0||r.predictable)return(0,i.asechNumber)(e);const s=Math.sqrt(t*t-1);return new n(Math.log(s-t),Math.PI)}return new n(e,0).asech()},Complex:function(e){return e.asech()},BigNumber:function(e){return new o(1).div(e).acosh()}})}))},75126:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAsin=void 0;var n=r(66212);const i="asin",s=["typed","config","Complex"];t.createAsin=(0,n.factory)(i,s,(e=>{let{typed:t,config:r,Complex:n}=e;return t(i,{number:function(e){return e>=-1&&e<=1||r.predictable?Math.asin(e):new n(e,0).asin()},Complex:function(e){return e.asin()},BigNumber:function(e){return e.asin()}})}))},23132:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAsinh=void 0;var n=r(66212),i=r(30369);const s=["typed"];t.createAsinh=(0,n.factory)("asinh",s,(e=>{let{typed:t}=e;return t("asinh",{number:i.asinhNumber,Complex:function(e){return e.asinh()},BigNumber:function(e){return e.asinh()}})}))},39815:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAtan=void 0;var n=r(66212);const i=["typed"];t.createAtan=(0,n.factory)("atan",i,(e=>{let{typed:t}=e;return t("atan",{number:function(e){return Math.atan(e)},Complex:function(e){return e.atan()},BigNumber:function(e){return e.atan()}})}))},57825:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAtan2=void 0;var n=r(66212),i=r(98225),s=r(89164),o=r(12485),a=r(73670),l=r(47993),c=r(11279);const u="atan2",d=["typed","matrix","equalScalar","BigNumber","DenseMatrix","concat"];t.createAtan2=(0,n.factory)(u,d,(e=>{let{typed:t,matrix:r,equalScalar:n,BigNumber:d,DenseMatrix:h,concat:p}=e;const m=(0,i.createMatAlgo02xDS0)({typed:t,equalScalar:n}),f=(0,s.createMatAlgo03xDSf)({typed:t}),g=(0,o.createMatAlgo09xS0Sf)({typed:t,equalScalar:n}),y=(0,a.createMatAlgo11xS0s)({typed:t,equalScalar:n}),b=(0,l.createMatAlgo12xSfs)({typed:t,DenseMatrix:h}),v=(0,c.createMatrixAlgorithmSuite)({typed:t,matrix:r,concat:p});return t(u,{"number, number":Math.atan2,"BigNumber, BigNumber":(e,t)=>d.atan2(e,t)},v({scalar:"number | BigNumber",SS:g,DS:f,SD:m,Ss:y,sS:b}))}))},14439:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAtanh=void 0;var n=r(66212),i=r(30369);const s="atanh",o=["typed","config","Complex"];t.createAtanh=(0,n.factory)(s,o,(e=>{let{typed:t,config:r,Complex:n}=e;return t(s,{number:function(e){return e<=1&&e>=-1||r.predictable?(0,i.atanhNumber)(e):new n(e,0).atanh()},Complex:function(e){return e.atanh()},BigNumber:function(e){return e.atanh()}})}))},33218:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCos=void 0;var n=r(66212),i=r(13241);const s=["typed"];t.createCos=(0,n.factory)("cos",s,(e=>{let{typed:t}=e;const r=(0,i.createTrigUnit)({typed:t});return t("cos",{number:Math.cos,"Complex | BigNumber":e=>e.cos()},r)}))},67920:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCosh=void 0;var n=r(66212),i=r(34749);const s="cosh",o=["typed"];t.createCosh=(0,n.factory)(s,o,(e=>{let{typed:t}=e;return t(s,{number:i.cosh,"Complex | BigNumber":e=>e.cosh()})}))},19179:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCot=void 0;var n=r(66212),i=r(30369),s=r(13241);const o=["typed","BigNumber"];t.createCot=(0,n.factory)("cot",o,(e=>{let{typed:t,BigNumber:r}=e;const n=(0,s.createTrigUnit)({typed:t});return t("cot",{number:i.cotNumber,Complex:e=>e.cot(),BigNumber:e=>new r(1).div(e.tan())},n)}))},97923:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCoth=void 0;var n=r(66212),i=r(30369);const s="coth",o=["typed","BigNumber"];t.createCoth=(0,n.factory)(s,o,(e=>{let{typed:t,BigNumber:r}=e;return t(s,{number:i.cothNumber,Complex:e=>e.coth(),BigNumber:e=>new r(1).div(e.tanh())})}))},70638:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCsc=void 0;var n=r(66212),i=r(30369),s=r(13241);const o=["typed","BigNumber"];t.createCsc=(0,n.factory)("csc",o,(e=>{let{typed:t,BigNumber:r}=e;const n=(0,s.createTrigUnit)({typed:t});return t("csc",{number:i.cscNumber,Complex:e=>e.csc(),BigNumber:e=>new r(1).div(e.sin())},n)}))},41492:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCsch=void 0;var n=r(66212),i=r(30369);const s="csch",o=["typed","BigNumber"];t.createCsch=(0,n.factory)(s,o,(e=>{let{typed:t,BigNumber:r}=e;return t(s,{number:i.cschNumber,Complex:e=>e.csch(),BigNumber:e=>new r(1).div(e.sinh())})}))},49940:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSec=void 0;var n=r(66212),i=r(30369),s=r(13241);const o=["typed","BigNumber"];t.createSec=(0,n.factory)("sec",o,(e=>{let{typed:t,BigNumber:r}=e;const n=(0,s.createTrigUnit)({typed:t});return t("sec",{number:i.secNumber,Complex:e=>e.sec(),BigNumber:e=>new r(1).div(e.cos())},n)}))},77382:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSech=void 0;var n=r(66212),i=r(30369);const s="sech",o=["typed","BigNumber"];t.createSech=(0,n.factory)(s,o,(e=>{let{typed:t,BigNumber:r}=e;return t(s,{number:i.sechNumber,Complex:e=>e.sech(),BigNumber:e=>new r(1).div(e.cosh())})}))},93083:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSin=void 0;var n=r(66212),i=r(13241);const s=["typed"];t.createSin=(0,n.factory)("sin",s,(e=>{let{typed:t}=e;const r=(0,i.createTrigUnit)({typed:t});return t("sin",{number:Math.sin,"Complex | BigNumber":e=>e.sin()},r)}))},57747:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSinh=void 0;var n=r(66212),i=r(30369);const s="sinh",o=["typed"];t.createSinh=(0,n.factory)(s,o,(e=>{let{typed:t}=e;return t(s,{number:i.sinhNumber,"Complex | BigNumber":e=>e.sinh()})}))},75826:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createTan=void 0;var n=r(66212),i=r(13241);const s=["typed"];t.createTan=(0,n.factory)("tan",s,(e=>{let{typed:t}=e;const r=(0,i.createTrigUnit)({typed:t});return t("tan",{number:Math.tan,"Complex | BigNumber":e=>e.tan()},r)}))},59392:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createTanh=void 0;var n=r(66212),i=r(34749);const s=["typed"];t.createTanh=(0,n.factory)("tanh",s,(e=>{let{typed:t}=e;return t("tanh",{number:i.tanh,"Complex | BigNumber":e=>e.tanh()})}))},13241:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createTrigUnit=void 0;var n=r(66212);t.createTrigUnit=(0,n.factory)("trigUnit",["typed"],(e=>{let{typed:t}=e;return{Unit:t.referToSelf((e=>r=>{if(!r.hasBase(r.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return t.find(e,r.valueType())(r.value)}))}}))},57151:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createTo=void 0;var n=r(66212),i=r(11279);const s=["typed","matrix","concat"];t.createTo=(0,n.factory)("to",s,(e=>{let{typed:t,matrix:r,concat:n}=e;return t("to",{"Unit, Unit | string":(e,t)=>e.to(t)},(0,i.createMatrixAlgorithmSuite)({typed:t,matrix:r,concat:n})({Ds:!0}))}))},39966:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createClone=void 0;var n=r(61175),i=r(66212);const s="clone",o=["typed"];t.createClone=(0,i.factory)(s,o,(e=>{let{typed:t}=e;return t(s,{any:n.clone})}))},98447:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createHasNumericValue=void 0;var n=r(66212);const i="hasNumericValue",s=["typed","isNumeric"];t.createHasNumericValue=(0,n.factory)(i,s,(e=>{let{typed:t,isNumeric:r}=e;return t(i,{boolean:()=>!0,string:function(e){return e.trim().length>0&&!isNaN(Number(e))},any:function(e){return r(e)}})}))},17533:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createIsInteger=void 0;var n=r(16624),i=r(34749),s=r(66212);const o="isInteger",a=["typed"];t.createIsInteger=(0,s.factory)(o,a,(e=>{let{typed:t}=e;return t(o,{number:i.isInteger,BigNumber:function(e){return e.isInt()},bigint:function(e){return!0},Fraction:function(e){return 1===e.d&&isFinite(e.n)},"Array | Matrix":t.referToSelf((e=>t=>(0,n.deepMap)(t,e)))})}))},77174:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createIsNaN=void 0;var n=r(16624),i=r(66212),s=r(30369);const o="isNaN",a=["typed"];t.createIsNaN=(0,i.factory)(o,a,(e=>{let{typed:t}=e;return t(o,{number:s.isNaNNumber,BigNumber:function(e){return e.isNaN()},bigint:function(e){return!1},Fraction:function(e){return!1},Complex:function(e){return e.isNaN()},Unit:function(e){return Number.isNaN(e.value)},"Array | Matrix":t.referToSelf((e=>t=>(0,n.deepMap)(t,e)))})}))},32524:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createIsNegative=void 0;var n=r(16624),i=r(66212),s=r(30369),o=r(67625),a=r(34749);const l="isNegative",c=["typed","config"];t.createIsNegative=(0,i.factory)(l,c,(e=>{let{typed:t,config:r}=e;return t(l,{number:e=>!(0,a.nearlyEqual)(e,0,r.relTol,r.absTol)&&(0,s.isNegativeNumber)(e),BigNumber:e=>!(0,o.nearlyEqual)(e,new e.constructor(0),r.relTol,r.absTol)&&(e.isNeg()&&!e.isZero()&&!e.isNaN()),bigint:e=>e<0n,Fraction:e=>e.s<0,Unit:t.referToSelf((e=>r=>t.find(e,r.valueType())(r.value))),"Array | Matrix":t.referToSelf((e=>t=>(0,n.deepMap)(t,e)))})}))},28824:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createIsNumeric=void 0;var n=r(16624),i=r(66212);const s="isNumeric",o=["typed"];t.createIsNumeric=(0,i.factory)(s,o,(e=>{let{typed:t}=e;return t(s,{"number | BigNumber | bigint | Fraction | boolean":()=>!0,"Complex | Unit | string | null | undefined | Node":()=>!1,"Array | Matrix":t.referToSelf((e=>t=>(0,n.deepMap)(t,e)))})}))},51080:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createIsPositive=void 0;var n=r(16624),i=r(66212),s=r(30369),o=r(67625),a=r(34749);const l="isPositive",c=["typed","config"];t.createIsPositive=(0,i.factory)(l,c,(e=>{let{typed:t,config:r}=e;return t(l,{number:e=>!(0,a.nearlyEqual)(e,0,r.relTol,r.absTol)&&(0,s.isPositiveNumber)(e),BigNumber:e=>!(0,o.nearlyEqual)(e,new e.constructor(0),r.relTol,r.absTol)&&(!e.isNeg()&&!e.isZero()&&!e.isNaN()),bigint:e=>e>0n,Fraction:e=>e.s>0&&e.n>0,Unit:t.referToSelf((e=>r=>t.find(e,r.valueType())(r.value))),"Array | Matrix":t.referToSelf((e=>t=>(0,n.deepMap)(t,e)))})}))},78132:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createIsPrime=void 0;var n=r(16624),i=r(66212);const s="isPrime",o=["typed"];t.createIsPrime=(0,i.factory)(s,o,(e=>{let{typed:t}=e;return t(s,{number:function(e){if(e<=3)return e>1;if(e%2==0||e%3==0)return!1;for(let t=5;t*t<=e;t+=6)if(e%t==0||e%(t+2)==0)return!1;return!0},bigint:function(e){if(e<=3n)return e>1n;if(e%2n===0n||e%3n===0n)return!1;for(let t=5n;t*t<=e;t+=6n)if(e%t===0n||e%(t+2n)===0n)return!1;return!0},BigNumber:function(e){if(e.lte(3))return e.gt(1);if(e.mod(2).eq(0)||e.mod(3).eq(0))return!1;if(e.lt(Math.pow(2,32))){const t=e.toNumber();for(let e=5;e*e<=t;e+=6)if(t%e==0||t%(e+2)==0)return!1;return!0}function t(e,t,r){let n=1;for(;!t.eq(0);)t.mod(2).eq(0)?(t=t.div(2),e=e.mul(e).mod(r)):(t=t.sub(1),n=e.mul(n).mod(r));return n}const r=e.constructor.clone({precision:2*e.toFixed(0).length});let n=0,i=(e=new r(e)).sub(1);for(;i.mod(2).eq(0);)i=i.div(2),n+=1;let s=null;if(e.lt("3317044064679887385961981"))s=[2,3,5,7,11,13,17,19,23,29,31,37,41].filter((t=>t<e));else{const t=Math.min(e.toNumber()-2,Math.floor(2*Math.pow(e.toFixed(0).length*Math.log(10),2)));s=[];for(let e=2;e<=t;e+=1)s.push(t)}for(let r=0;r<s.length;r+=1){const o=s[r],a=t(e.sub(e).add(o),i,e);if(!a.eq(1))for(let t=0,r=a;!r.eq(e.sub(1));t+=1,r=r.mul(r).mod(e))if(t===n-1)return!1}return!0},"Array | Matrix":t.referToSelf((e=>t=>(0,n.deepMap)(t,e)))})}))},45477:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createIsZero=void 0;var n=r(16624),i=r(66212);const s="isZero",o=["typed","equalScalar"];t.createIsZero=(0,i.factory)(s,o,(e=>{let{typed:t,equalScalar:r}=e;return t(s,{"number | BigNumber | Complex | Fraction":e=>r(e,0),bigint:e=>0n===e,Unit:t.referToSelf((e=>r=>t.find(e,r.valueType())(r.value))),"Array | Matrix":t.referToSelf((e=>t=>(0,n.deepMap)(t,e)))})}))},64720:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createNumeric=void 0;var n=r(91612),i=r(66212),s=r(10604);const o=["number","?bignumber","?fraction"];t.createNumeric=(0,i.factory)("numeric",o,(e=>{let{number:t,bignumber:r,fraction:i}=e;const o={string:!0,number:!0,BigNumber:!0,Fraction:!0},a={number:e=>t(e),BigNumber:r?e=>r(e):s.noBignumber,bigint:e=>BigInt(e),Fraction:i?e=>i(e):s.noFraction};return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"number";if(void 0!==(arguments.length>2?arguments[2]:void 0))throw new SyntaxError("numeric() takes one or two arguments");const r=(0,n.typeOf)(e);if(!(r in o))throw new TypeError("Cannot convert "+e+' of type "'+r+'"; valid input types are '+Object.keys(o).join(", "));if(!(t in a))throw new TypeError("Cannot convert "+e+' to type "'+t+'"; valid output types are '+Object.keys(a).join(", "));return t===r?e:a[t](e)}}))},35866:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createTypeOf=void 0;var n=r(66212),i=r(91612);const s="typeOf",o=["typed"];t.createTypeOf=(0,n.factory)(s,o,(e=>{let{typed:t}=e;return t(s,{any:i.typeOf})}))},63768:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(38042);Object.keys(n).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===n[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return n[e]}}))}))},66813:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createReplacer=void 0;var n=r(66212);const i=[];t.createReplacer=(0,n.factory)("replacer",i,(()=>function(e,t){return"number"!=typeof t||isFinite(t)&&!isNaN(t)?"bigint"==typeof t?{mathjs:"bigint",value:String(t)}:t:{mathjs:"number",value:String(t)}}))},77910:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createReviver=void 0;var n=r(66212);const i=["classes"];t.createReviver=(0,n.factory)("reviver",i,(e=>{let{classes:t}=e;return function(e,r){const n=t[r&&r.mathjs];return n&&"function"==typeof n.fromJSON?n.fromJSON(r):r}}))},94937:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.absNumber=o,t.addNumber=a,t.cbrtNumber=p,t.cubeNumber=m,t.divideNumber=u,t.expNumber=f,t.expm1Number=g,t.gcdNumber=y,t.lcmNumber=b,t.log10Number=v,t.log1pNumber=x,t.log2Number=_,t.logNumber=function(e,t){if(t)return Math.log(e)/Math.log(t);return Math.log(e)},t.modNumber=w,t.multiplyNumber=c,t.normNumber=$,t.nthRootNumber=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;const r=t<0;r&&(t=-t);if(0===t)throw new Error("Root must be non-zero");if(e<0&&Math.abs(t)%2!=1)throw new Error("Root must be odd when a is negative.");if(0===e)return r?1/0:0;if(!isFinite(e))return r?0:e;let n=Math.pow(Math.abs(e),1/t);return n=e<0?-n:n,r?1/n:n},t.powNumber=q,t.roundNumber=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!(0,n.isInteger)(t)||t<0||t>15)throw new Error("Number of decimals in function round must be an integer from 0 to 15 inclusive");return parseFloat((0,n.toFixed)(e,t))},t.signNumber=R,t.sqrtNumber=k,t.squareNumber=j,t.subtractNumber=l,t.unaryMinusNumber=d,t.unaryPlusNumber=h,t.xgcdNumber=z;var n=r(34749);const i="number",s="number, number";function o(e){return Math.abs(e)}function a(e,t){return e+t}function l(e,t){return e-t}function c(e,t){return e*t}function u(e,t){return e/t}function d(e){return-e}function h(e){return e}function p(e){return(0,n.cbrt)(e)}function m(e){return e*e*e}function f(e){return Math.exp(e)}function g(e){return(0,n.expm1)(e)}function y(e,t){if(!(0,n.isInteger)(e)||!(0,n.isInteger)(t))throw new Error("Parameters in function gcd must be integer numbers");let r;for(;0!==t;)r=e%t,e=t,t=r;return e<0?-e:e}function b(e,t){if(!(0,n.isInteger)(e)||!(0,n.isInteger)(t))throw new Error("Parameters in function lcm must be integer numbers");if(0===e||0===t)return 0;let r;const i=e*t;for(;0!==t;)r=t,t=e%r,e=r;return Math.abs(i/e)}function v(e){return(0,n.log10)(e)}function _(e){return(0,n.log2)(e)}function x(e){return(0,n.log1p)(e)}function w(e,t){return 0===t?e:e-t*Math.floor(e/t)}function R(e){return(0,n.sign)(e)}function k(e){return Math.sqrt(e)}function j(e){return e*e}function z(e,t){let r,i,s,o,a=0,l=1,c=1,u=0;if(!(0,n.isInteger)(e)||!(0,n.isInteger)(t))throw new Error("Parameters in function xgcd must be integer numbers");for(;t;)i=Math.floor(e/t),s=e-i*t,r=a,a=l-i*a,l=r,r=c,c=u-i*c,u=r,e=t,t=s;return o=e<0?[-e,-l,-u]:[e,e?l:0,u],o}function q(e,t){return e*e<1&&t===1/0||e*e>1&&t===-1/0?0:Math.pow(e,t)}function $(e){return Math.abs(e)}o.signature=i,a.signature=s,l.signature=s,c.signature=s,u.signature=s,d.signature=i,h.signature=i,p.signature=i,m.signature=i,f.signature=i,g.signature=i,y.signature=s,b.signature=s,v.signature=i,_.signature=i,x.signature=i,w.signature=s,R.signature=i,k.signature=i,j.signature=i,z.signature=s,q.signature=s,$.signature=i},73382:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bitAndNumber=s,t.bitNotNumber=o,t.bitOrNumber=a,t.bitXorNumber=l,t.leftShiftNumber=c,t.rightArithShiftNumber=u,t.rightLogShiftNumber=d;var n=r(34749);const i="number, number";function s(e,t){if(!(0,n.isInteger)(e)||!(0,n.isInteger)(t))throw new Error("Integers expected in function bitAnd");return e&t}function o(e){if(!(0,n.isInteger)(e))throw new Error("Integer expected in function bitNot");return~e}function a(e,t){if(!(0,n.isInteger)(e)||!(0,n.isInteger)(t))throw new Error("Integers expected in function bitOr");return e|t}function l(e,t){if(!(0,n.isInteger)(e)||!(0,n.isInteger)(t))throw new Error("Integers expected in function bitXor");return e^t}function c(e,t){if(!(0,n.isInteger)(e)||!(0,n.isInteger)(t))throw new Error("Integers expected in function leftShift");return e<<t}function u(e,t){if(!(0,n.isInteger)(e)||!(0,n.isInteger)(t))throw new Error("Integers expected in function rightArithShift");return e>>t}function d(e,t){if(!(0,n.isInteger)(e)||!(0,n.isInteger)(t))throw new Error("Integers expected in function rightLogShift");return e>>>t}s.signature=i,o.signature="number",a.signature=i,l.signature=i,c.signature=i,u.signature=i,d.signature=i},69717:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combinationsNumber=s;var n=r(34749),i=r(98189);function s(e,t){if(!(0,n.isInteger)(e)||e<0)throw new TypeError("Positive integer value expected in function combinations");if(!(0,n.isInteger)(t)||t<0)throw new TypeError("Positive integer value expected in function combinations");if(t>e)throw new TypeError("k must be less than or equal to n");const r=e-t;let s=1;let o=2;const a=t<r?t:r;for(let n=t<r?r+1:t+1;n<=e;++n)for(s*=n;o<=a&&s%o==0;)s/=o,++o;return o<=a&&(s/=(0,i.product)(o,a)),s}s.signature="number, number"},82440:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tau=t.pi=t.phi=t.e=void 0;t.pi=Math.PI,t.tau=2*Math.PI,t.e=Math.E,t.phi=1.618033988749895},30369:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(94937);Object.keys(n).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===n[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return n[e]}}))}));var i=r(73382);Object.keys(i).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===i[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}}))}));var s=r(69717);Object.keys(s).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===s[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}}))}));var o=r(82440);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))}));var a=r(66902);Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===a[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}}))}));var l=r(13580);Object.keys(l).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===l[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return l[e]}}))}));var c=r(39302);Object.keys(c).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===c[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return c[e]}}))}));var u=r(39078);Object.keys(u).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===u[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return u[e]}}))}));var d=r(67276);Object.keys(d).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===d[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return d[e]}}))}))},66902:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.andNumber=o,t.notNumber=n,t.orNumber=i,t.xorNumber=s;const r="number, number";function n(e){return!e}function i(e,t){return!(!e&&!t)}function s(e,t){return!!e!=!!t}function o(e,t){return!(!e||!t)}n.signature="number",i.signature=r,s.signature=r,o.signature=r},39302:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gammaG=void 0,t.gammaNumber=s,t.lgammaN=t.lgammaG=t.gammaP=void 0,t.lgammaNumber=h,t.lnSqrt2PI=t.lgammaSeries=void 0;var n=r(34749),i=r(98189);function s(e){let t;if((0,n.isInteger)(e))return e<=0?isFinite(e)?1/0:NaN:e>171?1/0:(0,i.product)(1,e-1);if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*s(1-e));if(e>=171.35)return 1/0;if(e>85){const t=e*e,r=t*e,n=r*e,i=n*e;return Math.sqrt(2*Math.PI/e)*Math.pow(e/Math.E,e)*(1+1/(12*e)+1/(288*t)-139/(51840*r)-571/(2488320*n)+163879/(209018880*i)+5246819/(75246796800*i*e))}--e,t=a[0];for(let r=1;r<a.length;++r)t+=a[r]/(e+r);const r=e+o+.5;return Math.sqrt(2*Math.PI)*Math.pow(r,e+.5)*Math.exp(-r)*t}s.signature="number";const o=t.gammaG=4.7421875,a=t.gammaP=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22],l=t.lnSqrt2PI=.9189385332046728,c=t.lgammaG=5,u=t.lgammaN=7,d=t.lgammaSeries=[1.000000000190015,76.18009172947146,-86.50532032941678,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18];function h(e){if(e<0)return NaN;if(0===e)return 1/0;if(!isFinite(e))return e;if(e<.5)return Math.log(Math.PI/Math.sin(Math.PI*e))-h(1-e);const t=(e-=1)+c+.5;let r=d[0];for(let t=u-1;t>=1;t--)r+=d[t]/(e+t);return l+(e+.5)*Math.log(t)-t+Math.log(r)}h.signature="number"},13580:()=>{},39078:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.acosNumber=s,t.acoshNumber=o,t.acotNumber=a,t.acothNumber=l,t.acscNumber=c,t.acschNumber=u,t.asecNumber=d,t.asechNumber=h,t.asinNumber=p,t.asinhNumber=m,t.atan2Number=g,t.atanNumber=f,t.atanhNumber=y,t.cosNumber=b,t.coshNumber=v,t.cotNumber=_,t.cothNumber=x,t.cscNumber=w,t.cschNumber=R,t.secNumber=k,t.sechNumber=j,t.sinNumber=z,t.sinhNumber=q,t.tanNumber=$,t.tanhNumber=Z;var n=r(34749);const i="number";function s(e){return Math.acos(e)}function o(e){return(0,n.acosh)(e)}function a(e){return Math.atan(1/e)}function l(e){return isFinite(e)?(Math.log((e+1)/e)+Math.log(e/(e-1)))/2:0}function c(e){return Math.asin(1/e)}function u(e){const t=1/e;return Math.log(t+Math.sqrt(t*t+1))}function d(e){return Math.acos(1/e)}function h(e){const t=1/e,r=Math.sqrt(t*t-1);return Math.log(r+t)}function p(e){return Math.asin(e)}function m(e){return(0,n.asinh)(e)}function f(e){return Math.atan(e)}function g(e,t){return Math.atan2(e,t)}function y(e){return(0,n.atanh)(e)}function b(e){return Math.cos(e)}function v(e){return(0,n.cosh)(e)}function _(e){return 1/Math.tan(e)}function x(e){const t=Math.exp(2*e);return(t+1)/(t-1)}function w(e){return 1/Math.sin(e)}function R(e){return 0===e?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(e)-Math.exp(-e)))*(0,n.sign)(e)}function k(e){return 1/Math.cos(e)}function j(e){return 2/(Math.exp(e)+Math.exp(-e))}function z(e){return Math.sin(e)}function q(e){return(0,n.sinh)(e)}function $(e){return Math.tan(e)}function Z(e){return(0,n.tanh)(e)}s.signature=i,o.signature=i,a.signature=i,l.signature=i,c.signature=i,u.signature=i,d.signature=i,h.signature=i,p.signature=i,m.signature=i,f.signature=i,g.signature="number, number",y.signature=i,b.signature=i,v.signature=i,_.signature=i,x.signature=i,w.signature=i,R.signature=i,k.signature=i,j.signature=i,z.signature=i,q.signature=i,$.signature=i,Z.signature=i},67276:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isIntegerNumber=s,t.isNaNNumber=c,t.isNegativeNumber=o,t.isPositiveNumber=a,t.isZeroNumber=l;var n=r(34749);const i="number";function s(e){return(0,n.isInteger)(e)}function o(e){return e<0}function a(e){return e>0}function l(e){return 0===e}function c(e){return Number.isNaN(e)}s.signature=i,o.signature=i,a.signature=i,l.signature=i,c.signature=i},78130:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createBigint=void 0;var n=r(66212),i=r(16624);const s=["typed"];t.createBigint=(0,n.factory)("bigint",s,(e=>{let{typed:t}=e;const r=t("bigint",{"":function(){return 0n},bigint:function(e){return e},number:function(e){return BigInt(e.toFixed())},BigNumber:function(e){return BigInt(e.round().toString())},Fraction:function(e){return BigInt(e.valueOf().toFixed())},"string | boolean":function(e){return BigInt(e)},null:function(e){return 0n},"Array | Matrix":t.referToSelf((e=>t=>(0,i.deepMap)(t,e)))});return r.fromJSON=function(e){return BigInt(e.value)},r}))},43774:(e,t,r)=>{"use strict";var n=r(87929);Object.defineProperty(t,"__esModule",{value:!0}),t.createBigNumberClass=void 0;var i=n(r(13944)),s=r(66212);const o=["?on","config"];t.createBigNumberClass=(0,s.factory)("BigNumber",o,(e=>{let{on:t,config:r}=e;const n=i.default.clone({precision:r.precision,modulo:i.default.EUCLID});return n.prototype=Object.create(n.prototype),n.prototype.type="BigNumber",n.prototype.isBigNumber=!0,n.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},n.fromJSON=function(e){return new n(e.value)},t&&t("config",(function(e,t){e.precision!==t.precision&&n.config({precision:e.precision})})),n}),{isClass:!0})},80701:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createBignumber=void 0;var n=r(66212),i=r(16624);const s=["typed","BigNumber"];t.createBignumber=(0,n.factory)("bignumber",s,(e=>{let{typed:t,BigNumber:r}=e;return t("bignumber",{"":function(){return new r(0)},number:function(e){return new r(e+"")},string:function(e){const t=e.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(t){const n=t[2],i=r(t[1]),s=new r(2).pow(Number(n));if(i.gt(s.sub(1)))throw new SyntaxError(`String "${e}" is out of range`);const o=new r(2).pow(Number(n)-1);return i.gte(o)?i.sub(s):i}return new r(e)},BigNumber:function(e){return e},bigint:function(e){return new r(e.toString())},Unit:t.referToSelf((e=>t=>{const r=t.clone();return r.value=e(t.value),r})),Fraction:function(e){return new r(e.n).div(e.d).times(e.s)},null:function(e){return new r(0)},"Array | Matrix":t.referToSelf((e=>t=>(0,i.deepMap)(t,e)))})}))},68049:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createBoolean=void 0;var n=r(66212),i=r(16624);const s="boolean",o=["typed"];t.createBoolean=(0,n.factory)(s,o,(e=>{let{typed:t}=e;return t(s,{"":function(){return!1},boolean:function(e){return e},number:function(e){return!!e},null:function(e){return!1},BigNumber:function(e){return!e.isZero()},string:function(e){const t=e.toLowerCase();if("true"===t)return!0;if("false"===t)return!1;const r=Number(e);if(""!==e&&!isNaN(r))return!!r;throw new Error('Cannot convert "'+e+'" to a boolean')},"Array | Matrix":t.referToSelf((e=>t=>(0,i.deepMap)(t,e)))})}))},52598:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createChainClass=void 0;var n=r(91612),i=r(7041),s=r(61175),o=r(66212);const a=["?on","math","typed"];t.createChainClass=(0,o.factory)("Chain",a,(e=>{let{on:t,math:r,typed:o}=e;function Chain(e){if(!(this instanceof Chain))throw new SyntaxError("Constructor must be called with the new operator");(0,n.isChain)(e)?this.value=e.value:this.value=e}function a(e,t){(0,s.lazy)(Chain.prototype,e,(function(){const e=t();if("function"==typeof e)return l(e)}))}function l(e){return function(){if(0===arguments.length)return new Chain(e(this.value));const t=[this.value];for(let e=0;e<arguments.length;e++)t[e+1]=arguments[e];if(o.isTypedFunction(e)){const r=o.resolve(e,t);if(1===r.params.length)throw new Error("chain function "+e.name+" cannot match rest parameter between chain value and additional arguments.");return new Chain(r.implementation.apply(e,t))}return new Chain(e.apply(e,t))}}Chain.prototype.type="Chain",Chain.prototype.isChain=!0,Chain.prototype.done=function(){return this.value},Chain.prototype.valueOf=function(){return this.value},Chain.prototype.toString=function(){return(0,i.format)(this.value)},Chain.prototype.toJSON=function(){return{mathjs:"Chain",value:this.value}},Chain.fromJSON=function(e){return new Chain(e.value)},Chain.createProxy=function(e,t){if("string"==typeof e)r=e,"function"==typeof(n=t)&&(Chain.prototype[r]=l(n));else for(const t in e)(0,s.hasOwnProperty)(e,t)&&void 0===c[t]&&a(t,(()=>e[t]));var r,n};const c={expression:!0,docs:!0,type:!0,classes:!0,json:!0,error:!0,isChain:!0};return Chain.createProxy(r),t&&t("import",(function(e,t,r){r||a(e,t)})),Chain}),{isClass:!0})},42581:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createChain=void 0;var n=r(66212);const i="chain",s=["typed","Chain"];t.createChain=(0,n.factory)(i,s,(e=>{let{typed:t,Chain:r}=e;return t(i,{"":function(){return new r},any:function(e){return new r(e)}})}))},84362:(e,t,r)=>{"use strict";var n=r(87929);Object.defineProperty(t,"__esModule",{value:!0}),t.createComplexClass=void 0;var i=n(r(76926)),s=r(34749),o=r(91612),a=r(66212);const l=[];t.createComplexClass=(0,a.factory)("Complex",l,(()=>(Object.defineProperty(i.default,"name",{value:"Complex"}),i.default.prototype.constructor=i.default,i.default.prototype.type="Complex",i.default.prototype.isComplex=!0,i.default.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},i.default.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},i.default.prototype.format=function(e){let t="",r=this.im,n=this.re;const i=(0,s.format)(this.re,e),a=(0,s.format)(this.im,e),l=(0,o.isNumber)(e)?e:e?e.precision:null;if(null!==l){const e=Math.pow(10,-l);Math.abs(n/r)<e&&(n=0),Math.abs(r/n)<e&&(r=0)}return t=0===r?i:0===n?1===r?"i":-1===r?"-i":a+"i":r<0?-1===r?i+" - i":i+" - "+a.substring(1)+"i":1===r?i+" + i":i+" + "+a+"i",t},i.default.fromPolar=function(e){switch(arguments.length){case 1:{const e=arguments[0];if("object"==typeof e)return(0,i.default)(e);throw new TypeError("Input has to be an object with r and phi keys.")}case 2:{const e=arguments[0];let t=arguments[1];if((0,o.isNumber)(e)){if((0,o.isUnit)(t)&&t.hasBase("ANGLE")&&(t=t.toNumber("rad")),(0,o.isNumber)(t))return new i.default({r:e,phi:t});throw new TypeError("Phi is not a number nor an angle unit.")}throw new TypeError("Radius r is not a number.")}default:throw new SyntaxError("Wrong number of arguments in function fromPolar")}},i.default.prototype.valueOf=i.default.prototype.toString,i.default.fromJSON=function(e){return new i.default(e)},i.default.compare=function(e,t){return e.re>t.re?1:e.re<t.re?-1:e.im>t.im?1:e.im<t.im?-1:0},i.default)),{isClass:!0})},51367:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createComplex=void 0;var n=r(66212),i=r(16624);const s=["typed","Complex"];t.createComplex=(0,n.factory)("complex",s,(e=>{let{typed:t,Complex:r}=e;return t("complex",{"":function(){return r.ZERO},number:function(e){return new r(e,0)},"number, number":function(e,t){return new r(e,t)},"BigNumber, BigNumber":function(e,t){return new r(e.toNumber(),t.toNumber())},Fraction:function(e){return new r(e.valueOf(),0)},Complex:function(e){return e.clone()},string:function(e){return r(e)},null:function(e){return r(0)},Object:function(e){if("re"in e&&"im"in e)return new r(e.re,e.im);if("r"in e&&"phi"in e||"abs"in e&&"arg"in e)return new r(e);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":t.referToSelf((e=>t=>(0,i.deepMap)(t,e)))})}))},36812:(e,t,r)=>{"use strict";var n=r(87929);Object.defineProperty(t,"__esModule",{value:!0}),t.createFractionClass=void 0;var i=n(r(41532)),s=r(66212);const o=[];t.createFractionClass=(0,s.factory)("Fraction",o,(()=>(Object.defineProperty(i.default,"name",{value:"Fraction"}),i.default.prototype.constructor=i.default,i.default.prototype.type="Fraction",i.default.prototype.isFraction=!0,i.default.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},i.default.fromJSON=function(e){return new i.default(e)},i.default)),{isClass:!0})},98123:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createFraction=void 0;var n=r(66212),i=r(16624);const s=["typed","Fraction"];t.createFraction=(0,n.factory)("fraction",s,(e=>{let{typed:t,Fraction:r}=e;return t("fraction",{number:function(e){if(!isFinite(e)||isNaN(e))throw new Error(e+" cannot be represented as a fraction");return new r(e)},string:function(e){return new r(e)},"number, number":function(e,t){return new r(e,t)},null:function(e){return new r(0)},BigNumber:function(e){return new r(e.toString())},bigint:function(e){return new r(e.toString())},Fraction:function(e){return e},Unit:t.referToSelf((e=>t=>{const r=t.clone();return r.value=e(t.value),r})),Object:function(e){return new r(e)},"Array | Matrix":t.referToSelf((e=>t=>(0,i.deepMap)(t,e)))})}))},11589:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDenseMatrixClass=void 0;var n=r(91612),i=r(34487),s=r(7041),o=r(34749),a=r(61175),l=r(6523),c=r(66212),u=r(68457);const d=["Matrix"];t.createDenseMatrixClass=(0,c.factory)("DenseMatrix",d,(e=>{let{Matrix:t}=e;function DenseMatrix(e,t){if(!(this instanceof DenseMatrix))throw new SyntaxError("Constructor must be called with the new operator");if(t&&!(0,n.isString)(t))throw new Error("Invalid datatype: "+t);if((0,n.isMatrix)(e))"DenseMatrix"===e.type?(this._data=(0,a.clone)(e._data),this._size=(0,a.clone)(e._size),this._datatype=t||e._datatype):(this._data=e.toArray(),this._size=e.size(),this._datatype=t||e._datatype);else if(e&&(0,n.isArray)(e.data)&&(0,n.isArray)(e.size))this._data=e.data,this._size=e.size,(0,i.validate)(this._data,this._size),this._datatype=t||e.datatype;else if((0,n.isArray)(e))this._data=p(e),this._size=(0,i.arraySize)(this._data),(0,i.validate)(this._data,this._size),this._datatype=t;else{if(e)throw new TypeError("Unsupported type of data ("+(0,n.typeOf)(e)+")");this._data=[],this._size=[0],this._datatype=t}}function r(e,t,n,s){const o=s===n-1,a=t.dimension(s);return o?a.map((function(t){return(0,i.validateIndex)(t,e.length),e[t]})).valueOf():a.map((function(o){(0,i.validateIndex)(o,e.length);return r(e[o],t,n,s+1)})).valueOf()}function c(e,t,r,n,s){const o=s===n-1,a=t.dimension(s);o?a.forEach((function(t,n){(0,i.validateIndex)(t),e[t]=r[n[0]]})):a.forEach((function(o,a){(0,i.validateIndex)(o),c(e[o],t,r[a[0]],n,s+1)}))}function d(e,t,r){if(0===t.length){let t=e._data;for(;(0,n.isArray)(t);)t=t[0];return t}return e._size=t.slice(0),e._data=(0,i.resize)(e._data,e._size,r),e}function h(e,t,r){const n=e._size.slice(0);let i=!1;for(;n.length<t.length;)n.push(0),i=!0;for(let e=0,r=t.length;e<r;e++)t[e]>n[e]&&(n[e]=t[e],i=!0);i&&d(e,n,r)}function p(e){return(0,n.isMatrix)(e)?p(e.valueOf()):(0,n.isArray)(e)?e.map(p):e}return DenseMatrix.prototype=new t,DenseMatrix.prototype.createDenseMatrix=function(e,t){return new DenseMatrix(e,t)},Object.defineProperty(DenseMatrix,"name",{value:"DenseMatrix"}),DenseMatrix.prototype.constructor=DenseMatrix,DenseMatrix.prototype.type="DenseMatrix",DenseMatrix.prototype.isDenseMatrix=!0,DenseMatrix.prototype.getDataType=function(){return(0,i.getArrayDataType)(this._data,n.typeOf)},DenseMatrix.prototype.storage=function(){return"dense"},DenseMatrix.prototype.datatype=function(){return this._datatype},DenseMatrix.prototype.create=function(e,t){return new DenseMatrix(e,t)},DenseMatrix.prototype.subset=function(e,t,s){switch(arguments.length){case 1:return function(e,t){if(!(0,n.isIndex)(t))throw new TypeError("Invalid index");const s=t.isScalar();if(s)return e.get(t.min());{const n=t.size();if(n.length!==e._size.length)throw new l.DimensionError(n.length,e._size.length);const s=t.min(),o=t.max();for(let t=0,r=e._size.length;t<r;t++)(0,i.validateIndex)(s[t],e._size[t]),(0,i.validateIndex)(o[t],e._size[t]);return new DenseMatrix(r(e._data,t,n.length,0),e._datatype)}}(this,e);case 2:case 3:return function(e,t,r,s){if(!t||!0!==t.isIndex)throw new TypeError("Invalid index");const o=t.size(),u=t.isScalar();let d;(0,n.isMatrix)(r)?(d=r.size(),r=r.valueOf()):d=(0,i.arraySize)(r);if(u){if(0!==d.length)throw new TypeError("Scalar expected");e.set(t.min(),r,s)}else{if(!(0,a.deepStrictEqual)(d,o))try{r=0===d.length?(0,i.broadcastTo)([r],o):(0,i.broadcastTo)(r,o),d=(0,i.arraySize)(r)}catch(e){}if(o.length<e._size.length)throw new l.DimensionError(o.length,e._size.length,"<");if(d.length<o.length){let e=0,t=0;for(;1===o[e]&&1===d[e];)e++;for(;1===o[e];)t++,e++;r=(0,i.unsqueeze)(r,o.length,t,d)}if(!(0,a.deepStrictEqual)(o,d))throw new l.DimensionError(o,d,">");h(e,t.max().map((function(e){return e+1})),s);const n=o.length,u=0;c(e._data,t,r,n,u)}return e}(this,e,t,s);default:throw new SyntaxError("Wrong number of arguments")}},DenseMatrix.prototype.get=function(e){return(0,i.get)(this._data,e)},DenseMatrix.prototype.set=function(e,t,r){if(!(0,n.isArray)(e))throw new TypeError("Array expected");if(e.length<this._size.length)throw new l.DimensionError(e.length,this._size.length,"<");let s,o,a;h(this,e.map((function(e){return e+1})),r);let c=this._data;for(s=0,o=e.length-1;s<o;s++)a=e[s],(0,i.validateIndex)(a,c.length),c=c[a];return a=e[e.length-1],(0,i.validateIndex)(a,c.length),c[a]=t,this},DenseMatrix.prototype.resize=function(e,t,r){if(!(0,n.isCollection)(e))throw new TypeError("Array or Matrix expected");const i=e.valueOf().map((e=>Array.isArray(e)&&1===e.length?e[0]:e));return d(r?this.clone():this,i,t)},DenseMatrix.prototype.reshape=function(e,t){const r=t?this.clone():this;r._data=(0,i.reshape)(r._data,e);const n=r._size.reduce(((e,t)=>e*t));return r._size=(0,i.processSizesWildcard)(e,n),r},DenseMatrix.prototype.clone=function(){return new DenseMatrix({data:(0,a.clone)(this._data),size:(0,a.clone)(this._size),datatype:this._datatype})},DenseMatrix.prototype.size=function(){return this._size.slice(0)},DenseMatrix.prototype.map=function(e){const t=this,r=function(i,s){return(0,n.isArray)(i)?i.map((function(e,t){return r(e,s.concat(t))})):(0,u.applyCallback)(e,i,s,t,"map")},s=r(this._data,[]);return new DenseMatrix(s,void 0!==this._datatype?(0,i.getArrayDataType)(s,n.typeOf):void 0)},DenseMatrix.prototype.forEach=function(e){const t=this,r=function(i,s){(0,n.isArray)(i)?i.forEach((function(e,t){r(e,s.concat(t))})):e(i,s,t)};r(this._data,[])},DenseMatrix.prototype[Symbol.iterator]=function*(){const e=function*(t,r){if((0,n.isArray)(t))for(let n=0;n<t.length;n++)yield*e(t[n],r.concat(n));else yield{value:t,index:r}};yield*e(this._data,[])},DenseMatrix.prototype.rows=function(){const e=[];if(2!==this.size().length)throw new TypeError("Rows can only be returned for a 2D matrix.");const t=this._data;for(const r of t)e.push(new DenseMatrix([r],this._datatype));return e},DenseMatrix.prototype.columns=function(){const e=[],t=this.size();if(2!==t.length)throw new TypeError("Rows can only be returned for a 2D matrix.");const r=this._data;for(let n=0;n<t[1];n++){const t=r.map((e=>[e[n]]));e.push(new DenseMatrix(t,this._datatype))}return e},DenseMatrix.prototype.toArray=function(){return(0,a.clone)(this._data)},DenseMatrix.prototype.valueOf=function(){return this._data},DenseMatrix.prototype.format=function(e){return(0,s.format)(this._data,e)},DenseMatrix.prototype.toString=function(){return(0,s.format)(this._data)},DenseMatrix.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},DenseMatrix.prototype.diagonal=function(e){if(e){if((0,n.isBigNumber)(e)&&(e=e.toNumber()),!(0,n.isNumber)(e)||!(0,o.isInteger)(e))throw new TypeError("The parameter k must be an integer number")}else e=0;const t=e>0?e:0,r=e<0?-e:0,i=this._size[0],s=this._size[1],a=Math.min(i-r,s-t),l=[];for(let e=0;e<a;e++)l[e]=this._data[e+r][e+t];return new DenseMatrix({data:l,size:[a],datatype:this._datatype})},DenseMatrix.diagonal=function(e,t,r,s){if(!(0,n.isArray)(e))throw new TypeError("Array expected, size parameter");if(2!==e.length)throw new Error("Only two dimensions matrix are supported");if(e=e.map((function(e){if((0,n.isBigNumber)(e)&&(e=e.toNumber()),!(0,n.isNumber)(e)||!(0,o.isInteger)(e)||e<1)throw new Error("Size values must be positive integers");return e})),r){if((0,n.isBigNumber)(r)&&(r=r.toNumber()),!(0,n.isNumber)(r)||!(0,o.isInteger)(r))throw new TypeError("The parameter k must be an integer number")}else r=0;const a=r>0?r:0,l=r<0?-r:0,c=e[0],u=e[1],d=Math.min(c-l,u-a);let h;if((0,n.isArray)(t)){if(t.length!==d)throw new Error("Invalid value array length");h=function(e){return t[e]}}else if((0,n.isMatrix)(t)){const e=t.size();if(1!==e.length||e[0]!==d)throw new Error("Invalid matrix length");h=function(e){return t.get([e])}}else h=function(){return t};s||(s=(0,n.isBigNumber)(h(0))?h(0).mul(0):0);let p=[];if(e.length>0){p=(0,i.resize)(p,e,s);for(let e=0;e<d;e++)p[e+l][e+a]=h(e)}return new DenseMatrix({data:p,size:[c,u]})},DenseMatrix.fromJSON=function(e){return new DenseMatrix(e)},DenseMatrix.prototype.swapRows=function(e,t){if(!((0,n.isNumber)(e)&&(0,o.isInteger)(e)&&(0,n.isNumber)(t)&&(0,o.isInteger)(t)))throw new Error("Row index must be positive integers");if(2!==this._size.length)throw new Error("Only two dimensional matrix is supported");return(0,i.validateIndex)(e,this._size[0]),(0,i.validateIndex)(t,this._size[0]),DenseMatrix._swapRows(e,t,this._data),this},DenseMatrix._swapRows=function(e,t,r){const n=r[e];r[e]=r[t],r[t]=n},DenseMatrix}),{isClass:!0})},71129:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createFibonacciHeapClass=void 0;var n=r(66212);const i=["smaller","larger"];t.createFibonacciHeapClass=(0,n.factory)("FibonacciHeap",i,(e=>{let{smaller:t,larger:r}=e;const n=1/Math.log((1+Math.sqrt(5))/2);function FibonacciHeap(){if(!(this instanceof FibonacciHeap))throw new SyntaxError("Constructor must be called with the new operator");this._minimum=null,this._size=0}function i(e,t,r){t.left.right=t.right,t.right.left=t.left,r.degree--,r.child===t&&(r.child=t.right),0===r.degree&&(r.child=null),t.left=e,t.right=e.right,e.right=t,t.right.left=t,t.parent=null,t.mark=!1}function s(e,t){const r=t.parent;r&&(t.mark?(i(e,t,r),s(r)):t.mark=!0)}FibonacciHeap.prototype.type="FibonacciHeap",FibonacciHeap.prototype.isFibonacciHeap=!0,FibonacciHeap.prototype.insert=function(e,r){const n={key:e,value:r,degree:0};if(this._minimum){const r=this._minimum;n.left=r,n.right=r.right,r.right=n,n.right.left=n,t(e,r.key)&&(this._minimum=n)}else n.left=n,n.right=n,this._minimum=n;return this._size++,n},FibonacciHeap.prototype.size=function(){return this._size},FibonacciHeap.prototype.clear=function(){this._minimum=null,this._size=0},FibonacciHeap.prototype.isEmpty=function(){return 0===this._size},FibonacciHeap.prototype.extractMinimum=function(){const e=this._minimum;if(null===e)return e;let i=this._minimum,s=e.degree,a=e.child;for(;s>0;){const e=a.right;a.left.right=a.right,a.right.left=a.left,a.left=i,a.right=i.right,i.right=a,a.right.left=a,a.parent=null,a=e,s--}return e.left.right=e.right,e.right.left=e.left,e===e.right?i=null:(i=e.right,i=function(e,i){const s=Math.floor(Math.log(i)*n)+1,a=new Array(s);let l,c=0,u=e;if(u)for(c++,u=u.right;u!==e;)c++,u=u.right;for(;c>0;){let e=u.degree;const t=u.right;for(;l=a[e],l;){if(r(u.key,l.key)){const e=l;l=u,u=e}o(l,u),a[e]=null,e++}a[e]=u,u=t,c--}e=null;for(let r=0;r<s;r++)l=a[r],l&&(e?(l.left.right=l.right,l.right.left=l.left,l.left=e,l.right=e.right,e.right=l,l.right.left=l,t(l.key,e.key)&&(e=l)):e=l);return e}(i,this._size)),this._size--,this._minimum=i,e},FibonacciHeap.prototype.remove=function(e){this._minimum=function(e,r,n){r.key=n;const o=r.parent;o&&t(r.key,o.key)&&(i(e,r,o),s(e,o));t(r.key,e.key)&&(e=r);return e}(this._minimum,e,-1),this.extractMinimum()};const o=function(e,t){e.left.right=e.right,e.right.left=e.left,e.parent=t,t.child?(e.left=t.child,e.right=t.child.right,t.child.right=e,e.right.left=e):(t.child=e,e.right=e,e.left=e),t.degree++,e.mark=!1};return FibonacciHeap}),{isClass:!0})},4161:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createImmutableDenseMatrixClass=void 0;var n=r(91612),i=r(61175),s=r(66212);const o=["smaller","DenseMatrix"];t.createImmutableDenseMatrixClass=(0,s.factory)("ImmutableDenseMatrix",o,(e=>{let{smaller:t,DenseMatrix:r}=e;function ImmutableDenseMatrix(e,t){if(!(this instanceof ImmutableDenseMatrix))throw new SyntaxError("Constructor must be called with the new operator");if(t&&!(0,n.isString)(t))throw new Error("Invalid datatype: "+t);if((0,n.isMatrix)(e)||(0,n.isArray)(e)){const n=new r(e,t);this._data=n._data,this._size=n._size,this._datatype=n._datatype,this._min=null,this._max=null}else if(e&&(0,n.isArray)(e.data)&&(0,n.isArray)(e.size))this._data=e.data,this._size=e.size,this._datatype=e.datatype,this._min=void 0!==e.min?e.min:null,this._max=void 0!==e.max?e.max:null;else{if(e)throw new TypeError("Unsupported type of data ("+(0,n.typeOf)(e)+")");this._data=[],this._size=[0],this._datatype=t,this._min=null,this._max=null}}return ImmutableDenseMatrix.prototype=new r,ImmutableDenseMatrix.prototype.type="ImmutableDenseMatrix",ImmutableDenseMatrix.prototype.isImmutableDenseMatrix=!0,ImmutableDenseMatrix.prototype.subset=function(e){switch(arguments.length){case 1:{const t=r.prototype.subset.call(this,e);return(0,n.isMatrix)(t)?new ImmutableDenseMatrix({data:t._data,size:t._size,datatype:t._datatype}):t}case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments")}},ImmutableDenseMatrix.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},ImmutableDenseMatrix.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},ImmutableDenseMatrix.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},ImmutableDenseMatrix.prototype.clone=function(){return new ImmutableDenseMatrix({data:(0,i.clone)(this._data),size:(0,i.clone)(this._size),datatype:this._datatype})},ImmutableDenseMatrix.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},ImmutableDenseMatrix.fromJSON=function(e){return new ImmutableDenseMatrix(e)},ImmutableDenseMatrix.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},ImmutableDenseMatrix.prototype.min=function(){if(null===this._min){let e=null;this.forEach((function(r){(null===e||t(r,e))&&(e=r)})),this._min=null!==e?e:void 0}return this._min},ImmutableDenseMatrix.prototype.max=function(){if(null===this._max){let e=null;this.forEach((function(r){(null===e||t(e,r))&&(e=r)})),this._max=null!==e?e:void 0}return this._max},ImmutableDenseMatrix}),{isClass:!0})},22774:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMatrixClass=void 0;var n=r(66212);const i=[];t.createMatrixClass=(0,n.factory)("Matrix",i,(()=>{function Matrix(){if(!(this instanceof Matrix))throw new SyntaxError("Constructor must be called with the new operator")}return Matrix.prototype.type="Matrix",Matrix.prototype.isMatrix=!0,Matrix.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},Matrix.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},Matrix.prototype.create=function(e,t){throw new Error("Cannot invoke create on a Matrix interface")},Matrix.prototype.subset=function(e,t,r){throw new Error("Cannot invoke subset on a Matrix interface")},Matrix.prototype.get=function(e){throw new Error("Cannot invoke get on a Matrix interface")},Matrix.prototype.set=function(e,t,r){throw new Error("Cannot invoke set on a Matrix interface")},Matrix.prototype.resize=function(e,t){throw new Error("Cannot invoke resize on a Matrix interface")},Matrix.prototype.reshape=function(e,t){throw new Error("Cannot invoke reshape on a Matrix interface")},Matrix.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},Matrix.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},Matrix.prototype.map=function(e,t){throw new Error("Cannot invoke map on a Matrix interface")},Matrix.prototype.forEach=function(e){throw new Error("Cannot invoke forEach on a Matrix interface")},Matrix.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},Matrix.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},Matrix.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},Matrix.prototype.format=function(e){throw new Error("Cannot invoke format on a Matrix interface")},Matrix.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},Matrix}),{isClass:!0})},76944:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createIndexClass=void 0;var n=r(91612),i=r(61175),s=r(34749),o=r(66212);const a=["ImmutableDenseMatrix","getMatrixDataType"];t.createIndexClass=(0,o.factory)("Index",a,(e=>{let{ImmutableDenseMatrix:t,getMatrixDataType:r}=e;function Index(e){if(!(this instanceof Index))throw new SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._sourceSize=[],this._isScalar=!0;for(let e=0,t=arguments.length;e<t;e++){const t=arguments[e],i=(0,n.isArray)(t),s=(0,n.isMatrix)(t);let a=null;if((0,n.isRange)(t))this._dimensions.push(t),this._isScalar=!1;else if(i||s){let e;"boolean"===r(t)?(i&&(e=o(l(t).valueOf())),s&&(e=o(l(t._data).valueOf())),a=t.valueOf().length):e=o(t.valueOf()),this._dimensions.push(e);const n=e.size();1===n.length&&1===n[0]&&null===a||(this._isScalar=!1)}else if("number"==typeof t)this._dimensions.push(o([t]));else{if("string"!=typeof t)throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");this._dimensions.push(t)}this._sourceSize.push(a)}}function o(e){for(let t=0,r=e.length;t<r;t++)if("number"!=typeof e[t]||!(0,s.isInteger)(e[t]))throw new TypeError("Index parameters must be positive integer numbers");return new t(e)}return Index.prototype.type="Index",Index.prototype.isIndex=!0,Index.prototype.clone=function(){const e=new Index;return e._dimensions=(0,i.clone)(this._dimensions),e._isScalar=this._isScalar,e._sourceSize=this._sourceSize,e},Index.create=function(e){const t=new Index;return Index.apply(t,e),t},Index.prototype.size=function(){const e=[];for(let t=0,r=this._dimensions.length;t<r;t++){const r=this._dimensions[t];e[t]="string"==typeof r?1:r.size()[0]}return e},Index.prototype.max=function(){const e=[];for(let t=0,r=this._dimensions.length;t<r;t++){const r=this._dimensions[t];e[t]="string"==typeof r?r:r.max()}return e},Index.prototype.min=function(){const e=[];for(let t=0,r=this._dimensions.length;t<r;t++){const r=this._dimensions[t];e[t]="string"==typeof r?r:r.min()}return e},Index.prototype.forEach=function(e){for(let t=0,r=this._dimensions.length;t<r;t++)e(this._dimensions[t],t,this)},Index.prototype.dimension=function(e){return this._dimensions[e]||null},Index.prototype.isObjectProperty=function(){return 1===this._dimensions.length&&"string"==typeof this._dimensions[0]},Index.prototype.getObjectProperty=function(){return this.isObjectProperty()?this._dimensions[0]:null},Index.prototype.isScalar=function(){return this._isScalar},Index.prototype.toArray=function(){const e=[];for(let t=0,r=this._dimensions.length;t<r;t++){const r=this._dimensions[t];e.push("string"==typeof r?r:r.toArray())}return e},Index.prototype.valueOf=Index.prototype.toArray,Index.prototype.toString=function(){const e=[];for(let t=0,r=this._dimensions.length;t<r;t++){const r=this._dimensions[t];"string"==typeof r?e.push(JSON.stringify(r)):e.push(r.toString())}return"["+e.join(", ")+"]"},Index.prototype.toJSON=function(){return{mathjs:"Index",dimensions:this._dimensions}},Index.fromJSON=function(e){return Index.create(e.dimensions)},Index}),{isClass:!0});function l(e){const t=[];return e.forEach(((e,r)=>{e&&t.push(r)})),t}},58794:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRangeClass=void 0;var n=r(91612),i=r(34749),s=r(66212);const o=[];t.createRangeClass=(0,s.factory)("Range",o,(()=>{function Range(e,t,r){if(!(this instanceof Range))throw new SyntaxError("Constructor must be called with the new operator");const i=null!=e,s=null!=t,o=null!=r;if(i)if((0,n.isBigNumber)(e))e=e.toNumber();else if("number"!=typeof e)throw new TypeError("Parameter start must be a number");if(s)if((0,n.isBigNumber)(t))t=t.toNumber();else if("number"!=typeof t)throw new TypeError("Parameter end must be a number");if(o)if((0,n.isBigNumber)(r))r=r.toNumber();else if("number"!=typeof r)throw new TypeError("Parameter step must be a number");this.start=i?parseFloat(e):0,this.end=s?parseFloat(t):0,this.step=o?parseFloat(r):1}return Range.prototype.type="Range",Range.prototype.isRange=!0,Range.parse=function(e){if("string"!=typeof e)return null;const t=e.split(":").map((function(e){return parseFloat(e)}));if(t.some((function(e){return isNaN(e)})))return null;switch(t.length){case 2:return new Range(t[0],t[1]);case 3:return new Range(t[0],t[2],t[1]);default:return null}},Range.prototype.clone=function(){return new Range(this.start,this.end,this.step)},Range.prototype.size=function(){let e=0;const t=this.start,r=this.step,n=this.end-t;return(0,i.sign)(r)===(0,i.sign)(n)?e=Math.ceil(n/r):0===n&&(e=0),isNaN(e)&&(e=0),[e]},Range.prototype.min=function(){const e=this.size()[0];return e>0?this.step>0?this.start:this.start+(e-1)*this.step:void 0},Range.prototype.max=function(){const e=this.size()[0];return e>0?this.step>0?this.start+(e-1)*this.step:this.start:void 0},Range.prototype.forEach=function(e){let t=this.start;const r=this.step,n=this.end;let i=0;if(r>0)for(;t<n;)e(t,[i],this),t+=r,i++;else if(r<0)for(;t>n;)e(t,[i],this),t+=r,i++},Range.prototype.map=function(e){const t=[];return this.forEach((function(r,n,i){t[n[0]]=e(r,n,i)})),t},Range.prototype.toArray=function(){const e=[];return this.forEach((function(t,r){e[r[0]]=t})),e},Range.prototype.valueOf=function(){return this.toArray()},Range.prototype.format=function(e){let t=(0,i.format)(this.start,e);return 1!==this.step&&(t+=":"+(0,i.format)(this.step,e)),t+=":"+(0,i.format)(this.end,e),t},Range.prototype.toString=function(){return this.format()},Range.prototype.toJSON=function(){return{mathjs:"Range",start:this.start,end:this.end,step:this.step}},Range.fromJSON=function(e){return new Range(e.start,e.end,e.step)},Range}),{isClass:!0})},11517:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSpaClass=void 0;var n=r(66212);const i=["addScalar","equalScalar","FibonacciHeap"];t.createSpaClass=(0,n.factory)("Spa",i,(e=>{let{addScalar:t,equalScalar:r,FibonacciHeap:n}=e;function Spa(){if(!(this instanceof Spa))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new n}return Spa.prototype.type="Spa",Spa.prototype.isSpa=!0,Spa.prototype.set=function(e,t){if(this._values[e])this._values[e].value=t;else{const r=this._heap.insert(e,t);this._values[e]=r}},Spa.prototype.get=function(e){const t=this._values[e];return t?t.value:0},Spa.prototype.accumulate=function(e,r){let n=this._values[e];n?n.value=t(n.value,r):(n=this._heap.insert(e,r),this._values[e]=n)},Spa.prototype.forEach=function(e,t,n){const i=this._heap,s=this._values,o=[];let a=i.extractMinimum();for(a&&o.push(a);a&&a.key<=t;)a.key>=e&&(r(a.value,0)||n(a.key,a.value,this)),a=i.extractMinimum(),a&&o.push(a);for(let e=0;e<o.length;e++){const t=o[e];a=i.insert(t.key,t.value),s[a.key]=a}},Spa.prototype.swap=function(e,t){let r=this._values[e],n=this._values[t];if(!r&&n)r=this._heap.insert(e,n.value),this._heap.remove(n),this._values[e]=r,this._values[t]=void 0;else if(r&&!n)n=this._heap.insert(t,r.value),this._heap.remove(r),this._values[t]=n,this._values[e]=void 0;else if(r&&n){const e=r.value;r.value=n.value,n.value=e}},Spa}),{isClass:!0})},57974:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSparseMatrixClass=void 0;var n=r(91612),i=r(34749),s=r(7041),o=r(61175),a=r(34487),l=r(66212),c=r(6523),u=r(68457);const d=["typed","equalScalar","Matrix"];t.createSparseMatrixClass=(0,l.factory)("SparseMatrix",d,(e=>{let{typed:t,equalScalar:r,Matrix:l}=e;function SparseMatrix(e,t){if(!(this instanceof SparseMatrix))throw new SyntaxError("Constructor must be called with the new operator");if(t&&!(0,n.isString)(t))throw new Error("Invalid datatype: "+t);if((0,n.isMatrix)(e))!function(e,t,r){"SparseMatrix"===t.type?(e._values=t._values?(0,o.clone)(t._values):void 0,e._index=(0,o.clone)(t._index),e._ptr=(0,o.clone)(t._ptr),e._size=(0,o.clone)(t._size),e._datatype=r||t._datatype):d(e,t.valueOf(),r||t._datatype)}(this,e,t);else if(e&&(0,n.isArray)(e.index)&&(0,n.isArray)(e.ptr)&&(0,n.isArray)(e.size))this._values=e.values,this._index=e.index,this._ptr=e.ptr,this._size=e.size,this._datatype=t||e.datatype;else if((0,n.isArray)(e))d(this,e,t);else{if(e)throw new TypeError("Unsupported type of data ("+(0,n.typeOf)(e)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=t}}function d(e,i,s){e._values=[],e._index=[],e._ptr=[],e._datatype=s;const o=i.length;let a=0,l=r,c=0;if((0,n.isString)(s)&&(l=t.find(r,[s,s])||r,c=t.convert(0,s)),o>0){let t=0;do{e._ptr.push(e._index.length);for(let r=0;r<o;r++){const s=i[r];if((0,n.isArray)(s)){if(0===t&&a<s.length&&(a=s.length),t<s.length){const n=s[t];l(n,c)||(e._values.push(n),e._index.push(r))}}else 0===t&&a<1&&(a=1),l(s,c)||(e._values.push(s),e._index.push(r))}t++}while(t<a)}e._ptr.push(e._index.length),e._size=[o,a]}function h(e,t,r,n){if(r-t==0)return r;for(let i=t;i<r;i++)if(n[i]===e)return i;return t}function p(e,t,r,n,i,s,o){i.splice(e,0,n),s.splice(e,0,t);for(let e=r+1;e<o.length;e++)o[e]++}function m(e,i,s,o){let a=o||0,l=r,c=0;(0,n.isString)(e._datatype)&&(l=t.find(r,[e._datatype,e._datatype])||r,c=t.convert(0,e._datatype),a=t.convert(a,e._datatype));const u=!l(a,c),d=e._size[0];let h,p,m,f=e._size[1];if(s>f){for(p=f;p<s;p++)if(e._ptr[p]=e._values.length,u)for(h=0;h<d;h++)e._values.push(a),e._index.push(h);e._ptr[s]=e._values.length}else s<f&&(e._ptr.splice(s+1,f-s),e._values.splice(e._ptr[s],e._values.length),e._index.splice(e._ptr[s],e._index.length));if(f=s,i>d){if(u){let t=0;for(p=0;p<f;p++){e._ptr[p]=e._ptr[p]+t,m=e._ptr[p+1]+t;let r=0;for(h=d;h<i;h++,r++)e._values.splice(m+r,0,a),e._index.splice(m+r,0,h),t++}e._ptr[f]=e._values.length}}else if(i<d){let t=0;for(p=0;p<f;p++){e._ptr[p]=e._ptr[p]-t;const r=e._ptr[p],n=e._ptr[p+1]-t;for(m=r;m<n;m++)h=e._index[m],h>i-1&&(e._values.splice(m,1),e._index.splice(m,1),t++)}e._ptr[p]=e._values.length}return e._size[0]=i,e._size[1]=s,e}function f(e,t,r,n,i){const s=n[0],a=n[1],l=[];let c,u;for(c=0;c<s;c++)for(l[c]=[],u=0;u<a;u++)l[c][u]=0;for(u=0;u<a;u++){const n=r[u],s=r[u+1];for(let r=n;r<s;r++)c=t[r],l[c][u]=e?i?(0,o.clone)(e[r]):e[r]:1}return l}return SparseMatrix.prototype=new l,SparseMatrix.prototype.createSparseMatrix=function(e,t){return new SparseMatrix(e,t)},Object.defineProperty(SparseMatrix,"name",{value:"SparseMatrix"}),SparseMatrix.prototype.constructor=SparseMatrix,SparseMatrix.prototype.type="SparseMatrix",SparseMatrix.prototype.isSparseMatrix=!0,SparseMatrix.prototype.getDataType=function(){return(0,a.getArrayDataType)(this._values,n.typeOf)},SparseMatrix.prototype.storage=function(){return"sparse"},SparseMatrix.prototype.datatype=function(){return this._datatype},SparseMatrix.prototype.create=function(e,t){return new SparseMatrix(e,t)},SparseMatrix.prototype.density=function(){const e=this._size[0],t=this._size[1];return 0!==e&&0!==t?this._index.length/(e*t):0},SparseMatrix.prototype.subset=function(e,t,r){if(!this._values)throw new Error("Cannot invoke subset on a Pattern only matrix");switch(arguments.length){case 1:return function(e,t){if(!(0,n.isIndex)(t))throw new TypeError("Invalid index");if(t.isScalar())return e.get(t.min());const r=t.size();if(r.length!==e._size.length)throw new c.DimensionError(r.length,e._size.length);let i,s,o,l;const u=t.min(),d=t.max();for(i=0,s=e._size.length;i<s;i++)(0,a.validateIndex)(u[i],e._size[i]),(0,a.validateIndex)(d[i],e._size[i]);const h=e._values,p=e._index,m=e._ptr,f=t.dimension(0),g=t.dimension(1),y=[],b=[];f.forEach((function(e,t){b[e]=t[0],y[e]=!0}));const v=h?[]:void 0,_=[],x=[];return g.forEach((function(e){for(x.push(_.length),o=m[e],l=m[e+1];o<l;o++)i=p[o],!0===y[i]&&(_.push(b[i]),v&&v.push(h[o]))})),x.push(_.length),new SparseMatrix({values:v,index:_,ptr:x,size:r,datatype:e._datatype})}(this,e);case 2:case 3:return function(e,t,r,i){if(!t||!0!==t.isIndex)throw new TypeError("Invalid index");const s=t.size(),l=t.isScalar();let u;(0,n.isMatrix)(r)?(u=r.size(),r=r.toArray()):u=(0,a.arraySize)(r);if(l){if(0!==u.length)throw new TypeError("Scalar expected");e.set(t.min(),r,i)}else{if(1!==s.length&&2!==s.length)throw new c.DimensionError(s.length,e._size.length,"<");if(u.length<s.length){let e=0,t=0;for(;1===s[e]&&1===u[e];)e++;for(;1===s[e];)t++,e++;r=(0,a.unsqueeze)(r,s.length,t,u)}if(!(0,o.deepStrictEqual)(s,u))throw new c.DimensionError(s,u,">");if(1===s.length){t.dimension(0).forEach((function(t,n){(0,a.validateIndex)(t),e.set([t,0],r[n[0]],i)}))}else{const n=t.dimension(0),s=t.dimension(1);n.forEach((function(t,n){(0,a.validateIndex)(t),s.forEach((function(s,o){(0,a.validateIndex)(s),e.set([t,s],r[n[0]][o[0]],i)}))}))}}return e}(this,e,t,r);default:throw new SyntaxError("Wrong number of arguments")}},SparseMatrix.prototype.get=function(e){if(!(0,n.isArray)(e))throw new TypeError("Array expected");if(e.length!==this._size.length)throw new c.DimensionError(e.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");const t=e[0],r=e[1];(0,a.validateIndex)(t,this._size[0]),(0,a.validateIndex)(r,this._size[1]);const i=h(t,this._ptr[r],this._ptr[r+1],this._index);return i<this._ptr[r+1]&&this._index[i]===t?this._values[i]:0},SparseMatrix.prototype.set=function(e,i,s){if(!(0,n.isArray)(e))throw new TypeError("Array expected");if(e.length!==this._size.length)throw new c.DimensionError(e.length,this._size.length);if(!this._values)throw new Error("Cannot invoke set on a Pattern only matrix");const o=e[0],l=e[1];let u=this._size[0],d=this._size[1],f=r,g=0;(0,n.isString)(this._datatype)&&(f=t.find(r,[this._datatype,this._datatype])||r,g=t.convert(0,this._datatype)),(o>u-1||l>d-1)&&(m(this,Math.max(o+1,u),Math.max(l+1,d),s),u=this._size[0],d=this._size[1]),(0,a.validateIndex)(o,u),(0,a.validateIndex)(l,d);const y=h(o,this._ptr[l],this._ptr[l+1],this._index);return y<this._ptr[l+1]&&this._index[y]===o?f(i,g)?function(e,t,r,n,i){r.splice(e,1),n.splice(e,1);for(let e=t+1;e<i.length;e++)i[e]--}(y,l,this._values,this._index,this._ptr):this._values[y]=i:f(i,g)||p(y,o,l,i,this._values,this._index,this._ptr),this},SparseMatrix.prototype.resize=function(e,t,r){if(!(0,n.isCollection)(e))throw new TypeError("Array or Matrix expected");const o=e.valueOf().map((e=>Array.isArray(e)&&1===e.length?e[0]:e));if(2!==o.length)throw new Error("Only two dimensions matrix are supported");o.forEach((function(e){if(!(0,n.isNumber)(e)||!(0,i.isInteger)(e)||e<0)throw new TypeError("Invalid size, must contain positive integers (size: "+(0,s.format)(o)+")")}));return m(r?this.clone():this,o[0],o[1],t)},SparseMatrix.prototype.reshape=function(e,t){if(!(0,n.isArray)(e))throw new TypeError("Array expected");if(2!==e.length)throw new Error("Sparse matrices can only be reshaped in two dimensions");e.forEach((function(t){if(!(0,n.isNumber)(t)||!(0,i.isInteger)(t)||t<=-2||0===t)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+(0,s.format)(e)+")")}));const r=this._size[0]*this._size[1];if(r!==(e=(0,a.processSizesWildcard)(e,r))[0]*e[1])throw new Error("Reshaping sparse matrix will result in the wrong number of elements");const o=t?this.clone():this;if(this._size[0]===e[0]&&this._size[1]===e[1])return o;const l=[];for(let e=0;e<o._ptr.length;e++)for(let t=0;t<o._ptr[e+1]-o._ptr[e];t++)l.push(e);const c=o._values.slice(),u=o._index.slice();for(let t=0;t<o._index.length;t++){const r=u[t],n=l[t],i=r*o._size[1]+n;l[t]=i%e[1],u[t]=Math.floor(i/e[1])}o._values.length=0,o._index.length=0,o._ptr.length=e[1]+1,o._size=e.slice();for(let e=0;e<o._ptr.length;e++)o._ptr[e]=0;for(let e=0;e<c.length;e++){const t=u[e],r=l[e],n=c[e];p(h(t,o._ptr[r],o._ptr[r+1],o._index),t,r,n,o._values,o._index,o._ptr)}return o},SparseMatrix.prototype.clone=function(){return new SparseMatrix({values:this._values?(0,o.clone)(this._values):void 0,index:(0,o.clone)(this._index),ptr:(0,o.clone)(this._ptr),size:(0,o.clone)(this._size),datatype:this._datatype})},SparseMatrix.prototype.size=function(){return this._size.slice(0)},SparseMatrix.prototype.map=function(e,i){if(!this._values)throw new Error("Cannot invoke map on a Pattern only matrix");const s=this;return function(e,i,s,o,a,l,c){const u=[],d=[],h=[];let p=r,m=0;(0,n.isString)(e._datatype)&&(p=t.find(r,[e._datatype,e._datatype])||r,m=t.convert(0,e._datatype));const f=function(e,t,r){const n=l(e,t,r);p(n,m)||(u.push(n),d.push(t))};for(let t=o;t<=a;t++){h.push(u.length);const r=e._ptr[t],n=e._ptr[t+1];if(c)for(let a=r;a<n;a++){const r=e._index[a];r>=i&&r<=s&&f(e._values[a],r-i,t-o)}else{const a={};for(let t=r;t<n;t++){a[e._index[t]]=e._values[t]}for(let e=i;e<=s;e++){f(e in a?a[e]:0,e-i,t-o)}}}return h.push(u.length),new SparseMatrix({values:u,index:d,ptr:h,size:[s-i+1,a-o+1]})}(this,0,this._size[0]-1,0,this._size[1]-1,(function(t,r,n){return(0,u.applyCallback)(e,t,[r,n],s,"map")}),i)},SparseMatrix.prototype.forEach=function(e,t){if(!this._values)throw new Error("Cannot invoke forEach on a Pattern only matrix");const r=this,n=this._size[0],i=this._size[1];for(let s=0;s<i;s++){const i=this._ptr[s],o=this._ptr[s+1];if(t)for(let t=i;t<o;t++){const n=this._index[t];e(this._values[t],[n,s],r)}else{const t={};for(let e=i;e<o;e++){t[this._index[e]]=this._values[e]}for(let i=0;i<n;i++){e(i in t?t[i]:0,[i,s],r)}}}},SparseMatrix.prototype[Symbol.iterator]=function*(){if(!this._values)throw new Error("Cannot iterate a Pattern only matrix");const e=this._size[1];for(let t=0;t<e;t++){const e=this._ptr[t],r=this._ptr[t+1];for(let n=e;n<r;n++){const e=this._index[n];yield{value:this._values[n],index:[e,t]}}}},SparseMatrix.prototype.toArray=function(){return f(this._values,this._index,this._ptr,this._size,!0)},SparseMatrix.prototype.valueOf=function(){return f(this._values,this._index,this._ptr,this._size,!1)},SparseMatrix.prototype.format=function(e){const t=this._size[0],r=this._size[1],n=this.density();let i="Sparse Matrix ["+(0,s.format)(t,e)+" x "+(0,s.format)(r,e)+"] density: "+(0,s.format)(n,e)+"\n";for(let t=0;t<r;t++){const r=this._ptr[t],n=this._ptr[t+1];for(let o=r;o<n;o++){const r=this._index[o];i+="\n    ("+(0,s.format)(r,e)+", "+(0,s.format)(t,e)+") ==> "+(this._values?(0,s.format)(this._values[o],e):"X")}}return i},SparseMatrix.prototype.toString=function(){return(0,s.format)(this.toArray())},SparseMatrix.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},SparseMatrix.prototype.diagonal=function(e){if(e){if((0,n.isBigNumber)(e)&&(e=e.toNumber()),!(0,n.isNumber)(e)||!(0,i.isInteger)(e))throw new TypeError("The parameter k must be an integer number")}else e=0;const t=e>0?e:0,r=e<0?-e:0,s=this._size[0],o=this._size[1],a=Math.min(s-r,o-t),l=[],c=[],u=[];u[0]=0;for(let e=t;e<o&&l.length<a;e++){const n=this._ptr[e],i=this._ptr[e+1];for(let s=n;s<i;s++){const n=this._index[s];if(n===e-t+r){l.push(this._values[s]),c[l.length-1]=n-r;break}}}return u.push(l.length),new SparseMatrix({values:l,index:c,ptr:u,size:[a,1]})},SparseMatrix.fromJSON=function(e){return new SparseMatrix(e)},SparseMatrix.diagonal=function(e,s,o,a,l){if(!(0,n.isArray)(e))throw new TypeError("Array expected, size parameter");if(2!==e.length)throw new Error("Only two dimensions matrix are supported");if(e=e.map((function(e){if((0,n.isBigNumber)(e)&&(e=e.toNumber()),!(0,n.isNumber)(e)||!(0,i.isInteger)(e)||e<1)throw new Error("Size values must be positive integers");return e})),o){if((0,n.isBigNumber)(o)&&(o=o.toNumber()),!(0,n.isNumber)(o)||!(0,i.isInteger)(o))throw new TypeError("The parameter k must be an integer number")}else o=0;let c=r,u=0;(0,n.isString)(l)&&(c=t.find(r,[l,l])||r,u=t.convert(0,l));const d=o>0?o:0,h=o<0?-o:0,p=e[0],m=e[1],f=Math.min(p-h,m-d);let g;if((0,n.isArray)(s)){if(s.length!==f)throw new Error("Invalid value array length");g=function(e){return s[e]}}else if((0,n.isMatrix)(s)){const e=s.size();if(1!==e.length||e[0]!==f)throw new Error("Invalid matrix length");g=function(e){return s.get([e])}}else g=function(){return s};const y=[],b=[],v=[];for(let e=0;e<m;e++){v.push(y.length);const t=e-d;if(t>=0&&t<f){const e=g(t);c(e,u)||(b.push(t+h),y.push(e))}}return v.push(y.length),new SparseMatrix({values:y,index:b,ptr:v,size:[p,m]})},SparseMatrix.prototype.swapRows=function(e,t){if(!((0,n.isNumber)(e)&&(0,i.isInteger)(e)&&(0,n.isNumber)(t)&&(0,i.isInteger)(t)))throw new Error("Row index must be positive integers");if(2!==this._size.length)throw new Error("Only two dimensional matrix is supported");return(0,a.validateIndex)(e,this._size[0]),(0,a.validateIndex)(t,this._size[0]),SparseMatrix._swapRows(e,t,this._size[1],this._values,this._index,this._ptr),this},SparseMatrix._forEachRow=function(e,t,r,n,i){const s=n[e],o=n[e+1];for(let e=s;e<o;e++)i(r[e],t[e])},SparseMatrix._swapRows=function(e,t,r,n,i,s){for(let o=0;o<r;o++){const r=s[o],a=s[o+1],l=h(e,r,a,i),c=h(t,r,a,i);if(l<a&&c<a&&i[l]===e&&i[c]===t){if(n){const e=n[l];n[l]=n[c],n[c]=e}}else if(l<a&&i[l]===e&&(c>=a||i[c]!==t)){const e=n?n[l]:void 0;i.splice(c,0,t),n&&n.splice(c,0,e),i.splice(c<=l?l+1:l,1),n&&n.splice(c<=l?l+1:l,1)}else if(c<a&&i[c]===t&&(l>=a||i[l]!==e)){const t=n?n[c]:void 0;i.splice(l,0,e),n&&n.splice(l,0,t),i.splice(l<=c?c+1:c,1),n&&n.splice(l<=c?c+1:c,1)}}},SparseMatrix}),{isClass:!0})},40596:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createIndex=void 0;var n=r(91612),i=r(66212);const s="index",o=["typed","Index"];t.createIndex=(0,i.factory)(s,o,(e=>{let{typed:t,Index:r}=e;return t(s,{"...number | string | BigNumber | Range | Array | Matrix":function(e){const t=e.map((function(e){return(0,n.isBigNumber)(e)?e.toNumber():(0,n.isArray)(e)||(0,n.isMatrix)(e)?e.map((function(e){return(0,n.isBigNumber)(e)?e.toNumber():e})):e})),i=new r;return r.apply(i,t),i}})}))},93847:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMatrix=void 0;var n=r(66212);const i="matrix",s=["typed","Matrix","DenseMatrix","SparseMatrix"];t.createMatrix=(0,n.factory)(i,s,(e=>{let{typed:t,Matrix:r,DenseMatrix:n,SparseMatrix:s}=e;return t(i,{"":function(){return o([])},string:function(e){return o([],e)},"string, string":function(e,t){return o([],e,t)},Array:function(e){return o(e)},Matrix:function(e){return o(e,e.storage())},"Array | Matrix, string":o,"Array | Matrix, string, string":o});function o(e,t,r){if("dense"===t||"default"===t||void 0===t)return new n(e,r);if("sparse"===t)return new s(e,r);throw new TypeError("Unknown matrix type "+JSON.stringify(t)+".")}}))},13274:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSparse=void 0;var n=r(66212);const i="sparse",s=["typed","SparseMatrix"];t.createSparse=(0,n.factory)(i,s,(e=>{let{typed:t,SparseMatrix:r}=e;return t(i,{"":function(){return new r([])},string:function(e){return new r([],e)},"Array | Matrix":function(e){return new r(e)},"Array | Matrix, string":function(e,t){return new r(e,t)}})}))},71142:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.broadcast=function(e,t){if((0,i.deepStrictEqual)(e.size(),t.size()))return[e,t];const r=(0,n.broadcastSizes)(e.size(),t.size());return[e,t].map((e=>function(e,t){if((0,i.deepStrictEqual)(e.size(),t))return e;return e.create((0,n.broadcastTo)(e.valueOf(),t),e.datatype())}(e,r)))};var n=r(34487),i=r(61175)},27935:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMatAlgo01xDSid=void 0;var n=r(66212),i=r(6523);const s=["typed"];t.createMatAlgo01xDSid=(0,n.factory)("matAlgo01xDSid",s,(e=>{let{typed:t}=e;return function(e,r,n,s){const o=e._data,a=e._size,l=e._datatype||e.getDataType(),c=r._values,u=r._index,d=r._ptr,h=r._size,p=r._datatype||void 0===r._data?r._datatype:r.getDataType();if(a.length!==h.length)throw new i.DimensionError(a.length,h.length);if(a[0]!==h[0]||a[1]!==h[1])throw new RangeError("Dimension mismatch. Matrix A ("+a+") must match Matrix B ("+h+")");if(!c)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");const m=a[0],f=a[1],g="string"==typeof l&&"mixed"!==l&&l===p?l:void 0,y=g?t.find(n,[g,g]):n;let b,v;const _=[];for(b=0;b<m;b++)_[b]=[];const x=[],w=[];for(v=0;v<f;v++){const e=v+1;for(let t=d[v],r=d[v+1],n=t;n<r;n++)b=u[n],x[b]=s?y(c[n],o[b][v]):y(o[b][v],c[n]),w[b]=e;for(b=0;b<m;b++)w[b]===e?_[b][v]=x[b]:_[b][v]=o[b][v]}return e.createDenseMatrix({data:_,size:[m,f],datatype:l===e._datatype&&p===r._datatype?g:void 0})}}))},98225:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMatAlgo02xDS0=void 0;var n=r(66212),i=r(6523);const s=["typed","equalScalar"];t.createMatAlgo02xDS0=(0,n.factory)("matAlgo02xDS0",s,(e=>{let{typed:t,equalScalar:r}=e;return function(e,n,s,o){const a=e._data,l=e._size,c=e._datatype||e.getDataType(),u=n._values,d=n._index,h=n._ptr,p=n._size,m=n._datatype||void 0===n._data?n._datatype:n.getDataType();if(l.length!==p.length)throw new i.DimensionError(l.length,p.length);if(l[0]!==p[0]||l[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+p+")");if(!u)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");const f=l[0],g=l[1];let y,b=r,v=0,_=s;"string"==typeof c&&c===m&&"mixed"!==c&&(y=c,b=t.find(r,[y,y]),v=t.convert(0,y),_=t.find(s,[y,y]));const x=[],w=[],R=[];for(let e=0;e<g;e++){R[e]=w.length;for(let t=h[e],r=h[e+1],n=t;n<r;n++){const t=d[n],r=o?_(u[n],a[t][e]):_(a[t][e],u[n]);b(r,v)||(w.push(t),x.push(r))}}return R[g]=w.length,n.createSparseMatrix({values:x,index:w,ptr:R,size:[f,g],datatype:c===e._datatype&&m===n._datatype?y:void 0})}}))},89164:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMatAlgo03xDSf=void 0;var n=r(66212),i=r(6523);const s=["typed"];t.createMatAlgo03xDSf=(0,n.factory)("matAlgo03xDSf",s,(e=>{let{typed:t}=e;return function(e,r,n,s){const o=e._data,a=e._size,l=e._datatype||e.getDataType(),c=r._values,u=r._index,d=r._ptr,h=r._size,p=r._datatype||void 0===r._data?r._datatype:r.getDataType();if(a.length!==h.length)throw new i.DimensionError(a.length,h.length);if(a[0]!==h[0]||a[1]!==h[1])throw new RangeError("Dimension mismatch. Matrix A ("+a+") must match Matrix B ("+h+")");if(!c)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");const m=a[0],f=a[1];let g,y=0,b=n;"string"==typeof l&&l===p&&"mixed"!==l&&(g=l,y=t.convert(0,g),b=t.find(n,[g,g]));const v=[];for(let e=0;e<m;e++)v[e]=[];const _=[],x=[];for(let e=0;e<f;e++){const t=e+1;for(let r=d[e],n=d[e+1],i=r;i<n;i++){const r=u[i];_[r]=s?b(c[i],o[r][e]):b(o[r][e],c[i]),x[r]=t}for(let r=0;r<m;r++)x[r]===t?v[r][e]=_[r]:v[r][e]=s?b(y,o[r][e]):b(o[r][e],y)}return e.createDenseMatrix({data:v,size:[m,f],datatype:l===e._datatype&&p===r._datatype?g:void 0})}}))},26906:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMatAlgo04xSidSid=void 0;var n=r(66212),i=r(6523);const s=["typed","equalScalar"];t.createMatAlgo04xSidSid=(0,n.factory)("matAlgo04xSidSid",s,(e=>{let{typed:t,equalScalar:r}=e;return function(e,n,s){const o=e._values,a=e._index,l=e._ptr,c=e._size,u=e._datatype||void 0===e._data?e._datatype:e.getDataType(),d=n._values,h=n._index,p=n._ptr,m=n._size,f=n._datatype||void 0===n._data?n._datatype:n.getDataType();if(c.length!==m.length)throw new i.DimensionError(c.length,m.length);if(c[0]!==m[0]||c[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+m+")");const g=c[0],y=c[1];let b,v=r,_=0,x=s;"string"==typeof u&&u===f&&"mixed"!==u&&(b=u,v=t.find(r,[b,b]),_=t.convert(0,b),x=t.find(s,[b,b]));const w=o&&d?[]:void 0,R=[],k=[],j=o&&d?[]:void 0,z=o&&d?[]:void 0,q=[],$=[];let Z,X,Y,ee,te;for(X=0;X<y;X++){k[X]=R.length;const e=X+1;for(ee=l[X],te=l[X+1],Y=ee;Y<te;Y++)Z=a[Y],R.push(Z),q[Z]=e,j&&(j[Z]=o[Y]);for(ee=p[X],te=p[X+1],Y=ee;Y<te;Y++)if(Z=h[Y],q[Z]===e){if(j){const e=x(j[Z],d[Y]);v(e,_)?q[Z]=null:j[Z]=e}}else R.push(Z),$[Z]=e,z&&(z[Z]=d[Y]);if(j&&z)for(Y=k[X];Y<R.length;)Z=R[Y],q[Z]===e?(w[Y]=j[Z],Y++):$[Z]===e?(w[Y]=z[Z],Y++):R.splice(Y,1)}return k[y]=R.length,e.createSparseMatrix({values:w,index:R,ptr:k,size:[g,y],datatype:u===e._datatype&&f===n._datatype?b:void 0})}}))},7367:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMatAlgo05xSfSf=void 0;var n=r(66212),i=r(6523);const s=["typed","equalScalar"];t.createMatAlgo05xSfSf=(0,n.factory)("matAlgo05xSfSf",s,(e=>{let{typed:t,equalScalar:r}=e;return function(e,n,s){const o=e._values,a=e._index,l=e._ptr,c=e._size,u=e._datatype||void 0===e._data?e._datatype:e.getDataType(),d=n._values,h=n._index,p=n._ptr,m=n._size,f=n._datatype||void 0===n._data?n._datatype:n.getDataType();if(c.length!==m.length)throw new i.DimensionError(c.length,m.length);if(c[0]!==m[0]||c[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+m+")");const g=c[0],y=c[1];let b,v=r,_=0,x=s;"string"==typeof u&&u===f&&"mixed"!==u&&(b=u,v=t.find(r,[b,b]),_=t.convert(0,b),x=t.find(s,[b,b]));const w=o&&d?[]:void 0,R=[],k=[],j=w?[]:void 0,z=w?[]:void 0,q=[],$=[];let Z,X,Y,ee;for(X=0;X<y;X++){k[X]=R.length;const e=X+1;for(Y=l[X],ee=l[X+1];Y<ee;Y++)Z=a[Y],R.push(Z),q[Z]=e,j&&(j[Z]=o[Y]);for(Y=p[X],ee=p[X+1];Y<ee;Y++)Z=h[Y],q[Z]!==e&&R.push(Z),$[Z]=e,z&&(z[Z]=d[Y]);if(w)for(Y=k[X];Y<R.length;){Z=R[Y];const t=q[Z],r=$[Z];if(t===e||r===e){const n=x(t===e?j[Z]:_,r===e?z[Z]:_);v(n,_)?R.splice(Y,1):(w.push(n),Y++)}}}return k[y]=R.length,e.createSparseMatrix({values:w,index:R,ptr:k,size:[g,y],datatype:u===e._datatype&&f===n._datatype?b:void 0})}}))},116:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMatAlgo06xS0S0=void 0;var n=r(66212),i=r(6523),s=r(16624);const o=["typed","equalScalar"];t.createMatAlgo06xS0S0=(0,n.factory)("matAlgo06xS0S0",o,(e=>{let{typed:t,equalScalar:r}=e;return function(e,n,o){const a=e._values,l=e._size,c=e._datatype||void 0===e._data?e._datatype:e.getDataType(),u=n._values,d=n._size,h=n._datatype||void 0===n._data?n._datatype:n.getDataType();if(l.length!==d.length)throw new i.DimensionError(l.length,d.length);if(l[0]!==d[0]||l[1]!==d[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+d+")");const p=l[0],m=l[1];let f,g=r,y=0,b=o;"string"==typeof c&&c===h&&"mixed"!==c&&(f=c,g=t.find(r,[f,f]),y=t.convert(0,f),b=t.find(o,[f,f]));const v=a&&u?[]:void 0,_=[],x=[],w=v?[]:void 0,R=[],k=[];for(let t=0;t<m;t++){x[t]=_.length;const r=t+1;if((0,s.scatter)(e,t,R,w,k,r,_,b),(0,s.scatter)(n,t,R,w,k,r,_,b),w){let e=x[t];for(;e<_.length;){const t=_[e];if(k[t]===r){const r=w[t];g(r,y)?_.splice(e,1):(v.push(r),e++)}else _.splice(e,1)}}else{let e=x[t];for(;e<_.length;){k[_[e]]!==r?_.splice(e,1):e++}}}return x[m]=_.length,e.createSparseMatrix({values:v,index:_,ptr:x,size:[p,m],datatype:c===e._datatype&&h===n._datatype?f:void 0})}}))},88177:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMatAlgo07xSSf=void 0;var n=r(66212),i=r(6523);const s=["typed","DenseMatrix"];t.createMatAlgo07xSSf=(0,n.factory)("matAlgo07xSSf",s,(e=>{let{typed:t,DenseMatrix:r}=e;return function(e,s,o){const a=e._size,l=e._datatype||void 0===e._data?e._datatype:e.getDataType(),c=s._size,u=s._datatype||void 0===s._data?s._datatype:s.getDataType();if(a.length!==c.length)throw new i.DimensionError(a.length,c.length);if(a[0]!==c[0]||a[1]!==c[1])throw new RangeError("Dimension mismatch. Matrix A ("+a+") must match Matrix B ("+c+")");const d=a[0],h=a[1];let p,m,f,g=0,y=o;"string"==typeof l&&l===u&&"mixed"!==l&&(p=l,g=t.convert(0,p),y=t.find(o,[p,p]));const b=[];for(m=0;m<d;m++)b[m]=[];const v=[],_=[],x=[],w=[];for(f=0;f<h;f++){const t=f+1;for(n(e,f,x,v,t),n(s,f,w,_,t),m=0;m<d;m++){const e=x[m]===t?v[m]:g,r=w[m]===t?_[m]:g;b[m][f]=y(e,r)}}return new r({data:b,size:[d,h],datatype:l===e._datatype&&u===s._datatype?p:void 0})};function n(e,t,r,n,i){const s=e._values,o=e._index,a=e._ptr;for(let e=a[t],l=a[t+1];e<l;e++){const t=o[e];r[t]=i,n[t]=s[e]}}}))},15889:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMatAlgo08xS0Sid=void 0;var n=r(66212),i=r(6523);const s=["typed","equalScalar"];t.createMatAlgo08xS0Sid=(0,n.factory)("matAlgo08xS0Sid",s,(e=>{let{typed:t,equalScalar:r}=e;return function(e,n,s){const o=e._values,a=e._index,l=e._ptr,c=e._size,u=e._datatype||void 0===e._data?e._datatype:e.getDataType(),d=n._values,h=n._index,p=n._ptr,m=n._size,f=n._datatype||void 0===n._data?n._datatype:n.getDataType();if(c.length!==m.length)throw new i.DimensionError(c.length,m.length);if(c[0]!==m[0]||c[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+m+")");if(!o||!d)throw new Error("Cannot perform operation on Pattern Sparse Matrices");const g=c[0],y=c[1];let b,v=r,_=0,x=s;"string"==typeof u&&u===f&&"mixed"!==u&&(b=u,v=t.find(r,[b,b]),_=t.convert(0,b),x=t.find(s,[b,b]));const w=[],R=[],k=[],j=[],z=[];let q,$,Z,X;for(let e=0;e<y;e++){k[e]=R.length;const t=e+1;for($=l[e],Z=l[e+1],q=$;q<Z;q++)X=a[q],z[X]=t,j[X]=o[q],R.push(X);for($=p[e],Z=p[e+1],q=$;q<Z;q++)X=h[q],z[X]===t&&(j[X]=x(j[X],d[q]));for(q=k[e];q<R.length;){X=R[q];const e=j[X];v(e,_)?R.splice(q,1):(w.push(e),q++)}}return k[y]=R.length,e.createSparseMatrix({values:w,index:R,ptr:k,size:[g,y],datatype:u===e._datatype&&f===n._datatype?b:void 0})}}))},12485:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMatAlgo09xS0Sf=void 0;var n=r(66212),i=r(6523);const s=["typed","equalScalar"];t.createMatAlgo09xS0Sf=(0,n.factory)("matAlgo09xS0Sf",s,(e=>{let{typed:t,equalScalar:r}=e;return function(e,n,s){const o=e._values,a=e._index,l=e._ptr,c=e._size,u=e._datatype||void 0===e._data?e._datatype:e.getDataType(),d=n._values,h=n._index,p=n._ptr,m=n._size,f=n._datatype||void 0===n._data?n._datatype:n.getDataType();if(c.length!==m.length)throw new i.DimensionError(c.length,m.length);if(c[0]!==m[0]||c[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+m+")");const g=c[0],y=c[1];let b,v=r,_=0,x=s;"string"==typeof u&&u===f&&"mixed"!==u&&(b=u,v=t.find(r,[b,b]),_=t.convert(0,b),x=t.find(s,[b,b]));const w=o&&d?[]:void 0,R=[],k=[],j=w?[]:void 0,z=[];let q,$,Z,X,Y;for($=0;$<y;$++){k[$]=R.length;const e=$+1;if(j)for(X=p[$],Y=p[$+1],Z=X;Z<Y;Z++)q=h[Z],z[q]=e,j[q]=d[Z];for(X=l[$],Y=l[$+1],Z=X;Z<Y;Z++)if(q=a[Z],j){const t=z[q]===e?j[q]:_,r=x(o[Z],t);v(r,_)||(R.push(q),w.push(r))}else R.push(q)}return k[y]=R.length,e.createSparseMatrix({values:w,index:R,ptr:k,size:[g,y],datatype:u===e._datatype&&f===n._datatype?b:void 0})}}))},8896:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMatAlgo10xSids=void 0;var n=r(66212);const i=["typed","DenseMatrix"];t.createMatAlgo10xSids=(0,n.factory)("matAlgo10xSids",i,(e=>{let{typed:t,DenseMatrix:r}=e;return function(e,n,i,s){const o=e._values,a=e._index,l=e._ptr,c=e._size,u=e._datatype;if(!o)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");const d=c[0],h=c[1];let p,m=i;"string"==typeof u&&(p=u,n=t.convert(n,p),m=t.find(i,[p,p]));const f=[],g=[],y=[];for(let e=0;e<h;e++){const t=e+1;for(let r=l[e],n=l[e+1],i=r;i<n;i++){const e=a[i];g[e]=o[i],y[e]=t}for(let r=0;r<d;r++)0===e&&(f[r]=[]),y[r]===t?f[r][e]=s?m(n,g[r]):m(g[r],n):f[r][e]=n}return new r({data:f,size:[d,h],datatype:p})}}))},73670:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMatAlgo11xS0s=void 0;var n=r(66212);const i=["typed","equalScalar"];t.createMatAlgo11xS0s=(0,n.factory)("matAlgo11xS0s",i,(e=>{let{typed:t,equalScalar:r}=e;return function(e,n,i,s){const o=e._values,a=e._index,l=e._ptr,c=e._size,u=e._datatype;if(!o)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");const d=c[0],h=c[1];let p,m=r,f=0,g=i;"string"==typeof u&&(p=u,m=t.find(r,[p,p]),f=t.convert(0,p),n=t.convert(n,p),g=t.find(i,[p,p]));const y=[],b=[],v=[];for(let e=0;e<h;e++){v[e]=b.length;for(let t=l[e],r=l[e+1],i=t;i<r;i++){const e=a[i],t=s?g(n,o[i]):g(o[i],n);m(t,f)||(b.push(e),y.push(t))}}return v[h]=b.length,e.createSparseMatrix({values:y,index:b,ptr:v,size:[d,h],datatype:p})}}))},47993:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMatAlgo12xSfs=void 0;var n=r(66212);const i=["typed","DenseMatrix"];t.createMatAlgo12xSfs=(0,n.factory)("matAlgo12xSfs",i,(e=>{let{typed:t,DenseMatrix:r}=e;return function(e,n,i,s){const o=e._values,a=e._index,l=e._ptr,c=e._size,u=e._datatype;if(!o)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");const d=c[0],h=c[1];let p,m=i;"string"==typeof u&&(p=u,n=t.convert(n,p),m=t.find(i,[p,p]));const f=[],g=[],y=[];for(let e=0;e<h;e++){const t=e+1;for(let r=l[e],n=l[e+1],i=r;i<n;i++){const e=a[i];g[e]=o[i],y[e]=t}for(let r=0;r<d;r++)0===e&&(f[r]=[]),y[r]===t?f[r][e]=s?m(n,g[r]):m(g[r],n):f[r][e]=s?m(n,0):m(0,n)}return new r({data:f,size:[d,h],datatype:p})}}))},32782:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMatAlgo13xDD=void 0;var n=r(66212),i=r(6523);const s=["typed"];t.createMatAlgo13xDD=(0,n.factory)("matAlgo13xDD",s,(e=>{let{typed:t}=e;return function(e,n,s){const o=e._data,a=e._size,l=e._datatype,c=n._data,u=n._size,d=n._datatype,h=[];if(a.length!==u.length)throw new i.DimensionError(a.length,u.length);for(let e=0;e<a.length;e++){if(a[e]!==u[e])throw new RangeError("Dimension mismatch. Matrix A ("+a+") must match Matrix B ("+u+")");h[e]=a[e]}let p,m=s;"string"==typeof l&&l===d&&(p=l,m=t.find(s,[p,p]));const f=h.length>0?r(m,0,h,h[0],o,c):[];return e.createDenseMatrix({data:f,size:h,datatype:p})};function r(e,t,n,i,s,o){const a=[];if(t===n.length-1)for(let t=0;t<i;t++)a[t]=e(s[t],o[t]);else for(let l=0;l<i;l++)a[l]=r(e,t+1,n,n[t+1],s[l],o[l]);return a}}))},18568:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMatAlgo14xDs=void 0;var n=r(66212),i=r(61175);const s=["typed"];t.createMatAlgo14xDs=(0,n.factory)("matAlgo14xDs",s,(e=>{let{typed:t}=e;return function(e,n,s,o){const a=e._data,l=e._size,c=e._datatype;let u,d=s;"string"==typeof c&&(u=c,n=t.convert(n,u),d=t.find(s,[u,u]));const h=l.length>0?r(d,0,l,l[0],a,n,o):[];return e.createDenseMatrix({data:h,size:(0,i.clone)(l),datatype:u})};function r(e,t,n,i,s,o,a){const l=[];if(t===n.length-1)for(let t=0;t<i;t++)l[t]=a?e(o,s[t]):e(s[t],o);else for(let c=0;c<i;c++)l[c]=r(e,t+1,n,n[t+1],s[c],o,a);return l}}))},11279:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMatrixAlgorithmSuite=void 0;var n=r(66212),i=r(61175),s=r(32782),o=r(18568),a=r(71142);const l=["typed","matrix"];t.createMatrixAlgorithmSuite=(0,n.factory)("matrixAlgorithmSuite",l,(e=>{let{typed:t,matrix:r}=e;const n=(0,s.createMatAlgo13xDD)({typed:t}),l=(0,o.createMatAlgo14xDs)({typed:t});return function(e){const s=e.elop,o=e.SD||e.DS;let c;s?(c={"DenseMatrix, DenseMatrix":(e,t)=>n(...(0,a.broadcast)(e,t),s),"Array, Array":(e,t)=>n(...(0,a.broadcast)(r(e),r(t)),s).valueOf(),"Array, DenseMatrix":(e,t)=>n(...(0,a.broadcast)(r(e),t),s),"DenseMatrix, Array":(e,t)=>n(...(0,a.broadcast)(e,r(t)),s)},e.SS&&(c["SparseMatrix, SparseMatrix"]=(t,r)=>e.SS(...(0,a.broadcast)(t,r),s,!1)),e.DS&&(c["DenseMatrix, SparseMatrix"]=(t,r)=>e.DS(...(0,a.broadcast)(t,r),s,!1),c["Array, SparseMatrix"]=(t,n)=>e.DS(...(0,a.broadcast)(r(t),n),s,!1)),o&&(c["SparseMatrix, DenseMatrix"]=(e,t)=>o(...(0,a.broadcast)(t,e),s,!0),c["SparseMatrix, Array"]=(e,t)=>o(...(0,a.broadcast)(r(t),e),s,!0))):(c={"DenseMatrix, DenseMatrix":t.referToSelf((e=>(t,r)=>n(...(0,a.broadcast)(t,r),e))),"Array, Array":t.referToSelf((e=>(t,i)=>n(...(0,a.broadcast)(r(t),r(i)),e).valueOf())),"Array, DenseMatrix":t.referToSelf((e=>(t,i)=>n(...(0,a.broadcast)(r(t),i),e))),"DenseMatrix, Array":t.referToSelf((e=>(t,i)=>n(...(0,a.broadcast)(t,r(i)),e)))},e.SS&&(c["SparseMatrix, SparseMatrix"]=t.referToSelf((t=>(r,n)=>e.SS(...(0,a.broadcast)(r,n),t,!1)))),e.DS&&(c["DenseMatrix, SparseMatrix"]=t.referToSelf((t=>(r,n)=>e.DS(...(0,a.broadcast)(r,n),t,!1))),c["Array, SparseMatrix"]=t.referToSelf((t=>(n,i)=>e.DS(...(0,a.broadcast)(r(n),i),t,!1)))),o&&(c["SparseMatrix, DenseMatrix"]=t.referToSelf((e=>(t,r)=>o(...(0,a.broadcast)(r,t),e,!0))),c["SparseMatrix, Array"]=t.referToSelf((e=>(t,n)=>o(...(0,a.broadcast)(r(n),t),e,!0)))));const u=e.scalar||"any";(e.Ds||e.Ss)&&(s?(c["DenseMatrix,"+u]=(e,t)=>l(e,t,s,!1),c[u+", DenseMatrix"]=(e,t)=>l(t,e,s,!0),c["Array,"+u]=(e,t)=>l(r(e),t,s,!1).valueOf(),c[u+", Array"]=(e,t)=>l(r(t),e,s,!0).valueOf()):(c["DenseMatrix,"+u]=t.referToSelf((e=>(t,r)=>l(t,r,e,!1))),c[u+", DenseMatrix"]=t.referToSelf((e=>(t,r)=>l(r,t,e,!0))),c["Array,"+u]=t.referToSelf((e=>(t,n)=>l(r(t),n,e,!1).valueOf())),c[u+", Array"]=t.referToSelf((e=>(t,n)=>l(r(n),t,e,!0).valueOf()))));const d=void 0!==e.sS?e.sS:e.Ss;return s?(e.Ss&&(c["SparseMatrix,"+u]=(t,r)=>e.Ss(t,r,s,!1)),d&&(c[u+", SparseMatrix"]=(e,t)=>d(t,e,s,!0))):(e.Ss&&(c["SparseMatrix,"+u]=t.referToSelf((t=>(r,n)=>e.Ss(r,n,t,!1)))),d&&(c[u+", SparseMatrix"]=t.referToSelf((e=>(t,r)=>d(r,t,e,!0))))),s&&s.signatures&&(0,i.extend)(c,s.signatures),c}}))},26960:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createNumber=void 0;var n=r(66212),i=r(16624);const s=["typed"];t.createNumber=(0,n.factory)("number",s,(e=>{let{typed:t}=e;const r=t("number",{"":function(){return 0},number:function(e){return e},string:function(e){if("NaN"===e)return NaN;const t=function(e){const t=e.match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/);if(t)return{input:e,radix:{"0b":2,"0o":8,"0x":16}[t[1]],integerPart:t[2],fractionalPart:t[3]};return null}(e);if(t)return function(e){const t=parseInt(e.integerPart,e.radix);let r=0;for(let t=0;t<e.fractionalPart.length;t++)r+=parseInt(e.fractionalPart[t],e.radix)/Math.pow(e.radix,t+1);const n=t+r;if(isNaN(n))throw new SyntaxError('String "'+e.input+'" is not a valid number');return n}(t);let r=0;const n=e.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);n&&(r=Number(n[2]),e=n[1]);let i=Number(e);if(isNaN(i))throw new SyntaxError('String "'+e+'" is not a valid number');if(n){if(i>2**r-1)throw new SyntaxError(`String "${e}" is out of range`);i>=2**(r-1)&&(i-=2**r)}return i},BigNumber:function(e){return e.toNumber()},bigint:function(e){return Number(e)},Fraction:function(e){return e.valueOf()},Unit:t.referToSelf((e=>t=>{const r=t.clone();return r.value=e(t.value),r})),null:function(e){return 0},"Unit, string | Unit":function(e,t){return e.toNumber(t)},"Array | Matrix":t.referToSelf((e=>t=>(0,i.deepMap)(t,e)))});return r.fromJSON=function(e){return parseFloat(e.value)},r}))},43542:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createResultSet=void 0;var n=r(66212);const i=[];t.createResultSet=(0,n.factory)("ResultSet",i,(()=>{function ResultSet(e){if(!(this instanceof ResultSet))throw new SyntaxError("Constructor must be called with the new operator");this.entries=e||[]}return ResultSet.prototype.type="ResultSet",ResultSet.prototype.isResultSet=!0,ResultSet.prototype.valueOf=function(){return this.entries},ResultSet.prototype.toString=function(){return"["+this.entries.join(", ")+"]"},ResultSet.prototype.toJSON=function(){return{mathjs:"ResultSet",entries:this.entries}},ResultSet.fromJSON=function(e){return new ResultSet(e.entries)},ResultSet}),{isClass:!0})},84:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createString=void 0;var n=r(66212),i=r(16624),s=r(34749);const o="string",a=["typed"];t.createString=(0,n.factory)(o,a,(e=>{let{typed:t}=e;return t(o,{"":function(){return""},number:s.format,null:function(e){return"null"},boolean:function(e){return e+""},string:function(e){return e},"Array | Matrix":t.referToSelf((e=>t=>(0,i.deepMap)(t,e))),any:function(e){return String(e)}})}))},56708:(e,t,r)=>{"use strict";var n=r(87929);Object.defineProperty(t,"__esModule",{value:!0}),t.createUnitClass=void 0;var i=n(r(37693)),s=r(91612),o=r(66212),a=r(76560),l=r(7041),c=r(61175),u=r(44879);const d=["?on","config","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","abs","fix","round","equal","isNumeric","format","number","Complex","BigNumber","Fraction"];t.createUnitClass=(0,o.factory)("Unit",d,(e=>{let{on:t,config:r,addScalar:n,subtractScalar:o,multiplyScalar:d,divideScalar:h,pow:p,abs:m,fix:f,round:g,equal:y,isNumeric:b,format:v,number:_,Complex:x,BigNumber:w,Fraction:R}=e;const k=_;function Unit(e,t){if(!(this instanceof Unit))throw new Error("Constructor must be called with the new operator");if(null!=e&&!b(e)&&!(0,s.isComplex)(e))throw new TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if(this.fixPrefix=!1,this.skipAutomaticSimplification=!0,void 0===t)this.units=[],this.dimensions=oe.map((e=>0));else if("string"==typeof t){const e=Unit.parse(t);this.units=e.units,this.dimensions=e.dimensions}else{if(!(0,s.isUnit)(t)||null!==t.value)throw new TypeError("Second parameter in Unit constructor must be a string or valueless Unit");this.fixPrefix=t.fixPrefix,this.skipAutomaticSimplification=t.skipAutomaticSimplification,this.dimensions=t.dimensions.slice(0),this.units=t.units.map((e=>(0,i.default)({},e)))}this.value=this._normalize(e)}let j,z,q;function $(){for(;" "===q||"\t"===q;)X()}function Z(e){return e>="0"&&e<="9"}function X(){z++,q=j.charAt(z)}function Y(e){z=e,q=j.charAt(z)}function ee(){let e="";const t=z;if("+"===q?X():"-"===q&&(e+=q,X()),!((r=q)>="0"&&r<="9"||"."===r))return Y(t),null;var r;if("."===q){if(e+=q,X(),!Z(q))return Y(t),null}else{for(;Z(q);)e+=q,X();"."===q&&(e+=q,X())}for(;Z(q);)e+=q,X();if("E"===q||"e"===q){let t="";const r=z;if(t+=q,X(),"+"!==q&&"-"!==q||(t+=q,X()),!Z(q))return Y(r),e;for(e+=t;Z(q);)e+=q,X()}return e}function te(){let e="";for(;Z(q)||Unit.isValidAlpha(q);)e+=q,X();const t=e.charAt(0);return Unit.isValidAlpha(t)?e:null}function re(e){return q===e?(X(),e):null}Object.defineProperty(Unit,"name",{value:"Unit"}),Unit.prototype.constructor=Unit,Unit.prototype.type="Unit",Unit.prototype.isUnit=!0,Unit.parse=function(e,t){if(t=t||{},j=e,z=-1,q="","string"!=typeof j)throw new TypeError("Invalid argument in Unit.parse, string expected");const n=new Unit;n.units=[];let i=1,s=!1;X(),$();const o=ee();let a=null;if(o){if("BigNumber"===r.number)a=new w(o);else if("Fraction"===r.number)try{a=new R(o)}catch(e){a=parseFloat(o)}else a=parseFloat(o);$(),re("*")?(i=1,s=!0):re("/")&&(i=-1,s=!0)}const l=[];let c=1;for(;;){for($();"("===q;)l.push(i),c*=i,i=1,X(),$();let t;if(!q)break;{const e=q;if(t=te(),null===t)throw new SyntaxError('Unexpected "'+e+'" in "'+j+'" at index '+z.toString())}const r=ne(t);if(null===r)throw new SyntaxError('Unit "'+t+'" not found.');let o=i*c;if($(),re("^")){$();const t=ee();if(null===t)throw new SyntaxError('In "'+e+'", "^" must be followed by a floating-point number');o*=t}n.units.push({unit:r.unit,prefix:r.prefix,power:o});for(let e=0;e<oe.length;e++)n.dimensions[e]+=(r.unit.dimensions[e]||0)*o;for($();")"===q;){if(0===l.length)throw new SyntaxError('Unmatched ")" in "'+j+'" at index '+z.toString());c/=l.pop(),X(),$()}if(s=!1,re("*")?(i=1,s=!0):re("/")?(i=-1,s=!0):i=1,r.unit.base){const e=r.unit.base.key;he.auto[e]={unit:r.unit,prefix:r.prefix}}}if($(),q)throw new SyntaxError('Could not parse: "'+e+'"');if(s)throw new SyntaxError('Trailing characters: "'+e+'"');if(0!==l.length)throw new SyntaxError('Unmatched "(" in "'+j+'"');if(0===n.units.length&&!t.allowNoUnits)throw new SyntaxError('"'+e+'" contains no units');return n.value=void 0!==a?n._normalize(a):null,n},Unit.prototype.clone=function(){const e=new Unit;e.fixPrefix=this.fixPrefix,e.skipAutomaticSimplification=this.skipAutomaticSimplification,e.value=(0,c.clone)(this.value),e.dimensions=this.dimensions.slice(0),e.units=[];for(let t=0;t<this.units.length;t++){e.units[t]={};for(const r in this.units[t])(0,c.hasOwnProperty)(this.units[t],r)&&(e.units[t][r]=this.units[t][r])}return e},Unit.prototype.valueType=function(){return(0,s.typeOf)(this.value)},Unit.prototype._isDerived=function(){return 0!==this.units.length&&(this.units.length>1||Math.abs(this.units[0].power-1)>1e-15)},Unit.prototype._normalize=function(e){if(null==e||0===this.units.length)return e;let t=e;const r=Unit._getNumberConverter((0,s.typeOf)(e));for(let e=0;e<this.units.length;e++){const n=r(this.units[e].unit.value),i=r(this.units[e].prefix.value),s=r(this.units[e].power);t=d(t,p(d(n,i),s))}return t},Unit.prototype._denormalize=function(e,t){if(null==e||0===this.units.length)return e;let r=e;const n=Unit._getNumberConverter((0,s.typeOf)(e));for(let e=0;e<this.units.length;e++){const t=n(this.units[e].unit.value),i=n(this.units[e].prefix.value),s=n(this.units[e].power);r=h(r,p(d(t,i),s))}return r};const ne=(0,a.memoize)((e=>{if((0,c.hasOwnProperty)(ce,e)){const t=ce[e];return{unit:t,prefix:t.prefixes[""]}}for(const t in ce)if((0,c.hasOwnProperty)(ce,t)&&(0,l.endsWith)(e,t)){const r=ce[t],n=e.length-t.length,i=e.substring(0,n),s=(0,c.hasOwnProperty)(r.prefixes,i)?r.prefixes[i]:void 0;if(void 0!==s)return{unit:r,prefix:s}}return null}),{hasher:e=>e[0],limit:100});function ie(e){return e.equalBase(ae.NONE)&&null!==e.value&&!r.predictable?e.value:e}Unit.isValuelessUnit=function(e){return null!==ne(e)},Unit.prototype.hasBase=function(e){if("string"==typeof e&&(e=ae[e]),!e)return!1;for(let t=0;t<oe.length;t++)if(Math.abs((this.dimensions[t]||0)-(e.dimensions[t]||0))>1e-12)return!1;return!0},Unit.prototype.equalBase=function(e){for(let t=0;t<oe.length;t++)if(Math.abs((this.dimensions[t]||0)-(e.dimensions[t]||0))>1e-12)return!1;return!0},Unit.prototype.equals=function(e){return this.equalBase(e)&&y(this.value,e.value)},Unit.prototype.multiply=function(e){const t=this.clone(),r=(0,s.isUnit)(e)?e:new Unit(e);for(let e=0;e<oe.length;e++)t.dimensions[e]=(this.dimensions[e]||0)+(r.dimensions[e]||0);for(let e=0;e<r.units.length;e++){const n={...r.units[e]};t.units.push(n)}if(null!==this.value||null!==r.value){const e=null===this.value?this._normalize(1):this.value,n=null===r.value?r._normalize(1):r.value;t.value=d(e,n)}else t.value=null;return(0,s.isUnit)(e)&&(t.skipAutomaticSimplification=!1),ie(t)},Unit.prototype.divideInto=function(e){return new Unit(e).divide(this)},Unit.prototype.divide=function(e){const t=this.clone(),r=(0,s.isUnit)(e)?e:new Unit(e);for(let e=0;e<oe.length;e++)t.dimensions[e]=(this.dimensions[e]||0)-(r.dimensions[e]||0);for(let e=0;e<r.units.length;e++){const n={...r.units[e],power:-r.units[e].power};t.units.push(n)}if(null!==this.value||null!==r.value){const e=null===this.value?this._normalize(1):this.value,n=null===r.value?r._normalize(1):r.value;t.value=h(e,n)}else t.value=null;return(0,s.isUnit)(e)&&(t.skipAutomaticSimplification=!1),ie(t)},Unit.prototype.pow=function(e){const t=this.clone();for(let r=0;r<oe.length;r++)t.dimensions[r]=(this.dimensions[r]||0)*e;for(let r=0;r<t.units.length;r++)t.units[r].power*=e;return null!==t.value?t.value=p(t.value,e):t.value=null,t.skipAutomaticSimplification=!1,ie(t)},Unit.prototype.abs=function(){const e=this.clone();if(null!==e.value)if(e._isDerived()||0===e.units.length||0===e.units[0].unit.offset)e.value=m(e.value);else{const t=e._numberConverter(),r=t(e.units[0].unit.value),i=t(e.units[0].unit.offset),s=d(r,i);e.value=o(m(n(e.value,s)),s)}for(const t in e.units)"VA"!==e.units[t].unit.name&&"VAR"!==e.units[t].unit.name||(e.units[t].unit=ce.W);return e},Unit.prototype.to=function(e){const t=null===this.value?this._normalize(1):this.value;let r;if("string"==typeof e)r=Unit.parse(e);else{if(!(0,s.isUnit)(e))throw new Error("String or Unit expected as parameter");r=e.clone()}if(!this.equalBase(r))throw new Error(`Units do not match ('${r.toString()}' != '${this.toString()}')`);if(null!==r.value)throw new Error("Cannot convert to a unit with a value");if(null===this.value||this._isDerived()||0===this.units.length||0===r.units.length||this.units[0].unit.offset===r.units[0].unit.offset)r.value=(0,c.clone)(t);else{const e=Unit._getNumberConverter((0,s.typeOf)(t)),i=this.units[0].unit.value,a=this.units[0].unit.offset,l=d(i,a),c=r.units[0].unit.value,u=r.units[0].unit.offset,h=d(c,u);r.value=n(t,e(o(l,h)))}return r.fixPrefix=!0,r.skipAutomaticSimplification=!0,r},Unit.prototype.toNumber=function(e){return k(this.toNumeric(e))},Unit.prototype.toNumeric=function(e){let t;return t=e?this.to(e):this.clone(),t._isDerived()||0===t.units.length?t._denormalize(t.value):t._denormalize(t.value,t.units[0].prefix.value)},Unit.prototype.toString=function(){return this.format()},Unit.prototype.toJSON=function(){return{mathjs:"Unit",value:this._denormalize(this.value),unit:this.units.length>0?this.formatUnits():null,fixPrefix:this.fixPrefix}},Unit.fromJSON=function(e){var t;const r=new Unit(e.value,null!==(t=e.unit)&&void 0!==t?t:void 0);return r.fixPrefix=e.fixPrefix||!1,r},Unit.prototype.valueOf=Unit.prototype.toString,Unit.prototype.simplify=function(){const e=this.clone(),t=[];let r;for(const t in pe)if((0,c.hasOwnProperty)(pe,t)&&e.hasBase(ae[t])){r=t;break}if("NONE"===r)e.units=[];else{let n;if(r&&(0,c.hasOwnProperty)(pe,r)&&(n=pe[r]),n)e.units=[{unit:n.unit,prefix:n.prefix,power:1}];else{let r=!1;for(let n=0;n<oe.length;n++){const i=oe[n];Math.abs(e.dimensions[n]||0)>1e-12&&((0,c.hasOwnProperty)(pe,i)?t.push({unit:pe[i].unit,prefix:pe[i].prefix,power:e.dimensions[n]||0}):r=!0)}t.length<e.units.length&&!r&&(e.units=t)}}return e},Unit.prototype.toSI=function(){const e=this.clone(),t=[];for(let r=0;r<oe.length;r++){const n=oe[r];if(Math.abs(e.dimensions[r]||0)>1e-12){if(!(0,c.hasOwnProperty)(he.si,n))throw new Error("Cannot express custom unit "+n+" in SI units");t.push({unit:he.si[n].unit,prefix:he.si[n].prefix,power:e.dimensions[r]||0})}}return e.units=t,e.fixPrefix=!0,e.skipAutomaticSimplification=!0,null!==this.value?(e.value=null,this.to(e)):e},Unit.prototype.formatUnits=function(){let e="",t="",r=0,n=0;for(let t=0;t<this.units.length;t++)this.units[t].power>0?(r++,e+=" "+this.units[t].prefix.name+this.units[t].unit.name,Math.abs(this.units[t].power-1)>1e-15&&(e+="^"+this.units[t].power)):this.units[t].power<0&&n++;if(n>0)for(let e=0;e<this.units.length;e++)this.units[e].power<0&&(r>0?(t+=" "+this.units[e].prefix.name+this.units[e].unit.name,Math.abs(this.units[e].power+1)>1e-15&&(t+="^"+-this.units[e].power)):(t+=" "+this.units[e].prefix.name+this.units[e].unit.name,t+="^"+this.units[e].power));e=e.substr(1),t=t.substr(1),r>1&&n>0&&(e="("+e+")"),n>1&&r>0&&(t="("+t+")");let i=e;return r>0&&n>0&&(i+=" / "),i+=t,i},Unit.prototype.format=function(e){const t=this.skipAutomaticSimplification||null===this.value?this.clone():this.simplify();let r=!1;void 0!==t.value&&null!==t.value&&(0,s.isComplex)(t.value)&&(r=Math.abs(t.value.re)<1e-14);for(const e in t.units)(0,c.hasOwnProperty)(t.units,e)&&t.units[e].unit&&("VA"===t.units[e].unit.name&&r?t.units[e].unit=ce.VAR:"VAR"!==t.units[e].unit.name||r||(t.units[e].unit=ce.VA));1!==t.units.length||t.fixPrefix||Math.abs(t.units[0].power-Math.round(t.units[0].power))<1e-14&&(t.units[0].prefix=t._bestPrefix());const n=t._denormalize(t.value);let i=null!==t.value?v(n,e||{}):"";const o=t.formatUnits();return t.value&&(0,s.isComplex)(t.value)&&(i="("+i+")"),o.length>0&&i.length>0&&(i+=" "),i+=o,i},Unit.prototype._bestPrefix=function(){if(1!==this.units.length)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");if(Math.abs(this.units[0].power-Math.round(this.units[0].power))>=1e-14)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");const e=null!==this.value?m(this.value):0,t=m(this.units[0].unit.value);let r=this.units[0].prefix;if(0===e)return r;const n=this.units[0].power;let i=Math.log(e/Math.pow(r.value*t,n))/Math.LN10-1.2;if(i>-2.200001&&i<1.800001)return r;i=Math.abs(i);const s=this.units[0].unit.prefixes;for(const o in s)if((0,c.hasOwnProperty)(s,o)){const a=s[o];if(a.scientific){const s=Math.abs(Math.log(e/Math.pow(a.value*t,n))/Math.LN10-1.2);(s<i||s===i&&a.name.length<r.name.length)&&(r=a,i=s)}}return r},Unit.prototype.splitUnit=function(e){let t=this.clone();const r=[];for(let n=0;n<e.length&&(t=t.to(e[n]),n!==e.length-1);n++){const i=t.toNumeric(),s=g(i);let a;a=y(s,i)?s:f(t.toNumeric());const l=new Unit(a,e[n].toString());r.push(l),t=o(t,l)}let i=0;for(let e=0;e<r.length;e++)i=n(i,r[e].value);return y(i,this.value)&&(t.value=0),r.push(t),r};const se={NONE:{"":{name:"",value:1,scientific:!0}},SHORT:{"":{name:"",value:1,scientific:!0},da:{name:"da",value:10,scientific:!1},h:{name:"h",value:100,scientific:!1},k:{name:"k",value:1e3,scientific:!0},M:{name:"M",value:1e6,scientific:!0},G:{name:"G",value:1e9,scientific:!0},T:{name:"T",value:1e12,scientific:!0},P:{name:"P",value:1e15,scientific:!0},E:{name:"E",value:1e18,scientific:!0},Z:{name:"Z",value:1e21,scientific:!0},Y:{name:"Y",value:1e24,scientific:!0},R:{name:"R",value:1e27,scientific:!0},Q:{name:"Q",value:1e30,scientific:!0},d:{name:"d",value:.1,scientific:!1},c:{name:"c",value:.01,scientific:!1},m:{name:"m",value:.001,scientific:!0},u:{name:"u",value:1e-6,scientific:!0},n:{name:"n",value:1e-9,scientific:!0},p:{name:"p",value:1e-12,scientific:!0},f:{name:"f",value:1e-15,scientific:!0},a:{name:"a",value:1e-18,scientific:!0},z:{name:"z",value:1e-21,scientific:!0},y:{name:"y",value:1e-24,scientific:!0},r:{name:"r",value:1e-27,scientific:!0},q:{name:"q",value:1e-30,scientific:!0}},LONG:{"":{name:"",value:1,scientific:!0},deca:{name:"deca",value:10,scientific:!1},hecto:{name:"hecto",value:100,scientific:!1},kilo:{name:"kilo",value:1e3,scientific:!0},mega:{name:"mega",value:1e6,scientific:!0},giga:{name:"giga",value:1e9,scientific:!0},tera:{name:"tera",value:1e12,scientific:!0},peta:{name:"peta",value:1e15,scientific:!0},exa:{name:"exa",value:1e18,scientific:!0},zetta:{name:"zetta",value:1e21,scientific:!0},yotta:{name:"yotta",value:1e24,scientific:!0},ronna:{name:"ronna",value:1e27,scientific:!0},quetta:{name:"quetta",value:1e30,scientific:!0},deci:{name:"deci",value:.1,scientific:!1},centi:{name:"centi",value:.01,scientific:!1},milli:{name:"milli",value:.001,scientific:!0},micro:{name:"micro",value:1e-6,scientific:!0},nano:{name:"nano",value:1e-9,scientific:!0},pico:{name:"pico",value:1e-12,scientific:!0},femto:{name:"femto",value:1e-15,scientific:!0},atto:{name:"atto",value:1e-18,scientific:!0},zepto:{name:"zepto",value:1e-21,scientific:!0},yocto:{name:"yocto",value:1e-24,scientific:!0},ronto:{name:"ronto",value:1e-27,scientific:!0},quecto:{name:"quecto",value:1e-30,scientific:!0}},SQUARED:{"":{name:"",value:1,scientific:!0},da:{name:"da",value:100,scientific:!1},h:{name:"h",value:1e4,scientific:!1},k:{name:"k",value:1e6,scientific:!0},M:{name:"M",value:1e12,scientific:!0},G:{name:"G",value:1e18,scientific:!0},T:{name:"T",value:1e24,scientific:!0},P:{name:"P",value:1e30,scientific:!0},E:{name:"E",value:1e36,scientific:!0},Z:{name:"Z",value:1e42,scientific:!0},Y:{name:"Y",value:1e48,scientific:!0},R:{name:"R",value:1e54,scientific:!0},Q:{name:"Q",value:1e60,scientific:!0},d:{name:"d",value:.01,scientific:!1},c:{name:"c",value:1e-4,scientific:!1},m:{name:"m",value:1e-6,scientific:!0},u:{name:"u",value:1e-12,scientific:!0},n:{name:"n",value:1e-18,scientific:!0},p:{name:"p",value:1e-24,scientific:!0},f:{name:"f",value:1e-30,scientific:!0},a:{name:"a",value:1e-36,scientific:!0},z:{name:"z",value:1e-42,scientific:!0},y:{name:"y",value:1e-48,scientific:!0},r:{name:"r",value:1e-54,scientific:!0},q:{name:"q",value:1e-60,scientific:!0}},CUBIC:{"":{name:"",value:1,scientific:!0},da:{name:"da",value:1e3,scientific:!1},h:{name:"h",value:1e6,scientific:!1},k:{name:"k",value:1e9,scientific:!0},M:{name:"M",value:1e18,scientific:!0},G:{name:"G",value:1e27,scientific:!0},T:{name:"T",value:1e36,scientific:!0},P:{name:"P",value:1e45,scientific:!0},E:{name:"E",value:1e54,scientific:!0},Z:{name:"Z",value:1e63,scientific:!0},Y:{name:"Y",value:1e72,scientific:!0},R:{name:"R",value:1e81,scientific:!0},Q:{name:"Q",value:1e90,scientific:!0},d:{name:"d",value:.001,scientific:!1},c:{name:"c",value:1e-6,scientific:!1},m:{name:"m",value:1e-9,scientific:!0},u:{name:"u",value:1e-18,scientific:!0},n:{name:"n",value:1e-27,scientific:!0},p:{name:"p",value:1e-36,scientific:!0},f:{name:"f",value:1e-45,scientific:!0},a:{name:"a",value:1e-54,scientific:!0},z:{name:"z",value:1e-63,scientific:!0},y:{name:"y",value:1e-72,scientific:!0},r:{name:"r",value:1e-81,scientific:!0},q:{name:"q",value:1e-90,scientific:!0}},BINARY_SHORT_SI:{"":{name:"",value:1,scientific:!0},k:{name:"k",value:1e3,scientific:!0},M:{name:"M",value:1e6,scientific:!0},G:{name:"G",value:1e9,scientific:!0},T:{name:"T",value:1e12,scientific:!0},P:{name:"P",value:1e15,scientific:!0},E:{name:"E",value:1e18,scientific:!0},Z:{name:"Z",value:1e21,scientific:!0},Y:{name:"Y",value:1e24,scientific:!0}},BINARY_SHORT_IEC:{"":{name:"",value:1,scientific:!0},Ki:{name:"Ki",value:1024,scientific:!0},Mi:{name:"Mi",value:Math.pow(1024,2),scientific:!0},Gi:{name:"Gi",value:Math.pow(1024,3),scientific:!0},Ti:{name:"Ti",value:Math.pow(1024,4),scientific:!0},Pi:{name:"Pi",value:Math.pow(1024,5),scientific:!0},Ei:{name:"Ei",value:Math.pow(1024,6),scientific:!0},Zi:{name:"Zi",value:Math.pow(1024,7),scientific:!0},Yi:{name:"Yi",value:Math.pow(1024,8),scientific:!0}},BINARY_LONG_SI:{"":{name:"",value:1,scientific:!0},kilo:{name:"kilo",value:1e3,scientific:!0},mega:{name:"mega",value:1e6,scientific:!0},giga:{name:"giga",value:1e9,scientific:!0},tera:{name:"tera",value:1e12,scientific:!0},peta:{name:"peta",value:1e15,scientific:!0},exa:{name:"exa",value:1e18,scientific:!0},zetta:{name:"zetta",value:1e21,scientific:!0},yotta:{name:"yotta",value:1e24,scientific:!0}},BINARY_LONG_IEC:{"":{name:"",value:1,scientific:!0},kibi:{name:"kibi",value:1024,scientific:!0},mebi:{name:"mebi",value:Math.pow(1024,2),scientific:!0},gibi:{name:"gibi",value:Math.pow(1024,3),scientific:!0},tebi:{name:"tebi",value:Math.pow(1024,4),scientific:!0},pebi:{name:"pebi",value:Math.pow(1024,5),scientific:!0},exi:{name:"exi",value:Math.pow(1024,6),scientific:!0},zebi:{name:"zebi",value:Math.pow(1024,7),scientific:!0},yobi:{name:"yobi",value:Math.pow(1024,8),scientific:!0}},BTU:{"":{name:"",value:1,scientific:!0},MM:{name:"MM",value:1e6,scientific:!0}}};se.SHORTLONG=(0,i.default)({},se.SHORT,se.LONG),se.BINARY_SHORT=(0,i.default)({},se.BINARY_SHORT_SI,se.BINARY_SHORT_IEC),se.BINARY_LONG=(0,i.default)({},se.BINARY_LONG_SI,se.BINARY_LONG_IEC);const oe=["MASS","LENGTH","TIME","CURRENT","TEMPERATURE","LUMINOUS_INTENSITY","AMOUNT_OF_SUBSTANCE","ANGLE","BIT"],ae={NONE:{dimensions:[0,0,0,0,0,0,0,0,0]},MASS:{dimensions:[1,0,0,0,0,0,0,0,0]},LENGTH:{dimensions:[0,1,0,0,0,0,0,0,0]},TIME:{dimensions:[0,0,1,0,0,0,0,0,0]},CURRENT:{dimensions:[0,0,0,1,0,0,0,0,0]},TEMPERATURE:{dimensions:[0,0,0,0,1,0,0,0,0]},LUMINOUS_INTENSITY:{dimensions:[0,0,0,0,0,1,0,0,0]},AMOUNT_OF_SUBSTANCE:{dimensions:[0,0,0,0,0,0,1,0,0]},FORCE:{dimensions:[1,1,-2,0,0,0,0,0,0]},SURFACE:{dimensions:[0,2,0,0,0,0,0,0,0]},VOLUME:{dimensions:[0,3,0,0,0,0,0,0,0]},ENERGY:{dimensions:[1,2,-2,0,0,0,0,0,0]},POWER:{dimensions:[1,2,-3,0,0,0,0,0,0]},PRESSURE:{dimensions:[1,-1,-2,0,0,0,0,0,0]},ELECTRIC_CHARGE:{dimensions:[0,0,1,1,0,0,0,0,0]},ELECTRIC_CAPACITANCE:{dimensions:[-1,-2,4,2,0,0,0,0,0]},ELECTRIC_POTENTIAL:{dimensions:[1,2,-3,-1,0,0,0,0,0]},ELECTRIC_RESISTANCE:{dimensions:[1,2,-3,-2,0,0,0,0,0]},ELECTRIC_INDUCTANCE:{dimensions:[1,2,-2,-2,0,0,0,0,0]},ELECTRIC_CONDUCTANCE:{dimensions:[-1,-2,3,2,0,0,0,0,0]},MAGNETIC_FLUX:{dimensions:[1,2,-2,-1,0,0,0,0,0]},MAGNETIC_FLUX_DENSITY:{dimensions:[1,0,-2,-1,0,0,0,0,0]},FREQUENCY:{dimensions:[0,0,-1,0,0,0,0,0,0]},ANGLE:{dimensions:[0,0,0,0,0,0,0,1,0]},BIT:{dimensions:[0,0,0,0,0,0,0,0,1]}};for(const e in ae)(0,c.hasOwnProperty)(ae,e)&&(ae[e].key=e);const le={name:"",base:{},value:1,offset:0,dimensions:oe.map((e=>0))},ce={meter:{name:"meter",base:ae.LENGTH,prefixes:se.LONG,value:1,offset:0},inch:{name:"inch",base:ae.LENGTH,prefixes:se.NONE,value:.0254,offset:0},foot:{name:"foot",base:ae.LENGTH,prefixes:se.NONE,value:.3048,offset:0},yard:{name:"yard",base:ae.LENGTH,prefixes:se.NONE,value:.9144,offset:0},mile:{name:"mile",base:ae.LENGTH,prefixes:se.NONE,value:1609.344,offset:0},link:{name:"link",base:ae.LENGTH,prefixes:se.NONE,value:.201168,offset:0},rod:{name:"rod",base:ae.LENGTH,prefixes:se.NONE,value:5.0292,offset:0},chain:{name:"chain",base:ae.LENGTH,prefixes:se.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:ae.LENGTH,prefixes:se.NONE,value:1e-10,offset:0},m:{name:"m",base:ae.LENGTH,prefixes:se.SHORT,value:1,offset:0},in:{name:"in",base:ae.LENGTH,prefixes:se.NONE,value:.0254,offset:0},ft:{name:"ft",base:ae.LENGTH,prefixes:se.NONE,value:.3048,offset:0},yd:{name:"yd",base:ae.LENGTH,prefixes:se.NONE,value:.9144,offset:0},mi:{name:"mi",base:ae.LENGTH,prefixes:se.NONE,value:1609.344,offset:0},li:{name:"li",base:ae.LENGTH,prefixes:se.NONE,value:.201168,offset:0},rd:{name:"rd",base:ae.LENGTH,prefixes:se.NONE,value:5.02921,offset:0},ch:{name:"ch",base:ae.LENGTH,prefixes:se.NONE,value:20.1168,offset:0},mil:{name:"mil",base:ae.LENGTH,prefixes:se.NONE,value:254e-7,offset:0},m2:{name:"m2",base:ae.SURFACE,prefixes:se.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:ae.SURFACE,prefixes:se.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:ae.SURFACE,prefixes:se.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:ae.SURFACE,prefixes:se.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:ae.SURFACE,prefixes:se.NONE,value:2589988.110336,offset:0},sqrd:{name:"sqrd",base:ae.SURFACE,prefixes:se.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:ae.SURFACE,prefixes:se.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:ae.SURFACE,prefixes:se.NONE,value:6.4516e-10,offset:0},acre:{name:"acre",base:ae.SURFACE,prefixes:se.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:ae.SURFACE,prefixes:se.NONE,value:1e4,offset:0},m3:{name:"m3",base:ae.VOLUME,prefixes:se.CUBIC,value:1,offset:0},L:{name:"L",base:ae.VOLUME,prefixes:se.SHORT,value:.001,offset:0},l:{name:"l",base:ae.VOLUME,prefixes:se.SHORT,value:.001,offset:0},litre:{name:"litre",base:ae.VOLUME,prefixes:se.LONG,value:.001,offset:0},cuin:{name:"cuin",base:ae.VOLUME,prefixes:se.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:ae.VOLUME,prefixes:se.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:ae.VOLUME,prefixes:se.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:ae.VOLUME,prefixes:se.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:ae.VOLUME,prefixes:se.NONE,value:15e-6,offset:0},drop:{name:"drop",base:ae.VOLUME,prefixes:se.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:ae.VOLUME,prefixes:se.NONE,value:5e-8,offset:0},minim:{name:"minim",base:ae.VOLUME,prefixes:se.NONE,value:6.1611519921875e-8,offset:0},fluiddram:{name:"fluiddram",base:ae.VOLUME,prefixes:se.NONE,value:36966911953125e-19,offset:0},fluidounce:{name:"fluidounce",base:ae.VOLUME,prefixes:se.NONE,value:295735295625e-16,offset:0},gill:{name:"gill",base:ae.VOLUME,prefixes:se.NONE,value:.00011829411825,offset:0},cc:{name:"cc",base:ae.VOLUME,prefixes:se.NONE,value:1e-6,offset:0},cup:{name:"cup",base:ae.VOLUME,prefixes:se.NONE,value:.0002365882365,offset:0},pint:{name:"pint",base:ae.VOLUME,prefixes:se.NONE,value:.000473176473,offset:0},quart:{name:"quart",base:ae.VOLUME,prefixes:se.NONE,value:.000946352946,offset:0},gallon:{name:"gallon",base:ae.VOLUME,prefixes:se.NONE,value:.003785411784,offset:0},beerbarrel:{name:"beerbarrel",base:ae.VOLUME,prefixes:se.NONE,value:.117347765304,offset:0},oilbarrel:{name:"oilbarrel",base:ae.VOLUME,prefixes:se.NONE,value:.158987294928,offset:0},hogshead:{name:"hogshead",base:ae.VOLUME,prefixes:se.NONE,value:.238480942392,offset:0},g:{name:"g",base:ae.MASS,prefixes:se.SHORT,value:.001,offset:0},gram:{name:"gram",base:ae.MASS,prefixes:se.LONG,value:.001,offset:0},ton:{name:"ton",base:ae.MASS,prefixes:se.SHORT,value:907.18474,offset:0},t:{name:"t",base:ae.MASS,prefixes:se.SHORT,value:1e3,offset:0},tonne:{name:"tonne",base:ae.MASS,prefixes:se.LONG,value:1e3,offset:0},grain:{name:"grain",base:ae.MASS,prefixes:se.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:ae.MASS,prefixes:se.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:ae.MASS,prefixes:se.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:ae.MASS,prefixes:se.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:ae.MASS,prefixes:se.NONE,value:45.359237,offset:0},stick:{name:"stick",base:ae.MASS,prefixes:se.NONE,value:.115,offset:0},stone:{name:"stone",base:ae.MASS,prefixes:se.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:ae.MASS,prefixes:se.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:ae.MASS,prefixes:se.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:ae.MASS,prefixes:se.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:ae.MASS,prefixes:se.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:ae.MASS,prefixes:se.NONE,value:45.359237,offset:0},s:{name:"s",base:ae.TIME,prefixes:se.SHORT,value:1,offset:0},min:{name:"min",base:ae.TIME,prefixes:se.NONE,value:60,offset:0},h:{name:"h",base:ae.TIME,prefixes:se.NONE,value:3600,offset:0},second:{name:"second",base:ae.TIME,prefixes:se.LONG,value:1,offset:0},sec:{name:"sec",base:ae.TIME,prefixes:se.LONG,value:1,offset:0},minute:{name:"minute",base:ae.TIME,prefixes:se.NONE,value:60,offset:0},hour:{name:"hour",base:ae.TIME,prefixes:se.NONE,value:3600,offset:0},day:{name:"day",base:ae.TIME,prefixes:se.NONE,value:86400,offset:0},week:{name:"week",base:ae.TIME,prefixes:se.NONE,value:604800,offset:0},month:{name:"month",base:ae.TIME,prefixes:se.NONE,value:2629800,offset:0},year:{name:"year",base:ae.TIME,prefixes:se.NONE,value:31557600,offset:0},decade:{name:"decade",base:ae.TIME,prefixes:se.NONE,value:315576e3,offset:0},century:{name:"century",base:ae.TIME,prefixes:se.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:ae.TIME,prefixes:se.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:ae.FREQUENCY,prefixes:se.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:ae.FREQUENCY,prefixes:se.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:ae.ANGLE,prefixes:se.SHORT,value:1,offset:0},radian:{name:"radian",base:ae.ANGLE,prefixes:se.LONG,value:1,offset:0},deg:{name:"deg",base:ae.ANGLE,prefixes:se.SHORT,value:null,offset:0},degree:{name:"degree",base:ae.ANGLE,prefixes:se.LONG,value:null,offset:0},grad:{name:"grad",base:ae.ANGLE,prefixes:se.SHORT,value:null,offset:0},gradian:{name:"gradian",base:ae.ANGLE,prefixes:se.LONG,value:null,offset:0},cycle:{name:"cycle",base:ae.ANGLE,prefixes:se.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:ae.ANGLE,prefixes:se.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:ae.ANGLE,prefixes:se.NONE,value:null,offset:0},A:{name:"A",base:ae.CURRENT,prefixes:se.SHORT,value:1,offset:0},ampere:{name:"ampere",base:ae.CURRENT,prefixes:se.LONG,value:1,offset:0},K:{name:"K",base:ae.TEMPERATURE,prefixes:se.SHORT,value:1,offset:0},degC:{name:"degC",base:ae.TEMPERATURE,prefixes:se.SHORT,value:1,offset:273.15},degF:{name:"degF",base:ae.TEMPERATURE,prefixes:se.SHORT,value:new R(5,9),offset:459.67},degR:{name:"degR",base:ae.TEMPERATURE,prefixes:se.SHORT,value:new R(5,9),offset:0},kelvin:{name:"kelvin",base:ae.TEMPERATURE,prefixes:se.LONG,value:1,offset:0},celsius:{name:"celsius",base:ae.TEMPERATURE,prefixes:se.LONG,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:ae.TEMPERATURE,prefixes:se.LONG,value:new R(5,9),offset:459.67},rankine:{name:"rankine",base:ae.TEMPERATURE,prefixes:se.LONG,value:new R(5,9),offset:0},mol:{name:"mol",base:ae.AMOUNT_OF_SUBSTANCE,prefixes:se.SHORT,value:1,offset:0},mole:{name:"mole",base:ae.AMOUNT_OF_SUBSTANCE,prefixes:se.LONG,value:1,offset:0},cd:{name:"cd",base:ae.LUMINOUS_INTENSITY,prefixes:se.SHORT,value:1,offset:0},candela:{name:"candela",base:ae.LUMINOUS_INTENSITY,prefixes:se.LONG,value:1,offset:0},N:{name:"N",base:ae.FORCE,prefixes:se.SHORT,value:1,offset:0},newton:{name:"newton",base:ae.FORCE,prefixes:se.LONG,value:1,offset:0},dyn:{name:"dyn",base:ae.FORCE,prefixes:se.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:ae.FORCE,prefixes:se.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:ae.FORCE,prefixes:se.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:ae.FORCE,prefixes:se.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:ae.FORCE,prefixes:se.LONG,value:4448.2216,offset:0},kilogramforce:{name:"kilogramforce",base:ae.FORCE,prefixes:se.NONE,value:9.80665,offset:0},J:{name:"J",base:ae.ENERGY,prefixes:se.SHORT,value:1,offset:0},joule:{name:"joule",base:ae.ENERGY,prefixes:se.LONG,value:1,offset:0},erg:{name:"erg",base:ae.ENERGY,prefixes:se.SHORTLONG,value:1e-7,offset:0},Wh:{name:"Wh",base:ae.ENERGY,prefixes:se.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:ae.ENERGY,prefixes:se.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:ae.ENERGY,prefixes:se.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:ae.ENERGY,prefixes:se.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:ae.POWER,prefixes:se.SHORT,value:1,offset:0},watt:{name:"watt",base:ae.POWER,prefixes:se.LONG,value:1,offset:0},hp:{name:"hp",base:ae.POWER,prefixes:se.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:ae.POWER,prefixes:se.SHORT,value:x.I,offset:0},VA:{name:"VA",base:ae.POWER,prefixes:se.SHORT,value:1,offset:0},Pa:{name:"Pa",base:ae.PRESSURE,prefixes:se.SHORT,value:1,offset:0},psi:{name:"psi",base:ae.PRESSURE,prefixes:se.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:ae.PRESSURE,prefixes:se.NONE,value:101325,offset:0},bar:{name:"bar",base:ae.PRESSURE,prefixes:se.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:ae.PRESSURE,prefixes:se.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:ae.PRESSURE,prefixes:se.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:ae.PRESSURE,prefixes:se.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:ae.PRESSURE,prefixes:se.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:ae.ELECTRIC_CHARGE,prefixes:se.LONG,value:1,offset:0},C:{name:"C",base:ae.ELECTRIC_CHARGE,prefixes:se.SHORT,value:1,offset:0},farad:{name:"farad",base:ae.ELECTRIC_CAPACITANCE,prefixes:se.LONG,value:1,offset:0},F:{name:"F",base:ae.ELECTRIC_CAPACITANCE,prefixes:se.SHORT,value:1,offset:0},volt:{name:"volt",base:ae.ELECTRIC_POTENTIAL,prefixes:se.LONG,value:1,offset:0},V:{name:"V",base:ae.ELECTRIC_POTENTIAL,prefixes:se.SHORT,value:1,offset:0},ohm:{name:"ohm",base:ae.ELECTRIC_RESISTANCE,prefixes:se.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:ae.ELECTRIC_INDUCTANCE,prefixes:se.LONG,value:1,offset:0},H:{name:"H",base:ae.ELECTRIC_INDUCTANCE,prefixes:se.SHORT,value:1,offset:0},siemens:{name:"siemens",base:ae.ELECTRIC_CONDUCTANCE,prefixes:se.LONG,value:1,offset:0},S:{name:"S",base:ae.ELECTRIC_CONDUCTANCE,prefixes:se.SHORT,value:1,offset:0},weber:{name:"weber",base:ae.MAGNETIC_FLUX,prefixes:se.LONG,value:1,offset:0},Wb:{name:"Wb",base:ae.MAGNETIC_FLUX,prefixes:se.SHORT,value:1,offset:0},tesla:{name:"tesla",base:ae.MAGNETIC_FLUX_DENSITY,prefixes:se.LONG,value:1,offset:0},T:{name:"T",base:ae.MAGNETIC_FLUX_DENSITY,prefixes:se.SHORT,value:1,offset:0},b:{name:"b",base:ae.BIT,prefixes:se.BINARY_SHORT,value:1,offset:0},bits:{name:"bits",base:ae.BIT,prefixes:se.BINARY_LONG,value:1,offset:0},B:{name:"B",base:ae.BIT,prefixes:se.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:ae.BIT,prefixes:se.BINARY_LONG,value:8,offset:0}},ue={meters:"meter",inches:"inch",feet:"foot",yards:"yard",miles:"mile",links:"link",rods:"rod",chains:"chain",angstroms:"angstrom",lt:"l",litres:"litre",liter:"litre",liters:"litre",teaspoons:"teaspoon",tablespoons:"tablespoon",minims:"minim",fldr:"fluiddram",fluiddrams:"fluiddram",floz:"fluidounce",fluidounces:"fluidounce",gi:"gill",gills:"gill",cp:"cup",cups:"cup",pt:"pint",pints:"pint",qt:"quart",quarts:"quart",gal:"gallon",gallons:"gallon",bbl:"beerbarrel",beerbarrels:"beerbarrel",obl:"oilbarrel",oilbarrels:"oilbarrel",hogsheads:"hogshead",gtts:"gtt",grams:"gram",tons:"ton",tonnes:"tonne",grains:"grain",drams:"dram",ounces:"ounce",poundmasses:"poundmass",hundredweights:"hundredweight",sticks:"stick",lb:"lbm",lbs:"lbm",kips:"kip",kgf:"kilogramforce",acres:"acre",hectares:"hectare",sqfeet:"sqft",sqyard:"sqyd",sqmile:"sqmi",sqmiles:"sqmi",mmhg:"mmHg",mmh2o:"mmH2O",cmh2o:"cmH2O",seconds:"second",secs:"second",minutes:"minute",mins:"minute",hours:"hour",hr:"hour",hrs:"hour",days:"day",weeks:"week",months:"month",years:"year",decades:"decade",centuries:"century",millennia:"millennium",hertz:"hertz",radians:"radian",degrees:"degree",gradians:"gradian",cycles:"cycle",arcsecond:"arcsec",arcseconds:"arcsec",arcminute:"arcmin",arcminutes:"arcmin",BTUs:"BTU",watts:"watt",joules:"joule",amperes:"ampere",amps:"ampere",amp:"ampere",coulombs:"coulomb",volts:"volt",ohms:"ohm",farads:"farad",webers:"weber",teslas:"tesla",electronvolts:"electronvolt",moles:"mole",bit:"bits",byte:"bytes"};function de(e){if("BigNumber"===e.number){const e=(0,u.createBigNumberPi)(w);ce.rad.value=new w(1),ce.deg.value=e.div(180),ce.grad.value=e.div(200),ce.cycle.value=e.times(2),ce.arcsec.value=e.div(648e3),ce.arcmin.value=e.div(10800)}else ce.rad.value=1,ce.deg.value=Math.PI/180,ce.grad.value=Math.PI/200,ce.cycle.value=2*Math.PI,ce.arcsec.value=Math.PI/648e3,ce.arcmin.value=Math.PI/10800;ce.radian.value=ce.rad.value,ce.degree.value=ce.deg.value,ce.gradian.value=ce.grad.value}de(r),t&&t("config",(function(e,t){e.number!==t.number&&de(e)}));const he={si:{NONE:{unit:le,prefix:se.NONE[""]},LENGTH:{unit:ce.m,prefix:se.SHORT[""]},MASS:{unit:ce.g,prefix:se.SHORT.k},TIME:{unit:ce.s,prefix:se.SHORT[""]},CURRENT:{unit:ce.A,prefix:se.SHORT[""]},TEMPERATURE:{unit:ce.K,prefix:se.SHORT[""]},LUMINOUS_INTENSITY:{unit:ce.cd,prefix:se.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:ce.mol,prefix:se.SHORT[""]},ANGLE:{unit:ce.rad,prefix:se.SHORT[""]},BIT:{unit:ce.bits,prefix:se.SHORT[""]},FORCE:{unit:ce.N,prefix:se.SHORT[""]},ENERGY:{unit:ce.J,prefix:se.SHORT[""]},POWER:{unit:ce.W,prefix:se.SHORT[""]},PRESSURE:{unit:ce.Pa,prefix:se.SHORT[""]},ELECTRIC_CHARGE:{unit:ce.C,prefix:se.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:ce.F,prefix:se.SHORT[""]},ELECTRIC_POTENTIAL:{unit:ce.V,prefix:se.SHORT[""]},ELECTRIC_RESISTANCE:{unit:ce.ohm,prefix:se.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:ce.H,prefix:se.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:ce.S,prefix:se.SHORT[""]},MAGNETIC_FLUX:{unit:ce.Wb,prefix:se.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:ce.T,prefix:se.SHORT[""]},FREQUENCY:{unit:ce.Hz,prefix:se.SHORT[""]}}};he.cgs=JSON.parse(JSON.stringify(he.si)),he.cgs.LENGTH={unit:ce.m,prefix:se.SHORT.c},he.cgs.MASS={unit:ce.g,prefix:se.SHORT[""]},he.cgs.FORCE={unit:ce.dyn,prefix:se.SHORT[""]},he.cgs.ENERGY={unit:ce.erg,prefix:se.NONE[""]},he.us=JSON.parse(JSON.stringify(he.si)),he.us.LENGTH={unit:ce.ft,prefix:se.NONE[""]},he.us.MASS={unit:ce.lbm,prefix:se.NONE[""]},he.us.TEMPERATURE={unit:ce.degF,prefix:se.NONE[""]},he.us.FORCE={unit:ce.lbf,prefix:se.NONE[""]},he.us.ENERGY={unit:ce.BTU,prefix:se.BTU[""]},he.us.POWER={unit:ce.hp,prefix:se.NONE[""]},he.us.PRESSURE={unit:ce.psi,prefix:se.NONE[""]},he.auto=JSON.parse(JSON.stringify(he.si));let pe=he.auto;Unit.setUnitSystem=function(e){if(!(0,c.hasOwnProperty)(he,e))throw new Error("Unit system "+e+" does not exist. Choices are: "+Object.keys(he).join(", "));pe=he[e]},Unit.getUnitSystem=function(){for(const e in he)if((0,c.hasOwnProperty)(he,e)&&he[e]===pe)return e},Unit.typeConverters={BigNumber:function(e){return null!=e&&e.isFraction?new w(e.n).div(e.d).times(e.s):new w(e+"")},Fraction:function(e){return new R(e)},Complex:function(e){return e},number:function(e){return null!=e&&e.isFraction?_(e):e}},Unit.prototype._numberConverter=function(){const e=Unit.typeConverters[this.valueType()];if(e)return e;throw new TypeError('Unsupported Unit value type "'+this.valueType()+'"')},Unit._getNumberConverter=function(e){if(!Unit.typeConverters[e])throw new TypeError('Unsupported type "'+e+'"');return Unit.typeConverters[e]};for(const e in ce)if((0,c.hasOwnProperty)(ce,e)){const t=ce[e];t.dimensions=t.base.dimensions}for(const e in ue)if((0,c.hasOwnProperty)(ue,e)){const t=ce[ue[e]],r={};for(const e in t)(0,c.hasOwnProperty)(t,e)&&(r[e]=t[e]);r.name=e,ce[e]=r}return Unit.isValidAlpha=function(e){return/^[a-zA-Z]$/.test(e)},Unit.createUnit=function(e,t){if("object"!=typeof e)throw new TypeError("createUnit expects first parameter to be of type 'Object'");if(t&&t.override)for(const t in e)if((0,c.hasOwnProperty)(e,t)&&Unit.deleteUnit(t),e[t].aliases)for(let r=0;r<e[t].aliases.length;r++)Unit.deleteUnit(e[t].aliases[r]);let r;for(const t in e)(0,c.hasOwnProperty)(e,t)&&(r=Unit.createUnitSingle(t,e[t]));return r},Unit.createUnitSingle=function(e,t){if(null==t&&(t={}),"string"!=typeof e)throw new TypeError("createUnitSingle expects first parameter to be of type 'string'");if((0,c.hasOwnProperty)(ce,e))throw new Error('Cannot create unit "'+e+'": a unit with that name already exists');!function(e){for(let t=0;t<e.length;t++){if(q=e.charAt(t),0===t&&!Unit.isValidAlpha(q))throw new Error('Invalid unit name (must begin with alpha character): "'+e+'"');if(t>0&&!Unit.isValidAlpha(q)&&!Z(q))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+e+'"')}}(e);let r,n,i,s=null,o=[],a=0;if(t&&"Unit"===t.type)s=t.clone();else if("string"==typeof t)""!==t&&(r=t);else{if("object"!=typeof t)throw new TypeError('Cannot create unit "'+e+'" from "'+t.toString()+'": expecting "string" or "Unit" or "Object"');r=t.definition,n=t.prefixes,a=t.offset,i=t.baseName,t.aliases&&(o=t.aliases.valueOf())}if(o)for(let e=0;e<o.length;e++)if((0,c.hasOwnProperty)(ce,o[e]))throw new Error('Cannot create alias "'+o[e]+'": a unit with that name already exists');if(r&&"string"==typeof r&&!s)try{s=Unit.parse(r,{allowNoUnits:!0})}catch(t){throw t.message='Could not create unit "'+e+'" from "'+r+'": '+t.message,t}else r&&"Unit"===r.type&&(s=r.clone());o=o||[],a=a||0,n=n&&n.toUpperCase&&se[n.toUpperCase()]||se.NONE;let l={};if(s){l={name:e,value:s.value,dimensions:s.dimensions.slice(0),prefixes:n,offset:a};let t=!1;for(const e in ae)if((0,c.hasOwnProperty)(ae,e)){let r=!0;for(let t=0;t<oe.length;t++)if(Math.abs((l.dimensions[t]||0)-(ae[e].dimensions[t]||0))>1e-12){r=!1;break}if(r){t=!0,l.base=ae[e];break}}if(!t){i=i||e+"_STUFF";const t={dimensions:s.dimensions.slice(0)};t.key=i,ae[i]=t,pe[i]={unit:l,prefix:se.NONE[""]},l.base=ae[i]}}else{if(i=i||e+"_STUFF",oe.indexOf(i)>=0)throw new Error('Cannot create new base unit "'+e+'": a base unit with that name already exists (and cannot be overridden)');oe.push(i);for(const e in ae)(0,c.hasOwnProperty)(ae,e)&&(ae[e].dimensions[oe.length-1]=0);const t={dimensions:[]};for(let e=0;e<oe.length;e++)t.dimensions[e]=0;t.dimensions[oe.length-1]=1,t.key=i,ae[i]=t,l={name:e,value:1,dimensions:ae[i].dimensions.slice(0),prefixes:n,offset:a,base:ae[i]},pe[i]={unit:l,prefix:se.NONE[""]}}Unit.UNITS[e]=l;for(let e=0;e<o.length;e++){const t=o[e],r={};for(const e in l)(0,c.hasOwnProperty)(l,e)&&(r[e]=l[e]);r.name=t,Unit.UNITS[t]=r}return delete ne.cache,new Unit(null,e)},Unit.deleteUnit=function(e){delete Unit.UNITS[e],delete ne.cache},Unit.PREFIXES=se,Unit.BASE_DIMENSIONS=oe,Unit.BASE_UNITS=ae,Unit.UNIT_SYSTEMS=he,Unit.UNITS=ce,Unit}),{isClass:!0})},52599:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCreateUnit=void 0;var n=r(66212);const i="createUnit",s=["typed","Unit"];t.createCreateUnit=(0,n.factory)(i,s,(e=>{let{typed:t,Unit:r}=e;return t(i,{"Object, Object":function(e,t){return r.createUnit(e,t)},Object:function(e){return r.createUnit(e,{})},"string, Unit | string | Object, Object":function(e,t,n){const i={};return i[e]=t,r.createUnit(i,n)},"string, Unit | string | Object":function(e,t){const n={};return n[e]=t,r.createUnit(n,{})},string:function(e){const t={};return t[e]={},r.createUnit(t,{})}})}))},74323:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSplitUnit=void 0;var n=r(66212);const i="splitUnit",s=["typed"];t.createSplitUnit=(0,n.factory)(i,s,(e=>{let{typed:t}=e;return t(i,{"Unit, Array":function(e,t){return e.splitUnit(t)}})}))},67595:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createUnitFunction=void 0;var n=r(66212),i=r(16624);const s="unit",o=["typed","Unit"];t.createUnitFunction=(0,n.factory)(s,o,(e=>{let{typed:t,Unit:r}=e;return t(s,{Unit:function(e){return e.clone()},string:function(e){return r.isValuelessUnit(e)?new r(null,e):r.parse(e,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string | Unit":function(e,t){return new r(e,t)},"number | BigNumber | Fraction":function(e){return new r(e)},"Array | Matrix":t.referToSelf((e=>t=>(0,i.deepMap)(t,e)))})}))},25014:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createWienDisplacement=t.createWeakMixingAngle=t.createVacuumImpedance=t.createThomsonCrossSection=t.createStefanBoltzmann=t.createSpeedOfLight=t.createSecondRadiation=t.createSackurTetrode=t.createRydberg=t.createReducedPlanckConstant=t.createQuantumOfCirculation=t.createProtonMass=t.createPlanckTime=t.createPlanckTemperature=t.createPlanckMass=t.createPlanckLength=t.createPlanckConstant=t.createPlanckCharge=t.createNuclearMagneton=t.createNeutronMass=t.createMolarVolume=t.createMolarPlanckConstant=t.createMolarMassC12=t.createMolarMass=t.createMagneticFluxQuantum=t.createMagneticConstant=t.createLoschmidt=t.createKlitzing=t.createJosephson=t.createInverseConductanceQuantum=t.createHartreeEnergy=t.createGravity=t.createGravitationConstant=t.createGasConstant=t.createFirstRadiation=t.createFineStructure=t.createFermiCoupling=t.createFaraday=t.createElementaryCharge=t.createElectronMass=t.createElectricConstant=t.createEfimovFactor=t.createDeuteronMass=t.createCoulomb=t.createConductanceQuantum=t.createClassicalElectronRadius=t.createBoltzmann=t.createBohrRadius=t.createBohrMagneton=t.createAvogadro=t.createAtomicMass=void 0;var n=r(66212);t.createSpeedOfLight=i("speedOfLight","299792458","m s^-1"),t.createGravitationConstant=i("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),t.createPlanckConstant=i("planckConstant","6.62607015e-34","J s"),t.createReducedPlanckConstant=i("reducedPlanckConstant","1.0545718176461565e-34","J s"),t.createMagneticConstant=i("magneticConstant","1.25663706212e-6","N A^-2"),t.createElectricConstant=i("electricConstant","8.8541878128e-12","F m^-1"),t.createVacuumImpedance=i("vacuumImpedance","376.730313667","ohm"),t.createCoulomb=i("coulomb","8.987551792261171e9","N m^2 C^-2"),t.createElementaryCharge=i("elementaryCharge","1.602176634e-19","C"),t.createBohrMagneton=i("bohrMagneton","9.2740100783e-24","J T^-1"),t.createConductanceQuantum=i("conductanceQuantum","7.748091729863649e-5","S"),t.createInverseConductanceQuantum=i("inverseConductanceQuantum","12906.403729652257","ohm"),t.createMagneticFluxQuantum=i("magneticFluxQuantum","2.0678338484619295e-15","Wb"),t.createNuclearMagneton=i("nuclearMagneton","5.0507837461e-27","J T^-1"),t.createKlitzing=i("klitzing","25812.807459304513","ohm"),t.createJosephson=i("josephson","4.835978484169836e14 Hz V","Hz V^-1"),t.createBohrRadius=i("bohrRadius","5.29177210903e-11","m"),t.createClassicalElectronRadius=i("classicalElectronRadius","2.8179403262e-15","m"),t.createElectronMass=i("electronMass","9.1093837015e-31","kg"),t.createFermiCoupling=i("fermiCoupling","1.1663787e-5","GeV^-2"),t.createFineStructure=s("fineStructure",.0072973525693),t.createHartreeEnergy=i("hartreeEnergy","4.3597447222071e-18","J"),t.createProtonMass=i("protonMass","1.67262192369e-27","kg"),t.createDeuteronMass=i("deuteronMass","3.3435830926e-27","kg"),t.createNeutronMass=i("neutronMass","1.6749271613e-27","kg"),t.createQuantumOfCirculation=i("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),t.createRydberg=i("rydberg","10973731.568160","m^-1"),t.createThomsonCrossSection=i("thomsonCrossSection","6.6524587321e-29","m^2"),t.createWeakMixingAngle=s("weakMixingAngle",.2229),t.createEfimovFactor=s("efimovFactor",22.7),t.createAtomicMass=i("atomicMass","1.66053906660e-27","kg"),t.createAvogadro=i("avogadro","6.02214076e23","mol^-1"),t.createBoltzmann=i("boltzmann","1.380649e-23","J K^-1"),t.createFaraday=i("faraday","96485.33212331001","C mol^-1"),t.createFirstRadiation=i("firstRadiation","3.7417718521927573e-16","W m^2"),t.createLoschmidt=i("loschmidt","2.686780111798444e25","m^-3"),t.createGasConstant=i("gasConstant","8.31446261815324","J K^-1 mol^-1"),t.createMolarPlanckConstant=i("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),t.createMolarVolume=i("molarVolume","0.022413969545014137","m^3 mol^-1"),t.createSackurTetrode=s("sackurTetrode",-1.16487052358),t.createSecondRadiation=i("secondRadiation","0.014387768775039337","m K"),t.createStefanBoltzmann=i("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),t.createWienDisplacement=i("wienDisplacement","2.897771955e-3","m K"),t.createMolarMass=i("molarMass","0.99999999965e-3","kg mol^-1"),t.createMolarMassC12=i("molarMassC12","11.9999999958e-3","kg mol^-1"),t.createGravity=i("gravity","9.80665","m s^-2"),t.createPlanckLength=i("planckLength","1.616255e-35","m"),t.createPlanckMass=i("planckMass","2.176435e-8","kg"),t.createPlanckTime=i("planckTime","5.391245e-44","s"),t.createPlanckCharge=i("planckCharge","1.87554603778e-18","C"),t.createPlanckTemperature=i("planckTemperature","1.416785e+32","K");function i(e,t,r){return(0,n.factory)(e,["config","Unit","BigNumber"],(e=>{let{config:n,Unit:i,BigNumber:s}=e;const o=new i("BigNumber"===n.number?new s(t):parseFloat(t),r);return o.fixPrefix=!0,o}))}function s(e,t){return(0,n.factory)(e,["config","BigNumber"],(e=>{let{config:r,BigNumber:n}=e;return"BigNumber"===r.number?new n(t):t}))}},68457:(e,t,r)=>{"use strict";var n=r(87929);Object.defineProperty(t,"__esModule",{value:!0}),t.applyCallback=function(e,t,r,n,o){if(i.default.isTypedFunction(e)){const s=[t,r,n],o=i.default.resolve(e,s);if(o)return a(o.implementation,s);const l=[t,r],c=i.default.resolve(e,l);if(c)return a(c.implementation,l);const u=[t],d=i.default.resolve(e,u);return d?a(d.implementation,u):a(e,s)}return e(t,r,n);function a(i,a){try{return i.apply(i,a)}catch(i){var l;if(i instanceof TypeError&&"wrongType"===(null===(l=i.data)||void 0===l?void 0:l.category)){const i=[];throw i.push(`value: ${(0,s.typeOf)(t)}`),a.length>=2&&i.push(`index: ${(0,s.typeOf)(r)}`),a.length>=3&&i.push(`array: ${(0,s.typeOf)(n)}`),new TypeError(`Function ${o} cannot apply callback arguments ${e.name}(${i.join(", ")}) at index ${JSON.stringify(r)}`)}throw new TypeError(`Function ${o} cannot apply callback arguments to function ${e.name}: ${i.message}`)}}};var i=n(r(83999)),s=r(91612)},34487:(e,t,r)=>{"use strict";var n=r(87929);Object.defineProperty(t,"__esModule",{value:!0}),t.arraySize=d,t.broadcastArrays=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(0===t.length)throw new Error("Insuficient number of argumnets in function broadcastArrays");if(1===t.length)return t[0];const n=R(...t.map((function(e){return d(e)}))),i=[];return t.forEach((function(e){i.push(j(e,n))})),i},t.broadcastSizes=R,t.broadcastTo=j,t.checkBroadcastingRules=k,t.clone=q,t.concat=w,t.filter=function(e,t){if(1!==d(e).length)throw new Error("Only one dimensional matrices supported");return Array.prototype.filter.call(e,t)},t.filterRegExp=function(e,t){if(1!==d(e).length)throw new Error("Only one dimensional matrices supported");return Array.prototype.filter.call(e,(e=>t.test(e)))},t.flatten=_,t.forEach=function(e,t){Array.prototype.forEach.call(e,t)},t.generalize=function(e){if(!Array.isArray(e))throw new TypeError("Array input expected");if(0===e.length)return e;const t=[];for(let r=0;r<e.length;r++)t.push(e[r].value);return t},t.get=function(e,t){if(!Array.isArray(e))throw new Error("Array expected");const r=d(e);if(t.length!==r.length)throw new l.DimensionError(t.length,r.length);for(let e=0;e<t.length;e++)p(t[e],r[e]);return t.reduce(((e,t)=>e[t]),e)},t.getArrayDataType=function e(t,r){let n,i=0;for(let s=0;s<t.length;s++){const o=t[s],a=Array.isArray(o);if(0===s&&a&&(i=o.length),a&&o.length!==i)return;const l=a?e(o,r):r(o);if(void 0===n)n=l;else if(n!==l)return"mixed"}return n},t.identify=function(e){if(!Array.isArray(e))throw new TypeError("Array input expected");if(0===e.length)return e;const t=[];let r=0;t[0]={value:e[0],identifier:0};for(let n=1;n<e.length;n++)e[n]===e[n-1]?r++:r=0,t.push({value:e[n],identifier:r});return t},t.initial=function(e){return e.slice(0,e.length-1)},t.isEmptyIndex=function(e){for(let t=0;t<e._dimensions.length;++t){const r=e._dimensions[t];if(r._data&&(0,o.isArray)(r._data)){if(0===r._size[0])return!0}else if(r.isRange){if(r.start===r.end)return!0}else if((0,o.isString)(r)&&0===r.length)return!0}return!1},t.join=function(e,t){return Array.prototype.join.call(e,t)},t.last=function(e){return e[e.length-1]},t.map=function(e,t){return Array.prototype.map.call(e,t)},t.processSizesWildcard=g,t.reshape=f,t.resize=function(e,t,r){if(!Array.isArray(t))throw new TypeError("Array expected");if(0===t.length)throw new Error("Resizing to scalar is not supported");t.forEach((function(e){if(!(0,o.isNumber)(e)||!(0,s.isInteger)(e)||e<0)throw new TypeError("Invalid size, must contain positive integers (size: "+(0,a.format)(t)+")")})),((0,o.isNumber)(e)||(0,o.isBigNumber)(e))&&(e=[e]);return m(e,t,0,r!==void 0?r:0),e},t.squeeze=function(e,t){const r=t||d(e);for(;Array.isArray(e)&&1===e.length;)e=e[0],r.shift();let n=r.length;for(;1===r[n-1];)n--;n<r.length&&(e=b(e,n,0),r.length=n);return e},t.stretch=z,t.unsqueeze=function(e,t,r,n){const i=n||d(e);if(r)for(let t=0;t<r;t++)e=[e],i.unshift(1);e=v(e,t,0);for(;i.length<t;)i.push(1);return e},t.validate=function(e,t){if(0===t.length){if(Array.isArray(e))throw new l.DimensionError(e.length,0)}else h(e,t,0)},t.validateIndex=p,t.validateIndexSourceSize=function(e,t){const r=e.isMatrix?e._size:d(e);t._sourceSize.forEach(((e,t)=>{if(null!==e&&e!==r[t])throw new l.DimensionError(e,r[t])}))};var i=n(r(37693)),s=r(34749),o=r(91612),a=r(7041),l=r(6523),c=r(17967),u=r(61175);function d(e){const t=[];for(;Array.isArray(e);)t.push(e.length),e=e[0];return t}function h(e,t,r){let n;const i=e.length;if(i!==t[r])throw new l.DimensionError(i,t[r]);if(r<t.length-1){const s=r+1;for(n=0;n<i;n++){const r=e[n];if(!Array.isArray(r))throw new l.DimensionError(t.length-1,t.length,"<");h(e[n],t,s)}}else for(n=0;n<i;n++)if(Array.isArray(e[n]))throw new l.DimensionError(t.length+1,t.length,">")}function p(e,t){if(void 0!==e){if(!(0,o.isNumber)(e)||!(0,s.isInteger)(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||"number"==typeof t&&e>=t)throw new c.IndexError(e,t)}}function m(e,t,r,n){let i,s;const o=e.length,a=t[r],l=Math.min(o,a);if(e.length=a,r<t.length-1){const o=r+1;for(i=0;i<l;i++)s=e[i],Array.isArray(s)||(s=[s],e[i]=s),m(s,t,o,n);for(i=l;i<a;i++)s=[],e[i]=s,m(s,t,o,n)}else{for(i=0;i<l;i++)for(;Array.isArray(e[i]);)e[i]=e[i][0];for(i=l;i<a;i++)e[i]=n}}function f(e,t){const r=_(e),n=r.length;if(!Array.isArray(e)||!Array.isArray(t))throw new TypeError("Array expected");if(0===t.length)throw new l.DimensionError(0,n,"!=");const i=y(t=g(t,n));if(n!==i)throw new l.DimensionError(i,n,"!=");try{return function(e,t){let r,n=e;for(let e=t.length-1;e>0;e--){const i=t[e];r=[];const s=n.length/i;for(let e=0;e<s;e++)r.push(n.slice(e*i,(e+1)*i));n=r}return n}(r,t)}catch(e){if(e instanceof l.DimensionError)throw new l.DimensionError(i,n,"!=");throw e}}function g(e,t){const r=y(e),n=e.slice(),i=e.indexOf(-1);if(e.indexOf(-1,i+1)>=0)throw new Error("More than one wildcard in sizes");if(i>=0){if(!(t%r==0))throw new Error("Could not replace wildcard, since "+t+" is no multiple of "+-r);n[i]=-t/r}return n}function y(e){return e.reduce(((e,t)=>e*t),1)}function b(e,t,r){let n,i;if(r<t){const s=r+1;for(n=0,i=e.length;n<i;n++)e[n]=b(e[n],t,s)}else for(;Array.isArray(e);)e=e[0];return e}function v(e,t,r){let n,i;if(Array.isArray(e)){const s=r+1;for(n=0,i=e.length;n<i;n++)e[n]=v(e[n],t,s)}else for(let n=r;n<t;n++)e=[e];return e}function _(e){if(!Array.isArray(e))return e;const t=[];return e.forEach((function e(r){Array.isArray(r)?r.forEach(e):t.push(r)})),t}function x(e,t,r,n){if(n<r){if(e.length!==t.length)throw new l.DimensionError(e.length,t.length);const i=[];for(let s=0;s<e.length;s++)i[s]=x(e[s],t[s],r,n+1);return i}return e.concat(t)}function w(){const e=Array.prototype.slice.call(arguments,0,-1),t=Array.prototype.slice.call(arguments,-1);if(1===e.length)return e[0];if(e.length>1)return e.slice(1).reduce((function(e,r){return x(e,r,t,0)}),e[0]);throw new Error("Wrong number of arguments in function concat")}function R(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];const n=t.map((e=>e.length)),i=Math.max(...n),s=new Array(i).fill(null);for(let e=0;e<t.length;e++){const r=t[e],o=n[e];for(let e=0;e<o;e++){const t=i-o+e;r[e]>s[t]&&(s[t]=r[e])}}for(let e=0;e<t.length;e++)k(t[e],s);return s}function k(e,t){const r=t.length,n=e.length;for(let i=0;i<n;i++){const s=r-n+i;if(e[i]<t[s]&&e[i]>1||e[i]>t[s])throw new Error(`shape missmatch: missmatch is found in arg with shape (${e}) not possible to broadcast dimension ${n} with size ${e[i]} to size ${t[s]}`)}}function j(e,t){let r=d(e);if((0,u.deepStrictEqual)(r,t))return e;k(r,t);const n=R(r,t),i=n.length,s=[...Array(i-r.length).fill(1),...r];let o=q(e);r.length<i&&(o=f(o,s),r=d(o));for(let e=0;e<i;e++)r[e]<n[e]&&(o=z(o,n[e],e),r=d(o));return o}function z(e,t,r){return w(...Array(t).fill(e),r)}function q(e){return(0,i.default)([],e)}},15333:(e,t)=>{"use strict";function r(e){if(e.isFinite()&&!e.isInteger())throw new Error("Integer expected in function bitNot");const t=e.constructor,r=t.precision;t.config({precision:1e9});const n=e.plus(new t(1));return n.s=-n.s||null,t.config({precision:r}),n}function n(e,t,n){const s=e.constructor;let o,a;const l=+(e.s<0),c=+(t.s<0);if(l){o=i(r(e));for(let e=0;e<o.length;++e)o[e]^=1}else o=i(e);if(c){a=i(r(t));for(let e=0;e<a.length;++e)a[e]^=1}else a=i(t);let u,d,h;o.length<=a.length?(u=o,d=a,h=l):(u=a,d=o,h=c);let p=u.length,m=d.length;const f=1^n(l,c);let g=new s(1^f),y=new s(1);const b=new s(2),v=s.precision;for(s.config({precision:1e9});p>0;)n(u[--p],d[--m])===f&&(g=g.plus(y)),y=y.times(b);for(;m>0;)n(h,d[--m])===f&&(g=g.plus(y)),y=y.times(b);return s.config({precision:v}),0===f&&(g.s=-g.s),g}function i(e){const t=e.d;let r=t[0]+"";for(let e=1;e<t.length;++e){let n=t[e]+"";for(let e=7-n.length;e--;)n="0"+n;r+=n}let n=r.length;for(;"0"===r.charAt(n);)n--;let i=e.e,s=r.slice(0,n+1||1);const o=s.length;if(i>0)if(++i>o)for(i-=o;i--;)s+="0";else i<o&&(s=s.slice(0,i)+"."+s.slice(i));const a=[0];for(let e=0;e<s.length;){let t=a.length;for(;t--;)a[t]*=10;a[0]+=parseInt(s.charAt(e++));for(let e=0;e<a.length;++e)a[e]>1&&(null!==a[e+1]&&void 0!==a[e+1]||(a[e+1]=0),a[e+1]+=a[e]>>1,a[e]&=1)}return a.reverse()}Object.defineProperty(t,"__esModule",{value:!0}),t.bitAndBigNumber=function(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitAnd");const r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);if(e.isZero()||t.eq(-1)||e.eq(t))return e;if(t.isZero()||e.eq(-1))return t;if(!e.isFinite()||!t.isFinite()){if(!e.isFinite()&&!t.isFinite())return e.isNegative()===t.isNegative()?e:new r(0);if(!e.isFinite())return t.isNegative()?e:e.isNegative()?new r(0):t;if(!t.isFinite())return e.isNegative()?t:t.isNegative()?new r(0):e}return n(e,t,(function(e,t){return e&t}))},t.bitNotBigNumber=r,t.bitOrBigNumber=function(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitOr");const r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);const i=new r(-1);if(e.isZero()||t.eq(i)||e.eq(t))return t;if(t.isZero()||e.eq(i))return e;if(!e.isFinite()||!t.isFinite())return!e.isFinite()&&!e.isNegative()&&t.isNegative()||e.isNegative()&&!t.isNegative()&&!t.isFinite()?i:e.isNegative()&&t.isNegative()?e.isFinite()?e:t:e.isFinite()?t:e;return n(e,t,(function(e,t){return e|t}))},t.bitXor=function(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitXor");const i=e.constructor;if(e.isNaN()||t.isNaN())return new i(NaN);if(e.isZero())return t;if(t.isZero())return e;if(e.eq(t))return new i(0);const s=new i(-1);if(e.eq(s))return r(t);if(t.eq(s))return r(e);if(!e.isFinite()||!t.isFinite())return e.isFinite()||t.isFinite()?new i(e.isNegative()===t.isNegative()?1/0:-1/0):s;return n(e,t,(function(e,t){return e^t}))},t.bitwise=n,t.leftShiftBigNumber=function(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function leftShift");const r=e.constructor;if(e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero())return new r(NaN);if(e.isZero()||t.isZero())return e;if(!e.isFinite()&&!t.isFinite())return new r(NaN);if(t.lt(55))return e.times(Math.pow(2,t.toNumber())+"");return e.times(new r(2).pow(t))},t.rightArithShiftBigNumber=function(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function rightArithShift");const r=e.constructor;if(e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero())return new r(NaN);if(e.isZero()||t.isZero())return e;if(!t.isFinite())return e.isNegative()?new r(-1):e.isFinite()?new r(0):new r(NaN);if(t.lt(55))return e.div(Math.pow(2,t.toNumber())+"").floor();return e.div(new r(2).pow(t)).floor()}},44879:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createBigNumberTau=t.createBigNumberPi=t.createBigNumberPhi=t.createBigNumberE=void 0;var n=r(76560);t.createBigNumberE=(0,n.memoize)((function(e){return new e(1).exp()}),{hasher:s}),t.createBigNumberPhi=(0,n.memoize)((function(e){return new e(1).plus(new e(5).sqrt()).div(2)}),{hasher:s});const i=t.createBigNumberPi=(0,n.memoize)((function(e){return e.acos(-1)}),{hasher:s});t.createBigNumberTau=(0,n.memoize)((function(e){return i(e).times(2)}),{hasher:s});function s(e){return e[0].precision}},97608:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.format=function(e,t){if("function"==typeof t)return t(e);if(!e.isFinite())return e.isNaN()?"NaN":e.gt(0)?"Infinity":"-Infinity";const{notation:r,precision:n,wordSize:u}=(0,i.normalizeFormatOptions)(t);switch(r){case"fixed":return l(e,n);case"exponential":return a(e,n);case"engineering":return o(e,n);case"bin":return s(e,2,u);case"oct":return s(e,8,u);case"hex":return s(e,16,u);case"auto":{const r=c(null==t?void 0:t.lowerExp,-3),i=c(null==t?void 0:t.upperExp,5);if(e.isZero())return"0";let s;const o=e.toSignificantDigits(n),l=o.e;return s=l>=r&&l<i?o.toFixed():a(e,n),s.replace(/((\.\d*?)(0+))($|e)/,(function(){const e=arguments[2],t=arguments[4];return"."!==e?e+t:t}))}default:throw new Error('Unknown notation "'+r+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}},t.toEngineering=o,t.toExponential=a,t.toFixed=l;var n=r(91612),i=r(34749);function s(e,t,r){const n=new(0,e.constructor)(2);let s="";if(r){if(r<1)throw new Error("size must be in greater than 0");if(!(0,i.isInteger)(r))throw new Error("size must be an integer");if(e.greaterThan(n.pow(r-1).sub(1))||e.lessThan(n.pow(r-1).mul(-1)))throw new Error(`Value must be in range [-2^${r-1}, 2^${r-1}-1]`);if(!e.isInteger())throw new Error("Value must be an integer");e.lessThan(0)&&(e=e.add(n.pow(r))),s=`i${r}`}switch(t){case 2:return`${e.toBinary()}${s}`;case 8:return`${e.toOctal()}${s}`;case 16:return`${e.toHexadecimal()}${s}`;default:throw new Error(`Base ${t} not supported `)}}function o(e,t){const r=e.e,n=r%3==0?r:r<0?r-3-r%3:r-r%3;let i=e.mul(Math.pow(10,-n)).toPrecision(t);if(i.includes("e")){i=new(0,e.constructor)(i).toFixed()}return i+"e"+(r>=0?"+":"")+n.toString()}function a(e,t){return void 0!==t?e.toExponential(t-1):e.toExponential()}function l(e,t){return e.toFixed(t)}function c(e,t){return(0,n.isNumber)(e)?e:(0,n.isBigNumber)(e)?e.toNumber():t}},67625:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nearlyEqual=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e-9,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(r<=0)throw new Error("Relative tolerance must be greater than 0");if(n<0)throw new Error("Absolute tolerance must be at least 0");if(e.isNaN()||t.isNaN())return!1;if(!e.isFinite()||!t.isFinite())return e.eq(t);if(e.eq(t))return!0;return e.minus(t).abs().lte(e.constructor.max(e.constructor.max(e.abs(),t.abs()).mul(r),n))}},16624:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.containsCollections=function(e){for(let t=0;t<e.length;t++)if((0,n.isCollection)(e[t]))return!0;return!1},t.deepForEach=function e(t,r){(0,n.isMatrix)(t)&&(t=t.valueOf());for(let n=0,i=t.length;n<i;n++){const i=t[n];Array.isArray(i)?e(i,r):r(i)}},t.deepMap=function e(t,r,n){return t&&"function"==typeof t.map?t.map((function(t){return e(t,r,n)})):r(t)},t.reduce=function(e,t,r){const o=Array.isArray(e)?(0,s.arraySize)(e):e.size();if(t<0||t>=o.length)throw new i.IndexError(t,o.length);return(0,n.isMatrix)(e)?e.create(a(e.valueOf(),t,r),e.datatype()):a(e,t,r)},t.scatter=function(e,t,r,n,i,s,o,a,l,c,u){const d=e._values,h=e._index,p=e._ptr;let m,f,g,y;if(n)for(f=p[t],g=p[t+1],m=f;m<g;m++)y=h[m],r[y]!==s?(r[y]=s,o.push(y),c?(n[y]=l?a(d[m],u):a(u,d[m]),i[y]=s):n[y]=d[m]):(n[y]=l?a(d[m],n[y]):a(n[y],d[m]),i[y]=s);else for(f=p[t],g=p[t+1],m=f;m<g;m++)y=h[m],r[y]!==s?(r[y]=s,o.push(y)):i[y]=s};var n=r(91612),i=r(17967),s=r(34487),o=r(55408);function a(e,t,r){let n,i,s,l;if(t<=0){if(Array.isArray(e[0])){for(l=(0,o._switch)(e),i=[],n=0;n<l.length;n++)i[n]=a(l[n],t-1,r);return i}for(s=e[0],n=1;n<e.length;n++)s=r(s,e[n]);return s}for(i=[],n=0;n<e.length;n++)i[n]=a(e[n],t-1,r);return i}},90938:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.complexEquals=function(e,t,r,i){return(0,n.nearlyEqual)(e.re,t.re,r,i)&&(0,n.nearlyEqual)(e.im,t.im,r,i)};var n=r(34749)},98770:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSafeMethod=function(e,t){if(!s(e,t))throw new Error('No access to method "'+t+'"');return e[t]},t.getSafeProperty=function(e,t){if(i(e,t))return e[t];if("function"==typeof e[t]&&s(e,t))throw new Error('Cannot access method "'+t+'" as a property');throw new Error('No access to property "'+t+'"')},t.isPlainObject=o,t.isSafeMethod=s,t.isSafeProperty=i,t.setSafeProperty=function(e,t,r){if(i(e,t))return e[t]=r,r;throw new Error('No access to property "'+t+'"')};var n=r(61175);function i(e,t){return!(!o(e)&&!Array.isArray(e))&&(!!(0,n.hasOwnProperty)(a,t)||!(t in Object.prototype)&&!(t in Function.prototype))}function s(e,t){return null!=e&&"function"==typeof e[t]&&(!((0,n.hasOwnProperty)(e,t)&&Object.getPrototypeOf&&t in Object.getPrototypeOf(e))&&(!!(0,n.hasOwnProperty)(l,t)||!(t in Object.prototype)&&!(t in Function.prototype)))}function o(e){return"object"==typeof e&&e&&e.constructor===Object}const a={length:!0,name:!0},l={toString:!0,valueOf:!0,toLocaleString:!0}},83392:(e,t,r)=>{"use strict";var n=r(87929);Object.defineProperty(t,"__esModule",{value:!0}),t.mixin=function(e){const t=new i.default;return e.on=t.on.bind(t),e.off=t.off.bind(t),e.once=t.once.bind(t),e.emit=t.emit.bind(t),e};var i=n(r(5994))},66212:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assertDependencies=o,t.create=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i(e).forEach((e=>e(t))),t},t.factory=function(e,t,r,i){function s(i){const s=(0,n.pickShallow)(i,t.map(l));return o(e,t,i),r(s)}s.isFactory=!0,s.fn=e,s.dependencies=t.slice().sort(),i&&(s.meta=i);return s},t.isFactory=s,t.isOptionalDependency=a,t.sortFactories=i,t.stripOptionalNotation=l;var n=r(61175);function i(e){const t={};function r(e,n){if(s(e)){if(e.dependencies.includes(n.fn||n.name))return!0;if(e.dependencies.some((e=>r(t[e],n))))return!0}return!1}e.forEach((e=>{t[e.fn]=e}));const n=[];function i(e){let t=0;for(;t<n.length&&!r(n[t],e);)t++;n.splice(t,0,e)}return e.filter(s).forEach(i),e.filter((e=>!s(e))).forEach(i),n}function s(e){return"function"==typeof e&&"string"==typeof e.fn&&Array.isArray(e.dependencies)}function o(e,t,r){if(!t.filter((e=>!a(e))).every((e=>void 0!==r[e]))){const n=t.filter((e=>void 0===r[e]));throw new Error(`Cannot create function "${e}", some dependencies are missing: ${n.map((e=>`"${e}"`)).join(", ")}.`)}}function a(e){return e&&"?"===e[0]}function l(e){return e&&"?"===e[0]?e.slice(1):e}},76560:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.memoize=function(e){let{hasher:t,limit:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r=null==r?Number.POSITIVE_INFINITY:r,t=null==t?JSON.stringify:t,function i(){"object"!=typeof i.cache&&(i.cache={values:new Map,lru:(0,n.lruQueue)(r||Number.POSITIVE_INFINITY)});const s=[];for(let e=0;e<arguments.length;e++)s[e]=arguments[e];const o=t(s);if(i.cache.values.has(o))return i.cache.lru.hit(o),i.cache.values.get(o);const a=e.apply(e,s);return i.cache.values.set(o,a),i.cache.values.delete(i.cache.lru.hit(o)),a}},t.memoizeCompare=function(e,t){const r=function r(){const n=[];for(let e=0;e<arguments.length;e++)n[e]=arguments[e];for(let e=0;e<r.cache.length;e++){const i=r.cache[e];if(t(n,i.args))return i.res}const i=e.apply(e,n);return r.cache.unshift({args:n,res:i}),i};return r.cache=[],r};var n=r(86924)},91612:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAccessorNode=function(e){return e&&!0===e.isAccessorNode&&!0===e.constructor.prototype.isNode||!1},t.isArray=void 0,t.isArrayNode=function(e){return e&&!0===e.isArrayNode&&!0===e.constructor.prototype.isNode||!1},t.isAssignmentNode=function(e){return e&&!0===e.isAssignmentNode&&!0===e.constructor.prototype.isNode||!1},t.isBigInt=function(e){return"bigint"==typeof e},t.isBigNumber=i,t.isBlockNode=function(e){return e&&!0===e.isBlockNode&&!0===e.constructor.prototype.isNode||!1},t.isBoolean=function(e){return"boolean"==typeof e},t.isChain=function(e){return e&&!0===e.constructor.prototype.isChain||!1},t.isCollection=function(e){return Array.isArray(e)||a(e)},t.isComplex=s,t.isConditionalNode=function(e){return e&&!0===e.isConditionalNode&&!0===e.constructor.prototype.isNode||!1},t.isConstantNode=u,t.isDate=function(e){return e instanceof Date},t.isDenseMatrix=function(e){return e&&e.isDenseMatrix&&!0===e.constructor.prototype.isMatrix||!1},t.isFraction=o,t.isFunction=function(e){return"function"==typeof e},t.isFunctionAssignmentNode=function(e){return e&&!0===e.isFunctionAssignmentNode&&!0===e.constructor.prototype.isNode||!1},t.isFunctionNode=function(e){return e&&!0===e.isFunctionNode&&!0===e.constructor.prototype.isNode||!1},t.isHelp=function(e){return e&&!0===e.constructor.prototype.isHelp||!1},t.isIndex=function(e){return e&&!0===e.constructor.prototype.isIndex||!1},t.isIndexNode=function(e){return e&&!0===e.isIndexNode&&!0===e.constructor.prototype.isNode||!1},t.isMap=c,t.isMatrix=a,t.isNode=function(e){return e&&!0===e.isNode&&!0===e.constructor.prototype.isNode||!1},t.isNull=function(e){return null===e},t.isNumber=function(e){return"number"==typeof e},t.isObject=l,t.isObjectNode=function(e){return e&&!0===e.isObjectNode&&!0===e.constructor.prototype.isNode||!1},t.isObjectWrappingMap=function(e){return c(e)&&l(e.wrappedObject)},t.isOperatorNode=d,t.isParenthesisNode=function(e){return e&&!0===e.isParenthesisNode&&!0===e.constructor.prototype.isNode||!1},t.isPartitionedMap=function(e){return c(e)&&c(e.a)&&c(e.b)},t.isRange=function(e){return e&&!0===e.constructor.prototype.isRange||!1},t.isRangeNode=function(e){return e&&!0===e.isRangeNode&&!0===e.constructor.prototype.isNode||!1},t.isRegExp=function(e){return e instanceof RegExp},t.isRelationalNode=function(e){return e&&!0===e.isRelationalNode&&!0===e.constructor.prototype.isNode||!1},t.isResultSet=function(e){return e&&!0===e.constructor.prototype.isResultSet||!1},t.isSparseMatrix=function(e){return e&&e.isSparseMatrix&&!0===e.constructor.prototype.isMatrix||!1},t.isString=function(e){return"string"==typeof e},t.isSymbolNode=function(e){return e&&!0===e.isSymbolNode&&!0===e.constructor.prototype.isNode||!1},t.isUndefined=function(e){return void 0===e},t.isUnit=function(e){return e&&!0===e.constructor.prototype.isUnit||!1},t.rule2Node=function(e){return u(e)||d(e)&&1===e.args.length&&u(e.args[0])&&"-+~".includes(e.op)},t.typeOf=function(e){const t=typeof e;if("object"===t)return null===e?"null":i(e)?"BigNumber":e.constructor&&e.constructor.name?e.constructor.name:"Object";return t};var n=r(81072);function i(e){return!(!e||"object"!=typeof e||"function"!=typeof e.constructor)&&(!0===e.isBigNumber&&"object"==typeof e.constructor.prototype&&!0===e.constructor.prototype.isBigNumber||"function"==typeof e.constructor.isDecimal&&!0===e.constructor.isDecimal(e))}function s(e){return e&&"object"==typeof e&&!0===Object.getPrototypeOf(e).isComplex||!1}function o(e){return e&&"object"==typeof e&&!0===Object.getPrototypeOf(e).isFraction||!1}t.isArray=Array.isArray;function a(e){return e&&!0===e.constructor.prototype.isMatrix||!1}function l(e){return!(!e||"object"!=typeof e||e.constructor!==Object||s(e)||o(e))}function c(e){return!!e&&(e instanceof Map||e instanceof n.ObjectWrappingMap||"function"==typeof e.set&&"function"==typeof e.get&&"function"==typeof e.keys&&"function"==typeof e.has)}function u(e){return e&&!0===e.isConstantNode&&!0===e.constructor.prototype.isNode||!1}function d(e){return e&&!0===e.isOperatorNode&&!0===e.constructor.prototype.isNode||!1}},60654:(e,t,r)=>{"use strict";var n=r(87929);Object.defineProperty(t,"__esModule",{value:!0}),t.defaultTemplate=void 0,t.escapeLatex=c,t.latexSymbols=t.latexOperators=t.latexFunctions=void 0,t.toSymbol=function(e,t){if(t=void 0!==t&&t)return(0,s.hasOwnProperty)(l,e)?l[e]:"\\mathrm{"+c(e)+"}";if((0,s.hasOwnProperty)(o,e))return o[e];return c(e)};var i=n(r(69110)),s=r(61175);const o=t.latexSymbols={Alpha:"A",alpha:"\\alpha",Beta:"B",beta:"\\beta",Gamma:"\\Gamma",gamma:"\\gamma",Delta:"\\Delta",delta:"\\delta",Epsilon:"E",epsilon:"\\epsilon",varepsilon:"\\varepsilon",Zeta:"Z",zeta:"\\zeta",Eta:"H",eta:"\\eta",Theta:"\\Theta",theta:"\\theta",vartheta:"\\vartheta",Iota:"I",iota:"\\iota",Kappa:"K",kappa:"\\kappa",varkappa:"\\varkappa",Lambda:"\\Lambda",lambda:"\\lambda",Mu:"M",mu:"\\mu",Nu:"N",nu:"\\nu",Xi:"\\Xi",xi:"\\xi",Omicron:"O",omicron:"o",Pi:"\\Pi",pi:"\\pi",varpi:"\\varpi",Rho:"P",rho:"\\rho",varrho:"\\varrho",Sigma:"\\Sigma",sigma:"\\sigma",varsigma:"\\varsigma",Tau:"T",tau:"\\tau",Upsilon:"\\Upsilon",upsilon:"\\upsilon",Phi:"\\Phi",phi:"\\phi",varphi:"\\varphi",Chi:"X",chi:"\\chi",Psi:"\\Psi",psi:"\\psi",Omega:"\\Omega",omega:"\\omega",true:"\\mathrm{True}",false:"\\mathrm{False}",i:"i",inf:"\\infty",Inf:"\\infty",infinity:"\\infty",Infinity:"\\infty",oo:"\\infty",lim:"\\lim",undefined:"\\mathbf{?}"},a=t.latexOperators={transpose:"^\\top",ctranspose:"^H",factorial:"!",pow:"^",dotPow:".^\\wedge",unaryPlus:"+",unaryMinus:"-",bitNot:"\\~",not:"\\neg",multiply:"\\cdot",divide:"\\frac",dotMultiply:".\\cdot",dotDivide:".:",mod:"\\mod",add:"+",subtract:"-",to:"\\rightarrow",leftShift:"<<",rightArithShift:">>",rightLogShift:">>>",equal:"=",unequal:"\\neq",smaller:"<",larger:">",smallerEq:"\\leq",largerEq:"\\geq",bitAnd:"\\&",bitXor:"\\underline{|}",bitOr:"|",and:"\\wedge",xor:"\\veebar",or:"\\vee"},l=(t.latexFunctions={abs:{1:"\\left|${args[0]}\\right|"},add:{2:`\\left(\${args[0]}${a.add}\${args[1]}\\right)`},cbrt:{1:"\\sqrt[3]{${args[0]}}"},ceil:{1:"\\left\\lceil${args[0]}\\right\\rceil"},cube:{1:"\\left(${args[0]}\\right)^3"},divide:{2:"\\frac{${args[0]}}{${args[1]}}"},dotDivide:{2:`\\left(\${args[0]}${a.dotDivide}\${args[1]}\\right)`},dotMultiply:{2:`\\left(\${args[0]}${a.dotMultiply}\${args[1]}\\right)`},dotPow:{2:`\\left(\${args[0]}${a.dotPow}\${args[1]}\\right)`},exp:{1:"\\exp\\left(${args[0]}\\right)"},expm1:`\\left(e${a.pow}{\${args[0]}}-1\\right)`,fix:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},floor:{1:"\\left\\lfloor${args[0]}\\right\\rfloor"},gcd:"\\gcd\\left(${args}\\right)",hypot:"\\hypot\\left(${args}\\right)",log:{1:"\\ln\\left(${args[0]}\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}\\right)"},log10:{1:"\\log_{10}\\left(${args[0]}\\right)"},log1p:{1:"\\ln\\left(${args[0]}+1\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}+1\\right)"},log2:"\\log_{2}\\left(${args[0]}\\right)",mod:{2:`\\left(\${args[0]}${a.mod}\${args[1]}\\right)`},multiply:{2:`\\left(\${args[0]}${a.multiply}\${args[1]}\\right)`},norm:{1:"\\left\\|${args[0]}\\right\\|",2:void 0},nthRoot:{2:"\\sqrt[${args[1]}]{${args[0]}}"},nthRoots:{2:"\\{y : $y^{args[1]} = {${args[0]}}\\}"},pow:{2:`\\left(\${args[0]}\\right)${a.pow}{\${args[1]}}`},round:{1:"\\left\\lfloor${args[0]}\\right\\rceil",2:void 0},sign:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},sqrt:{1:"\\sqrt{${args[0]}}"},square:{1:"\\left(${args[0]}\\right)^2"},subtract:{2:`\\left(\${args[0]}${a.subtract}\${args[1]}\\right)`},unaryMinus:{1:`${a.unaryMinus}\\left(\${args[0]}\\right)`},unaryPlus:{1:`${a.unaryPlus}\\left(\${args[0]}\\right)`},bitAnd:{2:`\\left(\${args[0]}${a.bitAnd}\${args[1]}\\right)`},bitNot:{1:a.bitNot+"\\left(${args[0]}\\right)"},bitOr:{2:`\\left(\${args[0]}${a.bitOr}\${args[1]}\\right)`},bitXor:{2:`\\left(\${args[0]}${a.bitXor}\${args[1]}\\right)`},leftShift:{2:`\\left(\${args[0]}${a.leftShift}\${args[1]}\\right)`},rightArithShift:{2:`\\left(\${args[0]}${a.rightArithShift}\${args[1]}\\right)`},rightLogShift:{2:`\\left(\${args[0]}${a.rightLogShift}\${args[1]}\\right)`},bellNumbers:{1:"\\mathrm{B}_{${args[0]}}"},catalan:{1:"\\mathrm{C}_{${args[0]}}"},stirlingS2:{2:"\\mathrm{S}\\left(${args}\\right)"},arg:{1:"\\arg\\left(${args[0]}\\right)"},conj:{1:"\\left(${args[0]}\\right)^*"},im:{1:"\\Im\\left\\lbrace${args[0]}\\right\\rbrace"},re:{1:"\\Re\\left\\lbrace${args[0]}\\right\\rbrace"},and:{2:`\\left(\${args[0]}${a.and}\${args[1]}\\right)`},not:{1:a.not+"\\left(${args[0]}\\right)"},or:{2:`\\left(\${args[0]}${a.or}\${args[1]}\\right)`},xor:{2:`\\left(\${args[0]}${a.xor}\${args[1]}\\right)`},cross:{2:"\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)"},ctranspose:{1:`\\left(\${args[0]}\\right)${a.ctranspose}`},det:{1:"\\det\\left(${args[0]}\\right)"},dot:{2:"\\left(${args[0]}\\cdot${args[1]}\\right)"},expm:{1:"\\exp\\left(${args[0]}\\right)"},inv:{1:"\\left(${args[0]}\\right)^{-1}"},pinv:{1:"\\left(${args[0]}\\right)^{+}"},sqrtm:{1:`{\${args[0]}}${a.pow}{\\frac{1}{2}}`},trace:{1:"\\mathrm{tr}\\left(${args[0]}\\right)"},transpose:{1:`\\left(\${args[0]}\\right)${a.transpose}`},combinations:{2:"\\binom{${args[0]}}{${args[1]}}"},combinationsWithRep:{2:"\\left(\\!\\!{\\binom{${args[0]}}{${args[1]}}}\\!\\!\\right)"},factorial:{1:`\\left(\${args[0]}\\right)${a.factorial}`},gamma:{1:"\\Gamma\\left(${args[0]}\\right)"},lgamma:{1:"\\ln\\Gamma\\left(${args[0]}\\right)"},equal:{2:`\\left(\${args[0]}${a.equal}\${args[1]}\\right)`},larger:{2:`\\left(\${args[0]}${a.larger}\${args[1]}\\right)`},largerEq:{2:`\\left(\${args[0]}${a.largerEq}\${args[1]}\\right)`},smaller:{2:`\\left(\${args[0]}${a.smaller}\${args[1]}\\right)`},smallerEq:{2:`\\left(\${args[0]}${a.smallerEq}\${args[1]}\\right)`},unequal:{2:`\\left(\${args[0]}${a.unequal}\${args[1]}\\right)`},erf:{1:"erf\\left(${args[0]}\\right)"},max:"\\max\\left(${args}\\right)",min:"\\min\\left(${args}\\right)",variance:"\\mathrm{Var}\\left(${args}\\right)",acos:{1:"\\cos^{-1}\\left(${args[0]}\\right)"},acosh:{1:"\\cosh^{-1}\\left(${args[0]}\\right)"},acot:{1:"\\cot^{-1}\\left(${args[0]}\\right)"},acoth:{1:"\\coth^{-1}\\left(${args[0]}\\right)"},acsc:{1:"\\csc^{-1}\\left(${args[0]}\\right)"},acsch:{1:"\\mathrm{csch}^{-1}\\left(${args[0]}\\right)"},asec:{1:"\\sec^{-1}\\left(${args[0]}\\right)"},asech:{1:"\\mathrm{sech}^{-1}\\left(${args[0]}\\right)"},asin:{1:"\\sin^{-1}\\left(${args[0]}\\right)"},asinh:{1:"\\sinh^{-1}\\left(${args[0]}\\right)"},atan:{1:"\\tan^{-1}\\left(${args[0]}\\right)"},atan2:{2:"\\mathrm{atan2}\\left(${args}\\right)"},atanh:{1:"\\tanh^{-1}\\left(${args[0]}\\right)"},cos:{1:"\\cos\\left(${args[0]}\\right)"},cosh:{1:"\\cosh\\left(${args[0]}\\right)"},cot:{1:"\\cot\\left(${args[0]}\\right)"},coth:{1:"\\coth\\left(${args[0]}\\right)"},csc:{1:"\\csc\\left(${args[0]}\\right)"},csch:{1:"\\mathrm{csch}\\left(${args[0]}\\right)"},sec:{1:"\\sec\\left(${args[0]}\\right)"},sech:{1:"\\mathrm{sech}\\left(${args[0]}\\right)"},sin:{1:"\\sin\\left(${args[0]}\\right)"},sinh:{1:"\\sinh\\left(${args[0]}\\right)"},tan:{1:"\\tan\\left(${args[0]}\\right)"},tanh:{1:"\\tanh\\left(${args[0]}\\right)"},to:{2:`\\left(\${args[0]}${a.to}\${args[1]}\\right)`},numeric:function(e,t){return e.args[0].toTex()},number:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"},string:{0:'\\mathtt{""}',1:"\\mathrm{string}\\left(${args[0]}\\right)"},bignumber:{0:"0",1:"\\left(${args[0]}\\right)"},bigint:{0:"0",1:"\\left(${args[0]}\\right)"},complex:{0:"0",1:"\\left(${args[0]}\\right)",2:`\\left(\\left(\${args[0]}\\right)+${o.i}\\cdot\\left(\${args[1]}\\right)\\right)`},matrix:{0:"\\begin{bmatrix}\\end{bmatrix}",1:"\\left(${args[0]}\\right)",2:"\\left(${args[0]}\\right)"},sparse:{0:"\\begin{bsparse}\\end{bsparse}",1:"\\left(${args[0]}\\right)"},unit:{1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"}},t.defaultTemplate="\\mathrm{${name}}\\left(${args}\\right)",{deg:"^\\circ"});function c(e){return(0,i.default)(e,{preserveFormatting:!0})}},86924:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lruQueue=function(e){let t=0,r=1,n=Object.create(null),i=Object.create(null),s=0;const o=function(e){const o=i[e];if(o&&(delete n[o],delete i[e],--t,r===o)){if(!t)return s=0,void(r=1);for(;!Object.prototype.hasOwnProperty.call(n,++r););}};return e=Math.abs(e),{hit:function(a){const l=i[a],c=++s;if(n[c]=a,i[a]=c,!l){if(++t,t<=e)return;return a=n[r],o(a),a}if(delete n[l],r===l)for(;!Object.prototype.hasOwnProperty.call(n,++r););},delete:o,clear:function(){t=s=0,r=1,n=Object.create(null),i=Object.create(null)}}}},81072:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PartitionedMap=t.ObjectWrappingMap=void 0,t.assign=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];for(const t of r)if(t)if((0,i.isMap)(t))for(const r of t.keys())e.set(r,t.get(r));else if((0,i.isObject)(t))for(const r of Object.keys(t))e.set(r,t[r]);return e},t.createEmptyMap=o,t.createMap=function(e){if(!e)return o();if((0,i.isMap)(e))return e;if((0,i.isObject)(e))return new ObjectWrappingMap(e);throw new Error("createMap can create maps from objects or Maps")},t.toObject=function(e){if(e instanceof ObjectWrappingMap)return e.wrappedObject;const t={};for(const r of e.keys()){const i=e.get(r);(0,n.setSafeProperty)(t,r,i)}return t};var n=r(98770),i=r(91612);class ObjectWrappingMap{constructor(e){this.wrappedObject=e,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).filter((e=>this.has(e))).values()}get(e){return(0,n.getSafeProperty)(this.wrappedObject,e)}set(e,t){return(0,n.setSafeProperty)(this.wrappedObject,e,t),this}has(e){return(0,n.isSafeProperty)(this.wrappedObject,e)&&e in this.wrappedObject}entries(){return s(this.keys(),(e=>[e,this.get(e)]))}forEach(e){for(const t of this.keys())e(this.get(t),t,this)}delete(e){(0,n.isSafeProperty)(this.wrappedObject,e)&&delete this.wrappedObject[e]}clear(){for(const e of this.keys())this.delete(e)}get size(){return Object.keys(this.wrappedObject).length}}t.ObjectWrappingMap=ObjectWrappingMap;function s(e,t){return{next:()=>{const r=e.next();return r.done?r:{value:t(r.value),done:!1}}}}function o(){return new Map}t.PartitionedMap=class PartitionedMap{constructor(e,t,r){this.a=e,this.b=t,this.bKeys=r,this[Symbol.iterator]=this.entries}get(e){return this.bKeys.has(e)?this.b.get(e):this.a.get(e)}set(e,t){return this.bKeys.has(e)?this.b.set(e,t):this.a.set(e,t),this}has(e){return this.b.has(e)||this.a.has(e)}keys(){return new Set([...this.a.keys(),...this.b.keys()])[Symbol.iterator]()}entries(){return s(this.keys(),(e=>[e,this.get(e)]))}forEach(e){for(const t of this.keys())e(this.get(t),t,this)}delete(e){return this.bKeys.has(e)?this.b.delete(e):this.a.delete(e)}clear(){this.a.clear(),this.b.clear()}get size(){return[...this.keys()].length}}},10604:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.noBignumber=function(){throw new Error('No "bignumber" implementation available')},t.noFraction=function(){throw new Error('No "fraction" implementation available')},t.noIndex=function(){throw new Error('No "index" implementation available')},t.noMatrix=function(){throw new Error('No "matrix" implementation available')},t.noSubset=function(){throw new Error('No "matrix" implementation available')}},34749:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cbrt=t.atanh=t.asinh=t.acosh=t.DBL_EPSILON=void 0,t.copysign=function(e,t){const r=e>0||!(e<0)&&1/e==1/0,n=t>0||!(t<0)&&1/t==1/0;return r^n?-e:e},t.cosh=void 0,t.digits=function(e){return e.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length},t.expm1=void 0,t.format=function(e,t){if("function"==typeof t)return t(e);if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(isNaN(e))return"NaN";const{notation:r,precision:n,wordSize:i}=a(t);switch(r){case"fixed":return u(e,n);case"exponential":return d(e,n);case"engineering":return c(e,n);case"bin":return o(e,2,i);case"oct":return o(e,8,i);case"hex":return o(e,16,i);case"auto":return h(e,n,t).replace(/((\.\d*?)(0+))($|e)/,(function(){const e=arguments[2],t=arguments[4];return"."!==e?e+t:t}));default:throw new Error('Unknown notation "'+r+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}},t.isInteger=i,t.isIntegerStr=s,t.log2=t.log1p=t.log10=void 0,t.nearlyEqual=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e-8,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(r<=0)throw new Error("Relative tolerance must be greater than 0");if(n<0)throw new Error("Absolute tolerance must be at least 0");if(isNaN(e)||isNaN(t))return!1;if(!isFinite(e)||!isFinite(t))return e===t;if(e===t)return!0;return Math.abs(e-t)<=Math.max(r*Math.max(Math.abs(e),Math.abs(t)),n)},t.normalizeFormatOptions=a,t.roundDigits=p,t.safeNumberType=function(e,t){if("bigint"===t.number&&!s(e))return t.numberFallback;return t.number},t.sinh=t.sign=void 0,t.splitNumber=l,t.tanh=void 0,t.toEngineering=c,t.toExponential=d,t.toFixed=u,t.toPrecision=h;var n=r(91612);function i(e){return"boolean"==typeof e||!!isFinite(e)&&e===Math.round(e)}function s(e){return/^-?\d+$/.test(e)}t.sign=Math.sign||function(e){return e>0?1:e<0?-1:0},t.log2=Math.log2||function(e){return Math.log(e)/Math.LN2},t.log10=Math.log10||function(e){return Math.log(e)/Math.LN10},t.log1p=Math.log1p||function(e){return Math.log(e+1)},t.cbrt=Math.cbrt||function(e){if(0===e)return e;const t=e<0;let r;return t&&(e=-e),isFinite(e)?(r=Math.exp(Math.log(e)/3),r=(e/(r*r)+2*r)/3):r=e,t?-r:r},t.expm1=Math.expm1||function(e){return e>=2e-4||e<=-2e-4?Math.exp(e)-1:e+e*e/2+e*e*e/6};function o(e,t,r){const n={2:"0b",8:"0o",16:"0x"}[t];let s="";if(r){if(r<1)throw new Error("size must be in greater than 0");if(!i(r))throw new Error("size must be an integer");if(e>2**(r-1)-1||e<-(2**(r-1)))throw new Error(`Value must be in range [-2^${r-1}, 2^${r-1}-1]`);if(!i(e))throw new Error("Value must be an integer");e<0&&(e+=2**r),s=`i${r}`}let o="";return e<0&&(e=-e,o="-"),`${o}${n}${e.toString(t)}${s}`}function a(e){let t,r,i="auto";if(void 0!==e)if((0,n.isNumber)(e))t=e;else if((0,n.isBigNumber)(e))t=e.toNumber();else{if(!(0,n.isObject)(e))throw new Error("Unsupported type of options, number, BigNumber, or object expected");void 0!==e.precision&&(t=f(e.precision,(()=>{throw new Error('Option "precision" must be a number or BigNumber')}))),void 0!==e.wordSize&&(r=f(e.wordSize,(()=>{throw new Error('Option "wordSize" must be a number or BigNumber')}))),e.notation&&(i=e.notation)}return{notation:i,precision:t,wordSize:r}}function l(e){const t=String(e).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw new SyntaxError("Invalid number "+e);const r=t[1],n=t[2];let i=parseFloat(t[4]||"0");const s=n.indexOf(".");i+=-1!==s?s-1:n.length-1;const o=n.replace(".","").replace(/^0*/,(function(e){return i-=e.length,""})).replace(/0*$/,"").split("").map((function(e){return parseInt(e)}));return 0===o.length&&(o.push(0),i++),{sign:r,coefficients:o,exponent:i}}function c(e,t){if(isNaN(e)||!isFinite(e))return String(e);const r=p(l(e),t),i=r.exponent,s=r.coefficients,o=i%3==0?i:i<0?i-3-i%3:i-i%3;if((0,n.isNumber)(t))for(;t>s.length||i-o+1>s.length;)s.push(0);else{const e=Math.abs(i-o)-(s.length-1);for(let t=0;t<e;t++)s.push(0)}let a=Math.abs(i-o),c=1;for(;a>0;)c++,a--;const u=s.slice(c).join(""),d=(0,n.isNumber)(t)&&u.length||u.match(/[1-9]/)?"."+u:"",h=s.slice(0,c).join("")+d+"e"+(i>=0?"+":"")+o.toString();return r.sign+h}function u(e,t){if(isNaN(e)||!isFinite(e))return String(e);const r=l(e),n="number"==typeof t?p(r,r.exponent+1+t):r;let i=n.coefficients,s=n.exponent+1;const o=s+(t||0);return i.length<o&&(i=i.concat(m(o-i.length))),s<0&&(i=m(1-s).concat(i),s=1),s<i.length&&i.splice(s,0,0===s?"0.":"."),n.sign+i.join("")}function d(e,t){if(isNaN(e)||!isFinite(e))return String(e);const r=l(e),n=t?p(r,t):r;let i=n.coefficients;const s=n.exponent;i.length<t&&(i=i.concat(m(t-i.length)));const o=i.shift();return n.sign+o+(i.length>0?"."+i.join(""):"")+"e"+(s>=0?"+":"")+s}function h(e,t,r){if(isNaN(e)||!isFinite(e))return String(e);const n=g(null==r?void 0:r.lowerExp,-3),i=g(null==r?void 0:r.upperExp,5),s=l(e),o=t?p(s,t):s;if(o.exponent<n||o.exponent>=i)return d(e,t);{let e=o.coefficients;const r=o.exponent;e.length<t&&(e=e.concat(m(t-e.length))),e=e.concat(m(r-e.length+1+(e.length<t?t-e.length:0))),e=m(-r).concat(e);const n=r>0?r:0;return n<e.length-1&&e.splice(n+1,0,"."),o.sign+e.join("")}}function p(e,t){const r={sign:e.sign,coefficients:e.coefficients,exponent:e.exponent},n=r.coefficients;for(;t<=0;)n.unshift(0),r.exponent++,t++;if(n.length>t){if(n.splice(t,n.length-t)[0]>=5){let e=t-1;for(n[e]++;10===n[e];)n.pop(),0===e&&(n.unshift(0),r.exponent++,e++),e--,n[e]++}}return r}function m(e){const t=[];for(let r=0;r<e;r++)t.push(0);return t}t.DBL_EPSILON=Number.EPSILON||2220446049250313e-31;t.acosh=Math.acosh||function(e){return Math.log(Math.sqrt(e*e-1)+e)},t.asinh=Math.asinh||function(e){return Math.log(Math.sqrt(e*e+1)+e)},t.atanh=Math.atanh||function(e){return Math.log((1+e)/(1-e))/2},t.cosh=Math.cosh||function(e){return(Math.exp(e)+Math.exp(-e))/2},t.sinh=Math.sinh||function(e){return(Math.exp(e)-Math.exp(-e))/2},t.tanh=Math.tanh||function(e){const t=Math.exp(2*e);return(t-1)/(t+1)};function f(e,t){return(0,n.isNumber)(e)?e:(0,n.isBigNumber)(e)?e.toNumber():void t()}function g(e,t){return(0,n.isNumber)(e)?e:(0,n.isBigNumber)(e)?e.toNumber():t}},61175:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.canDefineProperty=function(){try{if(Object.defineProperty)return Object.defineProperty({},"x",{get:function(){return null}}),!0}catch(e){}return!1},t.clone=function e(t){const r=typeof t;if("number"===r||"bigint"===r||"string"===r||"boolean"===r||null==t)return t;if("function"==typeof t.clone)return t.clone();if(Array.isArray(t))return t.map((function(t){return e(t)}));if(t instanceof Date)return new Date(t.valueOf());if((0,n.isBigNumber)(t))return t;if((0,n.isObject)(t))return i(t,e);throw new TypeError(`Cannot clone: unknown type of value (value: ${t})`)},t.deepExtend=function e(t,r){if(Array.isArray(r))throw new TypeError("Arrays are not supported by deepExtend");for(const n in r)if(o(r,n)&&!(n in Object.prototype)&&!(n in Function.prototype))if(r[n]&&r[n].constructor===Object)void 0===t[n]&&(t[n]={}),t[n]&&t[n].constructor===Object?e(t[n],r[n]):t[n]=r[n];else{if(Array.isArray(r[n]))throw new TypeError("Arrays are not supported by deepExtend");t[n]=r[n]}return t},t.deepFlatten=function(e){const t={};return s(e,t),t},t.deepStrictEqual=function e(t,r){let n,i,s;if(Array.isArray(t)){if(!Array.isArray(r))return!1;if(t.length!==r.length)return!1;for(i=0,s=t.length;i<s;i++)if(!e(t[i],r[i]))return!1;return!0}if("function"==typeof t)return t===r;if(t instanceof Object){if(Array.isArray(r)||!(r instanceof Object))return!1;for(n in t)if(!(n in r)||!e(t[n],r[n]))return!1;for(n in r)if(!(n in t))return!1;return!0}return t===r},t.extend=function(e,t){for(const r in t)o(t,r)&&(e[r]=t[r]);return e},t.get=a,t.hasOwnProperty=o,t.isLegacyFactory=function(e){return e&&"function"==typeof e.factory},t.lazy=function(e,t,r){let n,i=!0;Object.defineProperty(e,t,{get:function(){return i&&(n=r(),i=!1),n},set:function(e){n=e,i=!1},configurable:!0,enumerable:!0})},t.mapObject=i,t.pick=function(e,t,r){const n={};for(let i=0;i<t.length;i++){const s=t[i],o=a(e,s);void 0!==o&&l(n,s,r?r(o,s):o)}return n},t.pickShallow=function(e,t){const r={};for(let n=0;n<t.length;n++){const i=t[n],s=e[i];void 0!==s&&(r[i]=s)}return r},t.set=l,t.traverse=function e(t,r){if(r&&"string"==typeof r)return e(t,r.split("."));let n=t;if(r)for(let e=0;e<r.length;e++){const t=r[e];t in n||(n[t]={}),n=n[t]}return n};var n=r(91612);function i(e,t){const r={};for(const n in e)o(e,n)&&(r[n]=t(e[n]));return r}function s(e,t){for(const r in e)if(o(e,r)){const n=e[r];"object"==typeof n&&null!==n?s(n,t):t[r]=n}}function o(e,t){return e&&Object.hasOwnProperty.call(e,t)}function a(e,t){if("string"==typeof t)return c(t)?a(e,t.split(".")):e[t];let r=e;for(let e=0;e<t.length;e++){const n=t[e];r=r?r[n]:void 0}return r}function l(e,t,r){if("string"==typeof t)return c(t)?l(e,t.split("."),r):(e[t]=r,e);let n=e;for(let e=0;e<t.length-1;e++){const r=t[e];void 0===n[r]&&(n[r]={}),n=n[r]}if(t.length>0){n[t[t.length-1]]=r}return e}function c(e){return e.includes(".")}},34933:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.printTemplate=void 0;t.printTemplate=/\$([\w.]+)/g},98189:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.product=function e(t,r){if(r<t)return 1;if(r===t)return r;const n=r+t>>1;return e(t,n)*e(n+1,r)}},52434:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSubScope=function(e,t){return new n.PartitionedMap(e,new n.ObjectWrappingMap(t),new Set(Object.keys(t)))};var n=r(81072)},7041:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compareText=function(e,t){if(!(0,n.isString)(e))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+(0,n.typeOf)(e)+", index: 0)");if(!(0,n.isString)(t))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+(0,n.typeOf)(t)+", index: 1)");return e===t?0:e>t?1:-1},t.endsWith=function(e,t){const r=e.length-t.length,n=e.length;return e.substring(r,n)===t},t.escape=function(e){let t=String(e);return t=t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),t},t.format=o,t.stringify=a;var n=r(91612),i=r(34749),s=r(97608);function o(e,t){const r=function(e,t){if("number"==typeof e)return(0,i.format)(e,t);if((0,n.isBigNumber)(e))return(0,s.format)(e,t);if(function(e){return e&&"object"==typeof e&&"number"==typeof e.s&&"number"==typeof e.n&&"number"==typeof e.d||!1}(e))return t&&"decimal"===t.fraction?e.toString():e.s*e.n+"/"+e.d;if(Array.isArray(e))return c(e,t);if((0,n.isString)(e))return a(e);if("function"==typeof e)return e.syntax?String(e.syntax):"function";if(e&&"object"==typeof e){if("function"==typeof e.format)return e.format(t);if(e&&e.toString(t)!=={}.toString())return e.toString(t);return"{"+Object.keys(e).map((r=>a(r)+": "+o(e[r],t))).join(", ")+"}"}return String(e)}(e,t);return t&&"object"==typeof t&&"truncate"in t&&r.length>t.truncate?r.substring(0,t.truncate-3)+"...":r}function a(e){const t=String(e);let r="",n=0;for(;n<t.length;){const e=t.charAt(n);r+=e in l?l[e]:e,n++}return'"'+r+'"'}const l={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"};function c(e,t){if(Array.isArray(e)){let r="[";const n=e.length;for(let i=0;i<n;i++)0!==i&&(r+=", "),r+=c(e[i],t);return r+="]",r}return o(e,t)}},55408:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._switch=function(e){const t=e.length,r=e[0].length;let n,i;const s=[];for(i=0;i<r;i++){const r=[];for(n=0;n<t;n++)r.push(e[n][i]);s.push(r)}return s}},59012:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.version=void 0;t.version="13.1.1"},55288:(e,t,r)=>{var n=r(6487);e.exports=function(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},37693:e=>{function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(null,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},87929:e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},69650:(e,t,r)=>{var n=r(17443).default;e.exports=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},6487:(e,t,r)=>{var n=r(17443).default,i=r(69650);e.exports=function(e){var t=i(e,"string");return"symbol"==n(t)?t:t+""},e.exports.__esModule=!0,e.exports.default=e.exports},17443:e=>{function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},83999:function(e){e.exports=function(){"use strict";function e(){return!0}function t(){return!1}function r(){}const n="Argument is not a typed-function.";function i(){function s(e){return"object"==typeof e&&null!==e&&e.constructor===Object}const o=[{name:"number",test:function(e){return"number"==typeof e}},{name:"string",test:function(e){return"string"==typeof e}},{name:"boolean",test:function(e){return"boolean"==typeof e}},{name:"Function",test:function(e){return"function"==typeof e}},{name:"Array",test:Array.isArray},{name:"Date",test:function(e){return e instanceof Date}},{name:"RegExp",test:function(e){return e instanceof RegExp}},{name:"Object",test:s},{name:"null",test:function(e){return null===e}},{name:"undefined",test:function(e){return void 0===e}}],a={name:"any",test:e,isAny:!0};let l,c,u=0,d={createCount:0};function h(e){const t=l.get(e);if(t)return t;let r='Unknown type "'+e+'"';const n=e.toLowerCase();let i;for(i of c)if(i.toLowerCase()===n){r+='. Did you mean "'+i+'" ?';break}throw new TypeError(r)}function p(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";const r=t?h(t).index:c.length,n=[];for(let t=0;t<e.length;++t){if(!e[t]||"string"!=typeof e[t].name||"function"!=typeof e[t].test)throw new TypeError("Object with properties {name: string, test: function} expected");const i=e[t].name;if(l.has(i))throw new TypeError('Duplicate type name "'+i+'"');n.push(i),l.set(i,{name:i,test:e[t].test,isAny:e[t].isAny,index:r+t,conversionsTo:[]})}const i=c.slice(r);c=c.slice(0,r).concat(n).concat(i);for(let e=r+n.length;e<c.length;++e)l.get(c[e]).index=e}function m(){l=new Map,c=[],u=0,p([a],!1)}function f(){let e;for(e of c)l.get(e).conversionsTo=[];u=0}function g(e){const t=c.filter((t=>{const r=l.get(t);return!r.isAny&&r.test(e)}));return t.length?t:["any"]}function y(e){return e&&"function"==typeof e&&"_typedFunctionData"in e}function b(e,t,r){if(!y(e))throw new TypeError(n);const i=r&&r.exact,s=j(Array.isArray(t)?t.join(","):t),o=x(s);if(!i||o in e.signatures){const t=e._typedFunctionData.signatureMap.get(o);if(t)return t}const a=s.length;let l,c;if(i){let t;for(t in l=[],e.signatures)l.push(e._typedFunctionData.signatureMap.get(t))}else l=e._typedFunctionData.signatures;for(let e=0;e<a;++e){const t=s[e],r=[];let n;for(n of l){const i=Z(n.params,e);if(i&&(!t.restParam||i.restParam)){if(!i.hasAny){const e=k(i);if(t.types.some((t=>!e.has(t.name))))continue}r.push(n)}}if(l=r,0===l.length)break}for(c of l)if(c.params.length<=a)return c;throw new TypeError("Signature not found (signature: "+(e.name||"unnamed")+"("+x(s,", ")+"))")}function v(e,t,r){return b(e,t,r).implementation}function _(e,t){const r=h(t);if(r.test(e))return e;const n=r.conversionsTo;if(0===n.length)throw new Error("There are no conversions to "+t+" defined.");for(let t=0;t<n.length;t++)if(h(n[t].from).test(e))return n[t].convert(e);throw new Error("Cannot convert "+e+" to "+t)}function x(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:",";return e.map((e=>e.name)).join(t)}function w(e){const t=0===e.indexOf("..."),r=(t?e.length>3?e.slice(3):"any":e).split("|").map((e=>h(e.trim())));let n=!1,i=t?"...":"";return{types:r.map((function(e){return n=e.isAny||n,i+=e.name+"|",{name:e.name,typeIndex:e.index,test:e.test,isAny:e.isAny,conversion:null,conversionIndex:-1}})),name:i.slice(0,-1),hasAny:n,hasConversion:!1,restParam:t}}function R(e){const t=oe(e.types.map((e=>e.name)));let r=e.hasAny,n=e.name;const i=t.map((function(e){const t=h(e.from);return r=t.isAny||r,n+="|"+e.from,{name:e.from,typeIndex:t.index,test:t.test,isAny:t.isAny,conversion:e,conversionIndex:e.index}}));return{types:e.types.concat(i),name:n,hasAny:r,hasConversion:i.length>0,restParam:e.restParam}}function k(e){return e.typeSet||(e.typeSet=new Set,e.types.forEach((t=>e.typeSet.add(t.name)))),e.typeSet}function j(e){const t=[];if("string"!=typeof e)throw new TypeError("Signatures must be strings");const r=e.trim();if(""===r)return t;const n=r.split(",");for(let e=0;e<n.length;++e){const r=w(n[e].trim());if(r.restParam&&e!==n.length-1)throw new SyntaxError('Unexpected rest parameter "'+n[e]+'": only allowed for the last parameter');if(0===r.types.length)return null;t.push(r)}return t}function z(e){const t=be(e);return!!t&&t.restParam}function q(t){if(t&&0!==t.types.length){if(1===t.types.length)return h(t.types[0].name).test;if(2===t.types.length){const e=h(t.types[0].name).test,r=h(t.types[1].name).test;return function(t){return e(t)||r(t)}}{const e=t.types.map((function(e){return h(e.name).test}));return function(t){for(let r=0;r<e.length;r++)if(e[r](t))return!0;return!1}}}return e}function $(e){let t,r,n;if(z(e)){t=ye(e).map(q);const r=t.length,n=q(be(e)),i=function(e){for(let t=r;t<e.length;t++)if(!n(e[t]))return!1;return!0};return function(e){for(let r=0;r<t.length;r++)if(!t[r](e[r]))return!1;return i(e)&&e.length>=r+1}}return 0===e.length?function(e){return 0===e.length}:1===e.length?(r=q(e[0]),function(e){return r(e[0])&&1===e.length}):2===e.length?(r=q(e[0]),n=q(e[1]),function(e){return r(e[0])&&n(e[1])&&2===e.length}):(t=e.map(q),function(e){for(let r=0;r<t.length;r++)if(!t[r](e[r]))return!1;return e.length===t.length})}function Z(e,t){return t<e.length?e[t]:z(e)?be(e):null}function X(e,t){const r=Z(e,t);return r?k(r):new Set}function Y(e){return null===e.conversion||void 0===e.conversion}function ee(e,t){const r=new Set;return e.forEach((e=>{const n=X(e.params,t);let i;for(i of n)r.add(i)})),r.has("any")?["any"]:Array.from(r)}function te(e,t,r){let n,i;const s=e||"unnamed";let o,a=r;for(o=0;o<t.length;o++){const e=[];if(a.forEach((r=>{const n=q(Z(r.params,o));(o<r.params.length||z(r.params))&&n(t[o])&&e.push(r)})),0===e.length){if(i=ee(a,o),i.length>0){const e=g(t[o]);return n=new TypeError("Unexpected type of argument in function "+s+" (expected: "+i.join(" or ")+", actual: "+e.join(" | ")+", index: "+o+")"),n.data={category:"wrongType",fn:s,index:o,actual:e,expected:i},n}}else a=e}const l=a.map((function(e){return z(e.params)?1/0:e.params.length}));if(t.length<Math.min.apply(null,l))return i=ee(a,o),n=new TypeError("Too few arguments in function "+s+" (expected: "+i.join(" or ")+", index: "+t.length+")"),n.data={category:"tooFewArgs",fn:s,index:t.length,expected:i},n;const c=Math.max.apply(null,l);if(t.length>c)return n=new TypeError("Too many arguments in function "+s+" (expected: "+c+", actual: "+t.length+")"),n.data={category:"tooManyArgs",fn:s,index:t.length,expectedLength:c},n;const u=[];for(let e=0;e<t.length;++e)u.push(g(t[e]).join("|"));return n=new TypeError('Arguments of type "'+u.join(", ")+'" do not match any of the defined signatures of function '+s+"."),n.data={category:"mismatch",actual:u},n}function re(e){let t=c.length+1;for(let r=0;r<e.types.length;r++)Y(e.types[r])&&(t=Math.min(t,e.types[r].typeIndex));return t}function ne(e){let t=u+1;for(let r=0;r<e.types.length;r++)Y(e.types[r])||(t=Math.min(t,e.types[r].conversionIndex));return t}function ie(e,t){if(e.hasAny){if(!t.hasAny)return 1}else if(t.hasAny)return-1;if(e.restParam){if(!t.restParam)return 1}else if(t.restParam)return-1;if(e.hasConversion){if(!t.hasConversion)return 1}else if(t.hasConversion)return-1;const r=re(e)-re(t);if(r<0)return-1;if(r>0)return 1;const n=ne(e)-ne(t);return n<0?-1:n>0?1:0}function se(e,t){const r=e.params,n=t.params,i=be(r),s=be(n),o=z(r),a=z(n);if(o&&i.hasAny){if(!a||!s.hasAny)return 1}else if(a&&s.hasAny)return-1;let l,c=0,u=0;for(l of r)l.hasAny&&++c,l.hasConversion&&++u;let d=0,h=0;for(l of n)l.hasAny&&++d,l.hasConversion&&++h;if(c!==d)return c-d;if(o&&i.hasConversion){if(!a||!s.hasConversion)return 1}else if(a&&s.hasConversion)return-1;if(u!==h)return u-h;if(o){if(!a)return 1}else if(a)return-1;const p=(r.length-n.length)*(o?-1:1);if(0!==p)return p;const m=[];let f,g=0;for(let e=0;e<r.length;++e){const t=ie(r[e],n[e]);m.push(t),g+=t}if(0!==g)return g;for(f of m)if(0!==f)return f;return 0}function oe(e){if(0===e.length)return[];const t=e.map(h);e.length>1&&t.sort(((e,t)=>e.index-t.index));let r=t[0].conversionsTo;if(1===e.length)return r;r=r.concat([]);const n=new Set(e);for(let e=1;e<t.length;++e){let i;for(i of t[e].conversionsTo)n.has(i.from)||(r.push(i),n.add(i.from))}return r}function ae(e,t){let r=t;if(e.some((e=>e.hasConversion))){const n=z(e),i=e.map(le);r=function(){const e=[],r=n?arguments.length-1:arguments.length;for(let t=0;t<r;t++)e[t]=i[t](arguments[t]);return n&&(e[r]=arguments[r].map(i[r])),t.apply(this,e)}}let n=r;if(z(e)){const t=e.length-1;n=function(){return r.apply(this,ve(arguments,0,t).concat([ve(arguments,t)]))}}return n}function le(e){let t,r,n,i;const s=[],o=[];switch(e.types.forEach((function(e){e.conversion&&(s.push(h(e.conversion.from).test),o.push(e.conversion.convert))})),o.length){case 0:return function(e){return e};case 1:return t=s[0],n=o[0],function(e){return t(e)?n(e):e};case 2:return t=s[0],r=s[1],n=o[0],i=o[1],function(e){return t(e)?n(e):r(e)?i(e):e};default:return function(e){for(let t=0;t<o.length;t++)if(s[t](e))return o[t](e);return e}}}function ce(e){function t(e,r,n){if(r<e.length){const i=e[r];let s=[];if(i.restParam){const e=i.types.filter(Y);e.length<i.types.length&&s.push({types:e,name:"..."+e.map((e=>e.name)).join("|"),hasAny:e.some((e=>e.isAny)),hasConversion:!1,restParam:!0}),s.push(i)}else s=i.types.map((function(e){return{types:[e],name:e.name,hasAny:e.isAny,hasConversion:e.conversion,restParam:!1}}));return xe(s,(function(i){return t(e,r+1,n.concat([i]))}))}return[n]}return t(e,0,[])}function ue(e,t){const r=Math.max(e.length,t.length);for(let n=0;n<r;n++){const r=X(e,n),i=X(t,n);let s,o=!1;for(s of i)if(r.has(s)){o=!0;break}if(!o)return!1}const n=e.length,i=t.length,s=z(e),o=z(t);return s?o?n===i:i>=n:o?n>=i:n===i}function de(e){return e.map((e=>Re(e)?Pe(e.referToSelf.callback):Te(e)?Se(e.referTo.references,e.referTo.callback):e))}function he(e,t,r){const n=[];let i;for(i of e){let e=r[i];if("number"!=typeof e)throw new TypeError('No definition for referenced signature "'+i+'"');if(e=t[e],"function"!=typeof e)return!1;n.push(e)}return n}function pe(e,t,r){const n=de(e),i=new Array(n.length).fill(!1);let s=!0;for(;s;){s=!1;let e=!0;for(let o=0;o<n.length;++o){if(i[o])continue;const a=n[o];if(Re(a))n[o]=a.referToSelf.callback(r),n[o].referToSelf=a.referToSelf,i[o]=!0,e=!1;else if(Te(a)){const r=he(a.referTo.references,n,t);r?(n[o]=a.referTo.callback.apply(this,r),n[o].referTo=a.referTo,i[o]=!0,e=!1):s=!0}}if(e&&s)throw new SyntaxError("Circular reference detected in resolving typed.referTo")}return n}function me(e){const t=/\bthis(\(|\.signatures\b)/;Object.keys(e).forEach((r=>{const n=e[r];if(t.test(n.toString()))throw new SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")}))}function fe(e,n){if(d.createCount++,0===Object.keys(n).length)throw new SyntaxError("No signatures provided");d.warnAgainstDeprecatedThis&&me(n);const i=[],s=[],o={},a=[];let l;for(l in n){if(!Object.prototype.hasOwnProperty.call(n,l))continue;const e=j(l);if(!e)continue;i.forEach((function(t){if(ue(t,e))throw new TypeError('Conflicting signatures "'+x(t)+'" and "'+x(e)+'".')})),i.push(e);const t=s.length;s.push(n[l]);const r=e.map(R);let c;for(c of ce(r)){const e=x(c);a.push({params:c,name:e,fn:t}),c.every((e=>!e.hasConversion))&&(o[e]=t)}}a.sort(se);const c=pe(s,o,He);let u;for(u in o)Object.prototype.hasOwnProperty.call(o,u)&&(o[u]=c[o[u]]);const h=[],p=new Map;for(u of a)p.has(u.name)||(u.fn=c[u.fn],h.push(u),p.set(u.name,u));const m=h[0]&&h[0].params.length<=2&&!z(h[0].params),f=h[1]&&h[1].params.length<=2&&!z(h[1].params),g=h[2]&&h[2].params.length<=2&&!z(h[2].params),y=h[3]&&h[3].params.length<=2&&!z(h[3].params),b=h[4]&&h[4].params.length<=2&&!z(h[4].params),v=h[5]&&h[5].params.length<=2&&!z(h[5].params),_=m&&f&&g&&y&&b&&v;for(let e=0;e<h.length;++e)h[e].test=$(h[e].params);const w=m?q(h[0].params[0]):t,k=f?q(h[1].params[0]):t,Z=g?q(h[2].params[0]):t,X=y?q(h[3].params[0]):t,Y=b?q(h[4].params[0]):t,ee=v?q(h[5].params[0]):t,te=m?q(h[0].params[1]):t,re=f?q(h[1].params[1]):t,ne=g?q(h[2].params[1]):t,ie=y?q(h[3].params[1]):t,oe=b?q(h[4].params[1]):t,le=v?q(h[5].params[1]):t;for(let e=0;e<h.length;++e)h[e].implementation=ae(h[e].params,h[e].fn);const de=m?h[0].implementation:r,he=f?h[1].implementation:r,fe=g?h[2].implementation:r,ge=y?h[3].implementation:r,ye=b?h[4].implementation:r,be=v?h[5].implementation:r,ve=m?h[0].params.length:-1,_e=f?h[1].params.length:-1,xe=g?h[2].params.length:-1,we=y?h[3].params.length:-1,Se=b?h[4].params.length:-1,Pe=v?h[5].params.length:-1,Te=_?6:0,Re=h.length,ke=h.map((e=>e.test)),Ie=h.map((e=>e.implementation)),je=function(){for(let e=Te;e<Re;e++)if(ke[e](arguments))return Ie[e].apply(this,arguments);return d.onMismatch(e,arguments,h)};function He(e,t){return arguments.length===ve&&w(e)&&te(t)?de.apply(this,arguments):arguments.length===_e&&k(e)&&re(t)?he.apply(this,arguments):arguments.length===xe&&Z(e)&&ne(t)?fe.apply(this,arguments):arguments.length===we&&X(e)&&ie(t)?ge.apply(this,arguments):arguments.length===Se&&Y(e)&&oe(t)?ye.apply(this,arguments):arguments.length===Pe&&ee(e)&&le(t)?be.apply(this,arguments):je.apply(this,arguments)}try{Object.defineProperty(He,"name",{value:e})}catch(e){}return He.signatures=o,He._typedFunctionData={signatures:h,signatureMap:p},He}function ge(e,t,r){throw te(e,t,r)}function ye(e){return ve(e,0,e.length-1)}function be(e){return e[e.length-1]}function ve(e,t,r){return Array.prototype.slice.call(e,t,r)}function _e(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return e[r]}function xe(e,t){return Array.prototype.concat.apply([],e.map(t))}function we(){const e=ye(arguments).map((e=>x(j(e)))),t=be(arguments);if("function"!=typeof t)throw new TypeError("Callback function expected as last argument");return Se(e,t)}function Se(e,t){return{referTo:{references:e,callback:t}}}function Pe(e){if("function"!=typeof e)throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:e}}}function Te(e){return e&&"object"==typeof e.referTo&&Array.isArray(e.referTo.references)&&"function"==typeof e.referTo.callback}function Re(e){return e&&"object"==typeof e.referToSelf&&"function"==typeof e.referToSelf.callback}function ke(e,t){if(!e)return t;if(t&&t!==e){const r=new Error("Function names do not match (expected: "+e+", actual: "+t+")");throw r.data={actual:t,expected:e},r}return e}function Ie(e){let t;for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(y(e[r])||"string"==typeof e[r].signature)&&(t=ke(t,e[r].name));return t}function je(e,t){let r;for(r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(r in e&&t[r]!==e[r]){const n=new Error('Signature "'+r+'" is defined twice');throw n.data={signature:r,sourceFunction:t[r],destFunction:e[r]},n}e[r]=t[r]}}m(),p(o);const He=d;function ze(e){if(!e||"string"!=typeof e.from||"string"!=typeof e.to||"function"!=typeof e.convert)throw new TypeError("Object with properties {from: string, to: string, convert: function} expected");if(e.to===e.from)throw new SyntaxError('Illegal to define conversion from "'+e.from+'" to itself.')}return d=function(e){const t="string"==typeof e;let r=t?e:"";const n={};for(let e=t?1:0;e<arguments.length;++e){const i=arguments[e];let o,a={};if("function"==typeof i?(o=i.name,"string"==typeof i.signature?a[i.signature]=i:y(i)&&(a=i.signatures)):s(i)&&(a=i,t||(o=Ie(i))),0===Object.keys(a).length){const t=new TypeError("Argument to 'typed' at index "+e+" is not a (typed) function, nor an object with signatures as keys and functions as values.");throw t.data={index:e,argument:i},t}t||(r=ke(r,o)),je(n,a)}return fe(r||"",n)},d.create=i,d.createCount=He.createCount,d.onMismatch=ge,d.throwMismatchError=ge,d.createError=te,d.clear=m,d.clearConversions=f,d.addTypes=p,d._findType=h,d.referTo=we,d.referToSelf=Pe,d.convert=_,d.findSignature=b,d.find=v,d.isTypedFunction=y,d.warnAgainstDeprecatedThis=!0,d.addType=function(e,t){let r="any";!1!==t&&l.has("Object")&&(r="Object"),d.addTypes([e],r)},d.addConversion=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{override:!1};ze(e);const r=h(e.to),n=r.conversionsTo.find((t=>t.from===e.from));if(n){if(!t||!t.override)throw new Error('There is already a conversion from "'+e.from+'" to "'+r.name+'"');d.removeConversion({from:n.from,to:e.to,convert:n.convert})}r.conversionsTo.push({from:e.from,convert:e.convert,index:u++})},d.addConversions=function(e,t){e.forEach((e=>d.addConversion(e,t)))},d.removeConversion=function(e){ze(e);const t=h(e.to),r=_e(t.conversionsTo,(t=>t.from===e.from));if(!r)throw new Error("Attempt to remove nonexistent conversion from "+e.from+" to "+e.to);if(r.convert!==e.convert)throw new Error("Conversion to remove does not match existing conversion");const n=t.conversionsTo.indexOf(r);t.conversionsTo.splice(n,1)},d.resolve=function(e,t){if(!y(e))throw new TypeError(n);const r=e._typedFunctionData.signatures;for(let e=0;e<r.length;++e)if(r[e].test(t))return r[e];return null},d}return i()}()},84360:(e,t,r)=>{e.exports=r(6773)},13793:(e,t,r)=>{e.exports=r(21558).default},34109:(e,t,r)=>{e.exports=r(81970).default},81029:(e,t,r)=>{e.exports=r(21754).default},80685:(e,t,r)=>{e.exports=r(23362).default},48316:(e,t,r)=>{e.exports=r(70373).default},66443:(e,t,r)=>{e.exports=r(12704).default},91948:(e,t,r)=>{e.exports=r(10577).default},47109:(e,t,r)=>{e.exports=r(87126).default},68640:(e,t,r)=>{e.exports=r(50749).default},63510:(e,t,r)=>{e.exports=r(70468).default},50198:(e,t,r)=>{e.exports=r(17287).default},92639:(e,t,r)=>{e.exports=r(35124).default},54831:(e,t,r)=>{e.exports=r(18068).default},27325:(e,t,r)=>{e.exports=r(74842).default},97119:(e,t,r)=>{e.exports=r(12832).default},35783:(e,t,r)=>{e.exports=r(72564).default},73731:(e,t,r)=>{e.exports=r(66036).default},45707:(e,t,r)=>{e.exports=r(27744).default},38777:(e,t,r)=>{e.exports=r(43554).default},14727:(e,t,r)=>{e.exports=r(5020).default},75020:(e,t,r)=>{e.exports=r(65477).default},99240:(e,t,r)=>{e.exports=r(35801).default},73354:(e,t,r)=>{e.exports=r(88431).default},99721:(e,t,r)=>{e.exports=r(51813).default},77548:(e,t,r)=>{e.exports=r(87693).default},56148:(e,t,r)=>{e.exports=r(89677).default},57711:(e,t,r)=>{e.exports=r(94776).default},71058:(e,t,r)=>{e.exports=r(44751).default},26858:(e,t,r)=>{e.exports=r(71251)},82726:(e,t,r)=>{e.exports=r(31067).default},74734:(e,t,r)=>{e.exports=r(74675).default},45518:(e,t,r)=>{e.exports=r(76967).default},68597:(e,t,r)=>{e.exports=r(9278).default},20767:(e,t,r)=>{e.exports=r(81772).default},98718:(e,t,r)=>{e.exports=r(21915).default},76141:(e,t,r)=>{e.exports=r(86910).default},46617:(e,t,r)=>{e.exports=r(73926).default},87496:(e,t,r)=>{e.exports=r(67889).default},86608:(e,t,r)=>{e.exports=r(23305).default},35081:(e,t,r)=>{e.exports=r(21702).default},7938:(e,t,r)=>{e.exports=r(17467).default},53466:(e,t,r)=>{e.exports=r(11235).default},61546:(e,t,r)=>{e.exports=r(32583).default},6031:(e,t,r)=>{e.exports=r(29235).default},3764:(e,t,r)=>{e.exports=r(48385).default},92534:(e,t,r)=>{e.exports=r(40799).default},56784:(e,t,r)=>{e.exports=r(5585).default},11263:(e,t,r)=>{e.exports=r(64556).default},59807:(e,t,r)=>{e.exports=r(80580).default},89653:(e,t,r)=>{e.exports=r(49502).default},21724:(e,t,r)=>{e.exports=r(8229).default},19505:(e,t,r)=>{e.exports=r(59555).default},48676:(e,t,r)=>{e.exports=r(63481).default},77e3:(e,t,r)=>{e.exports=r(97345).default},72546:(e,t,r)=>{e.exports=r(76110).default},15839:(e,t,r)=>{e.exports=r(56252).default},6054:(e,t,r)=>{e.exports=r(58823).default},30368:(e,t,r)=>{e.exports=r(79549).default},31590:(e,t,r)=>{e.exports=r(3539).default},30175:(e,t,r)=>{e.exports=r(96316).default},15451:(e,t,r)=>{e.exports=r(38344).default},95984:(e,t,r)=>{e.exports=r(35989).default},43478:(e,t,r)=>{e.exports=r(64655).default},36780:(e,t,r)=>{e.exports=r(83497).default},17798:(e,t,r)=>{e.exports=r(25619).default},57701:(e,t,r)=>{e.exports=r(45718).default},78922:(e,t,r)=>{e.exports=r(93743).default},25683:(e,t,r)=>{e.exports=r(6120).default},34214:(e,t,r)=>{e.exports=r(72427).default},6282:(e,t,r)=>{e.exports=r(31199).default},97080:(e,t,r)=>{e.exports=r(18225).default},28793:(e,t,r)=>{e.exports=r(63902).default},53541:(e,t,r)=>{e.exports=r(8398)},58610:(e,t,r)=>{e.exports=r(2563).default},58151:(e,t,r)=>{e.exports=r(43468).default},32875:(e,t,r)=>{e.exports=r(61396).default},52411:(e,t,r)=>{e.exports=r(89868).default},31755:(e,t,r)=>{e.exports=r(42820).default},95975:(e,t,r)=>{e.exports=r(95716).default},77560:(e,t,r)=>{e.exports=r(80993).default},64268:(e,t,r)=>{e.exports=r(98745).default},16802:(e,t,r)=>{e.exports=r(14687).default},72351:(e,t,r)=>{e.exports=r(28440).default},35027:(e,t,r)=>{e.exports=r(73400).default},53948:(e,t,r)=>{e.exports=r(36122).default},73413:(e,t,r)=>{e.exports=r(71090).default},5115:(e,t,r)=>{e.exports=r(62204).default},52234:(e,t,r)=>{e.exports=r(40611).default},65808:(e,t,r)=>{e.exports=r(31889).default},56707:(e,t,r)=>{e.exports=r(19140).default},80568:(e,t,r)=>{e.exports=r(56913).default},32125:(e,t,r)=>{e.exports=r(1494).default},28992:(e,t,r)=>{e.exports=r(74589).default},12380:(e,t,r)=>{e.exports=r(43269).default},68013:(e,t,r)=>{e.exports=r(72818).default},84590:(e,t,r)=>{e.exports=r(92403).default},34856:(e,t,r)=>{e.exports=r(66393).default},53735:(e,t,r)=>{e.exports=r(48196).default},53981:(e,t,r)=>{e.exports=r(40022).default},85880:(e,t,r)=>{e.exports=r(52597).default},7653:(e,t,r)=>{e.exports=r(67166).default},25381:(e,t,r)=>{e.exports=r(1314).default},82128:(e,t,r)=>{e.exports=r(65737).default},15493:(e,t,r)=>{e.exports=r(60562).default},53012:(e,t,r)=>{e.exports=r(16137).default},14066:(e,t,r)=>{e.exports=r(94239).default},3356:(e,t,r)=>{e.exports=r(23885).default},34303:(e,t,r)=>{e.exports=r(44224).default},61926:(e,t,r)=>{e.exports=r(77503).default},88241:(e,t,r)=>{e.exports=r(79482).default},57344:(e,t,r)=>{e.exports=r(11737).default},2163:(e,t,r)=>{e.exports=r(40124).default},27377:(e,t,r)=>{e.exports=r(47468).default},68076:(e,t,r)=>{e.exports=r(22481).default},78864:(e,t,r)=>{e.exports=r(56553).default},8397:(e,t,r)=>{e.exports=r(88210).default},1270:(e,t,r)=>{e.exports=r(90131).default},64340:(e,t,r)=>{e.exports=r(59793).default},8083:(e,t,r)=>{e.exports=r(79728).default},78634:(e,t,r)=>{e.exports=r(20647).default},24512:(e,t,r)=>{e.exports=r(83681).default},19233:(e,t,r)=>{e.exports=r(36526).default},99479:(e,t,r)=>{e.exports=r(47540).default},33651:(e,t,r)=>{e.exports=r(24024).default},16769:(e,t,r)=>{e.exports=r(80438).default},74070:(e,t,r)=>{e.exports=r(49183).default},82823:(e,t,r)=>{e.exports=r(9304).default},13868:(e,t,r)=>{e.exports=r(29465).default},78904:(e,t,r)=>{e.exports=r(10041).default},85666:(e,t,r)=>{e.exports=r(21483).default},93791:(e,t,r)=>{e.exports=r(19028).default},34668:(e,t,r)=>{e.exports=r(85457).default},5544:(e,t,r)=>{e.exports=r(75421).default},13262:(e,t,r)=>{e.exports=r(46095).default},46710:(e,t,r)=>{e.exports=r(11887).default},54748:(e,t,r)=>{e.exports=r(74089).default},79071:(e,t,r)=>{e.exports=r(39344).default},32787:(e,t,r)=>{e.exports=r(9852).default},10409:(e,t,r)=>{e.exports=r(72094).default},88435:(e,t,r)=>{e.exports=r(52032).default},43950:(e,t,r)=>{e.exports=r(80387).default},14881:(e,t,r)=>{e.exports=r(50602).default},42122:(e,t,r)=>{e.exports=r(23855).default},94341:(e,t,r)=>{e.exports=r(78210).default},37974:(e,t,r)=>{e.exports=r(26279).default},5942:(e,t,r)=>{e.exports=r(14995).default},25332:(e,t,r)=>{e.exports=r(16850).default},12322:(e,t,r)=>{e.exports=r(22479).default},42901:(e,t,r)=>{e.exports=r(24653).default},60651:(e,t,r)=>{e.exports=r(37588).default},29635:(e,t,r)=>{e.exports=r(67204).default},61329:(e,t,r)=>{e.exports=r(8362).default},33322:(e,t,r)=>{e.exports=r(73155).default},21728:(e,t,r)=>{e.exports=r(2157).default},10753:(e,t,r)=>{e.exports=r(68414).default},90179:(e,t,r)=>{e.exports=r(41959).default},93794:(e,t,r)=>{e.exports=r(32867).default},59311:(e,t,r)=>{e.exports=r(87456).default},30409:(e,t,r)=>{e.exports=r(19302).default},28344:(e,t,r)=>{e.exports=r(10917).default},80853:(e,t,r)=>{e.exports=r(93126).default},57160:(e,t,r)=>{e.exports=r(14589).default},91860:(e,t,r)=>{e.exports=r(32049).default},90510:(e,t,r)=>{e.exports=r(60627).default},44892:(e,t,r)=>{e.exports=r(10789).default},48395:(e,t,r)=>{e.exports=r(90772).default},83894:(e,t,r)=>{e.exports=r(54639).default},2233:(e,t,r)=>{e.exports=r(17186).default},612:(e,t,r)=>{e.exports=r(94381).default},80205:(e,t,r)=>{e.exports=r(74598).default},98278:(e,t,r)=>{e.exports=r(95099).default},60584:(e,t,r)=>{e.exports=r(93829).default},90394:(e,t,r)=>{e.exports=r(56939).default},63357:(e,t,r)=>{e.exports=r(10330).default},52117:(e,t,r)=>{e.exports=r(22582).default},26643:(e,t,r)=>{e.exports=r(80936).default},29708:(e,t,r)=>{e.exports=r(48713).default},17062:(e,t,r)=>{e.exports=r(21315).default},5237:(e,t,r)=>{e.exports=r(63886).default},92516:(e,t,r)=>{e.exports=r(20505).default},59194:(e,t,r)=>{e.exports=r(98007).default},90998:(e,t,r)=>{e.exports=r(70475).default},7464:(e,t,r)=>{e.exports=r(94617).default},1967:(e,t,r)=>{e.exports=r(77628).default},38431:(e,t,r)=>{e.exports=r(5824).default},41557:(e,t,r)=>{e.exports=r(24574).default},78853:(e,t,r)=>{e.exports=r(59958).default},36138:(e,t,r)=>{e.exports=r(75035).default},88035:(e,t,r)=>{e.exports=r(69125).default},57191:(e,t,r)=>{e.exports=r(69096).default},93918:(e,t,r)=>{e.exports=r(76755).default},58698:(e,t,r)=>{e.exports=r(68759).default},5498:(e,t,r)=>{e.exports=r(90963).default},88543:(e,t,r)=>{e.exports=r(51272).default},44182:(e,t,r)=>{e.exports=r(57411).default},23029:(e,t,r)=>{e.exports=r(23686).default},72242:(e,t,r)=>{e.exports=r(88155).default},14532:(e,t,r)=>{e.exports=r(35837).default},96:(e,t,r)=>{e.exports=r(32789).default},30226:(e,t,r)=>{e.exports=r(30555).default},26815:(e,t,r)=>{e.exports=r(76184).default},6609:(e,t,r)=>{e.exports=r(28718).default},8929:(e,t,r)=>{e.exports=r(9354).default},31934:(e,t,r)=>{e.exports=r(24443).default},29945:(e,t,r)=>{e.exports=r(30818).default},40544:(e,t,r)=>{e.exports=r(41185).default},75717:(e,t,r)=>{e.exports=r(59106).default},19510:(e,t,r)=>{e.exports=r(48515).default},65870:(e,t,r)=>{e.exports=r(19827).default},87441:(e,t,r)=>{e.exports=r(64854).default},6998:(e,t,r)=>{e.exports=r(3963).default},52093:(e,t,r)=>{e.exports=r(58218).default},27854:(e,t,r)=>{e.exports=r(28639).default},8008:(e,t,r)=>{let n;e.exports={loadHotkeysLibrary:function(){return n??=(e=r(58013)).default||e;var e}}},34973:(e,t,r)=>{e.exports=r(96037).default},95429:(e,t,r)=>{e.exports=r(42826)},84540:(e,t,r)=>{e.exports=r(18477).default},17943:(e,t,r)=>{e.exports=r(10680).default},83388:(e,t,r)=>{e.exports=r(26713)},44417:(e,t,r)=>{e.exports=r(37230)},72:(e,t,r)=>{e.exports=r(30045).default},70490:(e,t,r)=>{e.exports=r(55327).default},96146:(e,t,r)=>{e.exports=r(31255).default},48351:(e,t,r)=>{e.exports=r(32640).default},4693:(e,t,r)=>{e.exports=r(30858).default},46407:(e,t,r)=>{e.exports=r(39288).default},5734:(e,t,r)=>{e.exports=r(69855).default},71162:(e,t,r)=>{e.exports=r(95203).default},551:(e,t,r)=>{e.exports=r(40436).default},49701:(e,t,r)=>{e.exports=r(98326).default},54124:(e,t,r)=>{e.exports=r(90749).default},87171:(e,t,r)=>{e.exports=r(81976).default},37498:(e,t,r)=>{e.exports=r(14935).default},63153:(e,t,r)=>{e.exports=r(13482).default},79274:(e,t,r)=>{e.exports=r(26563).default},16052:(e,t,r)=>{e.exports=r(11541).default},76472:(e,t,r)=>{e.exports=r(52353).default},1541:(e,t,r)=>{e.exports=r(62218).default},59455:(e,t,r)=>{e.exports=r(42932).default},54207:(e,t,r)=>{e.exports=r(97856).default},35545:(e,t,r)=>{e.exports=r(61210).default},73827:(e,t,r)=>{e.exports=r(15904).default},12003:(e,t,r)=>{e.exports=r(66904).default},68232:(e,t,r)=>{e.exports=r(33381).default},67653:(e,t,r)=>{e.exports=r(86714).default},66836:(e,t,r)=>{e.exports=r(30685).default},2856:(e,t,r)=>{e.exports=r(49029).default},18347:(e,t,r)=>{e.exports=r(70088).default},40387:(e,t,r)=>{e.exports=r(9348).default},68118:(e,t,r)=>{e.exports=r(79595).default},39420:(e,t,r)=>{e.exports=r(74997).default},24873:(e,t,r)=>{e.exports=r(18350).default},12522:(e,t,r)=>{e.exports=r(86819).default},43034:(e,t,r)=>{e.exports=r(47199).default},18905:(e,t,r)=>{e.exports=r(36990).default},22075:(e,t,r)=>{e.exports=r(86e3).default},42533:(e,t,r)=>{e.exports=r(72830).default},44471:(e,t,r)=>{e.exports=r(63812).default},38283:(e,t,r)=>{e.exports=r(44425).default},27026:(e,t,r)=>{e.exports=r(22711).default},23281:(e,t,r)=>{e.exports=r(4674).default},93413:(e,t,r)=>{e.exports=r(68662).default},64917:(e,t,r)=>{e.exports=r(20786).default},77185:(e,t,r)=>{e.exports=r(85678).default},63918:(e,t,r)=>{e.exports=r(2479).default},4664:(e,t,r)=>{e.exports=r(36869).default},50143:(e,t,r)=>{e.exports=r(72284).default},44674:(e,t,r)=>{e.exports=r(63059).default},10240:(e,t,r)=>{e.exports=r(27281).default},38720:(e,t,r)=>{e.exports=r(59257).default},58824:(e,t,r)=>{e.exports=r(14153).default},65958:(e,t,r)=>{e.exports=r(72971).default},25874:(e,t,r)=>{e.exports=r(10715).default},52703:(e,t,r)=>{e.exports=r(80168).default},7295:(e,t,r)=>{e.exports=r(66800).default},56692:(e,t,r)=>{e.exports=r(42337).default},96005:(e,t,r)=>{e.exports=r(3058).default},59608:(e,t,r)=>{e.exports=r(25373).default},13462:(e,t,r)=>{e.exports=r(85771)},67591:(e,t,r)=>{e.exports=r(11148)},29530:(e,t,r)=>{e.exports=r(28459)},1517:(e,t,r)=>{e.exports=r(40110)},33541:(e,t,r)=>{e.exports=r(23410).default},53639:(e,t,r)=>{e.exports=r(10940).default},57949:(e,t,r)=>{e.exports=r(46982)},95034:(e,t,r)=>{e.exports=r(23399).default},84251:(e,t,r)=>{e.exports=r(51616).default},26651:(e,t,r)=>{e.exports=r(73216).default},30771:(e,t,r)=>{e.exports=r(8824).default},32007:(e,t,r)=>{e.exports=r(4948).default},63857:(e,t,r)=>{e.exports=r(20366).default},93561:(e,t,r)=>{e.exports=r(14418).default},172:(e,t,r)=>{e.exports=r(13741).default},6209:(e,t,r)=>{e.exports=r(32650).default},97606:(e,t,r)=>{e.exports=r(25107).default},52537:(e,t,r)=>{e.exports=r(43510).default},53768:(e,t,r)=>{e.exports=r(1605).default},97943:(e,t,r)=>{"use strict";var n=r(9055),i=Uint8Array,s=Uint16Array,o=Uint32Array,a=new i([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),l=new i([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),c=new i([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),u=function(e,t){for(var r=new s(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var i=new o(r[30]);for(n=1;n<30;++n)for(var a=r[n];a<r[n+1];++a)i[a]=a-r[n]<<5|n;return[r,i]},d=u(a,2),h=d[0],p=d[1];h[28]=258,p[258]=28;for(var m=u(l,0),f=m[0],g=m[1],y=new s(32768),b=0;b<32768;++b){var v=(43690&b)>>>1|(21845&b)<<1;v=(61680&(v=(52428&v)>>>2|(13107&v)<<2))>>>4|(3855&v)<<4,y[b]=((65280&v)>>>8|(255&v)<<8)>>>1}var _=function(e,t,r){for(var n=e.length,i=0,o=new s(t);i<n;++i)e[i]&&++o[e[i]-1];var a,l=new s(t);for(i=0;i<t;++i)l[i]=l[i-1]+o[i-1]<<1;if(r){a=new s(1<<t);var c=15-t;for(i=0;i<n;++i)if(e[i])for(var u=i<<4|e[i],d=t-e[i],h=l[e[i]-1]++<<d,p=h|(1<<d)-1;h<=p;++h)a[y[h]>>>c]=u}else for(a=new s(n),i=0;i<n;++i)e[i]&&(a[i]=y[l[e[i]-1]++]>>>15-e[i]);return a},x=new i(288);for(b=0;b<144;++b)x[b]=8;for(b=144;b<256;++b)x[b]=9;for(b=256;b<280;++b)x[b]=7;for(b=280;b<288;++b)x[b]=8;var w=new i(32);for(b=0;b<32;++b)w[b]=5;var R=_(x,9,0),k=_(x,9,1),j=_(w,5,0),z=_(w,5,1),q=function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},$=function(e,t,r){var n=t/8|0;return(e[n]|e[n+1]<<8)>>(7&t)&r},Z=function(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(7&t)},X=function(e){return(e+7)/8|0},Y=function(e,t,r){(null==t||t<0)&&(t=0),(null==r||r>e.length)&&(r=e.length);var n=new(2==e.BYTES_PER_ELEMENT?s:4==e.BYTES_PER_ELEMENT?o:i)(r-t);return n.set(e.subarray(t,r)),n};t.FlateErrorCode={UnexpectedEOF:0,InvalidBlockType:1,InvalidLengthLiteral:2,InvalidDistance:3,StreamFinished:4,NoStreamHandler:5,InvalidHeader:6,NoCallback:7,InvalidUTF8:8,ExtraFieldTooLong:9,InvalidDate:10,FilenameTooLong:11,StreamFinishing:12,InvalidZipData:13,UnknownCompressionMethod:14};var ee=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],te=function(e,t,r){var n=new Error(t||ee[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,te),!r)throw n;return n},re=function(e,t,r){var n=e.length;if(!n||r&&r.f&&!r.l)return t||new i(0);var s=!t||r,o=!r||r.i;r||(r={}),t||(t=new i(3*n));var u=function(e){var r=t.length;if(e>r){var n=new i(Math.max(2*r,e));n.set(t),t=n}},d=r.f||0,p=r.p||0,m=r.b||0,g=r.l,y=r.d,b=r.m,v=r.n,x=8*n;do{if(!g){d=$(e,p,1);var w=$(e,p+1,3);if(p+=3,!w){var R=e[(ue=X(p)+4)-4]|e[ue-3]<<8,j=ue+R;if(j>n){o&&te(0);break}s&&u(m+R),t.set(e.subarray(ue,j),m),r.b=m+=R,r.p=p=8*j,r.f=d;continue}if(1==w)g=k,y=z,b=9,v=5;else if(2==w){var ee=$(e,p,31)+257,re=$(e,p+10,15)+4,ne=ee+$(e,p+5,31)+1;p+=14;for(var ie=new i(ne),se=new i(19),oe=0;oe<re;++oe)se[c[oe]]=$(e,p+3*oe,7);p+=3*re;var ae=q(se),le=(1<<ae)-1,ce=_(se,ae,1);for(oe=0;oe<ne;){var ue,de=ce[$(e,p,le)];if(p+=15&de,(ue=de>>>4)<16)ie[oe++]=ue;else{var he=0,pe=0;for(16==ue?(pe=3+$(e,p,3),p+=2,he=ie[oe-1]):17==ue?(pe=3+$(e,p,7),p+=3):18==ue&&(pe=11+$(e,p,127),p+=7);pe--;)ie[oe++]=he}}var me=ie.subarray(0,ee),fe=ie.subarray(ee);b=q(me),v=q(fe),g=_(me,b,1),y=_(fe,v,1)}else te(1);if(p>x){o&&te(0);break}}s&&u(m+131072);for(var ge=(1<<b)-1,ye=(1<<v)-1,be=p;;be=p){var ve=(he=g[Z(e,p)&ge])>>>4;if((p+=15&he)>x){o&&te(0);break}if(he||te(2),ve<256)t[m++]=ve;else{if(256==ve){be=p,g=null;break}var _e=ve-254;if(ve>264){var xe=a[oe=ve-257];_e=$(e,p,(1<<xe)-1)+h[oe],p+=xe}var we=y[Z(e,p)&ye],Se=we>>>4;we||te(3),p+=15&we;fe=f[Se];if(Se>3){xe=l[Se];fe+=Z(e,p)&(1<<xe)-1,p+=xe}if(p>x){o&&te(0);break}s&&u(m+131072);for(var Pe=m+_e;m<Pe;m+=4)t[m]=t[m-fe],t[m+1]=t[m+1-fe],t[m+2]=t[m+2-fe],t[m+3]=t[m+3-fe];m=Pe}}r.l=g,r.p=be,r.b=m,r.f=d,g&&(d=1,r.m=b,r.d=y,r.n=v)}while(!d);return m==t.length?t:Y(t,0,m)},ne=function(e,t,r){r<<=7&t;var n=t/8|0;e[n]|=r,e[n+1]|=r>>>8},ie=function(e,t,r){r<<=7&t;var n=t/8|0;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},se=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var o=r.length,a=r.slice();if(!o)return[he,0];if(1==o){var l=new i(r[0].s+1);return l[r[0].s]=1,[l,1]}r.sort((function(e,t){return e.f-t.f})),r.push({s:-1,f:25001});var c=r[0],u=r[1],d=0,h=1,p=2;for(r[0]={s:-1,f:c.f+u.f,l:c,r:u};h!=o-1;)c=r[r[d].f<r[p].f?d++:p++],u=r[d!=h&&r[d].f<r[p].f?d++:p++],r[h++]={s:-1,f:c.f+u.f,l:c,r:u};var m=a[0].s;for(n=1;n<o;++n)a[n].s>m&&(m=a[n].s);var f=new s(m+1),g=oe(r[h-1],f,0);if(g>t){n=0;var y=0,b=g-t,v=1<<b;for(a.sort((function(e,t){return f[t.s]-f[e.s]||e.f-t.f}));n<o;++n){var _=a[n].s;if(!(f[_]>t))break;y+=v-(1<<g-f[_]),f[_]=t}for(y>>>=b;y>0;){var x=a[n].s;f[x]<t?y-=1<<t-f[x]++-1:++n}for(;n>=0&&y;--n){var w=a[n].s;f[w]==t&&(--f[w],++y)}g=t}return[new i(f),g]},oe=function(e,t,r){return-1==e.s?Math.max(oe(e.l,t,r+1),oe(e.r,t,r+1)):t[e.s]=r},ae=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new s(++t),n=0,i=e[0],o=1,a=function(e){r[n++]=e},l=1;l<=t;++l)if(e[l]==i&&l!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)a(32754);o>2&&(a(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(a(i),--o;o>6;o-=6)a(8304);o>2&&(a(o-3<<5|8208),o=0)}for(;o--;)a(i);o=1,i=e[l]}return[r.subarray(0,n),t]},le=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},ce=function(e,t,r){var n=r.length,i=X(t+2);e[i]=255&n,e[i+1]=n>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var s=0;s<n;++s)e[i+s+4]=r[s];return 8*(i+4+n)},ue=function(e,t,r,n,i,o,u,d,h,p,m){ne(t,m++,r),++i[256];for(var f=se(i,15),g=f[0],y=f[1],b=se(o,15),v=b[0],k=b[1],z=ae(g),q=z[0],$=z[1],Z=ae(v),X=Z[0],Y=Z[1],ee=new s(19),te=0;te<q.length;++te)ee[31&q[te]]++;for(te=0;te<X.length;++te)ee[31&X[te]]++;for(var re=se(ee,7),oe=re[0],ue=re[1],de=19;de>4&&!oe[c[de-1]];--de);var he,pe,me,fe,ge=p+5<<3,ye=le(i,x)+le(o,w)+u,be=le(i,g)+le(o,v)+u+14+3*de+le(ee,oe)+(2*ee[16]+3*ee[17]+7*ee[18]);if(ge<=ye&&ge<=be)return ce(t,m,e.subarray(h,h+p));if(ne(t,m,1+(be<ye)),m+=2,be<ye){he=_(g,y,0),pe=g,me=_(v,k,0),fe=v;var ve=_(oe,ue,0);ne(t,m,$-257),ne(t,m+5,Y-1),ne(t,m+10,de-4),m+=14;for(te=0;te<de;++te)ne(t,m+3*te,oe[c[te]]);m+=3*de;for(var _e=[q,X],xe=0;xe<2;++xe){var we=_e[xe];for(te=0;te<we.length;++te){var Se=31&we[te];ne(t,m,ve[Se]),m+=oe[Se],Se>15&&(ne(t,m,we[te]>>>5&127),m+=we[te]>>>12)}}}else he=R,pe=x,me=j,fe=w;for(te=0;te<d;++te)if(n[te]>255){Se=n[te]>>>18&31;ie(t,m,he[Se+257]),m+=pe[Se+257],Se>7&&(ne(t,m,n[te]>>>23&31),m+=a[Se]);var Pe=31&n[te];ie(t,m,me[Pe]),m+=fe[Pe],Pe>3&&(ie(t,m,n[te]>>>5&8191),m+=l[Pe])}else ie(t,m,he[n[te]]),m+=pe[n[te]];return ie(t,m,he[256]),m+pe[256]},de=new o([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),he=new i(0),pe=function(e,t,r,n,c,u){var d=e.length,h=new i(n+d+5*(1+Math.ceil(d/7e3))+c),m=h.subarray(n,h.length-c),f=0;if(!t||d<8)for(var y=0;y<=d;y+=65535){var b=y+65535;b>=d&&(m[f>>3]=u),f=ce(m,f+1,e.subarray(y,b))}else{for(var v=de[t-1],_=v>>>13,x=8191&v,w=(1<<r)-1,R=new s(32768),k=new s(w+1),j=Math.ceil(r/3),z=2*j,q=function(t){return(e[t]^e[t+1]<<j^e[t+2]<<z)&w},$=new o(25e3),Z=new s(288),ee=new s(32),te=0,re=0,ne=(y=0,0),ie=0,se=0;y<d;++y){var oe=q(y),ae=32767&y,le=k[oe];if(R[ae]=le,k[oe]=ae,ie<=y){var pe=d-y;if((te>7e3||ne>24576)&&pe>423){f=ue(e,m,0,$,Z,ee,re,ne,se,y-se,f),ne=te=re=0,se=y;for(var me=0;me<286;++me)Z[me]=0;for(me=0;me<30;++me)ee[me]=0}var fe=2,ge=0,ye=x,be=ae-le&32767;if(pe>2&&oe==q(y-be))for(var ve=Math.min(_,pe)-1,_e=Math.min(32767,y),xe=Math.min(258,pe);be<=_e&&--ye&&ae!=le;){if(e[y+fe]==e[y+fe-be]){for(var we=0;we<xe&&e[y+we]==e[y+we-be];++we);if(we>fe){if(fe=we,ge=be,we>ve)break;var Se=Math.min(be,we-2),Pe=0;for(me=0;me<Se;++me){var Te=y-be+me+32768&32767,Re=Te-R[Te]+32768&32767;Re>Pe&&(Pe=Re,le=Te)}}}be+=(ae=le)-(le=R[ae])+32768&32767}if(ge){$[ne++]=268435456|p[fe]<<18|g[ge];var ke=31&p[fe],Ie=31&g[ge];re+=a[ke]+l[Ie],++Z[257+ke],++ee[Ie],ie=y+fe,++te}else $[ne++]=e[y],++Z[e[y]]}}f=ue(e,m,u,$,Z,ee,re,ne,se,y-se,f),!u&&7&f&&(f=ce(m,f+1,he))}return Y(h,0,n+X(f)+c)},me=function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var r=t,n=9;--n;)r=(1&r&&-306674912)^r>>>1;e[t]=r}return e}(),fe=function(){var e=-1;return{p:function(t){for(var r=e,n=0;n<t.length;++n)r=me[255&r^t[n]]^r>>>8;e=r},d:function(){return~e}}},ge=function(){var e=1,t=0;return{p:function(r){for(var n=e,i=t,s=0|r.length,o=0;o!=s;){for(var a=Math.min(o+2655,s);o<a;++o)i+=n+=r[o];n=(65535&n)+15*(n>>16),i=(65535&i)+15*(i>>16)}e=n,t=i},d:function(){return(255&(e%=65521))<<24|e>>>8<<16|(255&(t%=65521))<<8|t>>>8}}},ye=function(e,t,r,n,i){return pe(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,r,n,!i)},be=function(e,t){var r={};for(var n in e)r[n]=e[n];for(var n in t)r[n]=t[n];return r},ve=function(e,t,r){for(var n=e(),i=e.toString(),s=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),o=0;o<n.length;++o){var a=n[o],l=s[o];if("function"==typeof a){t+=";"+l+"=";var c=a.toString();if(a.prototype)if(-1!=c.indexOf("[native code]")){var u=c.indexOf(" ",8)+1;t+=c.slice(u,c.indexOf("(",u))}else for(var d in t+=c,a.prototype)t+=";"+l+".prototype."+d+"="+a.prototype[d].toString();else t+=c}else r[l]=a}return[t,r]},_e=[],xe=function(e,t,r,i){var s;if(!_e[r]){for(var o="",a={},l=e.length-1,c=0;c<l;++c)o=(s=ve(e[c],o,a))[0],a=s[1];_e[r]=ve(e[l],o,a)}var u=be({},_e[r][1]);return n.default(_e[r][0]+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+t.toString()+"}",r,u,function(e){var t=[];for(var r in e)e[r].buffer&&t.push((e[r]=new e[r].constructor(e[r])).buffer);return t}(u),i)},we=function(){return[i,s,o,a,l,c,h,f,k,z,y,ee,_,q,$,Z,X,Y,te,re,ut,Ie,je]},Se=function(){return[i,s,o,a,l,c,p,g,R,x,j,w,y,de,he,_,ne,ie,se,oe,ae,le,ce,ue,X,Y,pe,ye,ot,Ie]},Pe=function(){return[Xe,et,$e,fe,me]},Te=function(){return[Ye,Qe]},Re=function(){return[tt,$e,ge]},ke=function(){return[rt]},Ie=function(e){return postMessage(e,[e.buffer])},je=function(e){return e&&e.size&&new i(e.size)},He=function(e,t,r,n,i,s){var o=xe(r,n,i,(function(e,t){o.terminate(),s(e,t)}));return o.postMessage([e,t],t.consume?[e.buffer]:[]),function(){o.terminate()}},ze=function(e){return e.ondata=function(e,t){return postMessage([e,t],[e.buffer])},function(t){return e.push(t.data[0],t.data[1])}},Ge=function(e,t,r,n,i){var s,o=xe(e,n,i,(function(e,r){e?(o.terminate(),t.ondata.call(t,e)):(r[1]&&o.terminate(),t.ondata.call(t,e,r[0],r[1]))}));o.postMessage(r),t.push=function(e,r){t.ondata||te(5),s&&t.ondata(te(4,0,1),null,!!r),o.postMessage([e,s=r],[e.buffer])},t.terminate=function(){o.terminate()}},We=function(e,t){return e[t]|e[t+1]<<8},Ve=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},qe=function(e,t){return Ve(e,t)+4294967296*Ve(e,t+4)},$e=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},Xe=function(e,t){var r=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&$e(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var n=0;n<=r.length;++n)e[n+10]=r.charCodeAt(n)}},Ye=function(e){31==e[0]&&139==e[1]&&8==e[2]||te(6,"invalid gzip data");var t=e[3],r=10;4&t&&(r+=e[10]|2+(e[11]<<8));for(var n=(t>>3&1)+(t>>4&1);n>0;n-=!e[r++]);return r+(2&t)},Qe=function(e){var t=e.length;return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0},et=function(e){return 10+(e.filename&&e.filename.length+1||0)},tt=function(e,t){var r=t.level,n=0==r?0:r<6?1:9==r?3:2;e[0]=120,e[1]=n<<6|(n?32-2*n:1)},rt=function(e){(8!=(15&e[0])||e[0]>>>4>7||(e[0]<<8|e[1])%31)&&te(6,"invalid zlib data"),32&e[1]&&te(6,"invalid zlib data: preset dictionaries not supported")};function AsyncCmpStrm(e,t){return t||"function"!=typeof e||(t=e,e={}),this.ondata=t,e}var nt=function(){function Deflate2(e,t){t||"function"!=typeof e||(t=e,e={}),this.ondata=t,this.o=e||{}}return Deflate2.prototype.p=function(e,t){this.ondata(ye(e,this.o,0,0,!t),t)},Deflate2.prototype.push=function(e,t){this.ondata||te(5),this.d&&te(4),this.d=t,this.p(e,t||!1)},Deflate2}();t.Deflate=nt;var it=function(){return function(e,t){Ge([Se,function(){return[ze,nt]}],this,AsyncCmpStrm.call(this,e,t),(function(e){var t=new nt(e.data);onmessage=ze(t)}),6)}}();function st(e,t,r){return r||(r=t,t={}),"function"!=typeof r&&te(7),He(e,t,[Se],(function(e){return Ie(ot(e.data[0],e.data[1]))}),0,r)}function ot(e,t){return ye(e,t||{},0,0)}t.AsyncDeflate=it,t.deflate=st,t.deflateSync=ot;var at=function(){function Inflate2(e){this.s={},this.p=new i(0),this.ondata=e}return Inflate2.prototype.e=function(e){this.ondata||te(5),this.d&&te(4);var t=this.p.length,r=new i(t+e.length);r.set(this.p),r.set(e,t),this.p=r},Inflate2.prototype.c=function(e){this.d=this.s.i=e||!1;var t=this.s.b,r=re(this.p,this.o,this.s);this.ondata(Y(r,t,this.s.b),this.d),this.o=Y(r,this.s.b-32768),this.s.b=this.o.length,this.p=Y(this.p,this.s.p/8|0),this.s.p&=7},Inflate2.prototype.push=function(e,t){this.e(e),this.c(t)},Inflate2}();t.Inflate=at;var lt=function(){return function(e){this.ondata=e,Ge([we,function(){return[ze,at]}],this,0,(function(){var e=new at;onmessage=ze(e)}),7)}}();function ct(e,t,r){return r||(r=t,t={}),"function"!=typeof r&&te(7),He(e,t,[we],(function(e){return Ie(ut(e.data[0],je(e.data[1])))}),1,r)}function ut(e,t){return re(e,t)}t.AsyncInflate=lt,t.inflate=ct,t.inflateSync=ut;var dt=function(){function Gzip2(e,t){this.c=fe(),this.l=0,this.v=1,nt.call(this,e,t)}return Gzip2.prototype.push=function(e,t){nt.prototype.push.call(this,e,t)},Gzip2.prototype.p=function(e,t){this.c.p(e),this.l+=e.length;var r=ye(e,this.o,this.v&&et(this.o),t&&8,!t);this.v&&(Xe(r,this.o),this.v=0),t&&($e(r,r.length-8,this.c.d()),$e(r,r.length-4,this.l)),this.ondata(r,t)},Gzip2}();t.Gzip=dt,t.Compress=dt;var ht=function(){return function(e,t){Ge([Se,Pe,function(){return[ze,nt,dt]}],this,AsyncCmpStrm.call(this,e,t),(function(e){var t=new dt(e.data);onmessage=ze(t)}),8)}}();function pt(e,t,r){return r||(r=t,t={}),"function"!=typeof r&&te(7),He(e,t,[Se,Pe,function(){return[mt]}],(function(e){return Ie(mt(e.data[0],e.data[1]))}),2,r)}function mt(e,t){t||(t={});var r=fe(),n=e.length;r.p(e);var i=ye(e,t,et(t),8),s=i.length;return Xe(i,t),$e(i,s-8,r.d()),$e(i,s-4,n),i}t.AsyncGzip=ht,t.AsyncCompress=ht,t.gzip=pt,t.compress=pt,t.gzipSync=mt,t.compressSync=mt;var ft=function(){function Gunzip2(e){this.v=1,at.call(this,e)}return Gunzip2.prototype.push=function(e,t){if(at.prototype.e.call(this,e),this.v){var r=this.p.length>3?Ye(this.p):4;if(r>=this.p.length&&!t)return;this.p=this.p.subarray(r),this.v=0}t&&(this.p.length<8&&te(6,"invalid gzip data"),this.p=this.p.subarray(0,-8)),at.prototype.c.call(this,t)},Gunzip2}();t.Gunzip=ft;var gt=function(){return function(e){this.ondata=e,Ge([we,Te,function(){return[ze,at,ft]}],this,0,(function(){var e=new ft;onmessage=ze(e)}),9)}}();function yt(e,t,r){return r||(r=t,t={}),"function"!=typeof r&&te(7),He(e,t,[we,Te,function(){return[bt]}],(function(e){return Ie(bt(e.data[0]))}),3,r)}function bt(e,t){return re(e.subarray(Ye(e),-8),t||new i(Qe(e)))}t.AsyncGunzip=gt,t.gunzip=yt,t.gunzipSync=bt;var vt=function(){function Zlib2(e,t){this.c=ge(),this.v=1,nt.call(this,e,t)}return Zlib2.prototype.push=function(e,t){nt.prototype.push.call(this,e,t)},Zlib2.prototype.p=function(e,t){this.c.p(e);var r=ye(e,this.o,this.v&&2,t&&4,!t);this.v&&(tt(r,this.o),this.v=0),t&&$e(r,r.length-4,this.c.d()),this.ondata(r,t)},Zlib2}();t.Zlib=vt;var _t=function(){return function(e,t){Ge([Se,Re,function(){return[ze,nt,vt]}],this,AsyncCmpStrm.call(this,e,t),(function(e){var t=new vt(e.data);onmessage=ze(t)}),10)}}();function xt(e,t){t||(t={});var r=ge();r.p(e);var n=ye(e,t,2,4);return tt(n,t),$e(n,n.length-4,r.d()),n}t.AsyncZlib=_t,t.zlib=function(e,t,r){return r||(r=t,t={}),"function"!=typeof r&&te(7),He(e,t,[Se,Re,function(){return[xt]}],(function(e){return Ie(xt(e.data[0],e.data[1]))}),4,r)},t.zlibSync=xt;var wt=function(){function Unzlib2(e){this.v=1,at.call(this,e)}return Unzlib2.prototype.push=function(e,t){if(at.prototype.e.call(this,e),this.v){if(this.p.length<2&&!t)return;this.p=this.p.subarray(2),this.v=0}t&&(this.p.length<4&&te(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),at.prototype.c.call(this,t)},Unzlib2}();t.Unzlib=wt;var St=function(){return function(e){this.ondata=e,Ge([we,ke,function(){return[ze,at,wt]}],this,0,(function(){var e=new wt;onmessage=ze(e)}),11)}}();function Pt(e,t,r){return r||(r=t,t={}),"function"!=typeof r&&te(7),He(e,t,[we,ke,function(){return[Et]}],(function(e){return Ie(Et(e.data[0],je(e.data[1])))}),5,r)}function Et(e,t){return re((rt(e),e.subarray(2,-4)),t)}t.AsyncUnzlib=St,t.unzlib=Pt,t.unzlibSync=Et;var Mt=function(){function Decompress2(e){this.G=ft,this.I=at,this.Z=wt,this.ondata=e}return Decompress2.prototype.push=function(e,t){if(this.ondata||te(5),this.s)this.s.push(e,t);else{if(this.p&&this.p.length){var r=new i(this.p.length+e.length);r.set(this.p),r.set(e,this.p.length)}else this.p=e;if(this.p.length>2){var n=this,s=function(){n.ondata.apply(n,arguments)};this.s=31==this.p[0]&&139==this.p[1]&&8==this.p[2]?new this.G(s):8!=(15&this.p[0])||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(s):new this.Z(s),this.s.push(this.p,t),this.p=null}}},Decompress2}();t.Decompress=Mt;var Ct=function(){function AsyncDecompress2(e){this.G=gt,this.I=lt,this.Z=St,this.ondata=e}return AsyncDecompress2.prototype.push=function(e,t){Mt.prototype.push.call(this,e,t)},AsyncDecompress2}();t.AsyncDecompress=Ct,t.decompress=function(e,t,r){return r||(r=t,t={}),"function"!=typeof r&&te(7),31==e[0]&&139==e[1]&&8==e[2]?yt(e,t,r):8!=(15&e[0])||e[0]>>4>7||(e[0]<<8|e[1])%31?ct(e,t,r):Pt(e,t,r)},t.decompressSync=function(e,t){return 31==e[0]&&139==e[1]&&8==e[2]?bt(e,t):8!=(15&e[0])||e[0]>>4>7||(e[0]<<8|e[1])%31?ut(e,t):Et(e,t)};var At=function(e,t,r,n){for(var s in e){var o=e[s],a=t+s,l=n;Array.isArray(o)&&(l=be(n,o[1]),o=o[0]),o instanceof i?r[a]=[o,l]:(r[a+="/"]=[new i(0),l],At(o,a,r,n))}},Tt="undefined"!=typeof TextEncoder&&new TextEncoder,Dt="undefined"!=typeof TextDecoder&&new TextDecoder,Ot=0;try{Dt.decode(he,{stream:!0}),Ot=1}catch(e){}var Rt=function(e){for(var t="",r=0;;){var n=e[r++],i=(n>127)+(n>223)+(n>239);if(r+i>e.length)return[t,Y(e,r-1)];i?3==i?(n=((15&n)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++])-65536,t+=String.fromCharCode(55296|n>>10,56320|1023&n)):t+=1&i?String.fromCharCode((31&n)<<6|63&e[r++]):String.fromCharCode((15&n)<<12|(63&e[r++])<<6|63&e[r++]):t+=String.fromCharCode(n)}},Lt=function(){function DecodeUTF82(e){this.ondata=e,Ot?this.t=new TextDecoder:this.p=he}return DecodeUTF82.prototype.push=function(e,t){if(this.ondata||te(5),t=!!t,this.t)return this.ondata(this.t.decode(e,{stream:!0}),t),void(t&&(this.t.decode().length&&te(8),this.t=null));this.p||te(4);var r=new i(this.p.length+e.length);r.set(this.p),r.set(e,this.p.length);var n=Rt(r),s=n[0],o=n[1];t?(o.length&&te(8),this.p=null):this.p=o,this.ondata(s,t)},DecodeUTF82}();t.DecodeUTF8=Lt;var kt=function(){function EncodeUTF82(e){this.ondata=e}return EncodeUTF82.prototype.push=function(e,t){this.ondata||te(5),this.d&&te(4),this.ondata(Nt(e),this.d=t||!1)},EncodeUTF82}();function Nt(e,t){if(t){for(var r=new i(e.length),n=0;n<e.length;++n)r[n]=e.charCodeAt(n);return r}if(Tt)return Tt.encode(e);var s=e.length,o=new i(e.length+(e.length>>1)),a=0,l=function(e){o[a++]=e};for(n=0;n<s;++n){if(a+5>o.length){var c=new i(a+8+(s-n<<1));c.set(o),o=c}var u=e.charCodeAt(n);u<128||t?l(u):u<2048?(l(192|u>>6),l(128|63&u)):u>55295&&u<57344?(l(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++n))>>18),l(128|u>>12&63),l(128|u>>6&63),l(128|63&u)):(l(224|u>>12),l(128|u>>6&63),l(128|63&u))}return Y(o,0,a)}function Ft(e,t){if(t){for(var r="",n=0;n<e.length;n+=16384)r+=String.fromCharCode.apply(null,e.subarray(n,n+16384));return r}if(Dt)return Dt.decode(e);var i=Rt(e),s=i[0];return i[1].length&&te(8),s}t.EncodeUTF8=kt,t.strToU8=Nt,t.strFromU8=Ft;var It=function(e){return 1==e?3:e<6?2:9==e?1:0},Bt=function(e,t){return t+30+We(e,t+26)+We(e,t+28)},jt=function(e,t,r){var n=We(e,t+28),i=Ft(e.subarray(t+46,t+46+n),!(2048&We(e,t+8))),s=t+46+n,o=Ve(e,t+20),a=r&&4294967295==o?Ht(e,s):[o,Ve(e,t+24),Ve(e,t+42)],l=a[0],c=a[1],u=a[2];return[We(e,t+10),l,c,i,s+We(e,t+30)+We(e,t+32),u]},Ht=function(e,t){for(;1!=We(e,t);t+=4+We(e,t+2));return[qe(e,t+12),qe(e,t+4),qe(e,t+20)]},Ut=function(e){var t=0;if(e)for(var r in e){var n=e[r].length;n>65535&&te(9),t+=n+4}return t},zt=function(e,t,r,n,i,s,o,a){var l=n.length,c=r.extra,u=a&&a.length,d=Ut(c);$e(e,t,null!=o?33639248:67324752),t+=4,null!=o&&(e[t++]=20,e[t++]=r.os),e[t]=20,t+=2,e[t++]=r.flag<<1|(s<0&&8),e[t++]=i&&8,e[t++]=255&r.compression,e[t++]=r.compression>>8;var h=new Date(null==r.mtime?Date.now():r.mtime),p=h.getFullYear()-1980;if((p<0||p>119)&&te(10),$e(e,t,p<<25|h.getMonth()+1<<21|h.getDate()<<16|h.getHours()<<11|h.getMinutes()<<5|h.getSeconds()>>>1),t+=4,-1!=s&&($e(e,t,r.crc),$e(e,t+4,s<0?-s-2:s),$e(e,t+8,r.size)),$e(e,t+12,l),$e(e,t+14,d),t+=16,null!=o&&($e(e,t,u),$e(e,t+6,r.attrs),$e(e,t+10,o),t+=14),e.set(n,t),t+=l,d)for(var m in c){var f=c[m],g=f.length;$e(e,t,+m),$e(e,t+2,g),e.set(f,t+4),t+=4+g}return u&&(e.set(a,t),t+=u),t},Gt=function(e,t,r,n,i){$e(e,t,101010256),$e(e,t+8,r),$e(e,t+10,r),$e(e,t+12,n),$e(e,t+16,i)},Wt=function(){function ZipPassThrough2(e){this.filename=e,this.c=fe(),this.size=0,this.compression=0}return ZipPassThrough2.prototype.process=function(e,t){this.ondata(null,e,t)},ZipPassThrough2.prototype.push=function(e,t){this.ondata||te(5),this.c.p(e),this.size+=e.length,t&&(this.crc=this.c.d()),this.process(e,t||!1)},ZipPassThrough2}();t.ZipPassThrough=Wt;var Vt=function(){function ZipDeflate2(e,t){var r=this;t||(t={}),Wt.call(this,e),this.d=new nt(t,(function(e,t){r.ondata(null,e,t)})),this.compression=8,this.flag=It(t.level)}return ZipDeflate2.prototype.process=function(e,t){try{this.d.push(e,t)}catch(e){this.ondata(e,null,t)}},ZipDeflate2.prototype.push=function(e,t){Wt.prototype.push.call(this,e,t)},ZipDeflate2}();t.ZipDeflate=Vt;var qt=function(){function AsyncZipDeflate2(e,t){var r=this;t||(t={}),Wt.call(this,e),this.d=new it(t,(function(e,t,n){r.ondata(e,t,n)})),this.compression=8,this.flag=It(t.level),this.terminate=this.d.terminate}return AsyncZipDeflate2.prototype.process=function(e,t){this.d.push(e,t)},AsyncZipDeflate2.prototype.push=function(e,t){Wt.prototype.push.call(this,e,t)},AsyncZipDeflate2}();t.AsyncZipDeflate=qt;var $t=function(){function Zip2(e){this.ondata=e,this.u=[],this.d=1}return Zip2.prototype.add=function(e){var t=this;if(this.ondata||te(5),2&this.d)this.ondata(te(4+8*(1&this.d),0,1),null,!1);else{var r=Nt(e.filename),n=r.length,s=e.comment,o=s&&Nt(s),a=n!=e.filename.length||o&&s.length!=o.length,l=n+Ut(e.extra)+30;n>65535&&this.ondata(te(11,0,1),null,!1);var c=new i(l);zt(c,0,e,r,a,-1);var u=[c],d=function(){for(var e=0,r=u;e<r.length;e++){var n=r[e];t.ondata(null,n,!1)}u=[]},h=this.d;this.d=0;var p=this.u.length,m=be(e,{f:r,u:a,o,t:function(){e.terminate&&e.terminate()},r:function(){if(d(),h){var e=t.u[p+1];e?e.r():t.d=1}h=1}}),f=0;e.ondata=function(r,n,s){if(r)t.ondata(r,n,s),t.terminate();else if(f+=n.length,u.push(n),s){var o=new i(16);$e(o,0,134695760),$e(o,4,e.crc),$e(o,8,f),$e(o,12,e.size),u.push(o),m.c=f,m.b=l+f+16,m.crc=e.crc,m.size=e.size,h&&m.r(),h=1}else h&&d()},this.u.push(m)}},Zip2.prototype.end=function(){var e=this;2&this.d?this.ondata(te(4+8*(1&this.d),0,1),null,!0):(this.d?this.e():this.u.push({r:function(){1&e.d&&(e.u.splice(-1,1),e.e())},t:function(){}}),this.d=3)},Zip2.prototype.e=function(){for(var e=0,t=0,r=0,n=0,s=this.u;n<s.length;n++){r+=46+(c=s[n]).f.length+Ut(c.extra)+(c.o?c.o.length:0)}for(var o=new i(r+22),a=0,l=this.u;a<l.length;a++){var c=l[a];zt(o,e,c,c.f,c.u,-c.c-2,t,c.o),e+=46+c.f.length+Ut(c.extra)+(c.o?c.o.length:0),t+=c.b}Gt(o,e,this.u.length,r,t),this.ondata(null,o,!0),this.d=2},Zip2.prototype.terminate=function(){for(var e=0,t=this.u;e<t.length;e++){t[e].t()}this.d=2},Zip2}();t.Zip=$t,t.zip=function(e,t,r){r||(r=t,t={}),"function"!=typeof r&&te(7);var n={};At(e,"",n,t);var s=Object.keys(n),o=s.length,a=0,l=0,c=o,u=new Array(o),d=[],h=function(){for(var e=0;e<d.length;++e)d[e]()},p=function(e,t){Jt((function(){r(e,t)}))};Jt((function(){p=r}));var m=function(){var e=new i(l+22),t=a,r=l-a;l=0;for(var n=0;n<c;++n){var s=u[n];try{var o=s.c.length;zt(e,l,s,s.f,s.u,o);var d=30+s.f.length+Ut(s.extra),h=l+d;e.set(s.c,h),zt(e,a,s,s.f,s.u,o,l,s.m),a+=16+d+(s.m?s.m.length:0),l=h+o}catch(e){return p(e,null)}}Gt(e,a,u.length,r,t),p(null,e)};o||m();for(var f=function(e){var t=s[e],r=n[t],i=r[0],c=r[1],f=fe(),g=i.length;f.p(i);var y=Nt(t),b=y.length,v=c.comment,_=v&&Nt(v),x=_&&_.length,w=Ut(c.extra),R=0==c.level?0:8,k=function(r,n){if(r)h(),p(r,null);else{var i=n.length;u[e]=be(c,{size:g,crc:f.d(),c:n,f:y,m:_,u:b!=t.length||_&&v.length!=x,compression:R}),a+=30+b+w+i,l+=76+2*(b+w)+(x||0)+i,--o||m()}};if(b>65535&&k(te(11,0,1),null),R)if(g<16e4)try{k(null,ot(i,c))}catch(e){k(e,null)}else d.push(st(i,c,k));else k(null,i)},g=0;g<c;++g)f(g);return h},t.zipSync=function(e,t){t||(t={});var r={},n=[];At(e,"",r,t);var s=0,o=0;for(var a in r){var l=r[a],c=l[0],u=l[1],d=0==u.level?0:8,h=(k=Nt(a)).length,p=u.comment,m=p&&Nt(p),f=m&&m.length,g=Ut(u.extra);h>65535&&te(11);var y=d?ot(c,u):c,b=y.length,v=fe();v.p(c),n.push(be(u,{size:c.length,crc:v.d(),c:y,f:k,m,u:h!=a.length||m&&p.length!=f,o:s,compression:d})),s+=30+h+g+b,o+=76+2*(h+g)+(f||0)+b}for(var _=new i(o+22),x=s,w=o-s,R=0;R<n.length;++R){var k=n[R];zt(_,k.o,k,k.f,k.u,k.c.length);var j=30+k.f.length+Ut(k.extra);_.set(k.c,k.o+j),zt(_,s,k,k.f,k.u,k.c.length,k.o,k.m),s+=16+j+(k.m?k.m.length:0)}return Gt(_,s,n.length,w,x),_};var Zt=function(){function UnzipPassThrough2(){}return UnzipPassThrough2.prototype.push=function(e,t){this.ondata(null,e,t)},UnzipPassThrough2.compression=0,UnzipPassThrough2}();t.UnzipPassThrough=Zt;var Kt=function(){function UnzipInflate2(){var e=this;this.i=new at((function(t,r){e.ondata(null,t,r)}))}return UnzipInflate2.prototype.push=function(e,t){try{this.i.push(e,t)}catch(e){this.ondata(e,null,t)}},UnzipInflate2.compression=8,UnzipInflate2}();t.UnzipInflate=Kt;var Xt=function(){function AsyncUnzipInflate2(e,t){var r=this;t<32e4?this.i=new at((function(e,t){r.ondata(null,e,t)})):(this.i=new lt((function(e,t,n){r.ondata(e,t,n)})),this.terminate=this.i.terminate)}return AsyncUnzipInflate2.prototype.push=function(e,t){this.i.terminate&&(e=Y(e,0)),this.i.push(e,t)},AsyncUnzipInflate2.compression=8,AsyncUnzipInflate2}();t.AsyncUnzipInflate=Xt;var Yt=function(){function Unzip2(e){this.onfile=e,this.k=[],this.o={0:Zt},this.p=he}return Unzip2.prototype.push=function(e,t){var r=this;if(this.onfile||te(5),this.p||te(4),this.c>0){var n=Math.min(this.c,e.length),s=e.subarray(0,n);if(this.c-=n,this.d?this.d.push(s,!this.c):this.k[0].push(s),(e=e.subarray(n)).length)return this.push(e,t)}else{var o=0,a=0,l=void 0,c=void 0;this.p.length?e.length?((c=new i(this.p.length+e.length)).set(this.p),c.set(e,this.p.length)):c=this.p:c=e;for(var u=c.length,d=this.c,h=d&&this.d,p=function(){var e,t=Ve(c,a);if(67324752==t){o=1,l=a,m.d=null,m.c=0;var n=We(c,a+6),i=We(c,a+8),s=2048&n,h=8&n,p=We(c,a+26),f=We(c,a+28);if(u>a+30+p+f){var g=[];m.k.unshift(g),o=2;var y,b=Ve(c,a+18),v=Ve(c,a+22),_=Ft(c.subarray(a+30,a+=30+p),!s);4294967295==b?(e=h?[-2]:Ht(c,a),b=e[0],v=e[1]):h&&(b=-1),a+=f,m.c=b;var x={name:_,compression:i,start:function(){if(x.ondata||te(5),b){var e=r.o[i];e||x.ondata(te(14,"unknown compression type "+i,1),null,!1),(y=b<0?new e(_):new e(_,b,v)).ondata=function(e,t,r){x.ondata(e,t,r)};for(var t=0,n=g;t<n.length;t++){var s=n[t];y.push(s,!1)}r.k[0]==g&&r.c?r.d=y:y.push(he,!0)}else x.ondata(null,he,!0)},terminate:function(){y&&y.terminate&&y.terminate()}};b>=0&&(x.size=b,x.originalSize=v),m.onfile(x)}return"break"}if(d){if(134695760==t)return l=a+=12+(-2==d&&8),o=3,m.c=0,"break";if(33639248==t)return l=a-=4,o=3,m.c=0,"break"}},m=this;a<u-4;++a){if("break"===p())break}if(this.p=he,d<0){var f=o?c.subarray(0,l-12-(-2==d&&8)-(134695760==Ve(c,l-16)&&4)):c.subarray(0,a);h?h.push(f,!!o):this.k[+(2==o)].push(f)}if(2&o)return this.push(c.subarray(a),t);this.p=c.subarray(a)}t&&(this.c&&te(13),this.p=null)},Unzip2.prototype.register=function(e){this.o[e.compression]=e},Unzip2}();t.Unzip=Yt;var Jt="function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout?setTimeout:function(e){e()};t.unzip=function(e,t,r){r||(r=t,t={}),"function"!=typeof r&&te(7);var n=[],s=function(){for(var e=0;e<n.length;++e)n[e]()},o={},a=function(e,t){Jt((function(){r(e,t)}))};Jt((function(){a=r}));for(var l=e.length-22;101010256!=Ve(e,l);--l)if(!l||e.length-l>65558)return a(te(13,0,1),null),s;var c=We(e,l+8);if(c){var u=c,d=Ve(e,l+16),h=4294967295==d||65535==u;if(h){var p=Ve(e,l-12);(h=101075792==Ve(e,p))&&(u=c=Ve(e,p+32),d=Ve(e,p+48))}for(var m=t&&t.filter,f=function(t){var r=jt(e,d,h),l=r[0],u=r[1],p=r[2],f=r[3],g=r[4],y=r[5],b=Bt(e,y);d=g;var v=function(e,t){e?(s(),a(e,null)):(t&&(o[f]=t),--c||a(null,o))};if(!m||m({name:f,size:u,originalSize:p,compression:l}))if(l)if(8==l){var _=e.subarray(b,b+u);if(u<32e4)try{v(null,ut(_,new i(p)))}catch(e){v(e,null)}else n.push(ct(_,{size:p},v))}else v(te(14,"unknown compression type "+l,1),null);else v(null,Y(e,b,b+u));else v(null,null)},g=0;g<u;++g)f()}else a(null,{});return s},t.unzipSync=function(e,t){for(var r={},n=e.length-22;101010256!=Ve(e,n);--n)(!n||e.length-n>65558)&&te(13);var s=We(e,n+8);if(!s)return{};var o=Ve(e,n+16),a=4294967295==o||65535==s;if(a){var l=Ve(e,n-12);(a=101075792==Ve(e,l))&&(s=Ve(e,l+32),o=Ve(e,l+48))}for(var c=t&&t.filter,u=0;u<s;++u){var d=jt(e,o,a),h=d[0],p=d[1],m=d[2],f=d[3],g=d[4],y=d[5],b=Bt(e,y);o=g,c&&!c({name:f,size:p,originalSize:m,compression:h})||(h?8==h?r[f]=ut(e.subarray(b,b+p),new i(m)):te(14,"unknown compression type "+h):r[f]=Y(e,b,b+p))}return r}},9055:(e,t)=>{"use strict";var r={};t.default=function(e,t,n,i,s){var o=new Worker(r[t]||(r[t]=URL.createObjectURL(new Blob([e+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return o.onmessage=function(e){var t=e.data,r=t.$e$;if(r){var n=new Error(r[0]);n.code=r[1],n.stack=r[2],s(n,null)}else s(null,t)},o.postMessage(n,i),o}},41532:function(e,t){!function(r){"use strict";var n={s:1,n:0,d:1};function i(e,t){if(isNaN(e=parseInt(e,10)))throw InvalidParameter();return e*t}function s(e,t){if(0===t)throw DivisionByZero();var r=Object.create(Fraction.prototype);r.s=e<0?-1:1;var n=l(e=e<0?-e:e,t);return r.n=e/n,r.d=t/n,r}function o(e){for(var t={},r=e,n=2,i=4;i<=r;){for(;r%n==0;)r/=n,t[n]=(t[n]||0)+1;i+=1+2*n++}return r!==e?r>1&&(t[r]=(t[r]||0)+1):t[e]=(t[e]||0)+1,t}var a=function(e,t){var r,s=0,o=1,a=1,l=0,c=0,u=0,d=1,h=1,p=0,m=1,f=1,g=1,y=1e7;if(null==e);else if(void 0!==t){if(a=(s=e)*(o=t),s%1!=0||o%1!=0)throw NonIntegerParameter()}else switch(typeof e){case"object":if("d"in e&&"n"in e)s=e.n,o=e.d,"s"in e&&(s*=e.s);else{if(!(0 in e))throw InvalidParameter();s=e[0],1 in e&&(o=e[1])}a=s*o;break;case"number":if(e<0&&(a=e,e=-e),e%1==0)s=e;else if(e>0){for(e>=1&&(e/=h=Math.pow(10,Math.floor(1+Math.log(e)/Math.LN10)));m<=y&&g<=y;){if(e===(r=(p+f)/(m+g))){m+g<=y?(s=p+f,o=m+g):g>m?(s=f,o=g):(s=p,o=m);break}e>r?(p+=f,m+=g):(f+=p,g+=m),m>y?(s=f,o=g):(s=p,o=m)}s*=h}else(isNaN(e)||isNaN(t))&&(o=s=NaN);break;case"string":if(null===(m=e.match(/\d+|./g)))throw InvalidParameter();if("-"===m[p]?(a=-1,p++):"+"===m[p]&&p++,m.length===p+1?c=i(m[p++],a):"."===m[p+1]||"."===m[p]?("."!==m[p]&&(l=i(m[p++],a)),(++p+1===m.length||"("===m[p+1]&&")"===m[p+3]||"'"===m[p+1]&&"'"===m[p+3])&&(c=i(m[p],a),d=Math.pow(10,m[p].length),p++),("("===m[p]&&")"===m[p+2]||"'"===m[p]&&"'"===m[p+2])&&(u=i(m[p+1],a),h=Math.pow(10,m[p+1].length)-1,p+=3)):"/"===m[p+1]||":"===m[p+1]?(c=i(m[p],a),d=i(m[p+2],1),p+=3):"/"===m[p+3]&&" "===m[p+1]&&(l=i(m[p],a),c=i(m[p+2],a),d=i(m[p+4],1),p+=5),m.length<=p){a=s=u+(o=d*h)*l+h*c;break}default:throw InvalidParameter()}if(0===o)throw DivisionByZero();n.s=a<0?-1:1,n.n=Math.abs(s),n.d=Math.abs(o)};function l(e,t){if(!e)return t;if(!t)return e;for(;;){if(!(e%=t))return t;if(!(t%=e))return e}}function Fraction(e,t){if(a(e,t),!(this instanceof Fraction))return s(n.s*n.n,n.d);e=l(n.d,n.n),this.s=n.s,this.n=n.n/e,this.d=n.d/e}var DivisionByZero=function(){return new Error("Division by Zero")},InvalidParameter=function(){return new Error("Invalid argument")},NonIntegerParameter=function(){return new Error("Parameters must be integer")};Fraction.prototype={s:1,n:0,d:1,abs:function(){return s(this.n,this.d)},neg:function(){return s(-this.s*this.n,this.d)},add:function(e,t){return a(e,t),s(this.s*this.n*n.d+n.s*this.d*n.n,this.d*n.d)},sub:function(e,t){return a(e,t),s(this.s*this.n*n.d-n.s*this.d*n.n,this.d*n.d)},mul:function(e,t){return a(e,t),s(this.s*n.s*this.n*n.n,this.d*n.d)},div:function(e,t){return a(e,t),s(this.s*n.s*this.n*n.d,this.d*n.n)},clone:function(){return s(this.s*this.n,this.d)},mod:function(e,t){if(isNaN(this.n)||isNaN(this.d))return new Fraction(NaN);if(void 0===e)return s(this.s*this.n%this.d,1);if(a(e,t),0===n.n&&0===this.d)throw DivisionByZero();return s(this.s*(n.d*this.n)%(n.n*this.d),n.d*this.d)},gcd:function(e,t){return a(e,t),s(l(n.n,this.n)*l(n.d,this.d),n.d*this.d)},lcm:function(e,t){return a(e,t),0===n.n&&0===this.n?s(0,1):s(n.n*this.n,l(n.n,this.n)*l(n.d,this.d))},ceil:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new Fraction(NaN):s(Math.ceil(e*this.s*this.n/this.d),e)},floor:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new Fraction(NaN):s(Math.floor(e*this.s*this.n/this.d),e)},round:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new Fraction(NaN):s(Math.round(e*this.s*this.n/this.d),e)},roundTo:function(e,t){return a(e,t),s(this.s*Math.round(this.n*n.d/(this.d*n.n))*n.n,n.d)},inverse:function(){return s(this.s*this.d,this.n)},pow:function(e,t){if(a(e,t),1===n.d)return n.s<0?s(Math.pow(this.s*this.d,n.n),Math.pow(this.n,n.n)):s(Math.pow(this.s*this.n,n.n),Math.pow(this.d,n.n));if(this.s<0)return null;var r=o(this.n),i=o(this.d),l=1,c=1;for(var u in r)if("1"!==u){if("0"===u){l=0;break}if(r[u]*=n.n,r[u]%n.d!=0)return null;r[u]/=n.d,l*=Math.pow(u,r[u])}for(var u in i)if("1"!==u){if(i[u]*=n.n,i[u]%n.d!=0)return null;i[u]/=n.d,c*=Math.pow(u,i[u])}return n.s<0?s(c,l):s(l,c)},equals:function(e,t){return a(e,t),this.s*this.n*n.d==n.s*n.n*this.d},compare:function(e,t){a(e,t);var r=this.s*this.n*n.d-n.s*n.n*this.d;return(0<r)-(r<0)},simplify:function(e){if(isNaN(this.n)||isNaN(this.d))return this;e=e||.001;for(var t=this.abs(),r=t.toContinued(),n=1;n<r.length;n++){for(var i=s(r[n-1],1),o=n-2;o>=0;o--)i=i.inverse().add(r[o]);if(Math.abs(i.sub(t).valueOf())<e)return i.mul(this.s)}return this},divisible:function(e,t){return a(e,t),!(!(n.n*this.d)||this.n*n.d%(n.n*this.d))},valueOf:function(){return this.s*this.n/this.d},toFraction:function(e){var t,r="",n=this.n,i=this.d;return this.s<0&&(r+="-"),1===i?r+=n:(e&&(t=Math.floor(n/i))>0&&(r+=t,r+=" ",n%=i),r+=n,r+="/",r+=i),r},toLatex:function(e){var t,r="",n=this.n,i=this.d;return this.s<0&&(r+="-"),1===i?r+=n:(e&&(t=Math.floor(n/i))>0&&(r+=t,n%=i),r+="\\frac{",r+=n,r+="}{",r+=i,r+="}"),r},toContinued:function(){var e,t=this.n,r=this.d,n=[];if(isNaN(t)||isNaN(r))return n;do{n.push(Math.floor(t/r)),e=t%r,t=r,r=e}while(1!==t);return n},toString:function(e){var t=this.n,r=this.d;if(isNaN(t)||isNaN(r))return"NaN";e=e||15;var n=function(e,t){for(;t%2==0;t/=2);for(;t%5==0;t/=5);if(1===t)return 0;for(var r=10%t,n=1;1!==r;n++)if(r=10*r%t,n>2e3)return 0;return n}(0,r),i=function(e,t,r){for(var n=1,i=function(e,t,r){for(var n=1;t>0;e=e*e%r,t>>=1)1&t&&(n=n*e%r);return n}(10,r,t),s=0;s<300;s++){if(n===i)return s;n=10*n%t,i=10*i%t}return 0}(0,r,n),s=this.s<0?"-":"";if(s+=t/r|0,t%=r,(t*=10)&&(s+="."),n){for(var o=i;o--;)s+=t/r|0,t%=r,t*=10;s+="(";for(o=n;o--;)s+=t/r|0,t%=r,t*=10;s+=")"}else for(o=e;t&&o--;)s+=t/r|0,t%=r,t*=10;return s}},Object.defineProperty(t,"__esModule",{value:!0}),t.default=Fraction,e.exports=Fraction}()},17944:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>i});var n=r(37849);const i=class extends n.Controller{static targets=["element"];static classes=["active"];static values={performOnConnect:{type:Boolean,default:!1}};connect(){this.performOnConnectValue&&this.perform()}perform(){this.hasElementTarget?this.elementTargets.forEach(this._toggleActiveClass):this._toggleActiveClass(this.element)}on(){this.hasElementTarget?this.elementTargets.forEach((e=>this._toggleActiveClass(e,!0))):this._toggleActiveClass(this.element,!0)}off(){this.hasElementTarget?this.elementTargets.forEach((e=>this._toggleActiveClass(e,!1))):this._toggleActiveClass(this.element,!1)}_toggleActiveClass(e,t=!e.classList.contains(this.activeClass)){setTimeout((()=>{e.classList.toggle(this.activeClass,t)}),0)}}},67859:(e,t,r)=>{"use strict";r(49565);const n=(e,t=document,{bubbles:r=!0,cancelable:n=!0,prefix:i="rms",detail:s}={})=>{const o=new CustomEvent(`${i}:${e}`,{bubbles:r,cancelable:n,detail:s});return t.dispatchEvent(o),!o.defaultPrevented};class TurboConfirmError extends Error{name="TurboConfirmError";static missingDialog(e,t){return new this(`No element matching dialogSelector: '${e}'`,{cause:t})}static noTurbo(){return new this('Turbo is not defined. Be sure to import "@hotwired/turbo-rails" before calling the `start()` function')}}class ConfirmationController{initialContent;#m;constructor(e){this.delegate=e,this.accept=this.accept.bind(this),this.deny=this.deny.bind(this)}showConfirm(e){this.#f();for(const[t,r]of Object.entries(e)){const e=this.element.querySelector(t);e&&r&&(e.innerHTML=r)}return this.#g(),this.delegate.showConfirm(this.element),new Promise((e=>this.#m=e))}accept(){this.#m(!0),this.#y()}deny(){this.#m(!1),this.#y()}get acceptButtons(){return this.element.querySelectorAll(this.delegate.acceptSelector)}get denyButtons(){return this.element.querySelectorAll(this.delegate.denySelector)}get element(){return document.querySelector(this.delegate.dialogSelector)}#y(){this.#m=null,this.delegate.hideConfirm(this.element),this.#b(),setTimeout(this.#v.bind(this),this.delegate.animationDuration)}#g(){this.acceptButtons.forEach((e=>e.addEventListener("click",this.accept))),this.denyButtons.forEach((e=>e.addEventListener("click",this.deny))),this.element.addEventListener("cancel",this.deny)}#b(){this.acceptButtons.forEach((e=>e.removeEventListener("click",this.accept))),this.denyButtons.forEach((e=>e.removeEventListener("click",this.deny))),this.element.removeEventListener("cancel",this.deny)}#f(){try{this.initialContent=this.element.innerHTML}catch(e){throw TurboConfirmError.missingDialog(this.delegate.dialogSelector,e)}}#v(){try{this.element.innerHTML=this.initialContent}catch{}}}class TurboConfirm{#_;#x={dialogSelector:"#confirm",activeClass:"modal--active",acceptSelector:"#confirm-accept",denySelector:".confirm-cancel",animationDuration:300,showConfirmCallback:e=>e.showModal&&e.showModal(),hideConfirmCallback:e=>e.close&&e.close(),messageSlotSelector:"#confirm-title",contentSlots:{body:{contentAttribute:"confirm-details",slotSelector:"#confirm-body"},acceptText:{contentAttribute:"confirm-button",slotSelector:"#confirm-accept"}}};constructor(e={}){for(const[t,r]of Object.entries(e))this.#x[t]=r;this.#_=new ConfirmationController(this)}confirm(e,t,r){const n=this.#w(r),i=this.#S(e,n);return this.confirmWithContent(i)}confirmWithContent(e){return this.#_.showConfirm(e)}showConfirm(e){e.classList.add(this.#x.activeClass),"function"==typeof this.#x.showConfirmCallback&&this.#x.showConfirmCallback(e)}hideConfirm(e){e.classList.remove(this.#x.activeClass),"function"==typeof this.#x.hideConfirmCallback&&this.#x.hideConfirmCallback(e)}get dialogSelector(){return this.#x.dialogSelector}get acceptSelector(){return this.#x.acceptSelector}get denySelector(){return this.#x.denySelector}get animationDuration(){return this.#x.animationDuration}#S(e,t){const r={};if(e&&(r[this.#x.messageSlotSelector]=e),t)for(const e of Object.keys(this.#x.contentSlots))r[this.#P(e)]=this.#E(e,t);return r}#P(e){return this.#x.contentSlots[e].slotSelector}#E(e,t){return t.getAttribute(`data-${this.#x.contentSlots[e].contentAttribute}`)}#w(e){return(e??document.activeElement).closest("[data-turbo-confirm]")}}(e=>{const t=new TurboConfirm(e);if(!window.Turbo)throw TurboConfirmError.noTurbo();window.Turbo.setConfirmMethod((async(e,r,i)=>{const s=await t.confirm(e,r,i);return n(s?"confirm-accept":"confirm-reject",i),s}))})()},35684:(e,t,r)=>{"use strict";r.a(e,(async(e,t)=>{try{r(76302),r(69414),r(49565),r(30283),r(67859);var n=r(37849),i=r(77673),s=(r(41784),r(41777));globalThis.ahoy=s.A,await Promise.resolve().then(r.t.bind(r,87843,19)),(await Promise.resolve().then(r.bind(r,74147))).start(),await Promise.resolve().then(r.t.bind(r,48087,19)),await Promise.resolve().then(r.t.bind(r,28052,19)),await Promise.resolve().then(r.t.bind(r,94527,19));const e=n.Application.start(),o=(await Promise.resolve().then(r.t.bind(r,99429,19))).default;e.load((0,i.Ux)(o)),await Promise.resolve().then(r.t.bind(r,97614,19)),t()}catch(e){t(e)}}),1)},238:(e,t,r)=>{"use strict";function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},n.apply(this,arguments)}r.d(t,{A:()=>n})},16632:(e,t,r)=>{"use strict";function n(e,t){return(n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,n(e,t)}r.d(t,{A:()=>i})},15105:(e,t,r)=>{"use strict";function n(e,t){if(null==e)return{};var r,n,i={},s=Object.keys(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}r.d(t,{A:()=>n})},41777:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var n={set:function(e,t,r,n){var i="",s="";if(r){var o=new Date;o.setTime(o.getTime()+60*r*1e3),i="; expires="+o.toGMTString()}n&&(s="; domain="+n),document.cookie=e+"="+escape(t)+i+s+"; path=/; samesite=lax"},get:function(e){var t,r,n=e+"=",i=document.cookie.split(";");for(t=0;t<i.length;t++){for(r=i[t];" "===r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(n))return unescape(r.substring(n.length,r.length))}return null}},i={urlPrefix:"",visitsUrl:"/ahoy/visits",eventsUrl:"/ahoy/events",page:null,platform:"Web",useBeacon:!0,startOnReady:!0,trackVisits:!0,cookies:!0,cookieDomain:null,headers:{},visitParams:{},withCredentials:!1,visitDuration:240,visitorDuration:1051200},s=window.ahoy||window.Ahoy||{};s.configure=function(e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(i[t]=e[t])},s.configure(s);var o,a,l,c,u=window.jQuery||window.Zepto||window.$,d=!1,h=[],p="undefined"!=typeof JSON&&void 0!==JSON.stringify,m=[];function f(){return i.urlPrefix+i.eventsUrl}function g(){return(i.useBeacon||i.trackNow)&&(e=i.headers,0===Object.keys(e).length)&&p&&void 0!==window.navigator.sendBeacon&&!i.withCredentials;var e}function y(e,t,r){n.set(e,t,r,i.cookieDomain||i.domain)}function b(e){return n.get(e)}function v(e){n.set(e,"",-1)}function _(e){b("ahoy_debug")&&window.console.log(e)}function x(){for(var e;e=h.shift();)e();d=!0}function w(e,t){var r=e.matches||e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector;return r?r.apply(e,[t])?e:e.parentElement?w(e.parentElement,t):null:(_("Unable to match"),null)}function R(e,t,r){document.addEventListener(e,(function(e){var n=w(e.target,t);if(n){var i=re(n,"data-ahoy-skip");if(null!==i&&"false"!==i)return;r.call(n,e)}}))}function k(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}function j(){i.cookies&&p&&y("ahoy_events",JSON.stringify(m),1)}function z(){var e=document.querySelector("meta[name=csrf-token]");return e&&e.content}function CSRFProtection(e){var t=z();t&&e.setRequestHeader("X-CSRF-Token",t)}function q(e,t,r){if(p)if(u&&u.ajax)u.ajax({type:"POST",url:e,data:JSON.stringify(t),contentType:"application/json; charset=utf-8",dataType:"json",beforeSend:CSRFProtection,success:r,headers:i.headers,xhrFields:{withCredentials:i.withCredentials}});else{var n=new XMLHttpRequest;for(var s in n.open("POST",e,!0),n.withCredentials=i.withCredentials,n.setRequestHeader("Content-Type","application/json"),i.headers)Object.prototype.hasOwnProperty.call(i.headers,s)&&n.setRequestHeader(s,i.headers[s]);n.onload=function(){200===n.status&&r()},CSRFProtection(n),n.send(JSON.stringify(t))}}function $(e){var t={events:[e]};return i.cookies&&(t.visit_token=e.visit_token,t.visitor_token=e.visitor_token),delete e.visit_token,delete e.visitor_token,t}function Z(e){s.ready((function(){q(f(),$(e),(function(){for(var t=0;t<m.length;t++)if(m[t].id===e.id){m.splice(t,1);break}j()}))}))}function X(e){s.ready((function(){var t,r=$(e),n=(t=document.querySelector("meta[name=csrf-param]"))&&t.content,i=z();n&&i&&(r[n]=i),r.events_json=JSON.stringify(r.events),delete r.events,window.navigator.sendBeacon(f(),function(e){var t=new FormData;for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.append(r,e[r]);return t}(r))}))}function Y(){return i.page||window.location.pathname}function ee(e){return e&&e.length>0?e:null}function te(){return function(e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&null===e[t]&&delete e[t];return e}({tag:this.tagName.toLowerCase(),id:ee(this.id),class:ee(this.className),page:Y(),section:re(this,"data-section")})}function re(e,t){for(;e&&e!==document;e=e.parentNode)if(e.hasAttribute(t))return e.getAttribute(t);return null}function ne(){if(d=!1,o=s.getVisitId(),a=s.getVisitorId(),l=b("ahoy_track"),!1===i.cookies||!1===i.trackVisits)_("Visit tracking disabled"),x();else if(o&&a&&!l)_("Active visit"),x();else if(o||y("ahoy_visit",o=k(),i.visitDuration),b("ahoy_visit")){_("Visit started"),a||y("ahoy_visitor",a=k(),i.visitorDuration);var e={visit_token:o,visitor_token:a,platform:i.platform,landing_page:window.location.href,screen_width:window.screen.width,screen_height:window.screen.height,js:!0};for(var t in document.referrer.length>0&&(e.referrer=document.referrer),i.visitParams)Object.prototype.hasOwnProperty.call(i.visitParams,t)&&(e[t]=i.visitParams[t]);_(e),q(i.urlPrefix+i.visitsUrl,e,(function(){v("ahoy_track"),x()}))}else _("Cookies disabled"),x()}s.ready=function(e){d?e():h.push(e)},s.getVisitId=s.getVisitToken=function(){return b("ahoy_visit")},s.getVisitorId=s.getVisitorToken=function(){return b("ahoy_visitor")},s.reset=function(){return v("ahoy_visit"),v("ahoy_visitor"),v("ahoy_events"),v("ahoy_track"),!0},s.debug=function(e){return!1===e?v("ahoy_debug"):y("ahoy_debug","t",525600),!0},s.track=function(e,t){var r={name:e,properties:t||{},time:(new Date).getTime()/1e3,id:k(),js:!0};return s.ready((function(){i.cookies&&!s.getVisitId()&&ne(),s.ready((function(){_(r),r.visit_token=s.getVisitId(),r.visitor_token=s.getVisitorId(),g()?X(r):(m.push(r),j(),setTimeout((function(){Z(r)}),1e3))}))})),!0},s.trackView=function(e){var t={url:window.location.href,title:document.title,page:Y()};if(e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);s.track("$view",t)},s.trackClicks=function(e){if(void 0===e)throw new Error("Missing selector");R("click",e,(function(e){var t=te.call(this,e);t.text="input"===t.tag?this.value:(this.textContent||this.innerText||this.innerHTML).replace(/[\s\r\n]+/g," ").trim(),t.href=this.href,s.track("$click",t)}))},s.trackSubmits=function(e){if(void 0===e)throw new Error("Missing selector");R("submit",e,(function(e){var t=te.call(this,e);s.track("$submit",t)}))},s.trackChanges=function(e){if(_("trackChanges is deprecated and will be removed in 0.5.0"),void 0===e)throw new Error("Missing selector");R("change",e,(function(e){var t=te.call(this,e);s.track("$change",t)}))};try{m=JSON.parse(b("ahoy_events")||"[]")}catch(e){}for(var ie=0;ie<m.length;ie++)Z(m[ie]);s.start=function(){ne(),s.start=function(){}},c=function(){i.startOnReady&&s.start()},"interactive"===document.readyState||"complete"===document.readyState?setTimeout(c,0):document.addEventListener("DOMContentLoaded",c)},20066:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AVERAGE:()=>s,CENTER:()=>i,CONTAINED:()=>c,ExtendedTriangle:()=>ExtendedTriangle,FloatVertexAttributeTexture:()=>FloatVertexAttributeTexture,INTERSECTED:()=>l,IntVertexAttributeTexture:()=>IntVertexAttributeTexture,MeshBVH:()=>MeshBVH,MeshBVHUniformStruct:()=>MeshBVHUniformStruct,MeshBVHVisualizer:()=>MeshBVHVisualizer,NOT_INTERSECTED:()=>a,OrientedBox:()=>OrientedBox,SAH:()=>o,StaticGeometryGenerator:()=>StaticGeometryGenerator,UIntVertexAttributeTexture:()=>UIntVertexAttributeTexture,VertexAttributeTexture:()=>VertexAttributeTexture,acceleratedRaycast:()=>bt,computeBoundsTree:()=>vt,disposeBoundsTree:()=>_t,estimateMemoryInBytes:()=>ht,getBVHExtremes:()=>dt,getJSONStructure:()=>mt,getTriangleHitPointInfo:()=>ye,shaderDistanceFunction:()=>Pt,shaderIntersectFunction:()=>St,shaderStructs:()=>wt,validateBounds:()=>pt});var n=r(28019);const i=0,s=1,o=2,a=0,l=1,c=2,u=1.25,d=1,h=32,p=65535,m=Math.pow(2,-24);class MeshBVHNode{constructor(){}}function f(e,t,r){return r.min.x=t[e],r.min.y=t[e+1],r.min.z=t[e+2],r.max.x=t[e+3],r.max.y=t[e+4],r.max.z=t[e+5],r}function g(e){let t=-1,r=-1/0;for(let n=0;n<3;n++){const i=e[n+3]-e[n];i>r&&(r=i,t=n)}return t}function y(e,t){t.set(e)}function b(e,t,r){let n,i;for(let s=0;s<3;s++){const o=s+3;n=e[s],i=t[s],r[s]=n<i?n:i,n=e[o],i=t[o],r[o]=n>i?n:i}}function v(e,t,r){for(let n=0;n<3;n++){const i=t[e+2*n],s=t[e+2*n+1],o=i-s,a=i+s;o<r[n]&&(r[n]=o),a>r[n+3]&&(r[n+3]=a)}}function _(e){const t=e[3]-e[0],r=e[4]-e[1],n=e[5]-e[2];return 2*(t*r+r*n+n*t)}function x(e,t,r,n,i=null){let s=1/0,o=1/0,a=1/0,l=-1/0,c=-1/0,u=-1/0,d=1/0,h=1/0,p=1/0,m=-1/0,f=-1/0,g=-1/0;const y=null!==i;for(let n=6*t,i=6*(t+r);n<i;n+=6){const t=e[n+0],r=e[n+1],i=t-r,b=t+r;i<s&&(s=i),b>l&&(l=b),y&&t<d&&(d=t),y&&t>m&&(m=t);const v=e[n+2],_=e[n+3],x=v-_,w=v+_;x<o&&(o=x),w>c&&(c=w),y&&v<h&&(h=v),y&&v>f&&(f=v);const R=e[n+4],k=e[n+5],j=R-k,z=R+k;j<a&&(a=j),z>u&&(u=z),y&&R<p&&(p=R),y&&R>g&&(g=R)}n[0]=s,n[1]=o,n[2]=a,n[3]=l,n[4]=c,n[5]=u,y&&(i[0]=d,i[1]=h,i[2]=p,i[3]=m,i[4]=f,i[5]=g)}const w=32,R=(e,t)=>e.candidate-t.candidate,k=new Array(w).fill().map((()=>({count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0}))),j=new Float32Array(6);function z(e,t){function r(e){Z&&Z(e/X)}function a(t,n,l,m=null,Z=0){if(!Y&&Z>=f&&(Y=!0,z&&(console.warn(`MeshBVH: Max depth of ${f} reached when generating BVH. Consider increasing maxDepth.`),console.warn(e))),l<=q||Z>=f)return r(n+l),t.offset=n,t.count=l,t;const X=function(e,t,r,n,a,l){let c=-1,h=0;if(l===i)c=g(t),-1!==c&&(h=(t[c]+t[c+3])/2);else if(l===s)c=g(e),-1!==c&&(h=function(e,t,r,n){let i=0;for(let s=t,o=t+r;s<o;s++)i+=e[6*s+2*n];return i/r}(r,n,a,c));else if(l===o){const i=_(e);let s=u*a;const o=6*n,l=6*(n+a);for(let e=0;e<3;e++){const n=t[e],p=(t[e+3]-n)/w;if(a<w/4){const t=[...k];t.length=a;let n=0;for(let i=o;i<l;i+=6,n++){const s=t[n];s.candidate=r[i+2*e],s.count=0;const{bounds:o,leftCacheBounds:a,rightCacheBounds:l}=s;for(let e=0;e<3;e++)l[e]=1/0,l[e+3]=-1/0,a[e]=1/0,a[e+3]=-1/0,o[e]=1/0,o[e+3]=-1/0;v(i,r,o)}t.sort(R);let p=a;for(let e=0;e<p;e++){const r=t[e];for(;e+1<p&&t[e+1].candidate===r.candidate;)t.splice(e+1,1),p--}for(let n=o;n<l;n+=6){const i=r[n+2*e];for(let e=0;e<p;e++){const s=t[e];i>=s.candidate?v(n,r,s.rightCacheBounds):(v(n,r,s.leftCacheBounds),s.count++)}}for(let r=0;r<p;r++){const n=t[r],o=n.count,l=a-n.count,p=n.leftCacheBounds,m=n.rightCacheBounds;let f=0;0!==o&&(f=_(p)/i);let g=0;0!==l&&(g=_(m)/i);const y=d+u*(f*o+g*l);y<s&&(c=e,s=y,h=n.candidate)}}else{for(let e=0;e<w;e++){const t=k[e];t.count=0,t.candidate=n+p+e*p;const r=t.bounds;for(let e=0;e<3;e++)r[e]=1/0,r[e+3]=-1/0}for(let t=o;t<l;t+=6){let i=~~((r[t+2*e]-n)/p);i>=w&&(i=w-1);const s=k[i];s.count++,v(t,r,s.bounds)}const t=k[w-1];y(t.bounds,t.rightCacheBounds);for(let e=w-2;e>=0;e--){const t=k[e],r=k[e+1];b(t.bounds,r.rightCacheBounds,t.rightCacheBounds)}let m=0;for(let t=0;t<w-1;t++){const r=k[t],n=r.count,o=r.bounds,l=k[t+1].rightCacheBounds;0!==n&&(0===m?y(o,j):b(o,j,j)),m+=n;let p=0,f=0;0!==m&&(p=_(j)/i);const g=a-m;0!==g&&(f=_(l)/i);const v=d+u*(p*m+f*g);v<s&&(c=e,s=v,h=r.candidate)}}}}else console.warn(`MeshBVH: Invalid build strategy value ${l} used.`);return{axis:c,pos:h}}(t.boundingData,m,h,n,l,$);if(-1===X.axis)return r(n+l),t.offset=n,t.count=l,t;const ee=function(e,t,r,n,i){let s=r,o=r+n-1;const a=i.pos,l=2*i.axis;for(;;){for(;s<=o&&t[6*s+l]<a;)s++;for(;s<=o&&t[6*o+l]>=a;)o--;if(!(s<o))return s;for(let r=0;r<3;r++){let n=e[3*s+r];e[3*s+r]=e[3*o+r],e[3*o+r]=n;let i=t[6*s+2*r+0];t[6*s+2*r+0]=t[6*o+2*r+0],t[6*o+2*r+0]=i;let a=t[6*s+2*r+1];t[6*s+2*r+1]=t[6*o+2*r+1],t[6*o+2*r+1]=a}s++,o--}}(p,h,n,l,X);if(ee===n||ee===n+l)r(n+l),t.offset=n,t.count=l;else{t.splitAxis=X.axis;const e=new MeshBVHNode,r=n,i=ee-n;t.left=e,e.boundingData=new Float32Array(6),x(h,r,i,e.boundingData,c),a(e,r,i,c,Z+1);const s=new MeshBVHNode,o=ee,u=l-i;t.right=s,s.boundingData=new Float32Array(6),x(h,o,u,s.boundingData,c),a(s,o,u,c,Z+1)}return t}!function(e,t){if(!e.index){const r=e.attributes.position.count,i=t.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;let s;s=r>65535?new Uint32Array(new i(4*r)):new Uint16Array(new i(2*r)),e.setIndex(new n.BufferAttribute(s,1));for(let e=0;e<r;e++)s[e]=e}}(e,t);const l=new Float32Array(6),c=new Float32Array(6),h=function(e,t){const r=e.attributes.position,n=e.index.array,i=n.length/3,s=new Float32Array(6*i),o=r.normalized,a=r.array,l=r.offset||0;let c=3;r.isInterleavedBufferAttribute&&(c=r.data.stride);const u=["getX","getY","getZ"];for(let e=0;e<i;e++){const i=3*e,d=6*e;let h,p,f;o?(h=n[i+0],p=n[i+1],f=n[i+2]):(h=n[i+0]*c+l,p=n[i+1]*c+l,f=n[i+2]*c+l);for(let e=0;e<3;e++){let n,i,l;o?(n=r[u[e]](h),i=r[u[e]](p),l=r[u[e]](f)):(n=a[h+e],i=a[p+e],l=a[f+e]);let c=n;i<c&&(c=i),l<c&&(c=l);let g=n;i>g&&(g=i),l>g&&(g=l);const y=(g-c)/2,b=2*e;s[d+b+0]=c+y,s[d+b+1]=y+(Math.abs(c)+y)*m,c<t[e]&&(t[e]=c),g>t[e+3]&&(t[e+3]=g)}}return s}(e,l),p=e.index.array,f=t.maxDepth,z=t.verbose,q=t.maxLeafTris,$=t.strategy,Z=t.onProgress,X=e.index.count/3;let Y=!1;const ee=[],te=function(e){if(!e.groups||!e.groups.length)return[{offset:0,count:e.index.count/3}];const t=[],r=new Set;for(const t of e.groups)r.add(t.start),r.add(t.start+t.count);const n=Array.from(r.values()).sort(((e,t)=>e-t));for(let e=0;e<n.length-1;e++){const r=n[e],i=n[e+1];t.push({offset:r/3,count:(i-r)/3})}return t}(e);if(1===te.length){const e=te[0],t=new MeshBVHNode;t.boundingData=l,function(e,t,r,n){let i=1/0,s=1/0,o=1/0,a=-1/0,l=-1/0,c=-1/0;for(let n=6*t,u=6*(t+r);n<u;n+=6){const t=e[n+0];t<i&&(i=t),t>a&&(a=t);const r=e[n+2];r<s&&(s=r),r>l&&(l=r);const u=e[n+4];u<o&&(o=u),u>c&&(c=u)}n[0]=i,n[1]=s,n[2]=o,n[3]=a,n[4]=l,n[5]=c}(h,e.offset,e.count,c),a(t,e.offset,e.count,c),ee.push(t)}else for(let e of te){const t=new MeshBVHNode;t.boundingData=new Float32Array(6),x(h,e.offset,e.count,t.boundingData,c),a(t,e.offset,e.count,c),ee.push(t)}return ee}class SeparatingAxisBounds{constructor(){this.min=1/0,this.max=-1/0}setFromPointsField(e,t){let r=1/0,n=-1/0;for(let i=0,s=e.length;i<s;i++){const s=e[i][t];r=s<r?s:r,n=s>n?s:n}this.min=r,this.max=n}setFromPoints(e,t){let r=1/0,n=-1/0;for(let i=0,s=t.length;i<s;i++){const s=t[i],o=e.dot(s);r=o<r?o:r,n=o>n?o:n}this.min=r,this.max=n}isSeparated(e){return this.min>e.max||e.min>this.max}}SeparatingAxisBounds.prototype.setFromBox=function(){const e=new n.Vector3;return function(t,r){const n=r.min,i=r.max;let s=1/0,o=-1/0;for(let r=0;r<=1;r++)for(let a=0;a<=1;a++)for(let l=0;l<=1;l++){e.x=n.x*r+i.x*(1-r),e.y=n.y*a+i.y*(1-a),e.z=n.z*l+i.z*(1-l);const c=t.dot(e);s=Math.min(c,s),o=Math.max(c,o)}this.min=s,this.max=o}}();!function(){const e=new SeparatingAxisBounds}();const q=function(){const e=new n.Vector3,t=new n.Vector3,r=new n.Vector3;return function(n,i,s){const o=n.start,a=e,l=i.start,c=t;r.subVectors(o,l),e.subVectors(n.end,n.start),t.subVectors(i.end,i.start);const u=r.dot(c),d=c.dot(a),h=c.dot(c),p=r.dot(a),m=a.dot(a)*h-d*d;let f,g;f=0!==m?(u*d-p*h)/m:0,g=(u+f*d)/h,s.x=f,s.y=g}}(),$=function(){const e=new n.Vector2,t=new n.Vector3,r=new n.Vector3;return function(n,i,s,o){q(n,i,e);let a=e.x,l=e.y;if(a>=0&&a<=1&&l>=0&&l<=1)return n.at(a,s),void i.at(l,o);if(a>=0&&a<=1)return l<0?i.at(0,o):i.at(1,o),void n.closestPointToPoint(o,!0,s);if(l>=0&&l<=1)return a<0?n.at(0,s):n.at(1,s),void i.closestPointToPoint(s,!0,o);{let e,c;e=a<0?n.start:n.end,c=l<0?i.start:i.end;const u=t,d=r;return n.closestPointToPoint(c,!0,t),i.closestPointToPoint(e,!0,r),u.distanceToSquared(c)<=d.distanceToSquared(e)?(s.copy(u),void o.copy(c)):(s.copy(e),void o.copy(d))}}}(),Z=function(){const e=new n.Vector3,t=new n.Vector3,r=new n.Plane,i=new n.Line3;return function(n,s){const{radius:o,center:a}=n,{a:l,b:c,c:u}=s;i.start=l,i.end=c;if(i.closestPointToPoint(a,!0,e).distanceTo(a)<=o)return!0;i.start=l,i.end=u;if(i.closestPointToPoint(a,!0,e).distanceTo(a)<=o)return!0;i.start=c,i.end=u;if(i.closestPointToPoint(a,!0,e).distanceTo(a)<=o)return!0;const d=s.getPlane(r);if(Math.abs(d.distanceToPoint(a))<=o){const e=d.projectPoint(a,t);if(s.containsPoint(e))return!0}return!1}}();function X(e){return Math.abs(e)<1e-15}class ExtendedTriangle extends n.Triangle{constructor(...e){super(...e),this.isExtendedTriangle=!0,this.satAxes=new Array(4).fill().map((()=>new n.Vector3)),this.satBounds=new Array(4).fill().map((()=>new SeparatingAxisBounds)),this.points=[this.a,this.b,this.c],this.sphere=new n.Sphere,this.plane=new n.Plane,this.needsUpdate=!0}intersectsSphere(e){return Z(e,this)}update(){const e=this.a,t=this.b,r=this.c,n=this.points,i=this.satAxes,s=this.satBounds,o=i[0],a=s[0];this.getNormal(o),a.setFromPoints(o,n);const l=i[1],c=s[1];l.subVectors(e,t),c.setFromPoints(l,n);const u=i[2],d=s[2];u.subVectors(t,r),d.setFromPoints(u,n);const h=i[3],p=s[3];h.subVectors(r,e),p.setFromPoints(h,n),this.sphere.setFromPoints(this.points),this.plane.setFromNormalAndCoplanarPoint(o,e),this.needsUpdate=!1}}ExtendedTriangle.prototype.closestPointToSegment=function(){const e=new n.Vector3,t=new n.Vector3,r=new n.Line3;return function(n,i=null,s=null){const{start:o,end:a}=n,l=this.points;let c,u=1/0;for(let o=0;o<3;o++){const a=(o+1)%3;r.start.copy(l[o]),r.end.copy(l[a]),$(r,n,e,t),c=e.distanceToSquared(t),c<u&&(u=c,i&&i.copy(e),s&&s.copy(t))}return this.closestPointToPoint(o,e),c=o.distanceToSquared(e),c<u&&(u=c,i&&i.copy(e),s&&s.copy(o)),this.closestPointToPoint(a,e),c=a.distanceToSquared(e),c<u&&(u=c,i&&i.copy(e),s&&s.copy(a)),Math.sqrt(u)}}(),ExtendedTriangle.prototype.intersectsTriangle=function(){const e=new ExtendedTriangle,t=new Array(3),r=new Array(3),i=new SeparatingAxisBounds,s=new SeparatingAxisBounds,o=new n.Vector3,a=new n.Vector3,l=new n.Vector3,c=new n.Vector3,u=new n.Line3,d=new n.Line3,h=new n.Line3;return function(n,p=null,m=!1){this.needsUpdate&&this.update(),n.isExtendedTriangle?n.needsUpdate&&n.update():(e.copy(n),e.update(),n=e);const f=this.plane,g=n.plane;if(Math.abs(f.normal.dot(g.normal))>1-1e-10){const e=this.satBounds,a=this.satAxes;r[0]=n.a,r[1]=n.b,r[2]=n.c;for(let t=0;t<4;t++){const n=e[t],s=a[t];if(i.setFromPoints(s,r),n.isSeparated(i))return!1}const l=n.satBounds,c=n.satAxes;t[0]=this.a,t[1]=this.b,t[2]=this.c;for(let e=0;e<4;e++){const r=l[e],n=c[e];if(i.setFromPoints(n,t),r.isSeparated(i))return!1}for(let e=0;e<4;e++){const n=a[e];for(let e=0;e<4;e++){const a=c[e];if(o.crossVectors(n,a),i.setFromPoints(o,t),s.setFromPoints(o,r),i.isSeparated(s))return!1}}return p&&(m||console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."),p.start.set(0,0,0),p.end.set(0,0,0)),!0}{const e=this.points;let t=!1,r=0;for(let n=0;n<3;n++){const i=e[n],s=e[(n+1)%3];u.start.copy(i),u.end.copy(s),u.delta(a);const o=t?d.start:d.end,l=X(g.distanceToPoint(i));if(X(g.normal.dot(a))&&l){d.copy(u),r=2;break}if((g.intersectLine(u,o)||l)&&!X(o.distanceTo(s))){if(r++,t)break;t=!0}}if(1===r&&n.containsPoint(d.end))return p&&(p.start.copy(d.end),p.end.copy(d.end)),!0;if(2!==r)return!1;const i=n.points;let s=!1,o=0;for(let e=0;e<3;e++){const t=i[e],r=i[(e+1)%3];u.start.copy(t),u.end.copy(r),u.delta(l);const n=s?h.start:h.end,a=X(f.distanceToPoint(t));if(X(f.normal.dot(l))&&a){h.copy(u),o=2;break}if((f.intersectLine(u,n)||a)&&!X(n.distanceTo(r))){if(o++,s)break;s=!0}}if(1===o&&this.containsPoint(h.end))return p&&(p.start.copy(h.end),p.end.copy(h.end)),!0;if(2!==o)return!1;if(d.delta(a),h.delta(l),a.dot(l)<0){let e=h.start;h.start=h.end,h.end=e}const m=d.start.dot(a),y=d.end.dot(a),b=h.start.dot(a),v=h.end.dot(a);return(m===v||b===y||y<b!==m<v)&&(p&&(c.subVectors(d.start,h.start),c.dot(a)>0?p.start.copy(d.start):p.start.copy(h.start),c.subVectors(d.end,h.end),c.dot(a)<0?p.end.copy(d.end):p.end.copy(h.end)),!0)}}}(),ExtendedTriangle.prototype.distanceToPoint=function(){const e=new n.Vector3;return function(t){return this.closestPointToPoint(t,e),t.distanceTo(e)}}(),ExtendedTriangle.prototype.distanceToTriangle=function(){const e=new n.Vector3,t=new n.Vector3,r=["a","b","c"],i=new n.Line3,s=new n.Line3;return function(n,o=null,a=null){const l=o||a?i:null;if(this.intersectsTriangle(n,l))return(o||a)&&(o&&l.getCenter(o),a&&l.getCenter(a)),0;let c=1/0;for(let t=0;t<3;t++){let i;const s=r[t],l=n[s];this.closestPointToPoint(l,e),i=l.distanceToSquared(e),i<c&&(c=i,o&&o.copy(e),a&&a.copy(l));const u=this[s];n.closestPointToPoint(u,e),i=u.distanceToSquared(e),i<c&&(c=i,o&&o.copy(u),a&&a.copy(e))}for(let l=0;l<3;l++){const u=r[l],d=r[(l+1)%3];i.set(this[u],this[d]);for(let l=0;l<3;l++){const u=r[l],d=r[(l+1)%3];s.set(n[u],n[d]),$(i,s,e,t);const h=e.distanceToSquared(t);h<c&&(c=h,o&&o.copy(e),a&&a.copy(t))}}return Math.sqrt(c)}}();class OrientedBox{constructor(e,t,r){this.isOrientedBox=!0,this.min=new n.Vector3,this.max=new n.Vector3,this.matrix=new n.Matrix4,this.invMatrix=new n.Matrix4,this.points=new Array(8).fill().map((()=>new n.Vector3)),this.satAxes=new Array(3).fill().map((()=>new n.Vector3)),this.satBounds=new Array(3).fill().map((()=>new SeparatingAxisBounds)),this.alignedSatBounds=new Array(3).fill().map((()=>new SeparatingAxisBounds)),this.needsUpdate=!1,e&&this.min.copy(e),t&&this.max.copy(t),r&&this.matrix.copy(r)}set(e,t,r){this.min.copy(e),this.max.copy(t),this.matrix.copy(r),this.needsUpdate=!0}copy(e){this.min.copy(e.min),this.max.copy(e.max),this.matrix.copy(e.matrix),this.needsUpdate=!0}}OrientedBox.prototype.update=function(){return function(){const e=this.matrix,t=this.min,r=this.max,n=this.points;for(let i=0;i<=1;i++)for(let s=0;s<=1;s++)for(let o=0;o<=1;o++){const a=n[1*i|2*s|4*o];a.x=i?r.x:t.x,a.y=s?r.y:t.y,a.z=o?r.z:t.z,a.applyMatrix4(e)}const i=this.satBounds,s=this.satAxes,o=n[0];for(let e=0;e<3;e++){const t=s[e],r=i[e],a=n[1<<e];t.subVectors(o,a),r.setFromPoints(t,n)}const a=this.alignedSatBounds;a[0].setFromPointsField(n,"x"),a[1].setFromPointsField(n,"y"),a[2].setFromPointsField(n,"z"),this.invMatrix.copy(this.matrix).invert(),this.needsUpdate=!1}}(),OrientedBox.prototype.intersectsBox=function(){const e=new SeparatingAxisBounds;return function(t){this.needsUpdate&&this.update();const r=t.min,n=t.max,i=this.satBounds,s=this.satAxes,o=this.alignedSatBounds;if(e.min=r.x,e.max=n.x,o[0].isSeparated(e))return!1;if(e.min=r.y,e.max=n.y,o[1].isSeparated(e))return!1;if(e.min=r.z,e.max=n.z,o[2].isSeparated(e))return!1;for(let r=0;r<3;r++){const n=s[r],o=i[r];if(e.setFromBox(n,t),o.isSeparated(e))return!1}return!0}}(),OrientedBox.prototype.intersectsTriangle=function(){const e=new ExtendedTriangle,t=new Array(3),r=new SeparatingAxisBounds,i=new SeparatingAxisBounds,s=new n.Vector3;return function(n){this.needsUpdate&&this.update(),n.isExtendedTriangle?n.needsUpdate&&n.update():(e.copy(n),e.update(),n=e);const o=this.satBounds,a=this.satAxes;t[0]=n.a,t[1]=n.b,t[2]=n.c;for(let e=0;e<3;e++){const n=o[e],i=a[e];if(r.setFromPoints(i,t),n.isSeparated(r))return!1}const l=n.satBounds,c=n.satAxes,u=this.points;for(let e=0;e<3;e++){const t=l[e],n=c[e];if(r.setFromPoints(n,u),t.isSeparated(r))return!1}for(let e=0;e<3;e++){const n=a[e];for(let e=0;e<4;e++){const o=c[e];if(s.crossVectors(n,o),r.setFromPoints(s,t),i.setFromPoints(s,u),r.isSeparated(i))return!1}}return!0}}(),OrientedBox.prototype.closestPointToPoint=function(){return function(e,t){return this.needsUpdate&&this.update(),t.copy(e).applyMatrix4(this.invMatrix).clamp(this.min,this.max).applyMatrix4(this.matrix),t}}(),OrientedBox.prototype.distanceToPoint=function(){const e=new n.Vector3;return function(t){return this.closestPointToPoint(t,e),t.distanceTo(e)}}(),OrientedBox.prototype.distanceToBox=function(){const e=["x","y","z"],t=new Array(12).fill().map((()=>new n.Line3)),r=new Array(12).fill().map((()=>new n.Line3)),i=new n.Vector3,s=new n.Vector3;return function(n,o=0,a=null,l=null){if(this.needsUpdate&&this.update(),this.intersectsBox(n))return(a||l)&&(n.getCenter(s),this.closestPointToPoint(s,i),n.closestPointToPoint(i,s),a&&a.copy(i),l&&l.copy(s)),0;const c=o*o,u=n.min,d=n.max,h=this.points;let p=1/0;for(let e=0;e<8;e++){const t=h[e];s.copy(t).clamp(u,d);const r=t.distanceToSquared(s);if(r<p&&(p=r,a&&a.copy(t),l&&l.copy(s),r<c))return Math.sqrt(r)}let m=0;for(let n=0;n<3;n++)for(let i=0;i<=1;i++)for(let s=0;s<=1;s++){const o=(n+1)%3,a=(n+2)%3,l=1<<n|i<<o|s<<a,c=h[i<<o|s<<a],p=h[l];t[m].set(c,p);const f=e[n],g=e[o],y=e[a],b=r[m],v=b.start,_=b.end;v[f]=u[f],v[g]=i?u[g]:d[g],v[y]=s?u[y]:d[g],_[f]=d[f],_[g]=i?u[g]:d[g],_[y]=s?u[y]:d[g],m++}for(let e=0;e<=1;e++)for(let t=0;t<=1;t++)for(let r=0;r<=1;r++){s.x=e?d.x:u.x,s.y=t?d.y:u.y,s.z=r?d.z:u.z,this.closestPointToPoint(s,i);const n=s.distanceToSquared(i);if(n<p&&(p=n,a&&a.copy(i),l&&l.copy(s),n<c))return Math.sqrt(n)}for(let e=0;e<12;e++){const n=t[e];for(let e=0;e<12;e++){const t=r[e];$(n,t,i,s);const o=i.distanceToSquared(s);if(o<p&&(p=o,a&&a.copy(i),l&&l.copy(s),o<c))return Math.sqrt(o)}}return Math.sqrt(p)}}();const Y=new n.Vector3,ee=new n.Vector3,te=new n.Vector3,re=new n.Vector2,ne=new n.Vector2,ie=new n.Vector2,se=new n.Vector3;function oe(e,t,r,i,s,o,a){Y.fromBufferAttribute(t,i),ee.fromBufferAttribute(t,s),te.fromBufferAttribute(t,o);const l=function(e,t,r,i,s,o){let a;return a=o===n.BackSide?e.intersectTriangle(i,r,t,!0,s):e.intersectTriangle(t,r,i,o!==n.DoubleSide,s),null===a?null:{distance:e.origin.distanceTo(s),point:s.clone()}}(e,Y,ee,te,se,a);if(l){r&&(re.fromBufferAttribute(r,i),ne.fromBufferAttribute(r,s),ie.fromBufferAttribute(r,o),l.uv=n.Triangle.getUV(se,Y,ee,te,re,ne,ie,new n.Vector2));const e={a:i,b:s,c:o,normal:new n.Vector3,materialIndex:0};n.Triangle.getNormal(Y,ee,te,e.normal),l.face=e,l.faceIndex=i}return l}function ae(e,t,r,n,i){const s=3*n,o=e.index.getX(s),a=e.index.getX(s+1),l=e.index.getX(s+2),c=oe(r,e.attributes.position,e.attributes.uv,o,a,l,t);return c?(c.faceIndex=n,i&&i.push(c),c):null}function le(e,t,r){return null===e?null:(e.point.applyMatrix4(t.matrixWorld),e.distance=e.point.distanceTo(r.ray.origin),e.object=t,e.distance<r.near||e.distance>r.far?null:e)}function ce(e,t,r,n){const i=e.a,s=e.b,o=e.c;let a=t,l=t+1,c=t+2;r&&(a=r.getX(t),l=r.getX(t+1),c=r.getX(t+2)),i.x=n.getX(a),i.y=n.getY(a),i.z=n.getZ(a),s.x=n.getX(l),s.y=n.getY(l),s.z=n.getZ(l),o.x=n.getX(c),o.y=n.getY(c),o.z=n.getZ(c)}function ue(e,t,r,n,i,s,o){const a=r.index,l=r.attributes.position;for(let r=e,c=t+e;r<c;r++)if(ce(o,3*r,a,l),o.needsUpdate=!0,n(o,r,i,s))return!0;return!1}const de=new n.Vector3,he=new n.Vector3,pe=new n.Vector3,me=new n.Vector2,fe=new n.Vector2,ge=new n.Vector2;function ye(e,t,r,i){const s=t.getIndex().array,o=t.getAttribute("position"),a=t.getAttribute("uv"),l=s[3*r],c=s[3*r+1],u=s[3*r+2];de.fromBufferAttribute(o,l),he.fromBufferAttribute(o,c),pe.fromBufferAttribute(o,u);let d=0;const h=t.groups,p=3*r;for(let e=0,t=h.length;e<t;e++){const t=h[e],{start:r,count:n}=t;if(p>=r&&p<r+n){d=t.materialIndex;break}}let m=null;return a&&(me.fromBufferAttribute(a,l),fe.fromBufferAttribute(a,c),ge.fromBufferAttribute(a,u),m=i&&i.uv?i.uv:new n.Vector2,n.Triangle.getUV(e,de,he,pe,me,fe,ge,m)),i?(i.face||(i.face={}),i.face.a=l,i.face.b=c,i.face.c=u,i.face.materialIndex=d,i.face.normal||(i.face.normal=new n.Vector3),n.Triangle.getNormal(de,he,pe,i.face.normal),m&&(i.uv=m),i):{face:{a:l,b:c,c:u,materialIndex:d,normal:n.Triangle.getNormal(de,he,pe,new n.Vector3)},uv:m}}class PrimitivePool{constructor(e){this._getNewPrimitive=e,this._primitives=[]}getPrimitive(){const e=this._primitives;return 0===e.length?this._getNewPrimitive():e.pop()}releasePrimitive(e){this._primitives.push(e)}}function IS_LEAF(e,t){return 65535===t[e+15]}function OFFSET(e,t){return t[e+6]}function COUNT(e,t){return t[e+14]}function LEFT_NODE(e){return e+8}function RIGHT_NODE(e,t){return t[e+6]}function SPLIT_AXIS(e,t){return t[e+7]}const be=new n.Box3,ve=new n.Vector3,_e=["x","y","z"];function xe(e,t,r,n,i){let s=2*e,o=Ie,a=je,l=He;if(IS_LEAF(s,a)){!function(e,t,r,n,i,s){for(let o=n,a=n+i;o<a;o++)ae(e,t,r,o,s)}(t,r,n,OFFSET(e,l),COUNT(s,a),i)}else{const s=LEFT_NODE(e);Te(s,o,n,ve)&&xe(s,t,r,n,i);const a=RIGHT_NODE(e,l);Te(a,o,n,ve)&&xe(a,t,r,n,i)}}function we(e,t,r,n){let i=2*e,s=Ie,o=je,a=He;if(IS_LEAF(i,o)){return function(e,t,r,n,i){let s=1/0,o=null;for(let a=n,l=n+i;a<l;a++){const n=ae(e,t,r,a);n&&n.distance<s&&(o=n,s=n.distance)}return o}(t,r,n,OFFSET(e,a),COUNT(i,o))}{const i=SPLIT_AXIS(e,a),o=_e[i],l=n.direction[o]>=0;let c,u;l?(c=LEFT_NODE(e),u=RIGHT_NODE(e,a)):(c=RIGHT_NODE(e,a),u=LEFT_NODE(e));const d=Te(c,s,n,ve)?we(c,t,r,n):null;if(d){const e=d.point[o];if(l?e<=s[u+i]:e>=s[u+i+3])return d}const h=Te(u,s,n,ve)?we(u,t,r,n):null;return d&&h?d.distance<=h.distance?d:h:d||h||null}}const Se=function(){let e,t;const r=[],i=new PrimitivePool((()=>new n.Box3));return function(...n){e=i.getPrimitive(),t=i.getPrimitive(),r.push(e,t);const o=s(...n);i.releasePrimitive(e),i.releasePrimitive(t),r.pop(),r.pop();const a=r.length;return a>0&&(t=r[a-1],e=r[a-2]),o};function s(r,n,i,o,a=null,l=0,u=0){function d(e){let t=2*e,r=je,n=He;for(;!IS_LEAF(t,r);)t=2*(e=LEFT_NODE(e));return OFFSET(e,n)}function h(e){let t=2*e,r=je,n=He;for(;!IS_LEAF(t,r);)t=2*(e=RIGHT_NODE(e,n));return OFFSET(e,n)+COUNT(t,r)}let p=2*r,m=Ie,g=je,y=He;if(IS_LEAF(p,g)){const t=OFFSET(r,y),n=COUNT(p,g);return f(r,m,e),o(t,n,!1,u,l+r,e)}{const p=LEFT_NODE(r),b=RIGHT_NODE(r,y);let v,_,x,w,R=p,k=b;if(a&&(x=e,w=t,f(R,m,x),f(k,m,w),v=a(x),_=a(w),_<v)){R=b,k=p;const e=v;v=_,_=e,x=w}x||(x=e,f(R,m,x));const j=i(x,IS_LEAF(2*R,g),v,u+1,l+R);let z;if(j===c){const e=d(R);z=o(e,h(R)-e,!0,u+1,l+R,x)}else z=j&&s(R,n,i,o,a,l,u+1);if(z)return!0;w=t,f(k,m,w);const q=i(w,IS_LEAF(2*k,g),_,u+1,l+k);let $;if(q===c){const e=d(k);$=o(e,h(k)-e,!0,u+1,l+k,w)}else $=q&&s(k,n,i,o,a,l,u+1);return!!$}}}(),Pe=function(){const e=new ExtendedTriangle,t=new ExtendedTriangle,r=new n.Matrix4,i=new OrientedBox,s=new OrientedBox;return function n(o,a,l,c,u=null){let d=2*o,h=Ie,p=je,m=He;null===u&&(l.boundingBox||l.computeBoundingBox(),i.set(l.boundingBox.min,l.boundingBox.max,c),u=i);if(!IS_LEAF(d,p)){const e=o+8,t=m[o+6];f(e,h,be);if(u.intersectsBox(be)&&n(e,a,l,c,u))return!0;f(t,h,be);return!!(u.intersectsBox(be)&&n(t,a,l,c,u))}{const n=a,i=n.index,u=n.attributes.position,g=l.index,y=l.attributes.position,b=OFFSET(o,m),v=COUNT(d,p);if(r.copy(c).invert(),l.boundsTree){f(o,h,s),s.matrix.copy(r),s.needsUpdate=!0;return l.boundsTree.shapecast({intersectsBounds:e=>s.intersectsBox(e),intersectsTriangle:e=>{e.a.applyMatrix4(c),e.b.applyMatrix4(c),e.c.applyMatrix4(c),e.needsUpdate=!0;for(let r=3*b,n=3*(v+b);r<n;r+=3)if(ce(t,r,i,u),t.needsUpdate=!0,e.intersectsTriangle(t))return!0;return!1}})}for(let n=3*b,s=v+3*b;n<s;n+=3){ce(e,n,i,u),e.a.applyMatrix4(r),e.b.applyMatrix4(r),e.c.applyMatrix4(r),e.needsUpdate=!0;for(let r=0,n=g.count;r<n;r+=3)if(ce(t,r,g,y),t.needsUpdate=!0,e.intersectsTriangle(t))return!0}}}}();function Te(e,t,r,n){return f(e,t,be),r.intersectBox(be,n)}const Re=[];let ke,Ie,je,He;function ze(e){ke&&Re.push(ke),ke=e,Ie=new Float32Array(e),je=new Uint16Array(e),He=new Uint32Array(e)}function Ge(){ke=null,Ie=null,je=null,He=null,Re.length&&ze(Re.pop())}const We=Symbol("skip tree generation"),Ve=new n.Box3,qe=new n.Box3,$e=new n.Matrix4,Xe=new OrientedBox,Ye=new OrientedBox,Qe=new n.Vector3,et=new n.Vector3,tt=new n.Vector3,rt=new n.Vector3,nt=new n.Vector3,it=new n.Box3,st=new PrimitivePool((()=>new ExtendedTriangle));class MeshBVH{static serialize(e,t={}){if(t.isBufferGeometry)return console.warn("MeshBVH.serialize: The arguments for the function have changed. See documentation for new signature."),MeshBVH.serialize(arguments[0],{cloneBuffers:void 0===arguments[2]||arguments[2]});t={cloneBuffers:!0,...t};const r=e.geometry,n=e._roots,i=r.getIndex();let s;return s=t.cloneBuffers?{roots:n.map((e=>e.slice())),index:i.array.slice()}:{roots:n,index:i.array},s}static deserialize(e,t,r={}){if("boolean"==typeof r)return console.warn("MeshBVH.deserialize: The arguments for the function have changed. See documentation for new signature."),MeshBVH.deserialize(arguments[0],arguments[1],{setIndex:void 0===arguments[2]||arguments[2]});r={setIndex:!0,...r};const{index:i,roots:s}=e,o=new MeshBVH(t,{...r,[We]:!0});if(o._roots=s,r.setIndex){const r=t.getIndex();if(null===r){const r=new n.BufferAttribute(e.index,1,!1);t.setIndex(r)}else r.array!==i&&(r.array.set(i),r.needsUpdate=!0)}return o}constructor(e,t={}){if(!e.isBufferGeometry)throw new Error("MeshBVH: Only BufferGeometries are supported.");if(e.index&&e.index.isInterleavedBufferAttribute)throw new Error("MeshBVH: InterleavedBufferAttribute is not supported for the index attribute.");if((t=Object.assign({strategy:i,maxDepth:40,maxLeafTris:10,verbose:!0,useSharedArrayBuffer:!1,setBoundingBox:!0,onProgress:null,[We]:!1},t)).useSharedArrayBuffer&&"undefined"==typeof SharedArrayBuffer)throw new Error("MeshBVH: SharedArrayBuffer is not available.");this._roots=null,t[We]||(this._roots=function(e,t){const r=z(e,t);let n,i,s;const o=[],a=t.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;for(let e=0;e<r.length;e++){const t=r[e];let u=l(t);const d=new a(h*u);n=new Float32Array(d),i=new Uint32Array(d),s=new Uint16Array(d),c(0,t),o.push(d)}return o;function l(e){return e.count?1:1+l(e.left)+l(e.right)}function c(e,t){const r=e/4,o=e/2,a=!!t.count,l=t.boundingData;for(let e=0;e<6;e++)n[r+e]=l[e];if(a){const n=t.offset,a=t.count;return i[r+6]=n,s[o+14]=a,s[o+15]=p,e+h}{const n=t.left,s=t.right,o=t.splitAxis;let a;if(a=c(e+h,n),a/4>Math.pow(2,32))throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");return i[r+6]=a/4,a=c(a,s),i[r+7]=o,a}}}(e,t),!e.boundingBox&&t.setBoundingBox&&(e.boundingBox=this.getBoundingBox(new n.Box3))),this.geometry=e}refit(e=null){e&&Array.isArray(e)&&(e=new Set(e));const t=this.geometry,r=t.index.array,n=t.attributes.position;let i,s,o,a,l=0;const c=this._roots;for(let e=0,t=c.length;e<t;e++)i=c[e],s=new Uint32Array(i),o=new Uint16Array(i),a=new Float32Array(i),u(0,l),l+=i.byteLength;function u(t,i,l=!1){const c=2*t;if(o[c+15]===p){const e=s[t+6];let i=1/0,l=1/0,u=1/0,d=-1/0,h=-1/0,p=-1/0;for(let t=3*e,s=3*(e+o[c+14]);t<s;t++){const e=r[t],s=n.getX(e),o=n.getY(e),a=n.getZ(e);s<i&&(i=s),s>d&&(d=s),o<l&&(l=o),o>h&&(h=o),a<u&&(u=a),a>p&&(p=a)}return(a[t+0]!==i||a[t+1]!==l||a[t+2]!==u||a[t+3]!==d||a[t+4]!==h||a[t+5]!==p)&&(a[t+0]=i,a[t+1]=l,a[t+2]=u,a[t+3]=d,a[t+4]=h,a[t+5]=p,!0)}{const r=t+8,n=s[t+6],o=r+i,c=n+i;let d=l,h=!1,p=!1;e?d||(h=e.has(o),p=e.has(c),d=!h&&!p):(h=!0,p=!0);const m=d||p;let f=!1;(d||h)&&(f=u(r,i,d));let g=!1;m&&(g=u(n,i,d));const y=f||g;if(y)for(let e=0;e<3;e++){const i=r+e,s=n+e,o=a[i],l=a[i+3],c=a[s],u=a[s+3];a[t+e]=o<c?o:c,a[t+e+3]=l>u?l:u}return y}}}traverse(e,t=0){const r=this._roots[t],n=new Uint32Array(r),i=new Uint16Array(r);!function t(s,o=0){const a=2*s,l=i[a+15]===p;if(l){const t=n[s+6],c=i[a+14];e(o,l,new Float32Array(r,4*s,6),t,c)}else{const i=s+8,a=n[s+6],c=n[s+7];e(o,l,new Float32Array(r,4*s,6),c)||(t(i,o+1),t(a,o+1))}}(0)}raycast(e,t=n.FrontSide){const r=this._roots,i=this.geometry,s=[],o=t.isMaterial,a=Array.isArray(t),l=i.groups,c=o?t.side:t;for(let n=0,o=r.length;n<o;n++){const o=a?t[l[n].materialIndex].side:c,u=s.length;if(ze(r[n]),xe(0,i,o,e,s),Ge(),a){const e=l[n].materialIndex;for(let t=u,r=s.length;t<r;t++)s[t].face.materialIndex=e}}return s}raycastFirst(e,t=n.FrontSide){const r=this._roots,i=this.geometry,s=t.isMaterial,o=Array.isArray(t);let a=null;const l=i.groups,c=s?t.side:t;for(let n=0,s=r.length;n<s;n++){const s=o?t[l[n].materialIndex].side:c;ze(r[n]);const u=we(0,i,s,e);Ge(),null!=u&&(null==a||u.distance<a.distance)&&(a=u,o&&(u.face.materialIndex=l[n].materialIndex))}return a}intersectsGeometry(e,t){const r=this.geometry;let n=!1;for(const i of this._roots)if(ze(i),n=Pe(0,r,e,t),Ge(),n)break;return n}shapecast(e,t,r){const n=this.geometry;if(e instanceof Function){if(t){const e=t;t=(t,r,n,i)=>{const s=3*r;return e(t,s,s+1,s+2,n,i)}}e={boundsTraverseOrder:r,intersectsBounds:e,intersectsTriangle:t,intersectsRange:null},console.warn("MeshBVH: Shapecast function signature has changed and now takes an object of callbacks as a second argument. See docs for new signature.")}const i=st.getPrimitive();let{boundsTraverseOrder:s,intersectsBounds:o,intersectsRange:a,intersectsTriangle:l}=e;if(a&&l){const e=a;a=(t,r,s,o,a)=>!!e(t,r,s,o,a)||ue(t,r,n,l,s,o,i)}else a||(a=l?(e,t,r,s)=>ue(e,t,n,l,r,s,i):(e,t,r)=>r);let c=!1,u=0;for(const e of this._roots){if(ze(e),c=Se(0,n,o,a,s,u),Ge(),c)break;u+=e.byteLength}return st.releasePrimitive(i),c}bvhcast(e,t,r){let{intersectsRanges:n,intersectsTriangles:i}=r;const s=this.geometry.index,o=this.geometry.attributes.position,a=e.geometry.index,l=e.geometry.attributes.position;$e.copy(t).invert();const c=st.getPrimitive(),u=st.getPrimitive();if(i){let e=function(e,r,n,d,h,p,m,f){for(let g=n,y=n+d;g<y;g++){ce(u,3*g,a,l),u.a.applyMatrix4(t),u.b.applyMatrix4(t),u.c.applyMatrix4(t),u.needsUpdate=!0;for(let t=e,n=e+r;t<n;t++)if(ce(c,3*t,s,o),c.needsUpdate=!0,i(c,u,t,g,h,p,m,f))return!0}return!1};if(n){const t=n;n=function(r,n,i,s,o,a,l,c){return!!t(r,n,i,s,o,a,l,c)||e(r,n,i,s,o,a,l,c)}}else n=e}e.getBoundingBox(qe),qe.applyMatrix4(t);const d=this.shapecast({intersectsBounds:e=>qe.intersectsBox(e),intersectsRange:(t,r,i,s,o,a)=>(Ve.copy(a),Ve.applyMatrix4($e),e.shapecast({intersectsBounds:e=>Ve.intersectsBox(e),intersectsRange:(e,i,a,l,c)=>n(t,r,e,i,s,o,l,c)}))});return st.releasePrimitive(c),st.releasePrimitive(u),d}intersectsBox(e,t){return Xe.set(e.min,e.max,t),Xe.needsUpdate=!0,this.shapecast({intersectsBounds:e=>Xe.intersectsBox(e),intersectsTriangle:e=>Xe.intersectsTriangle(e)})}intersectsSphere(e){return this.shapecast({intersectsBounds:t=>e.intersectsBox(t),intersectsTriangle:t=>t.intersectsSphere(e)})}closestPointToGeometry(e,t,r={},n={},i=0,s=1/0){e.boundingBox||e.computeBoundingBox(),Xe.set(e.boundingBox.min,e.boundingBox.max,t),Xe.needsUpdate=!0;const o=this.geometry,a=o.attributes.position,l=o.index,c=e.attributes.position,u=e.index,d=st.getPrimitive(),h=st.getPrimitive();let p=et,m=tt,f=null,g=null;n&&(f=rt,g=nt);let y=1/0,b=null,v=null;return $e.copy(t).invert(),Ye.matrix.copy($e),this.shapecast({boundsTraverseOrder:e=>Xe.distanceToBox(e),intersectsBounds:(e,t,r)=>r<y&&r<s&&(t&&(Ye.min.copy(e.min),Ye.max.copy(e.max),Ye.needsUpdate=!0),!0),intersectsRange:(r,n)=>{if(e.boundsTree)return e.boundsTree.shapecast({boundsTraverseOrder:e=>Ye.distanceToBox(e),intersectsBounds:(e,t,r)=>r<y&&r<s,intersectsRange:(e,s)=>{for(let o=3*e,_=3*(e+s);o<_;o+=3){ce(h,o,u,c),h.a.applyMatrix4(t),h.b.applyMatrix4(t),h.c.applyMatrix4(t),h.needsUpdate=!0;for(let e=3*r,t=3*(r+n);e<t;e+=3){ce(d,e,l,a),d.needsUpdate=!0;const t=d.distanceToTriangle(h,p,f);if(t<y&&(m.copy(p),g&&g.copy(f),y=t,b=e/3,v=o/3),t<i)return!0}}}});for(let e=0,s=u?u.count:c.count;e<s;e+=3){ce(h,e,u,c),h.a.applyMatrix4(t),h.b.applyMatrix4(t),h.c.applyMatrix4(t),h.needsUpdate=!0;for(let t=3*r,s=3*(r+n);t<s;t+=3){ce(d,t,l,a),d.needsUpdate=!0;const r=d.distanceToTriangle(h,p,f);if(r<y&&(m.copy(p),g&&g.copy(f),y=r,b=t/3,v=e/3),r<i)return!0}}}}),st.releasePrimitive(d),st.releasePrimitive(h),y===1/0?null:(r.point?r.point.copy(m):r.point=m.clone(),r.distance=y,r.faceIndex=b,n&&(n.point?n.point.copy(g):n.point=g.clone(),n.point.applyMatrix4($e),m.applyMatrix4($e),n.distance=m.sub(n.point).length(),n.faceIndex=v),r)}closestPointToPoint(e,t={},r=0,n=1/0){const i=r*r,s=n*n;let o=1/0,a=null;if(this.shapecast({boundsTraverseOrder:t=>(Qe.copy(e).clamp(t.min,t.max),Qe.distanceToSquared(e)),intersectsBounds:(e,t,r)=>r<o&&r<s,intersectsTriangle:(t,r)=>{t.closestPointToPoint(e,Qe);const n=e.distanceToSquared(Qe);return n<o&&(et.copy(Qe),o=n,a=r),n<i}}),o===1/0)return null;const l=Math.sqrt(o);return t.point?t.point.copy(et):t.point=et.clone(),t.distance=l,t.faceIndex=a,t}getBoundingBox(e){e.makeEmpty();return this._roots.forEach((t=>{f(0,new Float32Array(t),it),e.union(it)})),e}}const ot=new n.Box3;class MeshBVHRootVisualizer extends n.Object3D{get isMesh(){return!this.displayEdges}get isLineSegments(){return this.displayEdges}get isLine(){return this.displayEdges}constructor(e,t,r=10,i=0){super(),this.material=t,this.geometry=new n.BufferGeometry,this.name="MeshBVHRootVisualizer",this.depth=r,this.displayParents=!1,this.mesh=e,this.displayEdges=!0,this._group=i}raycast(){}update(){const e=this.geometry,t=this.mesh.geometry.boundsTree,r=this._group;if(e.dispose(),this.visible=!1,t){const i=this.depth-1,s=this.displayParents;let o=0;t.traverse(((e,t)=>{if(e===i||t)return o++,!0;s&&o++}),r);let a=0;const l=new Float32Array(24*o);let c,u;t.traverse(((e,t,r)=>{const n=e===i||t;if(n||s){f(0,r,ot);const{min:e,max:t}=ot;for(let r=-1;r<=1;r+=2){const n=r<0?e.x:t.x;for(let r=-1;r<=1;r+=2){const i=r<0?e.y:t.y;for(let r=-1;r<=1;r+=2){const s=r<0?e.z:t.z;l[a+0]=n,l[a+1]=i,l[a+2]=s,a+=3}}}return n}}),r),u=this.displayEdges?new Uint8Array([0,4,1,5,2,6,3,7,0,2,1,3,4,6,5,7,0,1,2,3,4,5,6,7]):new Uint8Array([0,1,2,2,1,3,4,6,5,6,7,5,1,4,5,0,4,1,2,3,6,3,7,6,0,2,4,2,6,4,1,5,3,3,5,7]),c=l.length>65535?new Uint32Array(u.length*o):new Uint16Array(u.length*o);const d=u.length;for(let e=0;e<o;e++){const t=8*e,r=e*d;for(let e=0;e<d;e++)c[r+e]=t+u[e]}e.setIndex(new n.BufferAttribute(c,1,!1)),e.setAttribute("position",new n.BufferAttribute(l,3,!1)),this.visible=!0}}}class MeshBVHVisualizer extends n.Group{get color(){return this.edgeMaterial.color}get opacity(){return this.edgeMaterial.opacity}set opacity(e){this.edgeMaterial.opacity=e,this.meshMaterial.opacity=e}constructor(e,t=10){super(),this.name="MeshBVHVisualizer",this.depth=t,this.mesh=e,this.displayParents=!1,this.displayEdges=!0,this._roots=[];const r=new n.LineBasicMaterial({color:65416,transparent:!0,opacity:.3,depthWrite:!1}),i=new n.MeshBasicMaterial({color:65416,transparent:!0,opacity:.3,depthWrite:!1});i.color=r.color,this.edgeMaterial=r,this.meshMaterial=i,this.update()}update(){const e=this.mesh.geometry.boundsTree,t=e?e._roots.length:0;for(;this._roots.length>t;){const e=this._roots.pop();e.geometry.dispose(),this.remove(e)}for(let e=0;e<t;e++){if(e>=this._roots.length){const t=new MeshBVHRootVisualizer(this.mesh,this.edgeMaterial,this.depth,e);this.add(t),this._roots.push(t)}const t=this._roots[e];t.depth=this.depth,t.mesh=this.mesh,t.displayParents=this.displayParents,t.displayEdges=this.displayEdges,t.material=this.displayEdges?this.edgeMaterial:this.meshMaterial,t.update()}}updateMatrixWorld(...e){this.position.copy(this.mesh.position),this.rotation.copy(this.mesh.rotation),this.scale.copy(this.mesh.scale),super.updateMatrixWorld(...e)}copy(e){this.depth=e.depth,this.mesh=e.mesh}clone(){return new MeshBVHVisualizer(this.mesh,this.depth)}dispose(){this.edgeMaterial.dispose(),this.meshMaterial.dispose();const e=this.children;for(let t=0,r=e.length;t<r;t++)e[t].geometry.dispose()}}const at=new n.Box3,lt=new n.Box3,ct=new n.Vector3;function ut(e){switch(typeof e){case"number":return 8;case"string":return 2*e.length;case"boolean":return 4;default:return 0}}function dt(e){return e._roots.map(((t,r)=>function(e,t){const r={nodeCount:0,leafNodeCount:0,depth:{min:1/0,max:-1/0},tris:{min:1/0,max:-1/0},splits:[0,0,0],surfaceAreaScore:0};return e.traverse(((e,t,n,i,s)=>{const o=n[3]-n[0],a=n[4]-n[1],l=n[5]-n[2],c=2*(o*a+a*l+l*o);r.nodeCount++,t?(r.leafNodeCount++,r.depth.min=Math.min(e,r.depth.min),r.depth.max=Math.max(e,r.depth.max),r.tris.min=Math.min(s,r.tris.min),r.tris.max=Math.max(s,r.tris.max),r.surfaceAreaScore+=c*u*s):(r.splits[i]++,r.surfaceAreaScore+=c*d)}),t),r.tris.min===1/0&&(r.tris.min=0,r.tris.max=0),r.depth.min===1/0&&(r.depth.min=0,r.depth.max=0),r}(e,r)))}function ht(e){const t=new Set,r=[e];let n=0;for(;r.length;){const e=r.pop();if(!t.has(e)){t.add(e);for(let t in e){if(!e.hasOwnProperty(t))continue;n+=ut(t);const i=e[t];!i||"object"!=typeof i&&"function"!=typeof i?n+=ut(i):/(Uint|Int|Float)(8|16|32)Array/.test(i.constructor.name)||i instanceof ArrayBuffer?n+=i.byteLength:r.push(i)}}}return n}function pt(e){const t=e.geometry,r=[],n=t.index,i=t.getAttribute("position");let s=!0;return e.traverse(((e,t,o,a,l)=>{const c={depth:e,isLeaf:t,boundingData:o,offset:a,count:l};r[e]=c,f(0,o,at);const u=r[e-1];if(t)for(let e=3*a,t=3*(a+l);e<t;e+=3){const t=n.getX(e),r=n.getX(e+1),o=n.getX(e+2);let a;ct.fromBufferAttribute(i,t),a=at.containsPoint(ct),ct.fromBufferAttribute(i,r),a=a&&at.containsPoint(ct),ct.fromBufferAttribute(i,o),a=a&&at.containsPoint(ct),console.assert(a,"Leaf bounds does not fully contain triangle."),s=s&&a}if(u){f(0,o,lt);const e=lt.containsBox(at);console.assert(e,"Parent bounds does not fully contain child."),s=s&&e}})),s}function mt(e){const t=[];return e.traverse(((e,r,i,s,o)=>{const a={bounds:f(0,i,new n.Box3)};r?(a.count=o,a.offset=s):(a.left=null,a.right=null),t[e]=a;const l=t[e-1];l&&(null===l.left?l.left=a:l.right=a)})),t[0]}const ft=new n.Ray,gt=new n.Matrix4,yt=n.Mesh.prototype.raycast;function bt(e,t){if(this.geometry.boundsTree){if(void 0===this.material)return;gt.copy(this.matrixWorld).invert(),ft.copy(e.ray).applyMatrix4(gt);const r=this.geometry.boundsTree;if(!0===e.firstHitOnly){const n=le(r.raycastFirst(ft,this.material),this,e);n&&t.push(n)}else{const n=r.raycast(ft,this.material);for(let r=0,i=n.length;r<i;r++){const i=le(n[r],this,e);i&&t.push(i)}}}else yt.call(this,e,t)}function vt(e){return this.boundsTree=new MeshBVH(this,e),this.boundsTree}function _t(){this.boundsTree=null}function xt(e){switch(e){case 1:return n.RedIntegerFormat;case 2:return n.RGIntegerFormat;case 3:case 4:return n.RGBAIntegerFormat}}class VertexAttributeTexture extends n.DataTexture{constructor(){super(),this.minFilter=n.NearestFilter,this.magFilter=n.NearestFilter,this.generateMipmaps=!1,this.overrideItemSize=null,this._forcedType=null}updateFrom(e){const t=this.overrideItemSize,r=e.itemSize,i=e.count;if(null!==t){if(r*i%t!=0)throw new Error("VertexAttributeTexture: overrideItemSize must divide evenly into buffer length.");e.itemSize=t,e.count=i*r/t}const s=e.itemSize,o=e.count,a=e.normalized,l=e.array.constructor,c=l.BYTES_PER_ELEMENT;let u,d,h,p,m=this._forcedType,f=s;if(null===m)switch(l){case Float32Array:m=n.FloatType;break;case Uint8Array:case Uint16Array:case Uint32Array:m=n.UnsignedIntType;break;case Int8Array:case Int16Array:case Int32Array:m=n.IntType}let g=function(e){switch(e){case 1:return"R";case 2:return"RG";case 3:case 4:return"RGBA"}throw new Error}(s);switch(m){case n.FloatType:h=1,d=function(e){switch(e){case 1:return n.RedFormat;case 2:return n.RGFormat;case 3:case 4:return n.RGBAFormat}}(s),a&&1===c?(p=l,g+="8",l===Uint8Array?u=n.UnsignedByteType:(u=n.ByteType,g+="_SNORM")):(p=Float32Array,g+="32F",u=n.FloatType);break;case n.IntType:g+=8*c+"I",h=a?Math.pow(2,8*l.BYTES_PER_ELEMENT-1):1,d=xt(s),1===c?(p=Int8Array,u=n.ByteType):2===c?(p=Int16Array,u=n.ShortType):(p=Int32Array,u=n.IntType);break;case n.UnsignedIntType:g+=8*c+"UI",h=a?Math.pow(2,8*l.BYTES_PER_ELEMENT-1):1,d=xt(s),1===c?(p=Uint8Array,u=n.UnsignedByteType):2===c?(p=Uint16Array,u=n.UnsignedShortType):(p=Uint32Array,u=n.UnsignedIntType)}3!==f||d!==n.RGBAFormat&&d!==n.RGBAIntegerFormat||(f=4);const y=Math.ceil(Math.sqrt(o)),b=new p(f*y*y),v=e.normalized;e.normalized=!1;for(let t=0;t<o;t++){const r=f*t;b[r]=e.getX(t)/h,s>=2&&(b[r+1]=e.getY(t)/h),s>=3&&(b[r+2]=e.getZ(t)/h,4===f&&(b[r+3]=1)),s>=4&&(b[r+3]=e.getW(t)/h)}e.normalized=v,this.internalFormat=g,this.format=d,this.type=u,this.image.width=y,this.image.height=y,this.image.data=b,this.needsUpdate=!0,this.dispose(),e.itemSize=r,e.count=i}}class UIntVertexAttributeTexture extends VertexAttributeTexture{constructor(){super(),this._forcedType=n.UnsignedIntType}}class IntVertexAttributeTexture extends VertexAttributeTexture{constructor(){super(),this._forcedType=n.IntType}}class FloatVertexAttributeTexture extends VertexAttributeTexture{constructor(){super(),this._forcedType=n.FloatType}}class MeshBVHUniformStruct{constructor(){this.autoDispose=!0,this.index=new UIntVertexAttributeTexture,this.position=new FloatVertexAttributeTexture,this.bvhBounds=new n.DataTexture,this.bvhContents=new n.DataTexture,this.index.overrideItemSize=3}updateFrom(e){const{geometry:t}=e;!function(e,t,r){const i=e._roots;if(1!==i.length)throw new Error("MeshBVHUniformStruct: Multi-root BVHs not supported.");const s=i[0],o=new Uint16Array(s),a=new Uint32Array(s),l=new Float32Array(s),c=s.byteLength/h,u=2*Math.ceil(Math.sqrt(c/2)),d=new Float32Array(4*u*u),p=Math.ceil(Math.sqrt(c)),m=new Uint32Array(2*p*p);for(let e=0;e<c;e++){const t=e*h/4,r=2*t,n=t;for(let t=0;t<3;t++)d[8*e+0+t]=l[n+0+t],d[8*e+4+t]=l[n+3+t];if(IS_LEAF(r,o)){const n=COUNT(r,o),i=OFFSET(t,a),s=4294901760|n;m[2*e+0]=s,m[2*e+1]=i}else{const r=4*RIGHT_NODE(t,a)/h,n=SPLIT_AXIS(t,a);m[2*e+0]=n,m[2*e+1]=r}}t.image.data=d,t.image.width=u,t.image.height=u,t.format=n.RGBAFormat,t.type=n.FloatType,t.internalFormat="RGBA32F",t.minFilter=n.NearestFilter,t.magFilter=n.NearestFilter,t.generateMipmaps=!1,t.needsUpdate=!0,t.dispose(),r.image.data=m,r.image.width=p,r.image.height=p,r.format=n.RGIntegerFormat,r.type=n.UnsignedIntType,r.internalFormat="RG32UI",r.minFilter=n.NearestFilter,r.magFilter=n.NearestFilter,r.generateMipmaps=!1,r.needsUpdate=!0,r.dispose()}(e,this.bvhBounds,this.bvhContents),this.index.updateFrom(t.index),this.position.updateFrom(t.attributes.position)}dispose(){const{index:e,position:t,bvhBounds:r,bvhContents:n}=this;e&&e.dispose(),t&&t.dispose(),r&&r.dispose(),n&&n.dispose()}}const wt="\n#ifndef TRI_INTERSECT_EPSILON\n#define TRI_INTERSECT_EPSILON 1e-5\n#endif\n\n#ifndef INFINITY\n#define INFINITY 1e20\n#endif\n\nstruct BVH {\n\n\tusampler2D index;\n\tsampler2D position;\n\n\tsampler2D bvhBounds;\n\tusampler2D bvhContents;\n\n};\n",St="\n\n// Utilities\nuvec4 uTexelFetch1D( usampler2D tex, uint index ) {\n\n\tuint width = uint( textureSize( tex, 0 ).x );\n\tuvec2 uv;\n\tuv.x = index % width;\n\tuv.y = index / width;\n\n\treturn texelFetch( tex, ivec2( uv ), 0 );\n\n}\n\nivec4 iTexelFetch1D( isampler2D tex, uint index ) {\n\n\tuint width = uint( textureSize( tex, 0 ).x );\n\tuvec2 uv;\n\tuv.x = index % width;\n\tuv.y = index / width;\n\n\treturn texelFetch( tex, ivec2( uv ), 0 );\n\n}\n\nvec4 texelFetch1D( sampler2D tex, uint index ) {\n\n\tuint width = uint( textureSize( tex, 0 ).x );\n\tuvec2 uv;\n\tuv.x = index % width;\n\tuv.y = index / width;\n\n\treturn texelFetch( tex, ivec2( uv ), 0 );\n\n}\n\nvec4 textureSampleBarycoord( sampler2D tex, vec3 barycoord, uvec3 faceIndices ) {\n\n\treturn\n\t\tbarycoord.x * texelFetch1D( tex, faceIndices.x ) +\n\t\tbarycoord.y * texelFetch1D( tex, faceIndices.y ) +\n\t\tbarycoord.z * texelFetch1D( tex, faceIndices.z );\n\n}\n\nvoid ndcToCameraRay(\n\tvec2 coord, mat4 cameraWorld, mat4 invProjectionMatrix,\n\tout vec3 rayOrigin, out vec3 rayDirection\n) {\n\n\t// get camera look direction and near plane for camera clipping\n\tvec4 lookDirection = cameraWorld * vec4( 0.0, 0.0, - 1.0, 0.0 );\n\tvec4 nearVector = invProjectionMatrix * vec4( 0.0, 0.0, - 1.0, 1.0 );\n\tfloat near = abs( nearVector.z / nearVector.w );\n\n\t// get the camera direction and position from camera matrices\n\tvec4 origin = cameraWorld * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec4 direction = invProjectionMatrix * vec4( coord, 0.5, 1.0 );\n\tdirection /= direction.w;\n\tdirection = cameraWorld * direction - origin;\n\n\t// slide the origin along the ray until it sits at the near clip plane position\n\torigin.xyz += direction.xyz * near / dot( direction, lookDirection );\n\n\trayOrigin = origin.xyz;\n\trayDirection = direction.xyz;\n\n}\n\n// Raycasting\nfloat intersectsBounds( vec3 rayOrigin, vec3 rayDirection, vec3 boundsMin, vec3 boundsMax ) {\n\n\t// https://www.reddit.com/r/opengl/comments/8ntzz5/fast_glsl_ray_box_intersection/\n\t// https://tavianator.com/2011/ray_box.html\n\tvec3 invDir = 1.0 / rayDirection;\n\n\t// find intersection distances for each plane\n\tvec3 tMinPlane = invDir * ( boundsMin - rayOrigin );\n\tvec3 tMaxPlane = invDir * ( boundsMax - rayOrigin );\n\n\t// get the min and max distances from each intersection\n\tvec3 tMinHit = min( tMaxPlane, tMinPlane );\n\tvec3 tMaxHit = max( tMaxPlane, tMinPlane );\n\n\t// get the furthest hit distance\n\tvec2 t = max( tMinHit.xx, tMinHit.yz );\n\tfloat t0 = max( t.x, t.y );\n\n\t// get the minimum hit distance\n\tt = min( tMaxHit.xx, tMaxHit.yz );\n\tfloat t1 = min( t.x, t.y );\n\n\t// set distance to 0.0 if the ray starts inside the box\n\tfloat dist = max( t0, 0.0 );\n\n\treturn t1 >= dist ? dist : INFINITY;\n\n}\n\nbool intersectsTriangle(\n\tvec3 rayOrigin, vec3 rayDirection, vec3 a, vec3 b, vec3 c,\n\tout vec3 barycoord, out vec3 norm, out float dist, out float side\n) {\n\n\t// https://stackoverflow.com/questions/42740765/intersection-between-line-and-triangle-in-3d\n\tvec3 edge1 = b - a;\n\tvec3 edge2 = c - a;\n\tnorm = cross( edge1, edge2 );\n\n\tfloat det = - dot( rayDirection, norm );\n\tfloat invdet = 1.0 / det;\n\n\tvec3 AO = rayOrigin - a;\n\tvec3 DAO = cross( AO, rayDirection );\n\n\tvec4 uvt;\n\tuvt.x = dot( edge2, DAO ) * invdet;\n\tuvt.y = - dot( edge1, DAO ) * invdet;\n\tuvt.z = dot( AO, norm ) * invdet;\n\tuvt.w = 1.0 - uvt.x - uvt.y;\n\n\t// set the hit information\n\tbarycoord = uvt.wxy; // arranged in A, B, C order\n\tdist = uvt.z;\n\tside = sign( det );\n\tnorm = side * normalize( norm );\n\n\t// add an epsilon to avoid misses between triangles\n\tuvt += vec4( TRI_INTERSECT_EPSILON );\n\n\treturn all( greaterThanEqual( uvt, vec4( 0.0 ) ) );\n\n}\n\nbool intersectTriangles(\n\tBVH bvh, vec3 rayOrigin, vec3 rayDirection, uint offset, uint count,\n\tinout float minDistance,\n\n\t// output variables\n\tout uvec4 faceIndices, out vec3 faceNormal, out vec3 barycoord,\n\tout float side, out float dist\n) {\n\n\tbool found = false;\n\tvec3 localBarycoord, localNormal;\n\tfloat localDist, localSide;\n\tfor ( uint i = offset, l = offset + count; i < l; i ++ ) {\n\n\t\tuvec3 indices = uTexelFetch1D( bvh.index, i ).xyz;\n\t\tvec3 a = texelFetch1D( bvh.position, indices.x ).rgb;\n\t\tvec3 b = texelFetch1D( bvh.position, indices.y ).rgb;\n\t\tvec3 c = texelFetch1D( bvh.position, indices.z ).rgb;\n\n\t\tif (\n\t\t\tintersectsTriangle( rayOrigin, rayDirection, a, b, c, localBarycoord, localNormal, localDist, localSide )\n\t\t\t&& localDist < minDistance\n\t\t) {\n\n\t\t\tfound = true;\n\t\t\tminDistance = localDist;\n\n\t\t\tfaceIndices = uvec4( indices.xyz, i );\n\t\t\tfaceNormal = localNormal;\n\n\t\t\tside = localSide;\n\t\t\tbarycoord = localBarycoord;\n\t\t\tdist = localDist;\n\n\t\t}\n\n\t}\n\n\treturn found;\n\n}\n\nfloat intersectsBVHNodeBounds( vec3 rayOrigin, vec3 rayDirection, BVH bvh, uint currNodeIndex ) {\n\n\tvec3 boundsMin = texelFetch1D( bvh.bvhBounds, currNodeIndex * 2u + 0u ).xyz;\n\tvec3 boundsMax = texelFetch1D( bvh.bvhBounds, currNodeIndex * 2u + 1u ).xyz;\n\treturn intersectsBounds( rayOrigin, rayDirection, boundsMin, boundsMax );\n\n}\n\nbool bvhIntersectFirstHit(\n\tBVH bvh, vec3 rayOrigin, vec3 rayDirection,\n\n\t// output variables\n\tout uvec4 faceIndices, out vec3 faceNormal, out vec3 barycoord,\n\tout float side, out float dist\n) {\n\n\t// stack needs to be twice as long as the deepest tree we expect because\n\t// we push both the left and right child onto the stack every traversal\n\tint ptr = 0;\n\tuint stack[ 60 ];\n\tstack[ 0 ] = 0u;\n\n\tfloat triangleDistance = 1e20;\n\tbool found = false;\n\twhile ( ptr > - 1 && ptr < 60 ) {\n\n\t\tuint currNodeIndex = stack[ ptr ];\n\t\tptr --;\n\n\t\t// check if we intersect the current bounds\n\t\tfloat boundsHitDistance = intersectsBVHNodeBounds( rayOrigin, rayDirection, bvh, currNodeIndex );\n\t\tif ( boundsHitDistance == INFINITY || boundsHitDistance > triangleDistance ) {\n\n\t\t\tcontinue;\n\n\t\t}\n\n\t\tuvec2 boundsInfo = uTexelFetch1D( bvh.bvhContents, currNodeIndex ).xy;\n\t\tbool isLeaf = bool( boundsInfo.x & 0xffff0000u );\n\n\t\tif ( isLeaf ) {\n\n\t\t\tuint count = boundsInfo.x & 0x0000ffffu;\n\t\t\tuint offset = boundsInfo.y;\n\n\t\t\tfound = intersectTriangles(\n\t\t\t\tbvh, rayOrigin, rayDirection, offset, count, triangleDistance,\n\t\t\t\tfaceIndices, faceNormal, barycoord, side, dist\n\t\t\t) || found;\n\n\t\t} else {\n\n\t\t\tuint leftIndex = currNodeIndex + 1u;\n\t\t\tuint splitAxis = boundsInfo.x & 0x0000ffffu;\n\t\t\tuint rightIndex = boundsInfo.y;\n\n\t\t\tbool leftToRight = rayDirection[ splitAxis ] >= 0.0;\n\t\t\tuint c1 = leftToRight ? leftIndex : rightIndex;\n\t\t\tuint c2 = leftToRight ? rightIndex : leftIndex;\n\n\t\t\t// set c2 in the stack so we traverse it later. We need to keep track of a pointer in\n\t\t\t// the stack while we traverse. The second pointer added is the one that will be\n\t\t\t// traversed first\n\t\t\tptr ++;\n\t\t\tstack[ ptr ] = c2;\n\n\t\t\tptr ++;\n\t\t\tstack[ ptr ] = c1;\n\n\t\t}\n\n\t}\n\n\treturn found;\n\n}\n",Pt="\n\nfloat dot2( in vec3 v ) {\n\n\treturn dot( v, v );\n\n}\n\n\n// https://www.shadertoy.com/view/ttfGWl\nvec3 closestPointToTriangle( vec3 p, vec3 v0, vec3 v1, vec3 v2, out vec3 barycoord ) {\n\n    vec3 v10 = v1 - v0;\n    vec3 v21 = v2 - v1;\n    vec3 v02 = v0 - v2;\n\n\tvec3 p0 = p - v0;\n\tvec3 p1 = p - v1;\n\tvec3 p2 = p - v2;\n\n    vec3 nor = cross( v10, v02 );\n\n    // method 2, in barycentric space\n    vec3  q = cross( nor, p0 );\n    float d = 1.0 / dot2( nor );\n    float u = d * dot( q, v02 );\n    float v = d * dot( q, v10 );\n    float w = 1.0 - u - v;\n\n\tif( u < 0.0 ) {\n\n\t\tw = clamp( dot( p2, v02 ) / dot2( v02 ), 0.0, 1.0 );\n\t\tu = 0.0;\n\t\tv = 1.0 - w;\n\n\t} else if( v < 0.0 ) {\n\n\t\tu = clamp( dot( p0, v10 ) / dot2( v10 ), 0.0, 1.0 );\n\t\tv = 0.0;\n\t\tw = 1.0 - u;\n\n\t} else if( w < 0.0 ) {\n\n\t\tv = clamp( dot( p1, v21 ) / dot2( v21 ), 0.0, 1.0 );\n\t\tw = 0.0;\n\t\tu = 1.0-v;\n\n\t}\n\n\tbarycoord = vec3( u, v, w );\n    return u * v1 + v * v2 + w * v0;\n\n}\n\nfloat distanceToTriangles(\n\tBVH bvh, vec3 point, uint offset, uint count, float closestDistanceSquared,\n\n\tout uvec4 faceIndices, out vec3 faceNormal, out vec3 barycoord, out float side, out vec3 outPoint\n) {\n\n\tbool found = false;\n\tuvec3 localIndices;\n\tvec3 localBarycoord;\n\tvec3 localNormal;\n\tfor ( uint i = offset, l = offset + count; i < l; i ++ ) {\n\n\t\tuvec3 indices = uTexelFetch1D( bvh.index, i ).xyz;\n\t\tvec3 a = texelFetch1D( bvh.position, indices.x ).rgb;\n\t\tvec3 b = texelFetch1D( bvh.position, indices.y ).rgb;\n\t\tvec3 c = texelFetch1D( bvh.position, indices.z ).rgb;\n\n\t\t// get the closest point and barycoord\n\t\tvec3 closestPoint = closestPointToTriangle( point, a, b, c, localBarycoord );\n\t\tvec3 delta = point - closestPoint;\n\t\tfloat sqDist = dot2( delta );\n\t\tif ( sqDist < closestDistanceSquared ) {\n\n\t\t\t// set the output results\n\t\t\tclosestDistanceSquared = sqDist;\n\t\t\tfaceIndices = uvec4( indices.xyz, i );\n\t\t\tfaceNormal = normalize( cross( a - b, b - c ) );\n\t\t\tbarycoord = localBarycoord;\n\t\t\toutPoint = closestPoint;\n\t\t\tside = sign( dot( faceNormal, delta ) );\n\n\t\t}\n\n\t}\n\n\treturn closestDistanceSquared;\n\n}\n\nfloat distanceSqToBounds( vec3 point, vec3 boundsMin, vec3 boundsMax ) {\n\n\tvec3 clampedPoint = clamp( point, boundsMin, boundsMax );\n\tvec3 delta = point - clampedPoint;\n\treturn dot( delta, delta );\n\n}\n\nfloat distanceSqToBVHNodeBoundsPoint( vec3 point, BVH bvh, uint currNodeIndex ) {\n\n\tvec3 boundsMin = texelFetch1D( bvh.bvhBounds, currNodeIndex * 2u + 0u ).xyz;\n\tvec3 boundsMax = texelFetch1D( bvh.bvhBounds, currNodeIndex * 2u + 1u ).xyz;\n\treturn distanceSqToBounds( point, boundsMin, boundsMax );\n\n}\n\nfloat bvhClosestPointToPoint(\n\tBVH bvh, vec3 point,\n\n\t// output variables\n\tout uvec4 faceIndices, out vec3 faceNormal, out vec3 barycoord,\n\tout float side, out vec3 outPoint\n ) {\n\n\t// stack needs to be twice as long as the deepest tree we expect because\n\t// we push both the left and right child onto the stack every traversal\n\tint ptr = 0;\n\tuint stack[ 60 ];\n\tstack[ 0 ] = 0u;\n\tfloat closestDistanceSquared = pow( 100000.0, 2.0 );\n\tbool found = false;\n\twhile ( ptr > - 1 && ptr < 60 ) {\n\n\t\tuint currNodeIndex = stack[ ptr ];\n\t\tptr --;\n\n\t\t// check if we intersect the current bounds\n\t\tfloat boundsHitDistance = distanceSqToBVHNodeBoundsPoint( point, bvh, currNodeIndex );\n\t\tif ( boundsHitDistance > closestDistanceSquared ) {\n\n\t\t\tcontinue;\n\n\t\t}\n\n\t\tuvec2 boundsInfo = uTexelFetch1D( bvh.bvhContents, currNodeIndex ).xy;\n\t\tbool isLeaf = bool( boundsInfo.x & 0xffff0000u );\n\t\tif ( isLeaf ) {\n\n\t\t\tuint count = boundsInfo.x & 0x0000ffffu;\n\t\t\tuint offset = boundsInfo.y;\n\t\t\tclosestDistanceSquared = distanceToTriangles(\n\t\t\t\tbvh, point, offset, count, closestDistanceSquared,\n\n\t\t\t\t// outputs\n\t\t\t\tfaceIndices, faceNormal, barycoord, side, outPoint\n\t\t\t);\n\n\t\t} else {\n\n\t\t\tuint leftIndex = currNodeIndex + 1u;\n\t\t\tuint splitAxis = boundsInfo.x & 0x0000ffffu;\n\t\t\tuint rightIndex = boundsInfo.y;\n\t\t\tbool leftToRight = distanceSqToBVHNodeBoundsPoint( point, bvh, leftIndex ) < distanceSqToBVHNodeBoundsPoint( point, bvh, rightIndex );//rayDirection[ splitAxis ] >= 0.0;\n\t\t\tuint c1 = leftToRight ? leftIndex : rightIndex;\n\t\t\tuint c2 = leftToRight ? rightIndex : leftIndex;\n\n\t\t\t// set c2 in the stack so we traverse it later. We need to keep track of a pointer in\n\t\t\t// the stack while we traverse. The second pointer added is the one that will be\n\t\t\t// traversed first\n\t\t\tptr ++;\n\t\t\tstack[ ptr ] = c2;\n\t\t\tptr ++;\n\t\t\tstack[ ptr ] = c1;\n\n\t\t}\n\n\t}\n\n\treturn sqrt( closestDistanceSquared );\n\n}\n",Et=new n.Vector3,Mt=new n.Vector3,Ct=new n.Vector3,At=new n.Vector4,Tt=new n.Vector3,Dt=new n.Vector3,Ot=new n.Vector4,Rt=new n.Vector4,Lt=new n.Matrix4,kt=new n.Matrix4;function Nt(e,t){if(!e&&!t)return;const r=e.count===t.count,n=e.normalized===t.normalized,i=e.array.constructor===t.array.constructor,s=e.itemSize===t.itemSize;if(!(r&&n&&i&&s))throw new Error}function Ft(e,t=null){const r=e.array.constructor,i=e.normalized,s=e.itemSize,o=null===t?e.count:t;return new n.BufferAttribute(new r(s*o),s,i)}function It(e,t,r=0){if(e.isInterleavedBufferAttribute){const n=e.itemSize;for(let i=0,s=e.count;i<s;i++){const s=i+r;t.setX(s,e.getX(i)),n>=2&&t.setY(s,e.getY(i)),n>=3&&t.setZ(s,e.getZ(i)),n>=4&&t.setW(s,e.getW(i))}}else{const n=t.array,i=n.constructor,s=n.BYTES_PER_ELEMENT*e.itemSize*r;new i(n.buffer,s,e.array.length).set(e.array)}}function Bt(e,t,r){const n=e.elements,i=t.elements;for(let e=0,t=i.length;e<t;e++)n[e]+=i[e]*r}function jt(e,t,r){const n=e.skeleton,i=e.geometry,s=n.bones,o=n.boneInverses;Ot.fromBufferAttribute(i.attributes.skinIndex,t),Rt.fromBufferAttribute(i.attributes.skinWeight,t),Lt.elements.fill(0);for(let e=0;e<4;e++){const t=Rt.getComponent(e);if(0!==t){const r=Ot.getComponent(e);kt.multiplyMatrices(s[r].matrixWorld,o[r]),Bt(Lt,kt,t)}}return Lt.multiply(e.bindMatrix).premultiply(e.bindMatrixInverse),r.transformDirection(Lt),r}function Ht(e,t,r,n,i){Tt.set(0,0,0);for(let s=0,o=e.length;s<o;s++){const o=t[s],a=e[s];0!==o&&(Dt.fromBufferAttribute(a,n),r?Tt.addScaledVector(Dt,o):Tt.addScaledVector(Dt.sub(i),o))}i.add(Tt)}class GeometryDiff{constructor(e){this.matrixWorld=new n.Matrix4,this.geometryHash=null,this.boneMatrices=null,this.primitiveCount=-1,this.mesh=e,this.update()}update(){const e=this.mesh,t=e.geometry,r=e.skeleton,n=(t.index?t.index.count:t.attributes.position.count)/3;if(this.matrixWorld.copy(e.matrixWorld),this.geometryHash=t.attributes.position.version,this.primitiveCount=n,r){r.boneTexture||r.computeBoneTexture(),r.update();const e=r.boneMatrices;this.boneMatrices&&this.boneMatrices.length===e.length?this.boneMatrices.set(e):this.boneMatrices=e.slice()}else this.boneMatrices=null}didChange(){const e=this.mesh,t=e.geometry,r=(t.index?t.index.count:t.attributes.position.count)/3;return!(this.matrixWorld.equals(e.matrixWorld)&&this.geometryHash===t.attributes.position.version&&function(e,t){if(null===e||null===t)return e===t;if(e.length!==t.length)return!1;for(let r=0,n=e.length;r<n;r++)if(e[r]!==t[r])return!1;return!0}(e.skeleton&&e.skeleton.boneMatrices||null,this.boneMatrices)&&this.primitiveCount===r)}}class StaticGeometryGenerator{constructor(e){Array.isArray(e)||(e=[e]);const t=[];e.forEach((e=>{e.traverseVisible((e=>{e.isMesh&&t.push(e)}))})),this.meshes=t,this.useGroups=!0,this.applyWorldTransforms=!0,this.attributes=["position","normal","color","tangent","uv","uv2"],this._intermediateGeometry=new Array(t.length).fill().map((()=>new n.BufferGeometry)),this._diffMap=new WeakMap}getMaterials(){const e=[];return this.meshes.forEach((t=>{Array.isArray(t.material)?e.push(...t.material):e.push(t.material)})),e}generate(e=new n.BufferGeometry){let t=[];const{meshes:r,useGroups:i,_intermediateGeometry:s,_diffMap:o}=this;for(let e=0,n=r.length;e<n;e++){const n=r[e],i=s[e],a=o.get(n);!a||a.didChange(n)?(this._convertToStaticGeometry(n,i),t.push(!1),a?a.update():o.set(n,new GeometryDiff(n))):t.push(!0)}!function(e,t={useGroups:!1,updateIndex:!1,skipAttributes:[]},r=new n.BufferGeometry){const i=null!==e[0].index,{useGroups:s=!1,updateIndex:o=!1,skipAttributes:a=[]}=t,l=new Set(Object.keys(e[0].attributes)),c={};let u=0;r.clearGroups();for(let t=0;t<e.length;++t){const n=e[t];let o=0;if(i!==(null!==n.index))throw new Error("StaticGeometryGenerator: All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them.");for(const e in n.attributes){if(!l.has(e))throw new Error('StaticGeometryGenerator: All geometries must have compatible attributes; make sure "'+e+'" attribute exists among all geometries, or in none of them.');void 0===c[e]&&(c[e]=[]),c[e].push(n.attributes[e]),o++}if(o!==l.size)throw new Error("StaticGeometryGenerator: Make sure all geometries have the same number of attributes.");if(s){let e;if(i)e=n.index.count;else{if(void 0===n.attributes.position)throw new Error("StaticGeometryGenerator: The geometry must have either an index or a position attribute");e=n.attributes.position.count}r.addGroup(u,e,t),u+=e}}if(i){let t=!1;if(!r.index){let i=0;for(let t=0;t<e.length;++t)i+=e[t].index.count;r.setIndex(new n.BufferAttribute(new Uint32Array(i),1,!1)),t=!0}if(o||t){const t=r.index;let n=0,i=0;for(let r=0;r<e.length;++r){const s=e[r],o=s.index;if(!0!==a[r])for(let e=0;e<o.count;++e)t.setX(n,o.getX(e)+i),n++;i+=s.attributes.position.count}}}for(const e in c){const t=c[e];if(!(e in r.attributes)){let n=0;for(const e in t)n+=t[e].count;r.setAttribute(e,Ft(c[e][0],n))}const n=r.attributes[e];let i=0;for(let e=0,r=t.length;e<r;e++){const r=t[e];!0!==a[e]&&It(r,n,i),i+=r.count}}}(s,{useGroups:i,skipAttributes:t},e);for(const t in e.attributes)e.attributes[t].needsUpdate=!0;return e}_convertToStaticGeometry(e,t=new n.BufferGeometry){const r=e.geometry,i=this.applyWorldTransforms,s=this.attributes.includes("normal"),o=this.attributes.includes("tangent"),a=r.attributes,l=t.attributes;t.index||(t.index=r.index),l.position||t.setAttribute("position",Ft(a.position)),s&&!l.normal&&a.normal&&t.setAttribute("normal",Ft(a.normal)),o&&!l.tangent&&a.tangent&&t.setAttribute("tangent",Ft(a.tangent)),Nt(r.index,t.index),Nt(a.position,l.position),s&&Nt(a.normal,l.normal),o&&Nt(a.tangent,l.tangent);const c=a.position,u=s?a.normal:null,d=o?a.tangent:null,h=r.morphAttributes.position,p=r.morphAttributes.normal,m=r.morphAttributes.tangent,f=r.morphTargetsRelative,g=e.morphTargetInfluences,y=new n.Matrix3;y.getNormalMatrix(e.matrixWorld);for(let t=0,r=a.position.count;t<r;t++)Et.fromBufferAttribute(c,t),u&&Mt.fromBufferAttribute(u,t),d&&(At.fromBufferAttribute(d,t),Ct.fromBufferAttribute(d,t)),g&&(h&&Ht(h,g,f,t,Et),p&&Ht(p,g,f,t,Mt),m&&Ht(m,g,f,t,Ct)),e.isSkinnedMesh&&(e.boneTransform(t,Et),u&&jt(e,t,Mt),d&&jt(e,t,Ct)),i&&Et.applyMatrix4(e.matrixWorld),l.position.setXYZ(t,Et.x,Et.y,Et.z),u&&(i&&Mt.applyNormalMatrix(y),l.normal.setXYZ(t,Mt.x,Mt.y,Mt.z)),d&&(i&&Ct.transformDirection(e.matrixWorld),l.tangent.setXYZW(t,Ct.x,Ct.y,Ct.z,At.w));for(const e in this.attributes){const r=this.attributes[e];"position"!==r&&"tangent"!==r&&"normal"!==r&&r in a&&(l[r]||t.setAttribute(r,Ft(a[r])),Nt(a[r],l[r]),It(a[r],l[r]))}return t}}},28019:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ACESFilmicToneMapping:()=>Re,AddEquation:()=>R,AddOperation:()=>xe,AdditiveAnimationBlendMode:()=>xr,AdditiveBlending:()=>v,AgXToneMapping:()=>Ie,AlphaFormat:()=>wt,AlwaysCompare:()=>ln,AlwaysDepth:()=>he,AlwaysStencilFunc:()=>Qr,AmbientLight:()=>AmbientLight,AnimationAction:()=>AnimationAction,AnimationClip:()=>AnimationClip,AnimationLoader:()=>AnimationLoader,AnimationMixer:()=>AnimationMixer,AnimationObjectGroup:()=>AnimationObjectGroup,AnimationUtils:()=>zu,ArcCurve:()=>ArcCurve,ArrayCamera:()=>ArrayCamera,ArrowHelper:()=>ArrowHelper,AttachedBindMode:()=>He,Audio:()=>Audio,AudioAnalyser:()=>AudioAnalyser,AudioContext:()=>AudioContext,AudioListener:()=>AudioListener,AudioLoader:()=>AudioLoader,AxesHelper:()=>AxesHelper,BackSide:()=>f,BasicDepthPacking:()=>Er,BasicShadowMap:()=>u,BatchedMesh:()=>BatchedMesh,Bone:()=>Bone,BooleanKeyframeTrack:()=>BooleanKeyframeTrack,Box2:()=>Box2,Box3:()=>Box3,Box3Helper:()=>Box3Helper,BoxGeometry:()=>BoxGeometry,BoxHelper:()=>BoxHelper,BufferAttribute:()=>BufferAttribute,BufferGeometry:()=>BufferGeometry,BufferGeometryLoader:()=>BufferGeometryLoader,ByteType:()=>ht,Cache:()=>Wu,Camera:()=>Camera,CameraHelper:()=>CameraHelper,CanvasTexture:()=>CanvasTexture,CapsuleGeometry:()=>CapsuleGeometry,CatmullRomCurve3:()=>CatmullRomCurve3,CineonToneMapping:()=>Te,CircleGeometry:()=>CircleGeometry,ClampToEdgeWrapping:()=>Qe,Clock:()=>Clock,Color:()=>Color,ColorKeyframeTrack:()=>ColorKeyframeTrack,ColorManagement:()=>Zn,CompressedArrayTexture:()=>CompressedArrayTexture,CompressedCubeTexture:()=>CompressedCubeTexture,CompressedTexture:()=>CompressedTexture,CompressedTextureLoader:()=>CompressedTextureLoader,ConeGeometry:()=>ConeGeometry,ConstantAlphaFactor:()=>ce,ConstantColorFactor:()=>ae,CubeCamera:()=>CubeCamera,CubeReflectionMapping:()=>We,CubeRefractionMapping:()=>Ve,CubeTexture:()=>CubeTexture,CubeTextureLoader:()=>CubeTextureLoader,CubeUVReflectionMapping:()=>Xe,CubicBezierCurve:()=>CubicBezierCurve,CubicBezierCurve3:()=>CubicBezierCurve3,CubicInterpolant:()=>CubicInterpolant,CullFaceBack:()=>a,CullFaceFront:()=>l,CullFaceFrontBack:()=>c,CullFaceNone:()=>o,Curve:()=>Curve,CurvePath:()=>CurvePath,CustomBlending:()=>w,CustomToneMapping:()=>ke,CylinderGeometry:()=>CylinderGeometry,Cylindrical:()=>Cylindrical,Data3DTexture:()=>Data3DTexture,DataArrayTexture:()=>DataArrayTexture,DataTexture:()=>DataTexture,DataTextureLoader:()=>DataTextureLoader,DataUtils:()=>Ds,DecrementStencilOp:()=>zr,DecrementWrapStencilOp:()=>Wr,DefaultLoadingManager:()=>Vu,DepthFormat:()=>Mt,DepthStencilFormat:()=>Ct,DepthTexture:()=>DepthTexture,DetachedBindMode:()=>ze,DirectionalLight:()=>DirectionalLight,DirectionalLightHelper:()=>DirectionalLightHelper,DiscreteInterpolant:()=>DiscreteInterpolant,DisplayP3ColorSpace:()=>Rr,DodecahedronGeometry:()=>DodecahedronGeometry,DoubleSide:()=>g,DstAlphaFactor:()=>re,DstColorFactor:()=>ie,DynamicCopyUsage:()=>gn,DynamicDrawUsage:()=>un,DynamicReadUsage:()=>pn,EdgesGeometry:()=>EdgesGeometry,EllipseCurve:()=>EllipseCurve,EqualCompare:()=>rn,EqualDepth:()=>fe,EqualStencilFunc:()=>Zr,EquirectangularReflectionMapping:()=>qe,EquirectangularRefractionMapping:()=>$e,Euler:()=>Euler,EventDispatcher:()=>EventDispatcher,ExtrudeGeometry:()=>ExtrudeGeometry,FileLoader:()=>FileLoader,Float16BufferAttribute:()=>Float16BufferAttribute,Float32BufferAttribute:()=>Float32BufferAttribute,FloatType:()=>yt,Fog:()=>Fog,FogExp2:()=>FogExp2,FramebufferTexture:()=>FramebufferTexture,FrontSide:()=>m,Frustum:()=>Frustum,GLBufferAttribute:()=>GLBufferAttribute,GLSL1:()=>bn,GLSL3:()=>vn,GreaterCompare:()=>sn,GreaterDepth:()=>ye,GreaterEqualCompare:()=>an,GreaterEqualDepth:()=>ge,GreaterEqualStencilFunc:()=>Jr,GreaterStencilFunc:()=>Xr,GridHelper:()=>GridHelper,Group:()=>Group,HalfFloatType:()=>bt,HemisphereLight:()=>HemisphereLight,HemisphereLightHelper:()=>HemisphereLightHelper,IcosahedronGeometry:()=>IcosahedronGeometry,ImageBitmapLoader:()=>ImageBitmapLoader,ImageLoader:()=>ImageLoader,ImageUtils:()=>ImageUtils,IncrementStencilOp:()=>Ur,IncrementWrapStencilOp:()=>Gr,InstancedBufferAttribute:()=>InstancedBufferAttribute,InstancedBufferGeometry:()=>InstancedBufferGeometry,InstancedInterleavedBuffer:()=>InstancedInterleavedBuffer,InstancedMesh:()=>InstancedMesh,Int16BufferAttribute:()=>Int16BufferAttribute,Int32BufferAttribute:()=>Int32BufferAttribute,Int8BufferAttribute:()=>Int8BufferAttribute,IntType:()=>ft,InterleavedBuffer:()=>InterleavedBuffer,InterleavedBufferAttribute:()=>InterleavedBufferAttribute,Interpolant:()=>Interpolant,InterpolateDiscrete:()=>mr,InterpolateLinear:()=>fr,InterpolateSmooth:()=>gr,InvertStencilOp:()=>Vr,KeepStencilOp:()=>jr,KeyframeTrack:()=>KeyframeTrack,LOD:()=>LOD,LatheGeometry:()=>LatheGeometry,Layers:()=>Layers,LessCompare:()=>tn,LessDepth:()=>pe,LessEqualCompare:()=>nn,LessEqualDepth:()=>me,LessEqualStencilFunc:()=>Kr,LessStencilFunc:()=>$r,Light:()=>Light,LightProbe:()=>LightProbe,Line:()=>Line,Line3:()=>Line3,LineBasicMaterial:()=>LineBasicMaterial,LineCurve:()=>LineCurve,LineCurve3:()=>LineCurve3,LineDashedMaterial:()=>LineDashedMaterial,LineLoop:()=>LineLoop,LineSegments:()=>LineSegments,LinearDisplayP3ColorSpace:()=>Lr,LinearFilter:()=>ot,LinearInterpolant:()=>LinearInterpolant,LinearMipMapLinearFilter:()=>ut,LinearMipMapNearestFilter:()=>lt,LinearMipmapLinearFilter:()=>ct,LinearMipmapNearestFilter:()=>at,LinearSRGBColorSpace:()=>Or,LinearToneMapping:()=>Se,LinearTransfer:()=>kr,Loader:()=>Loader,LoaderUtils:()=>LoaderUtils,LoadingManager:()=>LoadingManager,LoopOnce:()=>dr,LoopPingPong:()=>pr,LoopRepeat:()=>hr,LuminanceAlphaFormat:()=>Et,LuminanceFormat:()=>Pt,MOUSE:()=>i,Material:()=>Material,MaterialLoader:()=>MaterialLoader,MathUtils:()=>Nn,Matrix3:()=>Matrix3,Matrix4:()=>Matrix4,MaxEquation:()=>q,Mesh:()=>Mesh,MeshBasicMaterial:()=>MeshBasicMaterial,MeshDepthMaterial:()=>MeshDepthMaterial,MeshDistanceMaterial:()=>MeshDistanceMaterial,MeshLambertMaterial:()=>MeshLambertMaterial,MeshMatcapMaterial:()=>MeshMatcapMaterial,MeshNormalMaterial:()=>MeshNormalMaterial,MeshPhongMaterial:()=>MeshPhongMaterial,MeshPhysicalMaterial:()=>MeshPhysicalMaterial,MeshStandardMaterial:()=>MeshStandardMaterial,MeshToonMaterial:()=>MeshToonMaterial,MinEquation:()=>z,MirroredRepeatWrapping:()=>et,MixOperation:()=>_e,MultiplyBlending:()=>x,MultiplyOperation:()=>ve,NearestFilter:()=>tt,NearestMipMapLinearFilter:()=>st,NearestMipMapNearestFilter:()=>nt,NearestMipmapLinearFilter:()=>it,NearestMipmapNearestFilter:()=>rt,NeutralToneMapping:()=>je,NeverCompare:()=>en,NeverDepth:()=>de,NeverStencilFunc:()=>qr,NoBlending:()=>y,NoColorSpace:()=>Tr,NoToneMapping:()=>we,NormalAnimationBlendMode:()=>_r,NormalBlending:()=>b,NotEqualCompare:()=>on,NotEqualDepth:()=>be,NotEqualStencilFunc:()=>Yr,NumberKeyframeTrack:()=>NumberKeyframeTrack,Object3D:()=>Object3D,ObjectLoader:()=>ObjectLoader,ObjectSpaceNormalMap:()=>Ar,OctahedronGeometry:()=>OctahedronGeometry,OneFactor:()=>Z,OneMinusConstantAlphaFactor:()=>ue,OneMinusConstantColorFactor:()=>le,OneMinusDstAlphaFactor:()=>ne,OneMinusDstColorFactor:()=>se,OneMinusSrcAlphaFactor:()=>te,OneMinusSrcColorFactor:()=>Y,OrthographicCamera:()=>OrthographicCamera,P3Primaries:()=>Ir,PCFShadowMap:()=>d,PCFSoftShadowMap:()=>h,PMREMGenerator:()=>PMREMGenerator,Path:()=>Path,PerspectiveCamera:()=>PerspectiveCamera,Plane:()=>Plane,PlaneGeometry:()=>PlaneGeometry,PlaneHelper:()=>PlaneHelper,PointLight:()=>PointLight,PointLightHelper:()=>PointLightHelper,Points:()=>Points,PointsMaterial:()=>PointsMaterial,PolarGridHelper:()=>PolarGridHelper,PolyhedronGeometry:()=>PolyhedronGeometry,PositionalAudio:()=>PositionalAudio,PropertyBinding:()=>PropertyBinding,PropertyMixer:()=>PropertyMixer,QuadraticBezierCurve:()=>QuadraticBezierCurve,QuadraticBezierCurve3:()=>QuadraticBezierCurve3,Quaternion:()=>Quaternion,QuaternionKeyframeTrack:()=>QuaternionKeyframeTrack,QuaternionLinearInterpolant:()=>QuaternionLinearInterpolant,RED_GREEN_RGTC2_Format:()=>cr,RED_RGTC1_Format:()=>ar,REVISION:()=>n,RGBADepthPacking:()=>Mr,RGBAFormat:()=>St,RGBAIntegerFormat:()=>Rt,RGBA_ASTC_10x10_Format:()=>tr,RGBA_ASTC_10x5_Format:()=>Jt,RGBA_ASTC_10x6_Format:()=>Qt,RGBA_ASTC_10x8_Format:()=>er,RGBA_ASTC_12x10_Format:()=>rr,RGBA_ASTC_12x12_Format:()=>nr,RGBA_ASTC_4x4_Format:()=>Wt,RGBA_ASTC_5x4_Format:()=>Vt,RGBA_ASTC_5x5_Format:()=>qt,RGBA_ASTC_6x5_Format:()=>$t,RGBA_ASTC_6x6_Format:()=>Zt,RGBA_ASTC_8x5_Format:()=>Kt,RGBA_ASTC_8x6_Format:()=>Xt,RGBA_ASTC_8x8_Format:()=>Yt,RGBA_BPTC_Format:()=>ir,RGBA_ETC2_EAC_Format:()=>Gt,RGBA_PVRTC_2BPPV1_Format:()=>Ht,RGBA_PVRTC_4BPPV1_Format:()=>jt,RGBA_S3TC_DXT1_Format:()=>kt,RGBA_S3TC_DXT3_Format:()=>Nt,RGBA_S3TC_DXT5_Format:()=>Ft,RGB_BPTC_SIGNED_Format:()=>sr,RGB_BPTC_UNSIGNED_Format:()=>or,RGB_ETC1_Format:()=>Ut,RGB_ETC2_Format:()=>zt,RGB_PVRTC_2BPPV1_Format:()=>Bt,RGB_PVRTC_4BPPV1_Format:()=>It,RGB_S3TC_DXT1_Format:()=>Lt,RGFormat:()=>Dt,RGIntegerFormat:()=>Ot,RawShaderMaterial:()=>RawShaderMaterial,Ray:()=>Ray,Raycaster:()=>Raycaster,Rec709Primaries:()=>Fr,RectAreaLight:()=>RectAreaLight,RedFormat:()=>At,RedIntegerFormat:()=>Tt,ReinhardToneMapping:()=>Pe,RenderTarget:()=>RenderTarget,RepeatWrapping:()=>Ye,ReplaceStencilOp:()=>Hr,ReverseSubtractEquation:()=>j,RingGeometry:()=>RingGeometry,SIGNED_RED_GREEN_RGTC2_Format:()=>ur,SIGNED_RED_RGTC1_Format:()=>lr,SRGBColorSpace:()=>Dr,SRGBTransfer:()=>Nr,Scene:()=>Scene,ShaderChunk:()=>bo,ShaderLib:()=>_o,ShaderMaterial:()=>ShaderMaterial,ShadowMaterial:()=>ShadowMaterial,Shape:()=>Shape,ShapeGeometry:()=>ShapeGeometry,ShapePath:()=>ShapePath,ShapeUtils:()=>ShapeUtils,ShortType:()=>pt,Skeleton:()=>Skeleton,SkeletonHelper:()=>SkeletonHelper,SkinnedMesh:()=>SkinnedMesh,Source:()=>Source,Sphere:()=>Sphere,SphereGeometry:()=>SphereGeometry,Spherical:()=>Spherical,SphericalHarmonics3:()=>SphericalHarmonics3,SplineCurve:()=>SplineCurve,SpotLight:()=>SpotLight,SpotLightHelper:()=>SpotLightHelper,Sprite:()=>Sprite,SpriteMaterial:()=>SpriteMaterial,SrcAlphaFactor:()=>ee,SrcAlphaSaturateFactor:()=>oe,SrcColorFactor:()=>X,StaticCopyUsage:()=>fn,StaticDrawUsage:()=>cn,StaticReadUsage:()=>hn,StereoCamera:()=>StereoCamera,StreamCopyUsage:()=>yn,StreamDrawUsage:()=>dn,StreamReadUsage:()=>mn,StringKeyframeTrack:()=>StringKeyframeTrack,SubtractEquation:()=>k,SubtractiveBlending:()=>_,TOUCH:()=>s,TangentSpaceNormalMap:()=>Cr,TetrahedronGeometry:()=>TetrahedronGeometry,Texture:()=>Texture,TextureLoader:()=>TextureLoader,TorusGeometry:()=>TorusGeometry,TorusKnotGeometry:()=>TorusKnotGeometry,Triangle:()=>Triangle,TriangleFanDrawMode:()=>Pr,TriangleStripDrawMode:()=>Sr,TrianglesDrawMode:()=>wr,TubeGeometry:()=>TubeGeometry,UVMapping:()=>Ge,Uint16BufferAttribute:()=>Uint16BufferAttribute,Uint32BufferAttribute:()=>Uint32BufferAttribute,Uint8BufferAttribute:()=>Uint8BufferAttribute,Uint8ClampedBufferAttribute:()=>Uint8ClampedBufferAttribute,Uniform:()=>Uniform,UniformsGroup:()=>UniformsGroup,UniformsLib:()=>vo,UniformsUtils:()=>ao,UnsignedByteType:()=>dt,UnsignedInt248Type:()=>xt,UnsignedIntType:()=>gt,UnsignedShort4444Type:()=>vt,UnsignedShort5551Type:()=>_t,UnsignedShortType:()=>mt,VSMShadowMap:()=>p,Vector2:()=>Vector2,Vector3:()=>Vector3,Vector4:()=>Vector4,VectorKeyframeTrack:()=>VectorKeyframeTrack,VideoTexture:()=>VideoTexture,WebGL1Renderer:()=>WebGL1Renderer,WebGL3DRenderTarget:()=>WebGL3DRenderTarget,WebGLArrayRenderTarget:()=>WebGLArrayRenderTarget,WebGLCoordinateSystem:()=>xn,WebGLCubeRenderTarget:()=>WebGLCubeRenderTarget,WebGLMultipleRenderTargets:()=>WebGLMultipleRenderTargets,WebGLRenderTarget:()=>WebGLRenderTarget,WebGLRenderer:()=>WebGLRenderer,WebGLUtils:()=>WebGLUtils,WebGPUCoordinateSystem:()=>wn,WireframeGeometry:()=>WireframeGeometry,WrapAroundEnding:()=>vr,ZeroCurvatureEnding:()=>yr,ZeroFactor:()=>$,ZeroSlopeEnding:()=>br,ZeroStencilOp:()=>Br,_SRGBAFormat:()=>_n,createCanvasElement:()=>Un});const n="162",i={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},s={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},o=0,a=1,l=2,c=3,u=0,d=1,h=2,p=3,m=0,f=1,g=2,y=0,b=1,v=2,_=3,x=4,w=5,R=100,k=101,j=102,z=103,q=104,$=200,Z=201,X=202,Y=203,ee=204,te=205,re=206,ne=207,ie=208,se=209,oe=210,ae=211,le=212,ce=213,ue=214,de=0,he=1,pe=2,me=3,fe=4,ge=5,ye=6,be=7,ve=0,_e=1,xe=2,we=0,Se=1,Pe=2,Te=3,Re=4,ke=5,Ie=6,je=7,He="attached",ze="detached",Ge=300,We=301,Ve=302,qe=303,$e=304,Xe=306,Ye=1e3,Qe=1001,et=1002,tt=1003,rt=1004,nt=1004,it=1005,st=1005,ot=1006,at=1007,lt=1007,ct=1008,ut=1008,dt=1009,ht=1010,pt=1011,mt=1012,ft=1013,gt=1014,yt=1015,bt=1016,vt=1017,_t=1018,xt=1020,wt=1021,St=1023,Pt=1024,Et=1025,Mt=1026,Ct=1027,At=1028,Tt=1029,Dt=1030,Ot=1031,Rt=1033,Lt=33776,kt=33777,Nt=33778,Ft=33779,It=35840,Bt=35841,jt=35842,Ht=35843,Ut=36196,zt=37492,Gt=37496,Wt=37808,Vt=37809,qt=37810,$t=37811,Zt=37812,Kt=37813,Xt=37814,Yt=37815,Jt=37816,Qt=37817,er=37818,tr=37819,rr=37820,nr=37821,ir=36492,sr=36494,or=36495,ar=36283,lr=36284,cr=36285,ur=36286,dr=2200,hr=2201,pr=2202,mr=2300,fr=2301,gr=2302,yr=2400,br=2401,vr=2402,_r=2500,xr=2501,wr=0,Sr=1,Pr=2,Er=3200,Mr=3201,Cr=0,Ar=1,Tr="",Dr="srgb",Or="srgb-linear",Rr="display-p3",Lr="display-p3-linear",kr="linear",Nr="srgb",Fr="rec709",Ir="p3",Br=0,jr=7680,Hr=7681,Ur=7682,zr=7683,Gr=34055,Wr=34056,Vr=5386,qr=512,$r=513,Zr=514,Kr=515,Xr=516,Yr=517,Jr=518,Qr=519,en=512,tn=513,rn=514,nn=515,sn=516,on=517,an=518,ln=519,cn=35044,un=35048,dn=35040,hn=35045,pn=35049,mn=35041,fn=35046,gn=35050,yn=35042,bn="100",vn="300 es",_n=1035,xn=2e3,wn=2001;class EventDispatcher{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});const r=this._listeners;void 0===r[e]&&(r[e]=[]),-1===r[e].indexOf(t)&&r[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;const r=this._listeners;return void 0!==r[e]&&-1!==r[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;const r=this._listeners[e];if(void 0!==r){const e=r.indexOf(t);-1!==e&&r.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;const t=this._listeners[e.type];if(void 0!==t){e.target=this;const r=t.slice(0);for(let t=0,n=r.length;t<n;t++)r[t].call(this,e);e.target=null}}}const Sn=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let Pn=1234567;const En=Math.PI/180,Mn=180/Math.PI;function Cn(){const e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,r=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(Sn[255&e]+Sn[e>>8&255]+Sn[e>>16&255]+Sn[e>>24&255]+"-"+Sn[255&t]+Sn[t>>8&255]+"-"+Sn[t>>16&15|64]+Sn[t>>24&255]+"-"+Sn[63&r|128]+Sn[r>>8&255]+"-"+Sn[r>>16&255]+Sn[r>>24&255]+Sn[255&n]+Sn[n>>8&255]+Sn[n>>16&255]+Sn[n>>24&255]).toLowerCase()}function An(e,t,r){return Math.max(t,Math.min(r,e))}function Tn(e,t){return(e%t+t)%t}function Dn(e,t,r){return(1-r)*e+r*t}function On(e){return 0==(e&e-1)&&0!==e}function Rn(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}function Ln(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw new Error("Invalid component type.")}}function kn(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(4294967295*e);case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int32Array:return Math.round(2147483647*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw new Error("Invalid component type.")}}const Nn={DEG2RAD:En,RAD2DEG:Mn,generateUUID:Cn,clamp:An,euclideanModulo:Tn,mapLinear:function(e,t,r,n,i){return n+(e-t)*(i-n)/(r-t)},inverseLerp:function(e,t,r){return e!==t?(r-e)/(t-e):0},lerp:Dn,damp:function(e,t,r,n){return Dn(e,t,1-Math.exp(-r*n))},pingpong:function(e,t=1){return t-Math.abs(Tn(e,2*t)-t)},smoothstep:function(e,t,r){return e<=t?0:e>=r?1:(e=(e-t)/(r-t))*e*(3-2*e)},smootherstep:function(e,t,r){return e<=t?0:e>=r?1:(e=(e-t)/(r-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){void 0!==e&&(Pn=e);let t=Pn+=1831565813;return t=Math.imul(t^t>>>15,1|t),t^=t+Math.imul(t^t>>>7,61|t),((t^t>>>14)>>>0)/4294967296},degToRad:function(e){return e*En},radToDeg:function(e){return e*Mn},isPowerOfTwo:On,ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:Rn,setQuaternionFromProperEuler:function(e,t,r,n,i){const s=Math.cos,o=Math.sin,a=s(r/2),l=o(r/2),c=s((t+n)/2),u=o((t+n)/2),d=s((t-n)/2),h=o((t-n)/2),p=s((n-t)/2),m=o((n-t)/2);switch(i){case"XYX":e.set(a*u,l*d,l*h,a*c);break;case"YZY":e.set(l*h,a*u,l*d,a*c);break;case"ZXZ":e.set(l*d,l*h,a*u,a*c);break;case"XZX":e.set(a*u,l*m,l*p,a*c);break;case"YXY":e.set(l*p,a*u,l*m,a*c);break;case"ZYZ":e.set(l*m,l*p,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}},normalize:kn,denormalize:Ln};class Vector2{constructor(e=0,t=0){Vector2.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,r=this.y,n=e.elements;return this.x=n[0]*t+n[3]*r+n[6],this.y=n[1]*t+n[4]*r+n[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const r=this.dot(e)/t;return Math.acos(An(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y;return t*t+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const r=Math.cos(t),n=Math.sin(t),i=this.x-e.x,s=this.y-e.y;return this.x=i*r-s*n+e.x,this.y=i*n+s*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Matrix3{constructor(e,t,r,n,i,s,o,a,l){Matrix3.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==e&&this.set(e,t,r,n,i,s,o,a,l)}set(e,t,r,n,i,s,o,a,l){const c=this.elements;return c[0]=e,c[1]=n,c[2]=o,c[3]=t,c[4]=i,c[5]=a,c[6]=r,c[7]=s,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],this}extractBasis(e,t,r){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const r=e.elements,n=t.elements,i=this.elements,s=r[0],o=r[3],a=r[6],l=r[1],c=r[4],u=r[7],d=r[2],h=r[5],p=r[8],m=n[0],f=n[3],g=n[6],y=n[1],b=n[4],v=n[7],_=n[2],x=n[5],w=n[8];return i[0]=s*m+o*y+a*_,i[3]=s*f+o*b+a*x,i[6]=s*g+o*v+a*w,i[1]=l*m+c*y+u*_,i[4]=l*f+c*b+u*x,i[7]=l*g+c*v+u*w,i[2]=d*m+h*y+p*_,i[5]=d*f+h*b+p*x,i[8]=d*g+h*v+p*w,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],r=e[1],n=e[2],i=e[3],s=e[4],o=e[5],a=e[6],l=e[7],c=e[8];return t*s*c-t*o*l-r*i*c+r*o*a+n*i*l-n*s*a}invert(){const e=this.elements,t=e[0],r=e[1],n=e[2],i=e[3],s=e[4],o=e[5],a=e[6],l=e[7],c=e[8],u=c*s-o*l,d=o*a-c*i,h=l*i-s*a,p=t*u+r*d+n*h;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const m=1/p;return e[0]=u*m,e[1]=(n*l-c*r)*m,e[2]=(o*r-n*s)*m,e[3]=d*m,e[4]=(c*t-n*a)*m,e[5]=(n*i-o*t)*m,e[6]=h*m,e[7]=(r*a-l*t)*m,e[8]=(s*t-r*i)*m,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,r,n,i,s,o){const a=Math.cos(i),l=Math.sin(i);return this.set(r*a,r*l,-r*(a*s+l*o)+s+e,-n*l,n*a,-n*(-l*s+a*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(Fn.makeScale(e,t)),this}rotate(e){return this.premultiply(Fn.makeRotation(-e)),this}translate(e,t){return this.premultiply(Fn.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,r,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,r=e.elements;for(let e=0;e<9;e++)if(t[e]!==r[e])return!1;return!0}fromArray(e,t=0){for(let r=0;r<9;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e}clone(){return(new this.constructor).fromArray(this.elements)}}const Fn=new Matrix3;function In(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}const Bn={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function jn(e,t){return new Bn[e](t)}function Hn(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function Un(){const e=Hn("canvas");return e.style.display="block",e}const zn={};function Gn(e){e in zn||(zn[e]=!0,console.warn(e))}const Wn=(new Matrix3).set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),Vn=(new Matrix3).set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),qn={[Or]:{transfer:kr,primaries:Fr,toReference:e=>e,fromReference:e=>e},[Dr]:{transfer:Nr,primaries:Fr,toReference:e=>e.convertSRGBToLinear(),fromReference:e=>e.convertLinearToSRGB()},[Lr]:{transfer:kr,primaries:Ir,toReference:e=>e.applyMatrix3(Vn),fromReference:e=>e.applyMatrix3(Wn)},[Rr]:{transfer:Nr,primaries:Ir,toReference:e=>e.convertSRGBToLinear().applyMatrix3(Vn),fromReference:e=>e.applyMatrix3(Wn).convertLinearToSRGB()}},$n=new Set([Or,Lr]),Zn={enabled:!0,_workingColorSpace:Or,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(e){if(!$n.has(e))throw new Error(`Unsupported working color space, "${e}".`);this._workingColorSpace=e},convert:function(e,t,r){if(!1===this.enabled||t===r||!t||!r)return e;const n=qn[t].toReference;return(0,qn[r].fromReference)(n(e))},fromWorkingColorSpace:function(e,t){return this.convert(e,this._workingColorSpace,t)},toWorkingColorSpace:function(e,t){return this.convert(e,t,this._workingColorSpace)},getPrimaries:function(e){return qn[e].primaries},getTransfer:function(e){return e===Tr?kr:qn[e].transfer}};function SRGBToLinear(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function LinearToSRGB(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}let Kn;class ImageUtils{static getDataURL(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===Kn&&(Kn=Hn("canvas")),Kn.width=e.width,Kn.height=e.height;const r=Kn.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),t=Kn}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const t=Hn("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");r.drawImage(e,0,0,e.width,e.height);const n=r.getImageData(0,0,e.width,e.height),i=n.data;for(let e=0;e<i.length;e++)i[e]=255*SRGBToLinear(i[e]/255);return r.putImageData(n,0,0),t}if(e.data){const t=e.data.slice(0);for(let e=0;e<t.length;e++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[e]=Math.floor(255*SRGBToLinear(t[e]/255)):t[e]=SRGBToLinear(t[e]);return{data:t,width:e.width,height:e.height}}return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let Xn=0;class Source{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:Xn++}),this.uuid=Cn(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){!0===e&&this.version++}toJSON(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.images[this.uuid])return e.images[this.uuid];const r={uuid:this.uuid,url:""},n=this.data;if(null!==n){let e;if(Array.isArray(n)){e=[];for(let t=0,r=n.length;t<r;t++)n[t].isDataTexture?e.push(Yn(n[t].image)):e.push(Yn(n[t]))}else e=Yn(n);r.url=e}return t||(e.images[this.uuid]=r),r}}function Yn(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?ImageUtils.getDataURL(e):e.data?{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let Jn=0;class Texture extends EventDispatcher{constructor(e=Texture.DEFAULT_IMAGE,t=Texture.DEFAULT_MAPPING,r=Qe,n=Qe,i=ot,s=ct,o=St,a=dt,l=Texture.DEFAULT_ANISOTROPY,c=Tr){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Jn++}),this.uuid=Cn(),this.name="",this.source=new Source(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=r,this.wrapT=n,this.magFilter=i,this.minFilter=s,this.anisotropy=l,this.format=o,this.internalFormat=null,this.type=a,this.offset=new Vector2(0,0),this.repeat=new Vector2(1,1),this.center=new Vector2(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Matrix3,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=c,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];const r={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(r.userData=this.userData),t||(e.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Ge)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Ye:e.x=e.x-Math.floor(e.x);break;case Qe:e.x=e.x<0?0:1;break;case et:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case Ye:e.y=e.y-Math.floor(e.y);break;case Qe:e.y=e.y<0?0:1;break;case et:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){!0===e&&(this.version++,this.source.needsUpdate=!0)}}Texture.DEFAULT_IMAGE=null,Texture.DEFAULT_MAPPING=Ge,Texture.DEFAULT_ANISOTROPY=1;class Vector4{constructor(e=0,t=0,r=0,n=1){Vector4.prototype.isVector4=!0,this.x=e,this.y=t,this.z=r,this.w=n}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,r,n){return this.x=e,this.y=t,this.z=r,this.w=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,r=this.y,n=this.z,i=this.w,s=e.elements;return this.x=s[0]*t+s[4]*r+s[8]*n+s[12]*i,this.y=s[1]*t+s[5]*r+s[9]*n+s[13]*i,this.z=s[2]*t+s[6]*r+s[10]*n+s[14]*i,this.w=s[3]*t+s[7]*r+s[11]*n+s[15]*i,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,r,n,i;const s=.01,o=.1,a=e.elements,l=a[0],c=a[4],u=a[8],d=a[1],h=a[5],p=a[9],m=a[2],f=a[6],g=a[10];if(Math.abs(c-d)<s&&Math.abs(u-m)<s&&Math.abs(p-f)<s){if(Math.abs(c+d)<o&&Math.abs(u+m)<o&&Math.abs(p+f)<o&&Math.abs(l+h+g-3)<o)return this.set(1,0,0,0),this;t=Math.PI;const e=(l+1)/2,a=(h+1)/2,y=(g+1)/2,b=(c+d)/4,v=(u+m)/4,_=(p+f)/4;return e>a&&e>y?e<s?(r=0,n=.707106781,i=.707106781):(r=Math.sqrt(e),n=b/r,i=v/r):a>y?a<s?(r=.707106781,n=0,i=.707106781):(n=Math.sqrt(a),r=b/n,i=_/n):y<s?(r=.707106781,n=.707106781,i=0):(i=Math.sqrt(y),r=v/i,n=_/i),this.set(r,n,i,t),this}let y=Math.sqrt((f-p)*(f-p)+(u-m)*(u-m)+(d-c)*(d-c));return Math.abs(y)<.001&&(y=1),this.x=(f-p)/y,this.y=(u-m)/y,this.z=(d-c)/y,this.w=Math.acos((l+h+g-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this.w=e.w+(t.w-e.w)*r,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class RenderTarget extends EventDispatcher{constructor(e=1,t=1,r={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Vector4(0,0,e,t),this.scissorTest=!1,this.viewport=new Vector4(0,0,e,t);const n={width:e,height:t,depth:1};r=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:ot,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0,count:1},r);const i=new Texture(n,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.colorSpace);i.flipY=!1,i.generateMipmaps=r.generateMipmaps,i.internalFormat=r.internalFormat,this.textures=[];const s=r.count;for(let e=0;e<s;e++)this.textures[e]=i.clone(),this.textures[e].isRenderTargetTexture=!0;this.depthBuffer=r.depthBuffer,this.stencilBuffer=r.stencilBuffer,this.depthTexture=r.depthTexture,this.samples=r.samples}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}setSize(e,t,r=1){if(this.width!==e||this.height!==t||this.depth!==r){this.width=e,this.height=t,this.depth=r;for(let n=0,i=this.textures.length;n<i;n++)this.textures[n].image.width=e,this.textures[n].image.height=t,this.textures[n].image.depth=r;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return(new this.constructor).copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,r=e.textures.length;t<r;t++)this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new Source(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class WebGLRenderTarget extends RenderTarget{constructor(e=1,t=1,r={}){super(e,t,r),this.isWebGLRenderTarget=!0}}class DataArrayTexture extends Texture{constructor(e=null,t=1,r=1,n=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:r,depth:n},this.magFilter=tt,this.minFilter=tt,this.wrapR=Qe,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class WebGLArrayRenderTarget extends WebGLRenderTarget{constructor(e=1,t=1,r=1,n={}){super(e,t,n),this.isWebGLArrayRenderTarget=!0,this.depth=r,this.texture=new DataArrayTexture(null,e,t,r),this.texture.isRenderTargetTexture=!0}}class Data3DTexture extends Texture{constructor(e=null,t=1,r=1,n=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:r,depth:n},this.magFilter=tt,this.minFilter=tt,this.wrapR=Qe,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class WebGL3DRenderTarget extends WebGLRenderTarget{constructor(e=1,t=1,r=1,n={}){super(e,t,n),this.isWebGL3DRenderTarget=!0,this.depth=r,this.texture=new Data3DTexture(null,e,t,r),this.texture.isRenderTargetTexture=!0}}class Quaternion{constructor(e=0,t=0,r=0,n=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=r,this._w=n}static slerpFlat(e,t,r,n,i,s,o){let a=r[n+0],l=r[n+1],c=r[n+2],u=r[n+3];const d=i[s+0],h=i[s+1],p=i[s+2],m=i[s+3];if(0===o)return e[t+0]=a,e[t+1]=l,e[t+2]=c,void(e[t+3]=u);if(1===o)return e[t+0]=d,e[t+1]=h,e[t+2]=p,void(e[t+3]=m);if(u!==m||a!==d||l!==h||c!==p){let e=1-o;const t=a*d+l*h+c*p+u*m,r=t>=0?1:-1,n=1-t*t;if(n>Number.EPSILON){const i=Math.sqrt(n),s=Math.atan2(i,t*r);e=Math.sin(e*s)/i,o=Math.sin(o*s)/i}const i=o*r;if(a=a*e+d*i,l=l*e+h*i,c=c*e+p*i,u=u*e+m*i,e===1-o){const e=1/Math.sqrt(a*a+l*l+c*c+u*u);a*=e,l*=e,c*=e,u*=e}}e[t]=a,e[t+1]=l,e[t+2]=c,e[t+3]=u}static multiplyQuaternionsFlat(e,t,r,n,i,s){const o=r[n],a=r[n+1],l=r[n+2],c=r[n+3],u=i[s],d=i[s+1],h=i[s+2],p=i[s+3];return e[t]=o*p+c*u+a*h-l*d,e[t+1]=a*p+c*d+l*u-o*h,e[t+2]=l*p+c*h+o*d-a*u,e[t+3]=c*p-o*u-a*d-l*h,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,r,n){return this._x=e,this._y=t,this._z=r,this._w=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const r=e._x,n=e._y,i=e._z,s=e._order,o=Math.cos,a=Math.sin,l=o(r/2),c=o(n/2),u=o(i/2),d=a(r/2),h=a(n/2),p=a(i/2);switch(s){case"XYZ":this._x=d*c*u+l*h*p,this._y=l*h*u-d*c*p,this._z=l*c*p+d*h*u,this._w=l*c*u-d*h*p;break;case"YXZ":this._x=d*c*u+l*h*p,this._y=l*h*u-d*c*p,this._z=l*c*p-d*h*u,this._w=l*c*u+d*h*p;break;case"ZXY":this._x=d*c*u-l*h*p,this._y=l*h*u+d*c*p,this._z=l*c*p+d*h*u,this._w=l*c*u-d*h*p;break;case"ZYX":this._x=d*c*u-l*h*p,this._y=l*h*u+d*c*p,this._z=l*c*p-d*h*u,this._w=l*c*u+d*h*p;break;case"YZX":this._x=d*c*u+l*h*p,this._y=l*h*u+d*c*p,this._z=l*c*p-d*h*u,this._w=l*c*u-d*h*p;break;case"XZY":this._x=d*c*u-l*h*p,this._y=l*h*u-d*c*p,this._z=l*c*p+d*h*u,this._w=l*c*u+d*h*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!0===t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const r=t/2,n=Math.sin(r);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,r=t[0],n=t[4],i=t[8],s=t[1],o=t[5],a=t[9],l=t[2],c=t[6],u=t[10],d=r+o+u;if(d>0){const e=.5/Math.sqrt(d+1);this._w=.25/e,this._x=(c-a)*e,this._y=(i-l)*e,this._z=(s-n)*e}else if(r>o&&r>u){const e=2*Math.sqrt(1+r-o-u);this._w=(c-a)/e,this._x=.25*e,this._y=(n+s)/e,this._z=(i+l)/e}else if(o>u){const e=2*Math.sqrt(1+o-r-u);this._w=(i-l)/e,this._x=(n+s)/e,this._y=.25*e,this._z=(a+c)/e}else{const e=2*Math.sqrt(1+u-r-o);this._w=(s-n)/e,this._x=(i+l)/e,this._y=(a+c)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let r=e.dot(t)+1;return r<Number.EPSILON?(r=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(An(this.dot(e),-1,1)))}rotateTowards(e,t){const r=this.angleTo(e);if(0===r)return this;const n=Math.min(1,t/r);return this.slerp(e,n),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const r=e._x,n=e._y,i=e._z,s=e._w,o=t._x,a=t._y,l=t._z,c=t._w;return this._x=r*c+s*o+n*l-i*a,this._y=n*c+s*a+i*o-r*l,this._z=i*c+s*l+r*a-n*o,this._w=s*c-r*o-n*a-i*l,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);const r=this._x,n=this._y,i=this._z,s=this._w;let o=s*e._w+r*e._x+n*e._y+i*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=s,this._x=r,this._y=n,this._z=i,this;const a=1-o*o;if(a<=Number.EPSILON){const e=1-t;return this._w=e*s+t*this._w,this._x=e*r+t*this._x,this._y=e*n+t*this._y,this._z=e*i+t*this._z,this.normalize(),this}const l=Math.sqrt(a),c=Math.atan2(l,o),u=Math.sin((1-t)*c)/l,d=Math.sin(t*c)/l;return this._w=s*u+this._w*d,this._x=r*u+this._x*d,this._y=n*u+this._y*d,this._z=i*u+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,r){return this.copy(e).slerp(t,r)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),r=Math.random(),n=Math.sqrt(1-r),i=Math.sqrt(r);return this.set(n*Math.sin(e),n*Math.cos(e),i*Math.sin(t),i*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Vector3{constructor(e=0,t=0,r=0){Vector3.prototype.isVector3=!0,this.x=e,this.y=t,this.z=r}set(e,t,r){return void 0===r&&(r=this.z),this.x=e,this.y=t,this.z=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(ei.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(ei.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,r=this.y,n=this.z,i=e.elements;return this.x=i[0]*t+i[3]*r+i[6]*n,this.y=i[1]*t+i[4]*r+i[7]*n,this.z=i[2]*t+i[5]*r+i[8]*n,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,r=this.y,n=this.z,i=e.elements,s=1/(i[3]*t+i[7]*r+i[11]*n+i[15]);return this.x=(i[0]*t+i[4]*r+i[8]*n+i[12])*s,this.y=(i[1]*t+i[5]*r+i[9]*n+i[13])*s,this.z=(i[2]*t+i[6]*r+i[10]*n+i[14])*s,this}applyQuaternion(e){const t=this.x,r=this.y,n=this.z,i=e.x,s=e.y,o=e.z,a=e.w,l=2*(s*n-o*r),c=2*(o*t-i*n),u=2*(i*r-s*t);return this.x=t+a*l+s*u-o*c,this.y=r+a*c+o*l-i*u,this.z=n+a*u+i*c-s*l,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,r=this.y,n=this.z,i=e.elements;return this.x=i[0]*t+i[4]*r+i[8]*n,this.y=i[1]*t+i[5]*r+i[9]*n,this.z=i[2]*t+i[6]*r+i[10]*n,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const r=e.x,n=e.y,i=e.z,s=t.x,o=t.y,a=t.z;return this.x=n*a-i*o,this.y=i*s-r*a,this.z=r*o-n*s,this}projectOnVector(e){const t=e.lengthSq();if(0===t)return this.set(0,0,0);const r=e.dot(this)/t;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return Qn.copy(this).projectOnVector(e),this.sub(Qn)}reflect(e){return this.sub(Qn.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const r=this.dot(e)/t;return Math.acos(An(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y,n=this.z-e.z;return t*t+r*r+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,r){const n=Math.sin(t)*e;return this.x=n*Math.sin(r),this.y=Math.cos(t)*e,this.z=n*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,r){return this.x=e*Math.sin(t),this.y=r,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length(),n=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=r,this.z=n,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=2*Math.random()-1,r=Math.sqrt(1-t*t);return this.x=r*Math.cos(e),this.y=t,this.z=r*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Qn=new Vector3,ei=new Quaternion;class Box3{constructor(e=new Vector3(1/0,1/0,1/0),t=new Vector3(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,r=e.length;t<r;t+=3)this.expandByPoint(ri.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,r=e.count;t<r;t++)this.expandByPoint(ri.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,r=e.length;t<r;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const r=ri.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(r),this.max.copy(e).add(r),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const r=e.geometry;if(void 0!==r){const n=r.getAttribute("position");if(!0===t&&void 0!==n&&!0!==e.isInstancedMesh)for(let t=0,r=n.count;t<r;t++)!0===e.isMesh?e.getVertexPosition(t,ri):ri.fromBufferAttribute(n,t),ri.applyMatrix4(e.matrixWorld),this.expandByPoint(ri);else void 0!==e.boundingBox?(null===e.boundingBox&&e.computeBoundingBox(),ni.copy(e.boundingBox)):(null===r.boundingBox&&r.computeBoundingBox(),ni.copy(r.boundingBox)),ni.applyMatrix4(e.matrixWorld),this.union(ni)}const n=e.children;for(let e=0,r=n.length;e<r;e++)this.expandByObject(n[e],t);return this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}intersectsSphere(e){return this.clampPoint(e.center,ri),ri.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,r;return e.normal.x>0?(t=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),t<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(ui),di.subVectors(this.max,ui),ii.subVectors(e.a,ui),si.subVectors(e.b,ui),oi.subVectors(e.c,ui),ai.subVectors(si,ii),li.subVectors(oi,si),ci.subVectors(ii,oi);let t=[0,-ai.z,ai.y,0,-li.z,li.y,0,-ci.z,ci.y,ai.z,0,-ai.x,li.z,0,-li.x,ci.z,0,-ci.x,-ai.y,ai.x,0,-li.y,li.x,0,-ci.y,ci.x,0];return!!mi(t,ii,si,oi,di)&&(t=[1,0,0,0,1,0,0,0,1],!!mi(t,ii,si,oi,di)&&(hi.crossVectors(ai,li),t=[hi.x,hi.y,hi.z],mi(t,ii,si,oi,di)))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,ri).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(ri).length()),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(ti[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),ti[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),ti[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),ti[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),ti[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),ti[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),ti[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),ti[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(ti)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const ti=[new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3],ri=new Vector3,ni=new Box3,ii=new Vector3,si=new Vector3,oi=new Vector3,ai=new Vector3,li=new Vector3,ci=new Vector3,ui=new Vector3,di=new Vector3,hi=new Vector3,pi=new Vector3;function mi(e,t,r,n,i){for(let s=0,o=e.length-3;s<=o;s+=3){pi.fromArray(e,s);const o=i.x*Math.abs(pi.x)+i.y*Math.abs(pi.y)+i.z*Math.abs(pi.z),a=t.dot(pi),l=r.dot(pi),c=n.dot(pi);if(Math.max(-Math.max(a,l,c),Math.min(a,l,c))>o)return!1}return!0}const fi=new Box3,gi=new Vector3,yi=new Vector3;class Sphere{constructor(e=new Vector3,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const r=this.center;void 0!==t?r.copy(t):fi.setFromPoints(e).getCenter(r);let n=0;for(let t=0,i=e.length;t<i;t++)n=Math.max(n,r.distanceToSquared(e[t]));return this.radius=Math.sqrt(n),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const r=this.center.distanceToSquared(e);return t.copy(e),r>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;gi.subVectors(e,this.center);const t=gi.lengthSq();if(t>this.radius*this.radius){const e=Math.sqrt(t),r=.5*(e-this.radius);this.center.addScaledVector(gi,r/e),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(!0===this.center.equals(e.center)?this.radius=Math.max(this.radius,e.radius):(yi.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(gi.copy(e.center).add(yi)),this.expandByPoint(gi.copy(e.center).sub(yi))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const bi=new Vector3,vi=new Vector3,_i=new Vector3,xi=new Vector3,wi=new Vector3,Ei=new Vector3,Ci=new Vector3;class Ray{constructor(e=new Vector3,t=new Vector3(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,bi)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const r=t.dot(this.direction);return r<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,r)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=bi.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(bi.copy(this.origin).addScaledVector(this.direction,t),bi.distanceToSquared(e))}distanceSqToSegment(e,t,r,n){vi.copy(e).add(t).multiplyScalar(.5),_i.copy(t).sub(e).normalize(),xi.copy(this.origin).sub(vi);const i=.5*e.distanceTo(t),s=-this.direction.dot(_i),o=xi.dot(this.direction),a=-xi.dot(_i),l=xi.lengthSq(),c=Math.abs(1-s*s);let u,d,h,p;if(c>0)if(u=s*a-o,d=s*o-a,p=i*c,u>=0)if(d>=-p)if(d<=p){const e=1/c;u*=e,d*=e,h=u*(u+s*d+2*o)+d*(s*u+d+2*a)+l}else d=i,u=Math.max(0,-(s*d+o)),h=-u*u+d*(d+2*a)+l;else d=-i,u=Math.max(0,-(s*d+o)),h=-u*u+d*(d+2*a)+l;else d<=-p?(u=Math.max(0,-(-s*i+o)),d=u>0?-i:Math.min(Math.max(-i,-a),i),h=-u*u+d*(d+2*a)+l):d<=p?(u=0,d=Math.min(Math.max(-i,-a),i),h=d*(d+2*a)+l):(u=Math.max(0,-(s*i+o)),d=u>0?i:Math.min(Math.max(-i,-a),i),h=-u*u+d*(d+2*a)+l);else d=s>0?-i:i,u=Math.max(0,-(s*d+o)),h=-u*u+d*(d+2*a)+l;return r&&r.copy(this.origin).addScaledVector(this.direction,u),n&&n.copy(vi).addScaledVector(_i,d),h}intersectSphere(e,t){bi.subVectors(e.center,this.origin);const r=bi.dot(this.direction),n=bi.dot(bi)-r*r,i=e.radius*e.radius;if(n>i)return null;const s=Math.sqrt(i-n),o=r-s,a=r+s;return a<0?null:o<0?this.at(a,t):this.at(o,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;const r=-(this.origin.dot(e.normal)+e.constant)/t;return r>=0?r:null}intersectPlane(e,t){const r=this.distanceToPlane(e);return null===r?null:this.at(r,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);if(0===t)return!0;return e.normal.dot(this.direction)*t<0}intersectBox(e,t){let r,n,i,s,o,a;const l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,d=this.origin;return l>=0?(r=(e.min.x-d.x)*l,n=(e.max.x-d.x)*l):(r=(e.max.x-d.x)*l,n=(e.min.x-d.x)*l),c>=0?(i=(e.min.y-d.y)*c,s=(e.max.y-d.y)*c):(i=(e.max.y-d.y)*c,s=(e.min.y-d.y)*c),r>s||i>n?null:((i>r||isNaN(r))&&(r=i),(s<n||isNaN(n))&&(n=s),u>=0?(o=(e.min.z-d.z)*u,a=(e.max.z-d.z)*u):(o=(e.max.z-d.z)*u,a=(e.min.z-d.z)*u),r>a||o>n?null:((o>r||r!=r)&&(r=o),(a<n||n!=n)&&(n=a),n<0?null:this.at(r>=0?r:n,t)))}intersectsBox(e){return null!==this.intersectBox(e,bi)}intersectTriangle(e,t,r,n,i){wi.subVectors(t,e),Ei.subVectors(r,e),Ci.crossVectors(wi,Ei);let s,o=this.direction.dot(Ci);if(o>0){if(n)return null;s=1}else{if(!(o<0))return null;s=-1,o=-o}xi.subVectors(this.origin,e);const a=s*this.direction.dot(Ei.crossVectors(xi,Ei));if(a<0)return null;const l=s*this.direction.dot(wi.cross(xi));if(l<0)return null;if(a+l>o)return null;const c=-s*xi.dot(Ci);return c<0?null:this.at(c/o,i)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class Matrix4{constructor(e,t,r,n,i,s,o,a,l,c,u,d,h,p,m,f){Matrix4.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==e&&this.set(e,t,r,n,i,s,o,a,l,c,u,d,h,p,m,f)}set(e,t,r,n,i,s,o,a,l,c,u,d,h,p,m,f){const g=this.elements;return g[0]=e,g[4]=t,g[8]=r,g[12]=n,g[1]=i,g[5]=s,g[9]=o,g[13]=a,g[2]=l,g[6]=c,g[10]=u,g[14]=d,g[3]=h,g[7]=p,g[11]=m,g[15]=f,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new Matrix4).fromArray(this.elements)}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],this}copyPosition(e){const t=this.elements,r=e.elements;return t[12]=r[12],t[13]=r[13],t[14]=r[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,r){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(e,t,r){return this.set(e.x,t.x,r.x,0,e.y,t.y,r.y,0,e.z,t.z,r.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,r=e.elements,n=1/Ti.setFromMatrixColumn(e,0).length(),i=1/Ti.setFromMatrixColumn(e,1).length(),s=1/Ti.setFromMatrixColumn(e,2).length();return t[0]=r[0]*n,t[1]=r[1]*n,t[2]=r[2]*n,t[3]=0,t[4]=r[4]*i,t[5]=r[5]*i,t[6]=r[6]*i,t[7]=0,t[8]=r[8]*s,t[9]=r[9]*s,t[10]=r[10]*s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,r=e.x,n=e.y,i=e.z,s=Math.cos(r),o=Math.sin(r),a=Math.cos(n),l=Math.sin(n),c=Math.cos(i),u=Math.sin(i);if("XYZ"===e.order){const e=s*c,r=s*u,n=o*c,i=o*u;t[0]=a*c,t[4]=-a*u,t[8]=l,t[1]=r+n*l,t[5]=e-i*l,t[9]=-o*a,t[2]=i-e*l,t[6]=n+r*l,t[10]=s*a}else if("YXZ"===e.order){const e=a*c,r=a*u,n=l*c,i=l*u;t[0]=e+i*o,t[4]=n*o-r,t[8]=s*l,t[1]=s*u,t[5]=s*c,t[9]=-o,t[2]=r*o-n,t[6]=i+e*o,t[10]=s*a}else if("ZXY"===e.order){const e=a*c,r=a*u,n=l*c,i=l*u;t[0]=e-i*o,t[4]=-s*u,t[8]=n+r*o,t[1]=r+n*o,t[5]=s*c,t[9]=i-e*o,t[2]=-s*l,t[6]=o,t[10]=s*a}else if("ZYX"===e.order){const e=s*c,r=s*u,n=o*c,i=o*u;t[0]=a*c,t[4]=n*l-r,t[8]=e*l+i,t[1]=a*u,t[5]=i*l+e,t[9]=r*l-n,t[2]=-l,t[6]=o*a,t[10]=s*a}else if("YZX"===e.order){const e=s*a,r=s*l,n=o*a,i=o*l;t[0]=a*c,t[4]=i-e*u,t[8]=n*u+r,t[1]=u,t[5]=s*c,t[9]=-o*c,t[2]=-l*c,t[6]=r*u+n,t[10]=e-i*u}else if("XZY"===e.order){const e=s*a,r=s*l,n=o*a,i=o*l;t[0]=a*c,t[4]=-u,t[8]=l*c,t[1]=e*u+i,t[5]=s*c,t[9]=r*u-n,t[2]=n*u-r,t[6]=o*c,t[10]=i*u+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Oi,e,Ri)}lookAt(e,t,r){const n=this.elements;return ji.subVectors(e,t),0===ji.lengthSq()&&(ji.z=1),ji.normalize(),ki.crossVectors(r,ji),0===ki.lengthSq()&&(1===Math.abs(r.z)?ji.x+=1e-4:ji.z+=1e-4,ji.normalize(),ki.crossVectors(r,ji)),ki.normalize(),Bi.crossVectors(ji,ki),n[0]=ki.x,n[4]=Bi.x,n[8]=ji.x,n[1]=ki.y,n[5]=Bi.y,n[9]=ji.y,n[2]=ki.z,n[6]=Bi.z,n[10]=ji.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const r=e.elements,n=t.elements,i=this.elements,s=r[0],o=r[4],a=r[8],l=r[12],c=r[1],u=r[5],d=r[9],h=r[13],p=r[2],m=r[6],f=r[10],g=r[14],y=r[3],b=r[7],v=r[11],_=r[15],x=n[0],w=n[4],R=n[8],k=n[12],j=n[1],z=n[5],q=n[9],$=n[13],Z=n[2],X=n[6],Y=n[10],ee=n[14],te=n[3],re=n[7],ne=n[11],ie=n[15];return i[0]=s*x+o*j+a*Z+l*te,i[4]=s*w+o*z+a*X+l*re,i[8]=s*R+o*q+a*Y+l*ne,i[12]=s*k+o*$+a*ee+l*ie,i[1]=c*x+u*j+d*Z+h*te,i[5]=c*w+u*z+d*X+h*re,i[9]=c*R+u*q+d*Y+h*ne,i[13]=c*k+u*$+d*ee+h*ie,i[2]=p*x+m*j+f*Z+g*te,i[6]=p*w+m*z+f*X+g*re,i[10]=p*R+m*q+f*Y+g*ne,i[14]=p*k+m*$+f*ee+g*ie,i[3]=y*x+b*j+v*Z+_*te,i[7]=y*w+b*z+v*X+_*re,i[11]=y*R+b*q+v*Y+_*ne,i[15]=y*k+b*$+v*ee+_*ie,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],r=e[4],n=e[8],i=e[12],s=e[1],o=e[5],a=e[9],l=e[13],c=e[2],u=e[6],d=e[10],h=e[14];return e[3]*(+i*a*u-n*l*u-i*o*d+r*l*d+n*o*h-r*a*h)+e[7]*(+t*a*h-t*l*d+i*s*d-n*s*h+n*l*c-i*a*c)+e[11]*(+t*l*u-t*o*h-i*s*u+r*s*h+i*o*c-r*l*c)+e[15]*(-n*o*c-t*a*u+t*o*d+n*s*u-r*s*d+r*a*c)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,r){const n=this.elements;return e.isVector3?(n[12]=e.x,n[13]=e.y,n[14]=e.z):(n[12]=e,n[13]=t,n[14]=r),this}invert(){const e=this.elements,t=e[0],r=e[1],n=e[2],i=e[3],s=e[4],o=e[5],a=e[6],l=e[7],c=e[8],u=e[9],d=e[10],h=e[11],p=e[12],m=e[13],f=e[14],g=e[15],y=u*f*l-m*d*l+m*a*h-o*f*h-u*a*g+o*d*g,b=p*d*l-c*f*l-p*a*h+s*f*h+c*a*g-s*d*g,v=c*m*l-p*u*l+p*o*h-s*m*h-c*o*g+s*u*g,_=p*u*a-c*m*a-p*o*d+s*m*d+c*o*f-s*u*f,x=t*y+r*b+n*v+i*_;if(0===x)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const w=1/x;return e[0]=y*w,e[1]=(m*d*i-u*f*i-m*n*h+r*f*h+u*n*g-r*d*g)*w,e[2]=(o*f*i-m*a*i+m*n*l-r*f*l-o*n*g+r*a*g)*w,e[3]=(u*a*i-o*d*i-u*n*l+r*d*l+o*n*h-r*a*h)*w,e[4]=b*w,e[5]=(c*f*i-p*d*i+p*n*h-t*f*h-c*n*g+t*d*g)*w,e[6]=(p*a*i-s*f*i-p*n*l+t*f*l+s*n*g-t*a*g)*w,e[7]=(s*d*i-c*a*i+c*n*l-t*d*l-s*n*h+t*a*h)*w,e[8]=v*w,e[9]=(p*u*i-c*m*i-p*r*h+t*m*h+c*r*g-t*u*g)*w,e[10]=(s*m*i-p*o*i+p*r*l-t*m*l-s*r*g+t*o*g)*w,e[11]=(c*o*i-s*u*i-c*r*l+t*u*l+s*r*h-t*o*h)*w,e[12]=_*w,e[13]=(c*m*n-p*u*n+p*r*d-t*m*d-c*r*f+t*u*f)*w,e[14]=(p*o*n-s*m*n-p*r*a+t*m*a+s*r*f-t*o*f)*w,e[15]=(s*u*n-c*o*n+c*r*a-t*u*a-s*r*d+t*o*d)*w,this}scale(e){const t=this.elements,r=e.x,n=e.y,i=e.z;return t[0]*=r,t[4]*=n,t[8]*=i,t[1]*=r,t[5]*=n,t[9]*=i,t[2]*=r,t[6]*=n,t[10]*=i,t[3]*=r,t[7]*=n,t[11]*=i,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,r,n))}makeTranslation(e,t,r){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,r,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,t,-r,0,0,r,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,0,r,0,0,1,0,0,-r,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,0,r,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const r=Math.cos(t),n=Math.sin(t),i=1-r,s=e.x,o=e.y,a=e.z,l=i*s,c=i*o;return this.set(l*s+r,l*o-n*a,l*a+n*o,0,l*o+n*a,c*o+r,c*a-n*s,0,l*a-n*o,c*a+n*s,i*a*a+r,0,0,0,0,1),this}makeScale(e,t,r){return this.set(e,0,0,0,0,t,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,t,r,n,i,s){return this.set(1,r,i,0,e,1,s,0,t,n,1,0,0,0,0,1),this}compose(e,t,r){const n=this.elements,i=t._x,s=t._y,o=t._z,a=t._w,l=i+i,c=s+s,u=o+o,d=i*l,h=i*c,p=i*u,m=s*c,f=s*u,g=o*u,y=a*l,b=a*c,v=a*u,_=r.x,x=r.y,w=r.z;return n[0]=(1-(m+g))*_,n[1]=(h+v)*_,n[2]=(p-b)*_,n[3]=0,n[4]=(h-v)*x,n[5]=(1-(d+g))*x,n[6]=(f+y)*x,n[7]=0,n[8]=(p+b)*w,n[9]=(f-y)*w,n[10]=(1-(d+m))*w,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this}decompose(e,t,r){const n=this.elements;let i=Ti.set(n[0],n[1],n[2]).length();const s=Ti.set(n[4],n[5],n[6]).length(),o=Ti.set(n[8],n[9],n[10]).length();this.determinant()<0&&(i=-i),e.x=n[12],e.y=n[13],e.z=n[14],Di.copy(this);const a=1/i,l=1/s,c=1/o;return Di.elements[0]*=a,Di.elements[1]*=a,Di.elements[2]*=a,Di.elements[4]*=l,Di.elements[5]*=l,Di.elements[6]*=l,Di.elements[8]*=c,Di.elements[9]*=c,Di.elements[10]*=c,t.setFromRotationMatrix(Di),r.x=i,r.y=s,r.z=o,this}makePerspective(e,t,r,n,i,s,o=xn){const a=this.elements,l=2*i/(t-e),c=2*i/(r-n),u=(t+e)/(t-e),d=(r+n)/(r-n);let h,p;if(o===xn)h=-(s+i)/(s-i),p=-2*s*i/(s-i);else{if(o!==wn)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);h=-s/(s-i),p=-s*i/(s-i)}return a[0]=l,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=c,a[9]=d,a[13]=0,a[2]=0,a[6]=0,a[10]=h,a[14]=p,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,r,n,i,s,o=xn){const a=this.elements,l=1/(t-e),c=1/(r-n),u=1/(s-i),d=(t+e)*l,h=(r+n)*c;let p,m;if(o===xn)p=(s+i)*u,m=-2*u;else{if(o!==wn)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);p=i*u,m=-1*u}return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-d,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-h,a[2]=0,a[6]=0,a[10]=m,a[14]=-p,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){const t=this.elements,r=e.elements;for(let e=0;e<16;e++)if(t[e]!==r[e])return!1;return!0}fromArray(e,t=0){for(let r=0;r<16;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e[t+9]=r[9],e[t+10]=r[10],e[t+11]=r[11],e[t+12]=r[12],e[t+13]=r[13],e[t+14]=r[14],e[t+15]=r[15],e}}const Ti=new Vector3,Di=new Matrix4,Oi=new Vector3(0,0,0),Ri=new Vector3(1,1,1),ki=new Vector3,Bi=new Vector3,ji=new Vector3,Hi=new Matrix4,Ui=new Quaternion;class Euler{constructor(e=0,t=0,r=0,n=Euler.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=r,this._order=n}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,r,n=this._order){return this._x=e,this._y=t,this._z=r,this._order=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,r=!0){const n=e.elements,i=n[0],s=n[4],o=n[8],a=n[1],l=n[5],c=n[9],u=n[2],d=n[6],h=n[10];switch(t){case"XYZ":this._y=Math.asin(An(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,h),this._z=Math.atan2(-s,i)):(this._x=Math.atan2(d,l),this._z=0);break;case"YXZ":this._x=Math.asin(-An(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(o,h),this._z=Math.atan2(a,l)):(this._y=Math.atan2(-u,i),this._z=0);break;case"ZXY":this._x=Math.asin(An(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,h),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(a,i));break;case"ZYX":this._y=Math.asin(-An(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,h),this._z=Math.atan2(a,i)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(An(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-u,i)):(this._x=0,this._y=Math.atan2(o,h));break;case"XZY":this._z=Math.asin(-An(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(d,l),this._y=Math.atan2(o,i)):(this._x=Math.atan2(-c,h),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===r&&this._onChangeCallback(),this}setFromQuaternion(e,t,r){return Hi.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Hi,t,r)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Ui.setFromEuler(this),this.setFromQuaternion(Ui,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Euler.DEFAULT_ORDER="XYZ";class Layers{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return 0!=(this.mask&e.mask)}isEnabled(e){return 0!=(this.mask&(1<<e|0))}}let zi=0;const qi=new Vector3,$i=new Quaternion,Ji=new Matrix4,Qi=new Vector3,es=new Vector3,ts=new Vector3,rs=new Quaternion,ns=new Vector3(1,0,0),is=new Vector3(0,1,0),ss=new Vector3(0,0,1),os={type:"added"},as={type:"removed"},ls={type:"childadded",child:null},cs={type:"childremoved",child:null};class Object3D extends EventDispatcher{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:zi++}),this.uuid=Cn(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Object3D.DEFAULT_UP.clone();const e=new Vector3,t=new Euler,r=new Quaternion,n=new Vector3(1,1,1);t._onChange((function(){r.setFromEuler(t,!1)})),r._onChange((function(){t.setFromQuaternion(r,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:r},scale:{configurable:!0,enumerable:!0,value:n},modelViewMatrix:{value:new Matrix4},normalMatrix:{value:new Matrix3}}),this.matrix=new Matrix4,this.matrixWorld=new Matrix4,this.matrixAutoUpdate=Object3D.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Object3D.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Layers,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return $i.setFromAxisAngle(e,t),this.quaternion.multiply($i),this}rotateOnWorldAxis(e,t){return $i.setFromAxisAngle(e,t),this.quaternion.premultiply($i),this}rotateX(e){return this.rotateOnAxis(ns,e)}rotateY(e){return this.rotateOnAxis(is,e)}rotateZ(e){return this.rotateOnAxis(ss,e)}translateOnAxis(e,t){return qi.copy(e).applyQuaternion(this.quaternion),this.position.add(qi.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(ns,e)}translateY(e){return this.translateOnAxis(is,e)}translateZ(e){return this.translateOnAxis(ss,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Ji.copy(this.matrixWorld).invert())}lookAt(e,t,r){e.isVector3?Qi.copy(e):Qi.set(e,t,r);const n=this.parent;this.updateWorldMatrix(!0,!1),es.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Ji.lookAt(es,Qi,this.up):Ji.lookAt(Qi,es,this.up),this.quaternion.setFromRotationMatrix(Ji),n&&(Ji.extractRotation(n.matrixWorld),$i.setFromRotationMatrix(Ji),this.quaternion.premultiply($i.invert()))}add(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(os),ls.child=e,this.dispatchEvent(ls),ls.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}const t=this.children.indexOf(e);return-1!==t&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(as),cs.child=e,this.dispatchEvent(cs),cs.child=null),this}removeFromParent(){const e=this.parent;return null!==e&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Ji.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),Ji.multiply(e.parent.matrixWorld)),e.applyMatrix4(Ji),this.add(e),e.updateWorldMatrix(!1,!0),this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let r=0,n=this.children.length;r<n;r++){const n=this.children[r].getObjectByProperty(e,t);if(void 0!==n)return n}}getObjectsByProperty(e,t,r=[]){this[e]===t&&r.push(this);const n=this.children;for(let i=0,s=n.length;i<s;i++)n[i].getObjectsByProperty(e,t,r);return r}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(es,e,ts),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(es,rs,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let r=0,n=t.length;r<n;r++)t[r].traverse(e)}traverseVisible(e){if(!1===this.visible)return;e(this);const t=this.children;for(let r=0,n=t.length;r<n;r++)t[r].traverseVisible(e)}traverseAncestors(e){const t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let r=0,n=t.length;r<n;r++){const n=t[r];!0!==n.matrixWorldAutoUpdate&&!0!==e||n.updateMatrixWorld(e)}}updateWorldMatrix(e,t){const r=this.parent;if(!0===e&&null!==r&&!0===r.matrixWorldAutoUpdate&&r.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===t){const e=this.children;for(let t=0,r=e.length;t<r;t++){const r=e[t];!0===r.matrixWorldAutoUpdate&&r.updateWorldMatrix(!1,!0)}}}toJSON(e){const t=void 0===e||"string"==typeof e,r={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},r.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const n={};function i(t,r){return void 0===t[r.uuid]&&(t[r.uuid]=r.toJSON(e)),r.uuid}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),!0===this.castShadow&&(n.castShadow=!0),!0===this.receiveShadow&&(n.receiveShadow=!0),!1===this.visible&&(n.visible=!1),!1===this.frustumCulled&&(n.frustumCulled=!1),0!==this.renderOrder&&(n.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(n.userData=this.userData),n.layers=this.layers.mask,n.matrix=this.matrix.toArray(),n.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(n.matrixAutoUpdate=!1),this.isInstancedMesh&&(n.type="InstancedMesh",n.count=this.count,n.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(n.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(n.type="BatchedMesh",n.perObjectFrustumCulled=this.perObjectFrustumCulled,n.sortObjects=this.sortObjects,n.drawRanges=this._drawRanges,n.reservedRanges=this._reservedRanges,n.visibility=this._visibility,n.active=this._active,n.bounds=this._bounds.map((e=>({boxInitialized:e.boxInitialized,boxMin:e.box.min.toArray(),boxMax:e.box.max.toArray(),sphereInitialized:e.sphereInitialized,sphereRadius:e.sphere.radius,sphereCenter:e.sphere.center.toArray()}))),n.maxGeometryCount=this._maxGeometryCount,n.maxVertexCount=this._maxVertexCount,n.maxIndexCount=this._maxIndexCount,n.geometryInitialized=this._geometryInitialized,n.geometryCount=this._geometryCount,n.matricesTexture=this._matricesTexture.toJSON(e),null!==this.boundingSphere&&(n.boundingSphere={center:n.boundingSphere.center.toArray(),radius:n.boundingSphere.radius}),null!==this.boundingBox&&(n.boundingBox={min:n.boundingBox.min.toArray(),max:n.boundingBox.max.toArray()})),this.isScene)this.background&&(this.background.isColor?n.background=this.background.toJSON():this.background.isTexture&&(n.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(n.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){n.geometry=i(e.geometries,this.geometry);const t=this.geometry.parameters;if(void 0!==t&&void 0!==t.shapes){const r=t.shapes;if(Array.isArray(r))for(let t=0,n=r.length;t<n;t++){const n=r[t];i(e.shapes,n)}else i(e.shapes,r)}}if(this.isSkinnedMesh&&(n.bindMode=this.bindMode,n.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(i(e.skeletons,this.skeleton),n.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const t=[];for(let r=0,n=this.material.length;r<n;r++)t.push(i(e.materials,this.material[r]));n.material=t}else n.material=i(e.materials,this.material);if(this.children.length>0){n.children=[];for(let t=0;t<this.children.length;t++)n.children.push(this.children[t].toJSON(e).object)}if(this.animations.length>0){n.animations=[];for(let t=0;t<this.animations.length;t++){const r=this.animations[t];n.animations.push(i(e.animations,r))}}if(t){const t=s(e.geometries),n=s(e.materials),i=s(e.textures),o=s(e.images),a=s(e.shapes),l=s(e.skeletons),c=s(e.animations),u=s(e.nodes);t.length>0&&(r.geometries=t),n.length>0&&(r.materials=n),i.length>0&&(r.textures=i),o.length>0&&(r.images=o),a.length>0&&(r.shapes=a),l.length>0&&(r.skeletons=l),c.length>0&&(r.animations=c),u.length>0&&(r.nodes=u)}return r.object=n,r;function s(e){const t=[];for(const r in e){const n=e[r];delete n.metadata,t.push(n)}return t}}clone(e){return(new this.constructor).copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let t=0;t<e.children.length;t++){const r=e.children[t];this.add(r.clone())}return this}}Object3D.DEFAULT_UP=new Vector3(0,1,0),Object3D.DEFAULT_MATRIX_AUTO_UPDATE=!0,Object3D.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const us=new Vector3,ds=new Vector3,hs=new Vector3,ps=new Vector3,ms=new Vector3,fs=new Vector3,gs=new Vector3,ys=new Vector3,bs=new Vector3,vs=new Vector3;class Triangle{constructor(e=new Vector3,t=new Vector3,r=new Vector3){this.a=e,this.b=t,this.c=r}static getNormal(e,t,r,n){n.subVectors(r,t),us.subVectors(e,t),n.cross(us);const i=n.lengthSq();return i>0?n.multiplyScalar(1/Math.sqrt(i)):n.set(0,0,0)}static getBarycoord(e,t,r,n,i){us.subVectors(n,t),ds.subVectors(r,t),hs.subVectors(e,t);const s=us.dot(us),o=us.dot(ds),a=us.dot(hs),l=ds.dot(ds),c=ds.dot(hs),u=s*l-o*o;if(0===u)return i.set(0,0,0),null;const d=1/u,h=(l*a-o*c)*d,p=(s*c-o*a)*d;return i.set(1-h-p,p,h)}static containsPoint(e,t,r,n){return null!==this.getBarycoord(e,t,r,n,ps)&&(ps.x>=0&&ps.y>=0&&ps.x+ps.y<=1)}static getInterpolation(e,t,r,n,i,s,o,a){return null===this.getBarycoord(e,t,r,n,ps)?(a.x=0,a.y=0,"z"in a&&(a.z=0),"w"in a&&(a.w=0),null):(a.setScalar(0),a.addScaledVector(i,ps.x),a.addScaledVector(s,ps.y),a.addScaledVector(o,ps.z),a)}static isFrontFacing(e,t,r,n){return us.subVectors(r,t),ds.subVectors(e,t),us.cross(ds).dot(n)<0}set(e,t,r){return this.a.copy(e),this.b.copy(t),this.c.copy(r),this}setFromPointsAndIndices(e,t,r,n){return this.a.copy(e[t]),this.b.copy(e[r]),this.c.copy(e[n]),this}setFromAttributeAndIndices(e,t,r,n){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,r),this.c.fromBufferAttribute(e,n),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return us.subVectors(this.c,this.b),ds.subVectors(this.a,this.b),.5*us.cross(ds).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Triangle.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Triangle.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,r,n,i){return Triangle.getInterpolation(e,this.a,this.b,this.c,t,r,n,i)}containsPoint(e){return Triangle.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Triangle.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const r=this.a,n=this.b,i=this.c;let s,o;ms.subVectors(n,r),fs.subVectors(i,r),ys.subVectors(e,r);const a=ms.dot(ys),l=fs.dot(ys);if(a<=0&&l<=0)return t.copy(r);bs.subVectors(e,n);const c=ms.dot(bs),u=fs.dot(bs);if(c>=0&&u<=c)return t.copy(n);const d=a*u-c*l;if(d<=0&&a>=0&&c<=0)return s=a/(a-c),t.copy(r).addScaledVector(ms,s);vs.subVectors(e,i);const h=ms.dot(vs),p=fs.dot(vs);if(p>=0&&h<=p)return t.copy(i);const m=h*l-a*p;if(m<=0&&l>=0&&p<=0)return o=l/(l-p),t.copy(r).addScaledVector(fs,o);const f=c*p-h*u;if(f<=0&&u-c>=0&&h-p>=0)return gs.subVectors(i,n),o=(u-c)/(u-c+(h-p)),t.copy(n).addScaledVector(gs,o);const g=1/(f+m+d);return s=m*g,o=d*g,t.copy(r).addScaledVector(ms,s).addScaledVector(fs,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const _s={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},xs={h:0,s:0,l:0},ws={h:0,s:0,l:0};function Ss(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+6*(t-e)*(2/3-r):e}class Color{constructor(e,t,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,r)}set(e,t,r){if(void 0===t&&void 0===r){const t=e;t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t)}else this.setRGB(e,t,r);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Dr){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,Zn.toWorkingColorSpace(this,t),this}setRGB(e,t,r,n=Zn.workingColorSpace){return this.r=e,this.g=t,this.b=r,Zn.toWorkingColorSpace(this,n),this}setHSL(e,t,r,n=Zn.workingColorSpace){if(e=Tn(e,1),t=An(t,0,1),r=An(r,0,1),0===t)this.r=this.g=this.b=r;else{const n=r<=.5?r*(1+t):r+t-r*t,i=2*r-n;this.r=Ss(i,n,e+1/3),this.g=Ss(i,n,e),this.b=Ss(i,n,e-1/3)}return Zn.toWorkingColorSpace(this,n),this}setStyle(e,t=Dr){function r(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^(\w+)\(([^\)]*)\)/.exec(e)){let i;const s=n[1],o=n[2];switch(s){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(i[4]),this.setRGB(Math.min(255,parseInt(i[1],10))/255,Math.min(255,parseInt(i[2],10))/255,Math.min(255,parseInt(i[3],10))/255,t);if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(i[4]),this.setRGB(Math.min(100,parseInt(i[1],10))/100,Math.min(100,parseInt(i[2],10))/100,Math.min(100,parseInt(i[3],10))/100,t);break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(i[4]),this.setHSL(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=n[1],i=r.length;if(3===i)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);if(6===i)return this.setHex(parseInt(r,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Dr){const r=_s[e.toLowerCase()];return void 0!==r?this.setHex(r,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=SRGBToLinear(e.r),this.g=SRGBToLinear(e.g),this.b=SRGBToLinear(e.b),this}copyLinearToSRGB(e){return this.r=LinearToSRGB(e.r),this.g=LinearToSRGB(e.g),this.b=LinearToSRGB(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Dr){return Zn.fromWorkingColorSpace(Ps.copy(this),e),65536*Math.round(An(255*Ps.r,0,255))+256*Math.round(An(255*Ps.g,0,255))+Math.round(An(255*Ps.b,0,255))}getHexString(e=Dr){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Zn.workingColorSpace){Zn.fromWorkingColorSpace(Ps.copy(this),t);const r=Ps.r,n=Ps.g,i=Ps.b,s=Math.max(r,n,i),o=Math.min(r,n,i);let a,l;const c=(o+s)/2;if(o===s)a=0,l=0;else{const e=s-o;switch(l=c<=.5?e/(s+o):e/(2-s-o),s){case r:a=(n-i)/e+(n<i?6:0);break;case n:a=(i-r)/e+2;break;case i:a=(r-n)/e+4}a/=6}return e.h=a,e.s=l,e.l=c,e}getRGB(e,t=Zn.workingColorSpace){return Zn.fromWorkingColorSpace(Ps.copy(this),t),e.r=Ps.r,e.g=Ps.g,e.b=Ps.b,e}getStyle(e=Dr){Zn.fromWorkingColorSpace(Ps.copy(this),e);const t=Ps.r,r=Ps.g,n=Ps.b;return e!==Dr?`color(${e} ${t.toFixed(3)} ${r.toFixed(3)} ${n.toFixed(3)})`:`rgb(${Math.round(255*t)},${Math.round(255*r)},${Math.round(255*n)})`}offsetHSL(e,t,r){return this.getHSL(xs),this.setHSL(xs.h+e,xs.s+t,xs.l+r)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,r){return this.r=e.r+(t.r-e.r)*r,this.g=e.g+(t.g-e.g)*r,this.b=e.b+(t.b-e.b)*r,this}lerpHSL(e,t){this.getHSL(xs),e.getHSL(ws);const r=Dn(xs.h,ws.h,t),n=Dn(xs.s,ws.s,t),i=Dn(xs.l,ws.l,t);return this.setHSL(r,n,i),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,r=this.g,n=this.b,i=e.elements;return this.r=i[0]*t+i[3]*r+i[6]*n,this.g=i[1]*t+i[4]*r+i[7]*n,this.b=i[2]*t+i[5]*r+i[8]*n,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const Ps=new Color;Color.NAMES=_s;let Es=0;class Material extends EventDispatcher{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Es++}),this.uuid=Cn(),this.name="",this.type="Material",this.blending=b,this.side=m,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=ee,this.blendDst=te,this.blendEquation=R,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Color(0,0,0),this.blendAlpha=0,this.depthFunc=me,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Qr,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=jr,this.stencilZFail=jr,this.stencilZPass=jr,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(const t in e){const r=e[t];if(void 0===r){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const n=this[t];void 0!==n?n&&n.isColor?n.set(r):n&&n.isVector3&&r&&r.isVector3?n.copy(r):this[t]=r:console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`)}}toJSON(e){const t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});const r={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function n(e){const t=[];for(const r in e){const n=e[r];delete n.metadata,t.push(n)}return t}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),void 0!==this.roughness&&(r.roughness=this.roughness),void 0!==this.metalness&&(r.metalness=this.metalness),void 0!==this.sheen&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(r.shininess=this.shininess),void 0!==this.clearcoat&&(r.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.iridescence&&(r.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(r.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),void 0!==this.anisotropy&&(r.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(r.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(r.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(e).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(r.combine=this.combine)),void 0!==this.envMapRotation&&(r.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(r.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(r.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(r.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(r.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(r.size=this.size),null!==this.shadowSide&&(r.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==b&&(r.blending=this.blending),this.side!==m&&(r.side=this.side),!0===this.vertexColors&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),!0===this.transparent&&(r.transparent=!0),this.blendSrc!==ee&&(r.blendSrc=this.blendSrc),this.blendDst!==te&&(r.blendDst=this.blendDst),this.blendEquation!==R&&(r.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(r.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(r.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(r.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(r.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(r.blendAlpha=this.blendAlpha),this.depthFunc!==me&&(r.depthFunc=this.depthFunc),!1===this.depthTest&&(r.depthTest=this.depthTest),!1===this.depthWrite&&(r.depthWrite=this.depthWrite),!1===this.colorWrite&&(r.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(r.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==Qr&&(r.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(r.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(r.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==jr&&(r.stencilFail=this.stencilFail),this.stencilZFail!==jr&&(r.stencilZFail=this.stencilZFail),this.stencilZPass!==jr&&(r.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(r.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(r.rotation=this.rotation),!0===this.polygonOffset&&(r.polygonOffset=!0),0!==this.polygonOffsetFactor&&(r.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(r.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(r.linewidth=this.linewidth),void 0!==this.dashSize&&(r.dashSize=this.dashSize),void 0!==this.gapSize&&(r.gapSize=this.gapSize),void 0!==this.scale&&(r.scale=this.scale),!0===this.dithering&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),!0===this.alphaHash&&(r.alphaHash=!0),!0===this.alphaToCoverage&&(r.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(r.premultipliedAlpha=!0),!0===this.forceSinglePass&&(r.forceSinglePass=!0),!0===this.wireframe&&(r.wireframe=!0),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(r.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(r.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(r.flatShading=!0),!1===this.visible&&(r.visible=!1),!1===this.toneMapped&&(r.toneMapped=!1),!1===this.fog&&(r.fog=!1),Object.keys(this.userData).length>0&&(r.userData=this.userData),t){const t=n(e.textures),i=n(e.images);t.length>0&&(r.textures=t),i.length>0&&(r.images=i)}return r}clone(){return(new this.constructor).copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let r=null;if(null!==t){const e=t.length;r=new Array(e);for(let n=0;n!==e;++n)r[n]=t[n].clone()}return this.clippingPlanes=r,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}}class MeshBasicMaterial extends Material{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Color(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Euler,this.combine=ve,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Ms=Cs();function Cs(){const e=new ArrayBuffer(4),t=new Float32Array(e),r=new Uint32Array(e),n=new Uint32Array(512),i=new Uint32Array(512);for(let e=0;e<256;++e){const t=e-127;t<-27?(n[e]=0,n[256|e]=32768,i[e]=24,i[256|e]=24):t<-14?(n[e]=1024>>-t-14,n[256|e]=1024>>-t-14|32768,i[e]=-t-1,i[256|e]=-t-1):t<=15?(n[e]=t+15<<10,n[256|e]=t+15<<10|32768,i[e]=13,i[256|e]=13):t<128?(n[e]=31744,n[256|e]=64512,i[e]=24,i[256|e]=24):(n[e]=31744,n[256|e]=64512,i[e]=13,i[256|e]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let e=1;e<1024;++e){let t=e<<13,r=0;for(;0==(8388608&t);)t<<=1,r-=8388608;t&=-8388609,r+=947912704,s[e]=t|r}for(let e=1024;e<2048;++e)s[e]=939524096+(e-1024<<13);for(let e=1;e<31;++e)o[e]=e<<23;o[31]=1199570944,o[32]=2147483648;for(let e=33;e<63;++e)o[e]=2147483648+(e-32<<23);o[63]=3347054592;for(let e=1;e<64;++e)32!==e&&(a[e]=1024);return{floatView:t,uint32View:r,baseTable:n,shiftTable:i,mantissaTable:s,exponentTable:o,offsetTable:a}}function As(e){Math.abs(e)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),e=An(e,-65504,65504),Ms.floatView[0]=e;const t=Ms.uint32View[0],r=t>>23&511;return Ms.baseTable[r]+((8388607&t)>>Ms.shiftTable[r])}function Ts(e){const t=e>>10;return Ms.uint32View[0]=Ms.mantissaTable[Ms.offsetTable[t]+(1023&e)]+Ms.exponentTable[t],Ms.floatView[0]}const Ds={toHalfFloat:As,fromHalfFloat:Ts},Os=new Vector3,Rs=new Vector2;class BufferAttribute{constructor(e,t,r=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=r,this.usage=cn,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=yt,this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}get updateRange(){return Gn("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,r){e*=this.itemSize,r*=t.itemSize;for(let n=0,i=this.itemSize;n<i;n++)this.array[e+n]=t.array[r+n];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(2===this.itemSize)for(let t=0,r=this.count;t<r;t++)Rs.fromBufferAttribute(this,t),Rs.applyMatrix3(e),this.setXY(t,Rs.x,Rs.y);else if(3===this.itemSize)for(let t=0,r=this.count;t<r;t++)Os.fromBufferAttribute(this,t),Os.applyMatrix3(e),this.setXYZ(t,Os.x,Os.y,Os.z);return this}applyMatrix4(e){for(let t=0,r=this.count;t<r;t++)Os.fromBufferAttribute(this,t),Os.applyMatrix4(e),this.setXYZ(t,Os.x,Os.y,Os.z);return this}applyNormalMatrix(e){for(let t=0,r=this.count;t<r;t++)Os.fromBufferAttribute(this,t),Os.applyNormalMatrix(e),this.setXYZ(t,Os.x,Os.y,Os.z);return this}transformDirection(e){for(let t=0,r=this.count;t<r;t++)Os.fromBufferAttribute(this,t),Os.transformDirection(e),this.setXYZ(t,Os.x,Os.y,Os.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let r=this.array[e*this.itemSize+t];return this.normalized&&(r=Ln(r,this.array)),r}setComponent(e,t,r){return this.normalized&&(r=kn(r,this.array)),this.array[e*this.itemSize+t]=r,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Ln(t,this.array)),t}setX(e,t){return this.normalized&&(t=kn(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Ln(t,this.array)),t}setY(e,t){return this.normalized&&(t=kn(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=Ln(t,this.array)),t}setZ(e,t){return this.normalized&&(t=kn(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=Ln(t,this.array)),t}setW(e,t){return this.normalized&&(t=kn(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,r){return e*=this.itemSize,this.normalized&&(t=kn(t,this.array),r=kn(r,this.array)),this.array[e+0]=t,this.array[e+1]=r,this}setXYZ(e,t,r,n){return e*=this.itemSize,this.normalized&&(t=kn(t,this.array),r=kn(r,this.array),n=kn(n,this.array)),this.array[e+0]=t,this.array[e+1]=r,this.array[e+2]=n,this}setXYZW(e,t,r,n,i){return e*=this.itemSize,this.normalized&&(t=kn(t,this.array),r=kn(r,this.array),n=kn(n,this.array),i=kn(i,this.array)),this.array[e+0]=t,this.array[e+1]=r,this.array[e+2]=n,this.array[e+3]=i,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),this.usage!==cn&&(e.usage=this.usage),e}}class Int8BufferAttribute extends BufferAttribute{constructor(e,t,r){super(new Int8Array(e),t,r)}}class Uint8BufferAttribute extends BufferAttribute{constructor(e,t,r){super(new Uint8Array(e),t,r)}}class Uint8ClampedBufferAttribute extends BufferAttribute{constructor(e,t,r){super(new Uint8ClampedArray(e),t,r)}}class Int16BufferAttribute extends BufferAttribute{constructor(e,t,r){super(new Int16Array(e),t,r)}}class Uint16BufferAttribute extends BufferAttribute{constructor(e,t,r){super(new Uint16Array(e),t,r)}}class Int32BufferAttribute extends BufferAttribute{constructor(e,t,r){super(new Int32Array(e),t,r)}}class Uint32BufferAttribute extends BufferAttribute{constructor(e,t,r){super(new Uint32Array(e),t,r)}}class Float16BufferAttribute extends BufferAttribute{constructor(e,t,r){super(new Uint16Array(e),t,r),this.isFloat16BufferAttribute=!0}getX(e){let t=Ts(this.array[e*this.itemSize]);return this.normalized&&(t=Ln(t,this.array)),t}setX(e,t){return this.normalized&&(t=kn(t,this.array)),this.array[e*this.itemSize]=As(t),this}getY(e){let t=Ts(this.array[e*this.itemSize+1]);return this.normalized&&(t=Ln(t,this.array)),t}setY(e,t){return this.normalized&&(t=kn(t,this.array)),this.array[e*this.itemSize+1]=As(t),this}getZ(e){let t=Ts(this.array[e*this.itemSize+2]);return this.normalized&&(t=Ln(t,this.array)),t}setZ(e,t){return this.normalized&&(t=kn(t,this.array)),this.array[e*this.itemSize+2]=As(t),this}getW(e){let t=Ts(this.array[e*this.itemSize+3]);return this.normalized&&(t=Ln(t,this.array)),t}setW(e,t){return this.normalized&&(t=kn(t,this.array)),this.array[e*this.itemSize+3]=As(t),this}setXY(e,t,r){return e*=this.itemSize,this.normalized&&(t=kn(t,this.array),r=kn(r,this.array)),this.array[e+0]=As(t),this.array[e+1]=As(r),this}setXYZ(e,t,r,n){return e*=this.itemSize,this.normalized&&(t=kn(t,this.array),r=kn(r,this.array),n=kn(n,this.array)),this.array[e+0]=As(t),this.array[e+1]=As(r),this.array[e+2]=As(n),this}setXYZW(e,t,r,n,i){return e*=this.itemSize,this.normalized&&(t=kn(t,this.array),r=kn(r,this.array),n=kn(n,this.array),i=kn(i,this.array)),this.array[e+0]=As(t),this.array[e+1]=As(r),this.array[e+2]=As(n),this.array[e+3]=As(i),this}}class Float32BufferAttribute extends BufferAttribute{constructor(e,t,r){super(new Float32Array(e),t,r)}}let Ls=0;const ks=new Matrix4,Ns=new Object3D,Fs=new Vector3,Is=new Box3,Bs=new Box3,js=new Vector3;class BufferGeometry extends EventDispatcher{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Ls++}),this.uuid=Cn(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(In(e)?Uint32BufferAttribute:Uint16BufferAttribute)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return void 0!==this.attributes[e]}addGroup(e,t,r=0){this.groups.push({start:e,count:t,materialIndex:r})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);const r=this.attributes.normal;if(void 0!==r){const t=(new Matrix3).getNormalMatrix(e);r.applyNormalMatrix(t),r.needsUpdate=!0}const n=this.attributes.tangent;return void 0!==n&&(n.transformDirection(e),n.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(e){return ks.makeRotationFromQuaternion(e),this.applyMatrix4(ks),this}rotateX(e){return ks.makeRotationX(e),this.applyMatrix4(ks),this}rotateY(e){return ks.makeRotationY(e),this.applyMatrix4(ks),this}rotateZ(e){return ks.makeRotationZ(e),this.applyMatrix4(ks),this}translate(e,t,r){return ks.makeTranslation(e,t,r),this.applyMatrix4(ks),this}scale(e,t,r){return ks.makeScale(e,t,r),this.applyMatrix4(ks),this}lookAt(e){return Ns.lookAt(e),Ns.updateMatrix(),this.applyMatrix4(Ns.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Fs).negate(),this.translate(Fs.x,Fs.y,Fs.z),this}setFromPoints(e){const t=[];for(let r=0,n=e.length;r<n;r++){const n=e[r];t.push(n.x,n.y,n.z||0)}return this.setAttribute("position",new Float32BufferAttribute(t,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new Box3);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),void this.boundingBox.set(new Vector3(-1/0,-1/0,-1/0),new Vector3(1/0,1/0,1/0));if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,r=t.length;e<r;e++){const r=t[e];Is.setFromBufferAttribute(r),this.morphTargetsRelative?(js.addVectors(this.boundingBox.min,Is.min),this.boundingBox.expandByPoint(js),js.addVectors(this.boundingBox.max,Is.max),this.boundingBox.expandByPoint(js)):(this.boundingBox.expandByPoint(Is.min),this.boundingBox.expandByPoint(Is.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new Sphere);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),void this.boundingSphere.set(new Vector3,1/0);if(e){const r=this.boundingSphere.center;if(Is.setFromBufferAttribute(e),t)for(let e=0,r=t.length;e<r;e++){const r=t[e];Bs.setFromBufferAttribute(r),this.morphTargetsRelative?(js.addVectors(Is.min,Bs.min),Is.expandByPoint(js),js.addVectors(Is.max,Bs.max),Is.expandByPoint(js)):(Is.expandByPoint(Bs.min),Is.expandByPoint(Bs.max))}Is.getCenter(r);let n=0;for(let t=0,i=e.count;t<i;t++)js.fromBufferAttribute(e,t),n=Math.max(n,r.distanceToSquared(js));if(t)for(let i=0,s=t.length;i<s;i++){const s=t[i],o=this.morphTargetsRelative;for(let t=0,i=s.count;t<i;t++)js.fromBufferAttribute(s,t),o&&(Fs.fromBufferAttribute(e,t),js.add(Fs)),n=Math.max(n,r.distanceToSquared(js))}this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(null===e||void 0===t.position||void 0===t.normal||void 0===t.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const r=t.position,n=t.normal,i=t.uv;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new BufferAttribute(new Float32Array(4*r.count),4));const s=this.getAttribute("tangent"),o=[],a=[];for(let e=0;e<r.count;e++)o[e]=new Vector3,a[e]=new Vector3;const l=new Vector3,c=new Vector3,u=new Vector3,d=new Vector2,h=new Vector2,p=new Vector2,m=new Vector3,f=new Vector3;function g(e,t,n){l.fromBufferAttribute(r,e),c.fromBufferAttribute(r,t),u.fromBufferAttribute(r,n),d.fromBufferAttribute(i,e),h.fromBufferAttribute(i,t),p.fromBufferAttribute(i,n),c.sub(l),u.sub(l),h.sub(d),p.sub(d);const s=1/(h.x*p.y-p.x*h.y);isFinite(s)&&(m.copy(c).multiplyScalar(p.y).addScaledVector(u,-h.y).multiplyScalar(s),f.copy(u).multiplyScalar(h.x).addScaledVector(c,-p.x).multiplyScalar(s),o[e].add(m),o[t].add(m),o[n].add(m),a[e].add(f),a[t].add(f),a[n].add(f))}let y=this.groups;0===y.length&&(y=[{start:0,count:e.count}]);for(let t=0,r=y.length;t<r;++t){const r=y[t],n=r.start;for(let t=n,i=n+r.count;t<i;t+=3)g(e.getX(t+0),e.getX(t+1),e.getX(t+2))}const b=new Vector3,v=new Vector3,_=new Vector3,x=new Vector3;function w(e){_.fromBufferAttribute(n,e),x.copy(_);const t=o[e];b.copy(t),b.sub(_.multiplyScalar(_.dot(t))).normalize(),v.crossVectors(x,t);const r=v.dot(a[e])<0?-1:1;s.setXYZW(e,b.x,b.y,b.z,r)}for(let t=0,r=y.length;t<r;++t){const r=y[t],n=r.start;for(let t=n,i=n+r.count;t<i;t+=3)w(e.getX(t+0)),w(e.getX(t+1)),w(e.getX(t+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(void 0!==t){let r=this.getAttribute("normal");if(void 0===r)r=new BufferAttribute(new Float32Array(3*t.count),3),this.setAttribute("normal",r);else for(let e=0,t=r.count;e<t;e++)r.setXYZ(e,0,0,0);const n=new Vector3,i=new Vector3,s=new Vector3,o=new Vector3,a=new Vector3,l=new Vector3,c=new Vector3,u=new Vector3;if(e)for(let d=0,h=e.count;d<h;d+=3){const h=e.getX(d+0),p=e.getX(d+1),m=e.getX(d+2);n.fromBufferAttribute(t,h),i.fromBufferAttribute(t,p),s.fromBufferAttribute(t,m),c.subVectors(s,i),u.subVectors(n,i),c.cross(u),o.fromBufferAttribute(r,h),a.fromBufferAttribute(r,p),l.fromBufferAttribute(r,m),o.add(c),a.add(c),l.add(c),r.setXYZ(h,o.x,o.y,o.z),r.setXYZ(p,a.x,a.y,a.z),r.setXYZ(m,l.x,l.y,l.z)}else for(let e=0,o=t.count;e<o;e+=3)n.fromBufferAttribute(t,e+0),i.fromBufferAttribute(t,e+1),s.fromBufferAttribute(t,e+2),c.subVectors(s,i),u.subVectors(n,i),c.cross(u),r.setXYZ(e+0,c.x,c.y,c.z),r.setXYZ(e+1,c.x,c.y,c.z),r.setXYZ(e+2,c.x,c.y,c.z);this.normalizeNormals(),r.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,r=e.count;t<r;t++)js.fromBufferAttribute(e,t),js.normalize(),e.setXYZ(t,js.x,js.y,js.z)}toNonIndexed(){function e(e,t){const r=e.array,n=e.itemSize,i=e.normalized,s=new r.constructor(t.length*n);let o=0,a=0;for(let i=0,l=t.length;i<l;i++){o=e.isInterleavedBufferAttribute?t[i]*e.data.stride+e.offset:t[i]*n;for(let e=0;e<n;e++)s[a++]=r[o++]}return new BufferAttribute(s,n,i)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new BufferGeometry,r=this.index.array,n=this.attributes;for(const i in n){const s=e(n[i],r);t.setAttribute(i,s)}const i=this.morphAttributes;for(const n in i){const s=[],o=i[n];for(let t=0,n=o.length;t<n;t++){const n=e(o[t],r);s.push(n)}t.morphAttributes[n]=s}t.morphTargetsRelative=this.morphTargetsRelative;const s=this.groups;for(let e=0,r=s.length;e<r;e++){const r=s[e];t.addGroup(r.start,r.count,r.materialIndex)}return t}toJSON(){const e={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters){const t=this.parameters;for(const r in t)void 0!==t[r]&&(e[r]=t[r]);return e}e.data={attributes:{}};const t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const r=this.attributes;for(const t in r){const n=r[t];e.data.attributes[t]=n.toJSON(e.data)}const n={};let i=!1;for(const t in this.morphAttributes){const r=this.morphAttributes[t],s=[];for(let t=0,n=r.length;t<n;t++){const n=r[t];s.push(n.toJSON(e.data))}s.length>0&&(n[t]=s,i=!0)}i&&(e.data.morphAttributes=n,e.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));const o=this.boundingSphere;return null!==o&&(e.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),e}clone(){return(new this.constructor).copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const r=e.index;null!==r&&this.setIndex(r.clone(t));const n=e.attributes;for(const e in n){const r=n[e];this.setAttribute(e,r.clone(t))}const i=e.morphAttributes;for(const e in i){const r=[],n=i[e];for(let e=0,i=n.length;e<i;e++)r.push(n[e].clone(t));this.morphAttributes[e]=r}this.morphTargetsRelative=e.morphTargetsRelative;const s=e.groups;for(let e=0,t=s.length;e<t;e++){const t=s[e];this.addGroup(t.start,t.count,t.materialIndex)}const o=e.boundingBox;null!==o&&(this.boundingBox=o.clone());const a=e.boundingSphere;return null!==a&&(this.boundingSphere=a.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const Hs=new Matrix4,Us=new Ray,zs=new Sphere,Gs=new Vector3,Ws=new Vector3,Vs=new Vector3,qs=new Vector3,$s=new Vector3,Zs=new Vector3,Ks=new Vector2,Xs=new Vector2,Ys=new Vector2,Js=new Vector3,Qs=new Vector3,eo=new Vector3,to=new Vector3,ro=new Vector3;class Mesh extends Object3D{constructor(e=new BufferGeometry,t=new MeshBasicMaterial){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const r=e[t[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=r.length;e<t;e++){const t=r[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}getVertexPosition(e,t){const r=this.geometry,n=r.attributes.position,i=r.morphAttributes.position,s=r.morphTargetsRelative;t.fromBufferAttribute(n,e);const o=this.morphTargetInfluences;if(i&&o){Zs.set(0,0,0);for(let r=0,n=i.length;r<n;r++){const n=o[r],a=i[r];0!==n&&($s.fromBufferAttribute(a,e),s?Zs.addScaledVector($s,n):Zs.addScaledVector($s.sub(t),n))}t.add(Zs)}return t}raycast(e,t){const r=this.geometry,n=this.material,i=this.matrixWorld;if(void 0!==n){if(null===r.boundingSphere&&r.computeBoundingSphere(),zs.copy(r.boundingSphere),zs.applyMatrix4(i),Us.copy(e.ray).recast(e.near),!1===zs.containsPoint(Us.origin)){if(null===Us.intersectSphere(zs,Gs))return;if(Us.origin.distanceToSquared(Gs)>(e.far-e.near)**2)return}Hs.copy(i).invert(),Us.copy(e.ray).applyMatrix4(Hs),null!==r.boundingBox&&!1===Us.intersectsBox(r.boundingBox)||this._computeIntersections(e,t,Us)}}_computeIntersections(e,t,r){let n;const i=this.geometry,s=this.material,o=i.index,a=i.attributes.position,l=i.attributes.uv,c=i.attributes.uv1,u=i.attributes.normal,d=i.groups,h=i.drawRange;if(null!==o)if(Array.isArray(s))for(let i=0,a=d.length;i<a;i++){const a=d[i],p=s[a.materialIndex];for(let i=Math.max(a.start,h.start),s=Math.min(o.count,Math.min(a.start+a.count,h.start+h.count));i<s;i+=3){n=no(this,p,e,r,l,c,u,o.getX(i),o.getX(i+1),o.getX(i+2)),n&&(n.faceIndex=Math.floor(i/3),n.face.materialIndex=a.materialIndex,t.push(n))}}else{for(let i=Math.max(0,h.start),a=Math.min(o.count,h.start+h.count);i<a;i+=3){n=no(this,s,e,r,l,c,u,o.getX(i),o.getX(i+1),o.getX(i+2)),n&&(n.faceIndex=Math.floor(i/3),t.push(n))}}else if(void 0!==a)if(Array.isArray(s))for(let i=0,o=d.length;i<o;i++){const o=d[i],p=s[o.materialIndex];for(let i=Math.max(o.start,h.start),s=Math.min(a.count,Math.min(o.start+o.count,h.start+h.count));i<s;i+=3){n=no(this,p,e,r,l,c,u,i,i+1,i+2),n&&(n.faceIndex=Math.floor(i/3),n.face.materialIndex=o.materialIndex,t.push(n))}}else{for(let i=Math.max(0,h.start),o=Math.min(a.count,h.start+h.count);i<o;i+=3){n=no(this,s,e,r,l,c,u,i,i+1,i+2),n&&(n.faceIndex=Math.floor(i/3),t.push(n))}}}}function no(e,t,r,n,i,s,o,a,l,c){e.getVertexPosition(a,Ws),e.getVertexPosition(l,Vs),e.getVertexPosition(c,qs);const u=function(e,t,r,n,i,s,o,a){let l;if(l=t.side===f?n.intersectTriangle(o,s,i,!0,a):n.intersectTriangle(i,s,o,t.side===m,a),null===l)return null;ro.copy(a),ro.applyMatrix4(e.matrixWorld);const c=r.ray.origin.distanceTo(ro);return c<r.near||c>r.far?null:{distance:c,point:ro.clone(),object:e}}(e,t,r,n,Ws,Vs,qs,to);if(u){i&&(Ks.fromBufferAttribute(i,a),Xs.fromBufferAttribute(i,l),Ys.fromBufferAttribute(i,c),u.uv=Triangle.getInterpolation(to,Ws,Vs,qs,Ks,Xs,Ys,new Vector2)),s&&(Ks.fromBufferAttribute(s,a),Xs.fromBufferAttribute(s,l),Ys.fromBufferAttribute(s,c),u.uv1=Triangle.getInterpolation(to,Ws,Vs,qs,Ks,Xs,Ys,new Vector2)),o&&(Js.fromBufferAttribute(o,a),Qs.fromBufferAttribute(o,l),eo.fromBufferAttribute(o,c),u.normal=Triangle.getInterpolation(to,Ws,Vs,qs,Js,Qs,eo,new Vector3),u.normal.dot(n.direction)>0&&u.normal.multiplyScalar(-1));const e={a,b:l,c,normal:new Vector3,materialIndex:0};Triangle.getNormal(Ws,Vs,qs,e.normal),u.face=e}return u}class BoxGeometry extends BufferGeometry{constructor(e=1,t=1,r=1,n=1,i=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:r,widthSegments:n,heightSegments:i,depthSegments:s};const o=this;n=Math.floor(n),i=Math.floor(i),s=Math.floor(s);const a=[],l=[],c=[],u=[];let d=0,h=0;function p(e,t,r,n,i,s,p,m,f,g,y){const b=s/f,v=p/g,_=s/2,x=p/2,w=m/2,R=f+1,k=g+1;let j=0,z=0;const q=new Vector3;for(let s=0;s<k;s++){const o=s*v-x;for(let a=0;a<R;a++){const d=a*b-_;q[e]=d*n,q[t]=o*i,q[r]=w,l.push(q.x,q.y,q.z),q[e]=0,q[t]=0,q[r]=m>0?1:-1,c.push(q.x,q.y,q.z),u.push(a/f),u.push(1-s/g),j+=1}}for(let e=0;e<g;e++)for(let t=0;t<f;t++){const r=d+t+R*e,n=d+t+R*(e+1),i=d+(t+1)+R*(e+1),s=d+(t+1)+R*e;a.push(r,n,s),a.push(n,i,s),z+=6}o.addGroup(h,z,y),h+=z,d+=j}p("z","y","x",-1,-1,r,t,e,s,i,0),p("z","y","x",1,-1,r,t,-e,s,i,1),p("x","z","y",1,1,e,r,t,n,s,2),p("x","z","y",1,-1,e,r,-t,n,s,3),p("x","y","z",1,-1,e,t,r,n,i,4),p("x","y","z",-1,-1,e,t,-r,n,i,5),this.setIndex(a),this.setAttribute("position",new Float32BufferAttribute(l,3)),this.setAttribute("normal",new Float32BufferAttribute(c,3)),this.setAttribute("uv",new Float32BufferAttribute(u,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new BoxGeometry(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function io(e){const t={};for(const r in e){t[r]={};for(const n in e[r]){const i=e[r][n];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[r][n]=null):t[r][n]=i.clone():Array.isArray(i)?t[r][n]=i.slice():t[r][n]=i}}return t}function so(e){const t={};for(let r=0;r<e.length;r++){const n=io(e[r]);for(const e in n)t[e]=n[e]}return t}function oo(e){return null===e.getRenderTarget()?e.outputColorSpace:Zn.workingColorSpace}const ao={clone:io,merge:so};class ShaderMaterial extends Material{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1,clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==e&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=io(e.uniforms),this.uniformsGroups=function(e){const t=[];for(let r=0;r<e.length;r++)t.push(e[r].clone());return t}(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const r in this.uniforms){const n=this.uniforms[r].value;n&&n.isTexture?t.uniforms[r]={type:"t",value:n.toJSON(e).uuid}:n&&n.isColor?t.uniforms[r]={type:"c",value:n.getHex()}:n&&n.isVector2?t.uniforms[r]={type:"v2",value:n.toArray()}:n&&n.isVector3?t.uniforms[r]={type:"v3",value:n.toArray()}:n&&n.isVector4?t.uniforms[r]={type:"v4",value:n.toArray()}:n&&n.isMatrix3?t.uniforms[r]={type:"m3",value:n.toArray()}:n&&n.isMatrix4?t.uniforms[r]={type:"m4",value:n.toArray()}:t.uniforms[r]={value:n}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const r={};for(const e in this.extensions)!0===this.extensions[e]&&(r[e]=!0);return Object.keys(r).length>0&&(t.extensions=r),t}}class Camera extends Object3D{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Matrix4,this.projectionMatrix=new Matrix4,this.projectionMatrixInverse=new Matrix4,this.coordinateSystem=xn}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}const lo=new Vector3,co=new Vector2,uo=new Vector2;class PerspectiveCamera extends Camera{constructor(e=50,t=1,r=.1,n=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=r,this.far=n,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=2*Mn*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(.5*En*this.fov);return.5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*Mn*Math.atan(Math.tan(.5*En*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,r){lo.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(lo.x,lo.y).multiplyScalar(-e/lo.z),lo.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),r.set(lo.x,lo.y).multiplyScalar(-e/lo.z)}getViewSize(e,t){return this.getViewBounds(e,co,uo),t.subVectors(uo,co)}setViewOffset(e,t,r,n,i,s){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=r,this.view.offsetY=n,this.view.width=i,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(.5*En*this.fov)/this.zoom,r=2*t,n=this.aspect*r,i=-.5*n;const s=this.view;if(null!==this.view&&this.view.enabled){const e=s.fullWidth,o=s.fullHeight;i+=s.offsetX*n/e,t-=s.offsetY*r/o,n*=s.width/e,r*=s.height/o}const o=this.filmOffset;0!==o&&(i+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+n,t,t-r,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const ho=-90;class CubeCamera extends Object3D{constructor(e,t,r){super(),this.type="CubeCamera",this.renderTarget=r,this.coordinateSystem=null,this.activeMipmapLevel=0;const n=new PerspectiveCamera(ho,1,e,t);n.layers=this.layers,this.add(n);const i=new PerspectiveCamera(ho,1,e,t);i.layers=this.layers,this.add(i);const s=new PerspectiveCamera(ho,1,e,t);s.layers=this.layers,this.add(s);const o=new PerspectiveCamera(ho,1,e,t);o.layers=this.layers,this.add(o);const a=new PerspectiveCamera(ho,1,e,t);a.layers=this.layers,this.add(a);const l=new PerspectiveCamera(ho,1,e,t);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[r,n,i,s,o,a]=t;for(const e of t)this.remove(e);if(e===xn)r.up.set(0,1,0),r.lookAt(1,0,0),n.up.set(0,1,0),n.lookAt(-1,0,0),i.up.set(0,0,-1),i.lookAt(0,1,0),s.up.set(0,0,1),s.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),a.up.set(0,1,0),a.lookAt(0,0,-1);else{if(e!==wn)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);r.up.set(0,-1,0),r.lookAt(-1,0,0),n.up.set(0,-1,0),n.lookAt(1,0,0),i.up.set(0,0,1),i.lookAt(0,1,0),s.up.set(0,0,-1),s.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),a.up.set(0,-1,0),a.lookAt(0,0,-1)}for(const e of t)this.add(e),e.updateMatrixWorld()}update(e,t){null===this.parent&&this.updateMatrixWorld();const{renderTarget:r,activeMipmapLevel:n}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[i,s,o,a,l,c]=this.children,u=e.getRenderTarget(),d=e.getActiveCubeFace(),h=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;const m=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0,n),e.render(t,i),e.setRenderTarget(r,1,n),e.render(t,s),e.setRenderTarget(r,2,n),e.render(t,o),e.setRenderTarget(r,3,n),e.render(t,a),e.setRenderTarget(r,4,n),e.render(t,l),r.texture.generateMipmaps=m,e.setRenderTarget(r,5,n),e.render(t,c),e.setRenderTarget(u,d,h),e.xr.enabled=p,r.texture.needsPMREMUpdate=!0}}class CubeTexture extends Texture{constructor(e,t,r,n,i,s,o,a,l,c){super(e=void 0!==e?e:[],t=void 0!==t?t:We,r,n,i,s,o,a,l,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class WebGLCubeRenderTarget extends WebGLRenderTarget{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const r={width:e,height:e,depth:1},n=[r,r,r,r,r,r];this.texture=new CubeTexture(n,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==t.generateMipmaps&&t.generateMipmaps,this.texture.minFilter=void 0!==t.minFilter?t.minFilter:ot}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const r={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t"},n=new BoxGeometry(5,5,5),i=new ShaderMaterial({name:"CubemapFromEquirect",uniforms:io(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:f,blending:y});i.uniforms.tEquirect.value=t;const s=new Mesh(n,i),o=t.minFilter;t.minFilter===ct&&(t.minFilter=ot);return new CubeCamera(1,10,this).update(e,s),t.minFilter=o,s.geometry.dispose(),s.material.dispose(),this}clear(e,t,r,n){const i=e.getRenderTarget();for(let i=0;i<6;i++)e.setRenderTarget(this,i),e.clear(t,r,n);e.setRenderTarget(i)}}const po=new Vector3,mo=new Vector3,fo=new Matrix3;class Plane{constructor(e=new Vector3(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,r,n){return this.normal.set(e,t,r),this.constant=n,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,r){const n=po.subVectors(r,t).cross(mo.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(n,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const r=e.delta(po),n=this.normal.dot(r);if(0===n)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;const i=-(e.start.dot(this.normal)+this.constant)/n;return i<0||i>1?null:t.copy(e.start).addScaledVector(r,i)}intersectsLine(e){const t=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return t<0&&r>0||r<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const r=t||fo.getNormalMatrix(e),n=this.coplanarPoint(po).applyMatrix4(e),i=this.normal.applyMatrix3(r).normalize();return this.constant=-n.dot(i),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return(new this.constructor).copy(this)}}const go=new Sphere,yo=new Vector3;class Frustum{constructor(e=new Plane,t=new Plane,r=new Plane,n=new Plane,i=new Plane,s=new Plane){this.planes=[e,t,r,n,i,s]}set(e,t,r,n,i,s){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(r),o[3].copy(n),o[4].copy(i),o[5].copy(s),this}copy(e){const t=this.planes;for(let r=0;r<6;r++)t[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e,t=xn){const r=this.planes,n=e.elements,i=n[0],s=n[1],o=n[2],a=n[3],l=n[4],c=n[5],u=n[6],d=n[7],h=n[8],p=n[9],m=n[10],f=n[11],g=n[12],y=n[13],b=n[14],v=n[15];if(r[0].setComponents(a-i,d-l,f-h,v-g).normalize(),r[1].setComponents(a+i,d+l,f+h,v+g).normalize(),r[2].setComponents(a+s,d+c,f+p,v+y).normalize(),r[3].setComponents(a-s,d-c,f-p,v-y).normalize(),r[4].setComponents(a-o,d-u,f-m,v-b).normalize(),t===xn)r[5].setComponents(a+o,d+u,f+m,v+b).normalize();else{if(t!==wn)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);r[5].setComponents(o,u,m,b).normalize()}return this}intersectsObject(e){if(void 0!==e.boundingSphere)null===e.boundingSphere&&e.computeBoundingSphere(),go.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;null===t.boundingSphere&&t.computeBoundingSphere(),go.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(go)}intersectsSprite(e){return go.center.set(0,0,0),go.radius=.7071067811865476,go.applyMatrix4(e.matrixWorld),this.intersectsSphere(go)}intersectsSphere(e){const t=this.planes,r=e.center,n=-e.radius;for(let e=0;e<6;e++){if(t[e].distanceToPoint(r)<n)return!1}return!0}intersectsBox(e){const t=this.planes;for(let r=0;r<6;r++){const n=t[r];if(yo.x=n.normal.x>0?e.max.x:e.min.x,yo.y=n.normal.y>0?e.max.y:e.min.y,yo.z=n.normal.z>0?e.max.z:e.min.z,n.distanceToPoint(yo)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let r=0;r<6;r++)if(t[r].distanceToPoint(e)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function WebGLAnimation(){let e=null,t=!1,r=null,n=null;function i(t,s){r(t,s),n=e.requestAnimationFrame(i)}return{start:function(){!0!==t&&null!==r&&(n=e.requestAnimationFrame(i),t=!0)},stop:function(){e.cancelAnimationFrame(n),t=!1},setAnimationLoop:function(e){r=e},setContext:function(t){e=t}}}function WebGLAttributes(e,t){const r=t.isWebGL2,n=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),n.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);const r=n.get(t);r&&(e.deleteBuffer(r.buffer),n.delete(t))},update:function(t,i){if(t.isGLBufferAttribute){const e=n.get(t);return void((!e||e.version<t.version)&&n.set(t,{buffer:t.buffer,type:t.type,bytesPerElement:t.elementSize,version:t.version}))}t.isInterleavedBufferAttribute&&(t=t.data);const s=n.get(t);if(void 0===s)n.set(t,function(t,n){const i=t.array,s=t.usage,o=i.byteLength,a=e.createBuffer();let l;if(e.bindBuffer(n,a),e.bufferData(n,i,s),t.onUploadCallback(),i instanceof Float32Array)l=e.FLOAT;else if(i instanceof Uint16Array)if(t.isFloat16BufferAttribute){if(!r)throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");l=e.HALF_FLOAT}else l=e.UNSIGNED_SHORT;else if(i instanceof Int16Array)l=e.SHORT;else if(i instanceof Uint32Array)l=e.UNSIGNED_INT;else if(i instanceof Int32Array)l=e.INT;else if(i instanceof Int8Array)l=e.BYTE;else if(i instanceof Uint8Array)l=e.UNSIGNED_BYTE;else{if(!(i instanceof Uint8ClampedArray))throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+i);l=e.UNSIGNED_BYTE}return{buffer:a,type:l,bytesPerElement:i.BYTES_PER_ELEMENT,version:t.version,size:o}}(t,i));else if(s.version<t.version){if(s.size!==t.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");!function(t,n,i){const s=n.array,o=n._updateRange,a=n.updateRanges;if(e.bindBuffer(i,t),-1===o.count&&0===a.length&&e.bufferSubData(i,0,s),0!==a.length){for(let t=0,n=a.length;t<n;t++){const n=a[t];r?e.bufferSubData(i,n.start*s.BYTES_PER_ELEMENT,s,n.start,n.count):e.bufferSubData(i,n.start*s.BYTES_PER_ELEMENT,s.subarray(n.start,n.start+n.count))}n.clearUpdateRanges()}-1!==o.count&&(r?e.bufferSubData(i,o.offset*s.BYTES_PER_ELEMENT,s,o.offset,o.count):e.bufferSubData(i,o.offset*s.BYTES_PER_ELEMENT,s.subarray(o.offset,o.offset+o.count)),o.count=-1),n.onUploadCallback()}(s.buffer,t,i),s.version=t.version}}}}class PlaneGeometry extends BufferGeometry{constructor(e=1,t=1,r=1,n=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:r,heightSegments:n};const i=e/2,s=t/2,o=Math.floor(r),a=Math.floor(n),l=o+1,c=a+1,u=e/o,d=t/a,h=[],p=[],m=[],f=[];for(let e=0;e<c;e++){const t=e*d-s;for(let r=0;r<l;r++){const n=r*u-i;p.push(n,-t,0),m.push(0,0,1),f.push(r/o),f.push(1-e/a)}}for(let e=0;e<a;e++)for(let t=0;t<o;t++){const r=t+l*e,n=t+l*(e+1),i=t+1+l*(e+1),s=t+1+l*e;h.push(r,n,s),h.push(n,i,s)}this.setIndex(h),this.setAttribute("position",new Float32BufferAttribute(p,3)),this.setAttribute("normal",new Float32BufferAttribute(m,3)),this.setAttribute("uv",new Float32BufferAttribute(f,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new PlaneGeometry(e.width,e.height,e.widthSegments,e.heightSegments)}}const bo={alphahash_fragment:"#ifdef USE_ALPHAHASH\n\tif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif",alphahash_pars_fragment:"#ifdef USE_ALPHAHASH\n\tconst float ALPHA_HASH_SCALE = 0.05;\n\tfloat hash2D( vec2 value ) {\n\t\treturn fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n\t}\n\tfloat hash3D( vec3 value ) {\n\t\treturn hash2D( vec2( hash2D( value.xy ), value.z ) );\n\t}\n\tfloat getAlphaHashThreshold( vec3 position ) {\n\t\tfloat maxDeriv = max(\n\t\t\tlength( dFdx( position.xyz ) ),\n\t\t\tlength( dFdy( position.xyz ) )\n\t\t);\n\t\tfloat pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n\t\tvec2 pixScales = vec2(\n\t\t\texp2( floor( log2( pixScale ) ) ),\n\t\t\texp2( ceil( log2( pixScale ) ) )\n\t\t);\n\t\tvec2 alpha = vec2(\n\t\t\thash3D( floor( pixScales.x * position.xyz ) ),\n\t\t\thash3D( floor( pixScales.y * position.xyz ) )\n\t\t);\n\t\tfloat lerpFactor = fract( log2( pixScale ) );\n\t\tfloat x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n\t\tfloat a = min( lerpFactor, 1.0 - lerpFactor );\n\t\tvec3 cases = vec3(\n\t\t\tx * x / ( 2.0 * a * ( 1.0 - a ) ),\n\t\t\t( x - 0.5 * a ) / ( 1.0 - a ),\n\t\t\t1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n\t\t);\n\t\tfloat threshold = ( x < ( 1.0 - a ) )\n\t\t\t? ( ( x < a ) ? cases.x : cases.y )\n\t\t\t: cases.z;\n\t\treturn clamp( threshold , 1.0e-6, 1.0 );\n\t}\n#endif",alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n\t#ifdef ALPHA_TO_COVERAGE\n\tdiffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\tif ( diffuseColor.a < alphaTest ) discard;\n\t#endif\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_CLEARCOAT ) \n\t\tclearcoatSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_SHEEN ) \n\t\tsheenSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",batching_pars_vertex:"#ifdef USE_BATCHING\n\tattribute float batchId;\n\tuniform highp sampler2D batchingTexture;\n\tmat4 getBatchingMatrix( const in float i ) {\n\t\tint size = textureSize( batchingTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n#endif",batching_vertex:"#ifdef USE_BATCHING\n\tmat4 batchingMatrix = getBatchingMatrix( batchId );\n#endif",begin_vertex:"vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n\tvPosition = vec3( position );\n#endif",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"float G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n} // validated",iridescence_fragment:"#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660,  0.0556434,\n\t\t-1.5371385,  1.8760108, -0.2040259,\n\t\t-0.4985314,  0.0415560,  1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\treturn vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vBumpMapUv );\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\n\t\tvec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#ifdef ALPHA_TO_COVERAGE\n\t\tfloat distanceToPlane, distanceGradient;\n\t\tfloat clipOpacity = 1.0;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\tclipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\tif ( clipOpacity == 0.0 ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tfloat unionClipOpacity = 1.0;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\t\tunionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tclipOpacity *= 1.0 - unionClipOpacity;\n\t\t#endif\n\t\tdiffuseColor.a *= clipOpacity;\n\t\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tbool clipped = true;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tif ( clipped ) discard;\n\t\t#endif\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n\tmat3 bm = mat3( batchingMatrix );\n\ttransformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n\ttransformedNormal = bm * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = bm * transformedTangent;\n\t#endif\n#endif\n#ifdef USE_INSTANCING\n\tmat3 im = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n\ttransformedNormal = im * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = im * transformedTangent;\n\t#endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\ttransformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",colorspace_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",colorspace_pars_fragment:"\nconst mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3(\n\tvec3( 0.8224621, 0.177538, 0.0 ),\n\tvec3( 0.0331941, 0.9668058, 0.0 ),\n\tvec3( 0.0170827, 0.0723974, 0.9105199 )\n);\nconst mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.2249401, - 0.2249404, 0.0 ),\n\tvec3( - 0.0420569, 1.0420571, 0.0 ),\n\tvec3( - 0.0196376, - 0.0786361, 1.0982735 )\n);\nvec4 LinearSRGBToLinearDisplayP3( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a );\n}\nvec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a );\n}\nvec4 LinearTransferOETF( in vec4 value ) {\n\treturn value;\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn sRGBTransferOETF( value );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform mat3 envMapRotation;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n\tuniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( LEGACY_LIGHTS )\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#else\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tif( material.anisotropy == 0.0 ) {\n\t\tanisotropyV = vec2( 1.0, 0.0 );\n\t} else {\n\t\tanisotropyV /= material.anisotropy;\n\t\tmaterial.anisotropy = saturate( material.anisotropy );\n\t}\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n    float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n    float x2 = x * x;\n    float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n    return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometryNormal;\n\t\tvec3 viewDir = geometryViewDir;\n\t\tvec3 position = geometryPosition;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3(    0, 1,    0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n\tgeometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometryPosition, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometryPosition, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#if defined( USE_LIGHT_PROBES )\n\t\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometryNormal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphinstance_vertex:"#ifdef USE_INSTANCING_MORPH\n\tfloat morphTargetInfluences[MORPHTARGETS_COUNT];\n\tfloat morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tmorphTargetInfluences[i] =  texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n\t}\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_INSTANCING_MORPH\n\t\tuniform float morphTargetBaseInfluence;\n\t#endif\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\t#ifndef USE_INSTANCING_MORPH\n\t\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\t#endif\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 nonPerturbedNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = nonPerturbedNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",opaque_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n\tmvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t  f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t  f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tint size = textureSize( boneTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3(  1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108,  1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605,  1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.6605, - 0.1246, - 0.0182 ),\n\tvec3( - 0.5876, 1.1329, - 0.1006 ),\n\tvec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n\tvec3( 0.6274, 0.0691, 0.0164 ),\n\tvec3( 0.3293, 0.9195, 0.0880 ),\n\tvec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n\tvec3 x2 = x * x;\n\tvec3 x4 = x2 * x2;\n\treturn + 15.5 * x4 * x2\n\t\t- 40.14 * x4 * x\n\t\t+ 31.96 * x4\n\t\t- 6.868 * x2 * x\n\t\t+ 0.4298 * x2\n\t\t+ 0.1191 * x\n\t\t- 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n\tconst mat3 AgXInsetMatrix = mat3(\n\t\tvec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n\t\tvec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n\t\tvec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n\t);\n\tconst mat3 AgXOutsetMatrix = mat3(\n\t\tvec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n\t\tvec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n\t\tvec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n\t);\n\tconst float AgxMinEv = - 12.47393;\tconst float AgxMaxEv = 4.026069;\n\tcolor *= toneMappingExposure;\n\tcolor = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n\tcolor = AgXInsetMatrix * color;\n\tcolor = max( color, 1e-10 );\tcolor = log2( color );\n\tcolor = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n\tcolor = clamp( color, 0.0, 1.0 );\n\tcolor = agxDefaultContrastApprox( color );\n\tcolor = AgXOutsetMatrix * color;\n\tcolor = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n\tcolor = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n\tcolor = clamp( color, 0.0, 1.0 );\n\treturn color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n\tfloat startCompression = 0.8 - 0.04;\n\tfloat desaturation = 0.15;\n\tcolor *= toneMappingExposure;\n\tfloat x = min(color.r, min(color.g, color.b));\n\tfloat offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n\tcolor -= offset;\n\tfloat peak = max(color.r, max(color.g, color.b));\n\tif (peak < startCompression) return color;\n\tfloat d = 1. - startCompression;\n\tfloat newPeak = 1. - d * d / (peak + d - startCompression);\n\tcolor *= newPeak / peak;\n\tfloat g = 1. - 1. / (desaturation * (peak - newPeak) + 1.);\n\treturn mix(color, vec3(1, 1, 1), g);\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a *  a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif",uv_pars_fragment:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_BATCHING\n\t\tworldPosition = batchingMatrix * worldPosition;\n\t#endif\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",depth_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_lambert_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\t#endif\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",shadow_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}"},vo={common:{diffuse:{value:new Color(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Matrix3},alphaMap:{value:null},alphaMapTransform:{value:new Matrix3},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Matrix3}},envmap:{envMap:{value:null},envMapRotation:{value:new Matrix3},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Matrix3}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Matrix3}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Matrix3},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Matrix3},normalScale:{value:new Vector2(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Matrix3},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Matrix3}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Matrix3}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Matrix3}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Color(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Color(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Matrix3},alphaTest:{value:0},uvTransform:{value:new Matrix3}},sprite:{diffuse:{value:new Color(16777215)},opacity:{value:1},center:{value:new Vector2(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Matrix3},alphaMap:{value:null},alphaMapTransform:{value:new Matrix3},alphaTest:{value:0}}},_o={basic:{uniforms:so([vo.common,vo.specularmap,vo.envmap,vo.aomap,vo.lightmap,vo.fog]),vertexShader:bo.meshbasic_vert,fragmentShader:bo.meshbasic_frag},lambert:{uniforms:so([vo.common,vo.specularmap,vo.envmap,vo.aomap,vo.lightmap,vo.emissivemap,vo.bumpmap,vo.normalmap,vo.displacementmap,vo.fog,vo.lights,{emissive:{value:new Color(0)}}]),vertexShader:bo.meshlambert_vert,fragmentShader:bo.meshlambert_frag},phong:{uniforms:so([vo.common,vo.specularmap,vo.envmap,vo.aomap,vo.lightmap,vo.emissivemap,vo.bumpmap,vo.normalmap,vo.displacementmap,vo.fog,vo.lights,{emissive:{value:new Color(0)},specular:{value:new Color(1118481)},shininess:{value:30}}]),vertexShader:bo.meshphong_vert,fragmentShader:bo.meshphong_frag},standard:{uniforms:so([vo.common,vo.envmap,vo.aomap,vo.lightmap,vo.emissivemap,vo.bumpmap,vo.normalmap,vo.displacementmap,vo.roughnessmap,vo.metalnessmap,vo.fog,vo.lights,{emissive:{value:new Color(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:bo.meshphysical_vert,fragmentShader:bo.meshphysical_frag},toon:{uniforms:so([vo.common,vo.aomap,vo.lightmap,vo.emissivemap,vo.bumpmap,vo.normalmap,vo.displacementmap,vo.gradientmap,vo.fog,vo.lights,{emissive:{value:new Color(0)}}]),vertexShader:bo.meshtoon_vert,fragmentShader:bo.meshtoon_frag},matcap:{uniforms:so([vo.common,vo.bumpmap,vo.normalmap,vo.displacementmap,vo.fog,{matcap:{value:null}}]),vertexShader:bo.meshmatcap_vert,fragmentShader:bo.meshmatcap_frag},points:{uniforms:so([vo.points,vo.fog]),vertexShader:bo.points_vert,fragmentShader:bo.points_frag},dashed:{uniforms:so([vo.common,vo.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:bo.linedashed_vert,fragmentShader:bo.linedashed_frag},depth:{uniforms:so([vo.common,vo.displacementmap]),vertexShader:bo.depth_vert,fragmentShader:bo.depth_frag},normal:{uniforms:so([vo.common,vo.bumpmap,vo.normalmap,vo.displacementmap,{opacity:{value:1}}]),vertexShader:bo.meshnormal_vert,fragmentShader:bo.meshnormal_frag},sprite:{uniforms:so([vo.sprite,vo.fog]),vertexShader:bo.sprite_vert,fragmentShader:bo.sprite_frag},background:{uniforms:{uvTransform:{value:new Matrix3},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:bo.background_vert,fragmentShader:bo.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Matrix3}},vertexShader:bo.backgroundCube_vert,fragmentShader:bo.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:bo.cube_vert,fragmentShader:bo.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:bo.equirect_vert,fragmentShader:bo.equirect_frag},distanceRGBA:{uniforms:so([vo.common,vo.displacementmap,{referencePosition:{value:new Vector3},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:bo.distanceRGBA_vert,fragmentShader:bo.distanceRGBA_frag},shadow:{uniforms:so([vo.lights,vo.fog,{color:{value:new Color(0)},opacity:{value:1}}]),vertexShader:bo.shadow_vert,fragmentShader:bo.shadow_frag}};_o.physical={uniforms:so([_o.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Matrix3},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Matrix3},clearcoatNormalScale:{value:new Vector2(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Matrix3},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Matrix3},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Matrix3},sheen:{value:0},sheenColor:{value:new Color(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Matrix3},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Matrix3},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Matrix3},transmissionSamplerSize:{value:new Vector2},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Matrix3},attenuationDistance:{value:0},attenuationColor:{value:new Color(0)},specularColor:{value:new Color(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Matrix3},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Matrix3},anisotropyVector:{value:new Vector2},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Matrix3}}]),vertexShader:bo.meshphysical_vert,fragmentShader:bo.meshphysical_frag};const xo={r:0,b:0,g:0},wo=new Euler,So=new Matrix4;function WebGLBackground(e,t,r,n,i,s,o){const a=new Color(0);let l,c,u=!0===s?0:1,d=null,h=0,p=null;function g(t,r){t.getRGB(xo,oo(e)),n.buffers.color.setClear(xo.r,xo.g,xo.b,r,o)}return{getClearColor:function(){return a},setClearColor:function(e,t=1){a.set(e),u=t,g(a,u)},getClearAlpha:function(){return u},setClearAlpha:function(e){u=e,g(a,u)},render:function(s,y){let b=!1,v=!0===y.isScene?y.background:null;if(v&&v.isTexture){v=(y.backgroundBlurriness>0?r:t).get(v)}null===v?g(a,u):v&&v.isColor&&(g(v,1),b=!0);const _=e.xr.getEnvironmentBlendMode();"additive"===_?n.buffers.color.setClear(0,0,0,1,o):"alpha-blend"===_&&n.buffers.color.setClear(0,0,0,0,o),(e.autoClear||b)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),v&&(v.isCubeTexture||v.mapping===Xe)?(void 0===c&&(c=new Mesh(new BoxGeometry(1,1,1),new ShaderMaterial({name:"BackgroundCubeMaterial",uniforms:io(_o.backgroundCube.uniforms),vertexShader:_o.backgroundCube.vertexShader,fragmentShader:_o.backgroundCube.fragmentShader,side:f,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(e,t,r){this.matrixWorld.copyPosition(r.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(c)),wo.copy(y.backgroundRotation),wo.x*=-1,wo.y*=-1,wo.z*=-1,v.isCubeTexture&&!1===v.isRenderTargetTexture&&(wo.y*=-1,wo.z*=-1),c.material.uniforms.envMap.value=v,c.material.uniforms.flipEnvMap.value=v.isCubeTexture&&!1===v.isRenderTargetTexture?-1:1,c.material.uniforms.backgroundBlurriness.value=y.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=y.backgroundIntensity,c.material.uniforms.backgroundRotation.value.setFromMatrix4(So.makeRotationFromEuler(wo)),c.material.toneMapped=Zn.getTransfer(v.colorSpace)!==Nr,d===v&&h===v.version&&p===e.toneMapping||(c.material.needsUpdate=!0,d=v,h=v.version,p=e.toneMapping),c.layers.enableAll(),s.unshift(c,c.geometry,c.material,0,0,null)):v&&v.isTexture&&(void 0===l&&(l=new Mesh(new PlaneGeometry(2,2),new ShaderMaterial({name:"BackgroundMaterial",uniforms:io(_o.background.uniforms),vertexShader:_o.background.vertexShader,fragmentShader:_o.background.fragmentShader,side:m,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(l)),l.material.uniforms.t2D.value=v,l.material.uniforms.backgroundIntensity.value=y.backgroundIntensity,l.material.toneMapped=Zn.getTransfer(v.colorSpace)!==Nr,!0===v.matrixAutoUpdate&&v.updateMatrix(),l.material.uniforms.uvTransform.value.copy(v.matrix),d===v&&h===v.version&&p===e.toneMapping||(l.material.needsUpdate=!0,d=v,h=v.version,p=e.toneMapping),l.layers.enableAll(),s.unshift(l,l.geometry,l.material,0,0,null))}}}function WebGLBindingStates(e,t,r,n){const i=e.getParameter(e.MAX_VERTEX_ATTRIBS),s=n.isWebGL2?null:t.get("OES_vertex_array_object"),o=n.isWebGL2||null!==s,a={},l=p(null);let c=l,u=!1;function d(t){return n.isWebGL2?e.bindVertexArray(t):s.bindVertexArrayOES(t)}function h(t){return n.isWebGL2?e.deleteVertexArray(t):s.deleteVertexArrayOES(t)}function p(e){const t=[],r=[],n=[];for(let e=0;e<i;e++)t[e]=0,r[e]=0,n[e]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:r,attributeDivisors:n,object:e,attributes:{},index:null}}function m(){const e=c.newAttributes;for(let t=0,r=e.length;t<r;t++)e[t]=0}function f(e){g(e,0)}function g(r,i){const s=c.newAttributes,o=c.enabledAttributes,a=c.attributeDivisors;if(s[r]=1,0===o[r]&&(e.enableVertexAttribArray(r),o[r]=1),a[r]!==i){(n.isWebGL2?e:t.get("ANGLE_instanced_arrays"))[n.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](r,i),a[r]=i}}function y(){const t=c.newAttributes,r=c.enabledAttributes;for(let n=0,i=r.length;n<i;n++)r[n]!==t[n]&&(e.disableVertexAttribArray(n),r[n]=0)}function b(t,r,n,i,s,o,a){!0===a?e.vertexAttribIPointer(t,r,n,s,o):e.vertexAttribPointer(t,r,n,i,s,o)}function v(){_(),u=!0,c!==l&&(c=l,d(c.object))}function _(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:function(i,l,h,v,_){let x=!1;if(o){const t=function(t,r,i){const o=!0===i.wireframe;let l=a[t.id];void 0===l&&(l={},a[t.id]=l);let c=l[r.id];void 0===c&&(c={},l[r.id]=c);let u=c[o];void 0===u&&(u=p(n.isWebGL2?e.createVertexArray():s.createVertexArrayOES()),c[o]=u);return u}(v,h,l);c!==t&&(c=t,d(c.object)),x=function(e,t,r,n){const i=c.attributes,s=t.attributes;let o=0;const a=r.getAttributes();for(const t in a){if(a[t].location>=0){const r=i[t];let n=s[t];if(void 0===n&&("instanceMatrix"===t&&e.instanceMatrix&&(n=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(n=e.instanceColor)),void 0===r)return!0;if(r.attribute!==n)return!0;if(n&&r.data!==n.data)return!0;o++}}return c.attributesNum!==o||c.index!==n}(i,v,h,_),x&&function(e,t,r,n){const i={},s=t.attributes;let o=0;const a=r.getAttributes();for(const t in a){if(a[t].location>=0){let r=s[t];void 0===r&&("instanceMatrix"===t&&e.instanceMatrix&&(r=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(r=e.instanceColor));const n={};n.attribute=r,r&&r.data&&(n.data=r.data),i[t]=n,o++}}c.attributes=i,c.attributesNum=o,c.index=n}(i,v,h,_)}else{const e=!0===l.wireframe;c.geometry===v.id&&c.program===h.id&&c.wireframe===e||(c.geometry=v.id,c.program=h.id,c.wireframe=e,x=!0)}null!==_&&r.update(_,e.ELEMENT_ARRAY_BUFFER),(x||u)&&(u=!1,function(i,s,o,a){if(!1===n.isWebGL2&&(i.isInstancedMesh||a.isInstancedBufferGeometry)&&null===t.get("ANGLE_instanced_arrays"))return;m();const l=a.attributes,c=o.getAttributes(),u=s.defaultAttributeValues;for(const t in c){const s=c[t];if(s.location>=0){let o=l[t];if(void 0===o&&("instanceMatrix"===t&&i.instanceMatrix&&(o=i.instanceMatrix),"instanceColor"===t&&i.instanceColor&&(o=i.instanceColor)),void 0!==o){const t=o.normalized,l=o.itemSize,c=r.get(o);if(void 0===c)continue;const u=c.buffer,d=c.type,h=c.bytesPerElement,p=!0===n.isWebGL2&&(d===e.INT||d===e.UNSIGNED_INT||o.gpuType===ft);if(o.isInterleavedBufferAttribute){const r=o.data,n=r.stride,c=o.offset;if(r.isInstancedInterleavedBuffer){for(let e=0;e<s.locationSize;e++)g(s.location+e,r.meshPerAttribute);!0!==i.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=r.meshPerAttribute*r.count)}else for(let e=0;e<s.locationSize;e++)f(s.location+e);e.bindBuffer(e.ARRAY_BUFFER,u);for(let e=0;e<s.locationSize;e++)b(s.location+e,l/s.locationSize,d,t,n*h,(c+l/s.locationSize*e)*h,p)}else{if(o.isInstancedBufferAttribute){for(let e=0;e<s.locationSize;e++)g(s.location+e,o.meshPerAttribute);!0!==i.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=o.meshPerAttribute*o.count)}else for(let e=0;e<s.locationSize;e++)f(s.location+e);e.bindBuffer(e.ARRAY_BUFFER,u);for(let e=0;e<s.locationSize;e++)b(s.location+e,l/s.locationSize,d,t,l*h,l/s.locationSize*e*h,p)}}else if(void 0!==u){const r=u[t];if(void 0!==r)switch(r.length){case 2:e.vertexAttrib2fv(s.location,r);break;case 3:e.vertexAttrib3fv(s.location,r);break;case 4:e.vertexAttrib4fv(s.location,r);break;default:e.vertexAttrib1fv(s.location,r)}}}}y()}(i,l,h,v),null!==_&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,r.get(_).buffer))},reset:v,resetDefaultState:_,dispose:function(){v();for(const e in a){const t=a[e];for(const e in t){const r=t[e];for(const e in r)h(r[e].object),delete r[e];delete t[e]}delete a[e]}},releaseStatesOfGeometry:function(e){if(void 0===a[e.id])return;const t=a[e.id];for(const e in t){const r=t[e];for(const e in r)h(r[e].object),delete r[e];delete t[e]}delete a[e.id]},releaseStatesOfProgram:function(e){for(const t in a){const r=a[t];if(void 0===r[e.id])continue;const n=r[e.id];for(const e in n)h(n[e].object),delete n[e];delete r[e.id]}},initAttributes:m,enableAttribute:f,disableUnusedAttributes:y}}function WebGLBufferRenderer(e,t,r,n){const i=n.isWebGL2;let s;this.setMode=function(e){s=e},this.render=function(t,n){e.drawArrays(s,t,n),r.update(n,s,1)},this.renderInstances=function(n,o,a){if(0===a)return;let l,c;if(i)l=e,c="drawArraysInstanced";else if(l=t.get("ANGLE_instanced_arrays"),c="drawArraysInstancedANGLE",null===l)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[c](s,n,o,a),r.update(o,s,a)},this.renderMultiDraw=function(e,n,i){if(0===i)return;const o=t.get("WEBGL_multi_draw");if(null===o)for(let t=0;t<i;t++)this.render(e[t],n[t]);else{o.multiDrawArraysWEBGL(s,e,0,n,0,i);let t=0;for(let e=0;e<i;e++)t+=n[e];r.update(t,s,1)}}}function WebGLCapabilities(e,t,r){let n;function i(t){if("highp"===t){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const s="undefined"!=typeof WebGL2RenderingContext&&"WebGL2RenderingContext"===e.constructor.name;let o=void 0!==r.precision?r.precision:"highp";const a=i(o);a!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",a,"instead."),o=a);const l=s||t.has("WEBGL_draw_buffers"),c=!0===r.logarithmicDepthBuffer,u=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),d=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),h=e.getParameter(e.MAX_TEXTURE_SIZE),p=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),m=e.getParameter(e.MAX_VERTEX_ATTRIBS),f=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),g=e.getParameter(e.MAX_VARYING_VECTORS),y=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),b=d>0,v=s||t.has("OES_texture_float");return{isWebGL2:s,drawBuffers:l,getMaxAnisotropy:function(){if(void 0!==n)return n;if(!0===t.has("EXT_texture_filter_anisotropic")){const r=t.get("EXT_texture_filter_anisotropic");n=e.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n},getMaxPrecision:i,precision:o,logarithmicDepthBuffer:c,maxTextures:u,maxVertexTextures:d,maxTextureSize:h,maxCubemapSize:p,maxAttributes:m,maxVertexUniforms:f,maxVaryings:g,maxFragmentUniforms:y,vertexTextures:b,floatFragmentTextures:v,floatVertexTextures:b&&v,maxSamples:s?e.getParameter(e.MAX_SAMPLES):0}}function WebGLClipping(e){const t=this;let r=null,n=0,i=!1,s=!1;const o=new Plane,a=new Matrix3,l={value:null,needsUpdate:!1};function c(e,r,n,i){const s=null!==e?e.length:0;let c=null;if(0!==s){if(c=l.value,!0!==i||null===c){const t=n+4*s,i=r.matrixWorldInverse;a.getNormalMatrix(i),(null===c||c.length<t)&&(c=new Float32Array(t));for(let t=0,r=n;t!==s;++t,r+=4)o.copy(e[t]).applyMatrix4(i,a),o.normal.toArray(c,r),c[r+3]=o.constant}l.value=c,l.needsUpdate=!0}return t.numPlanes=s,t.numIntersection=0,c}this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t){const r=0!==e.length||t||0!==n||i;return i=t,n=e.length,r},this.beginShadows=function(){s=!0,c(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(e,t){r=c(e,t,0)},this.setState=function(o,a,u){const d=o.clippingPlanes,h=o.clipIntersection,p=o.clipShadows,m=e.get(o);if(!i||null===d||0===d.length||s&&!p)s?c(null):function(){l.value!==r&&(l.value=r,l.needsUpdate=n>0);t.numPlanes=n,t.numIntersection=0}();else{const e=s?0:n,t=4*e;let i=m.clippingState||null;l.value=i,i=c(d,a,t,u);for(let e=0;e!==t;++e)i[e]=r[e];m.clippingState=i,this.numIntersection=h?this.numPlanes:0,this.numPlanes+=e}}}function WebGLCubeMaps(e){let t=new WeakMap;function r(e,t){return t===qe?e.mapping=We:t===$e&&(e.mapping=Ve),e}function n(e){const r=e.target;r.removeEventListener("dispose",n);const i=t.get(r);void 0!==i&&(t.delete(r),i.dispose())}return{get:function(i){if(i&&i.isTexture){const s=i.mapping;if(s===qe||s===$e){if(t.has(i)){return r(t.get(i).texture,i.mapping)}{const s=i.image;if(s&&s.height>0){const o=new WebGLCubeRenderTarget(s.height);return o.fromEquirectangularTexture(e,i),t.set(i,o),i.addEventListener("dispose",n),r(o.texture,i.mapping)}return null}}}return i},dispose:function(){t=new WeakMap}}}class OrthographicCamera extends Camera{constructor(e=-1,t=1,r=1,n=-1,i=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=r,this.bottom=n,this.near=i,this.far=s,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this}setViewOffset(e,t,r,n,i,s){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=r,this.view.offsetY=n,this.view.width=i,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,n=(this.top+this.bottom)/2;let i=r-e,s=r+e,o=n+t,a=n-t;if(null!==this.view&&this.view.enabled){const e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;i+=e*this.view.offsetX,s=i+e*this.view.width,o-=t*this.view.offsetY,a=o-t*this.view.height}this.projectionMatrix.makeOrthographic(i,s,o,a,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}const Po=[.125,.215,.35,.446,.526,.582],Eo=20,Mo=new OrthographicCamera,Co=new Color;let Ao=null,To=0,Do=0;const Oo=(1+Math.sqrt(5))/2,Ro=1/Oo,Lo=[new Vector3(1,1,1),new Vector3(-1,1,1),new Vector3(1,1,-1),new Vector3(-1,1,-1),new Vector3(0,Oo,Ro),new Vector3(0,Oo,-Ro),new Vector3(Ro,0,Oo),new Vector3(-Ro,0,Oo),new Vector3(Oo,Ro,0),new Vector3(-Oo,Ro,0)];class PMREMGenerator{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,r=.1,n=100){Ao=this._renderer.getRenderTarget(),To=this._renderer.getActiveCubeFace(),Do=this._renderer.getActiveMipmapLevel(),this._setSize(256);const i=this._allocateTargets();return i.depthBuffer=!0,this._sceneToCubeUV(e,r,n,i),t>0&&this._blur(i,0,0,t),this._applyPMREM(i),this._cleanup(i),i}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=Io(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=Fo(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(Ao,To,Do),e.scissorTest=!1,No(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===We||e.mapping===Ve?this._setSize(0===e.image.length?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),Ao=this._renderer.getRenderTarget(),To=this._renderer.getActiveCubeFace(),Do=this._renderer.getActiveMipmapLevel();const r=t||this._allocateTargets();return this._textureToCubeUV(e,r),this._applyPMREM(r),this._cleanup(r),r}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,r={magFilter:ot,minFilter:ot,generateMipmaps:!1,type:bt,format:St,colorSpace:Or,depthBuffer:!1},n=ko(e,t,r);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=ko(e,t,r);const{_lodMax:n}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=function(e){const t=[],r=[],n=[];let i=e;const s=e-4+1+Po.length;for(let o=0;o<s;o++){const s=Math.pow(2,i);r.push(s);let a=1/s;o>e-4?a=Po[o-e+4-1]:0===o&&(a=0),n.push(a);const l=1/(s-2),c=-l,u=1+l,d=[c,c,u,c,u,u,c,c,u,u,c,u],h=6,p=6,m=3,f=2,g=1,y=new Float32Array(m*p*h),b=new Float32Array(f*p*h),v=new Float32Array(g*p*h);for(let e=0;e<h;e++){const t=e%3*2/3-1,r=e>2?0:-1,n=[t,r,0,t+2/3,r,0,t+2/3,r+1,0,t,r,0,t+2/3,r+1,0,t,r+1,0];y.set(n,m*p*e),b.set(d,f*p*e);const i=[e,e,e,e,e,e];v.set(i,g*p*e)}const _=new BufferGeometry;_.setAttribute("position",new BufferAttribute(y,m)),_.setAttribute("uv",new BufferAttribute(b,f)),_.setAttribute("faceIndex",new BufferAttribute(v,g)),t.push(_),i>4&&i--}return{lodPlanes:t,sizeLods:r,sigmas:n}}(n)),this._blurMaterial=function(e,t,r){const n=new Float32Array(Eo),i=new Vector3(0,1,0),s=new ShaderMaterial({name:"SphericalGaussianBlur",defines:{n:Eo,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/r,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:Bo(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t",blending:y,depthTest:!1,depthWrite:!1});return s}(n,e,t)}return n}_compileMaterial(e){const t=new Mesh(this._lodPlanes[0],e);this._renderer.compile(t,Mo)}_sceneToCubeUV(e,t,r,n){const i=new PerspectiveCamera(90,1,t,r),s=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],a=this._renderer,l=a.autoClear,c=a.toneMapping;a.getClearColor(Co),a.toneMapping=we,a.autoClear=!1;const u=new MeshBasicMaterial({name:"PMREM.Background",side:f,depthWrite:!1,depthTest:!1}),d=new Mesh(new BoxGeometry,u);let h=!1;const p=e.background;p?p.isColor&&(u.color.copy(p),e.background=null,h=!0):(u.color.copy(Co),h=!0);for(let t=0;t<6;t++){const r=t%3;0===r?(i.up.set(0,s[t],0),i.lookAt(o[t],0,0)):1===r?(i.up.set(0,0,s[t]),i.lookAt(0,o[t],0)):(i.up.set(0,s[t],0),i.lookAt(0,0,o[t]));const l=this._cubeSize;No(n,r*l,t>2?l:0,l,l),a.setRenderTarget(n),h&&a.render(d,i),a.render(e,i)}d.geometry.dispose(),d.material.dispose(),a.toneMapping=c,a.autoClear=l,e.background=p}_textureToCubeUV(e,t){const r=this._renderer,n=e.mapping===We||e.mapping===Ve;n?(null===this._cubemapMaterial&&(this._cubemapMaterial=Io()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=Fo());const i=n?this._cubemapMaterial:this._equirectMaterial,s=new Mesh(this._lodPlanes[0],i);i.uniforms.envMap.value=e;const o=this._cubeSize;No(t,0,0,3*o,2*o),r.setRenderTarget(t),r.render(s,Mo)}_applyPMREM(e){const t=this._renderer,r=t.autoClear;t.autoClear=!1;for(let t=1;t<this._lodPlanes.length;t++){const r=Math.sqrt(this._sigmas[t]*this._sigmas[t]-this._sigmas[t-1]*this._sigmas[t-1]),n=Lo[(t-1)%Lo.length];this._blur(e,t-1,t,r,n)}t.autoClear=r}_blur(e,t,r,n,i){const s=this._pingPongRenderTarget;this._halfBlur(e,s,t,r,n,"latitudinal",i),this._halfBlur(s,e,r,r,n,"longitudinal",i)}_halfBlur(e,t,r,n,i,s,o){const a=this._renderer,l=this._blurMaterial;"latitudinal"!==s&&"longitudinal"!==s&&console.error("blur direction must be either latitudinal or longitudinal!");const c=new Mesh(this._lodPlanes[n],l),u=l.uniforms,d=this._sizeLods[r]-1,h=isFinite(i)?Math.PI/(2*d):2*Math.PI/39,p=i/h,m=isFinite(i)?1+Math.floor(3*p):Eo;m>Eo&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${m} samples when the maximum is set to 20`);const f=[];let g=0;for(let e=0;e<Eo;++e){const t=e/p,r=Math.exp(-t*t/2);f.push(r),0===e?g+=r:e<m&&(g+=2*r)}for(let e=0;e<f.length;e++)f[e]=f[e]/g;u.envMap.value=e.texture,u.samples.value=m,u.weights.value=f,u.latitudinal.value="latitudinal"===s,o&&(u.poleAxis.value=o);const{_lodMax:y}=this;u.dTheta.value=h,u.mipInt.value=y-r;const b=this._sizeLods[n];No(t,3*b*(n>y-4?n-y+4:0),4*(this._cubeSize-b),3*b,2*b),a.setRenderTarget(t),a.render(c,Mo)}}function ko(e,t,r){const n=new WebGLRenderTarget(e,t,r);return n.texture.mapping=Xe,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function No(e,t,r,n,i){e.viewport.set(t,r,n,i),e.scissor.set(t,r,n,i)}function Fo(){return new ShaderMaterial({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Bo(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:y,depthTest:!1,depthWrite:!1})}function Io(){return new ShaderMaterial({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Bo(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t",blending:y,depthTest:!1,depthWrite:!1})}function Bo(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t"}function WebGLCubeUVMaps(e){let t=new WeakMap,r=null;function n(e){const r=e.target;r.removeEventListener("dispose",n);const i=t.get(r);void 0!==i&&(t.delete(r),i.dispose())}return{get:function(i){if(i&&i.isTexture){const s=i.mapping,o=s===qe||s===$e,a=s===We||s===Ve;if(o||a){if(i.isRenderTargetTexture&&!0===i.needsPMREMUpdate){i.needsPMREMUpdate=!1;let n=t.get(i);return null===r&&(r=new PMREMGenerator(e)),n=o?r.fromEquirectangular(i,n):r.fromCubemap(i,n),t.set(i,n),n.texture}if(t.has(i))return t.get(i).texture;{const s=i.image;if(o&&s&&s.height>0||a&&s&&function(e){let t=0;const r=6;for(let n=0;n<r;n++)void 0!==e[n]&&t++;return t===r}(s)){null===r&&(r=new PMREMGenerator(e));const s=o?r.fromEquirectangular(i):r.fromCubemap(i);return t.set(i,s),i.addEventListener("dispose",n),s.texture}return null}}}return i},dispose:function(){t=new WeakMap,null!==r&&(r.dispose(),r=null)}}}function WebGLExtensions(e){const t={};function r(r){if(void 0!==t[r])return t[r];let n;switch(r){case"WEBGL_depth_texture":n=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":n=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":n=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":n=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:n=e.getExtension(r)}return t[r]=n,n}return{has:function(e){return null!==r(e)},init:function(e){e.isWebGL2?(r("EXT_color_buffer_float"),r("WEBGL_clip_cull_distance")):(r("WEBGL_depth_texture"),r("OES_texture_float"),r("OES_texture_half_float"),r("OES_texture_half_float_linear"),r("OES_standard_derivatives"),r("OES_element_index_uint"),r("OES_vertex_array_object"),r("ANGLE_instanced_arrays")),r("OES_texture_float_linear"),r("EXT_color_buffer_half_float"),r("WEBGL_multisampled_render_to_texture")},get:function(e){const t=r(e);return null===t&&console.warn("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function WebGLGeometries(e,t,r,n){const i={},s=new WeakMap;function o(e){const a=e.target;null!==a.index&&t.remove(a.index);for(const e in a.attributes)t.remove(a.attributes[e]);for(const e in a.morphAttributes){const r=a.morphAttributes[e];for(let e=0,n=r.length;e<n;e++)t.remove(r[e])}a.removeEventListener("dispose",o),delete i[a.id];const l=s.get(a);l&&(t.remove(l),s.delete(a)),n.releaseStatesOfGeometry(a),!0===a.isInstancedBufferGeometry&&delete a._maxInstanceCount,r.memory.geometries--}function a(e){const r=[],n=e.index,i=e.attributes.position;let o=0;if(null!==n){const e=n.array;o=n.version;for(let t=0,n=e.length;t<n;t+=3){const n=e[t+0],i=e[t+1],s=e[t+2];r.push(n,i,i,s,s,n)}}else{if(void 0===i)return;{const e=i.array;o=i.version;for(let t=0,n=e.length/3-1;t<n;t+=3){const e=t+0,n=t+1,i=t+2;r.push(e,n,n,i,i,e)}}}const a=new(In(r)?Uint32BufferAttribute:Uint16BufferAttribute)(r,1);a.version=o;const l=s.get(e);l&&t.remove(l),s.set(e,a)}return{get:function(e,t){return!0===i[t.id]||(t.addEventListener("dispose",o),i[t.id]=!0,r.memory.geometries++),t},update:function(r){const n=r.attributes;for(const r in n)t.update(n[r],e.ARRAY_BUFFER);const i=r.morphAttributes;for(const r in i){const n=i[r];for(let r=0,i=n.length;r<i;r++)t.update(n[r],e.ARRAY_BUFFER)}},getWireframeAttribute:function(e){const t=s.get(e);if(t){const r=e.index;null!==r&&t.version<r.version&&a(e)}else a(e);return s.get(e)}}}function WebGLIndexedBufferRenderer(e,t,r,n){const i=n.isWebGL2;let s,o,a;this.setMode=function(e){s=e},this.setIndex=function(e){o=e.type,a=e.bytesPerElement},this.render=function(t,n){e.drawElements(s,n,o,t*a),r.update(n,s,1)},this.renderInstances=function(n,l,c){if(0===c)return;let u,d;if(i)u=e,d="drawElementsInstanced";else if(u=t.get("ANGLE_instanced_arrays"),d="drawElementsInstancedANGLE",null===u)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");u[d](s,l,o,n*a,c),r.update(l,s,c)},this.renderMultiDraw=function(e,n,i){if(0===i)return;const l=t.get("WEBGL_multi_draw");if(null===l)for(let t=0;t<i;t++)this.render(e[t]/a,n[t]);else{l.multiDrawElementsWEBGL(s,n,0,o,e,0,i);let t=0;for(let e=0;e<i;e++)t+=n[e];r.update(t,s,1)}}}function WebGLInfo(e){const t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function(){t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function(r,n,i){switch(t.calls++,n){case e.TRIANGLES:t.triangles+=i*(r/3);break;case e.LINES:t.lines+=i*(r/2);break;case e.LINE_STRIP:t.lines+=i*(r-1);break;case e.LINE_LOOP:t.lines+=i*r;break;case e.POINTS:t.points+=i*r;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",n)}}}}function jo(e,t){return e[0]-t[0]}function Ho(e,t){return Math.abs(t[1])-Math.abs(e[1])}function WebGLMorphtargets(e,t,r){const n={},i=new Float32Array(8),s=new WeakMap,o=new Vector4,a=[];for(let e=0;e<8;e++)a[e]=[e,0];return{update:function(l,c,u){const d=l.morphTargetInfluences;if(!0===t.isWebGL2){const n=c.morphAttributes.position||c.morphAttributes.normal||c.morphAttributes.color,i=void 0!==n?n.length:0;let a=s.get(c);if(void 0===a||a.count!==i){let e=function(){y.dispose(),s.delete(c),c.removeEventListener("dispose",e)};void 0!==a&&a.texture.dispose();const r=void 0!==c.morphAttributes.position,n=void 0!==c.morphAttributes.normal,l=void 0!==c.morphAttributes.color,u=c.morphAttributes.position||[],d=c.morphAttributes.normal||[],h=c.morphAttributes.color||[];let p=0;!0===r&&(p=1),!0===n&&(p=2),!0===l&&(p=3);let m=c.attributes.position.count*p,f=1;m>t.maxTextureSize&&(f=Math.ceil(m/t.maxTextureSize),m=t.maxTextureSize);const g=new Float32Array(m*f*4*i),y=new DataArrayTexture(g,m,f,i);y.type=yt,y.needsUpdate=!0;const b=4*p;for(let e=0;e<i;e++){const t=u[e],i=d[e],s=h[e],a=m*f*4*e;for(let e=0;e<t.count;e++){const c=e*b;!0===r&&(o.fromBufferAttribute(t,e),g[a+c+0]=o.x,g[a+c+1]=o.y,g[a+c+2]=o.z,g[a+c+3]=0),!0===n&&(o.fromBufferAttribute(i,e),g[a+c+4]=o.x,g[a+c+5]=o.y,g[a+c+6]=o.z,g[a+c+7]=0),!0===l&&(o.fromBufferAttribute(s,e),g[a+c+8]=o.x,g[a+c+9]=o.y,g[a+c+10]=o.z,g[a+c+11]=4===s.itemSize?o.w:1)}}a={count:i,texture:y,size:new Vector2(m,f)},s.set(c,a),c.addEventListener("dispose",e)}if(!0===l.isInstancedMesh&&null!==l.morphTexture)u.getUniforms().setValue(e,"morphTexture",l.morphTexture,r);else{let t=0;for(let e=0;e<d.length;e++)t+=d[e];const r=c.morphTargetsRelative?1:1-t;u.getUniforms().setValue(e,"morphTargetBaseInfluence",r),u.getUniforms().setValue(e,"morphTargetInfluences",d)}u.getUniforms().setValue(e,"morphTargetsTexture",a.texture,r),u.getUniforms().setValue(e,"morphTargetsTextureSize",a.size)}else{const t=void 0===d?0:d.length;let r=n[c.id];if(void 0===r||r.length!==t){r=[];for(let e=0;e<t;e++)r[e]=[e,0];n[c.id]=r}for(let e=0;e<t;e++){const t=r[e];t[0]=e,t[1]=d[e]}r.sort(Ho);for(let e=0;e<8;e++)e<t&&r[e][1]?(a[e][0]=r[e][0],a[e][1]=r[e][1]):(a[e][0]=Number.MAX_SAFE_INTEGER,a[e][1]=0);a.sort(jo);const s=c.morphAttributes.position,o=c.morphAttributes.normal;let l=0;for(let e=0;e<8;e++){const t=a[e],r=t[0],n=t[1];r!==Number.MAX_SAFE_INTEGER&&n?(s&&c.getAttribute("morphTarget"+e)!==s[r]&&c.setAttribute("morphTarget"+e,s[r]),o&&c.getAttribute("morphNormal"+e)!==o[r]&&c.setAttribute("morphNormal"+e,o[r]),i[e]=n,l+=n):(s&&!0===c.hasAttribute("morphTarget"+e)&&c.deleteAttribute("morphTarget"+e),o&&!0===c.hasAttribute("morphNormal"+e)&&c.deleteAttribute("morphNormal"+e),i[e]=0)}const h=c.morphTargetsRelative?1:1-l;u.getUniforms().setValue(e,"morphTargetBaseInfluence",h),u.getUniforms().setValue(e,"morphTargetInfluences",i)}}}}function WebGLObjects(e,t,r,n){let i=new WeakMap;function s(e){const t=e.target;t.removeEventListener("dispose",s),r.remove(t.instanceMatrix),null!==t.instanceColor&&r.remove(t.instanceColor)}return{update:function(o){const a=n.render.frame,l=o.geometry,c=t.get(o,l);if(i.get(c)!==a&&(t.update(c),i.set(c,a)),o.isInstancedMesh&&(!1===o.hasEventListener("dispose",s)&&o.addEventListener("dispose",s),i.get(o)!==a&&(r.update(o.instanceMatrix,e.ARRAY_BUFFER),null!==o.instanceColor&&r.update(o.instanceColor,e.ARRAY_BUFFER),i.set(o,a))),o.isSkinnedMesh){const e=o.skeleton;i.get(e)!==a&&(e.update(),i.set(e,a))}return c},dispose:function(){i=new WeakMap}}}class DepthTexture extends Texture{constructor(e,t,r,n,i,s,o,a,l,c){if((c=void 0!==c?c:Mt)!==Mt&&c!==Ct)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===r&&c===Mt&&(r=gt),void 0===r&&c===Ct&&(r=xt),super(null,n,i,s,o,a,c,r,l),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=void 0!==o?o:tt,this.minFilter=void 0!==a?a:tt,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return null!==this.compareFunction&&(t.compareFunction=this.compareFunction),t}}const Uo=new Texture,zo=new DepthTexture(1,1);zo.compareFunction=nn;const Go=new DataArrayTexture,Wo=new Data3DTexture,Vo=new CubeTexture,qo=[],$o=[],Zo=new Float32Array(16),Ko=new Float32Array(9),Xo=new Float32Array(4);function Yo(e,t,r){const n=e[0];if(n<=0||n>0)return e;const i=t*r;let s=qo[i];if(void 0===s&&(s=new Float32Array(i),qo[i]=s),0!==t){n.toArray(s,0);for(let n=1,i=0;n!==t;++n)i+=r,e[n].toArray(s,i)}return s}function Jo(e,t){if(e.length!==t.length)return!1;for(let r=0,n=e.length;r<n;r++)if(e[r]!==t[r])return!1;return!0}function Qo(e,t){for(let r=0,n=t.length;r<n;r++)e[r]=t[r]}function ea(e,t){let r=$o[t];void 0===r&&(r=new Int32Array(t),$o[t]=r);for(let n=0;n!==t;++n)r[n]=e.allocateTextureUnit();return r}function ta(e,t){const r=this.cache;r[0]!==t&&(e.uniform1f(this.addr,t),r[0]=t)}function ra(e,t){const r=this.cache;if(void 0!==t.x)r[0]===t.x&&r[1]===t.y||(e.uniform2f(this.addr,t.x,t.y),r[0]=t.x,r[1]=t.y);else{if(Jo(r,t))return;e.uniform2fv(this.addr,t),Qo(r,t)}}function na(e,t){const r=this.cache;if(void 0!==t.x)r[0]===t.x&&r[1]===t.y&&r[2]===t.z||(e.uniform3f(this.addr,t.x,t.y,t.z),r[0]=t.x,r[1]=t.y,r[2]=t.z);else if(void 0!==t.r)r[0]===t.r&&r[1]===t.g&&r[2]===t.b||(e.uniform3f(this.addr,t.r,t.g,t.b),r[0]=t.r,r[1]=t.g,r[2]=t.b);else{if(Jo(r,t))return;e.uniform3fv(this.addr,t),Qo(r,t)}}function ia(e,t){const r=this.cache;if(void 0!==t.x)r[0]===t.x&&r[1]===t.y&&r[2]===t.z&&r[3]===t.w||(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),r[0]=t.x,r[1]=t.y,r[2]=t.z,r[3]=t.w);else{if(Jo(r,t))return;e.uniform4fv(this.addr,t),Qo(r,t)}}function sa(e,t){const r=this.cache,n=t.elements;if(void 0===n){if(Jo(r,t))return;e.uniformMatrix2fv(this.addr,!1,t),Qo(r,t)}else{if(Jo(r,n))return;Xo.set(n),e.uniformMatrix2fv(this.addr,!1,Xo),Qo(r,n)}}function oa(e,t){const r=this.cache,n=t.elements;if(void 0===n){if(Jo(r,t))return;e.uniformMatrix3fv(this.addr,!1,t),Qo(r,t)}else{if(Jo(r,n))return;Ko.set(n),e.uniformMatrix3fv(this.addr,!1,Ko),Qo(r,n)}}function aa(e,t){const r=this.cache,n=t.elements;if(void 0===n){if(Jo(r,t))return;e.uniformMatrix4fv(this.addr,!1,t),Qo(r,t)}else{if(Jo(r,n))return;Zo.set(n),e.uniformMatrix4fv(this.addr,!1,Zo),Qo(r,n)}}function la(e,t){const r=this.cache;r[0]!==t&&(e.uniform1i(this.addr,t),r[0]=t)}function ca(e,t){const r=this.cache;if(void 0!==t.x)r[0]===t.x&&r[1]===t.y||(e.uniform2i(this.addr,t.x,t.y),r[0]=t.x,r[1]=t.y);else{if(Jo(r,t))return;e.uniform2iv(this.addr,t),Qo(r,t)}}function ua(e,t){const r=this.cache;if(void 0!==t.x)r[0]===t.x&&r[1]===t.y&&r[2]===t.z||(e.uniform3i(this.addr,t.x,t.y,t.z),r[0]=t.x,r[1]=t.y,r[2]=t.z);else{if(Jo(r,t))return;e.uniform3iv(this.addr,t),Qo(r,t)}}function da(e,t){const r=this.cache;if(void 0!==t.x)r[0]===t.x&&r[1]===t.y&&r[2]===t.z&&r[3]===t.w||(e.uniform4i(this.addr,t.x,t.y,t.z,t.w),r[0]=t.x,r[1]=t.y,r[2]=t.z,r[3]=t.w);else{if(Jo(r,t))return;e.uniform4iv(this.addr,t),Qo(r,t)}}function ha(e,t){const r=this.cache;r[0]!==t&&(e.uniform1ui(this.addr,t),r[0]=t)}function pa(e,t){const r=this.cache;if(void 0!==t.x)r[0]===t.x&&r[1]===t.y||(e.uniform2ui(this.addr,t.x,t.y),r[0]=t.x,r[1]=t.y);else{if(Jo(r,t))return;e.uniform2uiv(this.addr,t),Qo(r,t)}}function ma(e,t){const r=this.cache;if(void 0!==t.x)r[0]===t.x&&r[1]===t.y&&r[2]===t.z||(e.uniform3ui(this.addr,t.x,t.y,t.z),r[0]=t.x,r[1]=t.y,r[2]=t.z);else{if(Jo(r,t))return;e.uniform3uiv(this.addr,t),Qo(r,t)}}function fa(e,t){const r=this.cache;if(void 0!==t.x)r[0]===t.x&&r[1]===t.y&&r[2]===t.z&&r[3]===t.w||(e.uniform4ui(this.addr,t.x,t.y,t.z,t.w),r[0]=t.x,r[1]=t.y,r[2]=t.z,r[3]=t.w);else{if(Jo(r,t))return;e.uniform4uiv(this.addr,t),Qo(r,t)}}function ga(e,t,r){const n=this.cache,i=r.allocateTextureUnit();n[0]!==i&&(e.uniform1i(this.addr,i),n[0]=i);const s=this.type===e.SAMPLER_2D_SHADOW?zo:Uo;r.setTexture2D(t||s,i)}function ya(e,t,r){const n=this.cache,i=r.allocateTextureUnit();n[0]!==i&&(e.uniform1i(this.addr,i),n[0]=i),r.setTexture3D(t||Wo,i)}function ba(e,t,r){const n=this.cache,i=r.allocateTextureUnit();n[0]!==i&&(e.uniform1i(this.addr,i),n[0]=i),r.setTextureCube(t||Vo,i)}function va(e,t,r){const n=this.cache,i=r.allocateTextureUnit();n[0]!==i&&(e.uniform1i(this.addr,i),n[0]=i),r.setTexture2DArray(t||Go,i)}function _a(e,t){e.uniform1fv(this.addr,t)}function xa(e,t){const r=Yo(t,this.size,2);e.uniform2fv(this.addr,r)}function wa(e,t){const r=Yo(t,this.size,3);e.uniform3fv(this.addr,r)}function Aa(e,t){const r=Yo(t,this.size,4);e.uniform4fv(this.addr,r)}function Oa(e,t){const r=Yo(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,r)}function ka(e,t){const r=Yo(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,r)}function ja(e,t){const r=Yo(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,r)}function Ua(e,t){e.uniform1iv(this.addr,t)}function za(e,t){e.uniform2iv(this.addr,t)}function qa(e,t){e.uniform3iv(this.addr,t)}function $a(e,t){e.uniform4iv(this.addr,t)}function Ka(e,t){e.uniform1uiv(this.addr,t)}function el(e,t){e.uniform2uiv(this.addr,t)}function tl(e,t){e.uniform3uiv(this.addr,t)}function rl(e,t){e.uniform4uiv(this.addr,t)}function nl(e,t,r){const n=this.cache,i=t.length,s=ea(r,i);Jo(n,s)||(e.uniform1iv(this.addr,s),Qo(n,s));for(let e=0;e!==i;++e)r.setTexture2D(t[e]||Uo,s[e])}function il(e,t,r){const n=this.cache,i=t.length,s=ea(r,i);Jo(n,s)||(e.uniform1iv(this.addr,s),Qo(n,s));for(let e=0;e!==i;++e)r.setTexture3D(t[e]||Wo,s[e])}function sl(e,t,r){const n=this.cache,i=t.length,s=ea(r,i);Jo(n,s)||(e.uniform1iv(this.addr,s),Qo(n,s));for(let e=0;e!==i;++e)r.setTextureCube(t[e]||Vo,s[e])}function ol(e,t,r){const n=this.cache,i=t.length,s=ea(r,i);Jo(n,s)||(e.uniform1iv(this.addr,s),Qo(n,s));for(let e=0;e!==i;++e)r.setTexture2DArray(t[e]||Go,s[e])}class SingleUniform{constructor(e,t,r){this.id=e,this.addr=r,this.cache=[],this.type=t.type,this.setValue=function(e){switch(e){case 5126:return ta;case 35664:return ra;case 35665:return na;case 35666:return ia;case 35674:return sa;case 35675:return oa;case 35676:return aa;case 5124:case 35670:return la;case 35667:case 35671:return ca;case 35668:case 35672:return ua;case 35669:case 35673:return da;case 5125:return ha;case 36294:return pa;case 36295:return ma;case 36296:return fa;case 35678:case 36198:case 36298:case 36306:case 35682:return ga;case 35679:case 36299:case 36307:return ya;case 35680:case 36300:case 36308:case 36293:return ba;case 36289:case 36303:case 36311:case 36292:return va}}(t.type)}}class PureArrayUniform{constructor(e,t,r){this.id=e,this.addr=r,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=function(e){switch(e){case 5126:return _a;case 35664:return xa;case 35665:return wa;case 35666:return Aa;case 35674:return Oa;case 35675:return ka;case 35676:return ja;case 5124:case 35670:return Ua;case 35667:case 35671:return za;case 35668:case 35672:return qa;case 35669:case 35673:return $a;case 5125:return Ka;case 36294:return el;case 36295:return tl;case 36296:return rl;case 35678:case 36198:case 36298:case 36306:case 35682:return nl;case 35679:case 36299:case 36307:return il;case 35680:case 36300:case 36308:case 36293:return sl;case 36289:case 36303:case 36311:case 36292:return ol}}(t.type)}}class StructuredUniform{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,r){const n=this.seq;for(let i=0,s=n.length;i!==s;++i){const s=n[i];s.setValue(e,t[s.id],r)}}}const al=/(\w+)(\])?(\[|\.)?/g;function ll(e,t){e.seq.push(t),e.map[t.id]=t}function cl(e,t,r){const n=e.name,i=n.length;for(al.lastIndex=0;;){const s=al.exec(n),o=al.lastIndex;let a=s[1];const l="]"===s[2],c=s[3];if(l&&(a|=0),void 0===c||"["===c&&o+2===i){ll(r,void 0===c?new SingleUniform(a,e,t):new PureArrayUniform(a,e,t));break}{let e=r.map[a];void 0===e&&(e=new StructuredUniform(a),ll(r,e)),r=e}}}class WebGLUniforms{constructor(e,t){this.seq=[],this.map={};const r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let n=0;n<r;++n){const r=e.getActiveUniform(t,n);cl(r,e.getUniformLocation(t,r.name),this)}}setValue(e,t,r,n){const i=this.map[t];void 0!==i&&i.setValue(e,r,n)}setOptional(e,t,r){const n=t[r];void 0!==n&&this.setValue(e,r,n)}static upload(e,t,r,n){for(let i=0,s=t.length;i!==s;++i){const s=t[i],o=r[s.id];!1!==o.needsUpdate&&s.setValue(e,o.value,n)}}static seqWithValue(e,t){const r=[];for(let n=0,i=e.length;n!==i;++n){const i=e[n];i.id in t&&r.push(i)}return r}}function WebGLShader(e,t,r){const n=e.createShader(t);return e.shaderSource(n,r),e.compileShader(n),n}const ul=37297;let dl=0;function hl(e,t,r){const n=e.getShaderParameter(t,e.COMPILE_STATUS),i=e.getShaderInfoLog(t).trim();if(n&&""===i)return"";const s=/ERROR: 0:(\d+)/.exec(i);if(s){const n=parseInt(s[1]);return r.toUpperCase()+"\n\n"+i+"\n\n"+function(e,t){const r=e.split("\n"),n=[],i=Math.max(t-6,0),s=Math.min(t+6,r.length);for(let e=i;e<s;e++){const i=e+1;n.push(`${i===t?">":" "} ${i}: ${r[e]}`)}return n.join("\n")}(e.getShaderSource(t),n)}return i}function pl(e,t){const r=function(e){const t=Zn.getPrimaries(Zn.workingColorSpace),r=Zn.getPrimaries(e);let n;switch(t===r?n="":t===Ir&&r===Fr?n="LinearDisplayP3ToLinearSRGB":t===Fr&&r===Ir&&(n="LinearSRGBToLinearDisplayP3"),e){case Or:case Lr:return[n,"LinearTransferOETF"];case Dr:case Rr:return[n,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",e),[n,"LinearTransferOETF"]}}(t);return`vec4 ${e}( vec4 value ) { return ${r[0]}( ${r[1]}( value ) ); }`}function ml(e,t){let r;switch(t){case Se:r="Linear";break;case Pe:r="Reinhard";break;case Te:r="OptimizedCineon";break;case Re:r="ACESFilmic";break;case Ie:r="AgX";break;case je:r="Neutral";break;case ke:r="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),r="Linear"}return"vec3 "+e+"( vec3 color ) { return "+r+"ToneMapping( color ); }"}function fl(e){return""!==e}function gl(e,t){const r=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,r).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function yl(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}const bl=/^[ \t]*#include +<([\w\d./]+)>/gm;function vl(e){return e.replace(bl,xl)}const _l=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function xl(e,t){let r=bo[t];if(void 0===r){const e=_l.get(t);if(void 0===e)throw new Error("Can not resolve #include <"+t+">");r=bo[e],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,e)}return vl(r)}const wl=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Sl(e){return e.replace(wl,Pl)}function Pl(e,t,r,n){let i="";for(let e=parseInt(t);e<parseInt(r);e++)i+=n.replace(/\[\s*i\s*\]/g,"[ "+e+" ]").replace(/UNROLLED_LOOP_INDEX/g,e);return i}function El(e){let t=`precision ${e.precision} float;\n\tprecision ${e.precision} int;\n\tprecision ${e.precision} sampler2D;\n\tprecision ${e.precision} samplerCube;\n\t`;return e.isWebGL2&&(t+=`precision ${e.precision} sampler3D;\n\t\tprecision ${e.precision} sampler2DArray;\n\t\tprecision ${e.precision} sampler2DShadow;\n\t\tprecision ${e.precision} samplerCubeShadow;\n\t\tprecision ${e.precision} sampler2DArrayShadow;\n\t\tprecision ${e.precision} isampler2D;\n\t\tprecision ${e.precision} isampler3D;\n\t\tprecision ${e.precision} isamplerCube;\n\t\tprecision ${e.precision} isampler2DArray;\n\t\tprecision ${e.precision} usampler2D;\n\t\tprecision ${e.precision} usampler3D;\n\t\tprecision ${e.precision} usamplerCube;\n\t\tprecision ${e.precision} usampler2DArray;\n\t\t`),"highp"===e.precision?t+="\n#define HIGH_PRECISION":"mediump"===e.precision?t+="\n#define MEDIUM_PRECISION":"lowp"===e.precision&&(t+="\n#define LOW_PRECISION"),t}function WebGLProgram(e,t,r,n){const i=e.getContext(),s=r.defines;let o=r.vertexShader,a=r.fragmentShader;const l=function(e){let t="SHADOWMAP_TYPE_BASIC";return e.shadowMapType===d?t="SHADOWMAP_TYPE_PCF":e.shadowMapType===h?t="SHADOWMAP_TYPE_PCF_SOFT":e.shadowMapType===p&&(t="SHADOWMAP_TYPE_VSM"),t}(r),c=function(e){let t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case We:case Ve:t="ENVMAP_TYPE_CUBE";break;case Xe:t="ENVMAP_TYPE_CUBE_UV"}return t}(r),u=function(e){let t="ENVMAP_MODE_REFLECTION";e.envMap&&e.envMapMode===Ve&&(t="ENVMAP_MODE_REFRACTION");return t}(r),m=function(e){let t="ENVMAP_BLENDING_NONE";if(e.envMap)switch(e.combine){case ve:t="ENVMAP_BLENDING_MULTIPLY";break;case _e:t="ENVMAP_BLENDING_MIX";break;case xe:t="ENVMAP_BLENDING_ADD"}return t}(r),f=function(e){const t=e.envMapCubeUVHeight;if(null===t)return null;const r=Math.log2(t)-2,n=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,r),112)),texelHeight:n,maxMip:r}}(r),g=r.isWebGL2?"":function(e){return[e.extensionDerivatives||e.envMapCubeUVHeight||e.bumpMap||e.normalMapTangentSpace||e.clearcoatNormalMap||e.flatShading||e.alphaToCoverage||"physical"===e.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(e.extensionFragDepth||e.logarithmicDepthBuffer)&&e.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",e.extensionDrawBuffers&&e.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(e.extensionShaderTextureLOD||e.envMap||e.transmission)&&e.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(fl).join("\n")}(r),y=function(e){return[e.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",e.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(fl).join("\n")}(r),b=function(e){const t=[];for(const r in e){const n=e[r];!1!==n&&t.push("#define "+r+" "+n)}return t.join("\n")}(s),v=i.createProgram();let _,x,w=r.glslVersion?"#version "+r.glslVersion+"\n":"";r.isRawShaderMaterial?(_=["#define SHADER_TYPE "+r.shaderType,"#define SHADER_NAME "+r.shaderName,b].filter(fl).join("\n"),_.length>0&&(_+="\n"),x=[g,"#define SHADER_TYPE "+r.shaderType,"#define SHADER_NAME "+r.shaderName,b].filter(fl).join("\n"),x.length>0&&(x+="\n")):(_=[El(r),"#define SHADER_TYPE "+r.shaderType,"#define SHADER_NAME "+r.shaderName,b,r.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",r.batching?"#define USE_BATCHING":"",r.instancing?"#define USE_INSTANCING":"",r.instancingColor?"#define USE_INSTANCING_COLOR":"",r.instancingMorph?"#define USE_INSTANCING_MORPH":"",r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+u:"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",r.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",r.displacementMap?"#define USE_DISPLACEMENTMAP":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.anisotropy?"#define USE_ANISOTROPY":"",r.anisotropyMap?"#define USE_ANISOTROPYMAP":"",r.clearcoatMap?"#define USE_CLEARCOATMAP":"",r.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",r.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",r.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.alphaHash?"#define USE_ALPHAHASH":"",r.transmission?"#define USE_TRANSMISSION":"",r.transmissionMap?"#define USE_TRANSMISSIONMAP":"",r.thicknessMap?"#define USE_THICKNESSMAP":"",r.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",r.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",r.mapUv?"#define MAP_UV "+r.mapUv:"",r.alphaMapUv?"#define ALPHAMAP_UV "+r.alphaMapUv:"",r.lightMapUv?"#define LIGHTMAP_UV "+r.lightMapUv:"",r.aoMapUv?"#define AOMAP_UV "+r.aoMapUv:"",r.emissiveMapUv?"#define EMISSIVEMAP_UV "+r.emissiveMapUv:"",r.bumpMapUv?"#define BUMPMAP_UV "+r.bumpMapUv:"",r.normalMapUv?"#define NORMALMAP_UV "+r.normalMapUv:"",r.displacementMapUv?"#define DISPLACEMENTMAP_UV "+r.displacementMapUv:"",r.metalnessMapUv?"#define METALNESSMAP_UV "+r.metalnessMapUv:"",r.roughnessMapUv?"#define ROUGHNESSMAP_UV "+r.roughnessMapUv:"",r.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+r.anisotropyMapUv:"",r.clearcoatMapUv?"#define CLEARCOATMAP_UV "+r.clearcoatMapUv:"",r.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+r.clearcoatNormalMapUv:"",r.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+r.clearcoatRoughnessMapUv:"",r.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+r.iridescenceMapUv:"",r.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+r.iridescenceThicknessMapUv:"",r.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+r.sheenColorMapUv:"",r.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+r.sheenRoughnessMapUv:"",r.specularMapUv?"#define SPECULARMAP_UV "+r.specularMapUv:"",r.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+r.specularColorMapUv:"",r.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+r.specularIntensityMapUv:"",r.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+r.transmissionMapUv:"",r.thicknessMapUv?"#define THICKNESSMAP_UV "+r.thicknessMapUv:"",r.vertexTangents&&!1===r.flatShading?"#define USE_TANGENT":"",r.vertexColors?"#define USE_COLOR":"",r.vertexAlphas?"#define USE_COLOR_ALPHA":"",r.vertexUv1s?"#define USE_UV1":"",r.vertexUv2s?"#define USE_UV2":"",r.vertexUv3s?"#define USE_UV3":"",r.pointsUvs?"#define USE_POINTS_UV":"",r.flatShading?"#define FLAT_SHADED":"",r.skinning?"#define USE_SKINNING":"",r.morphTargets?"#define USE_MORPHTARGETS":"",r.morphNormals&&!1===r.flatShading?"#define USE_MORPHNORMALS":"",r.morphColors&&r.isWebGL2?"#define USE_MORPHCOLORS":"",r.morphTargetsCount>0&&r.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",r.morphTargetsCount>0&&r.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+r.morphTextureStride:"",r.morphTargetsCount>0&&r.isWebGL2?"#define MORPHTARGETS_COUNT "+r.morphTargetsCount:"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+l:"",r.sizeAttenuation?"#define USE_SIZEATTENUATION":"",r.numLightProbes>0?"#define USE_LIGHT_PROBES":"",r.useLegacyLights?"#define LEGACY_LIGHTS":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&r.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH","\tuniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1","\tattribute vec2 uv1;","#endif","#ifdef USE_UV2","\tattribute vec2 uv2;","#endif","#ifdef USE_UV3","\tattribute vec2 uv3;","#endif","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(fl).join("\n"),x=[g,El(r),"#define SHADER_TYPE "+r.shaderType,"#define SHADER_NAME "+r.shaderName,b,r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",r.map?"#define USE_MAP":"",r.matcap?"#define USE_MATCAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+c:"",r.envMap?"#define "+u:"",r.envMap?"#define "+m:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",r.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.anisotropy?"#define USE_ANISOTROPY":"",r.anisotropyMap?"#define USE_ANISOTROPYMAP":"",r.clearcoat?"#define USE_CLEARCOAT":"",r.clearcoatMap?"#define USE_CLEARCOATMAP":"",r.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.iridescence?"#define USE_IRIDESCENCE":"",r.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",r.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",r.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.alphaTest?"#define USE_ALPHATEST":"",r.alphaHash?"#define USE_ALPHAHASH":"",r.sheen?"#define USE_SHEEN":"",r.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",r.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",r.transmission?"#define USE_TRANSMISSION":"",r.transmissionMap?"#define USE_TRANSMISSIONMAP":"",r.thicknessMap?"#define USE_THICKNESSMAP":"",r.vertexTangents&&!1===r.flatShading?"#define USE_TANGENT":"",r.vertexColors||r.instancingColor?"#define USE_COLOR":"",r.vertexAlphas?"#define USE_COLOR_ALPHA":"",r.vertexUv1s?"#define USE_UV1":"",r.vertexUv2s?"#define USE_UV2":"",r.vertexUv3s?"#define USE_UV3":"",r.pointsUvs?"#define USE_POINTS_UV":"",r.gradientMap?"#define USE_GRADIENTMAP":"",r.flatShading?"#define FLAT_SHADED":"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+l:"",r.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",r.numLightProbes>0?"#define USE_LIGHT_PROBES":"",r.useLegacyLights?"#define LEGACY_LIGHTS":"",r.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&r.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",r.toneMapping!==we?"#define TONE_MAPPING":"",r.toneMapping!==we?bo.tonemapping_pars_fragment:"",r.toneMapping!==we?ml("toneMapping",r.toneMapping):"",r.dithering?"#define DITHERING":"",r.opaque?"#define OPAQUE":"",bo.colorspace_pars_fragment,pl("linearToOutputTexel",r.outputColorSpace),r.useDepthPacking?"#define DEPTH_PACKING "+r.depthPacking:"","\n"].filter(fl).join("\n")),o=vl(o),o=gl(o,r),o=yl(o,r),a=vl(a),a=gl(a,r),a=yl(a,r),o=Sl(o),a=Sl(a),r.isWebGL2&&!0!==r.isRawShaderMaterial&&(w="#version 300 es\n",_=[y,"precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+_,x=["precision mediump sampler2DArray;","#define varying in",r.glslVersion===vn?"":"layout(location = 0) out highp vec4 pc_fragColor;",r.glslVersion===vn?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+x);const R=w+_+o,k=w+x+a,j=WebGLShader(i,i.VERTEX_SHADER,R),z=WebGLShader(i,i.FRAGMENT_SHADER,k);function q(t){if(e.debug.checkShaderErrors){const r=i.getProgramInfoLog(v).trim(),n=i.getShaderInfoLog(j).trim(),s=i.getShaderInfoLog(z).trim();let o=!0,a=!0;if(!1===i.getProgramParameter(v,i.LINK_STATUS))if(o=!1,"function"==typeof e.debug.onShaderError)e.debug.onShaderError(i,v,j,z);else{const e=hl(i,j,"vertex"),n=hl(i,z,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(v,i.VALIDATE_STATUS)+"\n\nMaterial Name: "+t.name+"\nMaterial Type: "+t.type+"\n\nProgram Info Log: "+r+"\n"+e+"\n"+n)}else""!==r?console.warn("THREE.WebGLProgram: Program Info Log:",r):""!==n&&""!==s||(a=!1);a&&(t.diagnostics={runnable:o,programLog:r,vertexShader:{log:n,prefix:_},fragmentShader:{log:s,prefix:x}})}i.deleteShader(j),i.deleteShader(z),$=new WebGLUniforms(i,v),Z=function(e,t){const r={},n=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let i=0;i<n;i++){const n=e.getActiveAttrib(t,i),s=n.name;let o=1;n.type===e.FLOAT_MAT2&&(o=2),n.type===e.FLOAT_MAT3&&(o=3),n.type===e.FLOAT_MAT4&&(o=4),r[s]={type:n.type,location:e.getAttribLocation(t,s),locationSize:o}}return r}(i,v)}let $,Z;i.attachShader(v,j),i.attachShader(v,z),void 0!==r.index0AttributeName?i.bindAttribLocation(v,0,r.index0AttributeName):!0===r.morphTargets&&i.bindAttribLocation(v,0,"position"),i.linkProgram(v),this.getUniforms=function(){return void 0===$&&q(this),$},this.getAttributes=function(){return void 0===Z&&q(this),Z};let X=!1===r.rendererExtensionParallelShaderCompile;return this.isReady=function(){return!1===X&&(X=i.getProgramParameter(v,ul)),X},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(v),this.program=void 0},this.type=r.shaderType,this.name=r.shaderName,this.id=dl++,this.cacheKey=t,this.usedTimes=1,this.program=v,this.vertexShader=j,this.fragmentShader=z,this}let Ml=0;class WebGLShaderCache{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,r=e.fragmentShader,n=this._getShaderStage(t),i=this._getShaderStage(r),s=this._getShaderCacheForMaterial(e);return!1===s.has(n)&&(s.add(n),n.usedTimes++),!1===s.has(i)&&(s.add(i),i.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const e of t)e.usedTimes--,0===e.usedTimes&&this.shaderCache.delete(e.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let r=t.get(e);return void 0===r&&(r=new Set,t.set(e,r)),r}_getShaderStage(e){const t=this.shaderCache;let r=t.get(e);return void 0===r&&(r=new WebGLShaderStage(e),t.set(e,r)),r}}class WebGLShaderStage{constructor(e){this.id=Ml++,this.code=e,this.usedTimes=0}}function WebGLPrograms(e,t,r,n,i,s,o){const a=new Layers,l=new WebGLShaderCache,c=new Set,u=[],d=i.isWebGL2,h=i.logarithmicDepthBuffer,p=i.vertexTextures;let m=i.precision;const y={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function v(e){return c.add(e),0===e?"uv":`uv${e}`}return{getParameters:function(s,a,u,_,x){const w=_.fog,R=x.geometry,k=s.isMeshStandardMaterial?_.environment:null,j=(s.isMeshStandardMaterial?r:t).get(s.envMap||k),z=j&&j.mapping===Xe?j.image.height:null,q=y[s.type];null!==s.precision&&(m=i.getMaxPrecision(s.precision),m!==s.precision&&console.warn("THREE.WebGLProgram.getParameters:",s.precision,"not supported, using",m,"instead."));const $=R.morphAttributes.position||R.morphAttributes.normal||R.morphAttributes.color,Z=void 0!==$?$.length:0;let X,Y,ee,te,re=0;if(void 0!==R.morphAttributes.position&&(re=1),void 0!==R.morphAttributes.normal&&(re=2),void 0!==R.morphAttributes.color&&(re=3),q){const e=_o[q];X=e.vertexShader,Y=e.fragmentShader}else X=s.vertexShader,Y=s.fragmentShader,l.update(s),ee=l.getVertexShaderID(s),te=l.getFragmentShaderID(s);const ne=e.getRenderTarget(),ie=!0===x.isInstancedMesh,se=!0===x.isBatchedMesh,oe=!!s.map,ae=!!s.matcap,le=!!j,ce=!!s.aoMap,ue=!!s.lightMap,de=!!s.bumpMap,he=!!s.normalMap,pe=!!s.displacementMap,me=!!s.emissiveMap,fe=!!s.metalnessMap,ge=!!s.roughnessMap,ye=s.anisotropy>0,be=s.clearcoat>0,ve=s.iridescence>0,_e=s.sheen>0,xe=s.transmission>0,Se=ye&&!!s.anisotropyMap,Pe=be&&!!s.clearcoatMap,Te=be&&!!s.clearcoatNormalMap,Re=be&&!!s.clearcoatRoughnessMap,ke=ve&&!!s.iridescenceMap,Ie=ve&&!!s.iridescenceThicknessMap,je=_e&&!!s.sheenColorMap,He=_e&&!!s.sheenRoughnessMap,ze=!!s.specularMap,Ge=!!s.specularColorMap,We=!!s.specularIntensityMap,Ve=xe&&!!s.transmissionMap,qe=xe&&!!s.thicknessMap,$e=!!s.gradientMap,Ye=!!s.alphaMap,Qe=s.alphaTest>0,et=!!s.alphaHash,tt=!!s.extensions;let rt=we;s.toneMapped&&(null!==ne&&!0!==ne.isXRRenderTarget||(rt=e.toneMapping));const nt={isWebGL2:d,shaderID:q,shaderType:s.type,shaderName:s.name,vertexShader:X,fragmentShader:Y,defines:s.defines,customVertexShaderID:ee,customFragmentShaderID:te,isRawShaderMaterial:!0===s.isRawShaderMaterial,glslVersion:s.glslVersion,precision:m,batching:se,instancing:ie,instancingColor:ie&&null!==x.instanceColor,instancingMorph:ie&&null!==x.morphTexture,supportsVertexTextures:p,outputColorSpace:null===ne?e.outputColorSpace:!0===ne.isXRRenderTarget?ne.texture.colorSpace:Or,alphaToCoverage:!!s.alphaToCoverage,map:oe,matcap:ae,envMap:le,envMapMode:le&&j.mapping,envMapCubeUVHeight:z,aoMap:ce,lightMap:ue,bumpMap:de,normalMap:he,displacementMap:p&&pe,emissiveMap:me,normalMapObjectSpace:he&&s.normalMapType===Ar,normalMapTangentSpace:he&&s.normalMapType===Cr,metalnessMap:fe,roughnessMap:ge,anisotropy:ye,anisotropyMap:Se,clearcoat:be,clearcoatMap:Pe,clearcoatNormalMap:Te,clearcoatRoughnessMap:Re,iridescence:ve,iridescenceMap:ke,iridescenceThicknessMap:Ie,sheen:_e,sheenColorMap:je,sheenRoughnessMap:He,specularMap:ze,specularColorMap:Ge,specularIntensityMap:We,transmission:xe,transmissionMap:Ve,thicknessMap:qe,gradientMap:$e,opaque:!1===s.transparent&&s.blending===b&&!1===s.alphaToCoverage,alphaMap:Ye,alphaTest:Qe,alphaHash:et,combine:s.combine,mapUv:oe&&v(s.map.channel),aoMapUv:ce&&v(s.aoMap.channel),lightMapUv:ue&&v(s.lightMap.channel),bumpMapUv:de&&v(s.bumpMap.channel),normalMapUv:he&&v(s.normalMap.channel),displacementMapUv:pe&&v(s.displacementMap.channel),emissiveMapUv:me&&v(s.emissiveMap.channel),metalnessMapUv:fe&&v(s.metalnessMap.channel),roughnessMapUv:ge&&v(s.roughnessMap.channel),anisotropyMapUv:Se&&v(s.anisotropyMap.channel),clearcoatMapUv:Pe&&v(s.clearcoatMap.channel),clearcoatNormalMapUv:Te&&v(s.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Re&&v(s.clearcoatRoughnessMap.channel),iridescenceMapUv:ke&&v(s.iridescenceMap.channel),iridescenceThicknessMapUv:Ie&&v(s.iridescenceThicknessMap.channel),sheenColorMapUv:je&&v(s.sheenColorMap.channel),sheenRoughnessMapUv:He&&v(s.sheenRoughnessMap.channel),specularMapUv:ze&&v(s.specularMap.channel),specularColorMapUv:Ge&&v(s.specularColorMap.channel),specularIntensityMapUv:We&&v(s.specularIntensityMap.channel),transmissionMapUv:Ve&&v(s.transmissionMap.channel),thicknessMapUv:qe&&v(s.thicknessMap.channel),alphaMapUv:Ye&&v(s.alphaMap.channel),vertexTangents:!!R.attributes.tangent&&(he||ye),vertexColors:s.vertexColors,vertexAlphas:!0===s.vertexColors&&!!R.attributes.color&&4===R.attributes.color.itemSize,pointsUvs:!0===x.isPoints&&!!R.attributes.uv&&(oe||Ye),fog:!!w,useFog:!0===s.fog,fogExp2:!!w&&w.isFogExp2,flatShading:!0===s.flatShading,sizeAttenuation:!0===s.sizeAttenuation,logarithmicDepthBuffer:h,skinning:!0===x.isSkinnedMesh,morphTargets:void 0!==R.morphAttributes.position,morphNormals:void 0!==R.morphAttributes.normal,morphColors:void 0!==R.morphAttributes.color,morphTargetsCount:Z,morphTextureStride:re,numDirLights:a.directional.length,numPointLights:a.point.length,numSpotLights:a.spot.length,numSpotLightMaps:a.spotLightMap.length,numRectAreaLights:a.rectArea.length,numHemiLights:a.hemi.length,numDirLightShadows:a.directionalShadowMap.length,numPointLightShadows:a.pointShadowMap.length,numSpotLightShadows:a.spotShadowMap.length,numSpotLightShadowsWithMaps:a.numSpotLightShadowsWithMaps,numLightProbes:a.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:s.dithering,shadowMapEnabled:e.shadowMap.enabled&&u.length>0,shadowMapType:e.shadowMap.type,toneMapping:rt,useLegacyLights:e._useLegacyLights,decodeVideoTexture:oe&&!0===s.map.isVideoTexture&&Zn.getTransfer(s.map.colorSpace)===Nr,premultipliedAlpha:s.premultipliedAlpha,doubleSided:s.side===g,flipSided:s.side===f,useDepthPacking:s.depthPacking>=0,depthPacking:s.depthPacking||0,index0AttributeName:s.index0AttributeName,extensionDerivatives:tt&&!0===s.extensions.derivatives,extensionFragDepth:tt&&!0===s.extensions.fragDepth,extensionDrawBuffers:tt&&!0===s.extensions.drawBuffers,extensionShaderTextureLOD:tt&&!0===s.extensions.shaderTextureLOD,extensionClipCullDistance:tt&&!0===s.extensions.clipCullDistance&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:tt&&!0===s.extensions.multiDraw&&n.has("WEBGL_multi_draw"),rendererExtensionFragDepth:d||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:d||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:d||n.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:s.customProgramCacheKey()};return nt.vertexUv1s=c.has(1),nt.vertexUv2s=c.has(2),nt.vertexUv3s=c.has(3),c.clear(),nt},getProgramCacheKey:function(t){const r=[];if(t.shaderID?r.push(t.shaderID):(r.push(t.customVertexShaderID),r.push(t.customFragmentShaderID)),void 0!==t.defines)for(const e in t.defines)r.push(e),r.push(t.defines[e]);return!1===t.isRawShaderMaterial&&(!function(e,t){e.push(t.precision),e.push(t.outputColorSpace),e.push(t.envMapMode),e.push(t.envMapCubeUVHeight),e.push(t.mapUv),e.push(t.alphaMapUv),e.push(t.lightMapUv),e.push(t.aoMapUv),e.push(t.bumpMapUv),e.push(t.normalMapUv),e.push(t.displacementMapUv),e.push(t.emissiveMapUv),e.push(t.metalnessMapUv),e.push(t.roughnessMapUv),e.push(t.anisotropyMapUv),e.push(t.clearcoatMapUv),e.push(t.clearcoatNormalMapUv),e.push(t.clearcoatRoughnessMapUv),e.push(t.iridescenceMapUv),e.push(t.iridescenceThicknessMapUv),e.push(t.sheenColorMapUv),e.push(t.sheenRoughnessMapUv),e.push(t.specularMapUv),e.push(t.specularColorMapUv),e.push(t.specularIntensityMapUv),e.push(t.transmissionMapUv),e.push(t.thicknessMapUv),e.push(t.combine),e.push(t.fogExp2),e.push(t.sizeAttenuation),e.push(t.morphTargetsCount),e.push(t.morphAttributeCount),e.push(t.numDirLights),e.push(t.numPointLights),e.push(t.numSpotLights),e.push(t.numSpotLightMaps),e.push(t.numHemiLights),e.push(t.numRectAreaLights),e.push(t.numDirLightShadows),e.push(t.numPointLightShadows),e.push(t.numSpotLightShadows),e.push(t.numSpotLightShadowsWithMaps),e.push(t.numLightProbes),e.push(t.shadowMapType),e.push(t.toneMapping),e.push(t.numClippingPlanes),e.push(t.numClipIntersection),e.push(t.depthPacking)}(r,t),function(e,t){a.disableAll(),t.isWebGL2&&a.enable(0);t.supportsVertexTextures&&a.enable(1);t.instancing&&a.enable(2);t.instancingColor&&a.enable(3);t.instancingMorph&&a.enable(4);t.matcap&&a.enable(5);t.envMap&&a.enable(6);t.normalMapObjectSpace&&a.enable(7);t.normalMapTangentSpace&&a.enable(8);t.clearcoat&&a.enable(9);t.iridescence&&a.enable(10);t.alphaTest&&a.enable(11);t.vertexColors&&a.enable(12);t.vertexAlphas&&a.enable(13);t.vertexUv1s&&a.enable(14);t.vertexUv2s&&a.enable(15);t.vertexUv3s&&a.enable(16);t.vertexTangents&&a.enable(17);t.anisotropy&&a.enable(18);t.alphaHash&&a.enable(19);t.batching&&a.enable(20);e.push(a.mask),a.disableAll(),t.fog&&a.enable(0);t.useFog&&a.enable(1);t.flatShading&&a.enable(2);t.logarithmicDepthBuffer&&a.enable(3);t.skinning&&a.enable(4);t.morphTargets&&a.enable(5);t.morphNormals&&a.enable(6);t.morphColors&&a.enable(7);t.premultipliedAlpha&&a.enable(8);t.shadowMapEnabled&&a.enable(9);t.useLegacyLights&&a.enable(10);t.doubleSided&&a.enable(11);t.flipSided&&a.enable(12);t.useDepthPacking&&a.enable(13);t.dithering&&a.enable(14);t.transmission&&a.enable(15);t.sheen&&a.enable(16);t.opaque&&a.enable(17);t.pointsUvs&&a.enable(18);t.decodeVideoTexture&&a.enable(19);t.alphaToCoverage&&a.enable(20);e.push(a.mask)}(r,t),r.push(e.outputColorSpace)),r.push(t.customProgramCacheKey),r.join()},getUniforms:function(e){const t=y[e.type];let r;if(t){const e=_o[t];r=ao.clone(e.uniforms)}else r=e.uniforms;return r},acquireProgram:function(t,r){let n;for(let e=0,t=u.length;e<t;e++){const t=u[e];if(t.cacheKey===r){n=t,++n.usedTimes;break}}return void 0===n&&(n=new WebGLProgram(e,r,t,s),u.push(n)),n},releaseProgram:function(e){if(0==--e.usedTimes){const t=u.indexOf(e);u[t]=u[u.length-1],u.pop(),e.destroy()}},releaseShaderCache:function(e){l.remove(e)},programs:u,dispose:function(){l.dispose()}}}function WebGLProperties(){let e=new WeakMap;return{get:function(t){let r=e.get(t);return void 0===r&&(r={},e.set(t,r)),r},remove:function(t){e.delete(t)},update:function(t,r,n){e.get(t)[r]=n},dispose:function(){e=new WeakMap}}}function Cl(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function Al(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function WebGLRenderList(){const e=[];let t=0;const r=[],n=[],i=[];function s(r,n,i,s,o,a){let l=e[t];return void 0===l?(l={id:r.id,object:r,geometry:n,material:i,groupOrder:s,renderOrder:r.renderOrder,z:o,group:a},e[t]=l):(l.id=r.id,l.object=r,l.geometry=n,l.material=i,l.groupOrder=s,l.renderOrder=r.renderOrder,l.z=o,l.group=a),t++,l}return{opaque:r,transmissive:n,transparent:i,init:function(){t=0,r.length=0,n.length=0,i.length=0},push:function(e,t,o,a,l,c){const u=s(e,t,o,a,l,c);o.transmission>0?n.push(u):!0===o.transparent?i.push(u):r.push(u)},unshift:function(e,t,o,a,l,c){const u=s(e,t,o,a,l,c);o.transmission>0?n.unshift(u):!0===o.transparent?i.unshift(u):r.unshift(u)},finish:function(){for(let r=t,n=e.length;r<n;r++){const t=e[r];if(null===t.id)break;t.id=null,t.object=null,t.geometry=null,t.material=null,t.group=null}},sort:function(e,t){r.length>1&&r.sort(e||Cl),n.length>1&&n.sort(t||Al),i.length>1&&i.sort(t||Al)}}}function WebGLRenderLists(){let e=new WeakMap;return{get:function(t,r){const n=e.get(t);let i;return void 0===n?(i=new WebGLRenderList,e.set(t,[i])):r>=n.length?(i=new WebGLRenderList,n.push(i)):i=n[r],i},dispose:function(){e=new WeakMap}}}function UniformsCache(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let r;switch(t.type){case"DirectionalLight":r={direction:new Vector3,color:new Color};break;case"SpotLight":r={position:new Vector3,direction:new Vector3,color:new Color,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":r={position:new Vector3,color:new Color,distance:0,decay:0};break;case"HemisphereLight":r={direction:new Vector3,skyColor:new Color,groundColor:new Color};break;case"RectAreaLight":r={color:new Color,position:new Vector3,halfWidth:new Vector3,halfHeight:new Vector3}}return e[t.id]=r,r}}}let Tl=0;function Dl(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+(t.map?1:0)-(e.map?1:0)}function WebGLLights(e,t){const r=new UniformsCache,n=function(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let r;switch(t.type){case"DirectionalLight":case"SpotLight":r={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Vector2};break;case"PointLight":r={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Vector2,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=r,r}}}(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let e=0;e<9;e++)i.probe.push(new Vector3);const s=new Vector3,o=new Matrix4,a=new Matrix4;return{setup:function(s,o){let a=0,l=0,c=0;for(let e=0;e<9;e++)i.probe[e].set(0,0,0);let u=0,d=0,h=0,p=0,m=0,f=0,g=0,y=0,b=0,v=0,_=0;s.sort(Dl);const x=!0===o?Math.PI:1;for(let e=0,t=s.length;e<t;e++){const t=s[e],o=t.color,w=t.intensity,R=t.distance,k=t.shadow&&t.shadow.map?t.shadow.map.texture:null;if(t.isAmbientLight)a+=o.r*w*x,l+=o.g*w*x,c+=o.b*w*x;else if(t.isLightProbe){for(let e=0;e<9;e++)i.probe[e].addScaledVector(t.sh.coefficients[e],w);_++}else if(t.isDirectionalLight){const e=r.get(t);if(e.color.copy(t.color).multiplyScalar(t.intensity*x),t.castShadow){const e=t.shadow,r=n.get(t);r.shadowBias=e.bias,r.shadowNormalBias=e.normalBias,r.shadowRadius=e.radius,r.shadowMapSize=e.mapSize,i.directionalShadow[u]=r,i.directionalShadowMap[u]=k,i.directionalShadowMatrix[u]=t.shadow.matrix,f++}i.directional[u]=e,u++}else if(t.isSpotLight){const e=r.get(t);e.position.setFromMatrixPosition(t.matrixWorld),e.color.copy(o).multiplyScalar(w*x),e.distance=R,e.coneCos=Math.cos(t.angle),e.penumbraCos=Math.cos(t.angle*(1-t.penumbra)),e.decay=t.decay,i.spot[h]=e;const s=t.shadow;if(t.map&&(i.spotLightMap[b]=t.map,b++,s.updateMatrices(t),t.castShadow&&v++),i.spotLightMatrix[h]=s.matrix,t.castShadow){const e=n.get(t);e.shadowBias=s.bias,e.shadowNormalBias=s.normalBias,e.shadowRadius=s.radius,e.shadowMapSize=s.mapSize,i.spotShadow[h]=e,i.spotShadowMap[h]=k,y++}h++}else if(t.isRectAreaLight){const e=r.get(t);e.color.copy(o).multiplyScalar(w),e.halfWidth.set(.5*t.width,0,0),e.halfHeight.set(0,.5*t.height,0),i.rectArea[p]=e,p++}else if(t.isPointLight){const e=r.get(t);if(e.color.copy(t.color).multiplyScalar(t.intensity*x),e.distance=t.distance,e.decay=t.decay,t.castShadow){const e=t.shadow,r=n.get(t);r.shadowBias=e.bias,r.shadowNormalBias=e.normalBias,r.shadowRadius=e.radius,r.shadowMapSize=e.mapSize,r.shadowCameraNear=e.camera.near,r.shadowCameraFar=e.camera.far,i.pointShadow[d]=r,i.pointShadowMap[d]=k,i.pointShadowMatrix[d]=t.shadow.matrix,g++}i.point[d]=e,d++}else if(t.isHemisphereLight){const e=r.get(t);e.skyColor.copy(t.color).multiplyScalar(w*x),e.groundColor.copy(t.groundColor).multiplyScalar(w*x),i.hemi[m]=e,m++}}p>0&&(t.isWebGL2?!0===e.has("OES_texture_float_linear")?(i.rectAreaLTC1=vo.LTC_FLOAT_1,i.rectAreaLTC2=vo.LTC_FLOAT_2):(i.rectAreaLTC1=vo.LTC_HALF_1,i.rectAreaLTC2=vo.LTC_HALF_2):!0===e.has("OES_texture_float_linear")?(i.rectAreaLTC1=vo.LTC_FLOAT_1,i.rectAreaLTC2=vo.LTC_FLOAT_2):!0===e.has("OES_texture_half_float_linear")?(i.rectAreaLTC1=vo.LTC_HALF_1,i.rectAreaLTC2=vo.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=a,i.ambient[1]=l,i.ambient[2]=c;const w=i.hash;w.directionalLength===u&&w.pointLength===d&&w.spotLength===h&&w.rectAreaLength===p&&w.hemiLength===m&&w.numDirectionalShadows===f&&w.numPointShadows===g&&w.numSpotShadows===y&&w.numSpotMaps===b&&w.numLightProbes===_||(i.directional.length=u,i.spot.length=h,i.rectArea.length=p,i.point.length=d,i.hemi.length=m,i.directionalShadow.length=f,i.directionalShadowMap.length=f,i.pointShadow.length=g,i.pointShadowMap.length=g,i.spotShadow.length=y,i.spotShadowMap.length=y,i.directionalShadowMatrix.length=f,i.pointShadowMatrix.length=g,i.spotLightMatrix.length=y+b-v,i.spotLightMap.length=b,i.numSpotLightShadowsWithMaps=v,i.numLightProbes=_,w.directionalLength=u,w.pointLength=d,w.spotLength=h,w.rectAreaLength=p,w.hemiLength=m,w.numDirectionalShadows=f,w.numPointShadows=g,w.numSpotShadows=y,w.numSpotMaps=b,w.numLightProbes=_,i.version=Tl++)},setupView:function(e,t){let r=0,n=0,l=0,c=0,u=0;const d=t.matrixWorldInverse;for(let t=0,h=e.length;t<h;t++){const h=e[t];if(h.isDirectionalLight){const e=i.directional[r];e.direction.setFromMatrixPosition(h.matrixWorld),s.setFromMatrixPosition(h.target.matrixWorld),e.direction.sub(s),e.direction.transformDirection(d),r++}else if(h.isSpotLight){const e=i.spot[l];e.position.setFromMatrixPosition(h.matrixWorld),e.position.applyMatrix4(d),e.direction.setFromMatrixPosition(h.matrixWorld),s.setFromMatrixPosition(h.target.matrixWorld),e.direction.sub(s),e.direction.transformDirection(d),l++}else if(h.isRectAreaLight){const e=i.rectArea[c];e.position.setFromMatrixPosition(h.matrixWorld),e.position.applyMatrix4(d),a.identity(),o.copy(h.matrixWorld),o.premultiply(d),a.extractRotation(o),e.halfWidth.set(.5*h.width,0,0),e.halfHeight.set(0,.5*h.height,0),e.halfWidth.applyMatrix4(a),e.halfHeight.applyMatrix4(a),c++}else if(h.isPointLight){const e=i.point[n];e.position.setFromMatrixPosition(h.matrixWorld),e.position.applyMatrix4(d),n++}else if(h.isHemisphereLight){const e=i.hemi[u];e.direction.setFromMatrixPosition(h.matrixWorld),e.direction.transformDirection(d),u++}}},state:i}}function WebGLRenderState(e,t){const r=new WebGLLights(e,t),n=[],i=[];return{init:function(){n.length=0,i.length=0},state:{lightsArray:n,shadowsArray:i,lights:r},setupLights:function(e){r.setup(n,e)},setupLightsView:function(e){r.setupView(n,e)},pushLight:function(e){n.push(e)},pushShadow:function(e){i.push(e)}}}function WebGLRenderStates(e,t){let r=new WeakMap;return{get:function(n,i=0){const s=r.get(n);let o;return void 0===s?(o=new WebGLRenderState(e,t),r.set(n,[o])):i>=s.length?(o=new WebGLRenderState(e,t),s.push(o)):o=s[i],o},dispose:function(){r=new WeakMap}}}class MeshDepthMaterial extends Material{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=Er,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class MeshDistanceMaterial extends Material{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}function WebGLShadowMap(e,t,r){let n=new Frustum;const i=new Vector2,s=new Vector2,o=new Vector4,a=new MeshDepthMaterial({depthPacking:Mr}),l=new MeshDistanceMaterial,c={},u=r.maxTextureSize,h={[m]:f,[f]:m,[g]:g},b=new ShaderMaterial({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Vector2},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),v=b.clone();v.defines.HORIZONTAL_PASS=1;const _=new BufferGeometry;_.setAttribute("position",new BufferAttribute(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const x=new Mesh(_,b),w=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=d;let R=this.type;function VSMPass(r,n){const s=t.update(x);b.defines.VSM_SAMPLES!==r.blurSamples&&(b.defines.VSM_SAMPLES=r.blurSamples,v.defines.VSM_SAMPLES=r.blurSamples,b.needsUpdate=!0,v.needsUpdate=!0),null===r.mapPass&&(r.mapPass=new WebGLRenderTarget(i.x,i.y)),b.uniforms.shadow_pass.value=r.map.texture,b.uniforms.resolution.value=r.mapSize,b.uniforms.radius.value=r.radius,e.setRenderTarget(r.mapPass),e.clear(),e.renderBufferDirect(n,null,s,b,x,null),v.uniforms.shadow_pass.value=r.mapPass.texture,v.uniforms.resolution.value=r.mapSize,v.uniforms.radius.value=r.radius,e.setRenderTarget(r.map),e.clear(),e.renderBufferDirect(n,null,s,v,x,null)}function k(t,r,n,i){let s=null;const o=!0===n.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(void 0!==o)s=o;else if(s=!0===n.isPointLight?l:a,e.localClippingEnabled&&!0===r.clipShadows&&Array.isArray(r.clippingPlanes)&&0!==r.clippingPlanes.length||r.displacementMap&&0!==r.displacementScale||r.alphaMap&&r.alphaTest>0||r.map&&r.alphaTest>0){const e=s.uuid,t=r.uuid;let n=c[e];void 0===n&&(n={},c[e]=n);let i=n[t];void 0===i&&(i=s.clone(),n[t]=i,r.addEventListener("dispose",z)),s=i}if(s.visible=r.visible,s.wireframe=r.wireframe,s.side=i===p?null!==r.shadowSide?r.shadowSide:r.side:null!==r.shadowSide?r.shadowSide:h[r.side],s.alphaMap=r.alphaMap,s.alphaTest=r.alphaTest,s.map=r.map,s.clipShadows=r.clipShadows,s.clippingPlanes=r.clippingPlanes,s.clipIntersection=r.clipIntersection,s.displacementMap=r.displacementMap,s.displacementScale=r.displacementScale,s.displacementBias=r.displacementBias,s.wireframeLinewidth=r.wireframeLinewidth,s.linewidth=r.linewidth,!0===n.isPointLight&&!0===s.isMeshDistanceMaterial){e.properties.get(s).light=n}return s}function j(r,i,s,o,a){if(!1===r.visible)return;if(r.layers.test(i.layers)&&(r.isMesh||r.isLine||r.isPoints)&&(r.castShadow||r.receiveShadow&&a===p)&&(!r.frustumCulled||n.intersectsObject(r))){r.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,r.matrixWorld);const n=t.update(r),l=r.material;if(Array.isArray(l)){const t=n.groups;for(let c=0,u=t.length;c<u;c++){const u=t[c],d=l[u.materialIndex];if(d&&d.visible){const t=k(r,d,o,a);r.onBeforeShadow(e,r,i,s,n,t,u),e.renderBufferDirect(s,null,n,t,r,u),r.onAfterShadow(e,r,i,s,n,t,u)}}}else if(l.visible){const t=k(r,l,o,a);r.onBeforeShadow(e,r,i,s,n,t,null),e.renderBufferDirect(s,null,n,t,r,null),r.onAfterShadow(e,r,i,s,n,t,null)}}const l=r.children;for(let e=0,t=l.length;e<t;e++)j(l[e],i,s,o,a)}function z(e){e.target.removeEventListener("dispose",z);for(const t in c){const r=c[t],n=e.target.uuid;if(n in r){r[n].dispose(),delete r[n]}}}this.render=function(t,r,a){if(!1===w.enabled)return;if(!1===w.autoUpdate&&!1===w.needsUpdate)return;if(0===t.length)return;const l=e.getRenderTarget(),c=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),h=e.state;h.setBlending(y),h.buffers.color.setClear(1,1,1,1),h.buffers.depth.setTest(!0),h.setScissorTest(!1);const m=R!==p&&this.type===p,f=R===p&&this.type!==p;for(let l=0,c=t.length;l<c;l++){const c=t[l],d=c.shadow;if(void 0===d){console.warn("THREE.WebGLShadowMap:",c,"has no shadow.");continue}if(!1===d.autoUpdate&&!1===d.needsUpdate)continue;i.copy(d.mapSize);const g=d.getFrameExtents();if(i.multiply(g),s.copy(d.mapSize),(i.x>u||i.y>u)&&(i.x>u&&(s.x=Math.floor(u/g.x),i.x=s.x*g.x,d.mapSize.x=s.x),i.y>u&&(s.y=Math.floor(u/g.y),i.y=s.y*g.y,d.mapSize.y=s.y)),null===d.map||!0===m||!0===f){const e=this.type!==p?{minFilter:tt,magFilter:tt}:{};null!==d.map&&d.map.dispose(),d.map=new WebGLRenderTarget(i.x,i.y,e),d.map.texture.name=c.name+".shadowMap",d.camera.updateProjectionMatrix()}e.setRenderTarget(d.map),e.clear();const y=d.getViewportCount();for(let e=0;e<y;e++){const t=d.getViewport(e);o.set(s.x*t.x,s.y*t.y,s.x*t.z,s.y*t.w),h.viewport(o),d.updateMatrices(c,e),n=d.getFrustum(),j(r,a,d.camera,c,this.type)}!0!==d.isPointLightShadow&&this.type===p&&VSMPass(d,a),d.needsUpdate=!1}R=this.type,w.needsUpdate=!1,e.setRenderTarget(l,c,d)}}function WebGLState(e,t,r){const n=r.isWebGL2;const i=new function(){let t=!1;const r=new Vector4;let n=null;const i=new Vector4(0,0,0,0);return{setMask:function(r){n===r||t||(e.colorMask(r,r,r,r),n=r)},setLocked:function(e){t=e},setClear:function(t,n,s,o,a){!0===a&&(t*=o,n*=o,s*=o),r.set(t,n,s,o),!1===i.equals(r)&&(e.clearColor(t,n,s,o),i.copy(r))},reset:function(){t=!1,n=null,i.set(-1,0,0,0)}}},s=new function(){let t=!1,r=null,n=null,i=null;return{setTest:function(t){t?ct(e.DEPTH_TEST):ut(e.DEPTH_TEST)},setMask:function(n){r===n||t||(e.depthMask(n),r=n)},setFunc:function(t){if(n!==t){switch(t){case de:e.depthFunc(e.NEVER);break;case he:e.depthFunc(e.ALWAYS);break;case pe:e.depthFunc(e.LESS);break;case me:e.depthFunc(e.LEQUAL);break;case fe:e.depthFunc(e.EQUAL);break;case ge:e.depthFunc(e.GEQUAL);break;case ye:e.depthFunc(e.GREATER);break;case be:e.depthFunc(e.NOTEQUAL);break;default:e.depthFunc(e.LEQUAL)}n=t}},setLocked:function(e){t=e},setClear:function(t){i!==t&&(e.clearDepth(t),i=t)},reset:function(){t=!1,r=null,n=null,i=null}}},c=new function(){let t=!1,r=null,n=null,i=null,s=null,o=null,a=null,l=null,c=null;return{setTest:function(r){t||(r?ct(e.STENCIL_TEST):ut(e.STENCIL_TEST))},setMask:function(n){r===n||t||(e.stencilMask(n),r=n)},setFunc:function(t,r,o){n===t&&i===r&&s===o||(e.stencilFunc(t,r,o),n=t,i=r,s=o)},setOp:function(t,r,n){o===t&&a===r&&l===n||(e.stencilOp(t,r,n),o=t,a=r,l=n)},setLocked:function(e){t=e},setClear:function(t){c!==t&&(e.clearStencil(t),c=t)},reset:function(){t=!1,r=null,n=null,i=null,s=null,o=null,a=null,l=null,c=null}}},u=new WeakMap,d=new WeakMap;let h={},p={},m=new WeakMap,ve=[],_e=null,xe=!1,we=null,Se=null,Pe=null,Te=null,Re=null,ke=null,Ie=null,je=new Color(0,0,0),He=0,ze=!1,Ge=null,We=null,Ve=null,qe=null,$e=null;const Xe=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let Ye=!1,Qe=0;const et=e.getParameter(e.VERSION);-1!==et.indexOf("WebGL")?(Qe=parseFloat(/^WebGL (\d)/.exec(et)[1]),Ye=Qe>=1):-1!==et.indexOf("OpenGL ES")&&(Qe=parseFloat(/^OpenGL ES (\d)/.exec(et)[1]),Ye=Qe>=2);let tt=null,rt={};const nt=e.getParameter(e.SCISSOR_BOX),it=e.getParameter(e.VIEWPORT),st=(new Vector4).fromArray(nt),ot=(new Vector4).fromArray(it);function at(t,r,i,s){const o=new Uint8Array(4),a=e.createTexture();e.bindTexture(t,a),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let a=0;a<i;a++)!n||t!==e.TEXTURE_3D&&t!==e.TEXTURE_2D_ARRAY?e.texImage2D(r+a,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,o):e.texImage3D(r,0,e.RGBA,1,1,s,0,e.RGBA,e.UNSIGNED_BYTE,o);return a}const lt={};function ct(t){!0!==h[t]&&(e.enable(t),h[t]=!0)}function ut(t){!1!==h[t]&&(e.disable(t),h[t]=!1)}lt[e.TEXTURE_2D]=at(e.TEXTURE_2D,e.TEXTURE_2D,1),lt[e.TEXTURE_CUBE_MAP]=at(e.TEXTURE_CUBE_MAP,e.TEXTURE_CUBE_MAP_POSITIVE_X,6),n&&(lt[e.TEXTURE_2D_ARRAY]=at(e.TEXTURE_2D_ARRAY,e.TEXTURE_2D_ARRAY,1,1),lt[e.TEXTURE_3D]=at(e.TEXTURE_3D,e.TEXTURE_3D,1,1)),i.setClear(0,0,0,1),s.setClear(1),c.setClear(0),ct(e.DEPTH_TEST),s.setFunc(me),mt(!1),ft(a),ct(e.CULL_FACE),pt(y);const dt={[R]:e.FUNC_ADD,[k]:e.FUNC_SUBTRACT,[j]:e.FUNC_REVERSE_SUBTRACT};if(n)dt[z]=e.MIN,dt[q]=e.MAX;else{const e=t.get("EXT_blend_minmax");null!==e&&(dt[z]=e.MIN_EXT,dt[q]=e.MAX_EXT)}const ht={[$]:e.ZERO,[Z]:e.ONE,[X]:e.SRC_COLOR,[ee]:e.SRC_ALPHA,[oe]:e.SRC_ALPHA_SATURATE,[ie]:e.DST_COLOR,[re]:e.DST_ALPHA,[Y]:e.ONE_MINUS_SRC_COLOR,[te]:e.ONE_MINUS_SRC_ALPHA,[se]:e.ONE_MINUS_DST_COLOR,[ne]:e.ONE_MINUS_DST_ALPHA,[ae]:e.CONSTANT_COLOR,[le]:e.ONE_MINUS_CONSTANT_COLOR,[ce]:e.CONSTANT_ALPHA,[ue]:e.ONE_MINUS_CONSTANT_ALPHA};function pt(t,r,n,i,s,o,a,l,c,u){if(t!==y){if(!1===xe&&(ct(e.BLEND),xe=!0),t===w)s=s||r,o=o||n,a=a||i,r===Se&&s===Re||(e.blendEquationSeparate(dt[r],dt[s]),Se=r,Re=s),n===Pe&&i===Te&&o===ke&&a===Ie||(e.blendFuncSeparate(ht[n],ht[i],ht[o],ht[a]),Pe=n,Te=i,ke=o,Ie=a),!1!==l.equals(je)&&c===He||(e.blendColor(l.r,l.g,l.b,c),je.copy(l),He=c),we=t,ze=!1;else if(t!==we||u!==ze){if(Se===R&&Re===R||(e.blendEquation(e.FUNC_ADD),Se=R,Re=R),u)switch(t){case b:e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case v:e.blendFunc(e.ONE,e.ONE);break;case _:e.blendFuncSeparate(e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);break;case x:e.blendFuncSeparate(e.ZERO,e.SRC_COLOR,e.ZERO,e.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case b:e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case v:e.blendFunc(e.SRC_ALPHA,e.ONE);break;case _:e.blendFuncSeparate(e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);break;case x:e.blendFunc(e.ZERO,e.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}Pe=null,Te=null,ke=null,Ie=null,je.set(0,0,0),He=0,we=t,ze=u}}else!0===xe&&(ut(e.BLEND),xe=!1)}function mt(t){Ge!==t&&(t?e.frontFace(e.CW):e.frontFace(e.CCW),Ge=t)}function ft(t){t!==o?(ct(e.CULL_FACE),t!==We&&(t===a?e.cullFace(e.BACK):t===l?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK))):ut(e.CULL_FACE),We=t}function gt(t,r,n){t?(ct(e.POLYGON_OFFSET_FILL),qe===r&&$e===n||(e.polygonOffset(r,n),qe=r,$e=n)):ut(e.POLYGON_OFFSET_FILL)}return{buffers:{color:i,depth:s,stencil:c},enable:ct,disable:ut,bindFramebuffer:function(t,r){return p[t]!==r&&(e.bindFramebuffer(t,r),p[t]=r,n&&(t===e.DRAW_FRAMEBUFFER&&(p[e.FRAMEBUFFER]=r),t===e.FRAMEBUFFER&&(p[e.DRAW_FRAMEBUFFER]=r)),!0)},drawBuffers:function(n,i){let s=ve,o=!1;if(n){s=m.get(i),void 0===s&&(s=[],m.set(i,s));const t=n.textures;if(s.length!==t.length||s[0]!==e.COLOR_ATTACHMENT0){for(let r=0,n=t.length;r<n;r++)s[r]=e.COLOR_ATTACHMENT0+r;s.length=t.length,o=!0}}else s[0]!==e.BACK&&(s[0]=e.BACK,o=!0);if(o)if(r.isWebGL2)e.drawBuffers(s);else{if(!0!==t.has("WEBGL_draw_buffers"))throw new Error("THREE.WebGLState: Usage of gl.drawBuffers() require WebGL2 or WEBGL_draw_buffers extension");t.get("WEBGL_draw_buffers").drawBuffersWEBGL(s)}},useProgram:function(t){return _e!==t&&(e.useProgram(t),_e=t,!0)},setBlending:pt,setMaterial:function(t,r){t.side===g?ut(e.CULL_FACE):ct(e.CULL_FACE);let n=t.side===f;r&&(n=!n),mt(n),t.blending===b&&!1===t.transparent?pt(y):pt(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.blendColor,t.blendAlpha,t.premultipliedAlpha),s.setFunc(t.depthFunc),s.setTest(t.depthTest),s.setMask(t.depthWrite),i.setMask(t.colorWrite);const o=t.stencilWrite;c.setTest(o),o&&(c.setMask(t.stencilWriteMask),c.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),c.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),gt(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits),!0===t.alphaToCoverage?ct(e.SAMPLE_ALPHA_TO_COVERAGE):ut(e.SAMPLE_ALPHA_TO_COVERAGE)},setFlipSided:mt,setCullFace:ft,setLineWidth:function(t){t!==Ve&&(Ye&&e.lineWidth(t),Ve=t)},setPolygonOffset:gt,setScissorTest:function(t){t?ct(e.SCISSOR_TEST):ut(e.SCISSOR_TEST)},activeTexture:function(t){void 0===t&&(t=e.TEXTURE0+Xe-1),tt!==t&&(e.activeTexture(t),tt=t)},bindTexture:function(t,r,n){void 0===n&&(n=null===tt?e.TEXTURE0+Xe-1:tt);let i=rt[n];void 0===i&&(i={type:void 0,texture:void 0},rt[n]=i),i.type===t&&i.texture===r||(tt!==n&&(e.activeTexture(n),tt=n),e.bindTexture(t,r||lt[t]),i.type=t,i.texture=r)},unbindTexture:function(){const t=rt[tt];void 0!==t&&void 0!==t.type&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function(){try{e.compressedTexImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},compressedTexImage3D:function(){try{e.compressedTexImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage2D:function(){try{e.texImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage3D:function(){try{e.texImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},updateUBOMapping:function(t,r){let n=d.get(r);void 0===n&&(n=new WeakMap,d.set(r,n));let i=n.get(t);void 0===i&&(i=e.getUniformBlockIndex(r,t.name),n.set(t,i))},uniformBlockBinding:function(t,r){const n=d.get(r).get(t);u.get(r)!==n&&(e.uniformBlockBinding(r,n,t.__bindingPointIndex),u.set(r,n))},texStorage2D:function(){try{e.texStorage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texStorage3D:function(){try{e.texStorage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texSubImage2D:function(){try{e.texSubImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texSubImage3D:function(){try{e.texSubImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},compressedTexSubImage2D:function(){try{e.compressedTexSubImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},compressedTexSubImage3D:function(){try{e.compressedTexSubImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},scissor:function(t){!1===st.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),st.copy(t))},viewport:function(t){!1===ot.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),ot.copy(t))},reset:function(){e.disable(e.BLEND),e.disable(e.CULL_FACE),e.disable(e.DEPTH_TEST),e.disable(e.POLYGON_OFFSET_FILL),e.disable(e.SCISSOR_TEST),e.disable(e.STENCIL_TEST),e.disable(e.SAMPLE_ALPHA_TO_COVERAGE),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ZERO),e.blendFuncSeparate(e.ONE,e.ZERO,e.ONE,e.ZERO),e.blendColor(0,0,0,0),e.colorMask(!0,!0,!0,!0),e.clearColor(0,0,0,0),e.depthMask(!0),e.depthFunc(e.LESS),e.clearDepth(1),e.stencilMask(4294967295),e.stencilFunc(e.ALWAYS,0,4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.clearStencil(0),e.cullFace(e.BACK),e.frontFace(e.CCW),e.polygonOffset(0,0),e.activeTexture(e.TEXTURE0),e.bindFramebuffer(e.FRAMEBUFFER,null),!0===n&&(e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),e.bindFramebuffer(e.READ_FRAMEBUFFER,null)),e.useProgram(null),e.lineWidth(1),e.scissor(0,0,e.canvas.width,e.canvas.height),e.viewport(0,0,e.canvas.width,e.canvas.height),h={},tt=null,rt={},p={},m=new WeakMap,ve=[],_e=null,xe=!1,we=null,Se=null,Pe=null,Te=null,Re=null,ke=null,Ie=null,je=new Color(0,0,0),He=0,ze=!1,Ge=null,We=null,Ve=null,qe=null,$e=null,st.set(0,0,e.canvas.width,e.canvas.height),ot.set(0,0,e.canvas.width,e.canvas.height),i.reset(),s.reset(),c.reset()}}}function WebGLTextures(e,t,r,n,i,s,o){const a=i.isWebGL2,l=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,c="undefined"!=typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),u=new Vector2,d=new WeakMap;let h;const p=new WeakMap;let m=!1;try{m="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(e){}function f(e,t){return m?new OffscreenCanvas(e,t):Hn("canvas")}function g(e,t,r,n){let i=1;const s=le(e);if((s.width>n||s.height>n)&&(i=n/Math.max(s.width,s.height)),i<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof VideoFrame&&e instanceof VideoFrame){const n=t?Rn:Math.floor,o=n(i*s.width),a=n(i*s.height);void 0===h&&(h=f(o,a));const l=r?f(o,a):h;l.width=o,l.height=a;return l.getContext("2d").drawImage(e,0,0,o,a),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+s.width+"x"+s.height+") to ("+o+"x"+a+")."),l}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+s.width+"x"+s.height+")."),e}return e}function y(e){const t=le(e);return On(t.width)&&On(t.height)}function b(e,t){return e.generateMipmaps&&t&&e.minFilter!==tt&&e.minFilter!==ot}function v(t){e.generateMipmap(t)}function _(r,n,i,s,o=!1){if(!1===a)return n;if(null!==r){if(void 0!==e[r])return e[r];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+r+"'")}let l=n;if(n===e.RED&&(i===e.FLOAT&&(l=e.R32F),i===e.HALF_FLOAT&&(l=e.R16F),i===e.UNSIGNED_BYTE&&(l=e.R8)),n===e.RED_INTEGER&&(i===e.UNSIGNED_BYTE&&(l=e.R8UI),i===e.UNSIGNED_SHORT&&(l=e.R16UI),i===e.UNSIGNED_INT&&(l=e.R32UI),i===e.BYTE&&(l=e.R8I),i===e.SHORT&&(l=e.R16I),i===e.INT&&(l=e.R32I)),n===e.RG&&(i===e.FLOAT&&(l=e.RG32F),i===e.HALF_FLOAT&&(l=e.RG16F),i===e.UNSIGNED_BYTE&&(l=e.RG8)),n===e.RG_INTEGER&&(i===e.UNSIGNED_BYTE&&(l=e.RG8UI),i===e.UNSIGNED_SHORT&&(l=e.RG16UI),i===e.UNSIGNED_INT&&(l=e.RG32UI),i===e.BYTE&&(l=e.RG8I),i===e.SHORT&&(l=e.RG16I),i===e.INT&&(l=e.RG32I)),n===e.RGBA){const t=o?kr:Zn.getTransfer(s);i===e.FLOAT&&(l=e.RGBA32F),i===e.HALF_FLOAT&&(l=e.RGBA16F),i===e.UNSIGNED_BYTE&&(l=t===Nr?e.SRGB8_ALPHA8:e.RGBA8),i===e.UNSIGNED_SHORT_4_4_4_4&&(l=e.RGBA4),i===e.UNSIGNED_SHORT_5_5_5_1&&(l=e.RGB5_A1)}return l!==e.R16F&&l!==e.R32F&&l!==e.RG16F&&l!==e.RG32F&&l!==e.RGBA16F&&l!==e.RGBA32F||t.get("EXT_color_buffer_float"),l}function x(e,t,r){return!0===b(e,r)||e.isFramebufferTexture&&e.minFilter!==tt&&e.minFilter!==ot?Math.log2(Math.max(t.width,t.height))+1:void 0!==e.mipmaps&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function w(t){return t===tt||t===rt||t===it?e.NEAREST:e.LINEAR}function R(e){const t=e.target;t.removeEventListener("dispose",R),function(e){const t=n.get(e);if(void 0===t.__webglInit)return;const r=e.source,i=p.get(r);if(i){const n=i[t.__cacheKey];n.usedTimes--,0===n.usedTimes&&j(e),0===Object.keys(i).length&&p.delete(r)}n.remove(e)}(t),t.isVideoTexture&&d.delete(t)}function k(t){const r=t.target;r.removeEventListener("dispose",k),function(t){const r=n.get(t);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++){if(Array.isArray(r.__webglFramebuffer[t]))for(let n=0;n<r.__webglFramebuffer[t].length;n++)e.deleteFramebuffer(r.__webglFramebuffer[t][n]);else e.deleteFramebuffer(r.__webglFramebuffer[t]);r.__webglDepthbuffer&&e.deleteRenderbuffer(r.__webglDepthbuffer[t])}else{if(Array.isArray(r.__webglFramebuffer))for(let t=0;t<r.__webglFramebuffer.length;t++)e.deleteFramebuffer(r.__webglFramebuffer[t]);else e.deleteFramebuffer(r.__webglFramebuffer);if(r.__webglDepthbuffer&&e.deleteRenderbuffer(r.__webglDepthbuffer),r.__webglMultisampledFramebuffer&&e.deleteFramebuffer(r.__webglMultisampledFramebuffer),r.__webglColorRenderbuffer)for(let t=0;t<r.__webglColorRenderbuffer.length;t++)r.__webglColorRenderbuffer[t]&&e.deleteRenderbuffer(r.__webglColorRenderbuffer[t]);r.__webglDepthRenderbuffer&&e.deleteRenderbuffer(r.__webglDepthRenderbuffer)}const i=t.textures;for(let t=0,r=i.length;t<r;t++){const r=n.get(i[t]);r.__webglTexture&&(e.deleteTexture(r.__webglTexture),o.memory.textures--),n.remove(i[t])}n.remove(t)}(r)}function j(t){const r=n.get(t);e.deleteTexture(r.__webglTexture);const i=t.source;delete p.get(i)[r.__cacheKey],o.memory.textures--}let z=0;function q(t,i){const s=n.get(t);if(t.isVideoTexture&&function(e){const t=o.render.frame;d.get(e)!==t&&(d.set(e,t),e.update())}(t),!1===t.isRenderTargetTexture&&t.version>0&&s.__version!==t.version){const e=t.image;if(null===e)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==e.complete)return void te(s,t,i);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}r.bindTexture(e.TEXTURE_2D,s.__webglTexture,e.TEXTURE0+i)}const $={[Ye]:e.REPEAT,[Qe]:e.CLAMP_TO_EDGE,[et]:e.MIRRORED_REPEAT},Z={[tt]:e.NEAREST,[rt]:e.NEAREST_MIPMAP_NEAREST,[it]:e.NEAREST_MIPMAP_LINEAR,[ot]:e.LINEAR,[at]:e.LINEAR_MIPMAP_NEAREST,[ct]:e.LINEAR_MIPMAP_LINEAR},X={[en]:e.NEVER,[ln]:e.ALWAYS,[tn]:e.LESS,[nn]:e.LEQUAL,[rn]:e.EQUAL,[an]:e.GEQUAL,[sn]:e.GREATER,[on]:e.NOTEQUAL};function Y(r,s,o){if(s.type!==yt||!1!==t.has("OES_texture_float_linear")||s.magFilter!==ot&&s.magFilter!==at&&s.magFilter!==it&&s.magFilter!==ct&&s.minFilter!==ot&&s.minFilter!==at&&s.minFilter!==it&&s.minFilter!==ct||console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),o?(e.texParameteri(r,e.TEXTURE_WRAP_S,$[s.wrapS]),e.texParameteri(r,e.TEXTURE_WRAP_T,$[s.wrapT]),r!==e.TEXTURE_3D&&r!==e.TEXTURE_2D_ARRAY||e.texParameteri(r,e.TEXTURE_WRAP_R,$[s.wrapR]),e.texParameteri(r,e.TEXTURE_MAG_FILTER,Z[s.magFilter]),e.texParameteri(r,e.TEXTURE_MIN_FILTER,Z[s.minFilter])):(e.texParameteri(r,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(r,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),r!==e.TEXTURE_3D&&r!==e.TEXTURE_2D_ARRAY||e.texParameteri(r,e.TEXTURE_WRAP_R,e.CLAMP_TO_EDGE),s.wrapS===Qe&&s.wrapT===Qe||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),e.texParameteri(r,e.TEXTURE_MAG_FILTER,w(s.magFilter)),e.texParameteri(r,e.TEXTURE_MIN_FILTER,w(s.minFilter)),s.minFilter!==tt&&s.minFilter!==ot&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),s.compareFunction&&(e.texParameteri(r,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(r,e.TEXTURE_COMPARE_FUNC,X[s.compareFunction])),!0===t.has("EXT_texture_filter_anisotropic")){if(s.magFilter===tt)return;if(s.minFilter!==it&&s.minFilter!==ct)return;if(s.type===yt&&!1===t.has("OES_texture_float_linear"))return;if(!1===a&&s.type===bt&&!1===t.has("OES_texture_half_float_linear"))return;if(s.anisotropy>1||n.get(s).__currentAnisotropy){const o=t.get("EXT_texture_filter_anisotropic");e.texParameterf(r,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,i.getMaxAnisotropy())),n.get(s).__currentAnisotropy=s.anisotropy}}}function ee(t,r){let n=!1;void 0===t.__webglInit&&(t.__webglInit=!0,r.addEventListener("dispose",R));const i=r.source;let s=p.get(i);void 0===s&&(s={},p.set(i,s));const a=function(e){const t=[];return t.push(e.wrapS),t.push(e.wrapT),t.push(e.wrapR||0),t.push(e.magFilter),t.push(e.minFilter),t.push(e.anisotropy),t.push(e.internalFormat),t.push(e.format),t.push(e.type),t.push(e.generateMipmaps),t.push(e.premultiplyAlpha),t.push(e.flipY),t.push(e.unpackAlignment),t.push(e.colorSpace),t.join()}(r);if(a!==t.__cacheKey){void 0===s[a]&&(s[a]={texture:e.createTexture(),usedTimes:0},o.memory.textures++,n=!0),s[a].usedTimes++;const i=s[t.__cacheKey];void 0!==i&&(s[t.__cacheKey].usedTimes--,0===i.usedTimes&&j(r)),t.__cacheKey=a,t.__webglTexture=s[a].texture}return n}function te(t,o,l){let c=e.TEXTURE_2D;(o.isDataArrayTexture||o.isCompressedArrayTexture)&&(c=e.TEXTURE_2D_ARRAY),o.isData3DTexture&&(c=e.TEXTURE_3D);const u=ee(t,o),d=o.source;r.bindTexture(c,t.__webglTexture,e.TEXTURE0+l);const h=n.get(d);if(d.version!==h.__version||!0===u){r.activeTexture(e.TEXTURE0+l);const t=Zn.getPrimaries(Zn.workingColorSpace),n=o.colorSpace===Tr?null:Zn.getPrimaries(o.colorSpace),p=o.colorSpace===Tr||t===n?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,o.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,p);const m=function(e){return!a&&(e.wrapS!==Qe||e.wrapT!==Qe||e.minFilter!==tt&&e.minFilter!==ot)}(o)&&!1===y(o.image);let f=g(o.image,m,!1,i.maxTextureSize);f=ae(o,f);const w=y(f)||a,R=s.convert(o.format,o.colorSpace);let k,j=s.convert(o.type),z=_(o.internalFormat,R,j,o.colorSpace,o.isVideoTexture);Y(c,o,w);const q=o.mipmaps,$=a&&!0!==o.isVideoTexture&&z!==Ut,Z=void 0===h.__version||!0===u,X=d.dataReady,ee=x(o,f,w);if(o.isDepthTexture)z=e.DEPTH_COMPONENT,a?z=o.type===yt?e.DEPTH_COMPONENT32F:o.type===gt?e.DEPTH_COMPONENT24:o.type===xt?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT16:o.type===yt&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),o.format===Mt&&z===e.DEPTH_COMPONENT&&o.type!==mt&&o.type!==gt&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),o.type=gt,j=s.convert(o.type)),o.format===Ct&&z===e.DEPTH_COMPONENT&&(z=e.DEPTH_STENCIL,o.type!==xt&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),o.type=xt,j=s.convert(o.type))),Z&&($?r.texStorage2D(e.TEXTURE_2D,1,z,f.width,f.height):r.texImage2D(e.TEXTURE_2D,0,z,f.width,f.height,0,R,j,null));else if(o.isDataTexture)if(q.length>0&&w){$&&Z&&r.texStorage2D(e.TEXTURE_2D,ee,z,q[0].width,q[0].height);for(let t=0,n=q.length;t<n;t++)k=q[t],$?X&&r.texSubImage2D(e.TEXTURE_2D,t,0,0,k.width,k.height,R,j,k.data):r.texImage2D(e.TEXTURE_2D,t,z,k.width,k.height,0,R,j,k.data);o.generateMipmaps=!1}else $?(Z&&r.texStorage2D(e.TEXTURE_2D,ee,z,f.width,f.height),X&&r.texSubImage2D(e.TEXTURE_2D,0,0,0,f.width,f.height,R,j,f.data)):r.texImage2D(e.TEXTURE_2D,0,z,f.width,f.height,0,R,j,f.data);else if(o.isCompressedTexture)if(o.isCompressedArrayTexture){$&&Z&&r.texStorage3D(e.TEXTURE_2D_ARRAY,ee,z,q[0].width,q[0].height,f.depth);for(let t=0,n=q.length;t<n;t++)k=q[t],o.format!==St?null!==R?$?X&&r.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,0,k.width,k.height,f.depth,R,k.data,0,0):r.compressedTexImage3D(e.TEXTURE_2D_ARRAY,t,z,k.width,k.height,f.depth,0,k.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):$?X&&r.texSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,0,k.width,k.height,f.depth,R,j,k.data):r.texImage3D(e.TEXTURE_2D_ARRAY,t,z,k.width,k.height,f.depth,0,R,j,k.data)}else{$&&Z&&r.texStorage2D(e.TEXTURE_2D,ee,z,q[0].width,q[0].height);for(let t=0,n=q.length;t<n;t++)k=q[t],o.format!==St?null!==R?$?X&&r.compressedTexSubImage2D(e.TEXTURE_2D,t,0,0,k.width,k.height,R,k.data):r.compressedTexImage2D(e.TEXTURE_2D,t,z,k.width,k.height,0,k.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):$?X&&r.texSubImage2D(e.TEXTURE_2D,t,0,0,k.width,k.height,R,j,k.data):r.texImage2D(e.TEXTURE_2D,t,z,k.width,k.height,0,R,j,k.data)}else if(o.isDataArrayTexture)$?(Z&&r.texStorage3D(e.TEXTURE_2D_ARRAY,ee,z,f.width,f.height,f.depth),X&&r.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,f.width,f.height,f.depth,R,j,f.data)):r.texImage3D(e.TEXTURE_2D_ARRAY,0,z,f.width,f.height,f.depth,0,R,j,f.data);else if(o.isData3DTexture)$?(Z&&r.texStorage3D(e.TEXTURE_3D,ee,z,f.width,f.height,f.depth),X&&r.texSubImage3D(e.TEXTURE_3D,0,0,0,0,f.width,f.height,f.depth,R,j,f.data)):r.texImage3D(e.TEXTURE_3D,0,z,f.width,f.height,f.depth,0,R,j,f.data);else if(o.isFramebufferTexture){if(Z)if($)r.texStorage2D(e.TEXTURE_2D,ee,z,f.width,f.height);else{let t=f.width,n=f.height;for(let i=0;i<ee;i++)r.texImage2D(e.TEXTURE_2D,i,z,t,n,0,R,j,null),t>>=1,n>>=1}}else if(q.length>0&&w){if($&&Z){const t=le(q[0]);r.texStorage2D(e.TEXTURE_2D,ee,z,t.width,t.height)}for(let t=0,n=q.length;t<n;t++)k=q[t],$?X&&r.texSubImage2D(e.TEXTURE_2D,t,0,0,R,j,k):r.texImage2D(e.TEXTURE_2D,t,z,R,j,k);o.generateMipmaps=!1}else if($){if(Z){const t=le(f);r.texStorage2D(e.TEXTURE_2D,ee,z,t.width,t.height)}X&&r.texSubImage2D(e.TEXTURE_2D,0,0,0,R,j,f)}else r.texImage2D(e.TEXTURE_2D,0,z,R,j,f);b(o,w)&&v(c),h.__version=d.version,o.onUpdate&&o.onUpdate(o)}t.__version=o.version}function re(t,i,o,a,c,u){const d=s.convert(o.format,o.colorSpace),h=s.convert(o.type),p=_(o.internalFormat,d,h,o.colorSpace);if(!n.get(i).__hasExternalTextures){const t=Math.max(1,i.width>>u),n=Math.max(1,i.height>>u);c===e.TEXTURE_3D||c===e.TEXTURE_2D_ARRAY?r.texImage3D(c,u,p,t,n,i.depth,0,d,h,null):r.texImage2D(c,u,p,t,n,0,d,h,null)}r.bindFramebuffer(e.FRAMEBUFFER,t),oe(i)?l.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,a,c,n.get(o).__webglTexture,0,se(i)):(c===e.TEXTURE_2D||c>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&c<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,a,c,n.get(o).__webglTexture,u),r.bindFramebuffer(e.FRAMEBUFFER,null)}function ne(t,r,n){if(e.bindRenderbuffer(e.RENDERBUFFER,t),r.depthBuffer&&!r.stencilBuffer){let i=!0===a?e.DEPTH_COMPONENT24:e.DEPTH_COMPONENT16;if(n||oe(r)){const t=r.depthTexture;t&&t.isDepthTexture&&(t.type===yt?i=e.DEPTH_COMPONENT32F:t.type===gt&&(i=e.DEPTH_COMPONENT24));const n=se(r);oe(r)?l.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,n,i,r.width,r.height):e.renderbufferStorageMultisample(e.RENDERBUFFER,n,i,r.width,r.height)}else e.renderbufferStorage(e.RENDERBUFFER,i,r.width,r.height);e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t)}else if(r.depthBuffer&&r.stencilBuffer){const i=se(r);n&&!1===oe(r)?e.renderbufferStorageMultisample(e.RENDERBUFFER,i,e.DEPTH24_STENCIL8,r.width,r.height):oe(r)?l.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,i,e.DEPTH24_STENCIL8,r.width,r.height):e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,r.width,r.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t)}else{const t=r.textures;for(let i=0;i<t.length;i++){const o=t[i],a=s.convert(o.format,o.colorSpace),c=s.convert(o.type),u=_(o.internalFormat,a,c,o.colorSpace),d=se(r);n&&!1===oe(r)?e.renderbufferStorageMultisample(e.RENDERBUFFER,d,u,r.width,r.height):oe(r)?l.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,d,u,r.width,r.height):e.renderbufferStorage(e.RENDERBUFFER,u,r.width,r.height)}}e.bindRenderbuffer(e.RENDERBUFFER,null)}function ie(t){const i=n.get(t),s=!0===t.isWebGLCubeRenderTarget;if(t.depthTexture&&!i.__autoAllocateDepthBuffer){if(s)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,i){if(i&&i.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(r.bindFramebuffer(e.FRAMEBUFFER,t),!i.depthTexture||!i.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");n.get(i.depthTexture).__webglTexture&&i.depthTexture.image.width===i.width&&i.depthTexture.image.height===i.height||(i.depthTexture.image.width=i.width,i.depthTexture.image.height=i.height,i.depthTexture.needsUpdate=!0),q(i.depthTexture,0);const s=n.get(i.depthTexture).__webglTexture,o=se(i);if(i.depthTexture.format===Mt)oe(i)?l.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,s,0,o):e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,s,0);else{if(i.depthTexture.format!==Ct)throw new Error("Unknown depthTexture format");oe(i)?l.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,s,0,o):e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,s,0)}}(i.__webglFramebuffer,t)}else if(s){i.__webglDepthbuffer=[];for(let n=0;n<6;n++)r.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[n]),i.__webglDepthbuffer[n]=e.createRenderbuffer(),ne(i.__webglDepthbuffer[n],t,!1)}else r.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer),i.__webglDepthbuffer=e.createRenderbuffer(),ne(i.__webglDepthbuffer,t,!1);r.bindFramebuffer(e.FRAMEBUFFER,null)}function se(e){return Math.min(i.maxSamples,e.samples)}function oe(e){const r=n.get(e);return a&&e.samples>0&&!0===t.has("WEBGL_multisampled_render_to_texture")&&!1!==r.__useRenderToTexture}function ae(e,r){const n=e.colorSpace,i=e.format,s=e.type;return!0===e.isCompressedTexture||!0===e.isVideoTexture||e.format===_n||n!==Or&&n!==Tr&&(Zn.getTransfer(n)===Nr?!1===a?!0===t.has("EXT_sRGB")&&i===St?(e.format=_n,e.minFilter=ot,e.generateMipmaps=!1):r=ImageUtils.sRGBToLinear(r):i===St&&s===dt||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",n)),r}function le(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?(u.width=e.naturalWidth||e.width,u.height=e.naturalHeight||e.height):"undefined"!=typeof VideoFrame&&e instanceof VideoFrame?(u.width=e.displayWidth,u.height=e.displayHeight):(u.width=e.width,u.height=e.height),u}this.allocateTextureUnit=function(){const e=z;return e>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+i.maxTextures),z+=1,e},this.resetTextureUnits=function(){z=0},this.setTexture2D=q,this.setTexture2DArray=function(t,i){const s=n.get(t);t.version>0&&s.__version!==t.version?te(s,t,i):r.bindTexture(e.TEXTURE_2D_ARRAY,s.__webglTexture,e.TEXTURE0+i)},this.setTexture3D=function(t,i){const s=n.get(t);t.version>0&&s.__version!==t.version?te(s,t,i):r.bindTexture(e.TEXTURE_3D,s.__webglTexture,e.TEXTURE0+i)},this.setTextureCube=function(t,o){const l=n.get(t);t.version>0&&l.__version!==t.version?function(t,o,l){if(6!==o.image.length)return;const c=ee(t,o),u=o.source;r.bindTexture(e.TEXTURE_CUBE_MAP,t.__webglTexture,e.TEXTURE0+l);const d=n.get(u);if(u.version!==d.__version||!0===c){r.activeTexture(e.TEXTURE0+l);const t=Zn.getPrimaries(Zn.workingColorSpace),n=o.colorSpace===Tr?null:Zn.getPrimaries(o.colorSpace),h=o.colorSpace===Tr||t===n?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,o.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,h);const p=o.isCompressedTexture||o.image[0].isCompressedTexture,m=o.image[0]&&o.image[0].isDataTexture,f=[];for(let e=0;e<6;e++)f[e]=p||m?m?o.image[e].image:o.image[e]:g(o.image[e],!1,!0,i.maxCubemapSize),f[e]=ae(o,f[e]);const w=f[0],R=y(w)||a,k=s.convert(o.format,o.colorSpace),j=s.convert(o.type),z=_(o.internalFormat,k,j,o.colorSpace),q=a&&!0!==o.isVideoTexture,$=void 0===d.__version||!0===c,Z=u.dataReady;let X,ee=x(o,w,R);if(Y(e.TEXTURE_CUBE_MAP,o,R),p){q&&$&&r.texStorage2D(e.TEXTURE_CUBE_MAP,ee,z,w.width,w.height);for(let t=0;t<6;t++){X=f[t].mipmaps;for(let n=0;n<X.length;n++){const i=X[n];o.format!==St?null!==k?q?Z&&r.compressedTexSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,n,0,0,i.width,i.height,k,i.data):r.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,n,z,i.width,i.height,0,i.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):q?Z&&r.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,n,0,0,i.width,i.height,k,j,i.data):r.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,n,z,i.width,i.height,0,k,j,i.data)}}}else{if(X=o.mipmaps,q&&$){X.length>0&&ee++;const t=le(f[0]);r.texStorage2D(e.TEXTURE_CUBE_MAP,ee,z,t.width,t.height)}for(let t=0;t<6;t++)if(m){q?Z&&r.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,f[t].width,f[t].height,k,j,f[t].data):r.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,z,f[t].width,f[t].height,0,k,j,f[t].data);for(let n=0;n<X.length;n++){const i=X[n].image[t].image;q?Z&&r.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,n+1,0,0,i.width,i.height,k,j,i.data):r.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,n+1,z,i.width,i.height,0,k,j,i.data)}}else{q?Z&&r.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,k,j,f[t]):r.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,z,k,j,f[t]);for(let n=0;n<X.length;n++){const i=X[n];q?Z&&r.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,n+1,0,0,k,j,i.image[t]):r.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,n+1,z,k,j,i.image[t])}}}b(o,R)&&v(e.TEXTURE_CUBE_MAP),d.__version=u.version,o.onUpdate&&o.onUpdate(o)}t.__version=o.version}(l,t,o):r.bindTexture(e.TEXTURE_CUBE_MAP,l.__webglTexture,e.TEXTURE0+o)},this.rebindTextures=function(t,r,i){const s=n.get(t);void 0!==r&&re(s.__webglFramebuffer,t,t.texture,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,0),void 0!==i&&ie(t)},this.setupRenderTarget=function(t){const l=t.texture,c=n.get(t),u=n.get(l);t.addEventListener("dispose",k);const d=t.textures,h=!0===t.isWebGLCubeRenderTarget,p=d.length>1,m=y(t)||a;if(p||(void 0===u.__webglTexture&&(u.__webglTexture=e.createTexture()),u.__version=l.version,o.memory.textures++),h){c.__webglFramebuffer=[];for(let t=0;t<6;t++)if(a&&l.mipmaps&&l.mipmaps.length>0){c.__webglFramebuffer[t]=[];for(let r=0;r<l.mipmaps.length;r++)c.__webglFramebuffer[t][r]=e.createFramebuffer()}else c.__webglFramebuffer[t]=e.createFramebuffer()}else{if(a&&l.mipmaps&&l.mipmaps.length>0){c.__webglFramebuffer=[];for(let t=0;t<l.mipmaps.length;t++)c.__webglFramebuffer[t]=e.createFramebuffer()}else c.__webglFramebuffer=e.createFramebuffer();if(p)if(i.drawBuffers)for(let t=0,r=d.length;t<r;t++){const r=n.get(d[t]);void 0===r.__webglTexture&&(r.__webglTexture=e.createTexture(),o.memory.textures++)}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");if(a&&t.samples>0&&!1===oe(t)){c.__webglMultisampledFramebuffer=e.createFramebuffer(),c.__webglColorRenderbuffer=[],r.bindFramebuffer(e.FRAMEBUFFER,c.__webglMultisampledFramebuffer);for(let r=0;r<d.length;r++){const n=d[r];c.__webglColorRenderbuffer[r]=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,c.__webglColorRenderbuffer[r]);const i=s.convert(n.format,n.colorSpace),o=s.convert(n.type),a=_(n.internalFormat,i,o,n.colorSpace,!0===t.isXRRenderTarget),l=se(t);e.renderbufferStorageMultisample(e.RENDERBUFFER,l,a,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+r,e.RENDERBUFFER,c.__webglColorRenderbuffer[r])}e.bindRenderbuffer(e.RENDERBUFFER,null),t.depthBuffer&&(c.__webglDepthRenderbuffer=e.createRenderbuffer(),ne(c.__webglDepthRenderbuffer,t,!0)),r.bindFramebuffer(e.FRAMEBUFFER,null)}}if(h){r.bindTexture(e.TEXTURE_CUBE_MAP,u.__webglTexture),Y(e.TEXTURE_CUBE_MAP,l,m);for(let r=0;r<6;r++)if(a&&l.mipmaps&&l.mipmaps.length>0)for(let n=0;n<l.mipmaps.length;n++)re(c.__webglFramebuffer[r][n],t,l,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+r,n);else re(c.__webglFramebuffer[r],t,l,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+r,0);b(l,m)&&v(e.TEXTURE_CUBE_MAP),r.unbindTexture()}else if(p){for(let i=0,s=d.length;i<s;i++){const s=d[i],o=n.get(s);r.bindTexture(e.TEXTURE_2D,o.__webglTexture),Y(e.TEXTURE_2D,s,m),re(c.__webglFramebuffer,t,s,e.COLOR_ATTACHMENT0+i,e.TEXTURE_2D,0),b(s,m)&&v(e.TEXTURE_2D)}r.unbindTexture()}else{let n=e.TEXTURE_2D;if((t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(a?n=t.isWebGL3DRenderTarget?e.TEXTURE_3D:e.TEXTURE_2D_ARRAY:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),r.bindTexture(n,u.__webglTexture),Y(n,l,m),a&&l.mipmaps&&l.mipmaps.length>0)for(let r=0;r<l.mipmaps.length;r++)re(c.__webglFramebuffer[r],t,l,e.COLOR_ATTACHMENT0,n,r);else re(c.__webglFramebuffer,t,l,e.COLOR_ATTACHMENT0,n,0);b(l,m)&&v(n),r.unbindTexture()}t.depthBuffer&&ie(t)},this.updateRenderTargetMipmap=function(t){const i=y(t)||a,s=t.textures;for(let o=0,a=s.length;o<a;o++){const a=s[o];if(b(a,i)){const i=t.isWebGLCubeRenderTarget?e.TEXTURE_CUBE_MAP:e.TEXTURE_2D,s=n.get(a).__webglTexture;r.bindTexture(i,s),v(i),r.unbindTexture()}}},this.updateMultisampleRenderTarget=function(t){if(a&&t.samples>0&&!1===oe(t)){const i=t.textures,s=t.width,o=t.height;let a=e.COLOR_BUFFER_BIT;const l=[],u=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,d=n.get(t),h=i.length>1;if(h)for(let t=0;t<i.length;t++)r.bindFramebuffer(e.FRAMEBUFFER,d.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,null),r.bindFramebuffer(e.FRAMEBUFFER,d.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,null,0);r.bindFramebuffer(e.READ_FRAMEBUFFER,d.__webglMultisampledFramebuffer),r.bindFramebuffer(e.DRAW_FRAMEBUFFER,d.__webglFramebuffer);for(let r=0;r<i.length;r++){l.push(e.COLOR_ATTACHMENT0+r),t.depthBuffer&&l.push(u);const p=void 0!==d.__ignoreDepthValues&&d.__ignoreDepthValues;if(!1===p&&(t.depthBuffer&&(a|=e.DEPTH_BUFFER_BIT),t.stencilBuffer&&(a|=e.STENCIL_BUFFER_BIT)),h&&e.framebufferRenderbuffer(e.READ_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,d.__webglColorRenderbuffer[r]),!0===p&&(e.invalidateFramebuffer(e.READ_FRAMEBUFFER,[u]),e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,[u])),h){const t=n.get(i[r]).__webglTexture;e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0)}e.blitFramebuffer(0,0,s,o,0,0,s,o,a,e.NEAREST),c&&e.invalidateFramebuffer(e.READ_FRAMEBUFFER,l)}if(r.bindFramebuffer(e.READ_FRAMEBUFFER,null),r.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),h)for(let t=0;t<i.length;t++){r.bindFramebuffer(e.FRAMEBUFFER,d.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,d.__webglColorRenderbuffer[t]);const s=n.get(i[t]).__webglTexture;r.bindFramebuffer(e.FRAMEBUFFER,d.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,s,0)}r.bindFramebuffer(e.DRAW_FRAMEBUFFER,d.__webglMultisampledFramebuffer)}},this.setupDepthRenderbuffer=ie,this.setupFrameBufferTexture=re,this.useMultisampledRTT=oe}function WebGLUtils(e,t,r){const n=r.isWebGL2;return{convert:function(r,i=Tr){let s;const o=Zn.getTransfer(i);if(r===dt)return e.UNSIGNED_BYTE;if(r===vt)return e.UNSIGNED_SHORT_4_4_4_4;if(r===_t)return e.UNSIGNED_SHORT_5_5_5_1;if(r===ht)return e.BYTE;if(r===pt)return e.SHORT;if(r===mt)return e.UNSIGNED_SHORT;if(r===ft)return e.INT;if(r===gt)return e.UNSIGNED_INT;if(r===yt)return e.FLOAT;if(r===bt)return n?e.HALF_FLOAT:(s=t.get("OES_texture_half_float"),null!==s?s.HALF_FLOAT_OES:null);if(r===wt)return e.ALPHA;if(r===St)return e.RGBA;if(r===Pt)return e.LUMINANCE;if(r===Et)return e.LUMINANCE_ALPHA;if(r===Mt)return e.DEPTH_COMPONENT;if(r===Ct)return e.DEPTH_STENCIL;if(r===_n)return s=t.get("EXT_sRGB"),null!==s?s.SRGB_ALPHA_EXT:null;if(r===At)return e.RED;if(r===Tt)return e.RED_INTEGER;if(r===Dt)return e.RG;if(r===Ot)return e.RG_INTEGER;if(r===Rt)return e.RGBA_INTEGER;if(r===Lt||r===kt||r===Nt||r===Ft)if(o===Nr){if(s=t.get("WEBGL_compressed_texture_s3tc_srgb"),null===s)return null;if(r===Lt)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(r===kt)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(r===Nt)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(r===Ft)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(s=t.get("WEBGL_compressed_texture_s3tc"),null===s)return null;if(r===Lt)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===kt)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===Nt)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===Ft)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(r===It||r===Bt||r===jt||r===Ht){if(s=t.get("WEBGL_compressed_texture_pvrtc"),null===s)return null;if(r===It)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===Bt)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===jt)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===Ht)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(r===Ut)return s=t.get("WEBGL_compressed_texture_etc1"),null!==s?s.COMPRESSED_RGB_ETC1_WEBGL:null;if(r===zt||r===Gt){if(s=t.get("WEBGL_compressed_texture_etc"),null===s)return null;if(r===zt)return o===Nr?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(r===Gt)return o===Nr?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}if(r===Wt||r===Vt||r===qt||r===$t||r===Zt||r===Kt||r===Xt||r===Yt||r===Jt||r===Qt||r===er||r===tr||r===rr||r===nr){if(s=t.get("WEBGL_compressed_texture_astc"),null===s)return null;if(r===Wt)return o===Nr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(r===Vt)return o===Nr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(r===qt)return o===Nr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(r===$t)return o===Nr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(r===Zt)return o===Nr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(r===Kt)return o===Nr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(r===Xt)return o===Nr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(r===Yt)return o===Nr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(r===Jt)return o===Nr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(r===Qt)return o===Nr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(r===er)return o===Nr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(r===tr)return o===Nr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(r===rr)return o===Nr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(r===nr)return o===Nr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}if(r===ir||r===sr||r===or){if(s=t.get("EXT_texture_compression_bptc"),null===s)return null;if(r===ir)return o===Nr?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(r===sr)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(r===or)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}if(r===ar||r===lr||r===cr||r===ur){if(s=t.get("EXT_texture_compression_rgtc"),null===s)return null;if(r===ir)return s.COMPRESSED_RED_RGTC1_EXT;if(r===lr)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(r===cr)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(r===ur)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return r===xt?n?e.UNSIGNED_INT_24_8:(s=t.get("WEBGL_depth_texture"),null!==s?s.UNSIGNED_INT_24_8_WEBGL:null):void 0!==e[r]?e[r]:null}}}class ArrayCamera extends PerspectiveCamera{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class Group extends Object3D{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Ol={type:"move"};class WebXRController{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new Group,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new Group,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Vector3,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Vector3),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new Group,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Vector3,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Vector3),this._grip}dispatchEvent(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const r of e.hand.values())this._getHandJoint(t,r)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(e,t,r){let n=null,i=null,s=null;const o=this._targetRay,a=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState){if(l&&e.hand){s=!0;for(const n of e.hand.values()){const e=t.getJointPose(n,r),i=this._getHandJoint(l,n);null!==e&&(i.matrix.fromArray(e.transform.matrix),i.matrix.decompose(i.position,i.rotation,i.scale),i.matrixWorldNeedsUpdate=!0,i.jointRadius=e.radius),i.visible=null!==e}const n=l.joints["index-finger-tip"],i=l.joints["thumb-tip"],o=n.position.distanceTo(i.position),a=.02,c=.005;l.inputState.pinching&&o>a+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&o<=a-c&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==a&&e.gripSpace&&(i=t.getPose(e.gripSpace,r),null!==i&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1));null!==o&&(n=t.getPose(e.targetRaySpace,r),null===n&&null!==i&&(n=i),null!==n&&(o.matrix.fromArray(n.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,n.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(n.linearVelocity)):o.hasLinearVelocity=!1,n.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(n.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(Ol)))}return null!==o&&(o.visible=null!==n),null!==a&&(a.visible=null!==i),null!==l&&(l.visible=null!==s),this}_getHandJoint(e,t){if(void 0===e.joints[t.jointName]){const r=new Group;r.matrixAutoUpdate=!1,r.visible=!1,e.joints[t.jointName]=r,e.add(r)}return e.joints[t.jointName]}}class WebXRDepthSensing{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,r){if(null===this.texture){const n=new Texture;e.properties.get(n).__webglTexture=t.texture,t.depthNear==r.depthNear&&t.depthFar==r.depthFar||(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=n}}render(e,t){if(null!==this.texture){if(null===this.mesh){const e=t.cameras[0].viewport,r=new ShaderMaterial({extensions:{fragDepth:!0},vertexShader:"\nvoid main() {\n\n\tgl_Position = vec4( position, 1.0 );\n\n}",fragmentShader:"\nuniform sampler2DArray depthColor;\nuniform float depthWidth;\nuniform float depthHeight;\n\nvoid main() {\n\n\tvec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );\n\n\tif ( coord.x >= 1.0 ) {\n\n\t\tgl_FragDepthEXT = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;\n\n\t} else {\n\n\t\tgl_FragDepthEXT = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;\n\n\t}\n\n}",uniforms:{depthColor:{value:this.texture},depthWidth:{value:e.z},depthHeight:{value:e.w}}});this.mesh=new Mesh(new PlaneGeometry(20,20),r)}e.render(this.mesh,t)}}reset(){this.texture=null,this.mesh=null}}class WebXRManager extends EventDispatcher{constructor(e,t){super();const r=this;let n=null,i=1,s=null,o="local-floor",a=1,l=null,c=null,u=null,d=null,h=null,p=null;const m=new WebXRDepthSensing,f=t.getContextAttributes();let g=null,y=null;const b=[],v=[],_=new Vector2;let x=null;const w=new PerspectiveCamera;w.layers.enable(1),w.viewport=new Vector4;const R=new PerspectiveCamera;R.layers.enable(2),R.viewport=new Vector4;const k=[w,R],j=new ArrayCamera;j.layers.enable(1),j.layers.enable(2);let z=null,q=null;function $(e){const t=v.indexOf(e.inputSource);if(-1===t)return;const r=b[t];void 0!==r&&(r.update(e.inputSource,e.frame,l||s),r.dispatchEvent({type:e.type,data:e.inputSource}))}function Z(){n.removeEventListener("select",$),n.removeEventListener("selectstart",$),n.removeEventListener("selectend",$),n.removeEventListener("squeeze",$),n.removeEventListener("squeezestart",$),n.removeEventListener("squeezeend",$),n.removeEventListener("end",Z),n.removeEventListener("inputsourceschange",X);for(let e=0;e<b.length;e++){const t=v[e];null!==t&&(v[e]=null,b[e].disconnect(t))}z=null,q=null,m.reset(),e.setRenderTarget(g),h=null,d=null,u=null,n=null,y=null,ne.stop(),r.isPresenting=!1,e.setPixelRatio(x),e.setSize(_.width,_.height,!1),r.dispatchEvent({type:"sessionend"})}function X(e){for(let t=0;t<e.removed.length;t++){const r=e.removed[t],n=v.indexOf(r);n>=0&&(v[n]=null,b[n].disconnect(r))}for(let t=0;t<e.added.length;t++){const r=e.added[t];let n=v.indexOf(r);if(-1===n){for(let e=0;e<b.length;e++){if(e>=v.length){v.push(r),n=e;break}if(null===v[e]){v[e]=r,n=e;break}}if(-1===n)break}const i=b[n];i&&i.connect(r)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=b[e];return void 0===t&&(t=new WebXRController,b[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=b[e];return void 0===t&&(t=new WebXRController,b[e]=t),t.getGripSpace()},this.getHand=function(e){let t=b[e];return void 0===t&&(t=new WebXRController,b[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){i=e,!0===r.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){o=e,!0===r.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||s},this.setReferenceSpace=function(e){l=e},this.getBaseLayer=function(){return null!==d?d:h},this.getBinding=function(){return u},this.getFrame=function(){return p},this.getSession=function(){return n},this.setSession=async function(c){if(n=c,null!==n){if(g=e.getRenderTarget(),n.addEventListener("select",$),n.addEventListener("selectstart",$),n.addEventListener("selectend",$),n.addEventListener("squeeze",$),n.addEventListener("squeezestart",$),n.addEventListener("squeezeend",$),n.addEventListener("end",Z),n.addEventListener("inputsourceschange",X),!0!==f.xrCompatible&&await t.makeXRCompatible(),x=e.getPixelRatio(),e.getSize(_),void 0===n.renderState.layers||!1===e.capabilities.isWebGL2){const r={antialias:void 0!==n.renderState.layers||f.antialias,alpha:!0,depth:f.depth,stencil:f.stencil,framebufferScaleFactor:i};h=new XRWebGLLayer(n,t,r),n.updateRenderState({baseLayer:h}),e.setPixelRatio(1),e.setSize(h.framebufferWidth,h.framebufferHeight,!1),y=new WebGLRenderTarget(h.framebufferWidth,h.framebufferHeight,{format:St,type:dt,colorSpace:e.outputColorSpace,stencilBuffer:f.stencil})}else{let r=null,s=null,o=null;f.depth&&(o=f.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,r=f.stencil?Ct:Mt,s=f.stencil?xt:gt);const a={colorFormat:t.RGBA8,depthFormat:o,scaleFactor:i};u=new XRWebGLBinding(n,t),d=u.createProjectionLayer(a),n.updateRenderState({layers:[d]}),e.setPixelRatio(1),e.setSize(d.textureWidth,d.textureHeight,!1),y=new WebGLRenderTarget(d.textureWidth,d.textureHeight,{format:St,type:dt,depthTexture:new DepthTexture(d.textureWidth,d.textureHeight,s,void 0,void 0,void 0,void 0,void 0,void 0,r),stencilBuffer:f.stencil,colorSpace:e.outputColorSpace,samples:f.antialias?4:0});e.properties.get(y).__ignoreDepthValues=d.ignoreDepthValues}y.isXRRenderTarget=!0,this.setFoveation(a),l=null,s=await n.requestReferenceSpace(o),ne.setContext(n),ne.start(),r.isPresenting=!0,r.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==n)return n.environmentBlendMode};const Y=new Vector3,ee=new Vector3;function te(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(null===n)return;null!==m.texture&&(e.near=m.depthNear,e.far=m.depthFar),j.near=R.near=w.near=e.near,j.far=R.far=w.far=e.far,z===j.near&&q===j.far||(n.updateRenderState({depthNear:j.near,depthFar:j.far}),z=j.near,q=j.far,w.near=z,w.far=q,R.near=z,R.far=q,w.updateProjectionMatrix(),R.updateProjectionMatrix(),e.updateProjectionMatrix());const t=e.parent,r=j.cameras;te(j,t);for(let e=0;e<r.length;e++)te(r[e],t);2===r.length?function(e,t,r){Y.setFromMatrixPosition(t.matrixWorld),ee.setFromMatrixPosition(r.matrixWorld);const n=Y.distanceTo(ee),i=t.projectionMatrix.elements,s=r.projectionMatrix.elements,o=i[14]/(i[10]-1),a=i[14]/(i[10]+1),l=(i[9]+1)/i[5],c=(i[9]-1)/i[5],u=(i[8]-1)/i[0],d=(s[8]+1)/s[0],h=o*u,p=o*d,m=n/(-u+d),f=m*-u;t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(f),e.translateZ(m),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert();const g=o+m,y=a+m,b=h-f,v=p+(n-f),_=l*a/y*g,x=c*a/y*g;e.projectionMatrix.makePerspective(b,v,_,x,g,y),e.projectionMatrixInverse.copy(e.projectionMatrix).invert()}(j,w,R):j.projectionMatrix.copy(w.projectionMatrix),function(e,t,r){null===r?e.matrix.copy(t.matrixWorld):(e.matrix.copy(r.matrixWorld),e.matrix.invert(),e.matrix.multiply(t.matrixWorld));e.matrix.decompose(e.position,e.quaternion,e.scale),e.updateMatrixWorld(!0),e.projectionMatrix.copy(t.projectionMatrix),e.projectionMatrixInverse.copy(t.projectionMatrixInverse),e.isPerspectiveCamera&&(e.fov=2*Mn*Math.atan(1/e.projectionMatrix.elements[5]),e.zoom=1)}(e,j,t)},this.getCamera=function(){return j},this.getFoveation=function(){if(null!==d||null!==h)return a},this.setFoveation=function(e){a=e,null!==d&&(d.fixedFoveation=e),null!==h&&void 0!==h.fixedFoveation&&(h.fixedFoveation=e)},this.hasDepthSensing=function(){return null!==m.texture};let re=null;const ne=new WebGLAnimation;ne.setAnimationLoop((function(t,i){if(c=i.getViewerPose(l||s),p=i,null!==c){const t=c.views;null!==h&&(e.setRenderTargetFramebuffer(y,h.framebuffer),e.setRenderTarget(y));let r=!1;t.length!==j.cameras.length&&(j.cameras.length=0,r=!0);for(let n=0;n<t.length;n++){const i=t[n];let s=null;if(null!==h)s=h.getViewport(i);else{const t=u.getViewSubImage(d,i);s=t.viewport,0===n&&(e.setRenderTargetTextures(y,t.colorTexture,d.ignoreDepthValues?void 0:t.depthStencilTexture),e.setRenderTarget(y))}let o=k[n];void 0===o&&(o=new PerspectiveCamera,o.layers.enable(n),o.viewport=new Vector4,k[n]=o),o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.quaternion,o.scale),o.projectionMatrix.fromArray(i.projectionMatrix),o.projectionMatrixInverse.copy(o.projectionMatrix).invert(),o.viewport.set(s.x,s.y,s.width,s.height),0===n&&(j.matrix.copy(o.matrix),j.matrix.decompose(j.position,j.quaternion,j.scale)),!0===r&&j.cameras.push(o)}const i=n.enabledFeatures;if(i&&i.includes("depth-sensing")){const r=u.getDepthInformation(t[0]);r&&r.isValid&&r.texture&&m.init(e,r,n.renderState)}}for(let e=0;e<b.length;e++){const t=v[e],r=b[e];null!==t&&void 0!==r&&r.update(t,i,l||s)}m.render(e,j),re&&re(t,i),i.detectedPlanes&&r.dispatchEvent({type:"planesdetected",data:i}),p=null})),this.setAnimationLoop=function(e){re=e},this.dispose=function(){}}}const Rl=new Euler,Ll=new Matrix4;function WebGLMaterials(e,t){function r(e,t){!0===e.matrixAutoUpdate&&e.updateMatrix(),t.value.copy(e.matrix)}function n(n,i){n.opacity.value=i.opacity,i.color&&n.diffuse.value.copy(i.color),i.emissive&&n.emissive.value.copy(i.emissive).multiplyScalar(i.emissiveIntensity),i.map&&(n.map.value=i.map,r(i.map,n.mapTransform)),i.alphaMap&&(n.alphaMap.value=i.alphaMap,r(i.alphaMap,n.alphaMapTransform)),i.bumpMap&&(n.bumpMap.value=i.bumpMap,r(i.bumpMap,n.bumpMapTransform),n.bumpScale.value=i.bumpScale,i.side===f&&(n.bumpScale.value*=-1)),i.normalMap&&(n.normalMap.value=i.normalMap,r(i.normalMap,n.normalMapTransform),n.normalScale.value.copy(i.normalScale),i.side===f&&n.normalScale.value.negate()),i.displacementMap&&(n.displacementMap.value=i.displacementMap,r(i.displacementMap,n.displacementMapTransform),n.displacementScale.value=i.displacementScale,n.displacementBias.value=i.displacementBias),i.emissiveMap&&(n.emissiveMap.value=i.emissiveMap,r(i.emissiveMap,n.emissiveMapTransform)),i.specularMap&&(n.specularMap.value=i.specularMap,r(i.specularMap,n.specularMapTransform)),i.alphaTest>0&&(n.alphaTest.value=i.alphaTest);const s=t.get(i),o=s.envMap,a=s.envMapRotation;if(o&&(n.envMap.value=o,Rl.copy(a),Rl.x*=-1,Rl.y*=-1,Rl.z*=-1,o.isCubeTexture&&!1===o.isRenderTargetTexture&&(Rl.y*=-1,Rl.z*=-1),n.envMapRotation.value.setFromMatrix4(Ll.makeRotationFromEuler(Rl)),n.flipEnvMap.value=o.isCubeTexture&&!1===o.isRenderTargetTexture?-1:1,n.reflectivity.value=i.reflectivity,n.ior.value=i.ior,n.refractionRatio.value=i.refractionRatio),i.lightMap){n.lightMap.value=i.lightMap;const t=!0===e._useLegacyLights?Math.PI:1;n.lightMapIntensity.value=i.lightMapIntensity*t,r(i.lightMap,n.lightMapTransform)}i.aoMap&&(n.aoMap.value=i.aoMap,n.aoMapIntensity.value=i.aoMapIntensity,r(i.aoMap,n.aoMapTransform))}return{refreshFogUniforms:function(t,r){r.color.getRGB(t.fogColor.value,oo(e)),r.isFog?(t.fogNear.value=r.near,t.fogFar.value=r.far):r.isFogExp2&&(t.fogDensity.value=r.density)},refreshMaterialUniforms:function(e,i,s,o,a){i.isMeshBasicMaterial||i.isMeshLambertMaterial?n(e,i):i.isMeshToonMaterial?(n(e,i),function(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap)}(e,i)):i.isMeshPhongMaterial?(n(e,i),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4)}(e,i)):i.isMeshStandardMaterial?(n(e,i),function(e,n){e.metalness.value=n.metalness,n.metalnessMap&&(e.metalnessMap.value=n.metalnessMap,r(n.metalnessMap,e.metalnessMapTransform));e.roughness.value=n.roughness,n.roughnessMap&&(e.roughnessMap.value=n.roughnessMap,r(n.roughnessMap,e.roughnessMapTransform));const i=t.get(n).envMap;i&&(e.envMapIntensity.value=n.envMapIntensity)}(e,i),i.isMeshPhysicalMaterial&&function(e,t,n){e.ior.value=t.ior,t.sheen>0&&(e.sheenColor.value.copy(t.sheenColor).multiplyScalar(t.sheen),e.sheenRoughness.value=t.sheenRoughness,t.sheenColorMap&&(e.sheenColorMap.value=t.sheenColorMap,r(t.sheenColorMap,e.sheenColorMapTransform)),t.sheenRoughnessMap&&(e.sheenRoughnessMap.value=t.sheenRoughnessMap,r(t.sheenRoughnessMap,e.sheenRoughnessMapTransform)));t.clearcoat>0&&(e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap,r(t.clearcoatMap,e.clearcoatMapTransform)),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap,r(t.clearcoatRoughnessMap,e.clearcoatRoughnessMapTransform)),t.clearcoatNormalMap&&(e.clearcoatNormalMap.value=t.clearcoatNormalMap,r(t.clearcoatNormalMap,e.clearcoatNormalMapTransform),e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),t.side===f&&e.clearcoatNormalScale.value.negate()));t.iridescence>0&&(e.iridescence.value=t.iridescence,e.iridescenceIOR.value=t.iridescenceIOR,e.iridescenceThicknessMinimum.value=t.iridescenceThicknessRange[0],e.iridescenceThicknessMaximum.value=t.iridescenceThicknessRange[1],t.iridescenceMap&&(e.iridescenceMap.value=t.iridescenceMap,r(t.iridescenceMap,e.iridescenceMapTransform)),t.iridescenceThicknessMap&&(e.iridescenceThicknessMap.value=t.iridescenceThicknessMap,r(t.iridescenceThicknessMap,e.iridescenceThicknessMapTransform)));t.transmission>0&&(e.transmission.value=t.transmission,e.transmissionSamplerMap.value=n.texture,e.transmissionSamplerSize.value.set(n.width,n.height),t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap,r(t.transmissionMap,e.transmissionMapTransform)),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap,r(t.thicknessMap,e.thicknessMapTransform)),e.attenuationDistance.value=t.attenuationDistance,e.attenuationColor.value.copy(t.attenuationColor));t.anisotropy>0&&(e.anisotropyVector.value.set(t.anisotropy*Math.cos(t.anisotropyRotation),t.anisotropy*Math.sin(t.anisotropyRotation)),t.anisotropyMap&&(e.anisotropyMap.value=t.anisotropyMap,r(t.anisotropyMap,e.anisotropyMapTransform)));e.specularIntensity.value=t.specularIntensity,e.specularColor.value.copy(t.specularColor),t.specularColorMap&&(e.specularColorMap.value=t.specularColorMap,r(t.specularColorMap,e.specularColorMapTransform));t.specularIntensityMap&&(e.specularIntensityMap.value=t.specularIntensityMap,r(t.specularIntensityMap,e.specularIntensityMapTransform))}(e,i,a)):i.isMeshMatcapMaterial?(n(e,i),function(e,t){t.matcap&&(e.matcap.value=t.matcap)}(e,i)):i.isMeshDepthMaterial?n(e,i):i.isMeshDistanceMaterial?(n(e,i),function(e,r){const n=t.get(r).light;e.referencePosition.value.setFromMatrixPosition(n.matrixWorld),e.nearDistance.value=n.shadow.camera.near,e.farDistance.value=n.shadow.camera.far}(e,i)):i.isMeshNormalMaterial?n(e,i):i.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,t.map&&(e.map.value=t.map,r(t.map,e.mapTransform))}(e,i),i.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(e,i)):i.isPointsMaterial?function(e,t,n,i){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*n,e.scale.value=.5*i,t.map&&(e.map.value=t.map,r(t.map,e.uvTransform));t.alphaMap&&(e.alphaMap.value=t.alphaMap,r(t.alphaMap,e.alphaMapTransform));t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}(e,i,s,o):i.isSpriteMaterial?function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map,r(t.map,e.mapTransform));t.alphaMap&&(e.alphaMap.value=t.alphaMap,r(t.alphaMap,e.alphaMapTransform));t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}(e,i):i.isShadowMaterial?(e.color.value.copy(i.color),e.opacity.value=i.opacity):i.isShaderMaterial&&(i.uniformsNeedUpdate=!1)}}}function WebGLUniformsGroups(e,t,r,n){let i={},s={},o=[];const a=r.isWebGL2?e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(e,t,r,n){const i=e.value,s=t+"_"+r;if(void 0===n[s])return n[s]="number"==typeof i||"boolean"==typeof i?i:i.clone(),!0;{const e=n[s];if("number"==typeof i||"boolean"==typeof i){if(e!==i)return n[s]=i,!0}else if(!1===e.equals(i))return e.copy(i),!0}return!1}function c(e){const t={boundary:0,storage:0};return"number"==typeof e||"boolean"==typeof e?(t.boundary=4,t.storage=4):e.isVector2?(t.boundary=8,t.storage=8):e.isVector3||e.isColor?(t.boundary=16,t.storage=12):e.isVector4?(t.boundary=16,t.storage=16):e.isMatrix3?(t.boundary=48,t.storage=48):e.isMatrix4?(t.boundary=64,t.storage=64):e.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",e),t}function u(t){const r=t.target;r.removeEventListener("dispose",u);const n=o.indexOf(r.__bindingPointIndex);o.splice(n,1),e.deleteBuffer(i[r.id]),delete i[r.id],delete s[r.id]}return{bind:function(e,t){const r=t.program;n.uniformBlockBinding(e,r)},update:function(r,d){let h=i[r.id];void 0===h&&(!function(e){const t=e.uniforms;let r=0;const n=16;for(let e=0,i=t.length;e<i;e++){const i=Array.isArray(t[e])?t[e]:[t[e]];for(let e=0,t=i.length;e<t;e++){const t=i[e],s=Array.isArray(t.value)?t.value:[t.value];for(let e=0,i=s.length;e<i;e++){const i=c(s[e]),o=r%n;0!==o&&n-o<i.boundary&&(r+=n-o),t.__data=new Float32Array(i.storage/Float32Array.BYTES_PER_ELEMENT),t.__offset=r,r+=i.storage}}}const i=r%n;i>0&&(r+=n-i);e.__size=r,e.__cache={}}(r),h=function(t){const r=function(){for(let e=0;e<a;e++)if(-1===o.indexOf(e))return o.push(e),e;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}();t.__bindingPointIndex=r;const n=e.createBuffer(),i=t.__size,s=t.usage;return e.bindBuffer(e.UNIFORM_BUFFER,n),e.bufferData(e.UNIFORM_BUFFER,i,s),e.bindBuffer(e.UNIFORM_BUFFER,null),e.bindBufferBase(e.UNIFORM_BUFFER,r,n),n}(r),i[r.id]=h,r.addEventListener("dispose",u));const p=d.program;n.updateUBOMapping(r,p);const m=t.render.frame;s[r.id]!==m&&(!function(t){const r=i[t.id],n=t.uniforms,s=t.__cache;e.bindBuffer(e.UNIFORM_BUFFER,r);for(let t=0,r=n.length;t<r;t++){const r=Array.isArray(n[t])?n[t]:[n[t]];for(let n=0,i=r.length;n<i;n++){const i=r[n];if(!0===l(i,t,n,s)){const t=i.__offset,r=Array.isArray(i.value)?i.value:[i.value];let n=0;for(let s=0;s<r.length;s++){const o=r[s],a=c(o);"number"==typeof o||"boolean"==typeof o?(i.__data[0]=o,e.bufferSubData(e.UNIFORM_BUFFER,t+n,i.__data)):o.isMatrix3?(i.__data[0]=o.elements[0],i.__data[1]=o.elements[1],i.__data[2]=o.elements[2],i.__data[3]=0,i.__data[4]=o.elements[3],i.__data[5]=o.elements[4],i.__data[6]=o.elements[5],i.__data[7]=0,i.__data[8]=o.elements[6],i.__data[9]=o.elements[7],i.__data[10]=o.elements[8],i.__data[11]=0):(o.toArray(i.__data,n),n+=a.storage/Float32Array.BYTES_PER_ELEMENT)}e.bufferSubData(e.UNIFORM_BUFFER,t,i.__data)}}}e.bindBuffer(e.UNIFORM_BUFFER,null)}(r),s[r.id]=m)},dispose:function(){for(const t in i)e.deleteBuffer(i[t]);o=[],i={},s={}}}}class WebGLRenderer{constructor(e={}){const{canvas:t=Un(),context:r=null,depth:i=!0,stencil:s=!0,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:d=!1}=e;let h;this.isWebGLRenderer=!0,h=null!==r?r.getContextAttributes().alpha:o;const p=new Uint32Array(4),y=new Int32Array(4);let b=null,v=null;const _=[],x=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Dr,this._useLegacyLights=!1,this.toneMapping=we,this.toneMappingExposure=1;const w=this;let R=!1,k=0,j=0,z=null,q=-1,$=null;const Z=new Vector4,X=new Vector4;let Y=null;const ee=new Color(0);let te=0,re=t.width,ne=t.height,ie=1,se=null,oe=null;const ae=new Vector4(0,0,re,ne),le=new Vector4(0,0,re,ne);let ce=!1;const ue=new Frustum;let de=!1,he=!1,pe=null;const me=new Matrix4,fe=new Vector2,ge=new Vector3,ye={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function be(){return null===z?ie:1}let ve,_e,xe,Se,Pe,Te,Re,ke,Ie,je,He,ze,Ge,We,Ve,qe,$e,Xe,Ye,Qe,et,tt,rt,nt,it=r;function st(e,r){for(let n=0;n<e.length;n++){const i=e[n],s=t.getContext(i,r);if(null!==s)return s}return null}try{const e={alpha:!0,depth:i,stencil:s,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:d};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${n}`),t.addEventListener("webglcontextlost",lt,!1),t.addEventListener("webglcontextrestored",ut,!1),t.addEventListener("webglcontextcreationerror",ht,!1),null===it){const t=["webgl2","webgl","experimental-webgl"];if(!0===w.isWebGL1Renderer&&t.shift(),it=st(t,e),null===it)throw st(t)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}"undefined"!=typeof WebGLRenderingContext&&it instanceof WebGLRenderingContext&&console.warn("THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163."),void 0===it.getShaderPrecisionFormat&&(it.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(e){throw console.error("THREE.WebGLRenderer: "+e.message),e}function ot(){ve=new WebGLExtensions(it),_e=new WebGLCapabilities(it,ve,e),ve.init(_e),tt=new WebGLUtils(it,ve,_e),xe=new WebGLState(it,ve,_e),Se=new WebGLInfo(it),Pe=new WebGLProperties,Te=new WebGLTextures(it,ve,xe,Pe,_e,tt,Se),Re=new WebGLCubeMaps(w),ke=new WebGLCubeUVMaps(w),Ie=new WebGLAttributes(it,_e),rt=new WebGLBindingStates(it,ve,Ie,_e),je=new WebGLGeometries(it,Ie,Se,rt),He=new WebGLObjects(it,je,Ie,Se),Ye=new WebGLMorphtargets(it,_e,Te),qe=new WebGLClipping(Pe),ze=new WebGLPrograms(w,Re,ke,ve,_e,rt,qe),Ge=new WebGLMaterials(w,Pe),We=new WebGLRenderLists,Ve=new WebGLRenderStates(ve,_e),Xe=new WebGLBackground(w,Re,ke,xe,He,h,l),$e=new WebGLShadowMap(w,He,_e),nt=new WebGLUniformsGroups(it,Se,_e,xe),Qe=new WebGLBufferRenderer(it,ve,Se,_e),et=new WebGLIndexedBufferRenderer(it,ve,Se,_e),Se.programs=ze.programs,w.capabilities=_e,w.extensions=ve,w.properties=Pe,w.renderLists=We,w.shadowMap=$e,w.state=xe,w.info=Se}ot();const at=new WebXRManager(w,it);function lt(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),R=!0}function ut(){console.log("THREE.WebGLRenderer: Context Restored."),R=!1;const e=Se.autoReset,t=$e.enabled,r=$e.autoUpdate,n=$e.needsUpdate,i=$e.type;ot(),Se.autoReset=e,$e.enabled=t,$e.autoUpdate=r,$e.needsUpdate=n,$e.type=i}function ht(e){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",e.statusMessage)}function pt(e){const t=e.target;t.removeEventListener("dispose",pt),function(e){(function(e){const t=Pe.get(e).programs;void 0!==t&&(t.forEach((function(e){ze.releaseProgram(e)})),e.isShaderMaterial&&ze.releaseShaderCache(e))})(e),Pe.remove(e)}(t)}function ft(e,t,r){!0===e.transparent&&e.side===g&&!1===e.forceSinglePass?(e.side=f,e.needsUpdate=!0,kt(e,t,r),e.side=m,e.needsUpdate=!0,kt(e,t,r),e.side=g):kt(e,t,r)}this.xr=at,this.getContext=function(){return it},this.getContextAttributes=function(){return it.getContextAttributes()},this.forceContextLoss=function(){const e=ve.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){const e=ve.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return ie},this.setPixelRatio=function(e){void 0!==e&&(ie=e,this.setSize(re,ne,!1))},this.getSize=function(e){return e.set(re,ne)},this.setSize=function(e,r,n=!0){at.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(re=e,ne=r,t.width=Math.floor(e*ie),t.height=Math.floor(r*ie),!0===n&&(t.style.width=e+"px",t.style.height=r+"px"),this.setViewport(0,0,e,r))},this.getDrawingBufferSize=function(e){return e.set(re*ie,ne*ie).floor()},this.setDrawingBufferSize=function(e,r,n){re=e,ne=r,ie=n,t.width=Math.floor(e*n),t.height=Math.floor(r*n),this.setViewport(0,0,e,r)},this.getCurrentViewport=function(e){return e.copy(Z)},this.getViewport=function(e){return e.copy(ae)},this.setViewport=function(e,t,r,n){e.isVector4?ae.set(e.x,e.y,e.z,e.w):ae.set(e,t,r,n),xe.viewport(Z.copy(ae).multiplyScalar(ie).round())},this.getScissor=function(e){return e.copy(le)},this.setScissor=function(e,t,r,n){e.isVector4?le.set(e.x,e.y,e.z,e.w):le.set(e,t,r,n),xe.scissor(X.copy(le).multiplyScalar(ie).round())},this.getScissorTest=function(){return ce},this.setScissorTest=function(e){xe.setScissorTest(ce=e)},this.setOpaqueSort=function(e){se=e},this.setTransparentSort=function(e){oe=e},this.getClearColor=function(e){return e.copy(Xe.getClearColor())},this.setClearColor=function(){Xe.setClearColor.apply(Xe,arguments)},this.getClearAlpha=function(){return Xe.getClearAlpha()},this.setClearAlpha=function(){Xe.setClearAlpha.apply(Xe,arguments)},this.clear=function(e=!0,t=!0,r=!0){let n=0;if(e){let e=!1;if(null!==z){const t=z.texture.format;e=t===Rt||t===Ot||t===Tt}if(e){const e=z.texture.type,t=e===dt||e===gt||e===mt||e===xt||e===vt||e===_t,r=Xe.getClearColor(),n=Xe.getClearAlpha(),i=r.r,s=r.g,o=r.b;t?(p[0]=i,p[1]=s,p[2]=o,p[3]=n,it.clearBufferuiv(it.COLOR,0,p)):(y[0]=i,y[1]=s,y[2]=o,y[3]=n,it.clearBufferiv(it.COLOR,0,y))}else n|=it.COLOR_BUFFER_BIT}t&&(n|=it.DEPTH_BUFFER_BIT),r&&(n|=it.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),it.clear(n)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",lt,!1),t.removeEventListener("webglcontextrestored",ut,!1),t.removeEventListener("webglcontextcreationerror",ht,!1),We.dispose(),Ve.dispose(),Pe.dispose(),Re.dispose(),ke.dispose(),He.dispose(),rt.dispose(),nt.dispose(),ze.dispose(),at.dispose(),at.removeEventListener("sessionstart",Pt),at.removeEventListener("sessionend",Et),pe&&(pe.dispose(),pe=null),Mt.stop()},this.renderBufferDirect=function(e,t,r,n,i,s){null===t&&(t=ye);const o=i.isMesh&&i.matrixWorld.determinant()<0,a=function(e,t,r,n,i){!0!==t.isScene&&(t=ye);Te.resetTextureUnits();const s=t.fog,o=n.isMeshStandardMaterial?t.environment:null,a=null===z?w.outputColorSpace:!0===z.isXRRenderTarget?z.texture.colorSpace:Or,l=(n.isMeshStandardMaterial?ke:Re).get(n.envMap||o),c=!0===n.vertexColors&&!!r.attributes.color&&4===r.attributes.color.itemSize,u=!!r.attributes.tangent&&(!!n.normalMap||n.anisotropy>0),d=!!r.morphAttributes.position,h=!!r.morphAttributes.normal,p=!!r.morphAttributes.color;let m=we;n.toneMapped&&(null!==z&&!0!==z.isXRRenderTarget||(m=w.toneMapping));const f=r.morphAttributes.position||r.morphAttributes.normal||r.morphAttributes.color,g=void 0!==f?f.length:0,y=Pe.get(n),b=v.state.lights;if(!0===de&&(!0===he||e!==$)){const t=e===$&&n.id===q;qe.setState(n,e,t)}let _=!1;n.version===y.__version?y.needsLights&&y.lightsStateVersion!==b.state.version||y.outputColorSpace!==a||i.isBatchedMesh&&!1===y.batching?_=!0:i.isBatchedMesh||!0!==y.batching?i.isInstancedMesh&&!1===y.instancing?_=!0:i.isInstancedMesh||!0!==y.instancing?i.isSkinnedMesh&&!1===y.skinning?_=!0:i.isSkinnedMesh||!0!==y.skinning?i.isInstancedMesh&&!0===y.instancingColor&&null===i.instanceColor||i.isInstancedMesh&&!1===y.instancingColor&&null!==i.instanceColor||i.isInstancedMesh&&!0===y.instancingMorph&&null===i.morphTexture||i.isInstancedMesh&&!1===y.instancingMorph&&null!==i.morphTexture||y.envMap!==l||!0===n.fog&&y.fog!==s?_=!0:void 0===y.numClippingPlanes||y.numClippingPlanes===qe.numPlanes&&y.numIntersection===qe.numIntersection?(y.vertexAlphas!==c||y.vertexTangents!==u||y.morphTargets!==d||y.morphNormals!==h||y.morphColors!==p||y.toneMapping!==m||!0===_e.isWebGL2&&y.morphTargetsCount!==g)&&(_=!0):_=!0:_=!0:_=!0:_=!0:(_=!0,y.__version=n.version);let x=y.currentProgram;!0===_&&(x=kt(n,t,i));let R=!1,k=!1,j=!1;const Z=x.getUniforms(),X=y.uniforms;xe.useProgram(x.program)&&(R=!0,k=!0,j=!0);n.id!==q&&(q=n.id,k=!0);if(R||$!==e){Z.setValue(it,"projectionMatrix",e.projectionMatrix),Z.setValue(it,"viewMatrix",e.matrixWorldInverse);const t=Z.map.cameraPosition;void 0!==t&&t.setValue(it,ge.setFromMatrixPosition(e.matrixWorld)),_e.logarithmicDepthBuffer&&Z.setValue(it,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&Z.setValue(it,"isOrthographic",!0===e.isOrthographicCamera),$!==e&&($=e,k=!0,j=!0)}if(i.isSkinnedMesh){Z.setOptional(it,i,"bindMatrix"),Z.setOptional(it,i,"bindMatrixInverse");const e=i.skeleton;e&&(_e.floatVertexTextures?(null===e.boneTexture&&e.computeBoneTexture(),Z.setValue(it,"boneTexture",e.boneTexture,Te)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}i.isBatchedMesh&&(Z.setOptional(it,i,"batchingTexture"),Z.setValue(it,"batchingTexture",i._matricesTexture,Te));const Y=r.morphAttributes;(void 0!==Y.position||void 0!==Y.normal||void 0!==Y.color&&!0===_e.isWebGL2)&&Ye.update(i,r,x);(k||y.receiveShadow!==i.receiveShadow)&&(y.receiveShadow=i.receiveShadow,Z.setValue(it,"receiveShadow",i.receiveShadow));n.isMeshGouraudMaterial&&null!==n.envMap&&(X.envMap.value=l,X.flipEnvMap.value=l.isCubeTexture&&!1===l.isRenderTargetTexture?-1:1);k&&(Z.setValue(it,"toneMappingExposure",w.toneMappingExposure),y.needsLights&&(te=j,(ee=X).ambientLightColor.needsUpdate=te,ee.lightProbe.needsUpdate=te,ee.directionalLights.needsUpdate=te,ee.directionalLightShadows.needsUpdate=te,ee.pointLights.needsUpdate=te,ee.pointLightShadows.needsUpdate=te,ee.spotLights.needsUpdate=te,ee.spotLightShadows.needsUpdate=te,ee.rectAreaLights.needsUpdate=te,ee.hemisphereLights.needsUpdate=te),s&&!0===n.fog&&Ge.refreshFogUniforms(X,s),Ge.refreshMaterialUniforms(X,n,ie,ne,pe),WebGLUniforms.upload(it,Nt(y),X,Te));var ee,te;n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(WebGLUniforms.upload(it,Nt(y),X,Te),n.uniformsNeedUpdate=!1);n.isSpriteMaterial&&Z.setValue(it,"center",i.center);if(Z.setValue(it,"modelViewMatrix",i.modelViewMatrix),Z.setValue(it,"normalMatrix",i.normalMatrix),Z.setValue(it,"modelMatrix",i.matrixWorld),n.isShaderMaterial||n.isRawShaderMaterial){const e=n.uniformsGroups;for(let t=0,r=e.length;t<r;t++)if(_e.isWebGL2){const r=e[t];nt.update(r,x),nt.bind(r,x)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return x}(e,t,r,n,i);xe.setMaterial(n,o);let l=r.index,c=1;if(!0===n.wireframe){if(l=je.getWireframeAttribute(r),void 0===l)return;c=2}const u=r.drawRange,d=r.attributes.position;let h=u.start*c,p=(u.start+u.count)*c;null!==s&&(h=Math.max(h,s.start*c),p=Math.min(p,(s.start+s.count)*c)),null!==l?(h=Math.max(h,0),p=Math.min(p,l.count)):null!=d&&(h=Math.max(h,0),p=Math.min(p,d.count));const m=p-h;if(m<0||m===1/0)return;let f;rt.setup(i,n,a,r,l);let g=Qe;if(null!==l&&(f=Ie.get(l),g=et,g.setIndex(f)),i.isMesh)!0===n.wireframe?(xe.setLineWidth(n.wireframeLinewidth*be()),g.setMode(it.LINES)):g.setMode(it.TRIANGLES);else if(i.isLine){let e=n.linewidth;void 0===e&&(e=1),xe.setLineWidth(e*be()),i.isLineSegments?g.setMode(it.LINES):i.isLineLoop?g.setMode(it.LINE_LOOP):g.setMode(it.LINE_STRIP)}else i.isPoints?g.setMode(it.POINTS):i.isSprite&&g.setMode(it.TRIANGLES);if(i.isBatchedMesh)g.renderMultiDraw(i._multiDrawStarts,i._multiDrawCounts,i._multiDrawCount);else if(i.isInstancedMesh)g.renderInstances(h,m,i.count);else if(r.isInstancedBufferGeometry){const e=void 0!==r._maxInstanceCount?r._maxInstanceCount:1/0,t=Math.min(r.instanceCount,e);g.renderInstances(h,m,t)}else g.render(h,m)},this.compile=function(e,t,r=null){null===r&&(r=e),v=Ve.get(r),v.init(),x.push(v),r.traverseVisible((function(e){e.isLight&&e.layers.test(t.layers)&&(v.pushLight(e),e.castShadow&&v.pushShadow(e))})),e!==r&&e.traverseVisible((function(e){e.isLight&&e.layers.test(t.layers)&&(v.pushLight(e),e.castShadow&&v.pushShadow(e))})),v.setupLights(w._useLegacyLights);const n=new Set;return e.traverse((function(e){const t=e.material;if(t)if(Array.isArray(t))for(let i=0;i<t.length;i++){const s=t[i];ft(s,r,e),n.add(s)}else ft(t,r,e),n.add(t)})),x.pop(),v=null,n},this.compileAsync=function(e,t,r=null){const n=this.compile(e,t,r);return new Promise((t=>{function r(){n.forEach((function(e){Pe.get(e).currentProgram.isReady()&&n.delete(e)})),0!==n.size?setTimeout(r,10):t(e)}null!==ve.get("KHR_parallel_shader_compile")?r():setTimeout(r,10)}))};let wt=null;function Pt(){Mt.stop()}function Et(){Mt.start()}const Mt=new WebGLAnimation;function Ct(e,t,r,n){if(!1===e.visible)return;if(e.layers.test(t.layers))if(e.isGroup)r=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)v.pushLight(e),e.castShadow&&v.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||ue.intersectsSprite(e)){n&&ge.setFromMatrixPosition(e.matrixWorld).applyMatrix4(me);const t=He.update(e),i=e.material;i.visible&&b.push(e,t,i,r,ge.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||ue.intersectsObject(e))){const t=He.update(e),i=e.material;if(n&&(void 0!==e.boundingSphere?(null===e.boundingSphere&&e.computeBoundingSphere(),ge.copy(e.boundingSphere.center)):(null===t.boundingSphere&&t.computeBoundingSphere(),ge.copy(t.boundingSphere.center)),ge.applyMatrix4(e.matrixWorld).applyMatrix4(me)),Array.isArray(i)){const n=t.groups;for(let s=0,o=n.length;s<o;s++){const o=n[s],a=i[o.materialIndex];a&&a.visible&&b.push(e,t,a,r,ge.z,o)}}else i.visible&&b.push(e,t,i,r,ge.z,null)}const i=e.children;for(let e=0,s=i.length;e<s;e++)Ct(i[e],t,r,n)}function At(e,t,r,n){const i=e.opaque,s=e.transmissive,o=e.transparent;v.setupLightsView(r),!0===de&&qe.setGlobalState(w.clippingPlanes,r),s.length>0&&function(e,t,r,n){const i=!0===r.isScene?r.overrideMaterial:null;if(null!==i)return;const s=_e.isWebGL2;null===pe&&(pe=new WebGLRenderTarget(1,1,{generateMipmaps:!0,type:ve.has("EXT_color_buffer_half_float")?bt:dt,minFilter:ct,samples:s?4:0}));w.getDrawingBufferSize(fe),s?pe.setSize(fe.x,fe.y):pe.setSize(Rn(fe.x),Rn(fe.y));const o=w.getRenderTarget();w.setRenderTarget(pe),w.getClearColor(ee),te=w.getClearAlpha(),te<1&&w.setClearColor(16777215,.5);w.clear();const a=w.toneMapping;w.toneMapping=we,Dt(e,r,n),Te.updateMultisampleRenderTarget(pe),Te.updateRenderTargetMipmap(pe);let l=!1;for(let e=0,i=t.length;e<i;e++){const i=t[e],s=i.object,o=i.geometry,a=i.material,c=i.group;if(a.side===g&&s.layers.test(n.layers)){const e=a.side;a.side=f,a.needsUpdate=!0,Lt(s,r,n,o,a,c),a.side=e,a.needsUpdate=!0,l=!0}}!0===l&&(Te.updateMultisampleRenderTarget(pe),Te.updateRenderTargetMipmap(pe));w.setRenderTarget(o),w.setClearColor(ee,te),w.toneMapping=a}(i,s,t,r),n&&xe.viewport(Z.copy(n)),i.length>0&&Dt(i,t,r),s.length>0&&Dt(s,t,r),o.length>0&&Dt(o,t,r),xe.buffers.depth.setTest(!0),xe.buffers.depth.setMask(!0),xe.buffers.color.setMask(!0),xe.setPolygonOffset(!1)}function Dt(e,t,r){const n=!0===t.isScene?t.overrideMaterial:null;for(let i=0,s=e.length;i<s;i++){const s=e[i],o=s.object,a=s.geometry,l=null===n?s.material:n,c=s.group;o.layers.test(r.layers)&&Lt(o,t,r,a,l,c)}}function Lt(e,t,r,n,i,s){e.onBeforeRender(w,t,r,n,i,s),e.modelViewMatrix.multiplyMatrices(r.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),i.onBeforeRender(w,t,r,n,e,s),!0===i.transparent&&i.side===g&&!1===i.forceSinglePass?(i.side=f,i.needsUpdate=!0,w.renderBufferDirect(r,t,n,i,e,s),i.side=m,i.needsUpdate=!0,w.renderBufferDirect(r,t,n,i,e,s),i.side=g):w.renderBufferDirect(r,t,n,i,e,s),e.onAfterRender(w,t,r,n,i,s)}function kt(e,t,r){!0!==t.isScene&&(t=ye);const n=Pe.get(e),i=v.state.lights,s=v.state.shadowsArray,o=i.state.version,a=ze.getParameters(e,i.state,s,t,r),l=ze.getProgramCacheKey(a);let c=n.programs;n.environment=e.isMeshStandardMaterial?t.environment:null,n.fog=t.fog,n.envMap=(e.isMeshStandardMaterial?ke:Re).get(e.envMap||n.environment),n.envMapRotation=null!==n.environment&&null===e.envMap?t.environmentRotation:e.envMapRotation,void 0===c&&(e.addEventListener("dispose",pt),c=new Map,n.programs=c);let u=c.get(l);if(void 0!==u){if(n.currentProgram===u&&n.lightsStateVersion===o)return Ft(e,a),u}else a.uniforms=ze.getUniforms(e),e.onBuild(r,a,w),e.onBeforeCompile(a,w),u=ze.acquireProgram(a,l),c.set(l,u),n.uniforms=a.uniforms;const d=n.uniforms;return(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(d.clippingPlanes=qe.uniform),Ft(e,a),n.needsLights=function(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights}(e),n.lightsStateVersion=o,n.needsLights&&(d.ambientLightColor.value=i.state.ambient,d.lightProbe.value=i.state.probe,d.directionalLights.value=i.state.directional,d.directionalLightShadows.value=i.state.directionalShadow,d.spotLights.value=i.state.spot,d.spotLightShadows.value=i.state.spotShadow,d.rectAreaLights.value=i.state.rectArea,d.ltc_1.value=i.state.rectAreaLTC1,d.ltc_2.value=i.state.rectAreaLTC2,d.pointLights.value=i.state.point,d.pointLightShadows.value=i.state.pointShadow,d.hemisphereLights.value=i.state.hemi,d.directionalShadowMap.value=i.state.directionalShadowMap,d.directionalShadowMatrix.value=i.state.directionalShadowMatrix,d.spotShadowMap.value=i.state.spotShadowMap,d.spotLightMatrix.value=i.state.spotLightMatrix,d.spotLightMap.value=i.state.spotLightMap,d.pointShadowMap.value=i.state.pointShadowMap,d.pointShadowMatrix.value=i.state.pointShadowMatrix),n.currentProgram=u,n.uniformsList=null,u}function Nt(e){if(null===e.uniformsList){const t=e.currentProgram.getUniforms();e.uniformsList=WebGLUniforms.seqWithValue(t.seq,e.uniforms)}return e.uniformsList}function Ft(e,t){const r=Pe.get(e);r.outputColorSpace=t.outputColorSpace,r.batching=t.batching,r.instancing=t.instancing,r.instancingColor=t.instancingColor,r.instancingMorph=t.instancingMorph,r.skinning=t.skinning,r.morphTargets=t.morphTargets,r.morphNormals=t.morphNormals,r.morphColors=t.morphColors,r.morphTargetsCount=t.morphTargetsCount,r.numClippingPlanes=t.numClippingPlanes,r.numIntersection=t.numClipIntersection,r.vertexAlphas=t.vertexAlphas,r.vertexTangents=t.vertexTangents,r.toneMapping=t.toneMapping}Mt.setAnimationLoop((function(e){wt&&wt(e)})),"undefined"!=typeof self&&Mt.setContext(self),this.setAnimationLoop=function(e){wt=e,at.setAnimationLoop(e),null===e?Mt.stop():Mt.start()},at.addEventListener("sessionstart",Pt),at.addEventListener("sessionend",Et),this.render=function(e,t){if(void 0!==t&&!0!==t.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===R)return;!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===t.parent&&!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),!0===at.enabled&&!0===at.isPresenting&&(!0===at.cameraAutoUpdate&&at.updateCamera(t),t=at.getCamera()),!0===e.isScene&&e.onBeforeRender(w,e,t,z),v=Ve.get(e,x.length),v.init(),x.push(v),me.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),ue.setFromProjectionMatrix(me),he=this.localClippingEnabled,de=qe.init(this.clippingPlanes,he),b=We.get(e,_.length),b.init(),_.push(b),Ct(e,t,0,w.sortObjects),b.finish(),!0===w.sortObjects&&b.sort(se,oe),this.info.render.frame++,!0===de&&qe.beginShadows();const r=v.state.shadowsArray;if($e.render(r,e,t),!0===de&&qe.endShadows(),!0===this.info.autoReset&&this.info.reset(),!1!==at.enabled&&!1!==at.isPresenting&&!1!==at.hasDepthSensing()||Xe.render(b,e),v.setupLights(w._useLegacyLights),t.isArrayCamera){const r=t.cameras;for(let t=0,n=r.length;t<n;t++){const n=r[t];At(b,e,n,n.viewport)}}else At(b,e,t);null!==z&&(Te.updateMultisampleRenderTarget(z),Te.updateRenderTargetMipmap(z)),!0===e.isScene&&e.onAfterRender(w,e,t),rt.resetDefaultState(),q=-1,$=null,x.pop(),v=x.length>0?x[x.length-1]:null,_.pop(),b=_.length>0?_[_.length-1]:null},this.getActiveCubeFace=function(){return k},this.getActiveMipmapLevel=function(){return j},this.getRenderTarget=function(){return z},this.setRenderTargetTextures=function(e,t,r){Pe.get(e.texture).__webglTexture=t,Pe.get(e.depthTexture).__webglTexture=r;const n=Pe.get(e);n.__hasExternalTextures=!0,n.__autoAllocateDepthBuffer=void 0===r,n.__autoAllocateDepthBuffer||!0===ve.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),n.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(e,t){const r=Pe.get(e);r.__webglFramebuffer=t,r.__useDefaultFramebuffer=void 0===t},this.setRenderTarget=function(e,t=0,r=0){z=e,k=t,j=r;let n=!0,i=null,s=!1,o=!1;if(e){const a=Pe.get(e);void 0!==a.__useDefaultFramebuffer?(xe.bindFramebuffer(it.FRAMEBUFFER,null),n=!1):void 0===a.__webglFramebuffer?Te.setupRenderTarget(e):a.__hasExternalTextures&&Te.rebindTextures(e,Pe.get(e.texture).__webglTexture,Pe.get(e.depthTexture).__webglTexture);const l=e.texture;(l.isData3DTexture||l.isDataArrayTexture||l.isCompressedArrayTexture)&&(o=!0);const c=Pe.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(i=Array.isArray(c[t])?c[t][r]:c[t],s=!0):i=_e.isWebGL2&&e.samples>0&&!1===Te.useMultisampledRTT(e)?Pe.get(e).__webglMultisampledFramebuffer:Array.isArray(c)?c[r]:c,Z.copy(e.viewport),X.copy(e.scissor),Y=e.scissorTest}else Z.copy(ae).multiplyScalar(ie).floor(),X.copy(le).multiplyScalar(ie).floor(),Y=ce;if(xe.bindFramebuffer(it.FRAMEBUFFER,i)&&_e.drawBuffers&&n&&xe.drawBuffers(e,i),xe.viewport(Z),xe.scissor(X),xe.setScissorTest(Y),s){const n=Pe.get(e.texture);it.framebufferTexture2D(it.FRAMEBUFFER,it.COLOR_ATTACHMENT0,it.TEXTURE_CUBE_MAP_POSITIVE_X+t,n.__webglTexture,r)}else if(o){const n=Pe.get(e.texture),i=t||0;it.framebufferTextureLayer(it.FRAMEBUFFER,it.COLOR_ATTACHMENT0,n.__webglTexture,r||0,i)}q=-1},this.readRenderTargetPixels=function(e,t,r,n,i,s,o){if(!e||!e.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let a=Pe.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==o&&(a=a[o]),a){xe.bindFramebuffer(it.FRAMEBUFFER,a);try{const o=e.texture,a=o.format,l=o.type;if(a!==St&&tt.convert(a)!==it.getParameter(it.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const c=l===bt&&(ve.has("EXT_color_buffer_half_float")||_e.isWebGL2&&ve.has("EXT_color_buffer_float"));if(!(l===dt||tt.convert(l)===it.getParameter(it.IMPLEMENTATION_COLOR_READ_TYPE)||l===yt&&(_e.isWebGL2||ve.has("OES_texture_float")||ve.has("WEBGL_color_buffer_float"))||c))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");t>=0&&t<=e.width-n&&r>=0&&r<=e.height-i&&it.readPixels(t,r,n,i,tt.convert(a),tt.convert(l),s)}finally{const e=null!==z?Pe.get(z).__webglFramebuffer:null;xe.bindFramebuffer(it.FRAMEBUFFER,e)}}},this.copyFramebufferToTexture=function(e,t,r=0){const n=Math.pow(2,-r),i=Math.floor(t.image.width*n),s=Math.floor(t.image.height*n);Te.setTexture2D(t,0),it.copyTexSubImage2D(it.TEXTURE_2D,r,0,0,e.x,e.y,i,s),xe.unbindTexture()},this.copyTextureToTexture=function(e,t,r,n=0){const i=t.image.width,s=t.image.height,o=tt.convert(r.format),a=tt.convert(r.type);Te.setTexture2D(r,0),it.pixelStorei(it.UNPACK_FLIP_Y_WEBGL,r.flipY),it.pixelStorei(it.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha),it.pixelStorei(it.UNPACK_ALIGNMENT,r.unpackAlignment),t.isDataTexture?it.texSubImage2D(it.TEXTURE_2D,n,e.x,e.y,i,s,o,a,t.image.data):t.isCompressedTexture?it.compressedTexSubImage2D(it.TEXTURE_2D,n,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,o,t.mipmaps[0].data):it.texSubImage2D(it.TEXTURE_2D,n,e.x,e.y,o,a,t.image),0===n&&r.generateMipmaps&&it.generateMipmap(it.TEXTURE_2D),xe.unbindTexture()},this.copyTextureToTexture3D=function(e,t,r,n,i=0){if(w.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const s=Math.round(e.max.x-e.min.x),o=Math.round(e.max.y-e.min.y),a=e.max.z-e.min.z+1,l=tt.convert(n.format),c=tt.convert(n.type);let u;if(n.isData3DTexture)Te.setTexture3D(n,0),u=it.TEXTURE_3D;else{if(!n.isDataArrayTexture&&!n.isCompressedArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");Te.setTexture2DArray(n,0),u=it.TEXTURE_2D_ARRAY}it.pixelStorei(it.UNPACK_FLIP_Y_WEBGL,n.flipY),it.pixelStorei(it.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha),it.pixelStorei(it.UNPACK_ALIGNMENT,n.unpackAlignment);const d=it.getParameter(it.UNPACK_ROW_LENGTH),h=it.getParameter(it.UNPACK_IMAGE_HEIGHT),p=it.getParameter(it.UNPACK_SKIP_PIXELS),m=it.getParameter(it.UNPACK_SKIP_ROWS),f=it.getParameter(it.UNPACK_SKIP_IMAGES),g=r.isCompressedTexture?r.mipmaps[i]:r.image;it.pixelStorei(it.UNPACK_ROW_LENGTH,g.width),it.pixelStorei(it.UNPACK_IMAGE_HEIGHT,g.height),it.pixelStorei(it.UNPACK_SKIP_PIXELS,e.min.x),it.pixelStorei(it.UNPACK_SKIP_ROWS,e.min.y),it.pixelStorei(it.UNPACK_SKIP_IMAGES,e.min.z),r.isDataTexture||r.isData3DTexture?it.texSubImage3D(u,i,t.x,t.y,t.z,s,o,a,l,c,g.data):n.isCompressedArrayTexture?it.compressedTexSubImage3D(u,i,t.x,t.y,t.z,s,o,a,l,g.data):it.texSubImage3D(u,i,t.x,t.y,t.z,s,o,a,l,c,g),it.pixelStorei(it.UNPACK_ROW_LENGTH,d),it.pixelStorei(it.UNPACK_IMAGE_HEIGHT,h),it.pixelStorei(it.UNPACK_SKIP_PIXELS,p),it.pixelStorei(it.UNPACK_SKIP_ROWS,m),it.pixelStorei(it.UNPACK_SKIP_IMAGES,f),0===i&&n.generateMipmaps&&it.generateMipmap(u),xe.unbindTexture()},this.initTexture=function(e){e.isCubeTexture?Te.setTextureCube(e,0):e.isData3DTexture?Te.setTexture3D(e,0):e.isDataArrayTexture||e.isCompressedArrayTexture?Te.setTexture2DArray(e,0):Te.setTexture2D(e,0),xe.unbindTexture()},this.resetState=function(){k=0,j=0,z=null,xe.reset(),rt.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return xn}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===Rr?"display-p3":"srgb",t.unpackColorSpace=Zn.workingColorSpace===Lr?"display-p3":"srgb"}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}class WebGL1Renderer extends WebGLRenderer{}WebGL1Renderer.prototype.isWebGL1Renderer=!0;class FogExp2{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new Color(e),this.density=t}clone(){return new FogExp2(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class Fog{constructor(e,t=1,r=1e3){this.isFog=!0,this.name="",this.color=new Color(e),this.near=t,this.far=r}clone(){return new Fog(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class Scene extends Object3D{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Euler,this.environmentRotation=new Euler,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentRotation.copy(e.environmentRotation),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class InterleavedBuffer{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=cn,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Cn()}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}get updateRange(){return Gn("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,r){e*=this.stride,r*=t.stride;for(let n=0,i=this.stride;n<i;n++)this.array[e+n]=t.array[r+n];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Cn()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),r=new this.constructor(t,this.stride);return r.setUsage(this.usage),r}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Cn()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const kl=new Vector3;class InterleavedBufferAttribute{constructor(e,t,r,n=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=r,this.normalized=n}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,r=this.data.count;t<r;t++)kl.fromBufferAttribute(this,t),kl.applyMatrix4(e),this.setXYZ(t,kl.x,kl.y,kl.z);return this}applyNormalMatrix(e){for(let t=0,r=this.count;t<r;t++)kl.fromBufferAttribute(this,t),kl.applyNormalMatrix(e),this.setXYZ(t,kl.x,kl.y,kl.z);return this}transformDirection(e){for(let t=0,r=this.count;t<r;t++)kl.fromBufferAttribute(this,t),kl.transformDirection(e),this.setXYZ(t,kl.x,kl.y,kl.z);return this}getComponent(e,t){let r=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(r=Ln(r,this.array)),r}setComponent(e,t,r){return this.normalized&&(r=kn(r,this.array)),this.data.array[e*this.data.stride+this.offset+t]=r,this}setX(e,t){return this.normalized&&(t=kn(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=kn(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=kn(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=kn(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=Ln(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=Ln(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=Ln(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=Ln(t,this.array)),t}setXY(e,t,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=kn(t,this.array),r=kn(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=r,this}setXYZ(e,t,r,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=kn(t,this.array),r=kn(r,this.array),n=kn(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=r,this.data.array[e+2]=n,this}setXYZW(e,t,r,n,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=kn(t,this.array),r=kn(r,this.array),n=kn(n,this.array),i=kn(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=r,this.data.array[e+2]=n,this.data.array[e+3]=i,this}clone(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const e=[];for(let t=0;t<this.count;t++){const r=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[r+t])}return new BufferAttribute(new this.array.constructor(e),this.itemSize,this.normalized)}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new InterleavedBufferAttribute(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const e=[];for(let t=0;t<this.count;t++){const r=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[r+t])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class SpriteMaterial extends Material{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new Color(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}let Nl;const Fl=new Vector3,Il=new Vector3,Bl=new Vector3,jl=new Vector2,Hl=new Vector2,Ul=new Matrix4,zl=new Vector3,Gl=new Vector3,Wl=new Vector3,Vl=new Vector2,ql=new Vector2,$l=new Vector2;class Sprite extends Object3D{constructor(e=new SpriteMaterial){if(super(),this.isSprite=!0,this.type="Sprite",void 0===Nl){Nl=new BufferGeometry;const e=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),t=new InterleavedBuffer(e,5);Nl.setIndex([0,1,2,0,2,3]),Nl.setAttribute("position",new InterleavedBufferAttribute(t,3,0,!1)),Nl.setAttribute("uv",new InterleavedBufferAttribute(t,2,3,!1))}this.geometry=Nl,this.material=e,this.center=new Vector2(.5,.5)}raycast(e,t){null===e.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Il.setFromMatrixScale(this.matrixWorld),Ul.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),Bl.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&Il.multiplyScalar(-Bl.z);const r=this.material.rotation;let n,i;0!==r&&(i=Math.cos(r),n=Math.sin(r));const s=this.center;Zl(zl.set(-.5,-.5,0),Bl,s,Il,n,i),Zl(Gl.set(.5,-.5,0),Bl,s,Il,n,i),Zl(Wl.set(.5,.5,0),Bl,s,Il,n,i),Vl.set(0,0),ql.set(1,0),$l.set(1,1);let o=e.ray.intersectTriangle(zl,Gl,Wl,!1,Fl);if(null===o&&(Zl(Gl.set(-.5,.5,0),Bl,s,Il,n,i),ql.set(0,1),o=e.ray.intersectTriangle(zl,Wl,Gl,!1,Fl),null===o))return;const a=e.ray.origin.distanceTo(Fl);a<e.near||a>e.far||t.push({distance:a,point:Fl.clone(),uv:Triangle.getInterpolation(Fl,zl,Gl,Wl,Vl,ql,$l,new Vector2),face:null,object:this})}copy(e,t){return super.copy(e,t),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}}function Zl(e,t,r,n,i,s){jl.subVectors(e,r).addScalar(.5).multiply(n),void 0!==i?(Hl.x=s*jl.x-i*jl.y,Hl.y=i*jl.x+s*jl.y):Hl.copy(jl),e.copy(t),e.x+=Hl.x,e.y+=Hl.y,e.applyMatrix4(Ul)}const Kl=new Vector3,Xl=new Vector3;class LOD extends Object3D{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let e=0,r=t.length;e<r;e++){const r=t[e];this.addLevel(r.object.clone(),r.distance,r.hysteresis)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0,r=0){t=Math.abs(t);const n=this.levels;let i;for(i=0;i<n.length&&!(t<n[i].distance);i++);return n.splice(i,0,{distance:t,hysteresis:r,object:e}),this.add(e),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let r,n;for(r=1,n=t.length;r<n;r++){let n=t[r].distance;if(t[r].object.visible&&(n-=n*t[r].hysteresis),e<n)break}return t[r-1].object}return null}raycast(e,t){if(this.levels.length>0){Kl.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(Kl);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Kl.setFromMatrixPosition(e.matrixWorld),Xl.setFromMatrixPosition(this.matrixWorld);const r=Kl.distanceTo(Xl)/e.zoom;let n,i;for(t[0].object.visible=!0,n=1,i=t.length;n<i;n++){let e=t[n].distance;if(t[n].object.visible&&(e-=e*t[n].hysteresis),!(r>=e))break;t[n-1].object.visible=!1,t[n].object.visible=!0}for(this._currentLevel=n-1;n<i;n++)t[n].object.visible=!1}}toJSON(e){const t=super.toJSON(e);!1===this.autoUpdate&&(t.object.autoUpdate=!1),t.object.levels=[];const r=this.levels;for(let e=0,n=r.length;e<n;e++){const n=r[e];t.object.levels.push({object:n.object.uuid,distance:n.distance,hysteresis:n.hysteresis})}return t}}const Yl=new Vector3,Jl=new Vector4,Ql=new Vector4,ec=new Vector3,tc=new Matrix4,rc=new Vector3,nc=new Sphere,ic=new Matrix4,sc=new Ray;class SkinnedMesh extends Mesh{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=He,this.bindMatrix=new Matrix4,this.bindMatrixInverse=new Matrix4,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;null===this.boundingBox&&(this.boundingBox=new Box3),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let e=0;e<t.count;e++)this.getVertexPosition(e,rc),this.boundingBox.expandByPoint(rc)}computeBoundingSphere(){const e=this.geometry;null===this.boundingSphere&&(this.boundingSphere=new Sphere),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let e=0;e<t.count;e++)this.getVertexPosition(e,rc),this.boundingSphere.expandByPoint(rc)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){const r=this.material,n=this.matrixWorld;void 0!==r&&(null===this.boundingSphere&&this.computeBoundingSphere(),nc.copy(this.boundingSphere),nc.applyMatrix4(n),!1!==e.ray.intersectsSphere(nc)&&(ic.copy(n).invert(),sc.copy(e.ray).applyMatrix4(ic),null!==this.boundingBox&&!1===sc.intersectsBox(this.boundingBox)||this._computeIntersections(e,t,sc)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new Vector4,t=this.geometry.attributes.skinWeight;for(let r=0,n=t.count;r<n;r++){e.fromBufferAttribute(t,r);const n=1/e.manhattanLength();n!==1/0?e.multiplyScalar(n):e.set(1,0,0,0),t.setXYZW(r,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===He?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===ze?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const r=this.skeleton,n=this.geometry;Jl.fromBufferAttribute(n.attributes.skinIndex,e),Ql.fromBufferAttribute(n.attributes.skinWeight,e),Yl.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let e=0;e<4;e++){const n=Ql.getComponent(e);if(0!==n){const i=Jl.getComponent(e);tc.multiplyMatrices(r.bones[i].matrixWorld,r.boneInverses[i]),t.addScaledVector(ec.copy(Yl).applyMatrix4(tc),n)}}return t.applyMatrix4(this.bindMatrixInverse)}}class Bone extends Object3D{constructor(){super(),this.isBone=!0,this.type="Bone"}}class DataTexture extends Texture{constructor(e=null,t=1,r=1,n,i,s,o,a,l=tt,c=tt,u,d){super(null,s,o,a,l,c,n,i,u,d),this.isDataTexture=!0,this.image={data:e,width:t,height:r},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const oc=new Matrix4,ac=new Matrix4;class Skeleton{constructor(e=[],t=[]){this.uuid=Cn(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(16*e.length),0===t.length)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let e=0,t=this.bones.length;e<t;e++)this.boneInverses.push(new Matrix4)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const t=new Matrix4;this.bones[e]&&t.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(t)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const t=this.bones[e];t&&t.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const t=this.bones[e];t&&(t.parent&&t.parent.isBone?(t.matrix.copy(t.parent.matrixWorld).invert(),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))}}update(){const e=this.bones,t=this.boneInverses,r=this.boneMatrices,n=this.boneTexture;for(let n=0,i=e.length;n<i;n++){const i=e[n]?e[n].matrixWorld:ac;oc.multiplyMatrices(i,t[n]),oc.toArray(r,16*n)}null!==n&&(n.needsUpdate=!0)}clone(){return new Skeleton(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(4*this.bones.length);e=4*Math.ceil(e/4),e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const r=new DataTexture(t,e,e,St,yt);return r.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=r,this}getBoneByName(e){for(let t=0,r=this.bones.length;t<r;t++){const r=this.bones[t];if(r.name===e)return r}}dispose(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let r=0,n=e.bones.length;r<n;r++){const n=e.bones[r];let i=t[n];void 0===i&&(console.warn("THREE.Skeleton: No bone found with UUID:",n),i=new Bone),this.bones.push(i),this.boneInverses.push((new Matrix4).fromArray(e.boneInverses[r]))}return this.init(),this}toJSON(){const e={metadata:{version:4.6,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,r=this.boneInverses;for(let n=0,i=t.length;n<i;n++){const i=t[n];e.bones.push(i.uuid);const s=r[n];e.boneInverses.push(s.toArray())}return e}}class InstancedBufferAttribute extends BufferAttribute{constructor(e,t,r,n=1){super(e,t,r),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const lc=new Matrix4,cc=new Matrix4,uc=[],dc=new Box3,hc=new Matrix4,pc=new Mesh,mc=new Sphere;class InstancedMesh extends Mesh{constructor(e,t,r){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new InstancedBufferAttribute(new Float32Array(16*r),16),this.instanceColor=null,this.morphTexture=null,this.count=r,this.boundingBox=null,this.boundingSphere=null;for(let e=0;e<r;e++)this.setMatrixAt(e,hc)}computeBoundingBox(){const e=this.geometry,t=this.count;null===this.boundingBox&&(this.boundingBox=new Box3),null===e.boundingBox&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let r=0;r<t;r++)this.getMatrixAt(r,lc),dc.copy(e.boundingBox).applyMatrix4(lc),this.boundingBox.union(dc)}computeBoundingSphere(){const e=this.geometry,t=this.count;null===this.boundingSphere&&(this.boundingSphere=new Sphere),null===e.boundingSphere&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let r=0;r<t;r++)this.getMatrixAt(r,lc),mc.copy(e.boundingSphere).applyMatrix4(lc),this.boundingSphere.union(mc)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),null!==e.instanceColor&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){t.fromArray(this.instanceColor.array,3*e)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,16*e)}getMorphAt(e,t){const r=t.morphTargetInfluences,n=this.morphTexture.source.data.data,i=e*(r.length+1)+1;for(let e=0;e<r.length;e++)r[e]=n[i+e]}raycast(e,t){const r=this.matrixWorld,n=this.count;if(pc.geometry=this.geometry,pc.material=this.material,void 0!==pc.material&&(null===this.boundingSphere&&this.computeBoundingSphere(),mc.copy(this.boundingSphere),mc.applyMatrix4(r),!1!==e.ray.intersectsSphere(mc)))for(let i=0;i<n;i++){this.getMatrixAt(i,lc),cc.multiplyMatrices(r,lc),pc.matrixWorld=cc,pc.raycast(e,uc);for(let e=0,r=uc.length;e<r;e++){const r=uc[e];r.instanceId=i,r.object=this,t.push(r)}uc.length=0}}setColorAt(e,t){null===this.instanceColor&&(this.instanceColor=new InstancedBufferAttribute(new Float32Array(3*this.instanceMatrix.count),3)),t.toArray(this.instanceColor.array,3*e)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,16*e)}setMorphAt(e,t){const r=t.morphTargetInfluences,n=r.length+1;null===this.morphTexture&&(this.morphTexture=new DataTexture(new Float32Array(n*this.count),n,this.count,At,yt));const i=this.morphTexture.source.data.data;let s=0;for(let e=0;e<r.length;e++)s+=r[e];const o=this.geometry.morphTargetsRelative?1:1-s,a=n*e;i[a]=o,i.set(r,a+1)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}function fc(e,t){return e.z-t.z}function gc(e,t){return t.z-e.z}class MultiDrawRenderList{constructor(){this.index=0,this.pool=[],this.list=[]}push(e,t){const r=this.pool,n=this.list;this.index>=r.length&&r.push({start:-1,count:-1,z:-1});const i=r[this.index];n.push(i),this.index++,i.start=e.start,i.count=e.count,i.z=t}reset(){this.list.length=0,this.index=0}}const yc="batchId",bc=new Matrix4,vc=new Matrix4,_c=new Matrix4,xc=new Matrix4,wc=new Frustum,Sc=new Box3,Ec=new Sphere,Mc=new Vector3,Tc=new MultiDrawRenderList,Oc=new Mesh,Lc=[];function kc(e,t,r=0){const n=t.itemSize;if(e.isInterleavedBufferAttribute||e.array.constructor!==t.array.constructor){const i=e.count;for(let s=0;s<i;s++)for(let i=0;i<n;i++)t.setComponent(s+r,i,e.getComponent(s,i))}else t.array.set(e.array,r*n);t.needsUpdate=!0}class BatchedMesh extends Mesh{get maxGeometryCount(){return this._maxGeometryCount}constructor(e,t,r=2*t,n){super(new BufferGeometry,n),this.isBatchedMesh=!0,this.perObjectFrustumCulled=!0,this.sortObjects=!0,this.boundingBox=null,this.boundingSphere=null,this.customSort=null,this._drawRanges=[],this._reservedRanges=[],this._visibility=[],this._active=[],this._bounds=[],this._maxGeometryCount=e,this._maxVertexCount=t,this._maxIndexCount=r,this._geometryInitialized=!1,this._geometryCount=0,this._multiDrawCounts=new Int32Array(e),this._multiDrawStarts=new Int32Array(e),this._multiDrawCount=0,this._visibilityChanged=!0,this._matricesTexture=null,this._initMatricesTexture()}_initMatricesTexture(){let e=Math.sqrt(4*this._maxGeometryCount);e=4*Math.ceil(e/4),e=Math.max(e,4);const t=new Float32Array(e*e*4),r=new DataTexture(t,e,e,St,yt);this._matricesTexture=r}_initializeGeometry(e){const t=this.geometry,r=this._maxVertexCount,n=this._maxGeometryCount,i=this._maxIndexCount;if(!1===this._geometryInitialized){for(const n in e.attributes){const i=e.getAttribute(n),{array:s,itemSize:o,normalized:a}=i,l=new s.constructor(r*o),c=new i.constructor(l,o,a);c.setUsage(i.usage),t.setAttribute(n,c)}if(null!==e.getIndex()){const e=r>65536?new Uint32Array(i):new Uint16Array(i);t.setIndex(new BufferAttribute(e,1))}const s=n>65536?new Uint32Array(r):new Uint16Array(r);t.setAttribute(yc,new BufferAttribute(s,1)),this._geometryInitialized=!0}}_validateGeometry(e){if(e.getAttribute(yc))throw new Error(`BatchedMesh: Geometry cannot use attribute "${yc}"`);const t=this.geometry;if(Boolean(e.getIndex())!==Boolean(t.getIndex()))throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const r in t.attributes){if(r===yc)continue;if(!e.hasAttribute(r))throw new Error(`BatchedMesh: Added geometry missing "${r}". All geometries must have consistent attributes.`);const n=e.getAttribute(r),i=t.getAttribute(r);if(n.itemSize!==i.itemSize||n.normalized!==i.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new Box3);const e=this._geometryCount,t=this.boundingBox,r=this._active;t.makeEmpty();for(let n=0;n<e;n++)!1!==r[n]&&(this.getMatrixAt(n,bc),this.getBoundingBoxAt(n,Sc).applyMatrix4(bc),t.union(Sc))}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new Sphere);const e=this._geometryCount,t=this.boundingSphere,r=this._active;t.makeEmpty();for(let n=0;n<e;n++)!1!==r[n]&&(this.getMatrixAt(n,bc),this.getBoundingSphereAt(n,Ec).applyMatrix4(bc),t.union(Ec))}addGeometry(e,t=-1,r=-1){if(this._initializeGeometry(e),this._validateGeometry(e),this._geometryCount>=this._maxGeometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");const n={vertexStart:-1,vertexCount:-1,indexStart:-1,indexCount:-1};let i=null;const s=this._reservedRanges,o=this._drawRanges,a=this._bounds;0!==this._geometryCount&&(i=s[s.length-1]),n.vertexCount=-1===t?e.getAttribute("position").count:t,n.vertexStart=null===i?0:i.vertexStart+i.vertexCount;const l=e.getIndex(),c=null!==l;if(c&&(n.indexCount=-1===r?l.count:r,n.indexStart=null===i?0:i.indexStart+i.indexCount),-1!==n.indexStart&&n.indexStart+n.indexCount>this._maxIndexCount||n.vertexStart+n.vertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");const u=this._visibility,d=this._active,h=this._matricesTexture,p=this._matricesTexture.image.data;u.push(!0),d.push(!0);const m=this._geometryCount;this._geometryCount++,_c.toArray(p,16*m),h.needsUpdate=!0,s.push(n),o.push({start:c?n.indexStart:n.vertexStart,count:-1}),a.push({boxInitialized:!1,box:new Box3,sphereInitialized:!1,sphere:new Sphere});const f=this.geometry.getAttribute(yc);for(let e=0;e<n.vertexCount;e++)f.setX(n.vertexStart+e,m);return f.needsUpdate=!0,this.setGeometryAt(m,e),m}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const r=this.geometry,n=null!==r.getIndex(),i=r.getIndex(),s=t.getIndex(),o=this._reservedRanges[e];if(n&&s.count>o.indexCount||t.attributes.position.count>o.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const a=o.vertexStart,l=o.vertexCount;for(const e in r.attributes){if(e===yc)continue;const n=t.getAttribute(e),i=r.getAttribute(e);kc(n,i,a);const s=n.itemSize;for(let e=n.count,t=l;e<t;e++){const t=a+e;for(let e=0;e<s;e++)i.setComponent(t,e,0)}i.needsUpdate=!0}if(n){const e=o.indexStart;for(let t=0;t<s.count;t++)i.setX(e+t,a+s.getX(t));for(let t=s.count,r=o.indexCount;t<r;t++)i.setX(e+t,a);i.needsUpdate=!0}const c=this._bounds[e];null!==t.boundingBox?(c.box.copy(t.boundingBox),c.boxInitialized=!0):c.boxInitialized=!1,null!==t.boundingSphere?(c.sphere.copy(t.boundingSphere),c.sphereInitialized=!0):c.sphereInitialized=!1;const u=this._drawRanges[e],d=t.getAttribute("position");return u.count=n?s.count:d.count,this._visibilityChanged=!0,e}deleteGeometry(e){const t=this._active;return e>=t.length||!1===t[e]||(t[e]=!1,this._visibilityChanged=!0),this}getBoundingBoxAt(e,t){if(!1===this._active[e])return null;const r=this._bounds[e],n=r.box,i=this.geometry;if(!1===r.boxInitialized){n.makeEmpty();const t=i.index,s=i.attributes.position,o=this._drawRanges[e];for(let e=o.start,r=o.start+o.count;e<r;e++){let r=e;t&&(r=t.getX(r)),n.expandByPoint(Mc.fromBufferAttribute(s,r))}r.boxInitialized=!0}return t.copy(n),t}getBoundingSphereAt(e,t){if(!1===this._active[e])return null;const r=this._bounds[e],n=r.sphere,i=this.geometry;if(!1===r.sphereInitialized){n.makeEmpty(),this.getBoundingBoxAt(e,Sc),Sc.getCenter(n.center);const t=i.index,s=i.attributes.position,o=this._drawRanges[e];let a=0;for(let e=o.start,r=o.start+o.count;e<r;e++){let r=e;t&&(r=t.getX(r)),Mc.fromBufferAttribute(s,r),a=Math.max(a,n.center.distanceToSquared(Mc))}n.radius=Math.sqrt(a),r.sphereInitialized=!0}return t.copy(n),t}setMatrixAt(e,t){const r=this._active,n=this._matricesTexture,i=this._matricesTexture.image.data;return e>=this._geometryCount||!1===r[e]||(t.toArray(i,16*e),n.needsUpdate=!0),this}getMatrixAt(e,t){const r=this._active,n=this._matricesTexture.image.data;return e>=this._geometryCount||!1===r[e]?null:t.fromArray(n,16*e)}setVisibleAt(e,t){const r=this._visibility,n=this._active;return e>=this._geometryCount||!1===n[e]||r[e]===t||(r[e]=t,this._visibilityChanged=!0),this}getVisibleAt(e){const t=this._visibility,r=this._active;return!(e>=this._geometryCount||!1===r[e])&&t[e]}raycast(e,t){const r=this._visibility,n=this._active,i=this._drawRanges,s=this._geometryCount,o=this.matrixWorld,a=this.geometry;Oc.material=this.material,Oc.geometry.index=a.index,Oc.geometry.attributes=a.attributes,null===Oc.geometry.boundingBox&&(Oc.geometry.boundingBox=new Box3),null===Oc.geometry.boundingSphere&&(Oc.geometry.boundingSphere=new Sphere);for(let a=0;a<s;a++){if(!r[a]||!n[a])continue;const s=i[a];Oc.geometry.setDrawRange(s.start,s.count),this.getMatrixAt(a,Oc.matrixWorld).premultiply(o),this.getBoundingBoxAt(a,Oc.geometry.boundingBox),this.getBoundingSphereAt(a,Oc.geometry.boundingSphere),Oc.raycast(e,Lc);for(let e=0,r=Lc.length;e<r;e++){const r=Lc[e];r.object=this,r.batchId=a,t.push(r)}Lc.length=0}Oc.material=null,Oc.geometry.index=null,Oc.geometry.attributes={},Oc.geometry.setDrawRange(0,1/0)}copy(e){return super.copy(e),this.geometry=e.geometry.clone(),this.perObjectFrustumCulled=e.perObjectFrustumCulled,this.sortObjects=e.sortObjects,this.boundingBox=null!==e.boundingBox?e.boundingBox.clone():null,this.boundingSphere=null!==e.boundingSphere?e.boundingSphere.clone():null,this._drawRanges=e._drawRanges.map((e=>({...e}))),this._reservedRanges=e._reservedRanges.map((e=>({...e}))),this._visibility=e._visibility.slice(),this._active=e._active.slice(),this._bounds=e._bounds.map((e=>({boxInitialized:e.boxInitialized,box:e.box.clone(),sphereInitialized:e.sphereInitialized,sphere:e.sphere.clone()}))),this._maxGeometryCount=e._maxGeometryCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._geometryCount=e._geometryCount,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.slice(),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this}onBeforeRender(e,t,r,n,i){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const s=n.getIndex(),o=null===s?1:s.array.BYTES_PER_ELEMENT,a=this._active,l=this._visibility,c=this._multiDrawStarts,u=this._multiDrawCounts,d=this._drawRanges,h=this.perObjectFrustumCulled;h&&(xc.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse).multiply(this.matrixWorld),wc.setFromProjectionMatrix(xc,e.coordinateSystem));let p=0;if(this.sortObjects){vc.copy(this.matrixWorld).invert(),Mc.setFromMatrixPosition(r.matrixWorld).applyMatrix4(vc);for(let e=0,t=l.length;e<t;e++)if(l[e]&&a[e]){this.getMatrixAt(e,bc),this.getBoundingSphereAt(e,Ec).applyMatrix4(bc);let t=!1;if(h&&(t=!wc.intersectsSphere(Ec)),!t){const t=Mc.distanceTo(Ec.center);Tc.push(d[e],t)}}const e=Tc.list,t=this.customSort;null===t?e.sort(i.transparent?gc:fc):t.call(this,e,r);for(let t=0,r=e.length;t<r;t++){const r=e[t];c[p]=r.start*o,u[p]=r.count,p++}Tc.reset()}else for(let e=0,t=l.length;e<t;e++)if(l[e]&&a[e]){let t=!1;if(h&&(this.getMatrixAt(e,bc),this.getBoundingSphereAt(e,Ec).applyMatrix4(bc),t=!wc.intersectsSphere(Ec)),!t){const t=d[e];c[p]=t.start*o,u[p]=t.count,p++}}this._multiDrawCount=p,this._visibilityChanged=!1}onBeforeShadow(e,t,r,n,i,s){this.onBeforeRender(e,null,n,i,s)}}class LineBasicMaterial extends Material{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Color(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const Nc=new Vector3,Fc=new Vector3,Ic=new Matrix4,jc=new Ray,zc=new Sphere;class Line extends Object3D{constructor(e=new BufferGeometry,t=new LineBasicMaterial){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(null===e.index){const t=e.attributes.position,r=[0];for(let e=1,n=t.count;e<n;e++)Nc.fromBufferAttribute(t,e-1),Fc.fromBufferAttribute(t,e),r[e]=r[e-1],r[e]+=Nc.distanceTo(Fc);e.setAttribute("lineDistance",new Float32BufferAttribute(r,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const r=this.geometry,n=this.matrixWorld,i=e.params.Line.threshold,s=r.drawRange;if(null===r.boundingSphere&&r.computeBoundingSphere(),zc.copy(r.boundingSphere),zc.applyMatrix4(n),zc.radius+=i,!1===e.ray.intersectsSphere(zc))return;Ic.copy(n).invert(),jc.copy(e.ray).applyMatrix4(Ic);const o=i/((this.scale.x+this.scale.y+this.scale.z)/3),a=o*o,l=new Vector3,c=new Vector3,u=new Vector3,d=new Vector3,h=this.isLineSegments?2:1,p=r.index,m=r.attributes.position;if(null!==p){for(let r=Math.max(0,s.start),n=Math.min(p.count,s.start+s.count)-1;r<n;r+=h){const n=p.getX(r),i=p.getX(r+1);l.fromBufferAttribute(m,n),c.fromBufferAttribute(m,i);if(jc.distanceSqToSegment(l,c,d,u)>a)continue;d.applyMatrix4(this.matrixWorld);const s=e.ray.origin.distanceTo(d);s<e.near||s>e.far||t.push({distance:s,point:u.clone().applyMatrix4(this.matrixWorld),index:r,face:null,faceIndex:null,object:this})}}else{for(let r=Math.max(0,s.start),n=Math.min(m.count,s.start+s.count)-1;r<n;r+=h){l.fromBufferAttribute(m,r),c.fromBufferAttribute(m,r+1);if(jc.distanceSqToSegment(l,c,d,u)>a)continue;d.applyMatrix4(this.matrixWorld);const n=e.ray.origin.distanceTo(d);n<e.near||n>e.far||t.push({distance:n,point:u.clone().applyMatrix4(this.matrixWorld),index:r,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const r=e[t[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=r.length;e<t;e++){const t=r[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}}const Gc=new Vector3,Vc=new Vector3;class LineSegments extends Line{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(null===e.index){const t=e.attributes.position,r=[];for(let e=0,n=t.count;e<n;e+=2)Gc.fromBufferAttribute(t,e),Vc.fromBufferAttribute(t,e+1),r[e]=0===e?0:r[e-1],r[e+1]=r[e]+Gc.distanceTo(Vc);e.setAttribute("lineDistance",new Float32BufferAttribute(r,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class LineLoop extends Line{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class PointsMaterial extends Material{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Color(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const qc=new Matrix4,$c=new Ray,Kc=new Sphere,Jc=new Vector3;class Points extends Object3D{constructor(e=new BufferGeometry,t=new PointsMaterial){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const r=this.geometry,n=this.matrixWorld,i=e.params.Points.threshold,s=r.drawRange;if(null===r.boundingSphere&&r.computeBoundingSphere(),Kc.copy(r.boundingSphere),Kc.applyMatrix4(n),Kc.radius+=i,!1===e.ray.intersectsSphere(Kc))return;qc.copy(n).invert(),$c.copy(e.ray).applyMatrix4(qc);const o=i/((this.scale.x+this.scale.y+this.scale.z)/3),a=o*o,l=r.index,c=r.attributes.position;if(null!==l){for(let r=Math.max(0,s.start),i=Math.min(l.count,s.start+s.count);r<i;r++){const i=l.getX(r);Jc.fromBufferAttribute(c,i),Qc(Jc,i,a,n,e,t,this)}}else{for(let r=Math.max(0,s.start),i=Math.min(c.count,s.start+s.count);r<i;r++)Jc.fromBufferAttribute(c,r),Qc(Jc,r,a,n,e,t,this)}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const r=e[t[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=r.length;e<t;e++){const t=r[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}}function Qc(e,t,r,n,i,s,o){const a=$c.distanceSqToPoint(e);if(a<r){const r=new Vector3;$c.closestPointToPoint(e,r),r.applyMatrix4(n);const l=i.ray.origin.distanceTo(r);if(l<i.near||l>i.far)return;s.push({distance:l,distanceToRay:Math.sqrt(a),point:r,index:t,face:null,object:o})}}class VideoTexture extends Texture{constructor(e,t,r,n,i,s,o,a,l){super(e,t,r,n,i,s,o,a,l),this.isVideoTexture=!0,this.minFilter=void 0!==s?s:ot,this.magFilter=void 0!==i?i:ot,this.generateMipmaps=!1;const c=this;"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback((function t(){c.needsUpdate=!0,e.requestVideoFrameCallback(t)}))}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;!1==="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class FramebufferTexture extends Texture{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=tt,this.minFilter=tt,this.generateMipmaps=!1,this.needsUpdate=!0}}class CompressedTexture extends Texture{constructor(e,t,r,n,i,s,o,a,l,c,u,d){super(null,s,o,a,l,c,n,i,u,d),this.isCompressedTexture=!0,this.image={width:t,height:r},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class CompressedArrayTexture extends CompressedTexture{constructor(e,t,r,n,i,s){super(e,t,r,i,s),this.isCompressedArrayTexture=!0,this.image.depth=n,this.wrapR=Qe}}class CompressedCubeTexture extends CompressedTexture{constructor(e,t,r){super(void 0,e[0].width,e[0].height,t,r,We),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class CanvasTexture extends Texture{constructor(e,t,r,n,i,s,o,a,l){super(e,t,r,n,i,s,o,a,l),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Curve{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const r=this.getUtoTmapping(e);return this.getPoint(r,t)}getPoints(e=5){const t=[];for(let r=0;r<=e;r++)t.push(this.getPoint(r/e));return t}getSpacedPoints(e=5){const t=[];for(let r=0;r<=e;r++)t.push(this.getPointAt(r/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let r,n=this.getPoint(0),i=0;t.push(0);for(let s=1;s<=e;s++)r=this.getPoint(s/e),i+=r.distanceTo(n),t.push(i),n=r;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const r=this.getLengths();let n=0;const i=r.length;let s;s=t||e*r[i-1];let o,a=0,l=i-1;for(;a<=l;)if(n=Math.floor(a+(l-a)/2),o=r[n]-s,o<0)a=n+1;else{if(!(o>0)){l=n;break}l=n-1}if(n=l,r[n]===s)return n/(i-1);const c=r[n];return(n+(s-c)/(r[n+1]-c))/(i-1)}getTangent(e,t){const r=1e-4;let n=e-r,i=e+r;n<0&&(n=0),i>1&&(i=1);const s=this.getPoint(n),o=this.getPoint(i),a=t||(s.isVector2?new Vector2:new Vector3);return a.copy(o).sub(s).normalize(),a}getTangentAt(e,t){const r=this.getUtoTmapping(e);return this.getTangent(r,t)}computeFrenetFrames(e,t){const r=new Vector3,n=[],i=[],s=[],o=new Vector3,a=new Matrix4;for(let t=0;t<=e;t++){const r=t/e;n[t]=this.getTangentAt(r,new Vector3)}i[0]=new Vector3,s[0]=new Vector3;let l=Number.MAX_VALUE;const c=Math.abs(n[0].x),u=Math.abs(n[0].y),d=Math.abs(n[0].z);c<=l&&(l=c,r.set(1,0,0)),u<=l&&(l=u,r.set(0,1,0)),d<=l&&r.set(0,0,1),o.crossVectors(n[0],r).normalize(),i[0].crossVectors(n[0],o),s[0].crossVectors(n[0],i[0]);for(let t=1;t<=e;t++){if(i[t]=i[t-1].clone(),s[t]=s[t-1].clone(),o.crossVectors(n[t-1],n[t]),o.length()>Number.EPSILON){o.normalize();const e=Math.acos(An(n[t-1].dot(n[t]),-1,1));i[t].applyMatrix4(a.makeRotationAxis(o,e))}s[t].crossVectors(n[t],i[t])}if(!0===t){let t=Math.acos(An(i[0].dot(i[e]),-1,1));t/=e,n[0].dot(o.crossVectors(i[0],i[e]))>0&&(t=-t);for(let r=1;r<=e;r++)i[r].applyMatrix4(a.makeRotationAxis(n[r],t*r)),s[r].crossVectors(n[r],i[r])}return{tangents:n,normals:i,binormals:s}}clone(){return(new this.constructor).copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class EllipseCurve extends Curve{constructor(e=0,t=0,r=1,n=1,i=0,s=2*Math.PI,o=!1,a=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=r,this.yRadius=n,this.aStartAngle=i,this.aEndAngle=s,this.aClockwise=o,this.aRotation=a}getPoint(e,t=new Vector2){const r=t,n=2*Math.PI;let i=this.aEndAngle-this.aStartAngle;const s=Math.abs(i)<Number.EPSILON;for(;i<0;)i+=n;for(;i>n;)i-=n;i<Number.EPSILON&&(i=s?0:n),!0!==this.aClockwise||s||(i===n?i=-n:i-=n);const o=this.aStartAngle+e*i;let a=this.aX+this.xRadius*Math.cos(o),l=this.aY+this.yRadius*Math.sin(o);if(0!==this.aRotation){const e=Math.cos(this.aRotation),t=Math.sin(this.aRotation),r=a-this.aX,n=l-this.aY;a=r*e-n*t+this.aX,l=r*t+n*e+this.aY}return r.set(a,l)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}class ArcCurve extends EllipseCurve{constructor(e,t,r,n,i,s){super(e,t,r,r,n,i,s),this.isArcCurve=!0,this.type="ArcCurve"}}function CubicPoly(){let e=0,t=0,r=0,n=0;function i(i,s,o,a){e=i,t=o,r=-3*i+3*s-2*o-a,n=2*i-2*s+o+a}return{initCatmullRom:function(e,t,r,n,s){i(t,r,s*(r-e),s*(n-t))},initNonuniformCatmullRom:function(e,t,r,n,s,o,a){let l=(t-e)/s-(r-e)/(s+o)+(r-t)/o,c=(r-t)/o-(n-t)/(o+a)+(n-r)/a;l*=o,c*=o,i(t,r,l,c)},calc:function(i){const s=i*i;return e+t*i+r*s+n*(s*i)}}}const eu=new Vector3,tu=new CubicPoly,ru=new CubicPoly,nu=new CubicPoly;class CatmullRomCurve3 extends Curve{constructor(e=[],t=!1,r="centripetal",n=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=r,this.tension=n}getPoint(e,t=new Vector3){const r=t,n=this.points,i=n.length,s=(i-(this.closed?0:1))*e;let o,a,l=Math.floor(s),c=s-l;this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/i)+1)*i:0===c&&l===i-1&&(l=i-2,c=1),this.closed||l>0?o=n[(l-1)%i]:(eu.subVectors(n[0],n[1]).add(n[0]),o=eu);const u=n[l%i],d=n[(l+1)%i];if(this.closed||l+2<i?a=n[(l+2)%i]:(eu.subVectors(n[i-1],n[i-2]).add(n[i-1]),a=eu),"centripetal"===this.curveType||"chordal"===this.curveType){const e="chordal"===this.curveType?.5:.25;let t=Math.pow(o.distanceToSquared(u),e),r=Math.pow(u.distanceToSquared(d),e),n=Math.pow(d.distanceToSquared(a),e);r<1e-4&&(r=1),t<1e-4&&(t=r),n<1e-4&&(n=r),tu.initNonuniformCatmullRom(o.x,u.x,d.x,a.x,t,r,n),ru.initNonuniformCatmullRom(o.y,u.y,d.y,a.y,t,r,n),nu.initNonuniformCatmullRom(o.z,u.z,d.z,a.z,t,r,n)}else"catmullrom"===this.curveType&&(tu.initCatmullRom(o.x,u.x,d.x,a.x,this.tension),ru.initCatmullRom(o.y,u.y,d.y,a.y,this.tension),nu.initCatmullRom(o.z,u.z,d.z,a.z,this.tension));return r.set(tu.calc(c),ru.calc(c),nu.calc(c)),r}copy(e){super.copy(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){const r=e.points[t];this.points.push(r.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,r=this.points.length;t<r;t++){const r=this.points[t];e.points.push(r.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){const r=e.points[t];this.points.push((new Vector3).fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function CatmullRom(e,t,r,n,i){const s=.5*(n-t),o=.5*(i-r),a=e*e;return(2*r-2*n+s+o)*(e*a)+(-3*r+3*n-2*s-o)*a+s*e+r}function QuadraticBezier(e,t,r,n){return function(e,t){const r=1-e;return r*r*t}(e,t)+function(e,t){return 2*(1-e)*e*t}(e,r)+function(e,t){return e*e*t}(e,n)}function CubicBezier(e,t,r,n,i){return function(e,t){const r=1-e;return r*r*r*t}(e,t)+function(e,t){const r=1-e;return 3*r*r*e*t}(e,r)+function(e,t){return 3*(1-e)*e*e*t}(e,n)+function(e,t){return e*e*e*t}(e,i)}class CubicBezierCurve extends Curve{constructor(e=new Vector2,t=new Vector2,r=new Vector2,n=new Vector2){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=r,this.v3=n}getPoint(e,t=new Vector2){const r=t,n=this.v0,i=this.v1,s=this.v2,o=this.v3;return r.set(CubicBezier(e,n.x,i.x,s.x,o.x),CubicBezier(e,n.y,i.y,s.y,o.y)),r}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class CubicBezierCurve3 extends Curve{constructor(e=new Vector3,t=new Vector3,r=new Vector3,n=new Vector3){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=r,this.v3=n}getPoint(e,t=new Vector3){const r=t,n=this.v0,i=this.v1,s=this.v2,o=this.v3;return r.set(CubicBezier(e,n.x,i.x,s.x,o.x),CubicBezier(e,n.y,i.y,s.y,o.y),CubicBezier(e,n.z,i.z,s.z,o.z)),r}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class LineCurve extends Curve{constructor(e=new Vector2,t=new Vector2){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new Vector2){const r=t;return 1===e?r.copy(this.v2):(r.copy(this.v2).sub(this.v1),r.multiplyScalar(e).add(this.v1)),r}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new Vector2){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class LineCurve3 extends Curve{constructor(e=new Vector3,t=new Vector3){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new Vector3){const r=t;return 1===e?r.copy(this.v2):(r.copy(this.v2).sub(this.v1),r.multiplyScalar(e).add(this.v1)),r}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new Vector3){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class QuadraticBezierCurve extends Curve{constructor(e=new Vector2,t=new Vector2,r=new Vector2){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=r}getPoint(e,t=new Vector2){const r=t,n=this.v0,i=this.v1,s=this.v2;return r.set(QuadraticBezier(e,n.x,i.x,s.x),QuadraticBezier(e,n.y,i.y,s.y)),r}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class QuadraticBezierCurve3 extends Curve{constructor(e=new Vector3,t=new Vector3,r=new Vector3){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=r}getPoint(e,t=new Vector3){const r=t,n=this.v0,i=this.v1,s=this.v2;return r.set(QuadraticBezier(e,n.x,i.x,s.x),QuadraticBezier(e,n.y,i.y,s.y),QuadraticBezier(e,n.z,i.z,s.z)),r}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class SplineCurve extends Curve{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new Vector2){const r=t,n=this.points,i=(n.length-1)*e,s=Math.floor(i),o=i-s,a=n[0===s?s:s-1],l=n[s],c=n[s>n.length-2?n.length-1:s+1],u=n[s>n.length-3?n.length-1:s+2];return r.set(CatmullRom(o,a.x,l.x,c.x,u.x),CatmullRom(o,a.y,l.y,c.y,u.y)),r}copy(e){super.copy(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){const r=e.points[t];this.points.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,r=this.points.length;t<r;t++){const r=this.points[t];e.points.push(r.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){const r=e.points[t];this.points.push((new Vector2).fromArray(r))}return this}}var iu=Object.freeze({__proto__:null,ArcCurve,CatmullRomCurve3,CubicBezierCurve,CubicBezierCurve3,EllipseCurve,LineCurve,LineCurve3,QuadraticBezierCurve,QuadraticBezierCurve3,SplineCurve});class CurvePath extends Curve{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(t)){const r=!0===e.isVector2?"LineCurve":"LineCurve3";this.curves.push(new iu[r](t,e))}return this}getPoint(e,t){const r=e*this.getLength(),n=this.getCurveLengths();let i=0;for(;i<n.length;){if(n[i]>=r){const e=n[i]-r,s=this.curves[i],o=s.getLength(),a=0===o?0:1-e/o;return s.getPointAt(a,t)}i++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let r=0,n=this.curves.length;r<n;r++)t+=this.curves[r].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let r=0;r<=e;r++)t.push(this.getPoint(r/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let r;for(let n=0,i=this.curves;n<i.length;n++){const s=i[n],o=s.isEllipseCurve?2*e:s.isLineCurve||s.isLineCurve3?1:s.isSplineCurve?e*s.points.length:e,a=s.getPoints(o);for(let e=0;e<a.length;e++){const n=a[e];r&&r.equals(n)||(t.push(n),r=n)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,r=e.curves.length;t<r;t++){const r=e.curves[t];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,r=this.curves.length;t<r;t++){const r=this.curves[t];e.curves.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,r=e.curves.length;t<r;t++){const r=e.curves[t];this.curves.push((new iu[r.type]).fromJSON(r))}return this}}class Path extends CurvePath{constructor(e){super(),this.type="Path",this.currentPoint=new Vector2,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,r=e.length;t<r;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const r=new LineCurve(this.currentPoint.clone(),new Vector2(e,t));return this.curves.push(r),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,r,n){const i=new QuadraticBezierCurve(this.currentPoint.clone(),new Vector2(e,t),new Vector2(r,n));return this.curves.push(i),this.currentPoint.set(r,n),this}bezierCurveTo(e,t,r,n,i,s){const o=new CubicBezierCurve(this.currentPoint.clone(),new Vector2(e,t),new Vector2(r,n),new Vector2(i,s));return this.curves.push(o),this.currentPoint.set(i,s),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),r=new SplineCurve(t);return this.curves.push(r),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,r,n,i,s){const o=this.currentPoint.x,a=this.currentPoint.y;return this.absarc(e+o,t+a,r,n,i,s),this}absarc(e,t,r,n,i,s){return this.absellipse(e,t,r,r,n,i,s),this}ellipse(e,t,r,n,i,s,o,a){const l=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(e+l,t+c,r,n,i,s,o,a),this}absellipse(e,t,r,n,i,s,o,a){const l=new EllipseCurve(e,t,r,n,i,s,o,a);if(this.curves.length>0){const e=l.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class LatheGeometry extends BufferGeometry{constructor(e=[new Vector2(0,-.5),new Vector2(.5,0),new Vector2(0,.5)],t=12,r=0,n=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:r,phiLength:n},t=Math.floor(t),n=An(n,0,2*Math.PI);const i=[],s=[],o=[],a=[],l=[],c=1/t,u=new Vector3,d=new Vector2,h=new Vector3,p=new Vector3,m=new Vector3;let f=0,g=0;for(let t=0;t<=e.length-1;t++)switch(t){case 0:f=e[t+1].x-e[t].x,g=e[t+1].y-e[t].y,h.x=1*g,h.y=-f,h.z=0*g,m.copy(h),h.normalize(),a.push(h.x,h.y,h.z);break;case e.length-1:a.push(m.x,m.y,m.z);break;default:f=e[t+1].x-e[t].x,g=e[t+1].y-e[t].y,h.x=1*g,h.y=-f,h.z=0*g,p.copy(h),h.x+=m.x,h.y+=m.y,h.z+=m.z,h.normalize(),a.push(h.x,h.y,h.z),m.copy(p)}for(let i=0;i<=t;i++){const h=r+i*c*n,p=Math.sin(h),m=Math.cos(h);for(let r=0;r<=e.length-1;r++){u.x=e[r].x*p,u.y=e[r].y,u.z=e[r].x*m,s.push(u.x,u.y,u.z),d.x=i/t,d.y=r/(e.length-1),o.push(d.x,d.y);const n=a[3*r+0]*p,c=a[3*r+1],h=a[3*r+0]*m;l.push(n,c,h)}}for(let r=0;r<t;r++)for(let t=0;t<e.length-1;t++){const n=t+r*e.length,s=n,o=n+e.length,a=n+e.length+1,l=n+1;i.push(s,o,l),i.push(a,l,o)}this.setIndex(i),this.setAttribute("position",new Float32BufferAttribute(s,3)),this.setAttribute("uv",new Float32BufferAttribute(o,2)),this.setAttribute("normal",new Float32BufferAttribute(l,3))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new LatheGeometry(e.points,e.segments,e.phiStart,e.phiLength)}}class CapsuleGeometry extends LatheGeometry{constructor(e=1,t=1,r=4,n=8){const i=new Path;i.absarc(0,-t/2,e,1.5*Math.PI,0),i.absarc(0,t/2,e,0,.5*Math.PI),super(i.getPoints(r),n),this.type="CapsuleGeometry",this.parameters={radius:e,length:t,capSegments:r,radialSegments:n}}static fromJSON(e){return new CapsuleGeometry(e.radius,e.length,e.capSegments,e.radialSegments)}}class CircleGeometry extends BufferGeometry{constructor(e=1,t=32,r=0,n=2*Math.PI){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:r,thetaLength:n},t=Math.max(3,t);const i=[],s=[],o=[],a=[],l=new Vector3,c=new Vector2;s.push(0,0,0),o.push(0,0,1),a.push(.5,.5);for(let i=0,u=3;i<=t;i++,u+=3){const d=r+i/t*n;l.x=e*Math.cos(d),l.y=e*Math.sin(d),s.push(l.x,l.y,l.z),o.push(0,0,1),c.x=(s[u]/e+1)/2,c.y=(s[u+1]/e+1)/2,a.push(c.x,c.y)}for(let e=1;e<=t;e++)i.push(e,e+1,0);this.setIndex(i),this.setAttribute("position",new Float32BufferAttribute(s,3)),this.setAttribute("normal",new Float32BufferAttribute(o,3)),this.setAttribute("uv",new Float32BufferAttribute(a,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new CircleGeometry(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class CylinderGeometry extends BufferGeometry{constructor(e=1,t=1,r=1,n=32,i=1,s=!1,o=0,a=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:r,radialSegments:n,heightSegments:i,openEnded:s,thetaStart:o,thetaLength:a};const l=this;n=Math.floor(n),i=Math.floor(i);const c=[],u=[],d=[],h=[];let p=0;const m=[],f=r/2;let g=0;function y(r){const i=p,s=new Vector2,m=new Vector3;let y=0;const b=!0===r?e:t,v=!0===r?1:-1;for(let e=1;e<=n;e++)u.push(0,f*v,0),d.push(0,v,0),h.push(.5,.5),p++;const _=p;for(let e=0;e<=n;e++){const t=e/n*a+o,r=Math.cos(t),i=Math.sin(t);m.x=b*i,m.y=f*v,m.z=b*r,u.push(m.x,m.y,m.z),d.push(0,v,0),s.x=.5*r+.5,s.y=.5*i*v+.5,h.push(s.x,s.y),p++}for(let e=0;e<n;e++){const t=i+e,n=_+e;!0===r?c.push(n,n+1,t):c.push(n+1,n,t),y+=3}l.addGroup(g,y,!0===r?1:2),g+=y}!function(){const s=new Vector3,y=new Vector3;let b=0;const v=(t-e)/r;for(let l=0;l<=i;l++){const c=[],g=l/i,b=g*(t-e)+e;for(let e=0;e<=n;e++){const t=e/n,i=t*a+o,l=Math.sin(i),m=Math.cos(i);y.x=b*l,y.y=-g*r+f,y.z=b*m,u.push(y.x,y.y,y.z),s.set(l,v,m).normalize(),d.push(s.x,s.y,s.z),h.push(t,1-g),c.push(p++)}m.push(c)}for(let e=0;e<n;e++)for(let t=0;t<i;t++){const r=m[t][e],n=m[t+1][e],i=m[t+1][e+1],s=m[t][e+1];c.push(r,n,s),c.push(n,i,s),b+=6}l.addGroup(g,b,0),g+=b}(),!1===s&&(e>0&&y(!0),t>0&&y(!1)),this.setIndex(c),this.setAttribute("position",new Float32BufferAttribute(u,3)),this.setAttribute("normal",new Float32BufferAttribute(d,3)),this.setAttribute("uv",new Float32BufferAttribute(h,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new CylinderGeometry(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class ConeGeometry extends CylinderGeometry{constructor(e=1,t=1,r=32,n=1,i=!1,s=0,o=2*Math.PI){super(0,e,t,r,n,i,s,o),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:r,heightSegments:n,openEnded:i,thetaStart:s,thetaLength:o}}static fromJSON(e){return new ConeGeometry(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class PolyhedronGeometry extends BufferGeometry{constructor(e=[],t=[],r=1,n=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:r,detail:n};const i=[],s=[];function o(e,t,r,n){const i=n+1,s=[];for(let n=0;n<=i;n++){s[n]=[];const o=e.clone().lerp(r,n/i),a=t.clone().lerp(r,n/i),l=i-n;for(let e=0;e<=l;e++)s[n][e]=0===e&&n===i?o:o.clone().lerp(a,e/l)}for(let e=0;e<i;e++)for(let t=0;t<2*(i-e)-1;t++){const r=Math.floor(t/2);t%2==0?(a(s[e][r+1]),a(s[e+1][r]),a(s[e][r])):(a(s[e][r+1]),a(s[e+1][r+1]),a(s[e+1][r]))}}function a(e){i.push(e.x,e.y,e.z)}function l(t,r){const n=3*t;r.x=e[n+0],r.y=e[n+1],r.z=e[n+2]}function c(e,t,r,n){n<0&&1===e.x&&(s[t]=e.x-1),0===r.x&&0===r.z&&(s[t]=n/2/Math.PI+.5)}function u(e){return Math.atan2(e.z,-e.x)}!function(e){const r=new Vector3,n=new Vector3,i=new Vector3;for(let s=0;s<t.length;s+=3)l(t[s+0],r),l(t[s+1],n),l(t[s+2],i),o(r,n,i,e)}(n),function(e){const t=new Vector3;for(let r=0;r<i.length;r+=3)t.x=i[r+0],t.y=i[r+1],t.z=i[r+2],t.normalize().multiplyScalar(e),i[r+0]=t.x,i[r+1]=t.y,i[r+2]=t.z}(r),function(){const e=new Vector3;for(let r=0;r<i.length;r+=3){e.x=i[r+0],e.y=i[r+1],e.z=i[r+2];const n=u(e)/2/Math.PI+.5,o=(t=e,Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))/Math.PI+.5);s.push(n,1-o)}var t;(function(){const e=new Vector3,t=new Vector3,r=new Vector3,n=new Vector3,o=new Vector2,a=new Vector2,l=new Vector2;for(let d=0,h=0;d<i.length;d+=9,h+=6){e.set(i[d+0],i[d+1],i[d+2]),t.set(i[d+3],i[d+4],i[d+5]),r.set(i[d+6],i[d+7],i[d+8]),o.set(s[h+0],s[h+1]),a.set(s[h+2],s[h+3]),l.set(s[h+4],s[h+5]),n.copy(e).add(t).add(r).divideScalar(3);const p=u(n);c(o,h+0,e,p),c(a,h+2,t,p),c(l,h+4,r,p)}})(),function(){for(let e=0;e<s.length;e+=6){const t=s[e+0],r=s[e+2],n=s[e+4],i=Math.max(t,r,n),o=Math.min(t,r,n);i>.9&&o<.1&&(t<.2&&(s[e+0]+=1),r<.2&&(s[e+2]+=1),n<.2&&(s[e+4]+=1))}}()}(),this.setAttribute("position",new Float32BufferAttribute(i,3)),this.setAttribute("normal",new Float32BufferAttribute(i.slice(),3)),this.setAttribute("uv",new Float32BufferAttribute(s,2)),0===n?this.computeVertexNormals():this.normalizeNormals()}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new PolyhedronGeometry(e.vertices,e.indices,e.radius,e.details)}}class DodecahedronGeometry extends PolyhedronGeometry{constructor(e=1,t=0){const r=(1+Math.sqrt(5))/2,n=1/r;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-n,-r,0,-n,r,0,n,-r,0,n,r,-n,-r,0,-n,r,0,n,-r,0,n,r,0,-r,0,-n,r,0,-n,-r,0,n,r,0,n],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new DodecahedronGeometry(e.radius,e.detail)}}const su=new Vector3,ou=new Vector3,au=new Vector3,lu=new Triangle;class EdgesGeometry extends BufferGeometry{constructor(e=null,t=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},null!==e){const r=4,n=Math.pow(10,r),i=Math.cos(En*t),s=e.getIndex(),o=e.getAttribute("position"),a=s?s.count:o.count,l=[0,0,0],c=["a","b","c"],u=new Array(3),d={},h=[];for(let e=0;e<a;e+=3){s?(l[0]=s.getX(e),l[1]=s.getX(e+1),l[2]=s.getX(e+2)):(l[0]=e,l[1]=e+1,l[2]=e+2);const{a:t,b:r,c:a}=lu;if(t.fromBufferAttribute(o,l[0]),r.fromBufferAttribute(o,l[1]),a.fromBufferAttribute(o,l[2]),lu.getNormal(au),u[0]=`${Math.round(t.x*n)},${Math.round(t.y*n)},${Math.round(t.z*n)}`,u[1]=`${Math.round(r.x*n)},${Math.round(r.y*n)},${Math.round(r.z*n)}`,u[2]=`${Math.round(a.x*n)},${Math.round(a.y*n)},${Math.round(a.z*n)}`,u[0]!==u[1]&&u[1]!==u[2]&&u[2]!==u[0])for(let e=0;e<3;e++){const t=(e+1)%3,r=u[e],n=u[t],s=lu[c[e]],o=lu[c[t]],a=`${r}_${n}`,p=`${n}_${r}`;p in d&&d[p]?(au.dot(d[p].normal)<=i&&(h.push(s.x,s.y,s.z),h.push(o.x,o.y,o.z)),d[p]=null):a in d||(d[a]={index0:l[e],index1:l[t],normal:au.clone()})}}for(const e in d)if(d[e]){const{index0:t,index1:r}=d[e];su.fromBufferAttribute(o,t),ou.fromBufferAttribute(o,r),h.push(su.x,su.y,su.z),h.push(ou.x,ou.y,ou.z)}this.setAttribute("position",new Float32BufferAttribute(h,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}class Shape extends Path{constructor(e){super(e),this.uuid=Cn(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let r=0,n=this.holes.length;r<n;r++)t[r]=this.holes[r].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,r=e.holes.length;t<r;t++){const r=e.holes[t];this.holes.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,r=this.holes.length;t<r;t++){const r=this.holes[t];e.holes.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,r=e.holes.length;t<r;t++){const r=e.holes[t];this.holes.push((new Path).fromJSON(r))}return this}}const Earcut_triangulate=function(e,t,r=2){const n=t&&t.length,i=n?t[0]*r:e.length;let s=cu(e,0,i,r,!0);const o=[];if(!s||s.next===s.prev)return o;let a,l,c,u,d,h,p;if(n&&(s=function(e,t,r,n){const i=[];let s,o,a,l,c;for(s=0,o=t.length;s<o;s++)a=t[s]*n,l=s<o-1?t[s+1]*n:e.length,c=cu(e,a,l,n,!1),c===c.next&&(c.steiner=!0),i.push(_u(c));for(i.sort(gu),s=0;s<i.length;s++)r=yu(i[s],r);return r}(e,t,s,r)),e.length>80*r){a=c=e[0],l=u=e[1];for(let t=r;t<i;t+=r)d=e[t],h=e[t+1],d<a&&(a=d),h<l&&(l=h),d>c&&(c=d),h>u&&(u=h);p=Math.max(c-a,u-l),p=0!==p?32767/p:0}return du(s,o,r,a,l,p,0),o};function cu(e,t,r,n,i){let s,o;if(i===function(e,t,r,n){let i=0;for(let s=t,o=r-n;s<r;s+=n)i+=(e[o]-e[s])*(e[s+1]+e[o+1]),o=s;return i}(e,t,r,n)>0)for(s=t;s<r;s+=n)o=Du(s,e[s],e[s+1],o);else for(s=r-n;s>=t;s-=n)o=Du(s,e[s],e[s+1],o);return o&&Pu(o,o.next)&&(Ou(o),o=o.next),o}function uu(e,t){if(!e)return e;t||(t=e);let r,n=e;do{if(r=!1,n.steiner||!Pu(n,n.next)&&0!==Su(n.prev,n,n.next))n=n.next;else{if(Ou(n),n=t=n.prev,n===n.next)break;r=!0}}while(r||n!==t);return t}function du(e,t,r,n,i,s,o){if(!e)return;!o&&s&&function(e,t,r,n){let i=e;do{0===i.z&&(i.z=vu(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){let t,r,n,i,s,o,a,l,c=1;do{for(r=e,e=null,s=null,o=0;r;){for(o++,n=r,a=0,t=0;t<c&&(a++,n=n.nextZ,n);t++);for(l=c;a>0||l>0&&n;)0!==a&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,a--):(i=n,n=n.nextZ,l--),s?s.nextZ=i:e=i,i.prevZ=s,s=i;r=n}s.nextZ=null,c*=2}while(o>1)}(i)}(e,n,i,s);let a,l,c=e;for(;e.prev!==e.next;)if(a=e.prev,l=e.next,s?pu(e,n,i,s):hu(e))t.push(a.i/r|0),t.push(e.i/r|0),t.push(l.i/r|0),Ou(e),e=l.next,c=l.next;else if((e=l)===c){o?1===o?du(e=mu(uu(e),t,r),t,r,n,i,s,2):2===o&&fu(e,t,r,n,i,s):du(uu(e),t,r,n,i,s,1);break}}function hu(e){const t=e.prev,r=e,n=e.next;if(Su(t,r,n)>=0)return!1;const i=t.x,s=r.x,o=n.x,a=t.y,l=r.y,c=n.y,u=i<s?i<o?i:o:s<o?s:o,d=a<l?a<c?a:c:l<c?l:c,h=i>s?i>o?i:o:s>o?s:o,p=a>l?a>c?a:c:l>c?l:c;let m=n.next;for(;m!==t;){if(m.x>=u&&m.x<=h&&m.y>=d&&m.y<=p&&xu(i,a,s,l,o,c,m.x,m.y)&&Su(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function pu(e,t,r,n){const i=e.prev,s=e,o=e.next;if(Su(i,s,o)>=0)return!1;const a=i.x,l=s.x,c=o.x,u=i.y,d=s.y,h=o.y,p=a<l?a<c?a:c:l<c?l:c,m=u<d?u<h?u:h:d<h?d:h,f=a>l?a>c?a:c:l>c?l:c,g=u>d?u>h?u:h:d>h?d:h,y=vu(p,m,t,r,n),b=vu(f,g,t,r,n);let v=e.prevZ,_=e.nextZ;for(;v&&v.z>=y&&_&&_.z<=b;){if(v.x>=p&&v.x<=f&&v.y>=m&&v.y<=g&&v!==i&&v!==o&&xu(a,u,l,d,c,h,v.x,v.y)&&Su(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,_.x>=p&&_.x<=f&&_.y>=m&&_.y<=g&&_!==i&&_!==o&&xu(a,u,l,d,c,h,_.x,_.y)&&Su(_.prev,_,_.next)>=0)return!1;_=_.nextZ}for(;v&&v.z>=y;){if(v.x>=p&&v.x<=f&&v.y>=m&&v.y<=g&&v!==i&&v!==o&&xu(a,u,l,d,c,h,v.x,v.y)&&Su(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;_&&_.z<=b;){if(_.x>=p&&_.x<=f&&_.y>=m&&_.y<=g&&_!==i&&_!==o&&xu(a,u,l,d,c,h,_.x,_.y)&&Su(_.prev,_,_.next)>=0)return!1;_=_.nextZ}return!0}function mu(e,t,r){let n=e;do{const i=n.prev,s=n.next.next;!Pu(i,s)&&Eu(i,n,n.next,s)&&Au(i,s)&&Au(s,i)&&(t.push(i.i/r|0),t.push(n.i/r|0),t.push(s.i/r|0),Ou(n),Ou(n.next),n=e=s),n=n.next}while(n!==e);return uu(n)}function fu(e,t,r,n,i,s){let o=e;do{let e=o.next.next;for(;e!==o.prev;){if(o.i!==e.i&&wu(o,e)){let a=Tu(o,e);return o=uu(o,o.next),a=uu(a,a.next),du(o,t,r,n,i,s,0),void du(a,t,r,n,i,s,0)}e=e.next}o=o.next}while(o!==e)}function gu(e,t){return e.x-t.x}function yu(e,t){const r=function(e,t){let r,n=t,i=-1/0;const s=e.x,o=e.y;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){const e=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(e<=s&&e>i&&(i=e,r=n.x<n.next.x?n:n.next,e===s))return r}n=n.next}while(n!==t);if(!r)return null;const a=r,l=r.x,c=r.y;let u,d=1/0;n=r;do{s>=n.x&&n.x>=l&&s!==n.x&&xu(o<c?s:i,o,l,c,o<c?i:s,o,n.x,n.y)&&(u=Math.abs(o-n.y)/(s-n.x),Au(n,e)&&(u<d||u===d&&(n.x>r.x||n.x===r.x&&bu(r,n)))&&(r=n,d=u)),n=n.next}while(n!==a);return r}(e,t);if(!r)return t;const n=Tu(r,e);return uu(n,n.next),uu(r,r.next)}function bu(e,t){return Su(e.prev,e,t.prev)<0&&Su(t.next,e,e.next)<0}function vu(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function _u(e){let t=e,r=e;do{(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next}while(t!==e);return r}function xu(e,t,r,n,i,s,o,a){return(i-o)*(t-a)>=(e-o)*(s-a)&&(e-o)*(n-a)>=(r-o)*(t-a)&&(r-o)*(s-a)>=(i-o)*(n-a)}function wu(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&Eu(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(Au(e,t)&&Au(t,e)&&function(e,t){let r=e,n=!1;const i=(e.x+t.x)/2,s=(e.y+t.y)/2;do{r.y>s!=r.next.y>s&&r.next.y!==r.y&&i<(r.next.x-r.x)*(s-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}(e,t)&&(Su(e.prev,e,t.prev)||Su(e,t.prev,t))||Pu(e,t)&&Su(e.prev,e,e.next)>0&&Su(t.prev,t,t.next)>0)}function Su(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function Pu(e,t){return e.x===t.x&&e.y===t.y}function Eu(e,t,r,n){const i=Cu(Su(e,t,r)),s=Cu(Su(e,t,n)),o=Cu(Su(r,n,e)),a=Cu(Su(r,n,t));return i!==s&&o!==a||(!(0!==i||!Mu(e,r,t))||(!(0!==s||!Mu(e,n,t))||(!(0!==o||!Mu(r,e,n))||!(0!==a||!Mu(r,t,n)))))}function Mu(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function Cu(e){return e>0?1:e<0?-1:0}function Au(e,t){return Su(e.prev,e,e.next)<0?Su(e,t,e.next)>=0&&Su(e,e.prev,t)>=0:Su(e,t,e.prev)<0||Su(e,e.next,t)<0}function Tu(e,t){const r=new Node(e.i,e.x,e.y),n=new Node(t.i,t.x,t.y),i=e.next,s=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,s.next=n,n.prev=s,n}function Du(e,t,r,n){const i=new Node(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Ou(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Node(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}class ShapeUtils{static area(e){const t=e.length;let r=0;for(let n=t-1,i=0;i<t;n=i++)r+=e[n].x*e[i].y-e[i].x*e[n].y;return.5*r}static isClockWise(e){return ShapeUtils.area(e)<0}static triangulateShape(e,t){const r=[],n=[],i=[];Ru(e),Lu(r,e);let s=e.length;t.forEach(Ru);for(let e=0;e<t.length;e++)n.push(s),s+=t[e].length,Lu(r,t[e]);const o=Earcut_triangulate(r,n);for(let e=0;e<o.length;e+=3)i.push(o.slice(e,e+3));return i}}function Ru(e){const t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function Lu(e,t){for(let r=0;r<t.length;r++)e.push(t[r].x),e.push(t[r].y)}class ExtrudeGeometry extends BufferGeometry{constructor(e=new Shape([new Vector2(.5,.5),new Vector2(-.5,.5),new Vector2(-.5,-.5),new Vector2(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const r=this,n=[],i=[];for(let t=0,r=e.length;t<r;t++){s(e[t])}function s(e){const s=[],o=void 0!==t.curveSegments?t.curveSegments:12,a=void 0!==t.steps?t.steps:1,l=void 0!==t.depth?t.depth:1;let c=void 0===t.bevelEnabled||t.bevelEnabled,u=void 0!==t.bevelThickness?t.bevelThickness:.2,d=void 0!==t.bevelSize?t.bevelSize:u-.1,h=void 0!==t.bevelOffset?t.bevelOffset:0,p=void 0!==t.bevelSegments?t.bevelSegments:3;const m=t.extrudePath,f=void 0!==t.UVGenerator?t.UVGenerator:ku;let g,y,b,v,_,x=!1;m&&(g=m.getSpacedPoints(a),x=!0,c=!1,y=m.computeFrenetFrames(a,!1),b=new Vector3,v=new Vector3,_=new Vector3),c||(p=0,u=0,d=0,h=0);const w=e.extractPoints(o);let R=w.shape;const k=w.holes;if(!ShapeUtils.isClockWise(R)){R=R.reverse();for(let e=0,t=k.length;e<t;e++){const t=k[e];ShapeUtils.isClockWise(t)&&(k[e]=t.reverse())}}const j=ShapeUtils.triangulateShape(R,k),z=R;for(let e=0,t=k.length;e<t;e++){const t=k[e];R=R.concat(t)}function q(e,t,r){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().addScaledVector(t,r)}const $=R.length,Z=j.length;function X(e,t,r){let n,i,s;const o=e.x-t.x,a=e.y-t.y,l=r.x-e.x,c=r.y-e.y,u=o*o+a*a,d=o*c-a*l;if(Math.abs(d)>Number.EPSILON){const d=Math.sqrt(u),h=Math.sqrt(l*l+c*c),p=t.x-a/d,m=t.y+o/d,f=((r.x-c/h-p)*c-(r.y+l/h-m)*l)/(o*c-a*l);n=p+o*f-e.x,i=m+a*f-e.y;const g=n*n+i*i;if(g<=2)return new Vector2(n,i);s=Math.sqrt(g/2)}else{let e=!1;o>Number.EPSILON?l>Number.EPSILON&&(e=!0):o<-Number.EPSILON?l<-Number.EPSILON&&(e=!0):Math.sign(a)===Math.sign(c)&&(e=!0),e?(n=-a,i=o,s=Math.sqrt(u)):(n=o,i=a,s=Math.sqrt(u/2))}return new Vector2(n/s,i/s)}const Y=[];for(let e=0,t=z.length,r=t-1,n=e+1;e<t;e++,r++,n++)r===t&&(r=0),n===t&&(n=0),Y[e]=X(z[e],z[r],z[n]);const ee=[];let te,re=Y.concat();for(let e=0,t=k.length;e<t;e++){const t=k[e];te=[];for(let e=0,r=t.length,n=r-1,i=e+1;e<r;e++,n++,i++)n===r&&(n=0),i===r&&(i=0),te[e]=X(t[e],t[n],t[i]);ee.push(te),re=re.concat(te)}for(let e=0;e<p;e++){const t=e/p,r=u*Math.cos(t*Math.PI/2),n=d*Math.sin(t*Math.PI/2)+h;for(let e=0,t=z.length;e<t;e++){const t=q(z[e],Y[e],n);se(t.x,t.y,-r)}for(let e=0,t=k.length;e<t;e++){const t=k[e];te=ee[e];for(let e=0,i=t.length;e<i;e++){const i=q(t[e],te[e],n);se(i.x,i.y,-r)}}}const ne=d+h;for(let e=0;e<$;e++){const t=c?q(R[e],re[e],ne):R[e];x?(v.copy(y.normals[0]).multiplyScalar(t.x),b.copy(y.binormals[0]).multiplyScalar(t.y),_.copy(g[0]).add(v).add(b),se(_.x,_.y,_.z)):se(t.x,t.y,0)}for(let e=1;e<=a;e++)for(let t=0;t<$;t++){const r=c?q(R[t],re[t],ne):R[t];x?(v.copy(y.normals[e]).multiplyScalar(r.x),b.copy(y.binormals[e]).multiplyScalar(r.y),_.copy(g[e]).add(v).add(b),se(_.x,_.y,_.z)):se(r.x,r.y,l/a*e)}for(let e=p-1;e>=0;e--){const t=e/p,r=u*Math.cos(t*Math.PI/2),n=d*Math.sin(t*Math.PI/2)+h;for(let e=0,t=z.length;e<t;e++){const t=q(z[e],Y[e],n);se(t.x,t.y,l+r)}for(let e=0,t=k.length;e<t;e++){const t=k[e];te=ee[e];for(let e=0,i=t.length;e<i;e++){const i=q(t[e],te[e],n);x?se(i.x,i.y+g[a-1].y,g[a-1].x+r):se(i.x,i.y,l+r)}}}function ie(e,t){let r=e.length;for(;--r>=0;){const n=r;let i=r-1;i<0&&(i=e.length-1);for(let e=0,r=a+2*p;e<r;e++){const r=$*e,s=$*(e+1);ae(t+n+r,t+i+r,t+i+s,t+n+s)}}}function se(e,t,r){s.push(e),s.push(t),s.push(r)}function oe(e,t,i){le(e),le(t),le(i);const s=n.length/3,o=f.generateTopUV(r,n,s-3,s-2,s-1);ce(o[0]),ce(o[1]),ce(o[2])}function ae(e,t,i,s){le(e),le(t),le(s),le(t),le(i),le(s);const o=n.length/3,a=f.generateSideWallUV(r,n,o-6,o-3,o-2,o-1);ce(a[0]),ce(a[1]),ce(a[3]),ce(a[1]),ce(a[2]),ce(a[3])}function le(e){n.push(s[3*e+0]),n.push(s[3*e+1]),n.push(s[3*e+2])}function ce(e){i.push(e.x),i.push(e.y)}!function(){const e=n.length/3;if(c){let e=0,t=$*e;for(let e=0;e<Z;e++){const r=j[e];oe(r[2]+t,r[1]+t,r[0]+t)}e=a+2*p,t=$*e;for(let e=0;e<Z;e++){const r=j[e];oe(r[0]+t,r[1]+t,r[2]+t)}}else{for(let e=0;e<Z;e++){const t=j[e];oe(t[2],t[1],t[0])}for(let e=0;e<Z;e++){const t=j[e];oe(t[0]+$*a,t[1]+$*a,t[2]+$*a)}}r.addGroup(e,n.length/3-e,0)}(),function(){const e=n.length/3;let t=0;ie(z,t),t+=z.length;for(let e=0,r=k.length;e<r;e++){const r=k[e];ie(r,t),t+=r.length}r.addGroup(e,n.length/3-e,1)}()}this.setAttribute("position",new Float32BufferAttribute(n,3)),this.setAttribute("uv",new Float32BufferAttribute(i,2)),this.computeVertexNormals()}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return function(e,t,r){if(r.shapes=[],Array.isArray(e))for(let t=0,n=e.length;t<n;t++){const n=e[t];r.shapes.push(n.uuid)}else r.shapes.push(e.uuid);r.options=Object.assign({},t),void 0!==t.extrudePath&&(r.options.extrudePath=t.extrudePath.toJSON());return r}(this.parameters.shapes,this.parameters.options,e)}static fromJSON(e,t){const r=[];for(let n=0,i=e.shapes.length;n<i;n++){const i=t[e.shapes[n]];r.push(i)}const n=e.options.extrudePath;return void 0!==n&&(e.options.extrudePath=(new iu[n.type]).fromJSON(n)),new ExtrudeGeometry(r,e.options)}}const ku={generateTopUV:function(e,t,r,n,i){const s=t[3*r],o=t[3*r+1],a=t[3*n],l=t[3*n+1],c=t[3*i],u=t[3*i+1];return[new Vector2(s,o),new Vector2(a,l),new Vector2(c,u)]},generateSideWallUV:function(e,t,r,n,i,s){const o=t[3*r],a=t[3*r+1],l=t[3*r+2],c=t[3*n],u=t[3*n+1],d=t[3*n+2],h=t[3*i],p=t[3*i+1],m=t[3*i+2],f=t[3*s],g=t[3*s+1],y=t[3*s+2];return Math.abs(a-u)<Math.abs(o-c)?[new Vector2(o,1-l),new Vector2(c,1-d),new Vector2(h,1-m),new Vector2(f,1-y)]:[new Vector2(a,1-l),new Vector2(u,1-d),new Vector2(p,1-m),new Vector2(g,1-y)]}};class IcosahedronGeometry extends PolyhedronGeometry{constructor(e=1,t=0){const r=(1+Math.sqrt(5))/2;super([-1,r,0,1,r,0,-1,-r,0,1,-r,0,0,-1,r,0,1,r,0,-1,-r,0,1,-r,r,0,-1,r,0,1,-r,0,-1,-r,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new IcosahedronGeometry(e.radius,e.detail)}}class OctahedronGeometry extends PolyhedronGeometry{constructor(e=1,t=0){super([1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new OctahedronGeometry(e.radius,e.detail)}}class RingGeometry extends BufferGeometry{constructor(e=.5,t=1,r=32,n=1,i=0,s=2*Math.PI){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:r,phiSegments:n,thetaStart:i,thetaLength:s},r=Math.max(3,r);const o=[],a=[],l=[],c=[];let u=e;const d=(t-e)/(n=Math.max(1,n)),h=new Vector3,p=new Vector2;for(let e=0;e<=n;e++){for(let e=0;e<=r;e++){const n=i+e/r*s;h.x=u*Math.cos(n),h.y=u*Math.sin(n),a.push(h.x,h.y,h.z),l.push(0,0,1),p.x=(h.x/t+1)/2,p.y=(h.y/t+1)/2,c.push(p.x,p.y)}u+=d}for(let e=0;e<n;e++){const t=e*(r+1);for(let e=0;e<r;e++){const n=e+t,i=n,s=n+r+1,a=n+r+2,l=n+1;o.push(i,s,l),o.push(s,a,l)}}this.setIndex(o),this.setAttribute("position",new Float32BufferAttribute(a,3)),this.setAttribute("normal",new Float32BufferAttribute(l,3)),this.setAttribute("uv",new Float32BufferAttribute(c,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new RingGeometry(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class ShapeGeometry extends BufferGeometry{constructor(e=new Shape([new Vector2(0,.5),new Vector2(-.5,-.5),new Vector2(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const r=[],n=[],i=[],s=[];let o=0,a=0;if(!1===Array.isArray(e))l(e);else for(let t=0;t<e.length;t++)l(e[t]),this.addGroup(o,a,t),o+=a,a=0;function l(e){const o=n.length/3,l=e.extractPoints(t);let c=l.shape;const u=l.holes;!1===ShapeUtils.isClockWise(c)&&(c=c.reverse());for(let e=0,t=u.length;e<t;e++){const t=u[e];!0===ShapeUtils.isClockWise(t)&&(u[e]=t.reverse())}const d=ShapeUtils.triangulateShape(c,u);for(let e=0,t=u.length;e<t;e++){const t=u[e];c=c.concat(t)}for(let e=0,t=c.length;e<t;e++){const t=c[e];n.push(t.x,t.y,0),i.push(0,0,1),s.push(t.x,t.y)}for(let e=0,t=d.length;e<t;e++){const t=d[e],n=t[0]+o,i=t[1]+o,s=t[2]+o;r.push(n,i,s),a+=3}}this.setIndex(r),this.setAttribute("position",new Float32BufferAttribute(n,3)),this.setAttribute("normal",new Float32BufferAttribute(i,3)),this.setAttribute("uv",new Float32BufferAttribute(s,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return function(e,t){if(t.shapes=[],Array.isArray(e))for(let r=0,n=e.length;r<n;r++){const n=e[r];t.shapes.push(n.uuid)}else t.shapes.push(e.uuid);return t}(this.parameters.shapes,e)}static fromJSON(e,t){const r=[];for(let n=0,i=e.shapes.length;n<i;n++){const i=t[e.shapes[n]];r.push(i)}return new ShapeGeometry(r,e.curveSegments)}}class SphereGeometry extends BufferGeometry{constructor(e=1,t=32,r=16,n=0,i=2*Math.PI,s=0,o=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:r,phiStart:n,phiLength:i,thetaStart:s,thetaLength:o},t=Math.max(3,Math.floor(t)),r=Math.max(2,Math.floor(r));const a=Math.min(s+o,Math.PI);let l=0;const c=[],u=new Vector3,d=new Vector3,h=[],p=[],m=[],f=[];for(let h=0;h<=r;h++){const g=[],y=h/r;let b=0;0===h&&0===s?b=.5/t:h===r&&a===Math.PI&&(b=-.5/t);for(let r=0;r<=t;r++){const a=r/t;u.x=-e*Math.cos(n+a*i)*Math.sin(s+y*o),u.y=e*Math.cos(s+y*o),u.z=e*Math.sin(n+a*i)*Math.sin(s+y*o),p.push(u.x,u.y,u.z),d.copy(u).normalize(),m.push(d.x,d.y,d.z),f.push(a+b,1-y),g.push(l++)}c.push(g)}for(let e=0;e<r;e++)for(let n=0;n<t;n++){const t=c[e][n+1],i=c[e][n],o=c[e+1][n],l=c[e+1][n+1];(0!==e||s>0)&&h.push(t,i,l),(e!==r-1||a<Math.PI)&&h.push(i,o,l)}this.setIndex(h),this.setAttribute("position",new Float32BufferAttribute(p,3)),this.setAttribute("normal",new Float32BufferAttribute(m,3)),this.setAttribute("uv",new Float32BufferAttribute(f,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new SphereGeometry(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class TetrahedronGeometry extends PolyhedronGeometry{constructor(e=1,t=0){super([1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new TetrahedronGeometry(e.radius,e.detail)}}class TorusGeometry extends BufferGeometry{constructor(e=1,t=.4,r=12,n=48,i=2*Math.PI){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:r,tubularSegments:n,arc:i},r=Math.floor(r),n=Math.floor(n);const s=[],o=[],a=[],l=[],c=new Vector3,u=new Vector3,d=new Vector3;for(let s=0;s<=r;s++)for(let h=0;h<=n;h++){const p=h/n*i,m=s/r*Math.PI*2;u.x=(e+t*Math.cos(m))*Math.cos(p),u.y=(e+t*Math.cos(m))*Math.sin(p),u.z=t*Math.sin(m),o.push(u.x,u.y,u.z),c.x=e*Math.cos(p),c.y=e*Math.sin(p),d.subVectors(u,c).normalize(),a.push(d.x,d.y,d.z),l.push(h/n),l.push(s/r)}for(let e=1;e<=r;e++)for(let t=1;t<=n;t++){const r=(n+1)*e+t-1,i=(n+1)*(e-1)+t-1,o=(n+1)*(e-1)+t,a=(n+1)*e+t;s.push(r,i,a),s.push(i,o,a)}this.setIndex(s),this.setAttribute("position",new Float32BufferAttribute(o,3)),this.setAttribute("normal",new Float32BufferAttribute(a,3)),this.setAttribute("uv",new Float32BufferAttribute(l,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new TorusGeometry(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class TorusKnotGeometry extends BufferGeometry{constructor(e=1,t=.4,r=64,n=8,i=2,s=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:r,radialSegments:n,p:i,q:s},r=Math.floor(r),n=Math.floor(n);const o=[],a=[],l=[],c=[],u=new Vector3,d=new Vector3,h=new Vector3,p=new Vector3,m=new Vector3,f=new Vector3,g=new Vector3;for(let o=0;o<=r;++o){const b=o/r*i*Math.PI*2;y(b,i,s,e,h),y(b+.01,i,s,e,p),f.subVectors(p,h),g.addVectors(p,h),m.crossVectors(f,g),g.crossVectors(m,f),m.normalize(),g.normalize();for(let e=0;e<=n;++e){const i=e/n*Math.PI*2,s=-t*Math.cos(i),p=t*Math.sin(i);u.x=h.x+(s*g.x+p*m.x),u.y=h.y+(s*g.y+p*m.y),u.z=h.z+(s*g.z+p*m.z),a.push(u.x,u.y,u.z),d.subVectors(u,h).normalize(),l.push(d.x,d.y,d.z),c.push(o/r),c.push(e/n)}}for(let e=1;e<=r;e++)for(let t=1;t<=n;t++){const r=(n+1)*(e-1)+(t-1),i=(n+1)*e+(t-1),s=(n+1)*e+t,a=(n+1)*(e-1)+t;o.push(r,i,a),o.push(i,s,a)}function y(e,t,r,n,i){const s=Math.cos(e),o=Math.sin(e),a=r/t*e,l=Math.cos(a);i.x=n*(2+l)*.5*s,i.y=n*(2+l)*o*.5,i.z=n*Math.sin(a)*.5}this.setIndex(o),this.setAttribute("position",new Float32BufferAttribute(a,3)),this.setAttribute("normal",new Float32BufferAttribute(l,3)),this.setAttribute("uv",new Float32BufferAttribute(c,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new TorusKnotGeometry(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class TubeGeometry extends BufferGeometry{constructor(e=new QuadraticBezierCurve3(new Vector3(-1,-1,0),new Vector3(-1,1,0),new Vector3(1,1,0)),t=64,r=1,n=8,i=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:r,radialSegments:n,closed:i};const s=e.computeFrenetFrames(t,i);this.tangents=s.tangents,this.normals=s.normals,this.binormals=s.binormals;const o=new Vector3,a=new Vector3,l=new Vector2;let c=new Vector3;const u=[],d=[],h=[],p=[];function m(i){c=e.getPointAt(i/t,c);const l=s.normals[i],h=s.binormals[i];for(let e=0;e<=n;e++){const t=e/n*Math.PI*2,i=Math.sin(t),s=-Math.cos(t);a.x=s*l.x+i*h.x,a.y=s*l.y+i*h.y,a.z=s*l.z+i*h.z,a.normalize(),d.push(a.x,a.y,a.z),o.x=c.x+r*a.x,o.y=c.y+r*a.y,o.z=c.z+r*a.z,u.push(o.x,o.y,o.z)}}!function(){for(let e=0;e<t;e++)m(e);m(!1===i?t:0),function(){for(let e=0;e<=t;e++)for(let r=0;r<=n;r++)l.x=e/t,l.y=r/n,h.push(l.x,l.y)}(),function(){for(let e=1;e<=t;e++)for(let t=1;t<=n;t++){const r=(n+1)*(e-1)+(t-1),i=(n+1)*e+(t-1),s=(n+1)*e+t,o=(n+1)*(e-1)+t;p.push(r,i,o),p.push(i,s,o)}}()}(),this.setIndex(p),this.setAttribute("position",new Float32BufferAttribute(u,3)),this.setAttribute("normal",new Float32BufferAttribute(d,3)),this.setAttribute("uv",new Float32BufferAttribute(h,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new TubeGeometry((new iu[e.path.type]).fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class WireframeGeometry extends BufferGeometry{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},null!==e){const t=[],r=new Set,n=new Vector3,i=new Vector3;if(null!==e.index){const s=e.attributes.position,o=e.index;let a=e.groups;0===a.length&&(a=[{start:0,count:o.count,materialIndex:0}]);for(let e=0,l=a.length;e<l;++e){const l=a[e],c=l.start;for(let e=c,a=c+l.count;e<a;e+=3)for(let a=0;a<3;a++){const l=o.getX(e+a),c=o.getX(e+(a+1)%3);n.fromBufferAttribute(s,l),i.fromBufferAttribute(s,c),!0===Nu(n,i,r)&&(t.push(n.x,n.y,n.z),t.push(i.x,i.y,i.z))}}}else{const s=e.attributes.position;for(let e=0,o=s.count/3;e<o;e++)for(let o=0;o<3;o++){const a=3*e+o,l=3*e+(o+1)%3;n.fromBufferAttribute(s,a),i.fromBufferAttribute(s,l),!0===Nu(n,i,r)&&(t.push(n.x,n.y,n.z),t.push(i.x,i.y,i.z))}}this.setAttribute("position",new Float32BufferAttribute(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function Nu(e,t,r){const n=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`,i=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`;return!0!==r.has(n)&&!0!==r.has(i)&&(r.add(n),r.add(i),!0)}var Fu=Object.freeze({__proto__:null,BoxGeometry,CapsuleGeometry,CircleGeometry,ConeGeometry,CylinderGeometry,DodecahedronGeometry,EdgesGeometry,ExtrudeGeometry,IcosahedronGeometry,LatheGeometry,OctahedronGeometry,PlaneGeometry,PolyhedronGeometry,RingGeometry,ShapeGeometry,SphereGeometry,TetrahedronGeometry,TorusGeometry,TorusKnotGeometry,TubeGeometry,WireframeGeometry});class ShadowMaterial extends Material{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new Color(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}}class RawShaderMaterial extends ShaderMaterial{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class MeshStandardMaterial extends Material{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Color(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Cr,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Euler,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class MeshPhysicalMaterial extends MeshStandardMaterial{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Vector2(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return An(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(e){this.ior=(1+.4*e)/(1-.4*e)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Color(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new Color(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Color(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class MeshPhongMaterial extends Material{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Color(16777215),this.specular=new Color(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Cr,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Euler,this.combine=ve,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class MeshToonMaterial extends Material{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Color(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Cr,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class MeshNormalMaterial extends Material{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Cr,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class MeshLambertMaterial extends Material{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Color(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Cr,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Euler,this.combine=ve,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class MeshMatcapMaterial extends Material{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Color(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Cr,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class LineDashedMaterial extends LineBasicMaterial{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function Iu(e,t,r){return!e||!r&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)}function Bu(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function ju(e){const t=e.length,r=new Array(t);for(let e=0;e!==t;++e)r[e]=e;return r.sort((function(t,r){return e[t]-e[r]})),r}function Hu(e,t,r){const n=e.length,i=new e.constructor(n);for(let s=0,o=0;o!==n;++s){const n=r[s]*t;for(let r=0;r!==t;++r)i[o++]=e[n+r]}return i}function Uu(e,t,r,n){let i=1,s=e[0];for(;void 0!==s&&void 0===s[n];)s=e[i++];if(void 0===s)return;let o=s[n];if(void 0!==o)if(Array.isArray(o))do{o=s[n],void 0!==o&&(t.push(s.time),r.push.apply(r,o)),s=e[i++]}while(void 0!==s);else if(void 0!==o.toArray)do{o=s[n],void 0!==o&&(t.push(s.time),o.toArray(r,r.length)),s=e[i++]}while(void 0!==s);else do{o=s[n],void 0!==o&&(t.push(s.time),r.push(o)),s=e[i++]}while(void 0!==s)}const zu={convertArray:Iu,isTypedArray:Bu,getKeyframeOrder:ju,sortedArray:Hu,flattenJSON:Uu,subclip:function(e,t,r,n,i=30){const s=e.clone();s.name=t;const o=[];for(let e=0;e<s.tracks.length;++e){const t=s.tracks[e],a=t.getValueSize(),l=[],c=[];for(let e=0;e<t.times.length;++e){const s=t.times[e]*i;if(!(s<r||s>=n)){l.push(t.times[e]);for(let r=0;r<a;++r)c.push(t.values[e*a+r])}}0!==l.length&&(t.times=Iu(l,t.times.constructor),t.values=Iu(c,t.values.constructor),o.push(t))}s.tracks=o;let a=1/0;for(let e=0;e<s.tracks.length;++e)a>s.tracks[e].times[0]&&(a=s.tracks[e].times[0]);for(let e=0;e<s.tracks.length;++e)s.tracks[e].shift(-1*a);return s.resetDuration(),s},makeClipAdditive:function(e,t=0,r=e,n=30){n<=0&&(n=30);const i=r.tracks.length,s=t/n;for(let t=0;t<i;++t){const n=r.tracks[t],i=n.ValueTypeName;if("bool"===i||"string"===i)continue;const o=e.tracks.find((function(e){return e.name===n.name&&e.ValueTypeName===i}));if(void 0===o)continue;let a=0;const l=n.getValueSize();n.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(a=l/3);let c=0;const u=o.getValueSize();o.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(c=u/3);const d=n.times.length-1;let h;if(s<=n.times[0]){const e=a,t=l-a;h=n.values.slice(e,t)}else if(s>=n.times[d]){const e=d*l+a,t=e+l-a;h=n.values.slice(e,t)}else{const e=n.createInterpolant(),t=a,r=l-a;e.evaluate(s),h=e.resultBuffer.slice(t,r)}if("quaternion"===i){(new Quaternion).fromArray(h).normalize().conjugate().toArray(h)}const p=o.times.length;for(let e=0;e<p;++e){const t=e*u+c;if("quaternion"===i)Quaternion.multiplyQuaternionsFlat(o.values,t,h,0,o.values,t);else{const e=u-2*c;for(let r=0;r<e;++r)o.values[t+r]-=h[r]}}}return e.blendMode=xr,e}};class Interpolant{constructor(e,t,r,n){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==n?n:new t.constructor(r),this.sampleValues=t,this.valueSize=r,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let r=this._cachedIndex,n=t[r],i=t[r-1];e:{t:{let s;r:{n:if(!(e<n)){for(let s=r+2;;){if(void 0===n){if(e<i)break n;return r=t.length,this._cachedIndex=r,this.copySampleValue_(r-1)}if(r===s)break;if(i=n,n=t[++r],e<n)break t}s=t.length;break r}if(e>=i)break e;{const o=t[1];e<o&&(r=2,i=o);for(let s=r-2;;){if(void 0===i)return this._cachedIndex=0,this.copySampleValue_(0);if(r===s)break;if(n=i,i=t[--r-1],e>=i)break t}s=r,r=0}}for(;r<s;){const n=r+s>>>1;e<t[n]?s=n:r=n+1}if(n=t[r],i=t[r-1],void 0===i)return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===n)return r=t.length,this._cachedIndex=r,this.copySampleValue_(r-1)}this._cachedIndex=r,this.intervalChanged_(r,i,n)}return this.interpolate_(r,i,e,n)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,r=this.sampleValues,n=this.valueSize,i=e*n;for(let e=0;e!==n;++e)t[e]=r[i+e];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class CubicInterpolant extends Interpolant{constructor(e,t,r,n){super(e,t,r,n),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:yr,endingEnd:yr}}intervalChanged_(e,t,r){const n=this.parameterPositions;let i=e-2,s=e+1,o=n[i],a=n[s];if(void 0===o)switch(this.getSettings_().endingStart){case br:i=e,o=2*t-r;break;case vr:i=n.length-2,o=t+n[i]-n[i+1];break;default:i=e,o=r}if(void 0===a)switch(this.getSettings_().endingEnd){case br:s=e,a=2*r-t;break;case vr:s=1,a=r+n[1]-n[0];break;default:s=e-1,a=t}const l=.5*(r-t),c=this.valueSize;this._weightPrev=l/(t-o),this._weightNext=l/(a-r),this._offsetPrev=i*c,this._offsetNext=s*c}interpolate_(e,t,r,n){const i=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=e*o,l=a-o,c=this._offsetPrev,u=this._offsetNext,d=this._weightPrev,h=this._weightNext,p=(r-t)/(n-t),m=p*p,f=m*p,g=-d*f+2*d*m-d*p,y=(1+d)*f+(-1.5-2*d)*m+(-.5+d)*p+1,b=(-1-h)*f+(1.5+h)*m+.5*p,v=h*f-h*m;for(let e=0;e!==o;++e)i[e]=g*s[c+e]+y*s[l+e]+b*s[a+e]+v*s[u+e];return i}}class LinearInterpolant extends Interpolant{constructor(e,t,r,n){super(e,t,r,n)}interpolate_(e,t,r,n){const i=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=e*o,l=a-o,c=(r-t)/(n-t),u=1-c;for(let e=0;e!==o;++e)i[e]=s[l+e]*u+s[a+e]*c;return i}}class DiscreteInterpolant extends Interpolant{constructor(e,t,r,n){super(e,t,r,n)}interpolate_(e){return this.copySampleValue_(e-1)}}class KeyframeTrack{constructor(e,t,r,n){if(void 0===e)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Iu(t,this.TimeBufferType),this.values=Iu(r,this.ValueBufferType),this.setInterpolation(n||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let r;if(t.toJSON!==this.toJSON)r=t.toJSON(e);else{r={name:e.name,times:Iu(e.times,Array),values:Iu(e.values,Array)};const t=e.getInterpolation();t!==e.DefaultInterpolation&&(r.interpolation=t)}return r.type=e.ValueTypeName,r}InterpolantFactoryMethodDiscrete(e){return new DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new LinearInterpolant(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new CubicInterpolant(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case mr:t=this.InterpolantFactoryMethodDiscrete;break;case fr:t=this.InterpolantFactoryMethodLinear;break;case gr:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){const t="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(t);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",t),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return mr;case this.InterpolantFactoryMethodLinear:return fr;case this.InterpolantFactoryMethodSmooth:return gr}}getValueSize(){return this.values.length/this.times.length}shift(e){if(0!==e){const t=this.times;for(let r=0,n=t.length;r!==n;++r)t[r]+=e}return this}scale(e){if(1!==e){const t=this.times;for(let r=0,n=t.length;r!==n;++r)t[r]*=e}return this}trim(e,t){const r=this.times,n=r.length;let i=0,s=n-1;for(;i!==n&&r[i]<e;)++i;for(;-1!==s&&r[s]>t;)--s;if(++s,0!==i||s!==n){i>=s&&(s=Math.max(s,1),i=s-1);const e=this.getValueSize();this.times=r.slice(i,s),this.values=this.values.slice(i*e,s*e)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const r=this.times,n=this.values,i=r.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let s=null;for(let t=0;t!==i;t++){const n=r[t];if("number"==typeof n&&isNaN(n)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,t,n),e=!1;break}if(null!==s&&s>n){console.error("THREE.KeyframeTrack: Out of order keys.",this,t,n,s),e=!1;break}s=n}if(void 0!==n&&Bu(n))for(let t=0,r=n.length;t!==r;++t){const r=n[t];if(isNaN(r)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,t,r),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),r=this.getValueSize(),n=this.getInterpolation()===gr,i=e.length-1;let s=1;for(let o=1;o<i;++o){let i=!1;const a=e[o];if(a!==e[o+1]&&(1!==o||a!==e[0]))if(n)i=!0;else{const e=o*r,n=e-r,s=e+r;for(let o=0;o!==r;++o){const r=t[e+o];if(r!==t[n+o]||r!==t[s+o]){i=!0;break}}}if(i){if(o!==s){e[s]=e[o];const n=o*r,i=s*r;for(let e=0;e!==r;++e)t[i+e]=t[n+e]}++s}}if(i>0){e[s]=e[i];for(let e=i*r,n=s*r,o=0;o!==r;++o)t[n+o]=t[e+o];++s}return s!==e.length?(this.times=e.slice(0,s),this.values=t.slice(0,s*r)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),r=new(0,this.constructor)(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}KeyframeTrack.prototype.TimeBufferType=Float32Array,KeyframeTrack.prototype.ValueBufferType=Float32Array,KeyframeTrack.prototype.DefaultInterpolation=fr;class BooleanKeyframeTrack extends KeyframeTrack{}BooleanKeyframeTrack.prototype.ValueTypeName="bool",BooleanKeyframeTrack.prototype.ValueBufferType=Array,BooleanKeyframeTrack.prototype.DefaultInterpolation=mr,BooleanKeyframeTrack.prototype.InterpolantFactoryMethodLinear=void 0,BooleanKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class ColorKeyframeTrack extends KeyframeTrack{}ColorKeyframeTrack.prototype.ValueTypeName="color";class NumberKeyframeTrack extends KeyframeTrack{}NumberKeyframeTrack.prototype.ValueTypeName="number";class QuaternionLinearInterpolant extends Interpolant{constructor(e,t,r,n){super(e,t,r,n)}interpolate_(e,t,r,n){const i=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=(r-t)/(n-t);let l=e*o;for(let e=l+o;l!==e;l+=4)Quaternion.slerpFlat(i,0,s,l-o,s,l,a);return i}}class QuaternionKeyframeTrack extends KeyframeTrack{InterpolantFactoryMethodLinear(e){return new QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)}}QuaternionKeyframeTrack.prototype.ValueTypeName="quaternion",QuaternionKeyframeTrack.prototype.DefaultInterpolation=fr,QuaternionKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class StringKeyframeTrack extends KeyframeTrack{}StringKeyframeTrack.prototype.ValueTypeName="string",StringKeyframeTrack.prototype.ValueBufferType=Array,StringKeyframeTrack.prototype.DefaultInterpolation=mr,StringKeyframeTrack.prototype.InterpolantFactoryMethodLinear=void 0,StringKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class VectorKeyframeTrack extends KeyframeTrack{}VectorKeyframeTrack.prototype.ValueTypeName="vector";class AnimationClip{constructor(e,t=-1,r,n=_r){this.name=e,this.tracks=r,this.duration=t,this.blendMode=n,this.uuid=Cn(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],r=e.tracks,n=1/(e.fps||1);for(let e=0,i=r.length;e!==i;++e)t.push(Gu(r[e]).scale(n));const i=new this(e.name,e.duration,t,e.blendMode);return i.uuid=e.uuid,i}static toJSON(e){const t=[],r=e.tracks,n={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let e=0,n=r.length;e!==n;++e)t.push(KeyframeTrack.toJSON(r[e]));return n}static CreateFromMorphTargetSequence(e,t,r,n){const i=t.length,s=[];for(let e=0;e<i;e++){let o=[],a=[];o.push((e+i-1)%i,e,(e+1)%i),a.push(0,1,0);const l=ju(o);o=Hu(o,1,l),a=Hu(a,1,l),n||0!==o[0]||(o.push(i),a.push(a[0])),s.push(new NumberKeyframeTrack(".morphTargetInfluences["+t[e].name+"]",o,a).scale(1/r))}return new this(e,-1,s)}static findByName(e,t){let r=e;if(!Array.isArray(e)){const t=e;r=t.geometry&&t.geometry.animations||t.animations}for(let e=0;e<r.length;e++)if(r[e].name===t)return r[e];return null}static CreateClipsFromMorphTargetSequences(e,t,r){const n={},i=/^([\w-]*?)([\d]+)$/;for(let t=0,r=e.length;t<r;t++){const r=e[t],s=r.name.match(i);if(s&&s.length>1){const e=s[1];let t=n[e];t||(n[e]=t=[]),t.push(r)}}const s=[];for(const e in n)s.push(this.CreateFromMorphTargetSequence(e,n[e],t,r));return s}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const r=function(e,t,r,n,i){if(0!==r.length){const s=[],o=[];Uu(r,s,o,n),0!==s.length&&i.push(new e(t,s,o))}},n=[],i=e.name||"default",s=e.fps||30,o=e.blendMode;let a=e.length||-1;const l=e.hierarchy||[];for(let e=0;e<l.length;e++){const i=l[e].keys;if(i&&0!==i.length)if(i[0].morphTargets){const e={};let t;for(t=0;t<i.length;t++)if(i[t].morphTargets)for(let r=0;r<i[t].morphTargets.length;r++)e[i[t].morphTargets[r]]=-1;for(const r in e){const e=[],s=[];for(let n=0;n!==i[t].morphTargets.length;++n){const n=i[t];e.push(n.time),s.push(n.morphTarget===r?1:0)}n.push(new NumberKeyframeTrack(".morphTargetInfluence["+r+"]",e,s))}a=e.length*s}else{const s=".bones["+t[e].name+"]";r(VectorKeyframeTrack,s+".position",i,"pos",n),r(QuaternionKeyframeTrack,s+".quaternion",i,"rot",n),r(VectorKeyframeTrack,s+".scale",i,"scl",n)}}if(0===n.length)return null;return new this(i,a,n,o)}resetDuration(){let e=0;for(let t=0,r=this.tracks.length;t!==r;++t){const r=this.tracks[t];e=Math.max(e,r.times[r.times.length-1])}return this.duration=e,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function Gu(e){if(void 0===e.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const t=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return NumberKeyframeTrack;case"vector":case"vector2":case"vector3":case"vector4":return VectorKeyframeTrack;case"color":return ColorKeyframeTrack;case"quaternion":return QuaternionKeyframeTrack;case"bool":case"boolean":return BooleanKeyframeTrack;case"string":return StringKeyframeTrack}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(e.type);if(void 0===e.times){const t=[],r=[];Uu(e.keys,t,r,"value"),e.times=t,e.values=r}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)}const Wu={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};class LoadingManager{constructor(e,t,r){const n=this;let i,s=!1,o=0,a=0;const l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=r,this.itemStart=function(e){a++,!1===s&&void 0!==n.onStart&&n.onStart(e,o,a),s=!0},this.itemEnd=function(e){o++,void 0!==n.onProgress&&n.onProgress(e,o,a),o===a&&(s=!1,void 0!==n.onLoad&&n.onLoad())},this.itemError=function(e){void 0!==n.onError&&n.onError(e)},this.resolveURL=function(e){return i?i(e):e},this.setURLModifier=function(e){return i=e,this},this.addHandler=function(e,t){return l.push(e,t),this},this.removeHandler=function(e){const t=l.indexOf(e);return-1!==t&&l.splice(t,2),this},this.getHandler=function(e){for(let t=0,r=l.length;t<r;t+=2){const r=l[t],n=l[t+1];if(r.global&&(r.lastIndex=0),r.test(e))return n}return null}}}const Vu=new LoadingManager;class Loader{constructor(e){this.manager=void 0!==e?e:Vu,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const r=this;return new Promise((function(n,i){r.load(e,n,t,i)}))}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}Loader.DEFAULT_MATERIAL_NAME="__DEFAULT";const qu={};class HttpError extends Error{constructor(e,t){super(e),this.response=t}}class FileLoader extends Loader{constructor(e){super(e)}load(e,t,r,n){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const i=Wu.get(e);if(void 0!==i)return this.manager.itemStart(e),setTimeout((()=>{t&&t(i),this.manager.itemEnd(e)}),0),i;if(void 0!==qu[e])return void qu[e].push({onLoad:t,onProgress:r,onError:n});qu[e]=[],qu[e].push({onLoad:t,onProgress:r,onError:n});const s=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,a=this.responseType;fetch(s).then((t=>{if(200===t.status||0===t.status){if(0===t.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===t.body||void 0===t.body.getReader)return t;const r=qu[e],n=t.body.getReader(),i=t.headers.get("Content-Length")||t.headers.get("X-File-Size"),s=i?parseInt(i):0,o=0!==s;let a=0;const l=new ReadableStream({start(e){!function t(){n.read().then((({done:n,value:i})=>{if(n)e.close();else{a+=i.byteLength;const n=new ProgressEvent("progress",{lengthComputable:o,loaded:a,total:s});for(let e=0,t=r.length;e<t;e++){const t=r[e];t.onProgress&&t.onProgress(n)}e.enqueue(i),t()}}))}()}});return new Response(l)}throw new HttpError(`fetch for "${t.url}" responded with ${t.status}: ${t.statusText}`,t)})).then((e=>{switch(a){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"document":return e.text().then((e=>(new DOMParser).parseFromString(e,o)));case"json":return e.json();default:if(void 0===o)return e.text();{const t=/charset="?([^;"\s]*)"?/i.exec(o),r=t&&t[1]?t[1].toLowerCase():void 0,n=new TextDecoder(r);return e.arrayBuffer().then((e=>n.decode(e)))}}})).then((t=>{Wu.add(e,t);const r=qu[e];delete qu[e];for(let e=0,n=r.length;e<n;e++){const n=r[e];n.onLoad&&n.onLoad(t)}})).catch((t=>{const r=qu[e];if(void 0===r)throw this.manager.itemError(e),t;delete qu[e];for(let e=0,n=r.length;e<n;e++){const n=r[e];n.onError&&n.onError(t)}this.manager.itemError(e)})).finally((()=>{this.manager.itemEnd(e)})),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class AnimationLoader extends Loader{constructor(e){super(e)}load(e,t,r,n){const i=this,s=new FileLoader(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(function(r){try{t(i.parse(JSON.parse(r)))}catch(t){n?n(t):console.error(t),i.manager.itemError(e)}}),r,n)}parse(e){const t=[];for(let r=0;r<e.length;r++){const n=AnimationClip.parse(e[r]);t.push(n)}return t}}class CompressedTextureLoader extends Loader{constructor(e){super(e)}load(e,t,r,n){const i=this,s=[],o=new CompressedTexture,a=new FileLoader(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(i.withCredentials);let l=0;function c(c){a.load(e[c],(function(e){const r=i.parse(e,!0);s[c]={width:r.width,height:r.height,format:r.format,mipmaps:r.mipmaps},l+=1,6===l&&(1===r.mipmapCount&&(o.minFilter=ot),o.image=s,o.format=r.format,o.needsUpdate=!0,t&&t(o))}),r,n)}if(Array.isArray(e))for(let t=0,r=e.length;t<r;++t)c(t);else a.load(e,(function(e){const r=i.parse(e,!0);if(r.isCubemap){const e=r.mipmaps.length/r.mipmapCount;for(let t=0;t<e;t++){s[t]={mipmaps:[]};for(let e=0;e<r.mipmapCount;e++)s[t].mipmaps.push(r.mipmaps[t*r.mipmapCount+e]),s[t].format=r.format,s[t].width=r.width,s[t].height=r.height}o.image=s}else o.image.width=r.width,o.image.height=r.height,o.mipmaps=r.mipmaps;1===r.mipmapCount&&(o.minFilter=ot),o.format=r.format,o.needsUpdate=!0,t&&t(o)}),r,n);return o}}class ImageLoader extends Loader{constructor(e){super(e)}load(e,t,r,n){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const i=this,s=Wu.get(e);if(void 0!==s)return i.manager.itemStart(e),setTimeout((function(){t&&t(s),i.manager.itemEnd(e)}),0),s;const o=Hn("img");function a(){c(),Wu.add(e,this),t&&t(this),i.manager.itemEnd(e)}function l(t){c(),n&&n(t),i.manager.itemError(e),i.manager.itemEnd(e)}function c(){o.removeEventListener("load",a,!1),o.removeEventListener("error",l,!1)}return o.addEventListener("load",a,!1),o.addEventListener("error",l,!1),"data:"!==e.slice(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),i.manager.itemStart(e),o.src=e,o}}class CubeTextureLoader extends Loader{constructor(e){super(e)}load(e,t,r,n){const i=new CubeTexture;i.colorSpace=Dr;const s=new ImageLoader(this.manager);s.setCrossOrigin(this.crossOrigin),s.setPath(this.path);let o=0;function a(r){s.load(e[r],(function(e){i.images[r]=e,o++,6===o&&(i.needsUpdate=!0,t&&t(i))}),void 0,n)}for(let t=0;t<e.length;++t)a(t);return i}}class DataTextureLoader extends Loader{constructor(e){super(e)}load(e,t,r,n){const i=this,s=new DataTexture,o=new FileLoader(this.manager);return o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.setWithCredentials(i.withCredentials),o.load(e,(function(e){let r;try{r=i.parse(e)}catch(e){if(void 0===n)return void console.error(e);n(e)}void 0!==r.image?s.image=r.image:void 0!==r.data&&(s.image.width=r.width,s.image.height=r.height,s.image.data=r.data),s.wrapS=void 0!==r.wrapS?r.wrapS:Qe,s.wrapT=void 0!==r.wrapT?r.wrapT:Qe,s.magFilter=void 0!==r.magFilter?r.magFilter:ot,s.minFilter=void 0!==r.minFilter?r.minFilter:ot,s.anisotropy=void 0!==r.anisotropy?r.anisotropy:1,void 0!==r.colorSpace&&(s.colorSpace=r.colorSpace),void 0!==r.flipY&&(s.flipY=r.flipY),void 0!==r.format&&(s.format=r.format),void 0!==r.type&&(s.type=r.type),void 0!==r.mipmaps&&(s.mipmaps=r.mipmaps,s.minFilter=ct),1===r.mipmapCount&&(s.minFilter=ot),void 0!==r.generateMipmaps&&(s.generateMipmaps=r.generateMipmaps),s.needsUpdate=!0,t&&t(s,r)}),r,n),s}}class TextureLoader extends Loader{constructor(e){super(e)}load(e,t,r,n){const i=new Texture,s=new ImageLoader(this.manager);return s.setCrossOrigin(this.crossOrigin),s.setPath(this.path),s.load(e,(function(e){i.image=e,i.needsUpdate=!0,void 0!==t&&t(i)}),r,n),i}}class Light extends Object3D{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new Color(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}class HemisphereLight extends Light{constructor(e,t,r){super(e,r),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Object3D.DEFAULT_UP),this.updateMatrix(),this.groundColor=new Color(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}const $u=new Matrix4,Zu=new Vector3,Ku=new Vector3;class LightShadow{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Vector2(512,512),this.map=null,this.mapPass=null,this.matrix=new Matrix4,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Frustum,this._frameExtents=new Vector2(1,1),this._viewportCount=1,this._viewports=[new Vector4(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,r=this.matrix;Zu.setFromMatrixPosition(e.matrixWorld),t.position.copy(Zu),Ku.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Ku),t.updateMatrixWorld(),$u.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix($u),r.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),r.multiply($u)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){const e={};return 0!==this.bias&&(e.bias=this.bias),0!==this.normalBias&&(e.normalBias=this.normalBias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class SpotLightShadow extends LightShadow{constructor(){super(new PerspectiveCamera(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,r=2*Mn*e.angle*this.focus,n=this.mapSize.width/this.mapSize.height,i=e.distance||t.far;r===t.fov&&n===t.aspect&&i===t.far||(t.fov=r,t.aspect=n,t.far=i,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class SpotLight extends Light{constructor(e,t,r=0,n=Math.PI/3,i=0,s=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Object3D.DEFAULT_UP),this.updateMatrix(),this.target=new Object3D,this.distance=r,this.angle=n,this.penumbra=i,this.decay=s,this.map=null,this.shadow=new SpotLightShadow}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const Xu=new Matrix4,Yu=new Vector3,Ju=new Vector3;class PointLightShadow extends LightShadow{constructor(){super(new PerspectiveCamera(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Vector2(4,2),this._viewportCount=6,this._viewports=[new Vector4(2,1,1,1),new Vector4(0,1,1,1),new Vector4(3,1,1,1),new Vector4(1,1,1,1),new Vector4(3,0,1,1),new Vector4(1,0,1,1)],this._cubeDirections=[new Vector3(1,0,0),new Vector3(-1,0,0),new Vector3(0,0,1),new Vector3(0,0,-1),new Vector3(0,1,0),new Vector3(0,-1,0)],this._cubeUps=[new Vector3(0,1,0),new Vector3(0,1,0),new Vector3(0,1,0),new Vector3(0,1,0),new Vector3(0,0,1),new Vector3(0,0,-1)]}updateMatrices(e,t=0){const r=this.camera,n=this.matrix,i=e.distance||r.far;i!==r.far&&(r.far=i,r.updateProjectionMatrix()),Yu.setFromMatrixPosition(e.matrixWorld),r.position.copy(Yu),Ju.copy(r.position),Ju.add(this._cubeDirections[t]),r.up.copy(this._cubeUps[t]),r.lookAt(Ju),r.updateMatrixWorld(),n.makeTranslation(-Yu.x,-Yu.y,-Yu.z),Xu.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Xu)}}class PointLight extends Light{constructor(e,t,r=0,n=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=r,this.decay=n,this.shadow=new PointLightShadow}get power(){return 4*this.intensity*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class DirectionalLightShadow extends LightShadow{constructor(){super(new OrthographicCamera(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class DirectionalLight extends Light{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Object3D.DEFAULT_UP),this.updateMatrix(),this.target=new Object3D,this.shadow=new DirectionalLightShadow}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class AmbientLight extends Light{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class RectAreaLight extends Light{constructor(e,t,r=10,n=10){super(e,t),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=r,this.height=n}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}class SphericalHarmonics3{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new Vector3)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const r=e.x,n=e.y,i=e.z,s=this.coefficients;return t.copy(s[0]).multiplyScalar(.282095),t.addScaledVector(s[1],.488603*n),t.addScaledVector(s[2],.488603*i),t.addScaledVector(s[3],.488603*r),t.addScaledVector(s[4],r*n*1.092548),t.addScaledVector(s[5],n*i*1.092548),t.addScaledVector(s[6],.315392*(3*i*i-1)),t.addScaledVector(s[7],r*i*1.092548),t.addScaledVector(s[8],.546274*(r*r-n*n)),t}getIrradianceAt(e,t){const r=e.x,n=e.y,i=e.z,s=this.coefficients;return t.copy(s[0]).multiplyScalar(.886227),t.addScaledVector(s[1],1.023328*n),t.addScaledVector(s[2],1.023328*i),t.addScaledVector(s[3],1.023328*r),t.addScaledVector(s[4],.858086*r*n),t.addScaledVector(s[5],.858086*n*i),t.addScaledVector(s[6],.743125*i*i-.247708),t.addScaledVector(s[7],.858086*r*i),t.addScaledVector(s[8],.429043*(r*r-n*n)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let r=0;r<9;r++)this.coefficients[r].addScaledVector(e.coefficients[r],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let r=0;r<9;r++)this.coefficients[r].lerp(e.coefficients[r],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return(new this.constructor).copy(this)}fromArray(e,t=0){const r=this.coefficients;for(let n=0;n<9;n++)r[n].fromArray(e,t+3*n);return this}toArray(e=[],t=0){const r=this.coefficients;for(let n=0;n<9;n++)r[n].toArray(e,t+3*n);return e}static getBasisAt(e,t){const r=e.x,n=e.y,i=e.z;t[0]=.282095,t[1]=.488603*n,t[2]=.488603*i,t[3]=.488603*r,t[4]=1.092548*r*n,t[5]=1.092548*n*i,t[6]=.315392*(3*i*i-1),t[7]=1.092548*r*i,t[8]=.546274*(r*r-n*n)}}class LightProbe extends Light{constructor(e=new SphericalHarmonics3,t=1){super(void 0,t),this.isLightProbe=!0,this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}class MaterialLoader extends Loader{constructor(e){super(e),this.textures={}}load(e,t,r,n){const i=this,s=new FileLoader(i.manager);s.setPath(i.path),s.setRequestHeader(i.requestHeader),s.setWithCredentials(i.withCredentials),s.load(e,(function(r){try{t(i.parse(JSON.parse(r)))}catch(t){n?n(t):console.error(t),i.manager.itemError(e)}}),r,n)}parse(e){const t=this.textures;function r(e){return void 0===t[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),t[e]}const n=MaterialLoader.createMaterialFromType(e.type);if(void 0!==e.uuid&&(n.uuid=e.uuid),void 0!==e.name&&(n.name=e.name),void 0!==e.color&&void 0!==n.color&&n.color.setHex(e.color),void 0!==e.roughness&&(n.roughness=e.roughness),void 0!==e.metalness&&(n.metalness=e.metalness),void 0!==e.sheen&&(n.sheen=e.sheen),void 0!==e.sheenColor&&(n.sheenColor=(new Color).setHex(e.sheenColor)),void 0!==e.sheenRoughness&&(n.sheenRoughness=e.sheenRoughness),void 0!==e.emissive&&void 0!==n.emissive&&n.emissive.setHex(e.emissive),void 0!==e.specular&&void 0!==n.specular&&n.specular.setHex(e.specular),void 0!==e.specularIntensity&&(n.specularIntensity=e.specularIntensity),void 0!==e.specularColor&&void 0!==n.specularColor&&n.specularColor.setHex(e.specularColor),void 0!==e.shininess&&(n.shininess=e.shininess),void 0!==e.clearcoat&&(n.clearcoat=e.clearcoat),void 0!==e.clearcoatRoughness&&(n.clearcoatRoughness=e.clearcoatRoughness),void 0!==e.iridescence&&(n.iridescence=e.iridescence),void 0!==e.iridescenceIOR&&(n.iridescenceIOR=e.iridescenceIOR),void 0!==e.iridescenceThicknessRange&&(n.iridescenceThicknessRange=e.iridescenceThicknessRange),void 0!==e.transmission&&(n.transmission=e.transmission),void 0!==e.thickness&&(n.thickness=e.thickness),void 0!==e.attenuationDistance&&(n.attenuationDistance=e.attenuationDistance),void 0!==e.attenuationColor&&void 0!==n.attenuationColor&&n.attenuationColor.setHex(e.attenuationColor),void 0!==e.anisotropy&&(n.anisotropy=e.anisotropy),void 0!==e.anisotropyRotation&&(n.anisotropyRotation=e.anisotropyRotation),void 0!==e.fog&&(n.fog=e.fog),void 0!==e.flatShading&&(n.flatShading=e.flatShading),void 0!==e.blending&&(n.blending=e.blending),void 0!==e.combine&&(n.combine=e.combine),void 0!==e.side&&(n.side=e.side),void 0!==e.shadowSide&&(n.shadowSide=e.shadowSide),void 0!==e.opacity&&(n.opacity=e.opacity),void 0!==e.transparent&&(n.transparent=e.transparent),void 0!==e.alphaTest&&(n.alphaTest=e.alphaTest),void 0!==e.alphaHash&&(n.alphaHash=e.alphaHash),void 0!==e.depthFunc&&(n.depthFunc=e.depthFunc),void 0!==e.depthTest&&(n.depthTest=e.depthTest),void 0!==e.depthWrite&&(n.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(n.colorWrite=e.colorWrite),void 0!==e.blendSrc&&(n.blendSrc=e.blendSrc),void 0!==e.blendDst&&(n.blendDst=e.blendDst),void 0!==e.blendEquation&&(n.blendEquation=e.blendEquation),void 0!==e.blendSrcAlpha&&(n.blendSrcAlpha=e.blendSrcAlpha),void 0!==e.blendDstAlpha&&(n.blendDstAlpha=e.blendDstAlpha),void 0!==e.blendEquationAlpha&&(n.blendEquationAlpha=e.blendEquationAlpha),void 0!==e.blendColor&&void 0!==n.blendColor&&n.blendColor.setHex(e.blendColor),void 0!==e.blendAlpha&&(n.blendAlpha=e.blendAlpha),void 0!==e.stencilWriteMask&&(n.stencilWriteMask=e.stencilWriteMask),void 0!==e.stencilFunc&&(n.stencilFunc=e.stencilFunc),void 0!==e.stencilRef&&(n.stencilRef=e.stencilRef),void 0!==e.stencilFuncMask&&(n.stencilFuncMask=e.stencilFuncMask),void 0!==e.stencilFail&&(n.stencilFail=e.stencilFail),void 0!==e.stencilZFail&&(n.stencilZFail=e.stencilZFail),void 0!==e.stencilZPass&&(n.stencilZPass=e.stencilZPass),void 0!==e.stencilWrite&&(n.stencilWrite=e.stencilWrite),void 0!==e.wireframe&&(n.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(n.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(n.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(n.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(n.rotation=e.rotation),void 0!==e.linewidth&&(n.linewidth=e.linewidth),void 0!==e.dashSize&&(n.dashSize=e.dashSize),void 0!==e.gapSize&&(n.gapSize=e.gapSize),void 0!==e.scale&&(n.scale=e.scale),void 0!==e.polygonOffset&&(n.polygonOffset=e.polygonOffset),void 0!==e.polygonOffsetFactor&&(n.polygonOffsetFactor=e.polygonOffsetFactor),void 0!==e.polygonOffsetUnits&&(n.polygonOffsetUnits=e.polygonOffsetUnits),void 0!==e.dithering&&(n.dithering=e.dithering),void 0!==e.alphaToCoverage&&(n.alphaToCoverage=e.alphaToCoverage),void 0!==e.premultipliedAlpha&&(n.premultipliedAlpha=e.premultipliedAlpha),void 0!==e.forceSinglePass&&(n.forceSinglePass=e.forceSinglePass),void 0!==e.visible&&(n.visible=e.visible),void 0!==e.toneMapped&&(n.toneMapped=e.toneMapped),void 0!==e.userData&&(n.userData=e.userData),void 0!==e.vertexColors&&("number"==typeof e.vertexColors?n.vertexColors=e.vertexColors>0:n.vertexColors=e.vertexColors),void 0!==e.uniforms)for(const t in e.uniforms){const i=e.uniforms[t];switch(n.uniforms[t]={},i.type){case"t":n.uniforms[t].value=r(i.value);break;case"c":n.uniforms[t].value=(new Color).setHex(i.value);break;case"v2":n.uniforms[t].value=(new Vector2).fromArray(i.value);break;case"v3":n.uniforms[t].value=(new Vector3).fromArray(i.value);break;case"v4":n.uniforms[t].value=(new Vector4).fromArray(i.value);break;case"m3":n.uniforms[t].value=(new Matrix3).fromArray(i.value);break;case"m4":n.uniforms[t].value=(new Matrix4).fromArray(i.value);break;default:n.uniforms[t].value=i.value}}if(void 0!==e.defines&&(n.defines=e.defines),void 0!==e.vertexShader&&(n.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(n.fragmentShader=e.fragmentShader),void 0!==e.glslVersion&&(n.glslVersion=e.glslVersion),void 0!==e.extensions)for(const t in e.extensions)n.extensions[t]=e.extensions[t];if(void 0!==e.lights&&(n.lights=e.lights),void 0!==e.clipping&&(n.clipping=e.clipping),void 0!==e.size&&(n.size=e.size),void 0!==e.sizeAttenuation&&(n.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(n.map=r(e.map)),void 0!==e.matcap&&(n.matcap=r(e.matcap)),void 0!==e.alphaMap&&(n.alphaMap=r(e.alphaMap)),void 0!==e.bumpMap&&(n.bumpMap=r(e.bumpMap)),void 0!==e.bumpScale&&(n.bumpScale=e.bumpScale),void 0!==e.normalMap&&(n.normalMap=r(e.normalMap)),void 0!==e.normalMapType&&(n.normalMapType=e.normalMapType),void 0!==e.normalScale){let t=e.normalScale;!1===Array.isArray(t)&&(t=[t,t]),n.normalScale=(new Vector2).fromArray(t)}return void 0!==e.displacementMap&&(n.displacementMap=r(e.displacementMap)),void 0!==e.displacementScale&&(n.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(n.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(n.roughnessMap=r(e.roughnessMap)),void 0!==e.metalnessMap&&(n.metalnessMap=r(e.metalnessMap)),void 0!==e.emissiveMap&&(n.emissiveMap=r(e.emissiveMap)),void 0!==e.emissiveIntensity&&(n.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(n.specularMap=r(e.specularMap)),void 0!==e.specularIntensityMap&&(n.specularIntensityMap=r(e.specularIntensityMap)),void 0!==e.specularColorMap&&(n.specularColorMap=r(e.specularColorMap)),void 0!==e.envMap&&(n.envMap=r(e.envMap)),void 0!==e.envMapRotation&&n.envMapRotation.fromArray(e.envMapRotation),void 0!==e.envMapIntensity&&(n.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(n.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(n.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(n.lightMap=r(e.lightMap)),void 0!==e.lightMapIntensity&&(n.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(n.aoMap=r(e.aoMap)),void 0!==e.aoMapIntensity&&(n.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(n.gradientMap=r(e.gradientMap)),void 0!==e.clearcoatMap&&(n.clearcoatMap=r(e.clearcoatMap)),void 0!==e.clearcoatRoughnessMap&&(n.clearcoatRoughnessMap=r(e.clearcoatRoughnessMap)),void 0!==e.clearcoatNormalMap&&(n.clearcoatNormalMap=r(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(n.clearcoatNormalScale=(new Vector2).fromArray(e.clearcoatNormalScale)),void 0!==e.iridescenceMap&&(n.iridescenceMap=r(e.iridescenceMap)),void 0!==e.iridescenceThicknessMap&&(n.iridescenceThicknessMap=r(e.iridescenceThicknessMap)),void 0!==e.transmissionMap&&(n.transmissionMap=r(e.transmissionMap)),void 0!==e.thicknessMap&&(n.thicknessMap=r(e.thicknessMap)),void 0!==e.anisotropyMap&&(n.anisotropyMap=r(e.anisotropyMap)),void 0!==e.sheenColorMap&&(n.sheenColorMap=r(e.sheenColorMap)),void 0!==e.sheenRoughnessMap&&(n.sheenRoughnessMap=r(e.sheenRoughnessMap)),n}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){return new{ShadowMaterial,SpriteMaterial,RawShaderMaterial,ShaderMaterial,PointsMaterial,MeshPhysicalMaterial,MeshStandardMaterial,MeshPhongMaterial,MeshToonMaterial,MeshNormalMaterial,MeshLambertMaterial,MeshDepthMaterial,MeshDistanceMaterial,MeshBasicMaterial,MeshMatcapMaterial,LineDashedMaterial,LineBasicMaterial,Material}[e]}}class LoaderUtils{static decodeText(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);let t="";for(let r=0,n=e.length;r<n;r++)t+=String.fromCharCode(e[r]);try{return decodeURIComponent(escape(t))}catch(e){return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return-1===t?"./":e.slice(0,t+1)}static resolveURL(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class InstancedBufferGeometry extends BufferGeometry{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class BufferGeometryLoader extends Loader{constructor(e){super(e)}load(e,t,r,n){const i=this,s=new FileLoader(i.manager);s.setPath(i.path),s.setRequestHeader(i.requestHeader),s.setWithCredentials(i.withCredentials),s.load(e,(function(r){try{t(i.parse(JSON.parse(r)))}catch(t){n?n(t):console.error(t),i.manager.itemError(e)}}),r,n)}parse(e){const t={},r={};function n(e,n){if(void 0!==t[n])return t[n];const i=e.interleavedBuffers[n],s=function(e,t){if(void 0!==r[t])return r[t];const n=e.arrayBuffers,i=n[t],s=new Uint32Array(i).buffer;return r[t]=s,s}(e,i.buffer),o=jn(i.type,s),a=new InterleavedBuffer(o,i.stride);return a.uuid=i.uuid,t[n]=a,a}const i=e.isInstancedBufferGeometry?new InstancedBufferGeometry:new BufferGeometry,s=e.data.index;if(void 0!==s){const e=jn(s.type,s.array);i.setIndex(new BufferAttribute(e,1))}const o=e.data.attributes;for(const t in o){const r=o[t];let s;if(r.isInterleavedBufferAttribute){const t=n(e.data,r.data);s=new InterleavedBufferAttribute(t,r.itemSize,r.offset,r.normalized)}else{const e=jn(r.type,r.array);s=new(r.isInstancedBufferAttribute?InstancedBufferAttribute:BufferAttribute)(e,r.itemSize,r.normalized)}void 0!==r.name&&(s.name=r.name),void 0!==r.usage&&s.setUsage(r.usage),i.setAttribute(t,s)}const a=e.data.morphAttributes;if(a)for(const t in a){const r=a[t],s=[];for(let t=0,i=r.length;t<i;t++){const i=r[t];let o;if(i.isInterleavedBufferAttribute){const t=n(e.data,i.data);o=new InterleavedBufferAttribute(t,i.itemSize,i.offset,i.normalized)}else{const e=jn(i.type,i.array);o=new BufferAttribute(e,i.itemSize,i.normalized)}void 0!==i.name&&(o.name=i.name),s.push(o)}i.morphAttributes[t]=s}e.data.morphTargetsRelative&&(i.morphTargetsRelative=!0);const l=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==l)for(let e=0,t=l.length;e!==t;++e){const t=l[e];i.addGroup(t.start,t.count,t.materialIndex)}const c=e.data.boundingSphere;if(void 0!==c){const e=new Vector3;void 0!==c.center&&e.fromArray(c.center),i.boundingSphere=new Sphere(e,c.radius)}return e.name&&(i.name=e.name),e.userData&&(i.userData=e.userData),i}}class ObjectLoader extends Loader{constructor(e){super(e)}load(e,t,r,n){const i=this,s=""===this.path?LoaderUtils.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||s;const o=new FileLoader(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,(function(r){let s=null;try{s=JSON.parse(r)}catch(t){return void 0!==n&&n(t),void console.error("THREE:ObjectLoader: Can't parse "+e+".",t.message)}const o=s.metadata;if(void 0===o||void 0===o.type||"geometry"===o.type.toLowerCase())return void 0!==n&&n(new Error("THREE.ObjectLoader: Can't load "+e)),void console.error("THREE.ObjectLoader: Can't load "+e);i.parse(s,t)}),r,n)}async loadAsync(e,t){const r=""===this.path?LoaderUtils.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||r;const n=new FileLoader(this.manager);n.setPath(this.path),n.setRequestHeader(this.requestHeader),n.setWithCredentials(this.withCredentials);const i=await n.loadAsync(e,t),s=JSON.parse(i),o=s.metadata;if(void 0===o||void 0===o.type||"geometry"===o.type.toLowerCase())throw new Error("THREE.ObjectLoader: Can't load "+e);return await this.parseAsync(s)}parse(e,t){const r=this.parseAnimations(e.animations),n=this.parseShapes(e.shapes),i=this.parseGeometries(e.geometries,n),s=this.parseImages(e.images,(function(){void 0!==t&&t(l)})),o=this.parseTextures(e.textures,s),a=this.parseMaterials(e.materials,o),l=this.parseObject(e.object,i,a,o,r),c=this.parseSkeletons(e.skeletons,l);if(this.bindSkeletons(l,c),void 0!==t){let e=!1;for(const t in s)if(s[t].data instanceof HTMLImageElement){e=!0;break}!1===e&&t(l)}return l}async parseAsync(e){const t=this.parseAnimations(e.animations),r=this.parseShapes(e.shapes),n=this.parseGeometries(e.geometries,r),i=await this.parseImagesAsync(e.images),s=this.parseTextures(e.textures,i),o=this.parseMaterials(e.materials,s),a=this.parseObject(e.object,n,o,s,t),l=this.parseSkeletons(e.skeletons,a);return this.bindSkeletons(a,l),a}parseShapes(e){const t={};if(void 0!==e)for(let r=0,n=e.length;r<n;r++){const n=(new Shape).fromJSON(e[r]);t[n.uuid]=n}return t}parseSkeletons(e,t){const r={},n={};if(t.traverse((function(e){e.isBone&&(n[e.uuid]=e)})),void 0!==e)for(let t=0,i=e.length;t<i;t++){const i=(new Skeleton).fromJSON(e[t],n);r[i.uuid]=i}return r}parseGeometries(e,t){const r={};if(void 0!==e){const n=new BufferGeometryLoader;for(let i=0,s=e.length;i<s;i++){let s;const o=e[i];switch(o.type){case"BufferGeometry":case"InstancedBufferGeometry":s=n.parse(o);break;default:o.type in Fu?s=Fu[o.type].fromJSON(o,t):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${o.type}"`)}s.uuid=o.uuid,void 0!==o.name&&(s.name=o.name),void 0!==o.userData&&(s.userData=o.userData),r[o.uuid]=s}}return r}parseMaterials(e,t){const r={},n={};if(void 0!==e){const i=new MaterialLoader;i.setTextures(t);for(let t=0,s=e.length;t<s;t++){const s=e[t];void 0===r[s.uuid]&&(r[s.uuid]=i.parse(s)),n[s.uuid]=r[s.uuid]}}return n}parseAnimations(e){const t={};if(void 0!==e)for(let r=0;r<e.length;r++){const n=e[r],i=AnimationClip.parse(n);t[i.uuid]=i}return t}parseImages(e,t){const r=this,n={};let i;function s(e){if("string"==typeof e){const t=e;return function(e){return r.manager.itemStart(e),i.load(e,(function(){r.manager.itemEnd(e)}),void 0,(function(){r.manager.itemError(e),r.manager.itemEnd(e)}))}(/^(\/\/)|([a-z]+:(\/\/)?)/i.test(t)?t:r.resourcePath+t)}return e.data?{data:jn(e.type,e.data),width:e.width,height:e.height}:null}if(void 0!==e&&e.length>0){const r=new LoadingManager(t);i=new ImageLoader(r),i.setCrossOrigin(this.crossOrigin);for(let t=0,r=e.length;t<r;t++){const r=e[t],i=r.url;if(Array.isArray(i)){const e=[];for(let t=0,r=i.length;t<r;t++){const r=s(i[t]);null!==r&&(r instanceof HTMLImageElement?e.push(r):e.push(new DataTexture(r.data,r.width,r.height)))}n[r.uuid]=new Source(e)}else{const e=s(r.url);n[r.uuid]=new Source(e)}}}return n}async parseImagesAsync(e){const t=this,r={};let n;async function i(e){if("string"==typeof e){const r=e,i=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(r)?r:t.resourcePath+r;return await n.loadAsync(i)}return e.data?{data:jn(e.type,e.data),width:e.width,height:e.height}:null}if(void 0!==e&&e.length>0){n=new ImageLoader(this.manager),n.setCrossOrigin(this.crossOrigin);for(let t=0,n=e.length;t<n;t++){const n=e[t],s=n.url;if(Array.isArray(s)){const e=[];for(let t=0,r=s.length;t<r;t++){const r=s[t],n=await i(r);null!==n&&(n instanceof HTMLImageElement?e.push(n):e.push(new DataTexture(n.data,n.width,n.height)))}r[n.uuid]=new Source(e)}else{const e=await i(n.url);r[n.uuid]=new Source(e)}}}return r}parseTextures(e,t){function r(e,t){return"number"==typeof e?e:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",e),t[e])}const n={};if(void 0!==e)for(let i=0,s=e.length;i<s;i++){const s=e[i];void 0===s.image&&console.warn('THREE.ObjectLoader: No "image" specified for',s.uuid),void 0===t[s.image]&&console.warn("THREE.ObjectLoader: Undefined image",s.image);const o=t[s.image],a=o.data;let l;Array.isArray(a)?(l=new CubeTexture,6===a.length&&(l.needsUpdate=!0)):(l=a&&a.data?new DataTexture:new Texture,a&&(l.needsUpdate=!0)),l.source=o,l.uuid=s.uuid,void 0!==s.name&&(l.name=s.name),void 0!==s.mapping&&(l.mapping=r(s.mapping,Qu)),void 0!==s.channel&&(l.channel=s.channel),void 0!==s.offset&&l.offset.fromArray(s.offset),void 0!==s.repeat&&l.repeat.fromArray(s.repeat),void 0!==s.center&&l.center.fromArray(s.center),void 0!==s.rotation&&(l.rotation=s.rotation),void 0!==s.wrap&&(l.wrapS=r(s.wrap[0],ed),l.wrapT=r(s.wrap[1],ed)),void 0!==s.format&&(l.format=s.format),void 0!==s.internalFormat&&(l.internalFormat=s.internalFormat),void 0!==s.type&&(l.type=s.type),void 0!==s.colorSpace&&(l.colorSpace=s.colorSpace),void 0!==s.minFilter&&(l.minFilter=r(s.minFilter,td)),void 0!==s.magFilter&&(l.magFilter=r(s.magFilter,td)),void 0!==s.anisotropy&&(l.anisotropy=s.anisotropy),void 0!==s.flipY&&(l.flipY=s.flipY),void 0!==s.generateMipmaps&&(l.generateMipmaps=s.generateMipmaps),void 0!==s.premultiplyAlpha&&(l.premultiplyAlpha=s.premultiplyAlpha),void 0!==s.unpackAlignment&&(l.unpackAlignment=s.unpackAlignment),void 0!==s.compareFunction&&(l.compareFunction=s.compareFunction),void 0!==s.userData&&(l.userData=s.userData),n[s.uuid]=l}return n}parseObject(e,t,r,n,i){let s,o,a;function l(e){return void 0===t[e]&&console.warn("THREE.ObjectLoader: Undefined geometry",e),t[e]}function c(e){if(void 0!==e){if(Array.isArray(e)){const t=[];for(let n=0,i=e.length;n<i;n++){const i=e[n];void 0===r[i]&&console.warn("THREE.ObjectLoader: Undefined material",i),t.push(r[i])}return t}return void 0===r[e]&&console.warn("THREE.ObjectLoader: Undefined material",e),r[e]}}function u(e){return void 0===n[e]&&console.warn("THREE.ObjectLoader: Undefined texture",e),n[e]}switch(e.type){case"Scene":s=new Scene,void 0!==e.background&&(Number.isInteger(e.background)?s.background=new Color(e.background):s.background=u(e.background)),void 0!==e.environment&&(s.environment=u(e.environment)),void 0!==e.fog&&("Fog"===e.fog.type?s.fog=new Fog(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(s.fog=new FogExp2(e.fog.color,e.fog.density)),""!==e.fog.name&&(s.fog.name=e.fog.name)),void 0!==e.backgroundBlurriness&&(s.backgroundBlurriness=e.backgroundBlurriness),void 0!==e.backgroundIntensity&&(s.backgroundIntensity=e.backgroundIntensity),void 0!==e.backgroundRotation&&s.backgroundRotation.fromArray(e.backgroundRotation),void 0!==e.environmentRotation&&s.environmentRotation.fromArray(e.environmentRotation);break;case"PerspectiveCamera":s=new PerspectiveCamera(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(s.focus=e.focus),void 0!==e.zoom&&(s.zoom=e.zoom),void 0!==e.filmGauge&&(s.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(s.filmOffset=e.filmOffset),void 0!==e.view&&(s.view=Object.assign({},e.view));break;case"OrthographicCamera":s=new OrthographicCamera(e.left,e.right,e.top,e.bottom,e.near,e.far),void 0!==e.zoom&&(s.zoom=e.zoom),void 0!==e.view&&(s.view=Object.assign({},e.view));break;case"AmbientLight":s=new AmbientLight(e.color,e.intensity);break;case"DirectionalLight":s=new DirectionalLight(e.color,e.intensity);break;case"PointLight":s=new PointLight(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":s=new RectAreaLight(e.color,e.intensity,e.width,e.height);break;case"SpotLight":s=new SpotLight(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":s=new HemisphereLight(e.color,e.groundColor,e.intensity);break;case"LightProbe":s=(new LightProbe).fromJSON(e);break;case"SkinnedMesh":o=l(e.geometry),a=c(e.material),s=new SkinnedMesh(o,a),void 0!==e.bindMode&&(s.bindMode=e.bindMode),void 0!==e.bindMatrix&&s.bindMatrix.fromArray(e.bindMatrix),void 0!==e.skeleton&&(s.skeleton=e.skeleton);break;case"Mesh":o=l(e.geometry),a=c(e.material),s=new Mesh(o,a);break;case"InstancedMesh":o=l(e.geometry),a=c(e.material);const t=e.count,r=e.instanceMatrix,n=e.instanceColor;s=new InstancedMesh(o,a,t),s.instanceMatrix=new InstancedBufferAttribute(new Float32Array(r.array),16),void 0!==n&&(s.instanceColor=new InstancedBufferAttribute(new Float32Array(n.array),n.itemSize));break;case"BatchedMesh":o=l(e.geometry),a=c(e.material),s=new BatchedMesh(e.maxGeometryCount,e.maxVertexCount,e.maxIndexCount,a),s.geometry=o,s.perObjectFrustumCulled=e.perObjectFrustumCulled,s.sortObjects=e.sortObjects,s._drawRanges=e.drawRanges,s._reservedRanges=e.reservedRanges,s._visibility=e.visibility,s._active=e.active,s._bounds=e.bounds.map((e=>{const t=new Box3;t.min.fromArray(e.boxMin),t.max.fromArray(e.boxMax);const r=new Sphere;return r.radius=e.sphereRadius,r.center.fromArray(e.sphereCenter),{boxInitialized:e.boxInitialized,box:t,sphereInitialized:e.sphereInitialized,sphere:r}})),s._maxGeometryCount=e.maxGeometryCount,s._maxVertexCount=e.maxVertexCount,s._maxIndexCount=e.maxIndexCount,s._geometryInitialized=e.geometryInitialized,s._geometryCount=e.geometryCount,s._matricesTexture=u(e.matricesTexture.uuid);break;case"LOD":s=new LOD;break;case"Line":s=new Line(l(e.geometry),c(e.material));break;case"LineLoop":s=new LineLoop(l(e.geometry),c(e.material));break;case"LineSegments":s=new LineSegments(l(e.geometry),c(e.material));break;case"PointCloud":case"Points":s=new Points(l(e.geometry),c(e.material));break;case"Sprite":s=new Sprite(c(e.material));break;case"Group":s=new Group;break;case"Bone":s=new Bone;break;default:s=new Object3D}if(s.uuid=e.uuid,void 0!==e.name&&(s.name=e.name),void 0!==e.matrix?(s.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(s.matrixAutoUpdate=e.matrixAutoUpdate),s.matrixAutoUpdate&&s.matrix.decompose(s.position,s.quaternion,s.scale)):(void 0!==e.position&&s.position.fromArray(e.position),void 0!==e.rotation&&s.rotation.fromArray(e.rotation),void 0!==e.quaternion&&s.quaternion.fromArray(e.quaternion),void 0!==e.scale&&s.scale.fromArray(e.scale)),void 0!==e.up&&s.up.fromArray(e.up),void 0!==e.castShadow&&(s.castShadow=e.castShadow),void 0!==e.receiveShadow&&(s.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(s.shadow.bias=e.shadow.bias),void 0!==e.shadow.normalBias&&(s.shadow.normalBias=e.shadow.normalBias),void 0!==e.shadow.radius&&(s.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&s.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(s.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(s.visible=e.visible),void 0!==e.frustumCulled&&(s.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(s.renderOrder=e.renderOrder),void 0!==e.userData&&(s.userData=e.userData),void 0!==e.layers&&(s.layers.mask=e.layers),void 0!==e.children){const o=e.children;for(let e=0;e<o.length;e++)s.add(this.parseObject(o[e],t,r,n,i))}if(void 0!==e.animations){const t=e.animations;for(let e=0;e<t.length;e++){const r=t[e];s.animations.push(i[r])}}if("LOD"===e.type){void 0!==e.autoUpdate&&(s.autoUpdate=e.autoUpdate);const t=e.levels;for(let e=0;e<t.length;e++){const r=t[e],n=s.getObjectByProperty("uuid",r.object);void 0!==n&&s.addLevel(n,r.distance,r.hysteresis)}}return s}bindSkeletons(e,t){0!==Object.keys(t).length&&e.traverse((function(e){if(!0===e.isSkinnedMesh&&void 0!==e.skeleton){const r=t[e.skeleton];void 0===r?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",e.skeleton):e.bind(r,e.bindMatrix)}}))}}const Qu={UVMapping:Ge,CubeReflectionMapping:We,CubeRefractionMapping:Ve,EquirectangularReflectionMapping:qe,EquirectangularRefractionMapping:$e,CubeUVReflectionMapping:Xe},ed={RepeatWrapping:Ye,ClampToEdgeWrapping:Qe,MirroredRepeatWrapping:et},td={NearestFilter:tt,NearestMipmapNearestFilter:rt,NearestMipmapLinearFilter:it,LinearFilter:ot,LinearMipmapNearestFilter:at,LinearMipmapLinearFilter:ct};class ImageBitmapLoader extends Loader{constructor(e){super(e),this.isImageBitmapLoader=!0,"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,r,n){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const i=this,s=Wu.get(e);if(void 0!==s)return i.manager.itemStart(e),s.then?void s.then((r=>{t&&t(r),i.manager.itemEnd(e)})).catch((e=>{n&&n(e)})):(setTimeout((function(){t&&t(s),i.manager.itemEnd(e)}),0),s);const o={};o.credentials="anonymous"===this.crossOrigin?"same-origin":"include",o.headers=this.requestHeader;const a=fetch(e,o).then((function(e){return e.blob()})).then((function(e){return createImageBitmap(e,Object.assign(i.options,{colorSpaceConversion:"none"}))})).then((function(r){return Wu.add(e,r),t&&t(r),i.manager.itemEnd(e),r})).catch((function(t){n&&n(t),Wu.remove(e),i.manager.itemError(e),i.manager.itemEnd(e)}));Wu.add(e,a),i.manager.itemStart(e)}}let rd;class AudioContext{static getContext(){return void 0===rd&&(rd=new(window.AudioContext||window.webkitAudioContext)),rd}static setContext(e){rd=e}}class AudioLoader extends Loader{constructor(e){super(e)}load(e,t,r,n){const i=this,s=new FileLoader(this.manager);function o(t){n?n(t):console.error(t),i.manager.itemError(e)}s.setResponseType("arraybuffer"),s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(function(e){try{const r=e.slice(0);AudioContext.getContext().decodeAudioData(r,(function(e){t(e)})).catch(o)}catch(e){o(e)}}),r,n)}}const nd=new Matrix4,id=new Matrix4,sd=new Matrix4;class StereoCamera{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new PerspectiveCamera,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new PerspectiveCamera,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,sd.copy(e.projectionMatrix);const r=t.eyeSep/2,n=r*t.near/t.focus,i=t.near*Math.tan(En*t.fov*.5)/t.zoom;let s,o;id.elements[12]=-r,nd.elements[12]=r,s=-i*t.aspect+n,o=i*t.aspect+n,sd.elements[0]=2*t.near/(o-s),sd.elements[8]=(o+s)/(o-s),this.cameraL.projectionMatrix.copy(sd),s=-i*t.aspect-n,o=i*t.aspect-n,sd.elements[0]=2*t.near/(o-s),sd.elements[8]=(o+s)/(o-s),this.cameraR.projectionMatrix.copy(sd)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(id),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(nd)}}class Clock{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=od(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=od();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function od(){return("undefined"==typeof performance?Date:performance).now()}const ad=new Vector3,ld=new Quaternion,cd=new Vector3,ud=new Vector3;class AudioListener extends Object3D{constructor(){super(),this.type="AudioListener",this.context=AudioContext.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Clock}getInput(){return this.gain}removeFilter(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,r=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(ad,ld,cd),ud.set(0,0,-1).applyQuaternion(ld),t.positionX){const e=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(ad.x,e),t.positionY.linearRampToValueAtTime(ad.y,e),t.positionZ.linearRampToValueAtTime(ad.z,e),t.forwardX.linearRampToValueAtTime(ud.x,e),t.forwardY.linearRampToValueAtTime(ud.y,e),t.forwardZ.linearRampToValueAtTime(ud.z,e),t.upX.linearRampToValueAtTime(r.x,e),t.upY.linearRampToValueAtTime(r.y,e),t.upZ.linearRampToValueAtTime(r.z,e)}else t.setPosition(ad.x,ad.y,ad.z),t.setOrientation(ud.x,ud.y,ud.z,r.x,r.y,r.z)}}class Audio extends Object3D{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(!0===this.isPlaying)return void console.warn("THREE.Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void console.warn("THREE.Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")}stop(){if(!1!==this.hasPlaybackControl)return this._progress=0,null!==this.source&&(this.source.stop(),this.source.onended=null),this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(!1!==this._connected){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}}getFilters(){return this.filters}setFilters(e){return e||(e=[]),!0===this._connected?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){return this.detune=e,!0===this.isPlaying&&void 0!==this.source.detune&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(!1!==this.hasPlaybackControl)return this.playbackRate=e,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(!1!==this.hasPlaybackControl)return this.loop=e,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}}const dd=new Vector3,hd=new Quaternion,pd=new Vector3,md=new Vector3;class PositionalAudio extends Audio{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}connect(){super.connect(),this.panner.connect(this.gain)}disconnect(){super.disconnect(),this.panner.disconnect(this.gain)}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,t,r){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=r,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),!0===this.hasPlaybackControl&&!1===this.isPlaying)return;this.matrixWorld.decompose(dd,hd,pd),md.set(0,0,1).applyQuaternion(hd);const t=this.panner;if(t.positionX){const e=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(dd.x,e),t.positionY.linearRampToValueAtTime(dd.y,e),t.positionZ.linearRampToValueAtTime(dd.z,e),t.orientationX.linearRampToValueAtTime(md.x,e),t.orientationY.linearRampToValueAtTime(md.y,e),t.orientationZ.linearRampToValueAtTime(md.z,e)}else t.setPosition(dd.x,dd.y,dd.z),t.setOrientation(md.x,md.y,md.z)}}class AudioAnalyser{constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0;const t=this.getFrequencyData();for(let r=0;r<t.length;r++)e+=t[r];return e/t.length}}class PropertyMixer{constructor(e,t,r){let n,i,s;switch(this.binding=e,this.valueSize=r,t){case"quaternion":n=this._slerp,i=this._slerpAdditive,s=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*r),this._workIndex=5;break;case"string":case"bool":n=this._select,i=this._select,s=this._setAdditiveIdentityOther,this.buffer=new Array(5*r);break;default:n=this._lerp,i=this._lerpAdditive,s=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*r)}this._mixBufferRegion=n,this._mixBufferRegionAdditive=i,this._setIdentity=s,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const r=this.buffer,n=this.valueSize,i=e*n+n;let s=this.cumulativeWeight;if(0===s){for(let e=0;e!==n;++e)r[i+e]=r[e];s=t}else{s+=t;const e=t/s;this._mixBufferRegion(r,i,0,e,n)}this.cumulativeWeight=s}accumulateAdditive(e){const t=this.buffer,r=this.valueSize,n=r*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(t,n,0,e,r),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,r=this.buffer,n=e*t+t,i=this.cumulativeWeight,s=this.cumulativeWeightAdditive,o=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,i<1){const e=t*this._origIndex;this._mixBufferRegion(r,n,e,1-i,t)}s>0&&this._mixBufferRegionAdditive(r,n,this._addIndex*t,1,t);for(let e=t,i=t+t;e!==i;++e)if(r[e]!==r[e+t]){o.setValue(r,n);break}}saveOriginalState(){const e=this.binding,t=this.buffer,r=this.valueSize,n=r*this._origIndex;e.getValue(t,n);for(let e=r,i=n;e!==i;++e)t[e]=t[n+e%r];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=3*this.valueSize;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let r=e;r<t;r++)this.buffer[r]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let r=0;r<this.valueSize;r++)this.buffer[t+r]=this.buffer[e+r]}_select(e,t,r,n,i){if(n>=.5)for(let n=0;n!==i;++n)e[t+n]=e[r+n]}_slerp(e,t,r,n){Quaternion.slerpFlat(e,t,e,t,e,r,n)}_slerpAdditive(e,t,r,n,i){const s=this._workIndex*i;Quaternion.multiplyQuaternionsFlat(e,s,e,t,e,r),Quaternion.slerpFlat(e,t,e,t,e,s,n)}_lerp(e,t,r,n,i){const s=1-n;for(let o=0;o!==i;++o){const i=t+o;e[i]=e[i]*s+e[r+o]*n}}_lerpAdditive(e,t,r,n,i){for(let s=0;s!==i;++s){const i=t+s;e[i]=e[i]+e[r+s]*n}}}const fd="\\[\\]\\.:\\/",gd=new RegExp("["+fd+"]","g"),yd="[^"+fd+"]",bd="[^"+fd.replace("\\.","")+"]",vd=new RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",yd)+/(WCOD+)?/.source.replace("WCOD",bd)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",yd)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",yd)+"$"),_d=["material","materials","bones","map"];class PropertyBinding{constructor(e,t,r){this.path=t,this.parsedPath=r||PropertyBinding.parseTrackName(t),this.node=PropertyBinding.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,r){return e&&e.isAnimationObjectGroup?new PropertyBinding.Composite(e,t,r):new PropertyBinding(e,t,r)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(gd,"")}static parseTrackName(e){const t=vd.exec(e);if(null===t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const r={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},n=r.nodeName&&r.nodeName.lastIndexOf(".");if(void 0!==n&&-1!==n){const e=r.nodeName.substring(n+1);-1!==_d.indexOf(e)&&(r.nodeName=r.nodeName.substring(0,n),r.objectName=e)}if(null===r.propertyName||0===r.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r}static findNode(e,t){if(void 0===t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){const r=e.skeleton.getBoneByName(t);if(void 0!==r)return r}if(e.children){const r=function(e){for(let n=0;n<e.length;n++){const i=e[n];if(i.name===t||i.uuid===t)return i;const s=r(i.children);if(s)return s}return null},n=r(e.children);if(n)return n}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const r=this.resolvedProperty;for(let n=0,i=r.length;n!==i;++n)e[t++]=r[n]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const r=this.resolvedProperty;for(let n=0,i=r.length;n!==i;++n)r[n]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const r=this.resolvedProperty;for(let n=0,i=r.length;n!==i;++n)r[n]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const r=this.resolvedProperty;for(let n=0,i=r.length;n!==i;++n)r[n]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,r=t.objectName,n=t.propertyName;let i=t.propertyIndex;if(e||(e=PropertyBinding.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e)return void console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");if(r){let n=t.objectIndex;switch(r){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(let t=0;t<e.length;t++)if(e[t].name===n){n=t;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.map)return void console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);e=e.material.map;break;default:if(void 0===e[r])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[r]}if(void 0!==n){if(void 0===e[n])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[n]}}const s=e[n];if(void 0===s){const r=t.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+r+"."+n+" but it wasn't found.",e)}let o=this.Versioning.None;this.targetObject=e,void 0!==e.needsUpdate?o=this.Versioning.NeedsUpdate:void 0!==e.matrixWorldNeedsUpdate&&(o=this.Versioning.MatrixWorldNeedsUpdate);let a=this.BindingType.Direct;if(void 0!==i){if("morphTargetInfluences"===n){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!e.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==e.morphTargetDictionary[i]&&(i=e.morphTargetDictionary[i])}a=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=i}else void 0!==s.fromArray&&void 0!==s.toArray?(a=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(a=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=n;this.getValue=this.GetterByBindingType[a],this.setValue=this.SetterByBindingTypeAndVersioning[a][o]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}PropertyBinding.Composite=class Composite{constructor(e,t,r){const n=r||PropertyBinding.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,n)}getValue(e,t){this.bind();const r=this._targetGroup.nCachedObjects_,n=this._bindings[r];void 0!==n&&n.getValue(e,t)}setValue(e,t){const r=this._bindings;for(let n=this._targetGroup.nCachedObjects_,i=r.length;n!==i;++n)r[n].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].unbind()}},PropertyBinding.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},PropertyBinding.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},PropertyBinding.prototype.GetterByBindingType=[PropertyBinding.prototype._getValue_direct,PropertyBinding.prototype._getValue_array,PropertyBinding.prototype._getValue_arrayElement,PropertyBinding.prototype._getValue_toArray],PropertyBinding.prototype.SetterByBindingTypeAndVersioning=[[PropertyBinding.prototype._setValue_direct,PropertyBinding.prototype._setValue_direct_setNeedsUpdate,PropertyBinding.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[PropertyBinding.prototype._setValue_array,PropertyBinding.prototype._setValue_array_setNeedsUpdate,PropertyBinding.prototype._setValue_array_setMatrixWorldNeedsUpdate],[PropertyBinding.prototype._setValue_arrayElement,PropertyBinding.prototype._setValue_arrayElement_setNeedsUpdate,PropertyBinding.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[PropertyBinding.prototype._setValue_fromArray,PropertyBinding.prototype._setValue_fromArray_setNeedsUpdate,PropertyBinding.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class AnimationObjectGroup{constructor(){this.isAnimationObjectGroup=!0,this.uuid=Cn(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let t=0,r=arguments.length;t!==r;++t)e[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}add(){const e=this._objects,t=this._indicesByUUID,r=this._paths,n=this._parsedPaths,i=this._bindings,s=i.length;let o,a=e.length,l=this.nCachedObjects_;for(let c=0,u=arguments.length;c!==u;++c){const u=arguments[c],d=u.uuid;let h=t[d];if(void 0===h){h=a++,t[d]=h,e.push(u);for(let e=0,t=s;e!==t;++e)i[e].push(new PropertyBinding(u,r[e],n[e]))}else if(h<l){o=e[h];const a=--l,c=e[a];t[c.uuid]=h,e[h]=c,t[d]=a,e[a]=u;for(let e=0,t=s;e!==t;++e){const t=i[e],s=t[a];let o=t[h];t[h]=s,void 0===o&&(o=new PropertyBinding(u,r[e],n[e])),t[a]=o}}else e[h]!==o&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=l}remove(){const e=this._objects,t=this._indicesByUUID,r=this._bindings,n=r.length;let i=this.nCachedObjects_;for(let s=0,o=arguments.length;s!==o;++s){const o=arguments[s],a=o.uuid,l=t[a];if(void 0!==l&&l>=i){const s=i++,c=e[s];t[c.uuid]=l,e[l]=c,t[a]=s,e[s]=o;for(let e=0,t=n;e!==t;++e){const t=r[e],n=t[s],i=t[l];t[l]=n,t[s]=i}}}this.nCachedObjects_=i}uncache(){const e=this._objects,t=this._indicesByUUID,r=this._bindings,n=r.length;let i=this.nCachedObjects_,s=e.length;for(let o=0,a=arguments.length;o!==a;++o){const a=arguments[o].uuid,l=t[a];if(void 0!==l)if(delete t[a],l<i){const o=--i,a=e[o],c=--s,u=e[c];t[a.uuid]=l,e[l]=a,t[u.uuid]=o,e[o]=u,e.pop();for(let e=0,t=n;e!==t;++e){const t=r[e],n=t[o],i=t[c];t[l]=n,t[o]=i,t.pop()}}else{const i=--s,o=e[i];i>0&&(t[o.uuid]=l),e[l]=o,e.pop();for(let e=0,t=n;e!==t;++e){const t=r[e];t[l]=t[i],t.pop()}}}this.nCachedObjects_=i}subscribe_(e,t){const r=this._bindingsIndicesByPath;let n=r[e];const i=this._bindings;if(void 0!==n)return i[n];const s=this._paths,o=this._parsedPaths,a=this._objects,l=a.length,c=this.nCachedObjects_,u=new Array(l);n=i.length,r[e]=n,s.push(e),o.push(t),i.push(u);for(let r=c,n=a.length;r!==n;++r){const n=a[r];u[r]=new PropertyBinding(n,e,t)}return u}unsubscribe_(e){const t=this._bindingsIndicesByPath,r=t[e];if(void 0!==r){const n=this._paths,i=this._parsedPaths,s=this._bindings,o=s.length-1,a=s[o];t[e[o]]=r,s[r]=a,s.pop(),i[r]=i[o],i.pop(),n[r]=n[o],n.pop()}}}class AnimationAction{constructor(e,t,r=null,n=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=r,this.blendMode=n;const i=t.tracks,s=i.length,o=new Array(s),a={endingStart:yr,endingEnd:yr};for(let e=0;e!==s;++e){const t=i[e].createInterpolant(null);o[e]=t,t.settings=a}this._interpolantSettings=a,this._interpolants=o,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=hr,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,r){if(e.fadeOut(t),this.fadeIn(t),r){const r=this._clip.duration,n=e._clip.duration,i=n/r,s=r/n;e.warp(1,i,t),this.warp(s,1,t)}return this}crossFadeTo(e,t,r){return e.crossFadeFrom(this,t,r)}stopFading(){const e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,r){const n=this._mixer,i=n.time,s=this.timeScale;let o=this._timeScaleInterpolant;null===o&&(o=n._lendControlInterpolant(),this._timeScaleInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=i,a[1]=i+r,l[0]=e/s,l[1]=t/s,this}stopWarping(){const e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,r,n){if(!this.enabled)return void this._updateWeight(e);const i=this._startTime;if(null!==i){const n=(e-i)*r;n<0||0===r?t=0:(this._startTime=null,t=r*n)}t*=this._updateTimeScale(e);const s=this._updateTime(t),o=this._updateWeight(e);if(o>0){const e=this._interpolants,t=this._propertyBindings;if(this.blendMode===xr)for(let r=0,n=e.length;r!==n;++r)e[r].evaluate(s),t[r].accumulateAdditive(o);else for(let r=0,i=e.length;r!==i;++r)e[r].evaluate(s),t[r].accumulate(n,o)}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const r=this._weightInterpolant;if(null!==r){const n=r.evaluate(e)[0];t*=n,e>r.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const r=this._timeScaleInterpolant;if(null!==r){t*=r.evaluate(e)[0],e>r.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,r=this.loop;let n=this.time+e,i=this._loopCount;const s=r===pr;if(0===e)return-1===i?n:s&&1==(1&i)?t-n:n;if(r===dr){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(n>=t)n=t;else{if(!(n<0)){this.time=n;break e}n=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===i&&(e>=0?(i=0,this._setEndings(!0,0===this.repetitions,s)):this._setEndings(0===this.repetitions,!0,s)),n>=t||n<0){const r=Math.floor(n/t);n-=t*r,i+=Math.abs(r);const o=this.repetitions-i;if(o<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,n=e>0?t:0,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===o){const t=e<0;this._setEndings(t,!t,s)}else this._setEndings(!1,!1,s);this._loopCount=i,this.time=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:r})}}else this.time=n;if(s&&1==(1&i))return t-n}return n}_setEndings(e,t,r){const n=this._interpolantSettings;r?(n.endingStart=br,n.endingEnd=br):(n.endingStart=e?this.zeroSlopeAtStart?br:yr:vr,n.endingEnd=t?this.zeroSlopeAtEnd?br:yr:vr)}_scheduleFading(e,t,r){const n=this._mixer,i=n.time;let s=this._weightInterpolant;null===s&&(s=n._lendControlInterpolant(),this._weightInterpolant=s);const o=s.parameterPositions,a=s.sampleValues;return o[0]=i,a[0]=t,o[1]=i+e,a[1]=r,this}}const xd=new Float32Array(1);class AnimationMixer extends EventDispatcher{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const r=e._localRoot||this._root,n=e._clip.tracks,i=n.length,s=e._propertyBindings,o=e._interpolants,a=r.uuid,l=this._bindingsByRootAndName;let c=l[a];void 0===c&&(c={},l[a]=c);for(let e=0;e!==i;++e){const i=n[e],l=i.name;let u=c[l];if(void 0!==u)++u.referenceCount,s[e]=u;else{if(u=s[e],void 0!==u){null===u._cacheIndex&&(++u.referenceCount,this._addInactiveBinding(u,a,l));continue}const n=t&&t._propertyBindings[e].binding.parsedPath;u=new PropertyMixer(PropertyBinding.create(r,l,n),i.ValueTypeName,i.getValueSize()),++u.referenceCount,this._addInactiveBinding(u,a,l),s[e]=u}o[e].resultBuffer=u.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){const t=(e._localRoot||this._root).uuid,r=e._clip.uuid,n=this._actionsByClip[r];this._bindAction(e,n&&n.knownActions[0]),this._addInactiveAction(e,r,t)}const t=e._propertyBindings;for(let e=0,r=t.length;e!==r;++e){const r=t[e];0==r.useCount++&&(this._lendBinding(r),r.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let e=0,r=t.length;e!==r;++e){const r=t[e];0==--r.useCount&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return null!==t&&t<this._nActiveActions}_addInactiveAction(e,t,r){const n=this._actions,i=this._actionsByClip;let s=i[t];if(void 0===s)s={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,i[t]=s;else{const t=s.knownActions;e._byClipCacheIndex=t.length,t.push(e)}e._cacheIndex=n.length,n.push(e),s.actionByRoot[r]=e}_removeInactiveAction(e){const t=this._actions,r=t[t.length-1],n=e._cacheIndex;r._cacheIndex=n,t[n]=r,t.pop(),e._cacheIndex=null;const i=e._clip.uuid,s=this._actionsByClip,o=s[i],a=o.knownActions,l=a[a.length-1],c=e._byClipCacheIndex;l._byClipCacheIndex=c,a[c]=l,a.pop(),e._byClipCacheIndex=null;delete o.actionByRoot[(e._localRoot||this._root).uuid],0===a.length&&delete s[i],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let e=0,r=t.length;e!==r;++e){const r=t[e];0==--r.referenceCount&&this._removeInactiveBinding(r)}}_lendAction(e){const t=this._actions,r=e._cacheIndex,n=this._nActiveActions++,i=t[n];e._cacheIndex=n,t[n]=e,i._cacheIndex=r,t[r]=i}_takeBackAction(e){const t=this._actions,r=e._cacheIndex,n=--this._nActiveActions,i=t[n];e._cacheIndex=n,t[n]=e,i._cacheIndex=r,t[r]=i}_addInactiveBinding(e,t,r){const n=this._bindingsByRootAndName,i=this._bindings;let s=n[t];void 0===s&&(s={},n[t]=s),s[r]=e,e._cacheIndex=i.length,i.push(e)}_removeInactiveBinding(e){const t=this._bindings,r=e.binding,n=r.rootNode.uuid,i=r.path,s=this._bindingsByRootAndName,o=s[n],a=t[t.length-1],l=e._cacheIndex;a._cacheIndex=l,t[l]=a,t.pop(),delete o[i],0===Object.keys(o).length&&delete s[n]}_lendBinding(e){const t=this._bindings,r=e._cacheIndex,n=this._nActiveBindings++,i=t[n];e._cacheIndex=n,t[n]=e,i._cacheIndex=r,t[r]=i}_takeBackBinding(e){const t=this._bindings,r=e._cacheIndex,n=--this._nActiveBindings,i=t[n];e._cacheIndex=n,t[n]=e,i._cacheIndex=r,t[r]=i}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let r=e[t];return void 0===r&&(r=new LinearInterpolant(new Float32Array(2),new Float32Array(2),1,xd),r.__cacheIndex=t,e[t]=r),r}_takeBackControlInterpolant(e){const t=this._controlInterpolants,r=e.__cacheIndex,n=--this._nActiveControlInterpolants,i=t[n];e.__cacheIndex=n,t[n]=e,i.__cacheIndex=r,t[r]=i}clipAction(e,t,r){const n=t||this._root,i=n.uuid;let s="string"==typeof e?AnimationClip.findByName(n,e):e;const o=null!==s?s.uuid:e,a=this._actionsByClip[o];let l=null;if(void 0===r&&(r=null!==s?s.blendMode:_r),void 0!==a){const e=a.actionByRoot[i];if(void 0!==e&&e.blendMode===r)return e;l=a.knownActions[0],null===s&&(s=l._clip)}if(null===s)return null;const c=new AnimationAction(this,s,t,r);return this._bindAction(c,l),this._addInactiveAction(c,o,i),c}existingAction(e,t){const r=t||this._root,n=r.uuid,i="string"==typeof e?AnimationClip.findByName(r,e):e,s=i?i.uuid:e,o=this._actionsByClip[s];return void 0!==o&&o.actionByRoot[n]||null}stopAllAction(){const e=this._actions;for(let t=this._nActiveActions-1;t>=0;--t)e[t].stop();return this}update(e){e*=this.timeScale;const t=this._actions,r=this._nActiveActions,n=this.time+=e,i=Math.sign(e),s=this._accuIndex^=1;for(let o=0;o!==r;++o){t[o]._update(n,e,i,s)}const o=this._bindings,a=this._nActiveBindings;for(let e=0;e!==a;++e)o[e].apply(s);return this}setTime(e){this.time=0;for(let e=0;e<this._actions.length;e++)this._actions[e].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,r=e.uuid,n=this._actionsByClip,i=n[r];if(void 0!==i){const e=i.knownActions;for(let r=0,n=e.length;r!==n;++r){const n=e[r];this._deactivateAction(n);const i=n._cacheIndex,s=t[t.length-1];n._cacheIndex=null,n._byClipCacheIndex=null,s._cacheIndex=i,t[i]=s,t.pop(),this._removeInactiveBindingsForAction(n)}delete n[r]}}uncacheRoot(e){const t=e.uuid,r=this._actionsByClip;for(const e in r){const n=r[e].actionByRoot[t];void 0!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}const n=this._bindingsByRootAndName[t];if(void 0!==n)for(const e in n){const t=n[e];t.restoreOriginalState(),this._removeInactiveBinding(t)}}uncacheAction(e,t){const r=this.existingAction(e,t);null!==r&&(this._deactivateAction(r),this._removeInactiveAction(r))}}class Uniform{constructor(e){this.value=e}clone(){return new Uniform(void 0===this.value.clone?this.value:this.value.clone())}}let wd=0;class UniformsGroup extends EventDispatcher{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:wd++}),this.name="",this.usage=cn,this.uniforms=[]}add(e){return this.uniforms.push(e),this}remove(e){const t=this.uniforms.indexOf(e);return-1!==t&&this.uniforms.splice(t,1),this}setName(e){return this.name=e,this}setUsage(e){return this.usage=e,this}dispose(){return this.dispatchEvent({type:"dispose"}),this}copy(e){this.name=e.name,this.usage=e.usage;const t=e.uniforms;this.uniforms.length=0;for(let e=0,r=t.length;e<r;e++){const r=Array.isArray(t[e])?t[e]:[t[e]];for(let e=0;e<r.length;e++)this.uniforms.push(r[e].clone())}return this}clone(){return(new this.constructor).copy(this)}}class InstancedInterleavedBuffer extends InterleavedBuffer{constructor(e,t,r=1){super(e,t),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}class GLBufferAttribute{constructor(e,t,r,n,i){this.isGLBufferAttribute=!0,this.name="",this.buffer=e,this.type=t,this.itemSize=r,this.elementSize=n,this.count=i,this.version=0}set needsUpdate(e){!0===e&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}}const Sd=new Matrix4;class Raycaster{constructor(e,t,r=0,n=1/0){this.ray=new Ray(e,t),this.near=r,this.far=n,this.camera=null,this.layers=new Layers,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}setFromXRController(e){return Sd.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(Sd),this}intersectObject(e,t=!0,r=[]){return Md(e,this,r,t),r.sort(Ed),r}intersectObjects(e,t=!0,r=[]){for(let n=0,i=e.length;n<i;n++)Md(e[n],this,r,t);return r.sort(Ed),r}}function Ed(e,t){return e.distance-t.distance}function Md(e,t,r,n){if(e.layers.test(t.layers)&&e.raycast(t,r),!0===n){const n=e.children;for(let e=0,i=n.length;e<i;e++)Md(n[e],t,r,!0)}}class Spherical{constructor(e=1,t=0,r=0){return this.radius=e,this.phi=t,this.theta=r,this}set(e,t,r){return this.radius=e,this.phi=t,this.theta=r,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){const e=1e-6;return this.phi=Math.max(e,Math.min(Math.PI-e,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,r){return this.radius=Math.sqrt(e*e+t*t+r*r),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,r),this.phi=Math.acos(An(t/this.radius,-1,1))),this}clone(){return(new this.constructor).copy(this)}}class Cylindrical{constructor(e=1,t=0,r=0){return this.radius=e,this.theta=t,this.y=r,this}set(e,t,r){return this.radius=e,this.theta=t,this.y=r,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,r){return this.radius=Math.sqrt(e*e+r*r),this.theta=Math.atan2(e,r),this.y=t,this}clone(){return(new this.constructor).copy(this)}}const Cd=new Vector2;class Box2{constructor(e=new Vector2(1/0,1/0),t=new Vector2(-1/0,-1/0)){this.isBox2=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,r=e.length;t<r;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const r=Cd.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(r),this.max.copy(e).add(r),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Cd).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const Ad=new Vector3,Td=new Vector3;class Line3{constructor(e=new Vector3,t=new Vector3){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){Ad.subVectors(e,this.start),Td.subVectors(this.end,this.start);const r=Td.dot(Td);let n=Td.dot(Ad)/r;return t&&(n=An(n,0,1)),n}closestPointToPoint(e,t,r){const n=this.closestPointToPointParameter(e,t);return this.delta(r).multiplyScalar(n).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return(new this.constructor).copy(this)}}const Dd=new Vector3;class SpotLightHelper extends Object3D{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const r=new BufferGeometry,n=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let e=0,t=1,r=32;e<r;e++,t++){const i=e/r*Math.PI*2,s=t/r*Math.PI*2;n.push(Math.cos(i),Math.sin(i),1,Math.cos(s),Math.sin(s),1)}r.setAttribute("position",new Float32BufferAttribute(n,3));const i=new LineBasicMaterial({fog:!1,toneMapped:!1});this.cone=new LineSegments(r,i),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),this.parent?(this.parent.updateWorldMatrix(!0),this.matrix.copy(this.parent.matrixWorld).invert().multiply(this.light.matrixWorld)):this.matrix.copy(this.light.matrixWorld),this.matrixWorld.copy(this.light.matrixWorld);const e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),Dd.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Dd),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const Od=new Vector3,Rd=new Matrix4,Ld=new Matrix4;class SkeletonHelper extends LineSegments{constructor(e){const t=kd(e),r=new BufferGeometry,n=[],i=[],s=new Color(0,0,1),o=new Color(0,1,0);for(let e=0;e<t.length;e++){const r=t[e];r.parent&&r.parent.isBone&&(n.push(0,0,0),n.push(0,0,0),i.push(s.r,s.g,s.b),i.push(o.r,o.g,o.b))}r.setAttribute("position",new Float32BufferAttribute(n,3)),r.setAttribute("color",new Float32BufferAttribute(i,3));super(r,new LineBasicMaterial({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0})),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(e){const t=this.bones,r=this.geometry,n=r.getAttribute("position");Ld.copy(this.root.matrixWorld).invert();for(let e=0,r=0;e<t.length;e++){const i=t[e];i.parent&&i.parent.isBone&&(Rd.multiplyMatrices(Ld,i.matrixWorld),Od.setFromMatrixPosition(Rd),n.setXYZ(r,Od.x,Od.y,Od.z),Rd.multiplyMatrices(Ld,i.parent.matrixWorld),Od.setFromMatrixPosition(Rd),n.setXYZ(r+1,Od.x,Od.y,Od.z),r+=2)}r.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose()}}function kd(e){const t=[];!0===e.isBone&&t.push(e);for(let r=0;r<e.children.length;r++)t.push.apply(t,kd(e.children[r]));return t}class PointLightHelper extends Mesh{constructor(e,t,r){super(new SphereGeometry(t,4,2),new MeshBasicMaterial({wireframe:!0,fog:!1,toneMapped:!1})),this.light=e,this.color=r,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const Nd=new Vector3,Fd=new Color,Id=new Color;class HemisphereLightHelper extends Object3D{constructor(e,t,r){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=r,this.type="HemisphereLightHelper";const n=new OctahedronGeometry(t);n.rotateY(.5*Math.PI),this.material=new MeshBasicMaterial({wireframe:!0,fog:!1,toneMapped:!1}),void 0===this.color&&(this.material.vertexColors=!0);const i=n.getAttribute("position"),s=new Float32Array(3*i.count);n.setAttribute("color",new BufferAttribute(s,3)),this.add(new Mesh(n,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const e=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{const t=e.geometry.getAttribute("color");Fd.copy(this.light.color),Id.copy(this.light.groundColor);for(let e=0,r=t.count;e<r;e++){const n=e<r/2?Fd:Id;t.setXYZ(e,n.r,n.g,n.b)}t.needsUpdate=!0}this.light.updateWorldMatrix(!0,!1),e.lookAt(Nd.setFromMatrixPosition(this.light.matrixWorld).negate())}}class GridHelper extends LineSegments{constructor(e=10,t=10,r=4473924,n=8947848){r=new Color(r),n=new Color(n);const i=t/2,s=e/t,o=e/2,a=[],l=[];for(let e=0,c=0,u=-o;e<=t;e++,u+=s){a.push(-o,0,u,o,0,u),a.push(u,0,-o,u,0,o);const t=e===i?r:n;t.toArray(l,c),c+=3,t.toArray(l,c),c+=3,t.toArray(l,c),c+=3,t.toArray(l,c),c+=3}const c=new BufferGeometry;c.setAttribute("position",new Float32BufferAttribute(a,3)),c.setAttribute("color",new Float32BufferAttribute(l,3));super(c,new LineBasicMaterial({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class PolarGridHelper extends LineSegments{constructor(e=10,t=16,r=8,n=64,i=4473924,s=8947848){i=new Color(i),s=new Color(s);const o=[],a=[];if(t>1)for(let r=0;r<t;r++){const n=r/t*(2*Math.PI),l=Math.sin(n)*e,c=Math.cos(n)*e;o.push(0,0,0),o.push(l,0,c);const u=1&r?i:s;a.push(u.r,u.g,u.b),a.push(u.r,u.g,u.b)}for(let t=0;t<r;t++){const l=1&t?i:s,c=e-e/r*t;for(let e=0;e<n;e++){let t=e/n*(2*Math.PI),r=Math.sin(t)*c,i=Math.cos(t)*c;o.push(r,0,i),a.push(l.r,l.g,l.b),t=(e+1)/n*(2*Math.PI),r=Math.sin(t)*c,i=Math.cos(t)*c,o.push(r,0,i),a.push(l.r,l.g,l.b)}}const l=new BufferGeometry;l.setAttribute("position",new Float32BufferAttribute(o,3)),l.setAttribute("color",new Float32BufferAttribute(a,3));super(l,new LineBasicMaterial({vertexColors:!0,toneMapped:!1})),this.type="PolarGridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}const Bd=new Vector3,jd=new Vector3,Hd=new Vector3;class DirectionalLightHelper extends Object3D{constructor(e,t,r){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=r,this.type="DirectionalLightHelper",void 0===t&&(t=1);let n=new BufferGeometry;n.setAttribute("position",new Float32BufferAttribute([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const i=new LineBasicMaterial({fog:!1,toneMapped:!1});this.lightPlane=new Line(n,i),this.add(this.lightPlane),n=new BufferGeometry,n.setAttribute("position",new Float32BufferAttribute([0,0,0,0,0,1],3)),this.targetLine=new Line(n,i),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),Bd.setFromMatrixPosition(this.light.matrixWorld),jd.setFromMatrixPosition(this.light.target.matrixWorld),Hd.subVectors(jd,Bd),this.lightPlane.lookAt(jd),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(jd),this.targetLine.scale.z=Hd.length()}}const Ud=new Vector3,zd=new Camera;class CameraHelper extends LineSegments{constructor(e){const t=new BufferGeometry,r=new LineBasicMaterial({color:16777215,vertexColors:!0,toneMapped:!1}),n=[],i=[],s={};function o(e,t){a(e),a(t)}function a(e){n.push(0,0,0),i.push(0,0,0),void 0===s[e]&&(s[e]=[]),s[e].push(n.length/3-1)}o("n1","n2"),o("n2","n4"),o("n4","n3"),o("n3","n1"),o("f1","f2"),o("f2","f4"),o("f4","f3"),o("f3","f1"),o("n1","f1"),o("n2","f2"),o("n3","f3"),o("n4","f4"),o("p","n1"),o("p","n2"),o("p","n3"),o("p","n4"),o("u1","u2"),o("u2","u3"),o("u3","u1"),o("c","t"),o("p","c"),o("cn1","cn2"),o("cn3","cn4"),o("cf1","cf2"),o("cf3","cf4"),t.setAttribute("position",new Float32BufferAttribute(n,3)),t.setAttribute("color",new Float32BufferAttribute(i,3)),super(t,r),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=s,this.update();const l=new Color(16755200),c=new Color(16711680),u=new Color(43775),d=new Color(16777215),h=new Color(3355443);this.setColors(l,c,u,d,h)}setColors(e,t,r,n,i){const s=this.geometry.getAttribute("color");s.setXYZ(0,e.r,e.g,e.b),s.setXYZ(1,e.r,e.g,e.b),s.setXYZ(2,e.r,e.g,e.b),s.setXYZ(3,e.r,e.g,e.b),s.setXYZ(4,e.r,e.g,e.b),s.setXYZ(5,e.r,e.g,e.b),s.setXYZ(6,e.r,e.g,e.b),s.setXYZ(7,e.r,e.g,e.b),s.setXYZ(8,e.r,e.g,e.b),s.setXYZ(9,e.r,e.g,e.b),s.setXYZ(10,e.r,e.g,e.b),s.setXYZ(11,e.r,e.g,e.b),s.setXYZ(12,e.r,e.g,e.b),s.setXYZ(13,e.r,e.g,e.b),s.setXYZ(14,e.r,e.g,e.b),s.setXYZ(15,e.r,e.g,e.b),s.setXYZ(16,e.r,e.g,e.b),s.setXYZ(17,e.r,e.g,e.b),s.setXYZ(18,e.r,e.g,e.b),s.setXYZ(19,e.r,e.g,e.b),s.setXYZ(20,e.r,e.g,e.b),s.setXYZ(21,e.r,e.g,e.b),s.setXYZ(22,e.r,e.g,e.b),s.setXYZ(23,e.r,e.g,e.b),s.setXYZ(24,t.r,t.g,t.b),s.setXYZ(25,t.r,t.g,t.b),s.setXYZ(26,t.r,t.g,t.b),s.setXYZ(27,t.r,t.g,t.b),s.setXYZ(28,t.r,t.g,t.b),s.setXYZ(29,t.r,t.g,t.b),s.setXYZ(30,t.r,t.g,t.b),s.setXYZ(31,t.r,t.g,t.b),s.setXYZ(32,r.r,r.g,r.b),s.setXYZ(33,r.r,r.g,r.b),s.setXYZ(34,r.r,r.g,r.b),s.setXYZ(35,r.r,r.g,r.b),s.setXYZ(36,r.r,r.g,r.b),s.setXYZ(37,r.r,r.g,r.b),s.setXYZ(38,n.r,n.g,n.b),s.setXYZ(39,n.r,n.g,n.b),s.setXYZ(40,i.r,i.g,i.b),s.setXYZ(41,i.r,i.g,i.b),s.setXYZ(42,i.r,i.g,i.b),s.setXYZ(43,i.r,i.g,i.b),s.setXYZ(44,i.r,i.g,i.b),s.setXYZ(45,i.r,i.g,i.b),s.setXYZ(46,i.r,i.g,i.b),s.setXYZ(47,i.r,i.g,i.b),s.setXYZ(48,i.r,i.g,i.b),s.setXYZ(49,i.r,i.g,i.b),s.needsUpdate=!0}update(){const e=this.geometry,t=this.pointMap;zd.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),Gd("c",t,e,zd,0,0,-1),Gd("t",t,e,zd,0,0,1),Gd("n1",t,e,zd,-1,-1,-1),Gd("n2",t,e,zd,1,-1,-1),Gd("n3",t,e,zd,-1,1,-1),Gd("n4",t,e,zd,1,1,-1),Gd("f1",t,e,zd,-1,-1,1),Gd("f2",t,e,zd,1,-1,1),Gd("f3",t,e,zd,-1,1,1),Gd("f4",t,e,zd,1,1,1),Gd("u1",t,e,zd,.7,1.1,-1),Gd("u2",t,e,zd,-.7,1.1,-1),Gd("u3",t,e,zd,0,2,-1),Gd("cf1",t,e,zd,-1,0,1),Gd("cf2",t,e,zd,1,0,1),Gd("cf3",t,e,zd,0,-1,1),Gd("cf4",t,e,zd,0,1,1),Gd("cn1",t,e,zd,-1,0,-1),Gd("cn2",t,e,zd,1,0,-1),Gd("cn3",t,e,zd,0,-1,-1),Gd("cn4",t,e,zd,0,1,-1),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function Gd(e,t,r,n,i,s,o){Ud.set(i,s,o).unproject(n);const a=t[e];if(void 0!==a){const e=r.getAttribute("position");for(let t=0,r=a.length;t<r;t++)e.setXYZ(a[t],Ud.x,Ud.y,Ud.z)}}const Wd=new Box3;class BoxHelper extends LineSegments{constructor(e,t=16776960){const r=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=new Float32Array(24),i=new BufferGeometry;i.setIndex(new BufferAttribute(r,1)),i.setAttribute("position",new BufferAttribute(n,3)),super(i,new LineBasicMaterial({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(e){if(void 0!==e&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&Wd.setFromObject(this.object),Wd.isEmpty())return;const t=Wd.min,r=Wd.max,n=this.geometry.attributes.position,i=n.array;i[0]=r.x,i[1]=r.y,i[2]=r.z,i[3]=t.x,i[4]=r.y,i[5]=r.z,i[6]=t.x,i[7]=t.y,i[8]=r.z,i[9]=r.x,i[10]=t.y,i[11]=r.z,i[12]=r.x,i[13]=r.y,i[14]=t.z,i[15]=t.x,i[16]=r.y,i[17]=t.z,i[18]=t.x,i[19]=t.y,i[20]=t.z,i[21]=r.x,i[22]=t.y,i[23]=t.z,n.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e,t){return super.copy(e,t),this.object=e.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class Box3Helper extends LineSegments{constructor(e,t=16776960){const r=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=new BufferGeometry;n.setIndex(new BufferAttribute(r,1)),n.setAttribute("position",new Float32BufferAttribute([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),super(n,new LineBasicMaterial({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}dispose(){this.geometry.dispose(),this.material.dispose()}}class PlaneHelper extends Line{constructor(e,t=1,r=16776960){const n=r,i=new BufferGeometry;i.setAttribute("position",new Float32BufferAttribute([1,-1,0,-1,1,0,-1,-1,0,1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],3)),i.computeBoundingSphere(),super(i,new LineBasicMaterial({color:n,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;const s=new BufferGeometry;s.setAttribute("position",new Float32BufferAttribute([1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],3)),s.computeBoundingSphere(),this.add(new Mesh(s,new MeshBasicMaterial({color:n,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){this.position.set(0,0,0),this.scale.set(.5*this.size,.5*this.size,1),this.lookAt(this.plane.normal),this.translateZ(-this.plane.constant),super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}}const Vd=new Vector3;let qd,$d;class ArrowHelper extends Object3D{constructor(e=new Vector3(0,0,1),t=new Vector3(0,0,0),r=1,n=16776960,i=.2*r,s=.2*i){super(),this.type="ArrowHelper",void 0===qd&&(qd=new BufferGeometry,qd.setAttribute("position",new Float32BufferAttribute([0,0,0,0,1,0],3)),$d=new CylinderGeometry(0,.5,1,5,1),$d.translate(0,-.5,0)),this.position.copy(t),this.line=new Line(qd,new LineBasicMaterial({color:n,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Mesh($d,new MeshBasicMaterial({color:n,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(r,i,s)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{Vd.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(Vd,t)}}setLength(e,t=.2*e,r=.2*t){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(r,t,r),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class AxesHelper extends LineSegments{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],r=new BufferGeometry;r.setAttribute("position",new Float32BufferAttribute(t,3)),r.setAttribute("color",new Float32BufferAttribute([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));super(r,new LineBasicMaterial({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(e,t,r){const n=new Color,i=this.geometry.attributes.color.array;return n.set(e),n.toArray(i,0),n.toArray(i,3),n.set(t),n.toArray(i,6),n.toArray(i,9),n.set(r),n.toArray(i,12),n.toArray(i,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class ShapePath{constructor(){this.type="ShapePath",this.color=new Color,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Path,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,r,n){return this.currentPath.quadraticCurveTo(e,t,r,n),this}bezierCurveTo(e,t,r,n,i,s){return this.currentPath.bezierCurveTo(e,t,r,n,i,s),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(e,t){const r=t.length;let n=!1;for(let i=r-1,s=0;s<r;i=s++){let r=t[i],o=t[s],a=o.x-r.x,l=o.y-r.y;if(Math.abs(l)>Number.EPSILON){if(l<0&&(r=t[s],a=-a,o=t[i],l=-l),e.y<r.y||e.y>o.y)continue;if(e.y===r.y){if(e.x===r.x)return!0}else{const t=l*(e.x-r.x)-a*(e.y-r.y);if(0===t)return!0;if(t<0)continue;n=!n}}else{if(e.y!==r.y)continue;if(o.x<=e.x&&e.x<=r.x||r.x<=e.x&&e.x<=o.x)return!0}}return n}const r=ShapeUtils.isClockWise,n=this.subPaths;if(0===n.length)return[];let i,s,o;const a=[];if(1===n.length)return s=n[0],o=new Shape,o.curves=s.curves,a.push(o),a;let l=!r(n[0].getPoints());l=e?!l:l;const c=[],u=[];let d,h,p=[],m=0;u[m]=void 0,p[m]=[];for(let t=0,o=n.length;t<o;t++)s=n[t],d=s.getPoints(),i=r(d),i=e?!i:i,i?(!l&&u[m]&&m++,u[m]={s:new Shape,p:d},u[m].s.curves=s.curves,l&&m++,p[m]=[]):p[m].push({h:s,p:d[0]});if(!u[0])return function(e){const t=[];for(let r=0,n=e.length;r<n;r++){const n=e[r],i=new Shape;i.curves=n.curves,t.push(i)}return t}(n);if(u.length>1){let e=!1,r=0;for(let e=0,t=u.length;e<t;e++)c[e]=[];for(let n=0,i=u.length;n<i;n++){const i=p[n];for(let s=0;s<i.length;s++){const o=i[s];let a=!0;for(let i=0;i<u.length;i++)t(o.p,u[i].p)&&(n!==i&&r++,a?(a=!1,c[i].push(o)):e=!0);a&&c[n].push(o)}}r>0&&!1===e&&(p=c)}for(let e=0,t=u.length;e<t;e++){o=u[e].s,a.push(o),h=p[e];for(let e=0,t=h.length;e<t;e++)o.holes.push(h[e].h)}return a}}class WebGLMultipleRenderTargets extends WebGLRenderTarget{constructor(e=1,t=1,r=1,n={}){console.warn('THREE.WebGLMultipleRenderTargets has been deprecated and will be removed in r172. Use THREE.WebGLRenderTarget and set the "count" parameter to enable MRT.'),super(e,t,{...n,count:r}),this.isWebGLMultipleRenderTargets=!0}get texture(){return this.textures}}"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:n}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=n)},88631:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var n=!0,i="Invariant failed";function s(e,t){if(!e){if(n)throw new Error(i);var r="function"==typeof t?t():t,s=r?"".concat(i,": ").concat(r):i;throw new Error(s)}}},80388:(e,t,r)=>{"use strict";r.a(e,(async(e,n)=>{try{r.r(t),r.d(t,{AbortException:()=>a,AnnotationEditorLayer:()=>l,AnnotationEditorParamsType:()=>c,AnnotationEditorType:()=>u,AnnotationEditorUIManager:()=>d,AnnotationLayer:()=>h,AnnotationMode:()=>p,CMapCompressionType:()=>m,ColorPicker:()=>f,DOMSVGFactory:()=>g,DrawLayer:()=>y,FeatureTest:()=>b,GlobalWorkerOptions:()=>v,ImageKind:()=>_,InvalidPDFException:()=>x,MissingPDFException:()=>w,OPS:()=>R,Outliner:()=>k,PDFDataRangeTransport:()=>j,PDFDateString:()=>z,PDFWorker:()=>q,PasswordResponses:()=>$,PermissionFlag:()=>Z,PixelsPerInch:()=>X,RenderingCancelledException:()=>Y,UnexpectedResponseException:()=>ee,Util:()=>te,VerbosityLevel:()=>re,XfaLayer:()=>ne,build:()=>ie,createValidAbsoluteUrl:()=>se,fetchData:()=>oe,getDocument:()=>ae,getFilenameFromUrl:()=>le,getPdfFilenameFromUrl:()=>ce,getXfaPageViewport:()=>ue,isDataScheme:()=>de,isPdfFile:()=>he,noContextMenu:()=>pe,normalizeUnicode:()=>me,renderTextLayer:()=>fe,setLayerDimensions:()=>ge,shadow:()=>ye,updateTextLayer:()=>be,version:()=>ve});var i={976:(e,t,r)=>{r.d(t,{AnnotationLayer:()=>AnnotationLayer,FreeTextAnnotationElement:()=>FreeTextAnnotationElement,InkAnnotationElement:()=>InkAnnotationElement,StampAnnotationElement:()=>StampAnnotationElement});var n=r(292),i=r(419),s=r(792);function o(e){return Math.floor(255*Math.max(0,Math.min(1,e))).toString(16).padStart(2,"0")}function a(e){return Math.max(0,Math.min(255,255*e))}class ColorConverters{static CMYK_G([e,t,r,n]){return["G",1-Math.min(1,.3*e+.59*r+.11*t+n)]}static G_CMYK([e]){return["CMYK",0,0,0,1-e]}static G_RGB([e]){return["RGB",e,e,e]}static G_rgb([e]){return[e=a(e),e,e]}static G_HTML([e]){const t=o(e);return`#${t}${t}${t}`}static RGB_G([e,t,r]){return["G",.3*e+.59*t+.11*r]}static RGB_rgb(e){return e.map(a)}static RGB_HTML(e){return`#${e.map(o).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([e,t,r,n]){return["RGB",1-Math.min(1,e+n),1-Math.min(1,r+n),1-Math.min(1,t+n)]}static CMYK_rgb([e,t,r,n]){return[a(1-Math.min(1,e+n)),a(1-Math.min(1,r+n)),a(1-Math.min(1,t+n))]}static CMYK_HTML(e){const t=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(t)}static RGB_CMYK([e,t,r]){const n=1-e,i=1-t,s=1-r;return["CMYK",n,i,s,Math.min(n,i,s)]}}var l=r(284);const c=1e3,u=new WeakSet;function d(e){return{width:e[2]-e[0],height:e[3]-e[1]}}class AnnotationElementFactory{static create(e){switch(e.data.annotationType){case n.AnnotationType.LINK:return new LinkAnnotationElement(e);case n.AnnotationType.TEXT:return new TextAnnotationElement(e);case n.AnnotationType.WIDGET:switch(e.data.fieldType){case"Tx":return new TextWidgetAnnotationElement(e);case"Btn":return e.data.radioButton?new RadioButtonWidgetAnnotationElement(e):e.data.checkBox?new CheckboxWidgetAnnotationElement(e):new PushButtonWidgetAnnotationElement(e);case"Ch":return new ChoiceWidgetAnnotationElement(e);case"Sig":return new SignatureWidgetAnnotationElement(e)}return new WidgetAnnotationElement(e);case n.AnnotationType.POPUP:return new PopupAnnotationElement(e);case n.AnnotationType.FREETEXT:return new FreeTextAnnotationElement(e);case n.AnnotationType.LINE:return new LineAnnotationElement(e);case n.AnnotationType.SQUARE:return new SquareAnnotationElement(e);case n.AnnotationType.CIRCLE:return new CircleAnnotationElement(e);case n.AnnotationType.POLYLINE:return new PolylineAnnotationElement(e);case n.AnnotationType.CARET:return new CaretAnnotationElement(e);case n.AnnotationType.INK:return new InkAnnotationElement(e);case n.AnnotationType.POLYGON:return new PolygonAnnotationElement(e);case n.AnnotationType.HIGHLIGHT:return new HighlightAnnotationElement(e);case n.AnnotationType.UNDERLINE:return new UnderlineAnnotationElement(e);case n.AnnotationType.SQUIGGLY:return new SquigglyAnnotationElement(e);case n.AnnotationType.STRIKEOUT:return new StrikeOutAnnotationElement(e);case n.AnnotationType.STAMP:return new StampAnnotationElement(e);case n.AnnotationType.FILEATTACHMENT:return new FileAttachmentAnnotationElement(e);default:return new AnnotationElement(e)}}}class AnnotationElement{#M=null;#C=!1;constructor(e,{isRenderable:t=!1,ignoreBorder:r=!1,createQuadrilaterals:n=!1}={}){this.isRenderable=t,this.data=e.data,this.layer=e.layer,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderForms=e.renderForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,this.enableScripting=e.enableScripting,this.hasJSActions=e.hasJSActions,this._fieldObjects=e.fieldObjects,this.parent=e.parent,t&&(this.container=this._createContainer(r)),n&&this._createQuadrilaterals()}static _hasPopupData({titleObj:e,contentsObj:t,richText:r}){return!!(e?.str||t?.str||r?.str)}get hasPopupData(){return AnnotationElement._hasPopupData(this.data)}updateEdited(e){if(!this.container)return;this.#M||={rect:this.data.rect.slice(0)};const{rect:t}=e;t&&this.#A(t)}resetEdited(){this.#M&&(this.#A(this.#M.rect),this.#M=null)}#A(e){const{container:{style:t},data:{rect:r,rotation:n},parent:{viewport:{rawDims:{pageWidth:i,pageHeight:s,pageX:o,pageY:a}}}}=this;r?.splice(0,4,...e);const{width:l,height:c}=d(e);t.left=100*(e[0]-o)/i+"%",t.top=100*(s-e[3]+a)/s+"%",0===n?(t.width=100*l/i+"%",t.height=100*c/s+"%"):this.setRotation(n)}_createContainer(e){const{data:t,parent:{page:r,viewport:i}}=this,s=document.createElement("section");s.setAttribute("data-annotation-id",t.id),this instanceof WidgetAnnotationElement||(s.tabIndex=c);const{style:o}=s;if(o.zIndex=this.parent.zIndex++,t.popupRef&&s.setAttribute("aria-haspopup","dialog"),t.alternativeText&&(s.title=t.alternativeText),t.noRotate&&s.classList.add("norotate"),!t.rect||this instanceof PopupAnnotationElement){const{rotation:e}=t;return t.hasOwnCanvas||0===e||this.setRotation(e,s),s}const{width:a,height:l}=d(t.rect);if(!e&&t.borderStyle.width>0){o.borderWidth=`${t.borderStyle.width}px`;const e=t.borderStyle.horizontalCornerRadius,r=t.borderStyle.verticalCornerRadius;if(e>0||r>0){const t=`calc(${e}px * var(--scale-factor)) / calc(${r}px * var(--scale-factor))`;o.borderRadius=t}else if(this instanceof RadioButtonWidgetAnnotationElement){const e=`calc(${a}px * var(--scale-factor)) / calc(${l}px * var(--scale-factor))`;o.borderRadius=e}switch(t.borderStyle.style){case n.AnnotationBorderStyleType.SOLID:o.borderStyle="solid";break;case n.AnnotationBorderStyleType.DASHED:o.borderStyle="dashed";break;case n.AnnotationBorderStyleType.BEVELED:(0,n.warn)("Unimplemented border style: beveled");break;case n.AnnotationBorderStyleType.INSET:(0,n.warn)("Unimplemented border style: inset");break;case n.AnnotationBorderStyleType.UNDERLINE:o.borderBottomStyle="solid"}const i=t.borderColor||null;i?(this.#C=!0,o.borderColor=n.Util.makeHexColor(0|i[0],0|i[1],0|i[2])):o.borderWidth=0}const u=n.Util.normalizeRect([t.rect[0],r.view[3]-t.rect[1]+r.view[1],t.rect[2],r.view[3]-t.rect[3]+r.view[1]]),{pageWidth:h,pageHeight:p,pageX:m,pageY:f}=i.rawDims;o.left=100*(u[0]-m)/h+"%",o.top=100*(u[1]-f)/p+"%";const{rotation:g}=t;return t.hasOwnCanvas||0===g?(o.width=100*a/h+"%",o.height=100*l/p+"%"):this.setRotation(g,s),s}setRotation(e,t=this.container){if(!this.data.rect)return;const{pageWidth:r,pageHeight:n}=this.parent.viewport.rawDims,{width:i,height:s}=d(this.data.rect);let o,a;e%180==0?(o=100*i/r,a=100*s/n):(o=100*s/r,a=100*i/n),t.style.width=`${o}%`,t.style.height=`${a}%`,t.setAttribute("data-main-rotation",(360-e)%360)}get _commonActions(){const e=(e,t,r)=>{const n=r.detail[e],i=n[0],s=n.slice(1);r.target.style[t]=ColorConverters[`${i}_HTML`](s),this.annotationStorage.setValue(this.data.id,{[t]:ColorConverters[`${i}_rgb`](s)})};return(0,n.shadow)(this,"_commonActions",{display:e=>{const{display:t}=e.detail,r=t%2==1;this.container.style.visibility=r?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:r,noPrint:1===t||2===t})},print:e=>{this.annotationStorage.setValue(this.data.id,{noPrint:!e.detail.print})},hidden:e=>{const{hidden:t}=e.detail;this.container.style.visibility=t?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:t,noView:t})},focus:e=>{setTimeout((()=>e.target.focus({preventScroll:!1})),0)},userName:e=>{e.target.title=e.detail.userName},readonly:e=>{e.target.disabled=e.detail.readonly},required:e=>{this._setRequired(e.target,e.detail.required)},bgColor:t=>{e("bgColor","backgroundColor",t)},fillColor:t=>{e("fillColor","backgroundColor",t)},fgColor:t=>{e("fgColor","color",t)},textColor:t=>{e("textColor","color",t)},borderColor:t=>{e("borderColor","borderColor",t)},strokeColor:t=>{e("strokeColor","borderColor",t)},rotation:e=>{const t=e.detail.rotation;this.setRotation(t),this.annotationStorage.setValue(this.data.id,{rotation:t})}})}_dispatchEventFromSandbox(e,t){const r=this._commonActions;for(const n of Object.keys(t.detail)){const i=e[n]||r[n];i?.(t)}}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;const t=this.annotationStorage.getRawValue(this.data.id);if(!t)return;const r=this._commonActions;for(const[n,i]of Object.entries(t)){const s=r[n];if(s){s({detail:{[n]:i},target:e}),delete t[n]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:e}=this.data;if(!e)return;const[t,r,n,i]=this.data.rect;if(1===e.length){const[,{x:s,y:o},{x:a,y:l}]=e[0];if(n===s&&i===o&&t===a&&r===l)return}const{style:s}=this.container;let o;if(this.#C){const{borderColor:e,borderWidth:t}=s;s.borderWidth=0,o=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">',`<g fill="transparent" stroke="${e}" stroke-width="${t}">`],this.container.classList.add("hasBorder")}const a=n-t,l=i-r,{svgFactory:c}=this,u=c.createElement("svg");u.classList.add("quadrilateralsContainer"),u.setAttribute("width",0),u.setAttribute("height",0);const d=c.createElement("defs");u.append(d);const h=c.createElement("clipPath"),p=`clippath_${this.data.id}`;h.setAttribute("id",p),h.setAttribute("clipPathUnits","objectBoundingBox"),d.append(h);for(const[,{x:r,y:n},{x:s,y:u}]of e){const e=c.createElement("rect"),d=(s-t)/a,p=(i-n)/l,m=(r-s)/a,f=(n-u)/l;e.setAttribute("x",d),e.setAttribute("y",p),e.setAttribute("width",m),e.setAttribute("height",f),h.append(e),o?.push(`<rect vector-effect="non-scaling-stroke" x="${d}" y="${p}" width="${m}" height="${f}"/>`)}this.#C&&(o.push("</g></svg>')"),s.backgroundImage=o.join("")),this.container.append(u),this.container.style.clipPath=`url(#${p})`}_createPopup(){const{container:e,data:t}=this;e.setAttribute("aria-haspopup","dialog");const r=new PopupAnnotationElement({data:{color:t.color,titleObj:t.titleObj,modificationDate:t.modificationDate,contentsObj:t.contentsObj,richText:t.richText,parentRect:t.rect,borderStyle:0,id:`popup_${t.id}`,rotation:t.rotation},parent:this.parent,elements:[this]});this.parent.div.append(r.render())}render(){(0,n.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(e,t=null){const r=[];if(this._fieldObjects){const i=this._fieldObjects[e];if(i)for(const{page:e,id:s,exportValues:o}of i){if(-1===e)continue;if(s===t)continue;const i="string"==typeof o?o:null,a=document.querySelector(`[data-element-id="${s}"]`);!a||u.has(a)?r.push({id:s,exportValue:i,domElement:a}):(0,n.warn)(`_getElementsByName - element not allowed: ${s}`)}return r}for(const n of document.getElementsByName(e)){const{exportValue:e}=n,i=n.getAttribute("data-element-id");i!==t&&(u.has(n)&&r.push({id:i,exportValue:e,domElement:n}))}return r}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const e=this.getElementsToTriggerPopup();if(Array.isArray(e))for(const t of e)t.classList.add("highlightArea");else e.classList.add("highlightArea")}get _isEditable(){return!1}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:e,data:{id:t}}=this;this.container.addEventListener("dblclick",(()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:e,editId:t})}))}}class LinkAnnotationElement extends AnnotationElement{constructor(e,t=null){super(e,{isRenderable:!0,ignoreBorder:!!t?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=e.data.isTooltipOnly}render(){const{data:e,linkService:t}=this,r=document.createElement("a");r.setAttribute("data-element-id",e.id);let n=!1;return e.url?(t.addLinkAttributes(r,e.url,e.newWindow),n=!0):e.action?(this._bindNamedAction(r,e.action),n=!0):e.attachment?(this.#T(r,e.attachment,e.attachmentDest),n=!0):e.setOCGState?(this.#D(r,e.setOCGState),n=!0):e.dest?(this._bindLink(r,e.dest),n=!0):(e.actions&&(e.actions.Action||e.actions["Mouse Up"]||e.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(r,e),n=!0),e.resetForm?(this._bindResetFormAction(r,e.resetForm),n=!0):this.isTooltipOnly&&!n&&(this._bindLink(r,""),n=!0)),this.container.classList.add("linkAnnotation"),n&&this.container.append(r),this.container}#O(){this.container.setAttribute("data-internal-link","")}_bindLink(e,t){e.href=this.linkService.getDestinationHash(t),e.onclick=()=>(t&&this.linkService.goToDestination(t),!1),(t||""===t)&&this.#O()}_bindNamedAction(e,t){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(t),!1),this.#O()}#T(e,t,r=null){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.downloadManager?.openOrDownloadData(t.content,t.filename,r),!1),this.#O()}#D(e,t){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeSetOCGState(t),!1),this.#O()}_bindJSAction(e,t){e.href=this.linkService.getAnchorUrl("");const r=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const n of Object.keys(t.actions)){const i=r.get(n);i&&(e[i]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t.id,name:n}}),!1))}e.onclick||(e.onclick=()=>!1),this.#O()}_bindResetFormAction(e,t){const r=e.onclick;if(r||(e.href=this.linkService.getAnchorUrl("")),this.#O(),!this._fieldObjects)return(0,n.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),void(r||(e.onclick=()=>!1));e.onclick=()=>{r?.();const{fields:e,refs:i,include:s}=t,o=[];if(0!==e.length||0!==i.length){const t=new Set(i);for(const r of e){const e=this._fieldObjects[r]||[];for(const{id:r}of e)t.add(r)}for(const e of Object.values(this._fieldObjects))for(const r of e)t.has(r.id)===s&&o.push(r)}else for(const e of Object.values(this._fieldObjects))o.push(...e);const a=this.annotationStorage,l=[];for(const e of o){const{id:t}=e;switch(l.push(t),e.type){case"text":{const r=e.defaultValue||"";a.setValue(t,{value:r});break}case"checkbox":case"radiobutton":{const r=e.defaultValue===e.exportValues;a.setValue(t,{value:r});break}case"combobox":case"listbox":{const r=e.defaultValue||"";a.setValue(t,{value:r});break}default:continue}const r=document.querySelector(`[data-element-id="${t}"]`);r&&(u.has(r)?r.dispatchEvent(new Event("resetform")):(0,n.warn)(`_bindResetFormAction - element not allowed: ${t}`))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:l,name:"ResetForm"}}),!1}}}class TextAnnotationElement extends AnnotationElement{constructor(e){super(e,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const e=document.createElement("img");return e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",e.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),e.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(e),this.container}}class WidgetAnnotationElement extends AnnotationElement{render(){return this.container}showElementAndHideCanvas(e){this.data.hasOwnCanvas&&("CANVAS"===e.previousSibling?.nodeName&&(e.previousSibling.hidden=!0),e.hidden=!1)}_getKeyModifier(e){return n.FeatureTest.platform.isMac?e.metaKey:e.ctrlKey}_setEventListener(e,t,r,n,i){r.includes("mouse")?e.addEventListener(r,(e=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:i(e),shift:e.shiftKey,modifier:this._getKeyModifier(e)}})})):e.addEventListener(r,(e=>{if("blur"===r){if(!t.focused||!e.relatedTarget)return;t.focused=!1}else if("focus"===r){if(t.focused)return;t.focused=!0}i&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:i(e)}})}))}_setEventListeners(e,t,r,n){for(const[i,s]of r)("Action"===s||this.data.actions?.[s])&&("Focus"!==s&&"Blur"!==s||(t||={focused:!1}),this._setEventListener(e,t,i,s,n),"Focus"!==s||this.data.actions?.Blur?"Blur"!==s||this.data.actions?.Focus||this._setEventListener(e,t,"focus","Focus",null):this._setEventListener(e,t,"blur","Blur",null))}_setBackgroundColor(e){const t=this.data.backgroundColor||null;e.style.backgroundColor=null===t?"transparent":n.Util.makeHexColor(t[0],t[1],t[2])}_setTextStyle(e){const t=["left","center","right"],{fontColor:r}=this.data.defaultAppearanceData,i=this.data.defaultAppearanceData.fontSize||9,s=e.style;let o;const a=e=>Math.round(10*e)/10;if(this.data.multiLine){const e=Math.abs(this.data.rect[3]-this.data.rect[1]-2),t=e/(Math.round(e/(n.LINE_FACTOR*i))||1);o=Math.min(i,a(t/n.LINE_FACTOR))}else{const e=Math.abs(this.data.rect[3]-this.data.rect[1]-2);o=Math.min(i,a(e/n.LINE_FACTOR))}s.fontSize=`calc(${o}px * var(--scale-factor))`,s.color=n.Util.makeHexColor(r[0],r[1],r[2]),null!==this.data.textAlignment&&(s.textAlign=t[this.data.textAlignment])}_setRequired(e,t){t?e.setAttribute("required",!0):e.removeAttribute("required"),e.setAttribute("aria-required",t)}}class TextWidgetAnnotationElement extends WidgetAnnotationElement{constructor(e){super(e,{isRenderable:e.renderForms||e.data.hasOwnCanvas||!e.data.hasAppearance&&!!e.data.fieldValue})}setPropertyOnSiblings(e,t,r,n){const i=this.annotationStorage;for(const s of this._getElementsByName(e.name,e.id))s.domElement&&(s.domElement[t]=r),i.setValue(s.id,{[n]:r})}render(){const e=this.annotationStorage,t=this.data.id;this.container.classList.add("textWidgetAnnotation");let r=null;if(this.renderForms){const n=e.getValue(t,{value:this.data.fieldValue});let i=n.value||"";const s=e.getValue(t,{charLimit:this.data.maxLen}).charLimit;s&&i.length>s&&(i=i.slice(0,s));let o=n.formattedValue||this.data.textContent?.join("\n")||null;o&&this.data.comb&&(o=o.replaceAll(/\s+/g,""));const a={userValue:i,formattedValue:o,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(r=document.createElement("textarea"),r.textContent=o??i,this.data.doNotScroll&&(r.style.overflowY="hidden")):(r=document.createElement("input"),r.type="text",r.setAttribute("value",o??i),this.data.doNotScroll&&(r.style.overflowX="hidden")),this.data.hasOwnCanvas&&(r.hidden=!0),u.add(r),r.setAttribute("data-element-id",t),r.disabled=this.data.readOnly,r.name=this.data.fieldName,r.tabIndex=c,this._setRequired(r,this.data.required),s&&(r.maxLength=s),r.addEventListener("input",(n=>{e.setValue(t,{value:n.target.value}),this.setPropertyOnSiblings(r,"value",n.target.value,"value"),a.formattedValue=null})),r.addEventListener("resetform",(e=>{const t=this.data.defaultFieldValue??"";r.value=a.userValue=t,a.formattedValue=null}));let l=e=>{const{formattedValue:t}=a;null!=t&&(e.target.value=t),e.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){r.addEventListener("focus",(e=>{if(a.focused)return;const{target:t}=e;a.userValue&&(t.value=a.userValue),a.lastCommittedValue=t.value,a.commitKey=1,this.data.actions?.Focus||(a.focused=!0)})),r.addEventListener("updatefromsandbox",(r=>{this.showElementAndHideCanvas(r.target);const n={value(r){a.userValue=r.detail.value??"",e.setValue(t,{value:a.userValue.toString()}),r.target.value=a.userValue},formattedValue(r){const{formattedValue:n}=r.detail;a.formattedValue=n,null!=n&&r.target!==document.activeElement&&(r.target.value=n),e.setValue(t,{formattedValue:n})},selRange(e){e.target.setSelectionRange(...e.detail.selRange)},charLimit:r=>{const{charLimit:n}=r.detail,{target:i}=r;if(0===n)return void i.removeAttribute("maxLength");i.setAttribute("maxLength",n);let s=a.userValue;!s||s.length<=n||(s=s.slice(0,n),i.value=a.userValue=s,e.setValue(t,{value:s}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:s,willCommit:!0,commitKey:1,selStart:i.selectionStart,selEnd:i.selectionEnd}}))}};this._dispatchEventFromSandbox(n,r)})),r.addEventListener("keydown",(e=>{a.commitKey=1;let r=-1;if("Escape"===e.key?r=0:"Enter"!==e.key||this.data.multiLine?"Tab"===e.key&&(a.commitKey=3):r=2,-1===r)return;const{value:n}=e.target;a.lastCommittedValue!==n&&(a.lastCommittedValue=n,a.userValue=n,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:n,willCommit:!0,commitKey:r,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}}))}));const n=l;l=null,r.addEventListener("blur",(e=>{if(!a.focused||!e.relatedTarget)return;this.data.actions?.Blur||(a.focused=!1);const{value:r}=e.target;a.userValue=r,a.lastCommittedValue!==r&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:r,willCommit:!0,commitKey:a.commitKey,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}}),n(e)})),this.data.actions?.Keystroke&&r.addEventListener("beforeinput",(e=>{a.lastCommittedValue=null;const{data:r,target:n}=e,{value:i,selectionStart:s,selectionEnd:o}=n;let l=s,c=o;switch(e.inputType){case"deleteWordBackward":{const e=i.substring(0,s).match(/\w*[^\w]*$/);e&&(l-=e[0].length);break}case"deleteWordForward":{const e=i.substring(s).match(/^[^\w]*\w*/);e&&(c+=e[0].length);break}case"deleteContentBackward":s===o&&(l-=1);break;case"deleteContentForward":s===o&&(c+=1)}e.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:i,change:r||"",willCommit:!1,selStart:l,selEnd:c}})})),this._setEventListeners(r,a,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(e=>e.target.value))}if(l&&r.addEventListener("blur",l),this.data.comb){const e=(this.data.rect[2]-this.data.rect[0])/s;r.classList.add("comb"),r.style.letterSpacing=`calc(${e}px * var(--scale-factor) - 1ch)`}}else r=document.createElement("div"),r.textContent=this.data.fieldValue,r.style.verticalAlign="middle",r.style.display="table-cell",this.data.hasOwnCanvas&&(r.hidden=!0);return this._setTextStyle(r),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class SignatureWidgetAnnotationElement extends WidgetAnnotationElement{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}}class CheckboxWidgetAnnotationElement extends WidgetAnnotationElement{constructor(e){super(e,{isRenderable:e.renderForms})}render(){const e=this.annotationStorage,t=this.data,r=t.id;let n=e.getValue(r,{value:t.exportValue===t.fieldValue}).value;"string"==typeof n&&(n="Off"!==n,e.setValue(r,{value:n})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const i=document.createElement("input");return u.add(i),i.setAttribute("data-element-id",r),i.disabled=t.readOnly,this._setRequired(i,this.data.required),i.type="checkbox",i.name=t.fieldName,n&&i.setAttribute("checked",!0),i.setAttribute("exportValue",t.exportValue),i.tabIndex=c,i.addEventListener("change",(n=>{const{name:i,checked:s}=n.target;for(const n of this._getElementsByName(i,r)){const r=s&&n.exportValue===t.exportValue;n.domElement&&(n.domElement.checked=r),e.setValue(n.id,{value:r})}e.setValue(r,{value:s})})),i.addEventListener("resetform",(e=>{const r=t.defaultFieldValue||"Off";e.target.checked=r===t.exportValue})),this.enableScripting&&this.hasJSActions&&(i.addEventListener("updatefromsandbox",(t=>{const n={value(t){t.target.checked="Off"!==t.detail.value,e.setValue(r,{value:t.target.checked})}};this._dispatchEventFromSandbox(n,t)})),this._setEventListeners(i,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(e=>e.target.checked))),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class RadioButtonWidgetAnnotationElement extends WidgetAnnotationElement{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const e=this.annotationStorage,t=this.data,r=t.id;let n=e.getValue(r,{value:t.fieldValue===t.buttonValue}).value;if("string"==typeof n&&(n=n!==t.buttonValue,e.setValue(r,{value:n})),n)for(const n of this._getElementsByName(t.fieldName,r))e.setValue(n.id,{value:!1});const i=document.createElement("input");if(u.add(i),i.setAttribute("data-element-id",r),i.disabled=t.readOnly,this._setRequired(i,this.data.required),i.type="radio",i.name=t.fieldName,n&&i.setAttribute("checked",!0),i.tabIndex=c,i.addEventListener("change",(t=>{const{name:n,checked:i}=t.target;for(const t of this._getElementsByName(n,r))e.setValue(t.id,{value:!1});e.setValue(r,{value:i})})),i.addEventListener("resetform",(e=>{const r=t.defaultFieldValue;e.target.checked=null!=r&&r===t.buttonValue})),this.enableScripting&&this.hasJSActions){const n=t.buttonValue;i.addEventListener("updatefromsandbox",(t=>{const i={value:t=>{const i=n===t.detail.value;for(const n of this._getElementsByName(t.target.name)){const t=i&&n.id===r;n.domElement&&(n.domElement.checked=t),e.setValue(n.id,{value:t})}}};this._dispatchEventFromSandbox(i,t)})),this._setEventListeners(i,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(e=>e.target.checked))}return this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class PushButtonWidgetAnnotationElement extends LinkAnnotationElement{constructor(e){super(e,{ignoreBorder:e.data.hasAppearance})}render(){const e=super.render();e.classList.add("buttonWidgetAnnotation","pushButton");const t=e.lastChild;return this.enableScripting&&this.hasJSActions&&t&&(this._setDefaultPropertiesFromJS(t),t.addEventListener("updatefromsandbox",(e=>{this._dispatchEventFromSandbox({},e)}))),e}}class ChoiceWidgetAnnotationElement extends WidgetAnnotationElement{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const e=this.annotationStorage,t=this.data.id,r=e.getValue(t,{value:this.data.fieldValue}),n=document.createElement("select");u.add(n),n.setAttribute("data-element-id",t),n.disabled=this.data.readOnly,this._setRequired(n,this.data.required),n.name=this.data.fieldName,n.tabIndex=c;let i=this.data.combo&&this.data.options.length>0;this.data.combo||(n.size=this.data.options.length,this.data.multiSelect&&(n.multiple=!0)),n.addEventListener("resetform",(e=>{const t=this.data.defaultFieldValue;for(const e of n.options)e.selected=e.value===t}));for(const e of this.data.options){const t=document.createElement("option");t.textContent=e.displayValue,t.value=e.exportValue,r.value.includes(e.exportValue)&&(t.setAttribute("selected",!0),i=!1),n.append(t)}let s=null;if(i){const e=document.createElement("option");e.value=" ",e.setAttribute("hidden",!0),e.setAttribute("selected",!0),n.prepend(e),s=()=>{e.remove(),n.removeEventListener("input",s),s=null},n.addEventListener("input",s)}const o=e=>{const t=e?"value":"textContent",{options:r,multiple:i}=n;return i?Array.prototype.filter.call(r,(e=>e.selected)).map((e=>e[t])):-1===r.selectedIndex?null:r[r.selectedIndex][t]};let a=o(!1);const l=e=>{const t=e.target.options;return Array.prototype.map.call(t,(e=>({displayValue:e.textContent,exportValue:e.value})))};return this.enableScripting&&this.hasJSActions?(n.addEventListener("updatefromsandbox",(r=>{const i={value(r){s?.();const i=r.detail.value,l=new Set(Array.isArray(i)?i:[i]);for(const e of n.options)e.selected=l.has(e.value);e.setValue(t,{value:o(!0)}),a=o(!1)},multipleSelection(e){n.multiple=!0},remove(r){const i=n.options,s=r.detail.remove;if(i[s].selected=!1,n.remove(s),i.length>0){-1===Array.prototype.findIndex.call(i,(e=>e.selected))&&(i[0].selected=!0)}e.setValue(t,{value:o(!0),items:l(r)}),a=o(!1)},clear(r){for(;0!==n.length;)n.remove(0);e.setValue(t,{value:null,items:[]}),a=o(!1)},insert(r){const{index:i,displayValue:s,exportValue:c}=r.detail.insert,u=n.children[i],d=document.createElement("option");d.textContent=s,d.value=c,u?u.before(d):n.append(d),e.setValue(t,{value:o(!0),items:l(r)}),a=o(!1)},items(r){const{items:i}=r.detail;for(;0!==n.length;)n.remove(0);for(const e of i){const{displayValue:t,exportValue:r}=e,i=document.createElement("option");i.textContent=t,i.value=r,n.append(i)}n.options.length>0&&(n.options[0].selected=!0),e.setValue(t,{value:o(!0),items:l(r)}),a=o(!1)},indices(r){const n=new Set(r.detail.indices);for(const e of r.target.options)e.selected=n.has(e.index);e.setValue(t,{value:o(!0)}),a=o(!1)},editable(e){e.target.disabled=!e.detail.editable}};this._dispatchEventFromSandbox(i,r)})),n.addEventListener("input",(r=>{const n=o(!0),i=o(!1);e.setValue(t,{value:n}),r.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:a,change:i,changeEx:n,willCommit:!1,commitKey:1,keyDown:!1}})})),this._setEventListeners(n,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],(e=>e.target.value))):n.addEventListener("input",(function(r){e.setValue(t,{value:o(!0)})})),this.data.combo&&this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class PopupAnnotationElement extends AnnotationElement{constructor(e){const{data:t,elements:r}=e;super(e,{isRenderable:AnnotationElement._hasPopupData(t)}),this.elements=r}render(){this.container.classList.add("popupAnnotation");const e=new PopupElement({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),t=[];for(const r of this.elements)r.popup=e,t.push(r.data.id),r.addHighlightArea();return this.container.setAttribute("aria-controls",t.map((e=>`${n.AnnotationPrefix}${e}`)).join(",")),this.container}}class PopupElement{#R=this.#L.bind(this);#k=this.#N.bind(this);#F=this.#I.bind(this);#B=this.#j.bind(this);#H=null;#U=null;#z=null;#G=null;#W=null;#V=null;#q=null;#$=!1;#Z=null;#K=null;#X=null;#Y=null;#J=!1;constructor({container:e,color:t,elements:r,titleObj:n,modificationDate:s,contentsObj:o,richText:a,parent:l,rect:c,parentRect:u,open:d}){this.#U=e,this.#Y=n,this.#z=o,this.#X=a,this.#V=l,this.#H=t,this.#K=c,this.#q=u,this.#W=r,this.#G=i.PDFDateString.toDateObject(s),this.trigger=r.flatMap((e=>e.getElementsToTriggerPopup()));for(const e of this.trigger)e.addEventListener("click",this.#B),e.addEventListener("mouseenter",this.#F),e.addEventListener("mouseleave",this.#k),e.classList.add("popupTriggerArea");for(const e of r)e.container?.addEventListener("keydown",this.#R);this.#U.hidden=!0,d&&this.#j()}render(){if(this.#Z)return;const{page:{view:e},viewport:{rawDims:{pageWidth:t,pageHeight:r,pageX:i,pageY:s}}}=this.#V,o=this.#Z=document.createElement("div");if(o.className="popup",this.#H){const e=o.style.outlineColor=n.Util.makeHexColor(...this.#H);if(CSS.supports("background-color","color-mix(in srgb, red 30%, white)"))o.style.backgroundColor=`color-mix(in srgb, ${e} 30%, white)`;else{const e=.7;o.style.backgroundColor=n.Util.makeHexColor(...this.#H.map((t=>Math.floor(e*(255-t)+t))))}}const a=document.createElement("span");a.className="header";const c=document.createElement("h1");if(a.append(c),({dir:c.dir,str:c.textContent}=this.#Y),o.append(a),this.#G){const e=document.createElement("span");e.classList.add("popupDate"),e.setAttribute("data-l10n-id","pdfjs-annotation-date-string"),e.setAttribute("data-l10n-args",JSON.stringify({date:this.#G.toLocaleDateString(),time:this.#G.toLocaleTimeString()})),a.append(e)}const u=this.#z,d=this.#X;if(!d?.str||u?.str&&u.str!==d.str){const e=this._formatContents(u);o.append(e)}else l.XfaLayer.render({xfaHtml:d.html,intent:"richText",div:o}),o.lastChild.classList.add("richText","popupContent");let h=!!this.#q,p=h?this.#q:this.#K;for(const e of this.#W)if(!p||null!==n.Util.intersect(e.data.rect,p)){p=e.data.rect,h=!0;break}const m=n.Util.normalizeRect([p[0],e[3]-p[1]+e[1],p[2],e[3]-p[3]+e[1]]),f=h?p[2]-p[0]+5:0,g=m[0]+f,y=m[1],{style:b}=this.#U;b.left=100*(g-i)/t+"%",b.top=100*(y-s)/r+"%",this.#U.append(o)}_formatContents({str:e,dir:t}){const r=document.createElement("p");r.classList.add("popupContent"),r.dir=t;const n=e.split(/(?:\r\n?|\n)/);for(let e=0,t=n.length;e<t;++e){const i=n[e];r.append(document.createTextNode(i)),e<t-1&&r.append(document.createElement("br"))}return r}#L(e){e.altKey||e.shiftKey||e.ctrlKey||e.metaKey||("Enter"===e.key||"Escape"===e.key&&this.#$)&&this.#j()}#j(){this.#$=!this.#$,this.#$?(this.#I(),this.#U.addEventListener("click",this.#B),this.#U.addEventListener("keydown",this.#R)):(this.#N(),this.#U.removeEventListener("click",this.#B),this.#U.removeEventListener("keydown",this.#R))}#I(){this.#Z||this.render(),this.isVisible?this.#$&&this.#U.classList.add("focused"):(this.#U.hidden=!1,this.#U.style.zIndex=parseInt(this.#U.style.zIndex)+1e3)}#N(){this.#U.classList.remove("focused"),!this.#$&&this.isVisible&&(this.#U.hidden=!0,this.#U.style.zIndex=parseInt(this.#U.style.zIndex)-1e3)}forceHide(){this.#J=this.isVisible,this.#J&&(this.#U.hidden=!0)}maybeShow(){this.#J&&(this.#J=!1,this.#U.hidden=!1)}get isVisible(){return!1===this.#U.hidden}}class FreeTextAnnotationElement extends AnnotationElement{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.textContent=e.data.textContent,this.textPosition=e.data.textPosition,this.annotationEditorType=n.AnnotationEditorType.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const e=document.createElement("div");e.classList.add("annotationTextContent"),e.setAttribute("role","comment");for(const t of this.textContent){const r=document.createElement("span");r.textContent=t,e.append(r)}this.container.append(e)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}get _isEditable(){return this.data.hasOwnCanvas}}class LineAnnotationElement extends AnnotationElement{#Q=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const e=this.data,{width:t,height:r}=d(e.rect),n=this.svgFactory.create(t,r,!0),i=this.#Q=this.svgFactory.createElement("svg:line");return i.setAttribute("x1",e.rect[2]-e.lineCoordinates[0]),i.setAttribute("y1",e.rect[3]-e.lineCoordinates[1]),i.setAttribute("x2",e.rect[2]-e.lineCoordinates[2]),i.setAttribute("y2",e.rect[3]-e.lineCoordinates[3]),i.setAttribute("stroke-width",e.borderStyle.width||1),i.setAttribute("stroke","transparent"),i.setAttribute("fill","transparent"),n.append(i),this.container.append(n),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#Q}addHighlightArea(){this.container.classList.add("highlightArea")}}class SquareAnnotationElement extends AnnotationElement{#ee=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const e=this.data,{width:t,height:r}=d(e.rect),n=this.svgFactory.create(t,r,!0),i=e.borderStyle.width,s=this.#ee=this.svgFactory.createElement("svg:rect");return s.setAttribute("x",i/2),s.setAttribute("y",i/2),s.setAttribute("width",t-i),s.setAttribute("height",r-i),s.setAttribute("stroke-width",i||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),n.append(s),this.container.append(n),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#ee}addHighlightArea(){this.container.classList.add("highlightArea")}}class CircleAnnotationElement extends AnnotationElement{#te=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const e=this.data,{width:t,height:r}=d(e.rect),n=this.svgFactory.create(t,r,!0),i=e.borderStyle.width,s=this.#te=this.svgFactory.createElement("svg:ellipse");return s.setAttribute("cx",t/2),s.setAttribute("cy",r/2),s.setAttribute("rx",t/2-i/2),s.setAttribute("ry",r/2-i/2),s.setAttribute("stroke-width",i||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),n.append(s),this.container.append(n),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#te}addHighlightArea(){this.container.classList.add("highlightArea")}}class PolylineAnnotationElement extends AnnotationElement{#re=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const e=this.data,{width:t,height:r}=d(e.rect),n=this.svgFactory.create(t,r,!0);let i=[];for(const t of e.vertices){const r=t.x-e.rect[0],n=e.rect[3]-t.y;i.push(r+","+n)}i=i.join(" ");const s=this.#re=this.svgFactory.createElement(this.svgElementName);return s.setAttribute("points",i),s.setAttribute("stroke-width",e.borderStyle.width||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),n.append(s),this.container.append(n),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#re}addHighlightArea(){this.container.classList.add("highlightArea")}}class PolygonAnnotationElement extends PolylineAnnotationElement{constructor(e){super(e),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class CaretAnnotationElement extends AnnotationElement{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class InkAnnotationElement extends AnnotationElement{#ne=[];constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=n.AnnotationEditorType.INK}render(){this.container.classList.add(this.containerClassName);const e=this.data,{width:t,height:r}=d(e.rect),n=this.svgFactory.create(t,r,!0);for(const t of e.inkLists){let r=[];for(const n of t){const t=n.x-e.rect[0],i=e.rect[3]-n.y;r.push(`${t},${i}`)}r=r.join(" ");const i=this.svgFactory.createElement(this.svgElementName);this.#ne.push(i),i.setAttribute("points",r),i.setAttribute("stroke-width",e.borderStyle.width||1),i.setAttribute("stroke","transparent"),i.setAttribute("fill","transparent"),!e.popupRef&&this.hasPopupData&&this._createPopup(),n.append(i)}return this.container.append(n),this.container}getElementsToTriggerPopup(){return this.#ne}addHighlightArea(){this.container.classList.add("highlightArea")}}class HighlightAnnotationElement extends AnnotationElement{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this.container}}class UnderlineAnnotationElement extends AnnotationElement{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}}class SquigglyAnnotationElement extends AnnotationElement{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}}class StrikeOutAnnotationElement extends AnnotationElement{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}}class StampAnnotationElement extends AnnotationElement{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class FileAttachmentAnnotationElement extends AnnotationElement{#ie=null;constructor(e){super(e,{isRenderable:!0});const{filename:t,content:r}=this.data.file;this.filename=(0,i.getFilenameFromUrl)(t,!0),this.content=r,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,filename:t,content:r})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:e,data:t}=this;let r;t.hasAppearance||0===t.fillAlpha?r=document.createElement("div"):(r=document.createElement("img"),r.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(t.name)?"paperclip":"pushpin"}.svg`,t.fillAlpha&&t.fillAlpha<1&&(r.style=`filter: opacity(${Math.round(100*t.fillAlpha)}%);`)),r.addEventListener("dblclick",this.#se.bind(this)),this.#ie=r;const{isMac:i}=n.FeatureTest.platform;return e.addEventListener("keydown",(e=>{"Enter"===e.key&&(i?e.metaKey:e.ctrlKey)&&this.#se()})),!t.popupRef&&this.hasPopupData?this._createPopup():r.classList.add("popupTriggerArea"),e.append(r),e}getElementsToTriggerPopup(){return this.#ie}addHighlightArea(){this.container.classList.add("highlightArea")}#se(){this.downloadManager?.openOrDownloadData(this.content,this.filename)}}class AnnotationLayer{#oe=null;#ae=null;#le=new Map;constructor({div:e,accessibilityManager:t,annotationCanvasMap:r,annotationEditorUIManager:n,page:i,viewport:s}){this.div=e,this.#oe=t,this.#ae=r,this.page=i,this.viewport=s,this.zIndex=0,this._annotationEditorUIManager=n}#ce(e,t){const r=e.firstChild||e;r.id=`${n.AnnotationPrefix}${t}`,this.div.append(e),this.#oe?.moveElementInDOM(this.div,e,r,!1)}async render(e){const{annotations:t}=e,r=this.div;(0,i.setLayerDimensions)(r,this.viewport);const o=new Map,a={data:null,layer:r,linkService:e.linkService,downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||"",renderForms:!1!==e.renderForms,svgFactory:new i.DOMSVGFactory,annotationStorage:e.annotationStorage||new s.AnnotationStorage,enableScripting:!0===e.enableScripting,hasJSActions:e.hasJSActions,fieldObjects:e.fieldObjects,parent:this,elements:null};for(const e of t){if(e.noHTML)continue;const t=e.annotationType===n.AnnotationType.POPUP;if(t){const t=o.get(e.id);if(!t)continue;a.elements=t}else{const{width:t,height:r}=d(e.rect);if(t<=0||r<=0)continue}a.data=e;const r=AnnotationElementFactory.create(a);if(!r.isRenderable)continue;if(!t&&e.popupRef){const t=o.get(e.popupRef);t?t.push(r):o.set(e.popupRef,[r])}const i=r.render();e.hidden&&(i.style.visibility="hidden"),this.#ce(i,e.id),r.annotationEditorType>0&&(this.#le.set(r.data.id,r),this._annotationEditorUIManager?.renderAnnotationElement(r))}this.#ue()}update({viewport:e}){const t=this.div;this.viewport=e,(0,i.setLayerDimensions)(t,{rotation:e.rotation}),this.#ue(),t.hidden=!1}#ue(){if(!this.#ae)return;const e=this.div;for(const[t,r]of this.#ae){const n=e.querySelector(`[data-annotation-id="${t}"]`);if(!n)continue;r.className="annotationContent";const{firstChild:i}=n;i?"CANVAS"===i.nodeName?i.replaceWith(r):i.classList.contains("annotationContent")?i.after(r):i.before(r):n.append(r)}this.#ae.clear()}getEditableAnnotations(){return Array.from(this.#le.values())}getEditableAnnotation(e){return this.#le.get(e)}}},792:(e,t,r)=>{r.d(t,{AnnotationStorage:()=>AnnotationStorage,PrintAnnotationStorage:()=>PrintAnnotationStorage,SerializableEmpty:()=>o});var n=r(292),i=r(310),s=r(651);const o=Object.freeze({map:null,hash:"",transfer:void 0});class AnnotationStorage{#de=!1;#he=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(e,t){const r=this.#he.get(e);return void 0===r?t:Object.assign(t,r)}getRawValue(e){return this.#he.get(e)}remove(e){if(this.#he.delete(e),0===this.#he.size&&this.resetModified(),"function"==typeof this.onAnnotationEditor){for(const e of this.#he.values())if(e instanceof i.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(e,t){const r=this.#he.get(e);let n=!1;if(void 0!==r)for(const[e,i]of Object.entries(t))r[e]!==i&&(n=!0,r[e]=i);else n=!0,this.#he.set(e,t);n&&this.#pe(),t instanceof i.AnnotationEditor&&"function"==typeof this.onAnnotationEditor&&this.onAnnotationEditor(t.constructor._type)}has(e){return this.#he.has(e)}getAll(){return this.#he.size>0?(0,n.objectFromMap)(this.#he):null}setAll(e){for(const[t,r]of Object.entries(e))this.setValue(t,r)}get size(){return this.#he.size}#pe(){this.#de||(this.#de=!0,"function"==typeof this.onSetModified&&this.onSetModified())}resetModified(){this.#de&&(this.#de=!1,"function"==typeof this.onResetModified&&this.onResetModified())}get print(){return new PrintAnnotationStorage(this)}get serializable(){if(0===this.#he.size)return o;const e=new Map,t=new s.MurmurHash3_64,r=[],n=Object.create(null);let a=!1;for(const[r,s]of this.#he){const o=s instanceof i.AnnotationEditor?s.serialize(!1,n):s;o&&(e.set(r,o),t.update(`${r}:${JSON.stringify(o)}`),a||=!!o.bitmap)}if(a)for(const t of e.values())t.bitmap&&r.push(t.bitmap);return e.size>0?{map:e,hash:t.hexdigest(),transfer:r}:o}get editorStats(){let e=null;const t=new Map;for(const r of this.#he.values()){if(!(r instanceof i.AnnotationEditor))continue;const n=r.telemetryFinalData;if(!n)continue;const{type:s}=n;t.has(s)||t.set(s,Object.getPrototypeOf(r).constructor),e||=Object.create(null);const o=e[s]||=new Map;for(const[e,t]of Object.entries(n)){if("type"===e)continue;let r=o.get(e);r||(r=new Map,o.set(e,r));const n=r.get(t)??0;r.set(t,n+1)}}for(const[r,n]of t)e[r]=n.computeTelemetryFinalData(e[r]);return e}}class PrintAnnotationStorage extends AnnotationStorage{#me;constructor(e){super();const{map:t,hash:r,transfer:n}=e.serializable,i=structuredClone(t,n?{transfer:n}:null);this.#me={map:i,hash:r,transfer:n}}get print(){(0,n.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#me}}},831:(e,t,r)=>{r.a(e,(async(e,n)=>{try{let x=function(e){if("string"==typeof e||e instanceof URL?e={url:e}:(e instanceof ArrayBuffer||ArrayBuffer.isView(e))&&(e={data:e}),"object"!=typeof e)throw new Error("Invalid parameter in getDocument, need parameter object.");if(!e.url&&!e.data&&!e.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const t=new PDFDocumentLoadingTask,{docId:r}=t,n=e.url?w(e.url):null,s=e.data?R(e.data):null,a=e.httpHeaders||null,l=!0===e.withCredentials,c=e.password??null,u=e.range instanceof PDFDataRangeTransport?e.range:null,p=Number.isInteger(e.rangeChunkSize)&&e.rangeChunkSize>0?e.rangeChunkSize:j;let m=e.worker instanceof PDFWorker?e.worker:null;const v=e.verbosity,_="string"!=typeof e.docBaseUrl||(0,o.isDataScheme)(e.docBaseUrl)?null:e.docBaseUrl,x="string"==typeof e.cMapUrl?e.cMapUrl:null,k=!1!==e.cMapPacked,z=e.CMapReaderFactory||Z,q="string"==typeof e.standardFontDataUrl?e.standardFontDataUrl:null,te=e.StandardFontDataFactory||Y,re=!0!==e.stopAtErrors,ne=Number.isInteger(e.maxImageSize)&&e.maxImageSize>-1?e.maxImageSize:-1,ie=!1!==e.isEvalSupported,se="boolean"==typeof e.isOffscreenCanvasSupported?e.isOffscreenCanvasSupported:!i.isNodeJS,oe=Number.isInteger(e.canvasMaxAreaInBytes)?e.canvasMaxAreaInBytes:-1,ae="boolean"==typeof e.disableFontFace?e.disableFontFace:i.isNodeJS,le=!0===e.fontExtraProperties,ce=!0===e.enableXfa,ue=e.ownerDocument||globalThis.document,de=!0===e.disableRange,he=!0===e.disableStream,pe=!0===e.disableAutoFetch,me=!0===e.pdfBug,fe=u?u.length:e.length??NaN,ge="boolean"==typeof e.useSystemFonts?e.useSystemFonts:!i.isNodeJS&&!ae,ye="boolean"==typeof e.useWorkerFetch?e.useWorkerFetch:z===o.DOMCMapReaderFactory&&te===o.DOMStandardFontDataFactory&&x&&q&&(0,o.isValidFetchUrl)(x,document.baseURI)&&(0,o.isValidFetchUrl)(q,document.baseURI),be=e.canvasFactory||new $({ownerDocument:ue}),ve=e.filterFactory||new X({docId:r,ownerDocument:ue});(0,i.setVerbosityLevel)(v);const _e={canvasFactory:be,filterFactory:ve};if(ye||(_e.cMapReaderFactory=new z({baseUrl:x,isCompressed:k}),_e.standardFontDataFactory=new te({baseUrl:q})),!m){const e={verbosity:v,port:d.GlobalWorkerOptions.workerPort};m=e.port?PDFWorker.fromPort(e):new PDFWorker(e),t._worker=m}const xe={docId:r,apiVersion:"4.2.67",data:s,password:c,disableAutoFetch:pe,rangeChunkSize:p,length:fe,docBaseUrl:_,enableXfa:ce,evaluatorOptions:{maxImageSize:ne,disableFontFace:ae,ignoreErrors:re,isEvalSupported:ie,isOffscreenCanvasSupported:se,canvasMaxAreaInBytes:oe,fontExtraProperties:le,useSystemFonts:ge,cMapUrl:ye?x:null,standardFontDataUrl:ye?q:null}},we={ignoreErrors:re,disableFontFace:ae,fontExtraProperties:le,enableXfa:ce,ownerDocument:ue,disableAutoFetch:pe,pdfBug:me,styleElement:null};return m.promise.then((function(){if(t.destroyed)throw new Error("Loading aborted");const e=ee(m,xe),c=new Promise((function(e){let t;if(u)t=new f.PDFDataTransportStream(u,{disableRange:de,disableStream:he});else if(!s){t=(e=>{if(i.isNodeJS){return function(){return"undefined"!=typeof fetch&&"undefined"!=typeof Response&&"body"in Response.prototype}()&&(0,o.isValidFetchUrl)(e.url)?new g.PDFFetchStream(e):new b.PDFNodeStream(e)}return(0,o.isValidFetchUrl)(e.url)?new g.PDFFetchStream(e):new y.PDFNetworkStream(e)})({url:n,length:fe,httpHeaders:a,withCredentials:l,rangeChunkSize:p,disableRange:de,disableStream:he})}e(t)}));return Promise.all([e,c]).then((function([e,n]){if(t.destroyed)throw new Error("Loading aborted");const i=new h.MessageHandler(r,e,m.port),s=new WorkerTransport(i,t,n,we,_e);t._transport=s,i.send("Ready",null)}))})).catch(t._capability.reject),t},w=function(e){if(e instanceof URL)return e.href;try{return new URL(e,window.location).href}catch{if(i.isNodeJS&&"string"==typeof e)return e}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")},R=function(e){if(i.isNodeJS&&"undefined"!=typeof Buffer&&e instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength)return e;if("string"==typeof e)return(0,i.stringToBytes)(e);if(e instanceof ArrayBuffer||ArrayBuffer.isView(e)||"object"==typeof e&&!isNaN(e?.length))return new Uint8Array(e);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")},k=function(e){return"object"==typeof e&&Number.isInteger(e?.num)&&e.num>=0&&Number.isInteger(e?.gen)&&e.gen>=0};r.d(t,{PDFDataRangeTransport:()=>PDFDataRangeTransport,PDFWorker:()=>PDFWorker,build:()=>ie,getDocument:()=>x,version:()=>ne});var i=r(292),s=r(792),o=r(419),a=r(10),l=r(573),c=r(923),u=r(814),d=r(164),h=r(178),p=r(62),m=r(626),f=r(585),g=r(94),y=r(457),b=r(786),v=r(50),_=e([l,b]);[l,b]=_.then?(await _)():_;const j=65536,z=100,q=5e3,$=i.isNodeJS?l.NodeCanvasFactory:o.DOMCanvasFactory,Z=i.isNodeJS?l.NodeCMapReaderFactory:o.DOMCMapReaderFactory,X=i.isNodeJS?l.NodeFilterFactory:o.DOMFilterFactory,Y=i.isNodeJS?l.NodeStandardFontDataFactory:o.DOMStandardFontDataFactory;async function ee(e,t){if(e.destroyed)throw new Error("Worker was destroyed");const r=await e.messageHandler.sendWithPromise("GetDocRequest",t,t.data?[t.data.buffer]:null);if(e.destroyed)throw new Error("Worker was destroyed");return r}class PDFDocumentLoadingTask{static#fe=0;constructor(){this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId="d"+PDFDocumentLoadingTask.#fe++,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{this._worker?.port&&(this._worker._pendingDestroy=!0),await(this._transport?.destroy())}catch(e){throw this._worker?.port&&delete this._worker._pendingDestroy,e}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}class PDFDataRangeTransport{constructor(e,t,r=!1,n=null){this.length=e,this.initialData=t,this.progressiveDone=r,this.contentDispositionFilename=n,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=Promise.withResolvers()}addRangeListener(e){this._rangeListeners.push(e)}addProgressListener(e){this._progressListeners.push(e)}addProgressiveReadListener(e){this._progressiveReadListeners.push(e)}addProgressiveDoneListener(e){this._progressiveDoneListeners.push(e)}onDataRange(e,t){for(const r of this._rangeListeners)r(e,t)}onDataProgress(e,t){this._readyCapability.promise.then((()=>{for(const r of this._progressListeners)r(e,t)}))}onDataProgressiveRead(e){this._readyCapability.promise.then((()=>{for(const t of this._progressiveReadListeners)t(e)}))}onDataProgressiveDone(){this._readyCapability.promise.then((()=>{for(const e of this._progressiveDoneListeners)e()}))}transportReady(){this._readyCapability.resolve()}requestDataRange(e,t){(0,i.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}class PDFDocumentProxy{constructor(e,t){this._pdfInfo=e,this._transport=t}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return(0,i.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:e="display"}={}){const{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getOptionalContentConfig(t)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(e=!1){return this._transport.startCleanup(e||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(e){return this._transport.cachedPageNumber(e)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}class PDFPageProxy{#ge=null;#ye=!1;constructor(e,t,r,n=!1){this._pageIndex=e,this._pageInfo=t,this._transport=r,this._stats=n?new o.StatTimer:null,this._pdfBug=n,this.commonObjs=r.commonObjs,this.objs=new PDFObjects,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:e,rotation:t=this.rotate,offsetX:r=0,offsetY:n=0,dontFlip:i=!1}={}){return new o.PageViewport({viewBox:this.view,scale:e,rotation:t,offsetX:r,offsetY:n,dontFlip:i})}getAnnotations({intent:e="display"}={}){const{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getAnnotations(this._pageIndex,t)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return(0,i.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:e,viewport:t,intent:r="display",annotationMode:n=i.AnnotationMode.ENABLE,transform:s=null,background:o=null,optionalContentConfigPromise:a=null,annotationCanvasMap:l=null,pageColors:c=null,printAnnotationStorage:u=null}){this._stats?.time("Overall");const d=this._transport.getRenderingIntent(r,n,u),{renderingIntent:h,cacheKey:p}=d;this.#ye=!1,this.#be(),a||=this._transport.getOptionalContentConfig(h);let m=this._intentStates.get(p);m||(m=Object.create(null),this._intentStates.set(p,m)),m.streamReaderCancelTimeout&&(clearTimeout(m.streamReaderCancelTimeout),m.streamReaderCancelTimeout=null);const f=!!(h&i.RenderingIntentFlag.PRINT);m.displayReadyCapability||(m.displayReadyCapability=Promise.withResolvers(),m.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(d));const g=e=>{m.renderTasks.delete(y),(this._maybeCleanupAfterRender||f)&&(this.#ye=!0),this.#ve(!f),e?(y.capability.reject(e),this._abortOperatorList({intentState:m,reason:e instanceof Error?e:new Error(e)})):y.capability.resolve(),this._stats?.timeEnd("Rendering"),this._stats?.timeEnd("Overall")},y=new InternalRenderTask({callback:g,params:{canvasContext:e,viewport:t,transform:s,background:o},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:l,operatorList:m.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!f,pdfBug:this._pdfBug,pageColors:c});(m.renderTasks||=new Set).add(y);const b=y.task;return Promise.all([m.displayReadyCapability.promise,a]).then((([e,t])=>{if(this.destroyed)g();else{if(this._stats?.time("Rendering"),!(t.renderingIntent&h))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");y.initializeGraphics({transparency:e,optionalContentConfig:t}),y.operatorListChanged()}})).catch(g),b}getOperatorList({intent:e="display",annotationMode:t=i.AnnotationMode.ENABLE,printAnnotationStorage:r=null}={}){const n=this._transport.getRenderingIntent(e,t,r,!0);let s,o=this._intentStates.get(n.cacheKey);return o||(o=Object.create(null),this._intentStates.set(n.cacheKey,o)),o.opListReadCapability||(s=Object.create(null),s.operatorListChanged=function(){o.operatorList.lastChunk&&(o.opListReadCapability.resolve(o.operatorList),o.renderTasks.delete(s))},o.opListReadCapability=Promise.withResolvers(),(o.renderTasks||=new Set).add(s),o.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(n)),o.opListReadCapability.promise}streamTextContent({includeMarkedContent:e=!1,disableNormalization:t=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===e,disableNormalization:!0===t},{highWaterMark:100,size:e=>e.items.length})}getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then((e=>v.XfaText.textContent(e)));const t=this.streamTextContent(e);return new Promise((function(e,r){const n=t.getReader(),i={items:[],styles:Object.create(null)};!function t(){n.read().then((function({value:r,done:n}){n?e(i):(Object.assign(i.styles,r.styles),i.items.push(...r.items),t())}),r)}()}))}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const e=[];for(const t of this._intentStates.values())if(this._abortOperatorList({intentState:t,reason:new Error("Page was destroyed."),force:!0}),!t.opListReadCapability)for(const r of t.renderTasks)e.push(r.completed),r.cancel();return this.objs.clear(),this.#ye=!1,this.#be(),Promise.all(e)}cleanup(e=!1){this.#ye=!0;const t=this.#ve(!1);return e&&t&&(this._stats&&=new o.StatTimer),t}#ve(e=!1){if(this.#be(),!this.#ye||this.destroyed)return!1;if(e)return this.#ge=setTimeout((()=>{this.#ge=null,this.#ve(!1)}),q),!1;for(const{renderTasks:e,operatorList:t}of this._intentStates.values())if(e.size>0||!t.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#ye=!1,!0}#be(){this.#ge&&(clearTimeout(this.#ge),this.#ge=null)}_startRenderPage(e,t){const r=this._intentStates.get(t);r&&(this._stats?.timeEnd("Page Request"),r.displayReadyCapability?.resolve(e))}_renderPageChunk(e,t){for(let r=0,n=e.length;r<n;r++)t.operatorList.fnArray.push(e.fnArray[r]),t.operatorList.argsArray.push(e.argsArray[r]);t.operatorList.lastChunk=e.lastChunk,t.operatorList.separateAnnots=e.separateAnnots;for(const e of t.renderTasks)e.operatorListChanged();e.lastChunk&&this.#ve(!0)}_pumpOperatorList({renderingIntent:e,cacheKey:t,annotationStorageSerializable:r}){const{map:n,transfer:i}=r,s=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:t,annotationStorage:n},i).getReader(),o=this._intentStates.get(t);o.streamReader=s;const a=()=>{s.read().then((({value:e,done:t})=>{t?o.streamReader=null:this._transport.destroyed||(this._renderPageChunk(e,o),a())}),(e=>{if(o.streamReader=null,!this._transport.destroyed){if(o.operatorList){o.operatorList.lastChunk=!0;for(const e of o.renderTasks)e.operatorListChanged();this.#ve(!0)}if(o.displayReadyCapability)o.displayReadyCapability.reject(e);else{if(!o.opListReadCapability)throw e;o.opListReadCapability.reject(e)}}}))};a()}_abortOperatorList({intentState:e,reason:t,force:r=!1}){if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!r){if(e.renderTasks.size>0)return;if(t instanceof o.RenderingCancelledException){let r=z;return t.extraDelay>0&&t.extraDelay<1e3&&(r+=t.extraDelay),void(e.streamReaderCancelTimeout=setTimeout((()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:t,force:!0})}),r))}}if(e.streamReader.cancel(new i.AbortException(t.message)).catch((()=>{})),e.streamReader=null,!this._transport.destroyed){for(const[t,r]of this._intentStates)if(r===e){this._intentStates.delete(t);break}this.cleanup()}}}get stats(){return this._stats}}class LoopbackPort{#_e=new Set;#xe=Promise.resolve();postMessage(e,t){const r={data:structuredClone(e,t?{transfer:t}:null)};this.#xe.then((()=>{for(const e of this.#_e)e.call(this,r)}))}addEventListener(e,t){this.#_e.add(t)}removeEventListener(e,t){this.#_e.delete(t)}terminate(){this.#_e.clear()}}const te={isWorkerDisabled:!1,fakeWorkerId:0};i.isNodeJS&&(te.isWorkerDisabled=!0,d.GlobalWorkerOptions.workerSrc||="./pdf.worker.mjs"),te.isSameOrigin=function(e,t){let r;try{if(r=new URL(e),!r.origin||"null"===r.origin)return!1}catch{return!1}const n=new URL(t,r);return r.origin===n.origin},te.createCDNWrapper=function(e){const t=`await import("${e}");`;return URL.createObjectURL(new Blob([t],{type:"text/javascript"}))};class PDFWorker{static#we;constructor({name:e=null,port:t=null,verbosity:r=(0,i.getVerbosityLevel)()}={}){if(this.name=e,this.destroyed=!1,this.verbosity=r,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,t){if(PDFWorker.#we?.has(t))throw new Error("Cannot use more than one PDFWorker per port.");return(PDFWorker.#we||=new WeakMap).set(t,this),void this._initializeFromPort(t)}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(e){this._port=e,this._messageHandler=new h.MessageHandler("main","worker",e),this._messageHandler.on("ready",(function(){})),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!te.isWorkerDisabled&&!PDFWorker.#Se){let{workerSrc:e}=PDFWorker;try{te.isSameOrigin(window.location.href,e)||(e=te.createCDNWrapper(new URL(e,window.location).href));const t=new Worker(e,{type:"module"}),r=new h.MessageHandler("main","worker",t),n=()=>{t.removeEventListener("error",i),r.destroy(),t.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},i=()=>{this._webWorker||n()};t.addEventListener("error",i),r.on("test",(e=>{t.removeEventListener("error",i),this.destroyed?n():e?(this._messageHandler=r,this._port=t,this._webWorker=t,this._readyCapability.resolve(),r.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),r.destroy(),t.terminate())})),r.on("ready",(e=>{if(t.removeEventListener("error",i),this.destroyed)n();else try{s()}catch{this._setupFakeWorker()}}));const s=()=>{const e=new Uint8Array;r.send("test",e,[e.buffer])};return void s()}catch{(0,i.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){te.isWorkerDisabled||((0,i.warn)("Setting up fake worker."),te.isWorkerDisabled=!0),PDFWorker._setupFakeWorkerGlobal.then((e=>{if(this.destroyed)return void this._readyCapability.reject(new Error("Worker was destroyed"));const t=new LoopbackPort;this._port=t;const r="fake"+te.fakeWorkerId++,n=new h.MessageHandler(r+"_worker",r,t);e.setup(n,t);const i=new h.MessageHandler(r,r+"_worker",t);this._messageHandler=i,this._readyCapability.resolve(),i.send("configure",{verbosity:this.verbosity})})).catch((e=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${e.message}".`))}))}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),PDFWorker.#we?.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(e){if(!e?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");const t=this.#we?.get(e.port);if(t){if(t._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return t}return new PDFWorker(e)}static get workerSrc(){if(d.GlobalWorkerOptions.workerSrc)return d.GlobalWorkerOptions.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get#Se(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){return(0,i.shadow)(this,"_setupFakeWorkerGlobal",(async()=>{if(this.#Se)return this.#Se;return(await import(this.workerSrc)).WorkerMessageHandler})())}}class WorkerTransport{#Pe=new Map;#Ee=new Map;#Me=new Map;#Ce=new Map;#Ae=null;constructor(e,t,r,n,i){this.messageHandler=e,this.loadingTask=t,this.commonObjs=new PDFObjects,this.fontLoader=new a.FontLoader({ownerDocument:n.ownerDocument,styleElement:n.styleElement}),this._params=n,this.canvasFactory=i.canvasFactory,this.filterFactory=i.filterFactory,this.cMapReaderFactory=i.cMapReaderFactory,this.standardFontDataFactory=i.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=r,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}#Te(e,t=null){const r=this.#Pe.get(e);if(r)return r;const n=this.messageHandler.sendWithPromise(e,t);return this.#Pe.set(e,n),n}get annotationStorage(){return(0,i.shadow)(this,"annotationStorage",new s.AnnotationStorage)}getRenderingIntent(e,t=i.AnnotationMode.ENABLE,r=null,n=!1){let o=i.RenderingIntentFlag.DISPLAY,a=s.SerializableEmpty;switch(e){case"any":o=i.RenderingIntentFlag.ANY;break;case"display":break;case"print":o=i.RenderingIntentFlag.PRINT;break;default:(0,i.warn)(`getRenderingIntent - invalid intent: ${e}`)}switch(t){case i.AnnotationMode.DISABLE:o+=i.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case i.AnnotationMode.ENABLE:break;case i.AnnotationMode.ENABLE_FORMS:o+=i.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case i.AnnotationMode.ENABLE_STORAGE:o+=i.RenderingIntentFlag.ANNOTATIONS_STORAGE;a=(o&i.RenderingIntentFlag.PRINT&&r instanceof s.PrintAnnotationStorage?r:this.annotationStorage).serializable;break;default:(0,i.warn)(`getRenderingIntent - invalid annotationMode: ${t}`)}return n&&(o+=i.RenderingIntentFlag.OPLIST),{renderingIntent:o,cacheKey:`${o}_${a.hash}`,annotationStorageSerializable:a}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#Ae?.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];for(const t of this.#Ee.values())e.push(t._destroy());this.#Ee.clear(),this.#Me.clear(),this.#Ce.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const t=this.messageHandler.sendWithPromise("Terminate",null);return e.push(t),Promise.all(e).then((()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#Pe.clear(),this.filterFactory.destroy(),(0,u.cleanupTextLayer)(),this._networkStream?.cancelAllRequests(new i.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()}),this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:e,loadingTask:t}=this;e.on("GetReader",((e,t)=>{(0,i.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=e=>{this._lastProgress={loaded:e.loaded,total:e.total}},t.onPull=()=>{this._fullReader.read().then((function({value:e,done:r}){r?t.close():((0,i.assert)(e instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),t.enqueue(new Uint8Array(e),1,[e]))})).catch((e=>{t.error(e)}))},t.onCancel=e=>{this._fullReader.cancel(e),t.ready.catch((e=>{if(!this.destroyed)throw e}))}})),e.on("ReaderHeadersReady",(e=>{const r=Promise.withResolvers(),n=this._fullReader;return n.headersReady.then((()=>{n.isStreamingSupported&&n.isRangeSupported||(this._lastProgress&&t.onProgress?.(this._lastProgress),n.onProgress=e=>{t.onProgress?.({loaded:e.loaded,total:e.total})}),r.resolve({isStreamingSupported:n.isStreamingSupported,isRangeSupported:n.isRangeSupported,contentLength:n.contentLength})}),r.reject),r.promise})),e.on("GetRangeReader",((e,t)=>{(0,i.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const r=this._networkStream.getRangeReader(e.begin,e.end);r?(t.onPull=()=>{r.read().then((function({value:e,done:r}){r?t.close():((0,i.assert)(e instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),t.enqueue(new Uint8Array(e),1,[e]))})).catch((e=>{t.error(e)}))},t.onCancel=e=>{r.cancel(e),t.ready.catch((e=>{if(!this.destroyed)throw e}))}):t.close()})),e.on("GetDoc",(({pdfInfo:e})=>{this._numPages=e.numPages,this._htmlForXfa=e.htmlForXfa,delete e.htmlForXfa,t._capability.resolve(new PDFDocumentProxy(e,this))})),e.on("DocException",(function(e){let r;switch(e.name){case"PasswordException":r=new i.PasswordException(e.message,e.code);break;case"InvalidPDFException":r=new i.InvalidPDFException(e.message);break;case"MissingPDFException":r=new i.MissingPDFException(e.message);break;case"UnexpectedResponseException":r=new i.UnexpectedResponseException(e.message,e.status);break;case"UnknownErrorException":r=new i.UnknownErrorException(e.message,e.details);break;default:(0,i.unreachable)("DocException - expected a valid Error.")}t._capability.reject(r)})),e.on("PasswordRequest",(e=>{if(this.#Ae=Promise.withResolvers(),t.onPassword){const r=e=>{e instanceof Error?this.#Ae.reject(e):this.#Ae.resolve({password:e})};try{t.onPassword(r,e.code)}catch(e){this.#Ae.reject(e)}}else this.#Ae.reject(new i.PasswordException(e.message,e.code));return this.#Ae.promise})),e.on("DataLoaded",(e=>{t.onProgress?.({loaded:e.length,total:e.length}),this.downloadInfoCapability.resolve(e)})),e.on("StartRenderPage",(e=>{if(this.destroyed)return;this.#Ee.get(e.pageIndex)._startRenderPage(e.transparency,e.cacheKey)})),e.on("commonobj",(([t,r,n])=>{if(this.destroyed)return null;if(this.commonObjs.has(t))return null;switch(r){case"Font":const s=this._params;if("error"in n){const e=n.error;(0,i.warn)(`Error during font loading: ${e}`),this.commonObjs.resolve(t,e);break}const o=s.pdfBug&&globalThis.FontInspector?.enabled?(e,t)=>globalThis.FontInspector.fontAdded(e,t):null,l=new a.FontFaceObject(n,{disableFontFace:s.disableFontFace,ignoreErrors:s.ignoreErrors,inspectFont:o});this.fontLoader.bind(l).catch((()=>e.sendWithPromise("FontFallback",{id:t}))).finally((()=>{!s.fontExtraProperties&&l.data&&(l.data=null),this.commonObjs.resolve(t,l)}));break;case"CopyLocalImage":const{imageRef:c}=n;(0,i.assert)(c,"The imageRef must be defined.");for(const e of this.#Ee.values())for(const[,r]of e.objs)if(r.ref===c)return r.dataLen?(this.commonObjs.resolve(t,structuredClone(r)),r.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(t,n);break;default:throw new Error(`Got unknown common object type ${r}`)}return null})),e.on("obj",(([e,t,r,n])=>{if(this.destroyed)return;const s=this.#Ee.get(t);if(!s.objs.has(e))if(0!==s._intentStates.size)switch(r){case"Image":s.objs.resolve(e,n),n?.dataLen>i.MAX_IMAGE_SIZE_TO_CACHE&&(s._maybeCleanupAfterRender=!0);break;case"Pattern":s.objs.resolve(e,n);break;default:throw new Error(`Got unknown object type ${r}`)}else n?.bitmap?.close()})),e.on("DocProgress",(e=>{this.destroyed||t.onProgress?.({loaded:e.loaded,total:e.total})})),e.on("FetchBuiltInCMap",(e=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(e):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter.")))),e.on("FetchStandardFontData",(e=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(e):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter."))))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&(0,i.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:e,transfer:t}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:e,filename:this._fullReader?.filename??null},t).finally((()=>{this.annotationStorage.resetModified()}))}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request."));const t=e-1,r=this.#Me.get(t);if(r)return r;const n=this.messageHandler.sendWithPromise("GetPage",{pageIndex:t}).then((r=>{if(this.destroyed)throw new Error("Transport destroyed");r.refStr&&this.#Ce.set(r.refStr,e);const n=new PDFPageProxy(t,r,this,this._params.pdfBug);return this.#Ee.set(t,n),n}));return this.#Me.set(t,n),n}getPageIndex(e){return k(e)?this.messageHandler.sendWithPromise("GetPageIndex",{num:e.num,gen:e.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(e,t){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:t})}getFieldObjects(){return this.#Te("GetFieldObjects")}hasJSActions(){return this.#Te("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return"string"!=typeof e?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return this.#Te("GetDocJSActions")}getPageJSActions(e){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:e})}getStructTree(e){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:e})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(e){return this.#Te("GetOptionalContentConfig").then((t=>new m.OptionalContentConfig(t,e)))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const e="GetMetadata",t=this.#Pe.get(e);if(t)return t;const r=this.messageHandler.sendWithPromise(e,null).then((e=>({info:e[0],metadata:e[1]?new p.Metadata(e[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null})));return this.#Pe.set(e,r),r}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(e=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const e of this.#Ee.values()){if(!e.cleanup())throw new Error(`startCleanup: Page ${e.pageNumber} is currently rendering.`)}this.commonObjs.clear(),e||this.fontLoader.clear(),this.#Pe.clear(),this.filterFactory.destroy(!0),(0,u.cleanupTextLayer)()}}cachedPageNumber(e){if(!k(e))return null;const t=0===e.gen?`${e.num}R`:`${e.num}R${e.gen}`;return this.#Ce.get(t)??null}get loadingParams(){const{disableAutoFetch:e,enableXfa:t}=this._params;return(0,i.shadow)(this,"loadingParams",{disableAutoFetch:e,enableXfa:t})}}const re=Symbol("INITIAL_DATA");class PDFObjects{#De=Object.create(null);#Oe(e){return this.#De[e]||={...Promise.withResolvers(),data:re}}get(e,t=null){if(t){const r=this.#Oe(e);return r.promise.then((()=>t(r.data))),null}const r=this.#De[e];if(!r||r.data===re)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return r.data}has(e){const t=this.#De[e];return!!t&&t.data!==re}resolve(e,t=null){const r=this.#Oe(e);r.data=t,r.resolve()}clear(){for(const e in this.#De){const{data:t}=this.#De[e];t?.bitmap?.close()}this.#De=Object.create(null)}*[Symbol.iterator](){for(const e in this.#De){const{data:t}=this.#De[e];t!==re&&(yield[e,t])}}}class RenderTask{#Re=null;constructor(e){this.#Re=e,this.onContinue=null}get promise(){return this.#Re.capability.promise}cancel(e=0){this.#Re.cancel(null,e)}get separateAnnots(){const{separateAnnots:e}=this.#Re.operatorList;if(!e)return!1;const{annotationCanvasMap:t}=this.#Re;return e.form||e.canvas&&t?.size>0}}class InternalRenderTask{static#Le=new WeakSet;constructor({callback:e,params:t,objs:r,commonObjs:n,annotationCanvasMap:i,operatorList:s,pageIndex:o,canvasFactory:a,filterFactory:l,useRequestAnimationFrame:c=!1,pdfBug:u=!1,pageColors:d=null}){this.callback=e,this.params=t,this.objs=r,this.commonObjs=n,this.annotationCanvasMap=i,this.operatorListIdx=null,this.operatorList=s,this._pageIndex=o,this.canvasFactory=a,this.filterFactory=l,this._pdfBug=u,this.pageColors=d,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===c&&"undefined"!=typeof window,this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new RenderTask(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=t.canvasContext.canvas}get completed(){return this.capability.promise.catch((function(){}))}initializeGraphics({transparency:e=!1,optionalContentConfig:t}){if(this.cancelled)return;if(this._canvas){if(InternalRenderTask.#Le.has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");InternalRenderTask.#Le.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:r,viewport:n,transform:i,background:s}=this.params;this.gfx=new c.CanvasGraphics(r,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:t},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:i,viewport:n,transparency:e,background:s}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(e=null,t=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),InternalRenderTask.#Le.delete(this._canvas),this.callback(e||new o.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,t))}operatorListChanged(){this.graphicsReady?(this.stepper?.updateOperatorList(this.operatorList),this.running||this._continue()):this.graphicsReadyCallback||=this._continueBound}_continue(){this.running=!0,this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame((()=>{this._nextBound().catch(this._cancelBound)})):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),InternalRenderTask.#Le.delete(this._canvas),this.callback())))}}const ne="4.2.67",ie="49b388101";n()}catch(se){n(se)}}))},583:(e,t,r)=>{r.d(t,{BaseCMapReaderFactory:()=>BaseCMapReaderFactory,BaseCanvasFactory:()=>BaseCanvasFactory,BaseFilterFactory:()=>BaseFilterFactory,BaseSVGFactory:()=>BaseSVGFactory,BaseStandardFontDataFactory:()=>BaseStandardFontDataFactory});var n=r(292);class BaseFilterFactory{constructor(){this.constructor===BaseFilterFactory&&(0,n.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(e){return"none"}addHCMFilter(e,t){return"none"}addHighlightHCMFilter(e,t,r,n,i){return"none"}destroy(e=!1){}}class BaseCanvasFactory{constructor(){this.constructor===BaseCanvasFactory&&(0,n.unreachable)("Cannot initialize BaseCanvasFactory.")}create(e,t){if(e<=0||t<=0)throw new Error("Invalid canvas size");const r=this._createCanvas(e,t);return{canvas:r,context:r.getContext("2d")}}reset(e,t,r){if(!e.canvas)throw new Error("Canvas is not specified");if(t<=0||r<=0)throw new Error("Invalid canvas size");e.canvas.width=t,e.canvas.height=r}destroy(e){if(!e.canvas)throw new Error("Canvas is not specified");e.canvas.width=0,e.canvas.height=0,e.canvas=null,e.context=null}_createCanvas(e,t){(0,n.unreachable)("Abstract method `_createCanvas` called.")}}class BaseCMapReaderFactory{constructor({baseUrl:e=null,isCompressed:t=!0}){this.constructor===BaseCMapReaderFactory&&(0,n.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=e,this.isCompressed=t}async fetch({name:e}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!e)throw new Error("CMap name must be specified.");const t=this.baseUrl+e+(this.isCompressed?".bcmap":""),r=this.isCompressed?n.CMapCompressionType.BINARY:n.CMapCompressionType.NONE;return this._fetchData(t,r).catch((e=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${t}`)}))}_fetchData(e,t){(0,n.unreachable)("Abstract method `_fetchData` called.")}}class BaseStandardFontDataFactory{constructor({baseUrl:e=null}){this.constructor===BaseStandardFontDataFactory&&(0,n.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!e)throw new Error("Font filename must be specified.");const t=`${this.baseUrl}${e}`;return this._fetchData(t).catch((e=>{throw new Error(`Unable to load font data at: ${t}`)}))}_fetchData(e){(0,n.unreachable)("Abstract method `_fetchData` called.")}}class BaseSVGFactory{constructor(){this.constructor===BaseSVGFactory&&(0,n.unreachable)("Cannot initialize BaseSVGFactory.")}create(e,t,r=!1){if(e<=0||t<=0)throw new Error("Invalid SVG dimensions");const n=this._createSVG("svg:svg");return n.setAttribute("version","1.1"),r||(n.setAttribute("width",`${e}px`),n.setAttribute("height",`${t}px`)),n.setAttribute("preserveAspectRatio","none"),n.setAttribute("viewBox",`0 0 ${e} ${t}`),n}createElement(e){if("string"!=typeof e)throw new Error("Invalid SVG element type");return this._createSVG(e)}_createSVG(e){(0,n.unreachable)("Abstract method `_createSVG` called.")}}},923:(e,t,r)=>{r.d(t,{CanvasGraphics:()=>CanvasGraphics});var n=r(292),i=r(419);const s="Fill",o="Stroke",a="Shading";function l(e,t){if(!t)return;const r=t[2]-t[0],n=t[3]-t[1],i=new Path2D;i.rect(t[0],t[1],r,n),e.clip(i)}class BaseShadingPattern{constructor(){this.constructor===BaseShadingPattern&&(0,n.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,n.unreachable)("Abstract method `getPattern` called.")}}class RadialAxialShadingPattern extends BaseShadingPattern{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7],this.matrix=null}_createGradient(e){let t;"axial"===this._type?t=e.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(t=e.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const e of this._colorStops)t.addColorStop(e[0],e[1]);return t}getPattern(e,t,r,a){let c;if(a===o||a===s){const s=t.current.getClippedPathBoundingBox(a,(0,i.getCurrentTransform)(e))||[0,0,0,0],o=Math.ceil(s[2]-s[0])||1,u=Math.ceil(s[3]-s[1])||1,d=t.cachedCanvases.getCanvas("pattern",o,u,!0),h=d.context;h.clearRect(0,0,h.canvas.width,h.canvas.height),h.beginPath(),h.rect(0,0,h.canvas.width,h.canvas.height),h.translate(-s[0],-s[1]),r=n.Util.transform(r,[1,0,0,1,s[0],s[1]]),h.transform(...t.baseTransform),this.matrix&&h.transform(...this.matrix),l(h,this._bbox),h.fillStyle=this._createGradient(h),h.fill(),c=e.createPattern(d.canvas,"no-repeat");const p=new DOMMatrix(r);c.setTransform(p)}else l(e,this._bbox),c=this._createGradient(e);return c}}function c(e,t,r,n,i,s,o,a){const l=t.coords,c=t.colors,u=e.data,d=4*e.width;let h;l[r+1]>l[n+1]&&(h=r,r=n,n=h,h=s,s=o,o=h),l[n+1]>l[i+1]&&(h=n,n=i,i=h,h=o,o=a,a=h),l[r+1]>l[n+1]&&(h=r,r=n,n=h,h=s,s=o,o=h);const p=(l[r]+t.offsetX)*t.scaleX,m=(l[r+1]+t.offsetY)*t.scaleY,f=(l[n]+t.offsetX)*t.scaleX,g=(l[n+1]+t.offsetY)*t.scaleY,y=(l[i]+t.offsetX)*t.scaleX,b=(l[i+1]+t.offsetY)*t.scaleY;if(m>=b)return;const v=c[s],_=c[s+1],x=c[s+2],w=c[o],R=c[o+1],k=c[o+2],j=c[a],z=c[a+1],q=c[a+2],$=Math.round(m),Z=Math.round(b);let X,Y,ee,te,re,ne,ie,se;for(let e=$;e<=Z;e++){if(e<g){const t=e<m?0:(m-e)/(m-g);X=p-(p-f)*t,Y=v-(v-w)*t,ee=_-(_-R)*t,te=x-(x-k)*t}else{let t;t=e>b?1:g===b?0:(g-e)/(g-b),X=f-(f-y)*t,Y=w-(w-j)*t,ee=R-(R-z)*t,te=k-(k-q)*t}let t;t=e<m?0:e>b?1:(m-e)/(m-b),re=p-(p-y)*t,ne=v-(v-j)*t,ie=_-(_-z)*t,se=x-(x-q)*t;const r=Math.round(Math.min(X,re)),n=Math.round(Math.max(X,re));let i=d*e+4*r;for(let e=r;e<=n;e++)t=(X-e)/(X-re),t<0?t=0:t>1&&(t=1),u[i++]=Y-(Y-ne)*t|0,u[i++]=ee-(ee-ie)*t|0,u[i++]=te-(te-se)*t|0,u[i++]=255}}function u(e,t,r){const n=t.coords,i=t.colors;let s,o;switch(t.type){case"lattice":const a=t.verticesPerRow,l=Math.floor(n.length/a)-1,u=a-1;for(s=0;s<l;s++){let t=s*a;for(let s=0;s<u;s++,t++)c(e,r,n[t],n[t+1],n[t+a],i[t],i[t+1],i[t+a]),c(e,r,n[t+a+1],n[t+1],n[t+a],i[t+a+1],i[t+1],i[t+a])}break;case"triangles":for(s=0,o=n.length;s<o;s+=3)c(e,r,n[s],n[s+1],n[s+2],i[s],i[s+1],i[s+2]);break;default:throw new Error("illegal figure")}}class MeshShadingPattern extends BaseShadingPattern{constructor(e){super(),this._coords=e[2],this._colors=e[3],this._figures=e[4],this._bounds=e[5],this._bbox=e[7],this._background=e[8],this.matrix=null}_createMeshCanvas(e,t,r){const n=Math.floor(this._bounds[0]),i=Math.floor(this._bounds[1]),s=Math.ceil(this._bounds[2])-n,o=Math.ceil(this._bounds[3])-i,a=Math.min(Math.ceil(Math.abs(s*e[0]*1.1)),3e3),l=Math.min(Math.ceil(Math.abs(o*e[1]*1.1)),3e3),c=s/a,d=o/l,h={coords:this._coords,colors:this._colors,offsetX:-n,offsetY:-i,scaleX:1/c,scaleY:1/d},p=a+4,m=l+4,f=r.getCanvas("mesh",p,m,!1),g=f.context,y=g.createImageData(a,l);if(t){const e=y.data;for(let r=0,n=e.length;r<n;r+=4)e[r]=t[0],e[r+1]=t[1],e[r+2]=t[2],e[r+3]=255}for(const e of this._figures)u(y,e,h);g.putImageData(y,2,2);return{canvas:f.canvas,offsetX:n-2*c,offsetY:i-2*d,scaleX:c,scaleY:d}}getPattern(e,t,r,s){let o;if(l(e,this._bbox),s===a)o=n.Util.singularValueDecompose2dScale((0,i.getCurrentTransform)(e));else if(o=n.Util.singularValueDecompose2dScale(t.baseTransform),this.matrix){const e=n.Util.singularValueDecompose2dScale(this.matrix);o=[o[0]*e[0],o[1]*e[1]]}const c=this._createMeshCanvas(o,s===a?null:this._background,t.cachedCanvases);return s!==a&&(e.setTransform(...t.baseTransform),this.matrix&&e.transform(...this.matrix)),e.translate(c.offsetX,c.offsetY),e.scale(c.scaleX,c.scaleY),e.createPattern(c.canvas,"no-repeat")}}class DummyShadingPattern extends BaseShadingPattern{getPattern(){return"hotpink"}}const d=1,h=2;class TilingPattern{static MAX_PATTERN_SIZE=3e3;constructor(e,t,r,n,i){this.operatorList=e[2],this.matrix=e[3]||[1,0,0,1,0,0],this.bbox=e[4],this.xstep=e[5],this.ystep=e[6],this.paintType=e[7],this.tilingType=e[8],this.color=t,this.ctx=r,this.canvasGraphicsFactory=n,this.baseTransform=i}createPatternCanvas(e){const t=this.operatorList,r=this.bbox,s=this.xstep,o=this.ystep,a=this.paintType,l=this.tilingType,c=this.color,u=this.canvasGraphicsFactory;(0,n.info)("TilingType: "+l);const d=r[0],h=r[1],p=r[2],m=r[3],f=n.Util.singularValueDecompose2dScale(this.matrix),g=n.Util.singularValueDecompose2dScale(this.baseTransform),y=[f[0]*g[0],f[1]*g[1]],b=this.getSizeAndScale(s,this.ctx.canvas.width,y[0]),v=this.getSizeAndScale(o,this.ctx.canvas.height,y[1]),_=e.cachedCanvases.getCanvas("pattern",b.size,v.size,!0),x=_.context,w=u.createCanvasGraphics(x);w.groupLevel=e.groupLevel,this.setFillAndStrokeStyleToContext(w,a,c);let R=d,k=h,j=p,z=m;return d<0&&(R=0,j+=Math.abs(d)),h<0&&(k=0,z+=Math.abs(h)),x.translate(-b.scale*R,-v.scale*k),w.transform(b.scale,0,0,v.scale,0,0),x.save(),this.clipBbox(w,R,k,j,z),w.baseTransform=(0,i.getCurrentTransform)(w.ctx),w.executeOperatorList(t),w.endDrawing(),{canvas:_.canvas,scaleX:b.scale,scaleY:v.scale,offsetX:R,offsetY:k}}getSizeAndScale(e,t,r){e=Math.abs(e);const n=Math.max(TilingPattern.MAX_PATTERN_SIZE,t);let i=Math.ceil(e*r);return i>=n?i=n:r=i/e,{scale:r,size:i}}clipBbox(e,t,r,n,s){const o=n-t,a=s-r;e.ctx.rect(t,r,o,a),e.current.updateRectMinMax((0,i.getCurrentTransform)(e.ctx),[t,r,n,s]),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,t,r){const i=e.ctx,s=e.current;switch(t){case d:const e=this.ctx;i.fillStyle=e.fillStyle,i.strokeStyle=e.strokeStyle,s.fillColor=e.fillStyle,s.strokeColor=e.strokeStyle;break;case h:const o=n.Util.makeHexColor(r[0],r[1],r[2]);i.fillStyle=o,i.strokeStyle=o,s.fillColor=o,s.strokeColor=o;break;default:throw new n.FormatError(`Unsupported paint type: ${t}`)}}getPattern(e,t,r,i){let s=r;i!==a&&(s=n.Util.transform(s,t.baseTransform),this.matrix&&(s=n.Util.transform(s,this.matrix)));const o=this.createPatternCanvas(t);let l=new DOMMatrix(s);l=l.translate(o.offsetX,o.offsetY),l=l.scale(1/o.scaleX,1/o.scaleY);const c=e.createPattern(o.canvas,"repeat");return c.setTransform(l),c}}function p({src:e,srcPos:t=0,dest:r,width:i,height:s,nonBlackColor:o=4294967295,inverseDecode:a=!1}){const l=n.FeatureTest.isLittleEndian?4278190080:255,[c,u]=a?[o,l]:[l,o],d=i>>3,h=7&i,p=e.length;r=new Uint32Array(r.buffer);let m=0;for(let n=0;n<s;n++){for(const n=t+d;t<n;t++){const n=t<p?e[t]:255;r[m++]=128&n?u:c,r[m++]=64&n?u:c,r[m++]=32&n?u:c,r[m++]=16&n?u:c,r[m++]=8&n?u:c,r[m++]=4&n?u:c,r[m++]=2&n?u:c,r[m++]=1&n?u:c}if(0===h)continue;const n=t<p?e[t++]:255;for(let e=0;e<h;e++)r[m++]=n&1<<7-e?u:c}return{srcPos:t,destPos:m}}const m=4096,f=16;class CachedCanvases{constructor(e){this.canvasFactory=e,this.cache=Object.create(null)}getCanvas(e,t,r){let n;return void 0!==this.cache[e]?(n=this.cache[e],this.canvasFactory.reset(n,t,r)):(n=this.canvasFactory.create(t,r),this.cache[e]=n),n}delete(e){delete this.cache[e]}clear(){for(const e in this.cache){const t=this.cache[e];this.canvasFactory.destroy(t),delete this.cache[e]}}}function g(e,t,r,n,s,o,a,l,c,u){const[d,h,p,m,f,g]=(0,i.getCurrentTransform)(e);if(0===h&&0===p){const i=a*d+f,y=Math.round(i),b=l*m+g,v=Math.round(b),_=(a+c)*d+f,x=Math.abs(Math.round(_)-y)||1,w=(l+u)*m+g,R=Math.abs(Math.round(w)-v)||1;return e.setTransform(Math.sign(d),0,0,Math.sign(m),y,v),e.drawImage(t,r,n,s,o,0,0,x,R),e.setTransform(d,h,p,m,f,g),[x,R]}if(0===d&&0===m){const i=l*p+f,y=Math.round(i),b=a*h+g,v=Math.round(b),_=(l+u)*p+f,x=Math.abs(Math.round(_)-y)||1,w=(a+c)*h+g,R=Math.abs(Math.round(w)-v)||1;return e.setTransform(0,Math.sign(h),Math.sign(p),0,y,v),e.drawImage(t,r,n,s,o,0,0,R,x),e.setTransform(d,h,p,m,f,g),[R,x]}e.drawImage(t,r,n,s,o,a,l,c,u);return[Math.hypot(d,h)*c,Math.hypot(p,m)*u]}class CanvasExtraState{constructor(e,t){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=n.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=n.FONT_IDENTITY_MATRIX,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=n.TextRenderingMode.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,e,t])}clone(){const e=Object.create(this);return e.clipBox=this.clipBox.slice(),e}setCurrentPoint(e,t){this.x=e,this.y=t}updatePathMinMax(e,t,r){[t,r]=n.Util.applyTransform([t,r],e),this.minX=Math.min(this.minX,t),this.minY=Math.min(this.minY,r),this.maxX=Math.max(this.maxX,t),this.maxY=Math.max(this.maxY,r)}updateRectMinMax(e,t){const r=n.Util.applyTransform(t,e),i=n.Util.applyTransform(t.slice(2),e),s=n.Util.applyTransform([t[0],t[3]],e),o=n.Util.applyTransform([t[2],t[1]],e);this.minX=Math.min(this.minX,r[0],i[0],s[0],o[0]),this.minY=Math.min(this.minY,r[1],i[1],s[1],o[1]),this.maxX=Math.max(this.maxX,r[0],i[0],s[0],o[0]),this.maxY=Math.max(this.maxY,r[1],i[1],s[1],o[1])}updateScalingPathMinMax(e,t){n.Util.scaleMinMax(e,t),this.minX=Math.min(this.minX,t[0]),this.minY=Math.min(this.minY,t[1]),this.maxX=Math.max(this.maxX,t[2]),this.maxY=Math.max(this.maxY,t[3])}updateCurvePathMinMax(e,t,r,i,s,o,a,l,c,u){const d=n.Util.bezierBoundingBox(t,r,i,s,o,a,l,c,u);u||this.updateRectMinMax(e,d)}getPathBoundingBox(e=s,t=null){const r=[this.minX,this.minY,this.maxX,this.maxY];if(e===o){t||(0,n.unreachable)("Stroke bounding box must include transform.");const e=n.Util.singularValueDecompose2dScale(t),i=e[0]*this.lineWidth/2,s=e[1]*this.lineWidth/2;r[0]-=i,r[1]-=s,r[2]+=i,r[3]+=s}return r}updateClipFromPath(){const e=n.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(e){this.clipBox=e,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(e=s,t=null){return n.Util.intersect(this.clipBox,this.getPathBoundingBox(e,t))}}function y(e,t){if("undefined"!=typeof ImageData&&t instanceof ImageData)return void e.putImageData(t,0,0);const r=t.height,i=t.width,s=r%f,o=(r-s)/f,a=0===s?o:o+1,l=e.createImageData(i,f);let c,u=0;const d=t.data,h=l.data;let p,m,g,y;if(t.kind===n.ImageKind.GRAYSCALE_1BPP){const t=d.byteLength,r=new Uint32Array(h.buffer,0,h.byteLength>>2),y=r.length,b=i+7>>3,v=4294967295,_=n.FeatureTest.isLittleEndian?4278190080:255;for(p=0;p<a;p++){for(g=p<o?f:s,c=0,m=0;m<g;m++){const e=t-u;let n=0;const s=e>b?i:8*e-7,o=-8&s;let a=0,l=0;for(;n<o;n+=8)l=d[u++],r[c++]=128&l?v:_,r[c++]=64&l?v:_,r[c++]=32&l?v:_,r[c++]=16&l?v:_,r[c++]=8&l?v:_,r[c++]=4&l?v:_,r[c++]=2&l?v:_,r[c++]=1&l?v:_;for(;n<s;n++)0===a&&(l=d[u++],a=128),r[c++]=l&a?v:_,a>>=1}for(;c<y;)r[c++]=0;e.putImageData(l,0,p*f)}}else if(t.kind===n.ImageKind.RGBA_32BPP){for(m=0,y=i*f*4,p=0;p<o;p++)h.set(d.subarray(u,u+y)),u+=y,e.putImageData(l,0,m),m+=f;p<a&&(y=i*s*4,h.set(d.subarray(u,u+y)),e.putImageData(l,0,m))}else{if(t.kind!==n.ImageKind.RGB_24BPP)throw new Error(`bad image kind: ${t.kind}`);for(g=f,y=i*g,p=0;p<a;p++){for(p>=o&&(g=s,y=i*g),c=0,m=y;m--;)h[c++]=d[u++],h[c++]=d[u++],h[c++]=d[u++],h[c++]=255;e.putImageData(l,0,p*f)}}}function b(e,t){if(t.bitmap)return void e.drawImage(t.bitmap,0,0);const r=t.height,n=t.width,i=r%f,s=(r-i)/f,o=0===i?s:s+1,a=e.createImageData(n,f);let l=0;const c=t.data,u=a.data;for(let t=0;t<o;t++){const r=t<s?f:i;({srcPos:l}=p({src:c,srcPos:l,dest:u,width:n,height:r,nonBlackColor:0})),e.putImageData(a,0,t*f)}}function v(e,t){const r=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const n of r)void 0!==e[n]&&(t[n]=e[n]);void 0!==e.setLineDash&&(t.setLineDash(e.getLineDash()),t.lineDashOffset=e.lineDashOffset)}function _(e){if(e.strokeStyle=e.fillStyle="#000000",e.fillRule="nonzero",e.globalAlpha=1,e.lineWidth=1,e.lineCap="butt",e.lineJoin="miter",e.miterLimit=10,e.globalCompositeOperation="source-over",e.font="10px sans-serif",void 0!==e.setLineDash&&(e.setLineDash([]),e.lineDashOffset=0),!n.isNodeJS){const{filter:t}=e;"none"!==t&&""!==t&&(e.filter="none")}}function x(e,t,r,n){const i=e.length;for(let s=3;s<i;s+=4){const i=e[s];if(0===i)e[s-3]=t,e[s-2]=r,e[s-1]=n;else if(i<255){const o=255-i;e[s-3]=e[s-3]*i+t*o>>8,e[s-2]=e[s-2]*i+r*o>>8,e[s-1]=e[s-1]*i+n*o>>8}}}function w(e,t,r){const n=e.length;for(let i=3;i<n;i+=4){const n=r?r[e[i]]:e[i];t[i]=t[i]*n*.00392156862745098|0}}function R(e,t,r){const n=e.length;for(let i=3;i<n;i+=4){const n=77*e[i-3]+152*e[i-2]+28*e[i-1];t[i]=r?t[i]*r[n>>8]>>8:t[i]*n>>16}}function k(e,t,r,n){const i=n[0],s=n[1],o=n[2]-i,a=n[3]-s;0!==o&&0!==a&&(!function(e,t,r,n,i,s,o,a,l,c,u){const d=!!s,h=d?s[0]:0,p=d?s[1]:0,m=d?s[2]:0,f="Luminosity"===i?R:w,g=Math.min(n,Math.ceil(1048576/r));for(let i=0;i<n;i+=g){const s=Math.min(g,n-i),y=e.getImageData(a-c,i+(l-u),r,s),b=t.getImageData(a,i+l,r,s);d&&x(y.data,h,p,m),f(y.data,b.data,o),t.putImageData(b,a,i+l)}}(t.context,r,o,a,t.subtype,t.backdrop,t.transferMap,i,s,t.offsetX,t.offsetY),e.save(),e.globalAlpha=1,e.globalCompositeOperation="source-over",e.setTransform(1,0,0,1,0,0),e.drawImage(r.canvas,0,0),e.restore())}function j(e,t){if(t)return!0;const r=n.Util.singularValueDecompose2dScale(e);r[0]=Math.fround(r[0]),r[1]=Math.fround(r[1]);const s=Math.fround((globalThis.devicePixelRatio||1)*i.PixelsPerInch.PDF_TO_CSS_UNITS);return r[0]<=s&&r[1]<=s}const z=["butt","round","square"],q=["miter","round","bevel"],$={},Z={};class CanvasGraphics{constructor(e,t,r,n,i,{optionalContentConfig:s,markedContentStack:o=null},a,l){this.ctx=e,this.current=new CanvasExtraState(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=t,this.objs=r,this.canvasFactory=n,this.filterFactory=i,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=o||[],this.optionalContentConfig=s,this.cachedCanvases=new CachedCanvases(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=a,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=l,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(e,t=null){return"string"==typeof e?e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e):t}beginDrawing({transform:e,viewport:t,transparency:r=!1,background:n=null}){const s=this.ctx.canvas.width,o=this.ctx.canvas.height,a=this.ctx.fillStyle;if(this.ctx.fillStyle=n||"#ffffff",this.ctx.fillRect(0,0,s,o),this.ctx.fillStyle=a,r){const e=this.cachedCanvases.getCanvas("transparent",s,o);this.compositeCtx=this.ctx,this.transparentCanvas=e.canvas,this.ctx=e.context,this.ctx.save(),this.ctx.transform(...(0,i.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),_(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...t.transform),this.viewportScale=t.scale,this.baseTransform=(0,i.getCurrentTransform)(this.ctx)}executeOperatorList(e,t,r,i){const s=e.argsArray,o=e.fnArray;let a=t||0;const l=s.length;if(l===a)return a;const c=l-a>10&&"function"==typeof r,u=c?Date.now()+15:0;let d=0;const h=this.commonObjs,p=this.objs;let m;for(;;){if(void 0!==i&&a===i.nextBreakPoint)return i.breakIt(a,r),a;if(m=o[a],m!==n.OPS.dependency)this[m].apply(this,s[a]);else for(const e of s[a]){const t=e.startsWith("g_")?h:p;if(!t.has(e))return t.get(e,r),a}if(a++,a===l)return a;if(c&&++d>10){if(Date.now()>u)return r(),a;d=0}}}#ke(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}endDrawing(){this.#ke(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const e of this._cachedBitmapsMap.values()){for(const t of e.values())"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement&&(t.width=t.height=0);e.clear()}this._cachedBitmapsMap.clear(),this.#Ne()}#Ne(){if(this.pageColors){const e=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if("none"!==e){const t=this.ctx.filter;this.ctx.filter=e,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=t}}}_scaleImage(e,t){const r=e.width,n=e.height;let i,s,o=Math.max(Math.hypot(t[0],t[1]),1),a=Math.max(Math.hypot(t[2],t[3]),1),l=r,c=n,u="prescale1";for(;o>2&&l>1||a>2&&c>1;){let t=l,r=c;o>2&&l>1&&(t=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l/2),o/=l/t),a>2&&c>1&&(r=c>=16384?Math.floor(c/2)-1||1:Math.ceil(c)/2,a/=c/r),i=this.cachedCanvases.getCanvas(u,t,r),s=i.context,s.clearRect(0,0,t,r),s.drawImage(e,0,0,l,c,0,0,t,r),e=i.canvas,l=t,c=r,u="prescale1"===u?"prescale2":"prescale1"}return{img:e,paintWidth:l,paintHeight:c}}_createMaskCanvas(e){const t=this.ctx,{width:r,height:o}=e,a=this.current.fillColor,l=this.current.patternFill,c=(0,i.getCurrentTransform)(t);let u,d,h,p;if((e.bitmap||e.data)&&e.count>1){const t=e.bitmap||e.data.buffer;d=JSON.stringify(l?c:[c.slice(0,4),a]),u=this._cachedBitmapsMap.get(t),u||(u=new Map,this._cachedBitmapsMap.set(t,u));const r=u.get(d);if(r&&!l){return{canvas:r,offsetX:Math.round(Math.min(c[0],c[2])+c[4]),offsetY:Math.round(Math.min(c[1],c[3])+c[5])}}h=r}h||(p=this.cachedCanvases.getCanvas("maskCanvas",r,o),b(p.context,e));let m=n.Util.transform(c,[1/r,0,0,-1/o,0,0]);m=n.Util.transform(m,[1,0,0,1,0,-o]);const[f,y,v,_]=n.Util.getAxialAlignedBoundingBox([0,0,r,o],m),x=Math.round(v-f)||1,w=Math.round(_-y)||1,R=this.cachedCanvases.getCanvas("fillCanvas",x,w),k=R.context,z=f,q=y;k.translate(-z,-q),k.transform(...m),h||(h=this._scaleImage(p.canvas,(0,i.getCurrentTransformInverse)(k)),h=h.img,u&&l&&u.set(d,h)),k.imageSmoothingEnabled=j((0,i.getCurrentTransform)(k),e.interpolate),g(k,h,0,0,h.width,h.height,0,0,r,o),k.globalCompositeOperation="source-in";const $=n.Util.transform((0,i.getCurrentTransformInverse)(k),[1,0,0,1,-z,-q]);return k.fillStyle=l?a.getPattern(t,this,$,s):a,k.fillRect(0,0,r,o),u&&!l&&(this.cachedCanvases.delete("fillCanvas"),u.set(d,R.canvas)),{canvas:R.canvas,offsetX:Math.round(z),offsetY:Math.round(q)}}setLineWidth(e){e!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(e){this.ctx.lineCap=z[e]}setLineJoin(e){this.ctx.lineJoin=q[e]}setMiterLimit(e){this.ctx.miterLimit=e}setDash(e,t){const r=this.ctx;void 0!==r.setLineDash&&(r.setLineDash(e),r.lineDashOffset=t)}setRenderingIntent(e){}setFlatness(e){}setGState(e){for(const[t,r]of e)switch(t){case"LW":this.setLineWidth(r);break;case"LC":this.setLineCap(r);break;case"LJ":this.setLineJoin(r);break;case"ML":this.setMiterLimit(r);break;case"D":this.setDash(r[0],r[1]);break;case"RI":this.setRenderingIntent(r);break;case"FL":this.setFlatness(r);break;case"Font":this.setFont(r[0],r[1]);break;case"CA":this.current.strokeAlpha=r;break;case"ca":this.current.fillAlpha=r,this.ctx.globalAlpha=r;break;case"BM":this.ctx.globalCompositeOperation=r;break;case"SMask":this.current.activeSMask=r?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(r)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode():!this.current.activeSMask&&e&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const e=this.ctx.canvas.width,t=this.ctx.canvas.height,r="smaskGroupAt"+this.groupLevel,n=this.cachedCanvases.getCanvas(r,e,t);this.suspendedCtx=this.ctx,this.ctx=n.context;const s=this.ctx;s.setTransform(...(0,i.getCurrentTransform)(this.suspendedCtx)),v(this.suspendedCtx,s),function(e,t){if(e._removeMirroring)throw new Error("Context is already forwarding operations.");e.__originalSave=e.save,e.__originalRestore=e.restore,e.__originalRotate=e.rotate,e.__originalScale=e.scale,e.__originalTranslate=e.translate,e.__originalTransform=e.transform,e.__originalSetTransform=e.setTransform,e.__originalResetTransform=e.resetTransform,e.__originalClip=e.clip,e.__originalMoveTo=e.moveTo,e.__originalLineTo=e.lineTo,e.__originalBezierCurveTo=e.bezierCurveTo,e.__originalRect=e.rect,e.__originalClosePath=e.closePath,e.__originalBeginPath=e.beginPath,e._removeMirroring=()=>{e.save=e.__originalSave,e.restore=e.__originalRestore,e.rotate=e.__originalRotate,e.scale=e.__originalScale,e.translate=e.__originalTranslate,e.transform=e.__originalTransform,e.setTransform=e.__originalSetTransform,e.resetTransform=e.__originalResetTransform,e.clip=e.__originalClip,e.moveTo=e.__originalMoveTo,e.lineTo=e.__originalLineTo,e.bezierCurveTo=e.__originalBezierCurveTo,e.rect=e.__originalRect,e.closePath=e.__originalClosePath,e.beginPath=e.__originalBeginPath,delete e._removeMirroring},e.save=function(){t.save(),this.__originalSave()},e.restore=function(){t.restore(),this.__originalRestore()},e.translate=function(e,r){t.translate(e,r),this.__originalTranslate(e,r)},e.scale=function(e,r){t.scale(e,r),this.__originalScale(e,r)},e.transform=function(e,r,n,i,s,o){t.transform(e,r,n,i,s,o),this.__originalTransform(e,r,n,i,s,o)},e.setTransform=function(e,r,n,i,s,o){t.setTransform(e,r,n,i,s,o),this.__originalSetTransform(e,r,n,i,s,o)},e.resetTransform=function(){t.resetTransform(),this.__originalResetTransform()},e.rotate=function(e){t.rotate(e),this.__originalRotate(e)},e.clip=function(e){t.clip(e),this.__originalClip(e)},e.moveTo=function(e,r){t.moveTo(e,r),this.__originalMoveTo(e,r)},e.lineTo=function(e,r){t.lineTo(e,r),this.__originalLineTo(e,r)},e.bezierCurveTo=function(e,r,n,i,s,o){t.bezierCurveTo(e,r,n,i,s,o),this.__originalBezierCurveTo(e,r,n,i,s,o)},e.rect=function(e,r,n,i){t.rect(e,r,n,i),this.__originalRect(e,r,n,i)},e.closePath=function(){t.closePath(),this.__originalClosePath()},e.beginPath=function(){t.beginPath(),this.__originalBeginPath()}}(s,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),v(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(e){if(!this.current.activeSMask)return;e?(e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const t=this.current.activeSMask;k(this.suspendedCtx,t,this.ctx,e),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}save(){this.inSMaskMode?(v(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const e=this.current;this.stateStack.push(e),this.current=e.clone()}restore(){0===this.stateStack.length&&this.inSMaskMode&&this.endSMaskMode(),0!==this.stateStack.length&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),v(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(e,t,r,n,i,s){this.ctx.transform(e,t,r,n,i,s),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(e,t,r){const s=this.ctx,o=this.current;let a,l,c=o.x,u=o.y;const d=(0,i.getCurrentTransform)(s),h=0===d[0]&&0===d[3]||0===d[1]&&0===d[2],p=h?r.slice(0):null;for(let r=0,i=0,m=e.length;r<m;r++)switch(0|e[r]){case n.OPS.rectangle:c=t[i++],u=t[i++];const e=t[i++],r=t[i++],m=c+e,f=u+r;s.moveTo(c,u),0===e||0===r?s.lineTo(m,f):(s.lineTo(m,u),s.lineTo(m,f),s.lineTo(c,f)),h||o.updateRectMinMax(d,[c,u,m,f]),s.closePath();break;case n.OPS.moveTo:c=t[i++],u=t[i++],s.moveTo(c,u),h||o.updatePathMinMax(d,c,u);break;case n.OPS.lineTo:c=t[i++],u=t[i++],s.lineTo(c,u),h||o.updatePathMinMax(d,c,u);break;case n.OPS.curveTo:a=c,l=u,c=t[i+4],u=t[i+5],s.bezierCurveTo(t[i],t[i+1],t[i+2],t[i+3],c,u),o.updateCurvePathMinMax(d,a,l,t[i],t[i+1],t[i+2],t[i+3],c,u,p),i+=6;break;case n.OPS.curveTo2:a=c,l=u,s.bezierCurveTo(c,u,t[i],t[i+1],t[i+2],t[i+3]),o.updateCurvePathMinMax(d,a,l,c,u,t[i],t[i+1],t[i+2],t[i+3],p),c=t[i+2],u=t[i+3],i+=4;break;case n.OPS.curveTo3:a=c,l=u,c=t[i+2],u=t[i+3],s.bezierCurveTo(t[i],t[i+1],c,u,c,u),o.updateCurvePathMinMax(d,a,l,t[i],t[i+1],c,u,c,u,p),i+=4;break;case n.OPS.closePath:s.closePath()}h&&o.updateScalingPathMinMax(d,p),o.setCurrentPoint(c,u)}closePath(){this.ctx.closePath()}stroke(e=!0){const t=this.ctx,r=this.current.strokeColor;t.globalAlpha=this.current.strokeAlpha,this.contentVisible&&("object"==typeof r&&r?.getPattern?(t.save(),t.strokeStyle=r.getPattern(t,this,(0,i.getCurrentTransformInverse)(t),o),this.rescaleAndStroke(!1),t.restore()):this.rescaleAndStroke(!0)),e&&this.consumePath(this.current.getClippedPathBoundingBox()),t.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(e=!0){const t=this.ctx,r=this.current.fillColor;let n=!1;this.current.patternFill&&(t.save(),t.fillStyle=r.getPattern(t,this,(0,i.getCurrentTransformInverse)(t),s),n=!0);const o=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==o&&(this.pendingEOFill?(t.fill("evenodd"),this.pendingEOFill=!1):t.fill()),n&&t.restore(),e&&this.consumePath(o)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=$}eoClip(){this.pendingClip=Z}beginText(){this.current.textMatrix=n.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const e=this.pendingTextPaths,t=this.ctx;if(void 0!==e){t.save(),t.beginPath();for(const r of e)t.setTransform(...r.transform),t.translate(r.x,r.y),r.addToPath(t,r.fontSize);t.restore(),t.clip(),t.beginPath(),delete this.pendingTextPaths}else t.beginPath()}setCharSpacing(e){this.current.charSpacing=e}setWordSpacing(e){this.current.wordSpacing=e}setHScale(e){this.current.textHScale=e/100}setLeading(e){this.current.leading=-e}setFont(e,t){const r=this.commonObjs.get(e),i=this.current;if(!r)throw new Error(`Can't find font for ${e}`);if(i.fontMatrix=r.fontMatrix||n.FONT_IDENTITY_MATRIX,0!==i.fontMatrix[0]&&0!==i.fontMatrix[3]||(0,n.warn)("Invalid font matrix for font "+e),t<0?(t=-t,i.fontDirection=-1):i.fontDirection=1,this.current.font=r,this.current.fontSize=t,r.isType3Font)return;const s=r.loadedName||"sans-serif",o=r.systemFontInfo?.css||`"${s}", ${r.fallbackName}`;let a="normal";r.black?a="900":r.bold&&(a="bold");const l=r.italic?"italic":"normal";let c=t;t<16?c=16:t>100&&(c=100),this.current.fontSizeScale=t/c,this.ctx.font=`${l} ${a} ${c}px ${o}`}setTextRenderingMode(e){this.current.textRenderingMode=e}setTextRise(e){this.current.textRise=e}moveText(e,t){this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=t}setLeadingMoveText(e,t){this.setLeading(-t),this.moveText(e,t)}setTextMatrix(e,t,r,n,i,s){this.current.textMatrix=[e,t,r,n,i,s],this.current.textMatrixScale=Math.hypot(e,t),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(e,t,r,s){const o=this.ctx,a=this.current,l=a.font,c=a.textRenderingMode,u=a.fontSize/a.fontSizeScale,d=c&n.TextRenderingMode.FILL_STROKE_MASK,h=!!(c&n.TextRenderingMode.ADD_TO_PATH_FLAG),p=a.patternFill&&!l.missingFile;let m;if((l.disableFontFace||h||p)&&(m=l.getPathGenerator(this.commonObjs,e)),l.disableFontFace||p?(o.save(),o.translate(t,r),o.beginPath(),m(o,u),s&&o.setTransform(...s),d!==n.TextRenderingMode.FILL&&d!==n.TextRenderingMode.FILL_STROKE||o.fill(),d!==n.TextRenderingMode.STROKE&&d!==n.TextRenderingMode.FILL_STROKE||o.stroke(),o.restore()):(d!==n.TextRenderingMode.FILL&&d!==n.TextRenderingMode.FILL_STROKE||o.fillText(e,t,r),d!==n.TextRenderingMode.STROKE&&d!==n.TextRenderingMode.FILL_STROKE||o.strokeText(e,t,r)),h){(this.pendingTextPaths||=[]).push({transform:(0,i.getCurrentTransform)(o),x:t,y:r,fontSize:u,addToPath:m})}}get isFontSubpixelAAEnabled(){const{context:e}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);e.scale(1.5,1),e.fillText("I",0,10);const t=e.getImageData(0,0,10,10).data;let r=!1;for(let e=3;e<t.length;e+=4)if(t[e]>0&&t[e]<255){r=!0;break}return(0,n.shadow)(this,"isFontSubpixelAAEnabled",r)}showText(e){const t=this.current,r=t.font;if(r.isType3Font)return this.showType3Text(e);const o=t.fontSize;if(0===o)return;const a=this.ctx,l=t.fontSizeScale,c=t.charSpacing,u=t.wordSpacing,d=t.fontDirection,h=t.textHScale*d,p=e.length,m=r.vertical,f=m?1:-1,g=r.defaultVMetrics,y=o*t.fontMatrix[0],b=t.textRenderingMode===n.TextRenderingMode.FILL&&!r.disableFontFace&&!t.patternFill;let v;if(a.save(),a.transform(...t.textMatrix),a.translate(t.x,t.y+t.textRise),d>0?a.scale(h,-1):a.scale(h,1),t.patternFill){a.save();const e=t.fillColor.getPattern(a,this,(0,i.getCurrentTransformInverse)(a),s);v=(0,i.getCurrentTransform)(a),a.restore(),a.fillStyle=e}let _=t.lineWidth;const x=t.textMatrixScale;if(0===x||0===_){const e=t.textRenderingMode&n.TextRenderingMode.FILL_STROKE_MASK;e!==n.TextRenderingMode.STROKE&&e!==n.TextRenderingMode.FILL_STROKE||(_=this.getSinglePixelWidth())}else _/=x;if(1!==l&&(a.scale(l,l),_/=l),a.lineWidth=_,r.isInvalidPDFjsFont){const r=[];let n=0;for(const t of e)r.push(t.unicode),n+=t.width;return a.fillText(r.join(""),0,0),t.x+=n*y*h,a.restore(),void this.compose()}let w,R=0;for(w=0;w<p;++w){const t=e[w];if("number"==typeof t){R+=f*t*o/1e3;continue}let n=!1;const i=(t.isSpace?u:0)+c,s=t.fontChar,h=t.accent;let p,_,x=t.width;if(m){const e=t.vmetric||g,r=-(t.vmetric?e[1]:.5*x)*y,n=e[2]*y;x=e?-e[0]:x,p=r/l,_=(R+n)/l}else p=R/l,_=0;if(r.remeasure&&x>0){const e=1e3*a.measureText(s).width/o*l;if(x<e&&this.isFontSubpixelAAEnabled){const t=x/e;n=!0,a.save(),a.scale(t,1),p/=t}else x!==e&&(p+=(x-e)/2e3*o/l)}if(this.contentVisible&&(t.isInFont||r.missingFile))if(b&&!h)a.fillText(s,p,_);else if(this.paintChar(s,p,_,v),h){const e=p+o*h.offset.x/l,t=_-o*h.offset.y/l;this.paintChar(h.fontChar,e,t,v)}R+=m?x*y-i*d:x*y+i*d,n&&a.restore()}m?t.y-=R:t.x+=R*h,a.restore(),this.compose()}showType3Text(e){const t=this.ctx,r=this.current,i=r.font,s=r.fontSize,o=r.fontDirection,a=i.vertical?1:-1,l=r.charSpacing,c=r.wordSpacing,u=r.textHScale*o,d=r.fontMatrix||n.FONT_IDENTITY_MATRIX,h=e.length;let p,m,f,g;if(!(r.textRenderingMode===n.TextRenderingMode.INVISIBLE)&&0!==s){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,t.save(),t.transform(...r.textMatrix),t.translate(r.x,r.y),t.scale(u,o),p=0;p<h;++p){if(m=e[p],"number"==typeof m){g=a*m*s/1e3,this.ctx.translate(g,0),r.x+=g*u;continue}const o=(m.isSpace?c:0)+l,h=i.charProcOperatorList[m.operatorListId];if(!h){(0,n.warn)(`Type3 character "${m.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=m,this.save(),t.scale(s,s),t.transform(...d),this.executeOperatorList(h),this.restore());f=n.Util.applyTransform([m.width,0],d)[0]*s+o,t.translate(f,0),r.x+=f*u}t.restore(),this.processingType3=null}}setCharWidth(e,t){}setCharWidthAndBounds(e,t,r,n,i,s){this.ctx.rect(r,n,i-r,s-n),this.ctx.clip(),this.endPath()}getColorN_Pattern(e){let t;if("TilingPattern"===e[0]){const r=e[1],n=this.baseTransform||(0,i.getCurrentTransform)(this.ctx),s={createCanvasGraphics:e=>new CanvasGraphics(e,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};t=new TilingPattern(e,r,this.ctx,s,n)}else t=this._getPattern(e[1],e[2]);return t}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(e,t,r){const i=n.Util.makeHexColor(e,t,r);this.ctx.strokeStyle=i,this.current.strokeColor=i}setFillRGBColor(e,t,r){const i=n.Util.makeHexColor(e,t,r);this.ctx.fillStyle=i,this.current.fillColor=i,this.current.patternFill=!1}_getPattern(e,t=null){let r;return this.cachedPatterns.has(e)?r=this.cachedPatterns.get(e):(r=function(e){switch(e[0]){case"RadialAxial":return new RadialAxialShadingPattern(e);case"Mesh":return new MeshShadingPattern(e);case"Dummy":return new DummyShadingPattern}throw new Error(`Unknown IR type: ${e[0]}`)}(this.getObject(e)),this.cachedPatterns.set(e,r)),t&&(r.matrix=t),r}shadingFill(e){if(!this.contentVisible)return;const t=this.ctx;this.save();const r=this._getPattern(e);t.fillStyle=r.getPattern(t,this,(0,i.getCurrentTransformInverse)(t),a);const s=(0,i.getCurrentTransformInverse)(t);if(s){const{width:e,height:r}=t.canvas,[i,o,a,l]=n.Util.getAxialAlignedBoundingBox([0,0,e,r],s);this.ctx.fillRect(i,o,a-i,l-o)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){(0,n.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,n.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(e,t){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(e)&&6===e.length&&this.transform(...e),this.baseTransform=(0,i.getCurrentTransform)(this.ctx),t)){const e=t[2]-t[0],r=t[3]-t[1];this.ctx.rect(t[0],t[1],e,r),this.current.updateRectMinMax((0,i.getCurrentTransform)(this.ctx),t),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const t=this.ctx;e.isolated||(0,n.info)("TODO: Support non-isolated groups."),e.knockout&&(0,n.warn)("Knockout groups not supported.");const r=(0,i.getCurrentTransform)(t);if(e.matrix&&t.transform(...e.matrix),!e.bbox)throw new Error("Bounding box is required.");let s=n.Util.getAxialAlignedBoundingBox(e.bbox,(0,i.getCurrentTransform)(t));const o=[0,0,t.canvas.width,t.canvas.height];s=n.Util.intersect(s,o)||[0,0,0,0];const a=Math.floor(s[0]),l=Math.floor(s[1]);let c=Math.max(Math.ceil(s[2])-a,1),u=Math.max(Math.ceil(s[3])-l,1),d=1,h=1;c>m&&(d=c/m,c=m),u>m&&(h=u/m,u=m),this.current.startNewPathAndClipBox([0,0,c,u]);let p="groupAt"+this.groupLevel;e.smask&&(p+="_smask_"+this.smaskCounter++%2);const f=this.cachedCanvases.getCanvas(p,c,u),g=f.context;g.scale(1/d,1/h),g.translate(-a,-l),g.transform(...r),e.smask?this.smaskStack.push({canvas:f.canvas,context:g,offsetX:a,offsetY:l,scaleX:d,scaleY:h,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null}):(t.setTransform(1,0,0,1,0,0),t.translate(a,l),t.scale(d,h),t.save()),v(t,g),this.ctx=g,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(t),this.groupLevel++}endGroup(e){if(!this.contentVisible)return;this.groupLevel--;const t=this.ctx,r=this.groupStack.pop();if(this.ctx=r,this.ctx.imageSmoothingEnabled=!1,e.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const e=(0,i.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...e);const r=n.Util.getAxialAlignedBoundingBox([0,0,t.canvas.width,t.canvas.height],e);this.ctx.drawImage(t.canvas,0,0),this.ctx.restore(),this.compose(r)}}beginAnnotation(e,t,r,s,o){if(this.#ke(),_(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(t)&&4===t.length){const s=t[2]-t[0],a=t[3]-t[1];if(o&&this.annotationCanvasMap){(r=r.slice())[4]-=t[0],r[5]-=t[1],(t=t.slice())[0]=t[1]=0,t[2]=s,t[3]=a;const[o,l]=n.Util.singularValueDecompose2dScale((0,i.getCurrentTransform)(this.ctx)),{viewportScale:c}=this,u=Math.ceil(s*this.outputScaleX*c),d=Math.ceil(a*this.outputScaleY*c);this.annotationCanvas=this.canvasFactory.create(u,d);const{canvas:h,context:p}=this.annotationCanvas;this.annotationCanvasMap.set(e,h),this.annotationCanvas.savedCtx=this.ctx,this.ctx=p,this.ctx.save(),this.ctx.setTransform(o,0,0,-l,0,a*l),_(this.ctx)}else _(this.ctx),this.ctx.rect(t[0],t[1],s,a),this.ctx.clip(),this.endPath()}this.current=new CanvasExtraState(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...r),this.transform(...s)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),this.#Ne(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(e){if(!this.contentVisible)return;const t=e.count;(e=this.getObject(e.data,e)).count=t;const r=this.ctx,n=this.processingType3;if(n&&(void 0===n.compiled&&(n.compiled=function(e){const{width:t,height:r}=e;if(t>1e3||r>1e3)return null;const n=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),i=t+1;let s,o,a,l=new Uint8Array(i*(r+1));const c=t+7&-8;let u=new Uint8Array(c*r),d=0;for(const t of e.data){let e=128;for(;e>0;)u[d++]=t&e?0:255,e>>=1}let h=0;for(d=0,0!==u[d]&&(l[0]=1,++h),o=1;o<t;o++)u[d]!==u[d+1]&&(l[o]=u[d]?2:1,++h),d++;for(0!==u[d]&&(l[o]=2,++h),s=1;s<r;s++){d=s*c,a=s*i,u[d-c]!==u[d]&&(l[a]=u[d]?1:8,++h);let e=(u[d]?4:0)+(u[d-c]?8:0);for(o=1;o<t;o++)e=(e>>2)+(u[d+1]?4:0)+(u[d-c+1]?8:0),n[e]&&(l[a+o]=n[e],++h),d++;if(u[d-c]!==u[d]&&(l[a+o]=u[d]?2:4,++h),h>1e3)return null}for(d=c*(r-1),a=s*i,0!==u[d]&&(l[a]=8,++h),o=1;o<t;o++)u[d]!==u[d+1]&&(l[a+o]=u[d]?4:8,++h),d++;if(0!==u[d]&&(l[a+o]=4,++h),h>1e3)return null;const p=new Int32Array([0,i,-1,0,-i,0,0,0,1]),m=new Path2D;for(s=0;h&&s<=r;s++){let e=s*i;const r=e+t;for(;e<r&&!l[e];)e++;if(e===r)continue;m.moveTo(e%i,s);const n=e;let o=l[e];do{const t=p[o];do{e+=t}while(!l[e]);const r=l[e];5!==r&&10!==r?(o=r,l[e]=0):(o=r&51*o>>4,l[e]&=o>>2|o<<2),m.lineTo(e%i,e/i|0),l[e]||--h}while(n!==e);--s}return u=null,l=null,function(e){e.save(),e.scale(1/t,-1/r),e.translate(0,-r),e.fill(m),e.beginPath(),e.restore()}}(e)),n.compiled))return void n.compiled(r);const i=this._createMaskCanvas(e),s=i.canvas;r.save(),r.setTransform(1,0,0,1,0,0),r.drawImage(s,i.offsetX,i.offsetY),r.restore(),this.compose()}paintImageMaskXObjectRepeat(e,t,r=0,s=0,o,a){if(!this.contentVisible)return;e=this.getObject(e.data,e);const l=this.ctx;l.save();const c=(0,i.getCurrentTransform)(l);l.transform(t,r,s,o,0,0);const u=this._createMaskCanvas(e);l.setTransform(1,0,0,1,u.offsetX-c[4],u.offsetY-c[5]);for(let e=0,i=a.length;e<i;e+=2){const i=n.Util.transform(c,[t,r,s,o,a[e],a[e+1]]),[d,h]=n.Util.applyTransform([0,0],i);l.drawImage(u.canvas,d,h)}l.restore(),this.compose()}paintImageMaskXObjectGroup(e){if(!this.contentVisible)return;const t=this.ctx,r=this.current.fillColor,n=this.current.patternFill;for(const o of e){const{data:e,width:a,height:l,transform:c}=o,u=this.cachedCanvases.getCanvas("maskCanvas",a,l),d=u.context;d.save();b(d,this.getObject(e,o)),d.globalCompositeOperation="source-in",d.fillStyle=n?r.getPattern(d,this,(0,i.getCurrentTransformInverse)(t),s):r,d.fillRect(0,0,a,l),d.restore(),t.save(),t.transform(...c),t.scale(1,-1),g(t,u.canvas,0,0,a,l,0,-1,1,1),t.restore()}this.compose()}paintImageXObject(e){if(!this.contentVisible)return;const t=this.getObject(e);t?this.paintInlineImageXObject(t):(0,n.warn)("Dependent image isn't ready yet")}paintImageXObjectRepeat(e,t,r,i){if(!this.contentVisible)return;const s=this.getObject(e);if(!s)return void(0,n.warn)("Dependent image isn't ready yet");const o=s.width,a=s.height,l=[];for(let e=0,n=i.length;e<n;e+=2)l.push({transform:[t,0,0,r,i[e],i[e+1]],x:0,y:0,w:o,h:a});this.paintInlineImageXObjectGroup(s,l)}applyTransferMapsToCanvas(e){return"none"!==this.current.transferMaps&&(e.filter=this.current.transferMaps,e.drawImage(e.canvas,0,0),e.filter="none"),e.canvas}applyTransferMapsToBitmap(e){if("none"===this.current.transferMaps)return e.bitmap;const{bitmap:t,width:r,height:n}=e,i=this.cachedCanvases.getCanvas("inlineImage",r,n),s=i.context;return s.filter=this.current.transferMaps,s.drawImage(t,0,0),s.filter="none",i.canvas}paintInlineImageXObject(e){if(!this.contentVisible)return;const t=e.width,r=e.height,s=this.ctx;if(this.save(),!n.isNodeJS){const{filter:e}=s;"none"!==e&&""!==e&&(s.filter="none")}let o;if(s.scale(1/t,-1/r),e.bitmap)o=this.applyTransferMapsToBitmap(e);else if("function"==typeof HTMLElement&&e instanceof HTMLElement||!e.data)o=e;else{const n=this.cachedCanvases.getCanvas("inlineImage",t,r).context;y(n,e),o=this.applyTransferMapsToCanvas(n)}const a=this._scaleImage(o,(0,i.getCurrentTransformInverse)(s));s.imageSmoothingEnabled=j((0,i.getCurrentTransform)(s),e.interpolate),g(s,a.img,0,0,a.paintWidth,a.paintHeight,0,-r,t,r),this.compose(),this.restore()}paintInlineImageXObjectGroup(e,t){if(!this.contentVisible)return;const r=this.ctx;let n;if(e.bitmap)n=e.bitmap;else{const t=e.width,r=e.height,i=this.cachedCanvases.getCanvas("inlineImage",t,r).context;y(i,e),n=this.applyTransferMapsToCanvas(i)}for(const e of t)r.save(),r.transform(...e.transform),r.scale(1,-1),g(r,n,e.x,e.y,e.w,e.h,0,-1,1,1),r.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(e){}markPointProps(e,t){}beginMarkedContent(e){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(e,t){"OC"===e?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(t)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(e){const t=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(e);const r=this.ctx;this.pendingClip&&(t||(this.pendingClip===Z?r.clip("evenodd"):r.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),r.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const e=(0,i.getCurrentTransform)(this.ctx);if(0===e[1]&&0===e[2])this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(e[0]),Math.abs(e[3]));else{const t=Math.abs(e[0]*e[3]-e[2]*e[1]),r=Math.hypot(e[0],e[2]),n=Math.hypot(e[1],e[3]);this._cachedGetSinglePixelWidth=Math.max(r,n)/t}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(-1===this._cachedScaleForStroking[0]){const{lineWidth:e}=this.current,{a:t,b:r,c:n,d:i}=this.ctx.getTransform();let s,o;if(0===r&&0===n){const r=Math.abs(t),n=Math.abs(i);if(r===n)if(0===e)s=o=1/r;else{const t=r*e;s=o=t<1?1/t:1}else if(0===e)s=1/r,o=1/n;else{const t=r*e,i=n*e;s=t<1?1/t:1,o=i<1?1/i:1}}else{const a=Math.abs(t*i-r*n),l=Math.hypot(t,r),c=Math.hypot(n,i);if(0===e)s=c/a,o=l/a;else{const t=e*a;s=c>t?c/t:1,o=l>t?l/t:1}}this._cachedScaleForStroking[0]=s,this._cachedScaleForStroking[1]=o}return this._cachedScaleForStroking}rescaleAndStroke(e){const{ctx:t}=this,{lineWidth:r}=this.current,[n,i]=this.getScaleForStroking();if(t.lineWidth=r||1,1===n&&1===i)return void t.stroke();const s=t.getLineDash();if(e&&t.save(),t.scale(n,i),s.length>0){const e=Math.max(n,i);t.setLineDash(s.map((t=>t/e))),t.lineDashOffset/=e}t.stroke(),e&&t.restore()}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}}for(const e in n.OPS)void 0!==CanvasGraphics.prototype[e]&&(CanvasGraphics.prototype[n.OPS[e]]=CanvasGraphics.prototype[e])},419:(e,t,r)=>{r.d(t,{DOMCMapReaderFactory:()=>DOMCMapReaderFactory,DOMCanvasFactory:()=>DOMCanvasFactory,DOMFilterFactory:()=>DOMFilterFactory,DOMSVGFactory:()=>DOMSVGFactory,DOMStandardFontDataFactory:()=>DOMStandardFontDataFactory,PDFDateString:()=>PDFDateString,PageViewport:()=>PageViewport,PixelsPerInch:()=>PixelsPerInch,RenderingCancelledException:()=>RenderingCancelledException,StatTimer:()=>StatTimer,fetchData:()=>o,getColorValues:()=>g,getCurrentTransform:()=>y,getCurrentTransformInverse:()=>b,getFilenameFromUrl:()=>c,getPdfFilenameFromUrl:()=>u,getRGB:()=>f,getXfaPageViewport:()=>m,isDataScheme:()=>a,isPdfFile:()=>l,isValidFetchUrl:()=>d,noContextMenu:()=>h,setLayerDimensions:()=>v});var n=r(583),i=r(292);const s="http://www.w3.org/2000/svg";class PixelsPerInch{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}class DOMFilterFactory extends n.BaseFilterFactory{#Fe;#Ie;#fe;#Be;#je;#He=0;constructor({docId:e,ownerDocument:t=globalThis.document}={}){super(),this.#fe=e,this.#Be=t}get#Ue(){return this.#Fe||=new Map}get#ze(){return this.#je||=new Map}get#Ge(){if(!this.#Ie){const e=this.#Be.createElement("div"),{style:t}=e;t.visibility="hidden",t.contain="strict",t.width=t.height=0,t.position="absolute",t.top=t.left=0,t.zIndex=-1;const r=this.#Be.createElementNS(s,"svg");r.setAttribute("width",0),r.setAttribute("height",0),this.#Ie=this.#Be.createElementNS(s,"defs"),e.append(r),r.append(this.#Ie),this.#Be.body.append(e)}return this.#Ie}addFilter(e){if(!e)return"none";let t,r,n,i,s=this.#Ue.get(e);if(s)return s;if(1===e.length){const s=e[0],o=new Array(256);for(let e=0;e<256;e++)o[e]=s[e]/255;i=t=r=n=o.join(",")}else{const[s,o,a]=e,l=new Array(256),c=new Array(256),u=new Array(256);for(let e=0;e<256;e++)l[e]=s[e]/255,c[e]=o[e]/255,u[e]=a[e]/255;t=l.join(","),r=c.join(","),n=u.join(","),i=`${t}${r}${n}`}if(s=this.#Ue.get(i),s)return this.#Ue.set(e,s),s;const o=`g_${this.#fe}_transfer_map_${this.#He++}`,a=`url(#${o})`;this.#Ue.set(e,a),this.#Ue.set(i,a);const l=this.#We(o);return this.#Ve(t,r,n,l),a}addHCMFilter(e,t){const r=`${e}-${t}`,n="base";let s=this.#ze.get(n);if(s?.key===r)return s.url;if(s?(s.filter?.remove(),s.key=r,s.url="none",s.filter=null):(s={key:r,url:"none",filter:null},this.#ze.set(n,s)),!e||!t)return s.url;const o=this.#qe(e);e=i.Util.makeHexColor(...o);const a=this.#qe(t);if(t=i.Util.makeHexColor(...a),this.#Ge.style.color="","#000000"===e&&"#ffffff"===t||e===t)return s.url;const l=new Array(256);for(let e=0;e<=255;e++){const t=e/255;l[e]=t<=.03928?t/12.92:((t+.055)/1.055)**2.4}const c=l.join(","),u=`g_${this.#fe}_hcm_filter`,d=s.filter=this.#We(u);this.#Ve(c,c,c,d),this.#$e(d);const h=(e,t)=>{const r=o[e]/255,n=a[e]/255,i=new Array(t+1);for(let e=0;e<=t;e++)i[e]=r+e/t*(n-r);return i.join(",")};return this.#Ve(h(0,5),h(1,5),h(2,5),d),s.url=`url(#${u})`,s.url}addHighlightHCMFilter(e,t,r,n,i){const s=`${t}-${r}-${n}-${i}`;let o=this.#ze.get(e);if(o?.key===s)return o.url;if(o?(o.filter?.remove(),o.key=s,o.url="none",o.filter=null):(o={key:s,url:"none",filter:null},this.#ze.set(e,o)),!t||!r)return o.url;const[a,l]=[t,r].map(this.#qe.bind(this));let c=Math.round(.2126*a[0]+.7152*a[1]+.0722*a[2]),u=Math.round(.2126*l[0]+.7152*l[1]+.0722*l[2]),[d,h]=[n,i].map(this.#qe.bind(this));u<c&&([c,u,d,h]=[u,c,h,d]),this.#Ge.style.color="";const p=(e,t,r)=>{const n=new Array(256),i=(u-c)/r,s=e/255,o=(t-e)/(255*r);let a=0;for(let e=0;e<=r;e++){const t=Math.round(c+e*i),r=s+e*o;for(let e=a;e<=t;e++)n[e]=r;a=t+1}for(let e=a;e<256;e++)n[e]=n[a-1];return n.join(",")},m=`g_${this.#fe}_hcm_${e}_filter`,f=o.filter=this.#We(m);return this.#$e(f),this.#Ve(p(d[0],h[0],5),p(d[1],h[1],5),p(d[2],h[2],5),f),o.url=`url(#${m})`,o.url}destroy(e=!1){e&&0!==this.#ze.size||(this.#Ie&&(this.#Ie.parentNode.parentNode.remove(),this.#Ie=null),this.#Fe&&(this.#Fe.clear(),this.#Fe=null),this.#He=0)}#$e(e){const t=this.#Be.createElementNS(s,"feColorMatrix");t.setAttribute("type","matrix"),t.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),e.append(t)}#We(e){const t=this.#Be.createElementNS(s,"filter");return t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("id",e),this.#Ge.append(t),t}#Ze(e,t,r){const n=this.#Be.createElementNS(s,t);n.setAttribute("type","discrete"),n.setAttribute("tableValues",r),e.append(n)}#Ve(e,t,r,n){const i=this.#Be.createElementNS(s,"feComponentTransfer");n.append(i),this.#Ze(i,"feFuncR",e),this.#Ze(i,"feFuncG",t),this.#Ze(i,"feFuncB",r)}#qe(e){return this.#Ge.style.color=e,f(getComputedStyle(this.#Ge).getPropertyValue("color"))}}class DOMCanvasFactory extends n.BaseCanvasFactory{constructor({ownerDocument:e=globalThis.document}={}){super(),this._document=e}_createCanvas(e,t){const r=this._document.createElement("canvas");return r.width=e,r.height=t,r}}async function o(e,t="text"){if(d(e,document.baseURI)){const r=await fetch(e);if(!r.ok)throw new Error(r.statusText);switch(t){case"arraybuffer":return r.arrayBuffer();case"blob":return r.blob();case"json":return r.json()}return r.text()}return new Promise(((r,n)=>{const i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType=t,i.onreadystatechange=()=>{if(i.readyState===XMLHttpRequest.DONE)if(200!==i.status&&0!==i.status)n(new Error(i.statusText));else{switch(t){case"arraybuffer":case"blob":case"json":return void r(i.response)}r(i.responseText)}},i.send(null)}))}class DOMCMapReaderFactory extends n.BaseCMapReaderFactory{_fetchData(e,t){return o(e,this.isCompressed?"arraybuffer":"text").then((e=>({cMapData:e instanceof ArrayBuffer?new Uint8Array(e):(0,i.stringToBytes)(e),compressionType:t})))}}class DOMStandardFontDataFactory extends n.BaseStandardFontDataFactory{_fetchData(e){return o(e,"arraybuffer").then((e=>new Uint8Array(e)))}}class DOMSVGFactory extends n.BaseSVGFactory{_createSVG(e){return document.createElementNS(s,e)}}class PageViewport{constructor({viewBox:e,scale:t,rotation:r,offsetX:n=0,offsetY:i=0,dontFlip:s=!1}){this.viewBox=e,this.scale=t,this.rotation=r,this.offsetX=n,this.offsetY=i;const o=(e[2]+e[0])/2,a=(e[3]+e[1])/2;let l,c,u,d,h,p,m,f;switch((r%=360)<0&&(r+=360),r){case 180:l=-1,c=0,u=0,d=1;break;case 90:l=0,c=1,u=1,d=0;break;case 270:l=0,c=-1,u=-1,d=0;break;case 0:l=1,c=0,u=0,d=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}s&&(u=-u,d=-d),0===l?(h=Math.abs(a-e[1])*t+n,p=Math.abs(o-e[0])*t+i,m=(e[3]-e[1])*t,f=(e[2]-e[0])*t):(h=Math.abs(o-e[0])*t+n,p=Math.abs(a-e[1])*t+i,m=(e[2]-e[0])*t,f=(e[3]-e[1])*t),this.transform=[l*t,c*t,u*t,d*t,h-l*t*o-u*t*a,p-c*t*o-d*t*a],this.width=m,this.height=f}get rawDims(){const{viewBox:e}=this;return(0,i.shadow)(this,"rawDims",{pageWidth:e[2]-e[0],pageHeight:e[3]-e[1],pageX:e[0],pageY:e[1]})}clone({scale:e=this.scale,rotation:t=this.rotation,offsetX:r=this.offsetX,offsetY:n=this.offsetY,dontFlip:i=!1}={}){return new PageViewport({viewBox:this.viewBox.slice(),scale:e,rotation:t,offsetX:r,offsetY:n,dontFlip:i})}convertToViewportPoint(e,t){return i.Util.applyTransform([e,t],this.transform)}convertToViewportRectangle(e){const t=i.Util.applyTransform([e[0],e[1]],this.transform),r=i.Util.applyTransform([e[2],e[3]],this.transform);return[t[0],t[1],r[0],r[1]]}convertToPdfPoint(e,t){return i.Util.applyInverseTransform([e,t],this.transform)}}class RenderingCancelledException extends i.BaseException{constructor(e,t=0){super(e,"RenderingCancelledException"),this.extraDelay=t}}function a(e){const t=e.length;let r=0;for(;r<t&&""===e[r].trim();)r++;return"data:"===e.substring(r,r+5).toLowerCase()}function l(e){return"string"==typeof e&&/\.pdf$/i.test(e)}function c(e,t=!1){return t||([e]=e.split(/[#?]/,1)),e.substring(e.lastIndexOf("/")+1)}function u(e,t="document.pdf"){if("string"!=typeof e)return t;if(a(e))return(0,i.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),t;const r=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,n=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(e);let s=r.exec(n[1])||r.exec(n[2])||r.exec(n[3]);if(s&&(s=s[0],s.includes("%")))try{s=r.exec(decodeURIComponent(s))[0]}catch{}return s||t}class StatTimer{started=Object.create(null);times=[];time(e){e in this.started&&(0,i.warn)(`Timer is already running for ${e}`),this.started[e]=Date.now()}timeEnd(e){e in this.started||(0,i.warn)(`Timer has not been started for ${e}`),this.times.push({name:e,start:this.started[e],end:Date.now()}),delete this.started[e]}toString(){const e=[];let t=0;for(const{name:e}of this.times)t=Math.max(e.length,t);for(const{name:r,start:n,end:i}of this.times)e.push(`${r.padEnd(t)} ${i-n}ms\n`);return e.join("")}}function d(e,t){try{const{protocol:r}=t?new URL(e,t):new URL(e);return"http:"===r||"https:"===r}catch{return!1}}function h(e){e.preventDefault()}let p;class PDFDateString{static toDateObject(e){if(!e||"string"!=typeof e)return null;p||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const t=p.exec(e);if(!t)return null;const r=parseInt(t[1],10);let n=parseInt(t[2],10);n=n>=1&&n<=12?n-1:0;let i=parseInt(t[3],10);i=i>=1&&i<=31?i:1;let s=parseInt(t[4],10);s=s>=0&&s<=23?s:0;let o=parseInt(t[5],10);o=o>=0&&o<=59?o:0;let a=parseInt(t[6],10);a=a>=0&&a<=59?a:0;const l=t[7]||"Z";let c=parseInt(t[8],10);c=c>=0&&c<=23?c:0;let u=parseInt(t[9],10)||0;return u=u>=0&&u<=59?u:0,"-"===l?(s+=c,o+=u):"+"===l&&(s-=c,o-=u),new Date(Date.UTC(r,n,i,s,o,a))}}function m(e,{scale:t=1,rotation:r=0}){const{width:n,height:i}=e.attributes.style,s=[0,0,parseInt(n),parseInt(i)];return new PageViewport({viewBox:s,scale:t,rotation:r})}function f(e){if(e.startsWith("#")){const t=parseInt(e.slice(1),16);return[(16711680&t)>>16,(65280&t)>>8,255&t]}return e.startsWith("rgb(")?e.slice(4,-1).split(",").map((e=>parseInt(e))):e.startsWith("rgba(")?e.slice(5,-1).split(",").map((e=>parseInt(e))).slice(0,3):((0,i.warn)(`Not a valid color format: "${e}"`),[0,0,0])}function g(e){const t=document.createElement("span");t.style.visibility="hidden",document.body.append(t);for(const r of e.keys()){t.style.color=r;const n=window.getComputedStyle(t).color;e.set(r,f(n))}t.remove()}function y(e){const{a:t,b:r,c:n,d:i,e:s,f:o}=e.getTransform();return[t,r,n,i,s,o]}function b(e){const{a:t,b:r,c:n,d:i,e:s,f:o}=e.getTransform().invertSelf();return[t,r,n,i,s,o]}function v(e,t,r=!1,n=!0){if(t instanceof PageViewport){const{pageWidth:n,pageHeight:s}=t.rawDims,{style:o}=e,a=i.FeatureTest.isCSSRoundSupported,l=`var(--scale-factor) * ${n}px`,c=`var(--scale-factor) * ${s}px`,u=a?`round(${l}, 1px)`:`calc(${l})`,d=a?`round(${c}, 1px)`:`calc(${c})`;r&&t.rotation%180!=0?(o.width=d,o.height=u):(o.width=u,o.height=d)}n&&e.setAttribute("data-main-rotation",t.rotation)}},47:(e,t,r)=>{r.d(t,{DrawLayer:()=>DrawLayer});var n=r(419),i=r(292);class DrawLayer{#V=null;#He=0;#Ke=new Map;#Xe=new Map;constructor({pageIndex:e}){this.pageIndex=e}setParent(e){if(this.#V){if(this.#V!==e){if(this.#Ke.size>0)for(const t of this.#Ke.values())t.remove(),e.append(t);this.#V=e}}else this.#V=e}static get _svgFactory(){return(0,i.shadow)(this,"_svgFactory",new n.DOMSVGFactory)}static#Ye(e,{x:t=0,y:r=0,width:n=1,height:i=1}={}){const{style:s}=e;s.top=100*r+"%",s.left=100*t+"%",s.width=100*n+"%",s.height=100*i+"%"}#Je(e){const t=DrawLayer._svgFactory.create(1,1,!0);return this.#V.append(t),t.setAttribute("aria-hidden",!0),DrawLayer.#Ye(t,e),t}#Qe(e,t){const r=DrawLayer._svgFactory.createElement("clipPath");e.append(r);const n=`clip_${t}`;r.setAttribute("id",n),r.setAttribute("clipPathUnits","objectBoundingBox");const i=DrawLayer._svgFactory.createElement("use");return r.append(i),i.setAttribute("href",`#${t}`),i.classList.add("clip"),n}highlight(e,t,r,n=!1){const i=this.#He++,s=this.#Je(e.box);s.classList.add("highlight"),e.free&&s.classList.add("free");const o=DrawLayer._svgFactory.createElement("defs");s.append(o);const a=DrawLayer._svgFactory.createElement("path");o.append(a);const l=`path_p${this.pageIndex}_${i}`;a.setAttribute("id",l),a.setAttribute("d",e.toSVGPath()),n&&this.#Xe.set(i,a);const c=this.#Qe(o,l),u=DrawLayer._svgFactory.createElement("use");return s.append(u),s.setAttribute("fill",t),s.setAttribute("fill-opacity",r),u.setAttribute("href",`#${l}`),this.#Ke.set(i,s),{id:i,clipPathId:`url(#${c})`}}highlightOutline(e){const t=this.#He++,r=this.#Je(e.box);r.classList.add("highlightOutline");const n=DrawLayer._svgFactory.createElement("defs");r.append(n);const i=DrawLayer._svgFactory.createElement("path");n.append(i);const s=`path_p${this.pageIndex}_${t}`;let o;if(i.setAttribute("id",s),i.setAttribute("d",e.toSVGPath()),i.setAttribute("vector-effect","non-scaling-stroke"),e.free){r.classList.add("free");const e=DrawLayer._svgFactory.createElement("mask");n.append(e),o=`mask_p${this.pageIndex}_${t}`,e.setAttribute("id",o),e.setAttribute("maskUnits","objectBoundingBox");const i=DrawLayer._svgFactory.createElement("rect");e.append(i),i.setAttribute("width","1"),i.setAttribute("height","1"),i.setAttribute("fill","white");const a=DrawLayer._svgFactory.createElement("use");e.append(a),a.setAttribute("href",`#${s}`),a.setAttribute("stroke","none"),a.setAttribute("fill","black"),a.setAttribute("fill-rule","nonzero"),a.classList.add("mask")}const a=DrawLayer._svgFactory.createElement("use");r.append(a),a.setAttribute("href",`#${s}`),o&&a.setAttribute("mask",`url(#${o})`);const l=a.cloneNode();return r.append(l),a.classList.add("mainOutline"),l.classList.add("secondaryOutline"),this.#Ke.set(t,r),t}finalizeLine(e,t){const r=this.#Xe.get(e);this.#Xe.delete(e),this.updateBox(e,t.box),r.setAttribute("d",t.toSVGPath())}updateLine(e,t){this.#Ke.get(e).firstChild.firstChild.setAttribute("d",t.toSVGPath())}removeFreeHighlight(e){this.remove(e),this.#Xe.delete(e)}updatePath(e,t){this.#Xe.get(e).setAttribute("d",t.toSVGPath())}updateBox(e,t){DrawLayer.#Ye(this.#Ke.get(e),t)}show(e,t){this.#Ke.get(e).classList.toggle("hidden",!t)}rotate(e,t){this.#Ke.get(e).setAttribute("data-main-rotation",t)}changeColor(e,t){this.#Ke.get(e).setAttribute("fill",t)}changeOpacity(e,t){this.#Ke.get(e).setAttribute("fill-opacity",t)}addClass(e,t){this.#Ke.get(e).classList.add(t)}removeClass(e,t){this.#Ke.get(e).classList.remove(t)}remove(e){null!==this.#V&&(this.#Ke.get(e).remove(),this.#Ke.delete(e))}destroy(){this.#V=null;for(const e of this.#Ke.values())e.remove();this.#Ke.clear()}}},731:(e,t,r)=>{r.d(t,{AnnotationEditorLayer:()=>AnnotationEditorLayer});var n=r(292),i=r(310),s=r(830),o=r(976);const a=/\r\n?|\n/g;class FreeTextEditor extends i.AnnotationEditor{#et=this.editorDivBlur.bind(this);#tt=this.editorDivFocus.bind(this);#rt=this.editorDivInput.bind(this);#nt=this.editorDivKeydown.bind(this);#it=this.editorDivPaste.bind(this);#H;#st="";#ot=`${this.id}-editor`;#at;#lt=null;static _freeTextDefaultContent="";static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){const e=FreeTextEditor.prototype,t=e=>e.isEmpty(),r=s.AnnotationEditorUIManager.TRANSLATE_SMALL,i=s.AnnotationEditorUIManager.TRANSLATE_BIG;return(0,n.shadow)(this,"_keyboardManager",new s.KeyboardManager([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],e.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],e.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],e._translateEmpty,{args:[-r,0],checker:t}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e._translateEmpty,{args:[-i,0],checker:t}],[["ArrowRight","mac+ArrowRight"],e._translateEmpty,{args:[r,0],checker:t}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e._translateEmpty,{args:[i,0],checker:t}],[["ArrowUp","mac+ArrowUp"],e._translateEmpty,{args:[0,-r],checker:t}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e._translateEmpty,{args:[0,-i],checker:t}],[["ArrowDown","mac+ArrowDown"],e._translateEmpty,{args:[0,r],checker:t}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e._translateEmpty,{args:[0,i],checker:t}]]))}static _type="freetext";static _editorType=n.AnnotationEditorType.FREETEXT;constructor(e){super({...e,name:"freeTextEditor"}),this.#H=e.color||FreeTextEditor._defaultColor||i.AnnotationEditor._defaultLineColor,this.#at=e.fontSize||FreeTextEditor._defaultFontSize}static initialize(e,t){i.AnnotationEditor.initialize(e,t,{strings:["pdfjs-free-text-default-content"]});const r=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(r.getPropertyValue("--freetext-padding"))}static updateDefaultParams(e,t){switch(e){case n.AnnotationEditorParamsType.FREETEXT_SIZE:FreeTextEditor._defaultFontSize=t;break;case n.AnnotationEditorParamsType.FREETEXT_COLOR:FreeTextEditor._defaultColor=t}}updateParams(e,t){switch(e){case n.AnnotationEditorParamsType.FREETEXT_SIZE:this.#ct(t);break;case n.AnnotationEditorParamsType.FREETEXT_COLOR:this.#ut(t)}}static get defaultPropertiesToUpdate(){return[[n.AnnotationEditorParamsType.FREETEXT_SIZE,FreeTextEditor._defaultFontSize],[n.AnnotationEditorParamsType.FREETEXT_COLOR,FreeTextEditor._defaultColor||i.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[n.AnnotationEditorParamsType.FREETEXT_SIZE,this.#at],[n.AnnotationEditorParamsType.FREETEXT_COLOR,this.#H]]}#ct(e){const t=e=>{this.editorDiv.style.fontSize=`calc(${e}px * var(--scale-factor))`,this.translate(0,-(e-this.#at)*this.parentScale),this.#at=e,this.#dt()},r=this.#at;this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:n.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#ut(e){const t=e=>{this.#H=this.editorDiv.style.color=e},r=this.#H;this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:n.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(e,t){this._uiManager.translateSelectedEditors(e,t,!0)}getInitialTranslation(){const e=this.parentScale;return[-FreeTextEditor._internalPadding*e,-(FreeTextEditor._internalPadding+this.#at)*e]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(n.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.editorDiv.addEventListener("keydown",this.#nt),this.editorDiv.addEventListener("focus",this.#tt),this.editorDiv.addEventListener("blur",this.#et),this.editorDiv.addEventListener("input",this.#rt),this.editorDiv.addEventListener("paste",this.#it))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#ot),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",this.#nt),this.editorDiv.removeEventListener("focus",this.#tt),this.editorDiv.removeEventListener("blur",this.#et),this.editorDiv.removeEventListener("input",this.#rt),this.editorDiv.removeEventListener("paste",this.#it),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"))}focusin(e){this._focusEventsAllowed&&(super.focusin(e),e.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){this.width||(this.enableEditMode(),this.editorDiv.focus(),this._initialOptions?.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freetextEditing")),super.remove()}#ht(){const e=[];this.editorDiv.normalize();for(const t of this.editorDiv.childNodes)e.push(FreeTextEditor.#pt(t));return e.join("\n")}#dt(){const[e,t]=this.parentDimensions;let r;if(this.isAttachedToDOM)r=this.div.getBoundingClientRect();else{const{currentLayer:e,div:t}=this,n=t.style.display,i=t.classList.contains("hidden");t.classList.remove("hidden"),t.style.display="hidden",e.div.append(this.div),r=t.getBoundingClientRect(),t.remove(),t.style.display=n,t.classList.toggle("hidden",i)}this.rotation%180==this.parentRotation%180?(this.width=r.width/e,this.height=r.height/t):(this.width=r.height/e,this.height=r.width/t),this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const e=this.#st,t=this.#st=this.#ht().trimEnd();if(e===t)return;const r=e=>{this.#st=e,e?(this.#mt(),this._uiManager.rebuild(this),this.#dt()):this.remove()};this.addCommands({cmd:()=>{r(t)},undo:()=>{r(e)},mustExec:!1}),this.#dt()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(e){this.enterInEditMode()}keydown(e){e.target===this.div&&"Enter"===e.key&&(this.enterInEditMode(),e.preventDefault())}editorDivKeydown(e){FreeTextEditor._keyboardManager.exec(this,e)}editorDivFocus(e){this.isEditing=!0}editorDivBlur(e){this.isEditing=!1}editorDivInput(e){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let e,t;this.width&&(e=this.x,t=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#ot),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text"),this.enableEditing(),i.AnnotationEditor._l10nPromise.get("pdfjs-free-text-default-content").then((e=>this.editorDiv?.setAttribute("default-content",e))),this.editorDiv.contentEditable=!0;const{style:r}=this.editorDiv;if(r.fontSize=`calc(${this.#at}px * var(--scale-factor))`,r.color=this.#H,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,s.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){const[r,n]=this.parentDimensions;if(this.annotationElementId){const{position:i}=this.#lt;let[s,o]=this.getInitialTranslation();[s,o]=this.pageTranslationToScreen(s,o);const[a,l]=this.pageDimensions,[c,u]=this.pageTranslation;let d,h;switch(this.rotation){case 0:d=e+(i[0]-c)/a,h=t+this.height-(i[1]-u)/l;break;case 90:d=e+(i[0]-c)/a,h=t-(i[1]-u)/l,[s,o]=[o,-s];break;case 180:d=e-this.width+(i[0]-c)/a,h=t-(i[1]-u)/l,[s,o]=[-s,-o];break;case 270:d=e+(i[0]-c-this.height*l)/a,h=t+(i[1]-u-this.width*a)/l,[s,o]=[-o,s]}this.setAt(d*r,h*n,s,o)}else this.setAt(e*r,t*n,this.width*r,this.height*n);this.#mt(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}static#pt(e){return(e.nodeType===Node.TEXT_NODE?e.nodeValue:e.innerText).replaceAll(a,"")}editorDivPaste(e){const t=e.clipboardData||window.clipboardData,{types:r}=t;if(1===r.length&&"text/plain"===r[0])return;e.preventDefault();const n=FreeTextEditor.#ft(t.getData("text")||"").replaceAll(a,"\n");if(!n)return;const i=window.getSelection();if(!i.rangeCount)return;this.editorDiv.normalize(),i.deleteFromDocument();const s=i.getRangeAt(0);if(!n.includes("\n"))return s.insertNode(document.createTextNode(n)),this.editorDiv.normalize(),void i.collapseToStart();const{startContainer:o,startOffset:l}=s,c=[],u=[];if(o.nodeType===Node.TEXT_NODE){const e=o.parentElement;if(u.push(o.nodeValue.slice(l).replaceAll(a,"")),e!==this.editorDiv){let t=c;for(const r of this.editorDiv.childNodes)r!==e?t.push(FreeTextEditor.#pt(r)):t=u}c.push(o.nodeValue.slice(0,l).replaceAll(a,""))}else if(o===this.editorDiv){let e=c,t=0;for(const r of this.editorDiv.childNodes)t++===l&&(e=u),e.push(FreeTextEditor.#pt(r))}this.#st=`${c.join("\n")}${n}${u.join("\n")}`,this.#mt();const d=new Range;let h=c.reduce(((e,t)=>e+t.length),0);for(const{firstChild:e}of this.editorDiv.childNodes)if(e.nodeType===Node.TEXT_NODE){const t=e.nodeValue.length;if(h<=t){d.setStart(e,h),d.setEnd(e,h);break}h-=t}i.removeAllRanges(),i.addRange(d)}#mt(){if(this.editorDiv.replaceChildren(),this.#st)for(const e of this.#st.split("\n")){const t=document.createElement("div");t.append(e?document.createTextNode(e):document.createElement("br")),this.editorDiv.append(t)}}#gt(){return this.#st.replaceAll(" "," ")}static#ft(e){return e.replaceAll(" "," ")}get contentDiv(){return this.editorDiv}static deserialize(e,t,r){let i=null;if(e instanceof o.FreeTextAnnotationElement){const{data:{defaultAppearanceData:{fontSize:t,fontColor:r},rect:s,rotation:o,id:a},textContent:l,textPosition:c,parent:{page:{pageNumber:u}}}=e;if(!l||0===l.length)return null;i=e={annotationType:n.AnnotationEditorType.FREETEXT,color:Array.from(r),fontSize:t,value:l.join("\n"),position:c,pageIndex:u-1,rect:s.slice(0),rotation:o,id:a,deleted:!1}}const s=super.deserialize(e,t,r);return s.#at=e.fontSize,s.#H=n.Util.makeHexColor(...e.color),s.#st=FreeTextEditor.#ft(e.value),s.annotationElementId=e.id||null,s.#lt=i,s}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0};const t=FreeTextEditor._internalPadding*this.parentScale,r=this.getRect(t,t),s=i.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.#H),o={annotationType:n.AnnotationEditorType.FREETEXT,color:s,fontSize:this.#at,value:this.#gt(),pageIndex:this.pageIndex,rect:r,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return e?o:this.annotationElementId&&!this.#yt(o)?null:(o.id=this.annotationElementId,o)}#yt(e){const{value:t,fontSize:r,color:n,pageIndex:i}=this.#lt;return this._hasBeenMoved||e.value!==t||e.fontSize!==r||e.color.some(((e,t)=>e!==n[t]))||e.pageIndex!==i}renderAnnotationElement(e){const t=super.renderAnnotationElement(e);if(this.deleted)return t;const{style:r}=t;r.fontSize=`calc(${this.#at}px * var(--scale-factor))`,r.color=this.#H,t.replaceChildren();for(const e of this.#st.split("\n")){const r=document.createElement("div");r.append(e?document.createTextNode(e):document.createElement("br")),t.append(r)}const n=FreeTextEditor._internalPadding*this.parentScale;return e.updateEdited({rect:this.getRect(n,n)}),t}resetAnnotationElement(e){super.resetAnnotationElement(e),e.resetEdited()}}var l=r(61),c=r(259),u=r(419);class HighlightEditor extends i.AnnotationEditor{#bt=null;#vt=0;#_t;#xt=null;#wt=null;#St=null;#Pt=null;#Et=0;#Mt=null;#Ct=null;#He=null;#At=!1;#Tt=this.#Dt.bind(this);#Ot=null;#Rt;#Lt=null;#kt="";#Nt;#Ft="";static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=12;static _l10nPromise;static _type="highlight";static _editorType=n.AnnotationEditorType.HIGHLIGHT;static _freeHighlightId=-1;static _freeHighlight=null;static _freeHighlightClipId="";static get _keyboardManager(){const e=HighlightEditor.prototype;return(0,n.shadow)(this,"_keyboardManager",new s.KeyboardManager([[["ArrowLeft","mac+ArrowLeft"],e._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],e._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],e._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],e._moveCaret,{args:[3]}]]))}constructor(e){super({...e,name:"highlightEditor"}),this.color=e.color||HighlightEditor._defaultColor,this.#Nt=e.thickness||HighlightEditor._defaultThickness,this.#Rt=e.opacity||HighlightEditor._defaultOpacity,this.#_t=e.boxes||null,this.#Ft=e.methodOfCreation||"",this.#kt=e.text||"",this._isDraggable=!1,e.highlightId>-1?(this.#At=!0,this.#It(e),this.#Bt()):(this.#bt=e.anchorNode,this.#vt=e.anchorOffset,this.#Pt=e.focusNode,this.#Et=e.focusOffset,this.#jt(),this.#Bt(),this.rotate(this.rotation))}get telemetryInitialData(){return{action:"added",type:this.#At?"free_highlight":"highlight",color:this._uiManager.highlightColorNames.get(this.color),thickness:this.#Nt,methodOfCreation:this.#Ft}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.highlightColorNames.get(this.color)}}static computeTelemetryFinalData(e){return{numberOfColors:e.get("color").size}}#jt(){const e=new l.Outliner(this.#_t,.001);this.#Ct=e.getOutlines(),({x:this.x,y:this.y,width:this.width,height:this.height}=this.#Ct.box);const t=new l.Outliner(this.#_t,.0025,.001,"ltr"===this._uiManager.direction);this.#St=t.getOutlines();const{lastPoint:r}=this.#St.box;this.#Ot=[(r[0]-this.x)/this.width,(r[1]-this.y)/this.height]}#It({highlightOutlines:e,highlightId:t,clipPathId:r}){this.#Ct=e;if(this.#St=e.getNewOutline(this.#Nt/2+1.5,.0025),t>=0)this.#He=t,this.#xt=r,this.parent.drawLayer.finalizeLine(t,e),this.#Lt=this.parent.drawLayer.highlightOutline(this.#St);else if(this.parent){const t=this.parent.viewport.rotation;this.parent.drawLayer.updateLine(this.#He,e),this.parent.drawLayer.updateBox(this.#He,HighlightEditor.#Ht(this.#Ct.box,(t-this.rotation+360)%360)),this.parent.drawLayer.updateLine(this.#Lt,this.#St),this.parent.drawLayer.updateBox(this.#Lt,HighlightEditor.#Ht(this.#St.box,t))}const{x:n,y:i,width:s,height:o}=e.box;switch(this.rotation){case 0:this.x=n,this.y=i,this.width=s,this.height=o;break;case 90:{const[e,t]=this.parentDimensions;this.x=i,this.y=1-n,this.width=s*t/e,this.height=o*e/t;break}case 180:this.x=1-n,this.y=1-i,this.width=s,this.height=o;break;case 270:{const[e,t]=this.parentDimensions;this.x=1-i,this.y=n,this.width=s*t/e,this.height=o*e/t;break}}const{lastPoint:a}=this.#St.box;this.#Ot=[(a[0]-n)/s,(a[1]-i)/o]}static initialize(e,t){i.AnnotationEditor.initialize(e,t),HighlightEditor._defaultColor||=t.highlightColors?.values().next().value||"#fff066"}static updateDefaultParams(e,t){switch(e){case n.AnnotationEditorParamsType.HIGHLIGHT_DEFAULT_COLOR:HighlightEditor._defaultColor=t;break;case n.AnnotationEditorParamsType.HIGHLIGHT_THICKNESS:HighlightEditor._defaultThickness=t}}translateInPage(e,t){}get toolbarPosition(){return this.#Ot}updateParams(e,t){switch(e){case n.AnnotationEditorParamsType.HIGHLIGHT_COLOR:this.#ut(t);break;case n.AnnotationEditorParamsType.HIGHLIGHT_THICKNESS:this.#Ut(t)}}static get defaultPropertiesToUpdate(){return[[n.AnnotationEditorParamsType.HIGHLIGHT_DEFAULT_COLOR,HighlightEditor._defaultColor],[n.AnnotationEditorParamsType.HIGHLIGHT_THICKNESS,HighlightEditor._defaultThickness]]}get propertiesToUpdate(){return[[n.AnnotationEditorParamsType.HIGHLIGHT_COLOR,this.color||HighlightEditor._defaultColor],[n.AnnotationEditorParamsType.HIGHLIGHT_THICKNESS,this.#Nt||HighlightEditor._defaultThickness],[n.AnnotationEditorParamsType.HIGHLIGHT_FREE,this.#At]]}#ut(e){const t=e=>{this.color=e,this.parent?.drawLayer.changeColor(this.#He,e),this.#wt?.updateColor(e)},r=this.color;this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:n.AnnotationEditorParamsType.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.highlightColorNames.get(e)},!0)}#Ut(e){const t=this.#Nt,r=e=>{this.#Nt=e,this.#zt(e)};this.addCommands({cmd:r.bind(this,e),undo:r.bind(this,t),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:n.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:e},!0)}async addEditToolbar(){const e=await super.addEditToolbar();return e?(this._uiManager.highlightColors&&(this.#wt=new c.ColorPicker({editor:this}),e.addColorPicker(this.#wt)),e):null}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(this.#Gt())}getBaseTranslation(){return[0,0]}getRect(e,t){return super.getRect(e,t,this.#Gt())}onceAdded(){this.parent.addUndoableEditor(this),this.div.focus()}remove(){this.#Wt(),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.#Bt(),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){let t=!1;this.parent&&!e?this.#Wt():e&&(this.#Bt(e),t=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(e),this.show(this._isVisible),t&&this.select()}#zt(e){if(!this.#At)return;this.#It({highlightOutlines:this.#Ct.getNewOutline(e/2)}),this.fixAndSetPosition();const[t,r]=this.parentDimensions;this.setDims(this.width*t,this.height*r)}#Wt(){null!==this.#He&&this.parent&&(this.parent.drawLayer.remove(this.#He),this.#He=null,this.parent.drawLayer.remove(this.#Lt),this.#Lt=null)}#Bt(e=this.parent){null===this.#He&&(({id:this.#He,clipPathId:this.#xt}=e.drawLayer.highlight(this.#Ct,this.color,this.#Rt)),this.#Lt=e.drawLayer.highlightOutline(this.#St),this.#Mt&&(this.#Mt.style.clipPath=this.#xt))}static#Ht({x:e,y:t,width:r,height:n},i){switch(i){case 90:return{x:1-t-n,y:e,width:n,height:r};case 180:return{x:1-e-r,y:1-t-n,width:r,height:n};case 270:return{x:t,y:1-e-r,width:n,height:r}}return{x:e,y:t,width:r,height:n}}rotate(e){const{drawLayer:t}=this.parent;let r;this.#At?(e=(e-this.rotation+360)%360,r=HighlightEditor.#Ht(this.#Ct.box,e)):r=HighlightEditor.#Ht(this,e),t.rotate(this.#He,e),t.rotate(this.#Lt,e),t.updateBox(this.#He,r),t.updateBox(this.#Lt,HighlightEditor.#Ht(this.#St.box,e))}render(){if(this.div)return this.div;const e=super.render();this.#kt&&(e.setAttribute("aria-label",this.#kt),e.setAttribute("role","mark")),this.#At?e.classList.add("free"):this.div.addEventListener("keydown",this.#Tt);const t=this.#Mt=document.createElement("div");e.append(t),t.setAttribute("aria-hidden","true"),t.className="internal",t.style.clipPath=this.#xt;const[r,n]=this.parentDimensions;return this.setDims(this.width*r,this.height*n),(0,s.bindEvents)(this,this.#Mt,["pointerover","pointerleave"]),this.enableEditing(),e}pointerover(){this.parent.drawLayer.addClass(this.#Lt,"hovered")}pointerleave(){this.parent.drawLayer.removeClass(this.#Lt,"hovered")}#Dt(e){HighlightEditor._keyboardManager.exec(this,e)}_moveCaret(e){switch(this.parent.unselect(this),e){case 0:case 2:this.#Vt(!0);break;case 1:case 3:this.#Vt(!1)}}#Vt(e){if(!this.#bt)return;const t=window.getSelection();e?t.setPosition(this.#bt,this.#vt):t.setPosition(this.#Pt,this.#Et)}select(){super.select(),this.#Lt&&(this.parent?.drawLayer.removeClass(this.#Lt,"hovered"),this.parent?.drawLayer.addClass(this.#Lt,"selected"))}unselect(){super.unselect(),this.#Lt&&(this.parent?.drawLayer.removeClass(this.#Lt,"selected"),this.#At||this.#Vt(!1))}get _mustFixPosition(){return!this.#At}show(e=this._isVisible){super.show(e),this.parent&&(this.parent.drawLayer.show(this.#He,e),this.parent.drawLayer.show(this.#Lt,e))}#Gt(){return this.#At?this.rotation:0}#qt(){if(this.#At)return null;const[e,t]=this.pageDimensions,r=this.#_t,n=new Array(8*r.length);let i=0;for(const{x:s,y:o,width:a,height:l}of r){const r=s*e,c=(1-o-l)*t;n[i]=n[i+4]=r,n[i+1]=n[i+3]=c,n[i+2]=n[i+6]=r+a*e,n[i+5]=n[i+7]=c+l*t,i+=8}return n}#$t(e){return this.#Ct.serialize(e,this.#Gt())}static startHighlighting(e,t,{target:r,x:n,y:i}){const{x:s,y:o,width:a,height:c}=r.getBoundingClientRect(),d=t=>{this.#Zt(e,t)},h={capture:!0,passive:!1},p=e=>{e.preventDefault(),e.stopPropagation()},m=t=>{r.removeEventListener("pointermove",d),window.removeEventListener("blur",m),window.removeEventListener("pointerup",m),window.removeEventListener("pointerdown",p,h),window.removeEventListener("contextmenu",u.noContextMenu),this.#Kt(e,t)};window.addEventListener("blur",m),window.addEventListener("pointerup",m),window.addEventListener("pointerdown",p,h),window.addEventListener("contextmenu",u.noContextMenu),r.addEventListener("pointermove",d),this._freeHighlight=new l.FreeOutliner({x:n,y:i},[s,o,a,c],e.scale,this._defaultThickness/2,t,.001),({id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=e.drawLayer.highlight(this._freeHighlight,this._defaultColor,this._defaultOpacity,!0))}static#Zt(e,t){this._freeHighlight.add(t)&&e.drawLayer.updatePath(this._freeHighlightId,this._freeHighlight)}static#Kt(e,t){this._freeHighlight.isEmpty()?e.drawLayer.removeFreeHighlight(this._freeHighlightId):e.createAndAddNewEditor(t,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""}static deserialize(e,t,r){const i=super.deserialize(e,t,r),{rect:[s,o,a,l],color:c,quadPoints:u}=e;i.color=n.Util.makeHexColor(...c),i.#Rt=e.opacity;const[d,h]=i.pageDimensions;i.width=(a-s)/d,i.height=(l-o)/h;const p=i.#_t=[];for(let e=0;e<u.length;e+=8)p.push({x:(u[4]-a)/d,y:(l-(1-u[e+5]))/h,width:(u[e+2]-u[e])/d,height:(u[e+5]-u[e+1])/h});return i.#jt(),i}serialize(e=!1){if(this.isEmpty()||e)return null;const t=this.getRect(0,0),r=i.AnnotationEditor._colorManager.convert(this.color);return{annotationType:n.AnnotationEditorType.HIGHLIGHT,color:r,opacity:this.#Rt,thickness:this.#Nt,quadPoints:this.#qt(),outlines:this.#$t(t),pageIndex:this.pageIndex,rect:t,rotation:this.#Gt(),structTreeParentId:this._structTreeParentId}}static canCreateNewEmptyEditor(){return!1}}class InkEditor extends i.AnnotationEditor{#Xt=0;#Yt=0;#Jt=this.canvasPointermove.bind(this);#Qt=this.canvasPointerleave.bind(this);#er=this.canvasPointerup.bind(this);#tr=this.canvasPointerdown.bind(this);#rr=null;#nr=new Path2D;#ir=!1;#sr=!1;#or=!1;#ar=null;#lr=0;#cr=0;#ur=null;static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=1;static _type="ink";static _editorType=n.AnnotationEditorType.INK;constructor(e){super({...e,name:"inkEditor"}),this.color=e.color||null,this.thickness=e.thickness||null,this.opacity=e.opacity||null,this.paths=[],this.bezierPath2D=[],this.allRawPaths=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0,this._willKeepAspectRatio=!0}static initialize(e,t){i.AnnotationEditor.initialize(e,t)}static updateDefaultParams(e,t){switch(e){case n.AnnotationEditorParamsType.INK_THICKNESS:InkEditor._defaultThickness=t;break;case n.AnnotationEditorParamsType.INK_COLOR:InkEditor._defaultColor=t;break;case n.AnnotationEditorParamsType.INK_OPACITY:InkEditor._defaultOpacity=t/100}}updateParams(e,t){switch(e){case n.AnnotationEditorParamsType.INK_THICKNESS:this.#Ut(t);break;case n.AnnotationEditorParamsType.INK_COLOR:this.#ut(t);break;case n.AnnotationEditorParamsType.INK_OPACITY:this.#dr(t)}}static get defaultPropertiesToUpdate(){return[[n.AnnotationEditorParamsType.INK_THICKNESS,InkEditor._defaultThickness],[n.AnnotationEditorParamsType.INK_COLOR,InkEditor._defaultColor||i.AnnotationEditor._defaultLineColor],[n.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*InkEditor._defaultOpacity)]]}get propertiesToUpdate(){return[[n.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||InkEditor._defaultThickness],[n.AnnotationEditorParamsType.INK_COLOR,this.color||InkEditor._defaultColor||i.AnnotationEditor._defaultLineColor],[n.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(this.opacity??InkEditor._defaultOpacity))]]}#Ut(e){const t=e=>{this.thickness=e,this.#hr()},r=this.thickness;this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:n.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}#ut(e){const t=e=>{this.color=e,this.#pr()},r=this.color;this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:n.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}#dr(e){const t=e=>{this.opacity=e,this.#pr()};e/=100;const r=this.opacity;this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:n.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.canvas||(this.#mr(),this.#fr()),this.isAttachedToDOM||(this.parent.add(this),this.#gr()),this.#hr()))}remove(){null!==this.canvas&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,this.#rr&&(clearTimeout(this.#rr),this.#rr=null),this.#ar.disconnect(),this.#ar=null,super.remove())}setParent(e){!this.parent&&e?this._uiManager.removeShouldRescale(this):this.parent&&null===e&&this._uiManager.addShouldRescale(this),super.setParent(e)}onScaleChanging(){const[e,t]=this.parentDimensions,r=this.width*e,n=this.height*t;this.setDimensions(r,n)}enableEditMode(){this.#ir||null===this.canvas||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",this.#tr))}disableEditMode(){this.isInEditMode()&&null!==this.canvas&&(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",this.#tr))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}#yr(){const{parentRotation:e,parentDimensions:[t,r]}=this;switch(e){case 90:return[0,r,r,t];case 180:return[t,r,t,r];case 270:return[t,0,r,t];default:return[0,0,t,r]}}#br(){const{ctx:e,color:t,opacity:r,thickness:n,parentScale:i,scaleFactor:o}=this;e.lineWidth=n*i/o,e.lineCap="round",e.lineJoin="round",e.miterLimit=10,e.strokeStyle=`${t}${(0,s.opacityToHex)(r)}`}#vr(e,t){this.canvas.addEventListener("contextmenu",u.noContextMenu),this.canvas.addEventListener("pointerleave",this.#Qt),this.canvas.addEventListener("pointermove",this.#Jt),this.canvas.addEventListener("pointerup",this.#er),this.canvas.removeEventListener("pointerdown",this.#tr),this.isEditing=!0,this.#or||(this.#or=!0,this.#gr(),this.thickness||=InkEditor._defaultThickness,this.color||=InkEditor._defaultColor||i.AnnotationEditor._defaultLineColor,this.opacity??=InkEditor._defaultOpacity),this.currentPath.push([e,t]),this.#sr=!1,this.#br(),this.#ur=()=>{this.#_r(),this.#ur&&window.requestAnimationFrame(this.#ur)},window.requestAnimationFrame(this.#ur)}#xr(e,t){const[r,n]=this.currentPath.at(-1);if(this.currentPath.length>1&&e===r&&t===n)return;const i=this.currentPath;let s=this.#nr;if(i.push([e,t]),this.#sr=!0,i.length<=2)return s.moveTo(...i[0]),void s.lineTo(e,t);3===i.length&&(this.#nr=s=new Path2D,s.moveTo(...i[0])),this.#wr(s,...i.at(-3),...i.at(-2),e,t)}#Sr(){if(0===this.currentPath.length)return;const e=this.currentPath.at(-1);this.#nr.lineTo(...e)}#Pr(e,t){let r;if(this.#ur=null,e=Math.min(Math.max(e,0),this.canvas.width),t=Math.min(Math.max(t,0),this.canvas.height),this.#xr(e,t),this.#Sr(),1!==this.currentPath.length)r=this.#Er();else{const n=[e,t];r=[[n,n.slice(),n.slice(),n]]}const n=this.#nr,i=this.currentPath;this.currentPath=[],this.#nr=new Path2D;this.addCommands({cmd:()=>{this.allRawPaths.push(i),this.paths.push(r),this.bezierPath2D.push(n),this._uiManager.rebuild(this)},undo:()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),0===this.paths.length?this.remove():(this.canvas||(this.#mr(),this.#fr()),this.#hr())},mustExec:!0})}#_r(){if(!this.#sr)return;this.#sr=!1;const e=Math.ceil(this.thickness*this.parentScale),t=this.currentPath.slice(-3),r=t.map((e=>e[0])),n=t.map((e=>e[1])),{ctx:i}=(Math.min(...r),Math.max(...r),Math.min(...n),Math.max(...n),this);i.save(),i.clearRect(0,0,this.canvas.width,this.canvas.height);for(const e of this.bezierPath2D)i.stroke(e);i.stroke(this.#nr),i.restore()}#wr(e,t,r,n,i,s,o){const a=(t+n)/2,l=(r+i)/2,c=(n+s)/2,u=(i+o)/2;e.bezierCurveTo(a+2*(n-a)/3,l+2*(i-l)/3,c+2*(n-c)/3,u+2*(i-u)/3,c,u)}#Er(){const e=this.currentPath;if(e.length<=2)return[[e[0],e[0],e.at(-1),e.at(-1)]];const t=[];let r,[n,i]=e[0];for(r=1;r<e.length-2;r++){const[s,o]=e[r],[a,l]=e[r+1],c=(s+a)/2,u=(o+l)/2,d=[n+2*(s-n)/3,i+2*(o-i)/3],h=[c+2*(s-c)/3,u+2*(o-u)/3];t.push([[n,i],d,h,[c,u]]),[n,i]=[c,u]}const[s,o]=e[r],[a,l]=e[r+1],c=[n+2*(s-n)/3,i+2*(o-i)/3],u=[a+2*(s-a)/3,l+2*(o-l)/3];return t.push([[n,i],c,u,[a,l]]),t}#pr(){if(this.isEmpty())return void this.#Mr();this.#br();const{canvas:e,ctx:t}=this;t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,e.width,e.height),this.#Mr();for(const e of this.bezierPath2D)t.stroke(e)}commit(){this.#ir||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),this.#ir=!0,this.div.classList.add("disabled"),this.#hr(!0),this.select(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(e){this._focusEventsAllowed&&(super.focusin(e),this.enableEditMode())}canvasPointerdown(e){0===e.button&&this.isInEditMode()&&!this.#ir&&(this.setInForeground(),e.preventDefault(),this.div.contains(document.activeElement)||this.div.focus({preventScroll:!0}),this.#vr(e.offsetX,e.offsetY))}canvasPointermove(e){e.preventDefault(),this.#xr(e.offsetX,e.offsetY)}canvasPointerup(e){e.preventDefault(),this.#Cr(e)}canvasPointerleave(e){this.#Cr(e)}#Cr(e){this.canvas.removeEventListener("pointerleave",this.#Qt),this.canvas.removeEventListener("pointermove",this.#Jt),this.canvas.removeEventListener("pointerup",this.#er),this.canvas.addEventListener("pointerdown",this.#tr),this.#rr&&clearTimeout(this.#rr),this.#rr=setTimeout((()=>{this.#rr=null,this.canvas.removeEventListener("contextmenu",u.noContextMenu)}),10),this.#Pr(e.offsetX,e.offsetY),this.addToAnnotationStorage(),this.setInBackground()}#mr(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",this.canvas.setAttribute("data-l10n-id","pdfjs-ink-canvas"),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")}#fr(){this.#ar=new ResizeObserver((e=>{const t=e[0].contentRect;t.width&&t.height&&this.setDimensions(t.width,t.height)})),this.#ar.observe(this.div)}get isResizable(){return!this.isEmpty()&&this.#ir}render(){if(this.div)return this.div;let e,t;this.width&&(e=this.x,t=this.y),super.render(),this.div.setAttribute("data-l10n-id","pdfjs-ink");const[r,n,i,s]=this.#yr();if(this.setAt(r,n,0,0),this.setDims(i,s),this.#mr(),this.width){const[r,n]=this.parentDimensions;this.setAspectRatio(this.width*r,this.height*n),this.setAt(e*r,t*n,this.width*r,this.height*n),this.#or=!0,this.#gr(),this.setDims(this.width*r,this.height*n),this.#pr(),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return this.#fr(),this.div}#gr(){if(!this.#or)return;const[e,t]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*e),this.canvas.height=Math.ceil(this.height*t),this.#Mr()}setDimensions(e,t){const r=Math.round(e),n=Math.round(t);if(this.#lr===r&&this.#cr===n)return;this.#lr=r,this.#cr=n,this.canvas.style.visibility="hidden";const[i,s]=this.parentDimensions;this.width=e/i,this.height=t/s,this.fixAndSetPosition(),this.#ir&&this.#Ar(e,t),this.#gr(),this.#pr(),this.canvas.style.visibility="visible",this.fixDims()}#Ar(e,t){const r=this.#Tr(),n=(e-r)/this.#Yt,i=(t-r)/this.#Xt;this.scaleFactor=Math.min(n,i)}#Mr(){const e=this.#Tr()/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+e,this.translationY*this.scaleFactor+e)}static#Dr(e){const t=new Path2D;for(let r=0,n=e.length;r<n;r++){const[n,i,s,o]=e[r];0===r&&t.moveTo(...n),t.bezierCurveTo(i[0],i[1],s[0],s[1],o[0],o[1])}return t}static#Or(e,t,r){const[n,i,s,o]=t;switch(r){case 0:for(let t=0,r=e.length;t<r;t+=2)e[t]+=n,e[t+1]=o-e[t+1];break;case 90:for(let t=0,r=e.length;t<r;t+=2){const r=e[t];e[t]=e[t+1]+n,e[t+1]=r+i}break;case 180:for(let t=0,r=e.length;t<r;t+=2)e[t]=s-e[t],e[t+1]+=i;break;case 270:for(let t=0,r=e.length;t<r;t+=2){const r=e[t];e[t]=s-e[t+1],e[t+1]=o-r}break;default:throw new Error("Invalid rotation")}return e}static#Rr(e,t,r){const[n,i,s,o]=t;switch(r){case 0:for(let t=0,r=e.length;t<r;t+=2)e[t]-=n,e[t+1]=o-e[t+1];break;case 90:for(let t=0,r=e.length;t<r;t+=2){const r=e[t];e[t]=e[t+1]-i,e[t+1]=r-n}break;case 180:for(let t=0,r=e.length;t<r;t+=2)e[t]=s-e[t],e[t+1]-=i;break;case 270:for(let t=0,r=e.length;t<r;t+=2){const r=e[t];e[t]=o-e[t+1],e[t+1]=s-r}break;default:throw new Error("Invalid rotation")}return e}#Lr(e,t,r,n){const i=[],s=this.thickness/2,o=e*t+s,a=e*r+s;for(const t of this.paths){const r=[],s=[];for(let n=0,i=t.length;n<i;n++){const[l,c,u,d]=t[n];if(l[0]===d[0]&&l[1]===d[1]&&1===i){const t=e*l[0]+o,n=e*l[1]+a;r.push(t,n),s.push(t,n);break}const h=e*l[0]+o,p=e*l[1]+a,m=e*c[0]+o,f=e*c[1]+a,g=e*u[0]+o,y=e*u[1]+a,b=e*d[0]+o,v=e*d[1]+a;0===n&&(r.push(h,p),s.push(h,p)),r.push(m,f,g,y,b,v),s.push(m,f),n===i-1&&s.push(b,v)}i.push({bezier:InkEditor.#Or(r,n,this.rotation),points:InkEditor.#Or(s,n,this.rotation)})}return i}#kr(){let e=1/0,t=-1/0,r=1/0,i=-1/0;for(const s of this.paths)for(const[o,a,l,c]of s){const s=n.Util.bezierBoundingBox(...o,...a,...l,...c);e=Math.min(e,s[0]),r=Math.min(r,s[1]),t=Math.max(t,s[2]),i=Math.max(i,s[3])}return[e,r,t,i]}#Tr(){return this.#ir?Math.ceil(this.thickness*this.parentScale):0}#hr(e=!1){if(this.isEmpty())return;if(!this.#ir)return void this.#pr();const t=this.#kr(),r=this.#Tr();this.#Yt=Math.max(i.AnnotationEditor.MIN_SIZE,t[2]-t[0]),this.#Xt=Math.max(i.AnnotationEditor.MIN_SIZE,t[3]-t[1]);const n=Math.ceil(r+this.#Yt*this.scaleFactor),s=Math.ceil(r+this.#Xt*this.scaleFactor),[o,a]=this.parentDimensions;this.width=n/o,this.height=s/a,this.setAspectRatio(n,s);const l=this.translationX,c=this.translationY;this.translationX=-t[0],this.translationY=-t[1],this.#gr(),this.#pr(),this.#lr=n,this.#cr=s,this.setDims(n,s);const u=e?r/this.scaleFactor/2:0;this.translate(l-this.translationX-u,c-this.translationY-u)}static deserialize(e,t,r){if(e instanceof o.InkAnnotationElement)return null;const s=super.deserialize(e,t,r);s.thickness=e.thickness,s.color=n.Util.makeHexColor(...e.color),s.opacity=e.opacity;const[a,l]=s.pageDimensions,c=s.width*a,u=s.height*l,d=s.parentScale,h=e.thickness/2;s.#ir=!0,s.#lr=Math.round(c),s.#cr=Math.round(u);const{paths:p,rect:m,rotation:f}=e;for(let{bezier:e}of p){e=InkEditor.#Rr(e,m,f);const t=[];s.paths.push(t);let r=d*(e[0]-h),n=d*(e[1]-h);for(let i=2,s=e.length;i<s;i+=6){const s=d*(e[i]-h),o=d*(e[i+1]-h),a=d*(e[i+2]-h),l=d*(e[i+3]-h),c=d*(e[i+4]-h),u=d*(e[i+5]-h);t.push([[r,n],[s,o],[a,l],[c,u]]),r=c,n=u}const i=this.#Dr(t);s.bezierPath2D.push(i)}const g=s.#kr();return s.#Yt=Math.max(i.AnnotationEditor.MIN_SIZE,g[2]-g[0]),s.#Xt=Math.max(i.AnnotationEditor.MIN_SIZE,g[3]-g[1]),s.#Ar(c,u),s}serialize(){if(this.isEmpty())return null;const e=this.getRect(0,0),t=i.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);return{annotationType:n.AnnotationEditorType.INK,color:t,thickness:this.thickness,opacity:this.opacity,paths:this.#Lr(this.scaleFactor/this.parentScale,this.translationX,this.translationY,e),pageIndex:this.pageIndex,rect:e,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}}class StampEditor extends i.AnnotationEditor{#Nr=null;#Fr=null;#Ir=null;#Br=null;#jr=null;#Hr="";#Ur=null;#ar=null;#zr=null;#Gr=!1;#Wr=!1;static _type="stamp";static _editorType=n.AnnotationEditorType.STAMP;constructor(e){super({...e,name:"stampEditor"}),this.#Br=e.bitmapUrl,this.#jr=e.bitmapFile}static initialize(e,t){i.AnnotationEditor.initialize(e,t)}static get supportedTypes(){return(0,n.shadow)(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map((e=>`image/${e}`)))}static get supportedTypesStr(){return(0,n.shadow)(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(e){return this.supportedTypes.includes(e)}static paste(e,t){t.pasteEditor(n.AnnotationEditorType.STAMP,{bitmapFile:e.getAsFile()})}#Vr(e,t=!1){e?(this.#Nr=e.bitmap,t||(this.#Fr=e.id,this.#Gr=e.isSvg),e.file&&(this.#Hr=e.file.name),this.#mr()):this.remove()}#qr(){this.#Ir=null,this._uiManager.enableWaiting(!1),this.#Ur&&this.div.focus()}#$r(){if(this.#Fr)return this._uiManager.enableWaiting(!0),void this._uiManager.imageManager.getFromId(this.#Fr).then((e=>this.#Vr(e,!0))).finally((()=>this.#qr()));if(this.#Br){const e=this.#Br;return this.#Br=null,this._uiManager.enableWaiting(!0),void(this.#Ir=this._uiManager.imageManager.getFromUrl(e).then((e=>this.#Vr(e))).finally((()=>this.#qr())))}if(this.#jr){const e=this.#jr;return this.#jr=null,this._uiManager.enableWaiting(!0),void(this.#Ir=this._uiManager.imageManager.getFromFile(e).then((e=>this.#Vr(e))).finally((()=>this.#qr())))}const e=document.createElement("input");e.type="file",e.accept=StampEditor.supportedTypesStr,this.#Ir=new Promise((t=>{e.addEventListener("change",(async()=>{if(e.files&&0!==e.files.length){this._uiManager.enableWaiting(!0);const t=await this._uiManager.imageManager.getFromFile(e.files[0]);this.#Vr(t)}else this.remove();t()})),e.addEventListener("cancel",(()=>{this.remove(),t()}))})).finally((()=>this.#qr())),e.click()}remove(){this.#Fr&&(this.#Nr=null,this._uiManager.imageManager.deleteId(this.#Fr),this.#Ur?.remove(),this.#Ur=null,this.#ar?.disconnect(),this.#ar=null,this.#zr&&(clearTimeout(this.#zr),this.#zr=null)),super.remove()}rebuild(){this.parent?(super.rebuild(),null!==this.div&&(this.#Fr&&null===this.#Ur&&this.#$r(),this.isAttachedToDOM||this.parent.add(this))):this.#Fr&&this.#$r()}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(this.#Ir||this.#Nr||this.#Br||this.#jr||this.#Fr)}get isResizable(){return!0}render(){if(this.div)return this.div;let e,t;if(this.width&&(e=this.x,t=this.y),super.render(),this.div.hidden=!0,this.addAltTextButton(),this.#Nr?this.#mr():this.#$r(),this.width){const[r,n]=this.parentDimensions;this.setAt(e*r,t*n,this.width*r,this.height*n)}return this.div}#mr(){const{div:e}=this;let{width:t,height:r}=this.#Nr;const[n,i]=this.pageDimensions,s=.75;if(this.width)t=this.width*n,r=this.height*i;else if(t>s*n||r>s*i){const e=Math.min(s*n/t,s*i/r);t*=e,r*=e}const[o,a]=this.parentDimensions;this.setDims(t*o/n,r*a/i),this._uiManager.enableWaiting(!1);const l=this.#Ur=document.createElement("canvas");e.append(l),e.hidden=!1,this.#Zr(t,r),this.#fr(),this.#Wr||(this.parent.addUndoableEditor(this),this.#Wr=!0),this._reportTelemetry({action:"inserted_image"}),this.#Hr&&l.setAttribute("aria-label",this.#Hr)}#Kr(e,t){const[r,n]=this.parentDimensions;this.width=e/r,this.height=t/n,this.setDims(e,t),this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,null!==this.#zr&&clearTimeout(this.#zr);this.#zr=setTimeout((()=>{this.#zr=null,this.#Zr(e,t)}),200)}#Xr(e,t){const{width:r,height:n}=this.#Nr;let i=r,s=n,o=this.#Nr;for(;i>2*e||s>2*t;){const r=i,n=s;i>2*e&&(i=i>=16384?Math.floor(i/2)-1:Math.ceil(i/2)),s>2*t&&(s=s>=16384?Math.floor(s/2)-1:Math.ceil(s/2));const a=new OffscreenCanvas(i,s);a.getContext("2d").drawImage(o,0,0,r,n,0,0,i,s),o=a.transferToImageBitmap()}return o}#Zr(e,t){e=Math.ceil(e),t=Math.ceil(t);const r=this.#Ur;if(!r||r.width===e&&r.height===t)return;r.width=e,r.height=t;const n=this.#Gr?this.#Nr:this.#Xr(e,t);if(this._uiManager.hasMLManager&&!this.hasAltText()){const r=new OffscreenCanvas(e,t);r.getContext("2d").drawImage(n,0,0,n.width,n.height,0,0,e,t),r.convertToBlob().then((e=>{const t=new FileReader;t.onload=()=>{const e=t.result;this._uiManager.mlGuess({service:"image-to-text",request:{imageData:e}}).then((e=>{const t=e?.output||"";this.parent&&t&&!this.hasAltText()&&(this.altTextData={altText:t,decorative:!1})}))},t.readAsDataURL(e)}))}const i=r.getContext("2d");i.filter=this._uiManager.hcmFilter,i.drawImage(n,0,0,n.width,n.height,0,0,e,t)}getImageForAltText(){return this.#Ur}#Yr(e){if(e){if(this.#Gr){const e=this._uiManager.imageManager.getSvgUrl(this.#Fr);if(e)return e}const e=document.createElement("canvas");({width:e.width,height:e.height}=this.#Nr);return e.getContext("2d").drawImage(this.#Nr,0,0),e.toDataURL()}if(this.#Gr){const[e,t]=this.pageDimensions,r=Math.round(this.width*e*u.PixelsPerInch.PDF_TO_CSS_UNITS),n=Math.round(this.height*t*u.PixelsPerInch.PDF_TO_CSS_UNITS),i=new OffscreenCanvas(r,n);return i.getContext("2d").drawImage(this.#Nr,0,0,this.#Nr.width,this.#Nr.height,0,0,r,n),i.transferToImageBitmap()}return structuredClone(this.#Nr)}#fr(){this.#ar=new ResizeObserver((e=>{const t=e[0].contentRect;t.width&&t.height&&this.#Kr(t.width,t.height)})),this.#ar.observe(this.div)}static deserialize(e,t,r){if(e instanceof o.StampAnnotationElement)return null;const n=super.deserialize(e,t,r),{rect:i,bitmapUrl:s,bitmapId:a,isSvg:l,accessibilityData:c}=e;a&&r.imageManager.isValidId(a)?n.#Fr=a:n.#Br=s,n.#Gr=l;const[u,d]=n.pageDimensions;return n.width=(i[2]-i[0])/u,n.height=(i[3]-i[1])/d,c&&(n.altTextData=c),n}serialize(e=!1,t=null){if(this.isEmpty())return null;const r={annotationType:n.AnnotationEditorType.STAMP,bitmapId:this.#Fr,pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:this.#Gr,structTreeParentId:this._structTreeParentId};if(e)return r.bitmapUrl=this.#Yr(!0),r.accessibilityData=this.altTextData,r;const{decorative:i,altText:s}=this.altTextData;if(!i&&s&&(r.accessibilityData={type:"Figure",alt:s}),null===t)return r;t.stamps||=new Map;const o=this.#Gr?(r.rect[2]-r.rect[0])*(r.rect[3]-r.rect[1]):null;if(t.stamps.has(this.#Fr)){if(this.#Gr){const e=t.stamps.get(this.#Fr);o>e.area&&(e.area=o,e.serialized.bitmap.close(),e.serialized.bitmap=this.#Yr(!1))}}else t.stamps.set(this.#Fr,{area:o,serialized:r}),r.bitmap=this.#Yr(!1);return r}}class AnnotationEditorLayer{#oe;#Jr=!1;#Qr=null;#en=null;#tn=null;#rn=null;#nn=null;#in=new Map;#sn=!1;#on=!1;#an=!1;#ln=null;#cn;static _initialized=!1;static#un=new Map([FreeTextEditor,InkEditor,StampEditor,HighlightEditor].map((e=>[e._editorType,e])));constructor({uiManager:e,pageIndex:t,div:r,accessibilityManager:n,annotationLayer:i,drawLayer:s,textLayer:o,viewport:a,l10n:l}){const c=[...AnnotationEditorLayer.#un.values()];if(!AnnotationEditorLayer._initialized){AnnotationEditorLayer._initialized=!0;for(const t of c)t.initialize(l,e)}e.registerEditorTypes(c),this.#cn=e,this.pageIndex=t,this.div=r,this.#oe=n,this.#Qr=i,this.viewport=a,this.#ln=o,this.drawLayer=s,this.#cn.addLayer(this)}get isEmpty(){return 0===this.#in.size}get isInvisible(){return this.isEmpty&&this.#cn.getMode()===n.AnnotationEditorType.NONE}updateToolbar(e){this.#cn.updateToolbar(e)}updateMode(e=this.#cn.getMode()){switch(this.#dn(),e){case n.AnnotationEditorType.NONE:return this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),void this.disableClick();case n.AnnotationEditorType.INK:this.addInkEditorIfNeeded(!1),this.disableTextSelection(),this.togglePointerEvents(!0),this.disableClick();break;case n.AnnotationEditorType.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:t}=this.div;for(const r of AnnotationEditorLayer.#un.values())t.toggle(`${r._type}Editing`,e===r._editorType);this.div.hidden=!1}hasTextLayer(e){return e===this.#ln?.div}addInkEditorIfNeeded(e){if(this.#cn.getMode()!==n.AnnotationEditorType.INK)return;if(!e)for(const e of this.#in.values())if(e.isEmpty())return void e.setInBackground();this.createAndAddNewEditor({offsetX:0,offsetY:0},!1).setInBackground()}setEditingState(e){this.#cn.setEditingState(e)}addCommands(e){this.#cn.addCommands(e)}togglePointerEvents(e=!1){this.div.classList.toggle("disabled",!e)}toggleAnnotationLayerPointerEvents(e=!1){this.#Qr?.div.classList.toggle("disabled",!e)}enable(){this.div.tabIndex=0,this.togglePointerEvents(!0);const e=new Set;for(const t of this.#in.values())t.enableEditing(),t.show(!0),t.annotationElementId&&(this.#cn.removeChangedExistingAnnotation(t),e.add(t.annotationElementId));if(!this.#Qr)return;const t=this.#Qr.getEditableAnnotations();for(const r of t){if(r.hide(),this.#cn.isDeletedAnnotationElement(r.data.id))continue;if(e.has(r.data.id))continue;const t=this.deserialize(r);t&&(this.addOrRebuild(t),t.enableEditing())}}disable(){this.#an=!0,this.div.tabIndex=-1,this.togglePointerEvents(!1);const e=new Map,t=new Map;for(const r of this.#in.values())r.disableEditing(),r.annotationElementId&&(null===r.serialize()?(t.set(r.annotationElementId,r),this.getEditableAnnotation(r.annotationElementId)?.show(),r.remove()):e.set(r.annotationElementId,r));if(this.#Qr){const r=this.#Qr.getEditableAnnotations();for(const n of r){const{id:r}=n.data;if(this.#cn.isDeletedAnnotationElement(r))continue;let i=t.get(r);i?(i.resetAnnotationElement(n),i.show(!1),n.show()):(i=e.get(r),i&&(this.#cn.addChangedExistingAnnotation(i),i.renderAnnotationElement(n),i.show(!1)),n.show())}}this.#dn(),this.isEmpty&&(this.div.hidden=!0);const{classList:r}=this.div;for(const e of AnnotationEditorLayer.#un.values())r.remove(`${e._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),this.#an=!1}getEditableAnnotation(e){return this.#Qr?.getEditableAnnotation(e)||null}setActiveEditor(e){this.#cn.getActive()!==e&&this.#cn.setActiveEditor(e)}enableTextSelection(){this.div.tabIndex=-1,this.#ln?.div&&!this.#rn&&(this.#rn=this.#hn.bind(this),this.#ln.div.addEventListener("pointerdown",this.#rn),this.#ln.div.classList.add("highlighting"))}disableTextSelection(){this.div.tabIndex=0,this.#ln?.div&&this.#rn&&(this.#ln.div.removeEventListener("pointerdown",this.#rn),this.#rn=null,this.#ln.div.classList.remove("highlighting"))}#hn(e){if(this.#cn.unselectAll(),e.target===this.#ln.div){const{isMac:t}=n.FeatureTest.platform;if(0!==e.button||e.ctrlKey&&t)return;this.#cn.showAllEditors("highlight",!0,!0),this.#ln.div.classList.add("free"),HighlightEditor.startHighlighting(this,"ltr"===this.#cn.direction,e),this.#ln.div.addEventListener("pointerup",(()=>{this.#ln.div.classList.remove("free")}),{once:!0}),e.preventDefault()}}enableClick(){this.#tn||(this.#tn=this.pointerdown.bind(this),this.#en=this.pointerup.bind(this),this.div.addEventListener("pointerdown",this.#tn),this.div.addEventListener("pointerup",this.#en))}disableClick(){this.#tn&&(this.div.removeEventListener("pointerdown",this.#tn),this.div.removeEventListener("pointerup",this.#en),this.#tn=null,this.#en=null)}attach(e){this.#in.set(e.id,e);const{annotationElementId:t}=e;t&&this.#cn.isDeletedAnnotationElement(t)&&this.#cn.removeDeletedAnnotationElement(e)}detach(e){this.#in.delete(e.id),this.#oe?.removePointerInTextLayer(e.contentDiv),!this.#an&&e.annotationElementId&&this.#cn.addDeletedAnnotationElement(e)}remove(e){this.detach(e),this.#cn.removeEditor(e),e.div.remove(),e.isAttachedToDOM=!1,this.#on||this.addInkEditorIfNeeded(!1)}changeParent(e){e.parent!==this&&(e.parent&&e.annotationElementId&&(this.#cn.addDeletedAnnotationElement(e.annotationElementId),i.AnnotationEditor.deleteAnnotationElement(e),e.annotationElementId=null),this.attach(e),e.parent?.detach(e),e.setParent(this),e.div&&e.isAttachedToDOM&&(e.div.remove(),this.div.append(e.div)))}add(e){if(e.parent!==this||!e.isAttachedToDOM){if(this.changeParent(e),this.#cn.addEditor(e),this.attach(e),!e.isAttachedToDOM){const t=e.render();this.div.append(t),e.isAttachedToDOM=!0}e.fixAndSetPosition(),e.onceAdded(),this.#cn.addToAnnotationStorage(e),e._reportTelemetry(e.telemetryInitialData)}}moveEditorInDOM(e){if(!e.isAttachedToDOM)return;const{activeElement:t}=document;e.div.contains(t)&&!this.#nn&&(e._focusEventsAllowed=!1,this.#nn=setTimeout((()=>{this.#nn=null,e.div.contains(document.activeElement)?e._focusEventsAllowed=!0:(e.div.addEventListener("focusin",(()=>{e._focusEventsAllowed=!0}),{once:!0}),t.focus())}),0)),e._structTreeParentId=this.#oe?.moveElementInDOM(this.div,e.div,e.contentDiv,!0)}addOrRebuild(e){e.needsToBeRebuilt()?(e.parent||=this,e.rebuild(),e.show()):this.add(e)}addUndoableEditor(e){this.addCommands({cmd:()=>e._uiManager.rebuild(e),undo:()=>{e.remove()},mustExec:!1})}getNextId(){return this.#cn.getId()}get#pn(){return AnnotationEditorLayer.#un.get(this.#cn.getMode())}#mn(e){const t=this.#pn;return t?new t.prototype.constructor(e):null}canCreateNewEmptyEditor(){return this.#pn?.canCreateNewEmptyEditor()}pasteEditor(e,t){this.#cn.updateToolbar(e),this.#cn.updateMode(e);const{offsetX:r,offsetY:n}=this.#fn(),i=this.getNextId(),s=this.#mn({parent:this,id:i,x:r,y:n,uiManager:this.#cn,isCentered:!0,...t});s&&this.add(s)}deserialize(e){return AnnotationEditorLayer.#un.get(e.annotationType??e.annotationEditorType)?.deserialize(e,this,this.#cn)||null}createAndAddNewEditor(e,t,r={}){const n=this.getNextId(),i=this.#mn({parent:this,id:n,x:e.offsetX,y:e.offsetY,uiManager:this.#cn,isCentered:t,...r});return i&&this.add(i),i}#fn(){const{x:e,y:t,width:r,height:n}=this.div.getBoundingClientRect(),i=Math.max(0,e),s=Math.max(0,t),o=(i+Math.min(window.innerWidth,e+r))/2-e,a=(s+Math.min(window.innerHeight,t+n))/2-t,[l,c]=this.viewport.rotation%180==0?[o,a]:[a,o];return{offsetX:l,offsetY:c}}addNewEditor(){this.createAndAddNewEditor(this.#fn(),!0)}setSelected(e){this.#cn.setSelected(e)}toggleSelected(e){this.#cn.toggleSelected(e)}isSelected(e){return this.#cn.isSelected(e)}unselect(e){this.#cn.unselect(e)}pointerup(e){const{isMac:t}=n.FeatureTest.platform;0!==e.button||e.ctrlKey&&t||e.target===this.div&&this.#sn&&(this.#sn=!1,this.#Jr?this.#cn.getMode()!==n.AnnotationEditorType.STAMP?this.createAndAddNewEditor(e,!1):this.#cn.unselectAll():this.#Jr=!0)}pointerdown(e){if(this.#cn.getMode()===n.AnnotationEditorType.HIGHLIGHT&&this.enableTextSelection(),this.#sn)return void(this.#sn=!1);const{isMac:t}=n.FeatureTest.platform;if(0!==e.button||e.ctrlKey&&t)return;if(e.target!==this.div)return;this.#sn=!0;const r=this.#cn.getActive();this.#Jr=!r||r.isEmpty()}findNewParent(e,t,r){const n=this.#cn.findParent(t,r);return null!==n&&n!==this&&(n.changeParent(e),!0)}destroy(){this.#cn.getActive()?.parent===this&&(this.#cn.commitOrRemove(),this.#cn.setActiveEditor(null)),this.#nn&&(clearTimeout(this.#nn),this.#nn=null);for(const e of this.#in.values())this.#oe?.removePointerInTextLayer(e.contentDiv),e.setParent(null),e.isAttachedToDOM=!1,e.div.remove();this.div=null,this.#in.clear(),this.#cn.removeLayer(this)}#dn(){this.#on=!0;for(const e of this.#in.values())e.isEmpty()&&e.remove();this.#on=!1}render({viewport:e}){this.viewport=e,(0,u.setLayerDimensions)(this.div,e);for(const e of this.#cn.getEditors(this.pageIndex))this.add(e),e.rebuild();this.updateMode()}update({viewport:e}){this.#cn.commitOrRemove(),this.#dn();const t=this.viewport.rotation,r=e.rotation;if(this.viewport=e,(0,u.setLayerDimensions)(this.div,{rotation:r}),t!==r)for(const e of this.#in.values())e.rotate(r);this.addInkEditorIfNeeded(!1)}get pageDimensions(){const{pageWidth:e,pageHeight:t}=this.viewport.rawDims;return[e,t]}get scale(){return this.#cn.viewParameters.realScale}}},259:(e,t,r)=>{r.d(t,{ColorPicker:()=>ColorPicker});var n=r(292),i=r(830),s=r(419);class ColorPicker{#R=this.#L.bind(this);#gn=this.#yn.bind(this);#bn=null;#vn=null;#_n;#xn=null;#wn=!1;#Sn=!1;#Pn=null;#En;#cn=null;#Mn;static get _keyboardManager(){return(0,n.shadow)(this,"_keyboardManager",new i.KeyboardManager([[["Escape","mac+Escape"],ColorPicker.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],ColorPicker.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],ColorPicker.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],ColorPicker.prototype._moveToPrevious],[["Home","mac+Home"],ColorPicker.prototype._moveToBeginning],[["End","mac+End"],ColorPicker.prototype._moveToEnd]]))}constructor({editor:e=null,uiManager:t=null}){e?(this.#Sn=!1,this.#Mn=n.AnnotationEditorParamsType.HIGHLIGHT_COLOR,this.#Pn=e):(this.#Sn=!0,this.#Mn=n.AnnotationEditorParamsType.HIGHLIGHT_DEFAULT_COLOR),this.#cn=e?._uiManager||t,this.#En=this.#cn._eventBus,this.#_n=e?.color||this.#cn?.highlightColors.values().next().value||"#FFFF98"}renderButton(){const e=this.#bn=document.createElement("button");e.className="colorPicker",e.tabIndex="0",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),e.setAttribute("aria-haspopup",!0),e.addEventListener("click",this.#Cn.bind(this)),e.addEventListener("keydown",this.#R);const t=this.#vn=document.createElement("span");return t.className="swatch",t.setAttribute("aria-hidden",!0),t.style.backgroundColor=this.#_n,e.append(t),e}renderMainDropdown(){const e=this.#xn=this.#An();return e.setAttribute("aria-orientation","horizontal"),e.setAttribute("aria-labelledby","highlightColorPickerLabel"),e}#An(){const e=document.createElement("div");e.addEventListener("contextmenu",s.noContextMenu),e.className="dropdown",e.role="listbox",e.setAttribute("aria-multiselectable",!1),e.setAttribute("aria-orientation","vertical"),e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown");for(const[t,r]of this.#cn.highlightColors){const n=document.createElement("button");n.tabIndex="0",n.role="option",n.setAttribute("data-color",r),n.title=t,n.setAttribute("data-l10n-id",`pdfjs-editor-colorpicker-${t}`);const i=document.createElement("span");n.append(i),i.className="swatch",i.style.backgroundColor=r,n.setAttribute("aria-selected",r===this.#_n),n.addEventListener("click",this.#Tn.bind(this,r)),e.append(n)}return e.addEventListener("keydown",this.#R),e}#Tn(e,t){t.stopPropagation(),this.#En.dispatch("switchannotationeditorparams",{source:this,type:this.#Mn,value:e})}_colorSelectFromKeyboard(e){if(e.target===this.#bn)return void this.#Cn(e);const t=e.target.getAttribute("data-color");t&&this.#Tn(t,e)}_moveToNext(e){this.#Dn?e.target!==this.#bn?e.target.nextSibling?.focus():this.#xn.firstChild?.focus():this.#Cn(e)}_moveToPrevious(e){e.target!==this.#xn?.firstChild&&e.target!==this.#bn?(this.#Dn||this.#Cn(e),e.target.previousSibling?.focus()):this.#Dn&&this._hideDropdownFromKeyboard()}_moveToBeginning(e){this.#Dn?this.#xn.firstChild?.focus():this.#Cn(e)}_moveToEnd(e){this.#Dn?this.#xn.lastChild?.focus():this.#Cn(e)}#L(e){ColorPicker._keyboardManager.exec(this,e)}#Cn(e){if(this.#Dn)return void this.hideDropdown();if(this.#wn=0===e.detail,window.addEventListener("pointerdown",this.#gn),this.#xn)return void this.#xn.classList.remove("hidden");const t=this.#xn=this.#An();this.#bn.append(t)}#yn(e){this.#xn?.contains(e.target)||this.hideDropdown()}hideDropdown(){this.#xn?.classList.add("hidden"),window.removeEventListener("pointerdown",this.#gn)}get#Dn(){return this.#xn&&!this.#xn.classList.contains("hidden")}_hideDropdownFromKeyboard(){this.#Sn||(this.#Dn?(this.hideDropdown(),this.#bn.focus({preventScroll:!0,focusVisible:this.#wn})):this.#Pn?.unselect())}updateColor(e){if(this.#vn&&(this.#vn.style.backgroundColor=e),!this.#xn)return;const t=this.#cn.highlightColors.values();for(const r of this.#xn.children)r.setAttribute("aria-selected",t.next().value===e)}destroy(){this.#bn?.remove(),this.#bn=null,this.#vn=null,this.#xn?.remove(),this.#xn=null}}},310:(e,t,r)=>{r.d(t,{AnnotationEditor:()=>AnnotationEditor});var n=r(830),i=r(292),s=r(419);class AltText{#On="";#Rn=!1;#Ln=null;#kn=null;#Nn=null;#Fn=!1;#Pn=null;static _l10nPromise=null;constructor(e){this.#Pn=e}static initialize(e){AltText._l10nPromise||=e}async render(){const e=this.#Ln=document.createElement("button");e.className="altText";const t=await AltText._l10nPromise.get("pdfjs-editor-alt-text-button-label");e.textContent=t,e.setAttribute("aria-label",t),e.tabIndex="0",e.addEventListener("contextmenu",s.noContextMenu),e.addEventListener("pointerdown",(e=>e.stopPropagation()));const r=e=>{e.preventDefault(),this.#Pn._uiManager.editAltText(this.#Pn)};return e.addEventListener("click",r,{capture:!0}),e.addEventListener("keydown",(t=>{t.target===e&&"Enter"===t.key&&(this.#Fn=!0,r(t))})),await this.#In(),e}finish(){this.#Ln&&(this.#Ln.focus({focusVisible:this.#Fn}),this.#Fn=!1)}isEmpty(){return!this.#On&&!this.#Rn}get data(){return{altText:this.#On,decorative:this.#Rn}}set data({altText:e,decorative:t}){this.#On===e&&this.#Rn===t||(this.#On=e,this.#Rn=t,this.#In())}toggle(e=!1){this.#Ln&&(!e&&this.#Nn&&(clearTimeout(this.#Nn),this.#Nn=null),this.#Ln.disabled=!e)}destroy(){this.#Ln?.remove(),this.#Ln=null,this.#kn=null}async#In(){const e=this.#Ln;if(!e)return;if(!this.#On&&!this.#Rn)return e.classList.remove("done"),void this.#kn?.remove();e.classList.add("done"),AltText._l10nPromise.get("pdfjs-editor-alt-text-edit-button-label").then((t=>{e.setAttribute("aria-label",t)}));let t=this.#kn;if(!t){this.#kn=t=document.createElement("span"),t.className="tooltip",t.setAttribute("role","tooltip");const r=t.id=`alt-text-tooltip-${this.#Pn.id}`;e.setAttribute("aria-describedby",r);const n=100;e.addEventListener("mouseenter",(()=>{this.#Nn=setTimeout((()=>{this.#Nn=null,this.#kn.classList.add("show"),this.#Pn._reportTelemetry({action:"alt_text_tooltip"})}),n)})),e.addEventListener("mouseleave",(()=>{this.#Nn&&(clearTimeout(this.#Nn),this.#Nn=null),this.#kn?.classList.remove("show")}))}t.innerText=this.#Rn?await AltText._l10nPromise.get("pdfjs-editor-alt-text-decorative-tooltip"):this.#On,t.parentNode||e.append(t);const r=this.#Pn.getImageForAltText();r?.setAttribute("aria-describedby",t.id)}}var o=r(362);class AnnotationEditor{#Bn=null;#On=null;#jn=!1;#Hn=!1;#Un=null;#zn=null;#Gn=this.focusin.bind(this);#Wn=this.focusout.bind(this);#Vn=null;#qn="";#$n=!1;#Zn=null;#Kn=!1;#Xn=!1;#Yn=!1;#Jn=null;#Qn=0;#ei=0;#ti=null;_initialOptions=Object.create(null);_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;_l10nPromise=null;#ri=!1;#ni=AnnotationEditor._zIndex++;static _borderLineWidth=-1;static _colorManager=new n.ColorManager;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){const e=AnnotationEditor.prototype._resizeWithKeyboard,t=n.AnnotationEditorUIManager.TRANSLATE_SMALL,r=n.AnnotationEditorUIManager.TRANSLATE_BIG;return(0,i.shadow)(this,"_resizerKeyboardManager",new n.KeyboardManager([[["ArrowLeft","mac+ArrowLeft"],e,{args:[-t,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e,{args:[-r,0]}],[["ArrowRight","mac+ArrowRight"],e,{args:[t,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e,{args:[r,0]}],[["ArrowUp","mac+ArrowUp"],e,{args:[0,-t]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e,{args:[0,-r]}],[["ArrowDown","mac+ArrowDown"],e,{args:[0,t]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e,{args:[0,r]}],[["Escape","mac+Escape"],AnnotationEditor.prototype._stopResizingWithKeyboard]]))}constructor(e){this.constructor===AnnotationEditor&&(0,i.unreachable)("Cannot initialize AnnotationEditor."),this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null,this._uiManager=e.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=e.isCentered,this._structTreeParentId=null;const{rotation:t,rawDims:{pageWidth:r,pageHeight:n,pageX:s,pageY:o}}=this.parent.viewport;this.rotation=t,this.pageRotation=(360+t-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[r,n],this.pageTranslation=[s,o];const[a,l]=this.parentDimensions;this.x=e.x/a,this.y=e.y/l,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return(0,i.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(e){const t=new FakeEditor({id:e.parent.getNextId(),parent:e.parent,uiManager:e._uiManager});t.annotationElementId=e.annotationElementId,t.deleted=!0,t._uiManager.addToAnnotationStorage(t)}static initialize(e,t,r){if(AnnotationEditor._l10nPromise||=new Map(["pdfjs-editor-alt-text-button-label","pdfjs-editor-alt-text-edit-button-label","pdfjs-editor-alt-text-decorative-tooltip","pdfjs-editor-resizer-label-topLeft","pdfjs-editor-resizer-label-topMiddle","pdfjs-editor-resizer-label-topRight","pdfjs-editor-resizer-label-middleRight","pdfjs-editor-resizer-label-bottomRight","pdfjs-editor-resizer-label-bottomMiddle","pdfjs-editor-resizer-label-bottomLeft","pdfjs-editor-resizer-label-middleLeft"].map((t=>[t,e.get(t.replaceAll(/([A-Z])/g,(e=>`-${e.toLowerCase()}`)))]))),r?.strings)for(const t of r.strings)AnnotationEditor._l10nPromise.set(t,e.get(t));if(-1!==AnnotationEditor._borderLineWidth)return;const n=getComputedStyle(document.documentElement);AnnotationEditor._borderLineWidth=parseFloat(n.getPropertyValue("--outline-width"))||0}static updateDefaultParams(e,t){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,t){(0,i.unreachable)("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#ri}set _isDraggable(e){this.#ri=e,this.div?.classList.toggle("draggable",e)}get isEnterHandled(){return!0}center(){const[e,t]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*t/(2*e),this.y+=this.width*e/(2*t);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*t/(2*e),this.y-=this.width*e/(2*t);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#ni}setParent(e){null!==e?(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions):this.#ii(),this.parent=e}focusin(e){this._focusEventsAllowed&&(this.#$n?this.#$n=!1:this.parent.setSelected(this))}focusout(e){if(!this._focusEventsAllowed)return;if(!this.isAttachedToDOM)return;const t=e.relatedTarget;t?.closest(`#${this.id}`)||(e.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(e,t,r,n){const[i,s]=this.parentDimensions;[r,n]=this.screenToPageTranslation(r,n),this.x=(e+r)/i,this.y=(t+n)/s,this.fixAndSetPosition()}#si([e,t],r,n){[r,n]=this.screenToPageTranslation(r,n),this.x+=r/e,this.y+=n/t,this.fixAndSetPosition()}translate(e,t){this.#si(this.parentDimensions,e,t)}translateInPage(e,t){this.#Zn||=[this.x,this.y],this.#si(this.pageDimensions,e,t),this.div.scrollIntoView({block:"nearest"})}drag(e,t){this.#Zn||=[this.x,this.y];const[r,n]=this.parentDimensions;if(this.x+=e/r,this.y+=t/n,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:e,y:t}=this.div.getBoundingClientRect();this.parent.findNewParent(this,e,t)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:i,y:s}=this;const[o,a]=this.getBaseTranslation();i+=o,s+=a,this.div.style.left=`${(100*i).toFixed(2)}%`,this.div.style.top=`${(100*s).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}get _hasBeenMoved(){return!!this.#Zn&&(this.#Zn[0]!==this.x||this.#Zn[1]!==this.y)}getBaseTranslation(){const[e,t]=this.parentDimensions,{_borderLineWidth:r}=AnnotationEditor,n=r/e,i=r/t;switch(this.rotation){case 90:return[-n,i];case 180:return[n,i];case 270:return[n,-i];default:return[-n,-i]}}get _mustFixPosition(){return!0}fixAndSetPosition(e=this.rotation){const[t,r]=this.pageDimensions;let{x:n,y:i,width:s,height:o}=this;if(s*=t,o*=r,n*=t,i*=r,this._mustFixPosition)switch(e){case 0:n=Math.max(0,Math.min(t-s,n)),i=Math.max(0,Math.min(r-o,i));break;case 90:n=Math.max(0,Math.min(t-o,n)),i=Math.min(r,Math.max(s,i));break;case 180:n=Math.min(t,Math.max(s,n)),i=Math.min(r,Math.max(o,i));break;case 270:n=Math.min(t,Math.max(o,n)),i=Math.max(0,Math.min(r-s,i))}this.x=n/=t,this.y=i/=r;const[a,l]=this.getBaseTranslation();n+=a,i+=l;const{style:c}=this.div;c.left=`${(100*n).toFixed(2)}%`,c.top=`${(100*i).toFixed(2)}%`,this.moveInDOM()}static#oi(e,t,r){switch(r){case 90:return[t,-e];case 180:return[-e,-t];case 270:return[-t,e];default:return[e,t]}}screenToPageTranslation(e,t){return AnnotationEditor.#oi(e,t,this.parentRotation)}pageTranslationToScreen(e,t){return AnnotationEditor.#oi(e,t,360-this.parentRotation)}#ai(e){switch(e){case 90:{const[e,t]=this.pageDimensions;return[0,-e/t,t/e,0]}case 180:return[-1,0,0,-1];case 270:{const[e,t]=this.pageDimensions;return[0,e/t,-t/e,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:e,pageDimensions:[t,r]}=this,n=t*e,s=r*e;return i.FeatureTest.isCSSRoundSupported?[Math.round(n),Math.round(s)]:[n,s]}setDims(e,t){const[r,n]=this.parentDimensions;this.div.style.width=`${(100*e/r).toFixed(2)}%`,this.#Hn||(this.div.style.height=`${(100*t/n).toFixed(2)}%`)}fixDims(){const{style:e}=this.div,{height:t,width:r}=e,n=r.endsWith("%"),i=!this.#Hn&&t.endsWith("%");if(n&&i)return;const[s,o]=this.parentDimensions;n||(e.width=`${(100*parseFloat(r)/s).toFixed(2)}%`),this.#Hn||i||(e.height=`${(100*parseFloat(t)/o).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}#li(){if(this.#Un)return;this.#Un=document.createElement("div"),this.#Un.classList.add("resizers");const e=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"];for(const t of e){const e=document.createElement("div");this.#Un.append(e),e.classList.add("resizer",t),e.setAttribute("data-resizer-name",t),e.addEventListener("pointerdown",this.#ci.bind(this,t)),e.addEventListener("contextmenu",s.noContextMenu),e.tabIndex=-1}this.div.prepend(this.#Un)}#ci(e,t){t.preventDefault();const{isMac:r}=i.FeatureTest.platform;if(0!==t.button||t.ctrlKey&&r)return;this.#On?.toggle(!1);const n=this.#ui.bind(this,e),o=this._isDraggable;this._isDraggable=!1;const a={passive:!0,capture:!0};this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",n,a),window.addEventListener("contextmenu",s.noContextMenu);const l=this.x,c=this.y,u=this.width,d=this.height,h=this.parent.div.style.cursor,p=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(t.target).cursor;const m=()=>{this.parent.togglePointerEvents(!0),this.#On?.toggle(!0),this._isDraggable=o,window.removeEventListener("pointerup",m),window.removeEventListener("blur",m),window.removeEventListener("pointermove",n,a),window.removeEventListener("contextmenu",s.noContextMenu),this.parent.div.style.cursor=h,this.div.style.cursor=p,this.#di(l,c,u,d)};window.addEventListener("pointerup",m),window.addEventListener("blur",m)}#di(e,t,r,n){const i=this.x,s=this.y,o=this.width,a=this.height;i===e&&s===t&&o===r&&a===n||this.addCommands({cmd:()=>{this.width=o,this.height=a,this.x=i,this.y=s;const[e,t]=this.parentDimensions;this.setDims(e*o,t*a),this.fixAndSetPosition()},undo:()=>{this.width=r,this.height=n,this.x=e,this.y=t;const[i,s]=this.parentDimensions;this.setDims(i*r,s*n),this.fixAndSetPosition()},mustExec:!0})}#ui(e,t){const[r,n]=this.parentDimensions,i=this.x,s=this.y,o=this.width,a=this.height,l=AnnotationEditor.MIN_SIZE/r,c=AnnotationEditor.MIN_SIZE/n,u=e=>Math.round(1e4*e)/1e4,d=this.#ai(this.rotation),h=(e,t)=>[d[0]*e+d[2]*t,d[1]*e+d[3]*t],p=this.#ai(360-this.rotation);let m,f,g=!1,y=!1;switch(e){case"topLeft":g=!0,m=(e,t)=>[0,0],f=(e,t)=>[e,t];break;case"topMiddle":m=(e,t)=>[e/2,0],f=(e,t)=>[e/2,t];break;case"topRight":g=!0,m=(e,t)=>[e,0],f=(e,t)=>[0,t];break;case"middleRight":y=!0,m=(e,t)=>[e,t/2],f=(e,t)=>[0,t/2];break;case"bottomRight":g=!0,m=(e,t)=>[e,t],f=(e,t)=>[0,0];break;case"bottomMiddle":m=(e,t)=>[e/2,t],f=(e,t)=>[e/2,0];break;case"bottomLeft":g=!0,m=(e,t)=>[0,t],f=(e,t)=>[e,0];break;case"middleLeft":y=!0,m=(e,t)=>[0,t/2],f=(e,t)=>[e,t/2]}const b=m(o,a),v=f(o,a);let _=h(...v);const x=u(i+_[0]),w=u(s+_[1]);let R=1,k=1,[j,z]=this.screenToPageTranslation(t.movementX,t.movementY);var q,$;if([j,z]=(q=j/r,$=z/n,[p[0]*q+p[2]*$,p[1]*q+p[3]*$]),g){const e=Math.hypot(o,a);R=k=Math.max(Math.min(Math.hypot(v[0]-b[0]-j,v[1]-b[1]-z)/e,1/o,1/a),l/o,c/a)}else y?R=Math.max(l,Math.min(1,Math.abs(v[0]-b[0]-j)))/o:k=Math.max(c,Math.min(1,Math.abs(v[1]-b[1]-z)))/a;const Z=u(o*R),X=u(a*k);_=h(...f(Z,X));const Y=x-_[0],ee=w-_[1];this.width=Z,this.height=X,this.x=Y,this.y=ee,this.setDims(r*Z,n*X),this.fixAndSetPosition()}altTextFinish(){this.#On?.finish()}async addEditToolbar(){return this.#Vn||this.#Xn||(this.#Vn=new o.EditorToolbar(this),this.div.append(this.#Vn.render()),this.#On&&this.#Vn.addAltTextButton(await this.#On.render())),this.#Vn}removeEditToolbar(){this.#Vn&&(this.#Vn.remove(),this.#Vn=null,this.#On?.destroy())}getClientDimensions(){return this.div.getBoundingClientRect()}async addAltTextButton(){this.#On||(AltText.initialize(AnnotationEditor._l10nPromise),this.#On=new AltText(this),await this.addEditToolbar())}get altTextData(){return this.#On?.data}set altTextData(e){this.#On&&(this.#On.data=e)}hasAltText(){return!this.#On?.isEmpty()}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.tabIndex=this.#jn?-1:0,this._isVisible||this.div.classList.add("hidden"),this.setInForeground(),this.div.addEventListener("focusin",this.#Gn),this.div.addEventListener("focusout",this.#Wn);const[e,t]=this.parentDimensions;this.parentRotation%180!=0&&(this.div.style.maxWidth=`${(100*t/e).toFixed(2)}%`,this.div.style.maxHeight=`${(100*e/t).toFixed(2)}%`);const[r,i]=this.getInitialTranslation();return this.translate(r,i),(0,n.bindEvents)(this,this.div,["pointerdown"]),this.div}pointerdown(e){const{isMac:t}=i.FeatureTest.platform;0!==e.button||e.ctrlKey&&t?e.preventDefault():(this.#$n=!0,this._isDraggable?this.#hi(e):this.#pi(e))}#pi(e){const{isMac:t}=i.FeatureTest.platform;e.ctrlKey&&!t||e.shiftKey||e.metaKey&&t?this.parent.toggleSelected(this):this.parent.setSelected(this)}#hi(e){const t=this._uiManager.isSelected(this);let r,n;this._uiManager.setUpDragSession(),t&&(this.div.classList.add("moving"),r={passive:!0,capture:!0},this.#Qn=e.clientX,this.#ei=e.clientY,n=e=>{const{clientX:t,clientY:r}=e,[n,i]=this.screenToPageTranslation(t-this.#Qn,r-this.#ei);this.#Qn=t,this.#ei=r,this._uiManager.dragSelectedEditors(n,i)},window.addEventListener("pointermove",n,r));const i=()=>{window.removeEventListener("pointerup",i),window.removeEventListener("blur",i),t&&(this.div.classList.remove("moving"),window.removeEventListener("pointermove",n,r)),this.#$n=!1,this._uiManager.endDragSession()||this.#pi(e)};window.addEventListener("pointerup",i),window.addEventListener("blur",i)}moveInDOM(){this.#Jn&&clearTimeout(this.#Jn),this.#Jn=setTimeout((()=>{this.#Jn=null,this.parent?.moveEditorInDOM(this)}),0)}_setParentAndPosition(e,t,r){e.changeParent(this),this.x=t,this.y=r,this.fixAndSetPosition()}getRect(e,t,r=this.rotation){const n=this.parentScale,[i,s]=this.pageDimensions,[o,a]=this.pageTranslation,l=e/n,c=t/n,u=this.x*i,d=this.y*s,h=this.width*i,p=this.height*s;switch(r){case 0:return[u+l+o,s-d-c-p+a,u+l+h+o,s-d-c+a];case 90:return[u+c+o,s-d+l+a,u+c+p+o,s-d+l+h+a];case 180:return[u-l-h+o,s-d+c+a,u-l+o,s-d+c+p+a];case 270:return[u-c-p+o,s-d-l-h+a,u-c+o,s-d-l+a];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(e,t){const[r,n,i,s]=e,o=i-r,a=s-n;switch(this.rotation){case 0:return[r,t-s,o,a];case 90:return[r,t-n,a,o];case 180:return[i,t-n,o,a];case 270:return[i,t-s,a,o];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){this.#Xn=!0}disableEditMode(){this.#Xn=!1}isInEditMode(){return this.#Xn}shouldGetKeyboardEvents(){return this.#Yn}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){this.div?.addEventListener("focusin",this.#Gn),this.div?.addEventListener("focusout",this.#Wn)}rotate(e){}serialize(e=!1,t=null){(0,i.unreachable)("An editor must be serializable")}static deserialize(e,t,r){const n=new this.prototype.constructor({parent:t,id:t.getNextId(),uiManager:r});n.rotation=e.rotation;const[i,s]=n.pageDimensions,[o,a,l,c]=n.getRectInCurrentCoords(e.rect,s);return n.x=o/i,n.y=a/s,n.width=l/i,n.height=c/s,n}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||null!==this.serialize())}remove(){if(this.div.removeEventListener("focusin",this.#Gn),this.div.removeEventListener("focusout",this.#Wn),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#Jn&&(clearTimeout(this.#Jn),this.#Jn=null),this.#ii(),this.removeEditToolbar(),this.#ti){for(const e of this.#ti.values())clearTimeout(e);this.#ti=null}this.parent=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#li(),this.#Un.classList.remove("hidden"),(0,n.bindEvents)(this,this.div,["keydown"]))}get toolbarPosition(){return null}keydown(e){if(!this.isResizable||e.target!==this.div||"Enter"!==e.key)return;this._uiManager.setSelected(this),this.#zn={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const t=this.#Un.children;if(!this.#Bn){this.#Bn=Array.from(t);const e=this.#mi.bind(this),r=this.#fi.bind(this);for(const t of this.#Bn){const n=t.getAttribute("data-resizer-name");t.setAttribute("role","spinbutton"),t.addEventListener("keydown",e),t.addEventListener("blur",r),t.addEventListener("focus",this.#gi.bind(this,n)),AnnotationEditor._l10nPromise.get(`pdfjs-editor-resizer-label-${n}`).then((e=>t.setAttribute("aria-label",e)))}}const r=this.#Bn[0];let n=0;for(const e of t){if(e===r)break;n++}const i=(360-this.rotation+this.parentRotation)%360/90*(this.#Bn.length/4);if(i!==n){if(i<n)for(let e=0;e<n-i;e++)this.#Un.append(this.#Un.firstChild);else if(i>n)for(let e=0;e<i-n;e++)this.#Un.firstChild.before(this.#Un.lastChild);let e=0;for(const r of t){const t=this.#Bn[e++].getAttribute("data-resizer-name");AnnotationEditor._l10nPromise.get(`pdfjs-editor-resizer-label-${t}`).then((e=>r.setAttribute("aria-label",e)))}}this.#yi(0),this.#Yn=!0,this.#Un.firstChild.focus({focusVisible:!0}),e.preventDefault(),e.stopImmediatePropagation()}#mi(e){AnnotationEditor._resizerKeyboardManager.exec(this,e)}#fi(e){this.#Yn&&e.relatedTarget?.parentNode!==this.#Un&&this.#ii()}#gi(e){this.#qn=this.#Yn?e:""}#yi(e){if(this.#Bn)for(const t of this.#Bn)t.tabIndex=e}_resizeWithKeyboard(e,t){this.#Yn&&this.#ui(this.#qn,{movementX:e,movementY:t})}#ii(){if(this.#Yn=!1,this.#yi(-1),this.#zn){const{savedX:e,savedY:t,savedWidth:r,savedHeight:n}=this.#zn;this.#di(e,t,r,n),this.#zn=null}}_stopResizingWithKeyboard(){this.#ii(),this.div.focus()}select(){this.makeResizable(),this.div?.classList.add("selectedEditor"),this.#Vn?this.#Vn?.show():this.addEditToolbar().then((()=>{this.div?.classList.contains("selectedEditor")&&this.#Vn?.show()}))}unselect(){this.#Un?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this.#Vn?.hide()}updateParams(e,t){}disableEditing(){}enableEditing(){}enterInEditMode(){}getImageForAltText(){return null}get contentDiv(){return this.div}get isEditing(){return this.#Kn}set isEditing(e){this.#Kn=e,this.parent&&(e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(e,t){this.#Hn=!0;const r=e/t,{style:n}=this.div;n.aspectRatio=r,n.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(e,t=!1){if(t){this.#ti||=new Map;const{action:t}=e;let r=this.#ti.get(t);return r&&clearTimeout(r),r=setTimeout((()=>{this._reportTelemetry(e),this.#ti.delete(t),0===this.#ti.size&&(this.#ti=null)}),AnnotationEditor._telemetryTimeout),void this.#ti.set(t,r)}e.type||=this.editorType,this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:e}})}show(e=this._isVisible){this.div.classList.toggle("hidden",!e),this._isVisible=e}enable(){this.div&&(this.div.tabIndex=0),this.#jn=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#jn=!0}renderAnnotationElement(e){let t=e.container.querySelector(".annotationContent");if(t){if("CANVAS"===t.nodeName){const e=t;t=document.createElement("div"),t.classList.add("annotationContent",this.editorType),e.before(t)}}else t=document.createElement("div"),t.classList.add("annotationContent",this.editorType),e.container.prepend(t);return t}resetAnnotationElement(e){const{firstChild:t}=e.container;"DIV"===t.nodeName&&t.classList.contains("annotationContent")&&t.remove()}}class FakeEditor extends AnnotationEditor{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}},61:(e,t,r)=>{r.d(t,{FreeOutliner:()=>FreeOutliner,Outliner:()=>Outliner});var n=r(292);class Outliner{#bi;#vi=[];#_i=[];constructor(e,t=0,r=0,n=!0){let i=1/0,s=-1/0,o=1/0,a=-1/0;const l=10**-4;for(const{x:r,y:n,width:c,height:u}of e){const e=Math.floor((r-t)/l)*l,d=Math.ceil((r+c+t)/l)*l,h=Math.floor((n-t)/l)*l,p=Math.ceil((n+u+t)/l)*l,m=[e,h,p,!0],f=[d,h,p,!1];this.#vi.push(m,f),i=Math.min(i,e),s=Math.max(s,d),o=Math.min(o,h),a=Math.max(a,p)}const c=s-i+2*r,u=a-o+2*r,d=i-r,h=o-r,p=this.#vi.at(n?-1:-2),m=[p[0],p[2]];for(const e of this.#vi){const[t,r,n]=e;e[0]=(t-d)/c,e[1]=(r-h)/u,e[2]=(n-h)/u}this.#bi={x:d,y:h,width:c,height:u,lastPoint:m}}getOutlines(){this.#vi.sort(((e,t)=>e[0]-t[0]||e[1]-t[1]||e[2]-t[2]));const e=[];for(const t of this.#vi)t[3]?(e.push(...this.#xi(t)),this.#wi(t)):(this.#Si(t),e.push(...this.#xi(t)));return this.#Pi(e)}#Pi(e){const t=[],r=new Set;for(const r of e){const[e,n,i]=r;t.push([e,n,r],[e,i,r])}t.sort(((e,t)=>e[1]-t[1]||e[0]-t[0]));for(let e=0,n=t.length;e<n;e+=2){const n=t[e][2],i=t[e+1][2];n.push(i),i.push(n),r.add(n),r.add(i)}const n=[];let i;for(;r.size>0;){const e=r.values().next().value;let[t,s,o,a,l]=e;r.delete(e);let c=t,u=s;for(i=[t,o],n.push(i);;){let e;if(r.has(a))e=a;else{if(!r.has(l))break;e=l}r.delete(e),[t,s,o,a,l]=e,c!==t&&(i.push(c,u,t,u===s?s:o),c=t),u=u===s?o:s}i.push(c,u)}return new HighlightOutline(n,this.#bi)}#Ei(e){const t=this.#_i;let r=0,n=t.length-1;for(;r<=n;){const i=r+n>>1,s=t[i][0];if(s===e)return i;s<e?r=i+1:n=i-1}return n+1}#wi([,e,t]){const r=this.#Ei(e);this.#_i.splice(r,0,[e,t])}#Si([,e,t]){const r=this.#Ei(e);for(let n=r;n<this.#_i.length;n++){const[r,i]=this.#_i[n];if(r!==e)break;if(r===e&&i===t)return void this.#_i.splice(n,1)}for(let n=r-1;n>=0;n--){const[r,i]=this.#_i[n];if(r!==e)break;if(r===e&&i===t)return void this.#_i.splice(n,1)}}#xi(e){const[t,r,n]=e,i=[[t,r,n]],s=this.#Ei(n);for(let e=0;e<s;e++){const[r,n]=this.#_i[e];for(let e=0,s=i.length;e<s;e++){const[,o,a]=i[e];if(!(n<=o||a<=r))if(o>=r)if(a>n)i[e][1]=n;else{if(1===s)return[];i.splice(e,1),e--,s--}else i[e][2]=r,a>n&&i.push([t,n,a])}}return i}}class Outline{toSVGPath(){throw new Error("Abstract method `toSVGPath` must be implemented.")}get box(){throw new Error("Abstract getter `box` must be implemented.")}serialize(e,t){throw new Error("Abstract method `serialize` must be implemented.")}get free(){return this instanceof FreeHighlightOutline}}class HighlightOutline extends Outline{#bi;#Mi;constructor(e,t){super(),this.#Mi=e,this.#bi=t}toSVGPath(){const e=[];for(const t of this.#Mi){let[r,n]=t;e.push(`M${r} ${n}`);for(let i=2;i<t.length;i+=2){const s=t[i],o=t[i+1];s===r?(e.push(`V${o}`),n=o):o===n&&(e.push(`H${s}`),r=s)}e.push("Z")}return e.join(" ")}serialize([e,t,r,n],i){const s=[],o=r-e,a=n-t;for(const t of this.#Mi){const r=new Array(t.length);for(let i=0;i<t.length;i+=2)r[i]=e+t[i]*o,r[i+1]=n-t[i+1]*a;s.push(r)}return s}get box(){return this.#bi}}class FreeOutliner{#bi;#Ci=[];#Ai;#Ti;#Di=[];#Oi=new Float64Array(18);#Ri;#Li;#ki;#Ni;#Fi;#Nt;#Ii=[];static#Bi=8;static#ji=2;static#Hi=FreeOutliner.#Bi+FreeOutliner.#ji;constructor({x:e,y:t},r,n,i,s,o=0){this.#bi=r,this.#Nt=i*n,this.#Ti=s,this.#Oi.set([NaN,NaN,NaN,NaN,e,t],6),this.#Ai=o,this.#Ni=FreeOutliner.#Bi*n,this.#ki=FreeOutliner.#Hi*n,this.#Fi=n,this.#Ii.push(e,t)}get free(){return!0}isEmpty(){return isNaN(this.#Oi[8])}#Ui(){const e=this.#Oi.subarray(4,6),t=this.#Oi.subarray(16,18),[r,n,i,s]=this.#bi;return[(this.#Ri+(e[0]-t[0])/2-r)/i,(this.#Li+(e[1]-t[1])/2-n)/s,(this.#Ri+(t[0]-e[0])/2-r)/i,(this.#Li+(t[1]-e[1])/2-n)/s]}add({x:e,y:t}){this.#Ri=e,this.#Li=t;const[r,n,i,s]=this.#bi;let[o,a,l,c]=this.#Oi.subarray(8,12);const u=e-l,d=t-c,h=Math.hypot(u,d);if(h<this.#ki)return!1;const p=h-this.#Ni,m=p/h,f=m*u,g=m*d;let y=o,b=a;o=l,a=c,l+=f,c+=g,this.#Ii?.push(e,t);const v=f/p,_=-g/p*this.#Nt,x=v*this.#Nt;if(this.#Oi.set(this.#Oi.subarray(2,8),0),this.#Oi.set([l+_,c+x],4),this.#Oi.set(this.#Oi.subarray(14,18),12),this.#Oi.set([l-_,c-x],16),isNaN(this.#Oi[6]))return 0===this.#Di.length&&(this.#Oi.set([o+_,a+x],2),this.#Di.push(NaN,NaN,NaN,NaN,(o+_-r)/i,(a+x-n)/s),this.#Oi.set([o-_,a-x],14),this.#Ci.push(NaN,NaN,NaN,NaN,(o-_-r)/i,(a-x-n)/s)),this.#Oi.set([y,b,o,a,l,c],6),!this.isEmpty();this.#Oi.set([y,b,o,a,l,c],6);return Math.abs(Math.atan2(b-a,y-o)-Math.atan2(g,f))<Math.PI/2?([o,a,l,c]=this.#Oi.subarray(2,6),this.#Di.push(NaN,NaN,NaN,NaN,((o+l)/2-r)/i,((a+c)/2-n)/s),[o,a,y,b]=this.#Oi.subarray(14,18),this.#Ci.push(NaN,NaN,NaN,NaN,((y+o)/2-r)/i,((b+a)/2-n)/s),!0):([y,b,o,a,l,c]=this.#Oi.subarray(0,6),this.#Di.push(((y+5*o)/6-r)/i,((b+5*a)/6-n)/s,((5*o+l)/6-r)/i,((5*a+c)/6-n)/s,((o+l)/2-r)/i,((a+c)/2-n)/s),[l,c,o,a,y,b]=this.#Oi.subarray(12,18),this.#Ci.push(((y+5*o)/6-r)/i,((b+5*a)/6-n)/s,((5*o+l)/6-r)/i,((5*a+c)/6-n)/s,((o+l)/2-r)/i,((a+c)/2-n)/s),!0)}toSVGPath(){if(this.isEmpty())return"";const e=this.#Di,t=this.#Ci,r=this.#Oi.subarray(4,6),n=this.#Oi.subarray(16,18),[i,s,o,a]=this.#bi,[l,c,u,d]=this.#Ui();if(isNaN(this.#Oi[6])&&!this.isEmpty())return`M${(this.#Oi[2]-i)/o} ${(this.#Oi[3]-s)/a} L${(this.#Oi[4]-i)/o} ${(this.#Oi[5]-s)/a} L${l} ${c} L${u} ${d} L${(this.#Oi[16]-i)/o} ${(this.#Oi[17]-s)/a} L${(this.#Oi[14]-i)/o} ${(this.#Oi[15]-s)/a} Z`;const h=[];h.push(`M${e[4]} ${e[5]}`);for(let t=6;t<e.length;t+=6)isNaN(e[t])?h.push(`L${e[t+4]} ${e[t+5]}`):h.push(`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`);h.push(`L${(r[0]-i)/o} ${(r[1]-s)/a} L${l} ${c} L${u} ${d} L${(n[0]-i)/o} ${(n[1]-s)/a}`);for(let e=t.length-6;e>=6;e-=6)isNaN(t[e])?h.push(`L${t[e+4]} ${t[e+5]}`):h.push(`C${t[e]} ${t[e+1]} ${t[e+2]} ${t[e+3]} ${t[e+4]} ${t[e+5]}`);return h.push(`L${t[4]} ${t[5]} Z`),h.join(" ")}getOutlines(){const e=this.#Di,t=this.#Ci,r=this.#Oi,n=r.subarray(4,6),i=r.subarray(16,18),[s,o,a,l]=this.#bi,c=new Float64Array((this.#Ii?.length??0)+2);for(let e=0,t=c.length-2;e<t;e+=2)c[e]=(this.#Ii[e]-s)/a,c[e+1]=(this.#Ii[e+1]-o)/l;c[c.length-2]=(this.#Ri-s)/a,c[c.length-1]=(this.#Li-o)/l;const[u,d,h,p]=this.#Ui();if(isNaN(r[6])&&!this.isEmpty()){const e=new Float64Array(36);return e.set([NaN,NaN,NaN,NaN,(r[2]-s)/a,(r[3]-o)/l,NaN,NaN,NaN,NaN,(r[4]-s)/a,(r[5]-o)/l,NaN,NaN,NaN,NaN,u,d,NaN,NaN,NaN,NaN,h,p,NaN,NaN,NaN,NaN,(r[16]-s)/a,(r[17]-o)/l,NaN,NaN,NaN,NaN,(r[14]-s)/a,(r[15]-o)/l],0),new FreeHighlightOutline(e,c,this.#bi,this.#Fi,this.#Ai,this.#Ti)}const m=new Float64Array(this.#Di.length+24+this.#Ci.length);let f=e.length;for(let t=0;t<f;t+=2)isNaN(e[t])?m[t]=m[t+1]=NaN:(m[t]=e[t],m[t+1]=e[t+1]);m.set([NaN,NaN,NaN,NaN,(n[0]-s)/a,(n[1]-o)/l,NaN,NaN,NaN,NaN,u,d,NaN,NaN,NaN,NaN,h,p,NaN,NaN,NaN,NaN,(i[0]-s)/a,(i[1]-o)/l],f),f+=24;for(let e=t.length-6;e>=6;e-=6)for(let r=0;r<6;r+=2)isNaN(t[e+r])?(m[f]=m[f+1]=NaN,f+=2):(m[f]=t[e+r],m[f+1]=t[e+r+1],f+=2);return m.set([NaN,NaN,NaN,NaN,t[4],t[5]],f),new FreeHighlightOutline(m,c,this.#bi,this.#Fi,this.#Ai,this.#Ti)}}class FreeHighlightOutline extends Outline{#bi;#zi=null;#Ai;#Ti;#Ii;#Fi;#Gi;constructor(e,t,r,n,i,s){super(),this.#Gi=e,this.#Ii=t,this.#bi=r,this.#Fi=n,this.#Ai=i,this.#Ti=s,this.#Wi(s);const{x:o,y:a,width:l,height:c}=this.#zi;for(let t=0,r=e.length;t<r;t+=2)e[t]=(e[t]-o)/l,e[t+1]=(e[t+1]-a)/c;for(let e=0,r=t.length;e<r;e+=2)t[e]=(t[e]-o)/l,t[e+1]=(t[e+1]-a)/c}toSVGPath(){const e=[`M${this.#Gi[4]} ${this.#Gi[5]}`];for(let t=6,r=this.#Gi.length;t<r;t+=6)isNaN(this.#Gi[t])?e.push(`L${this.#Gi[t+4]} ${this.#Gi[t+5]}`):e.push(`C${this.#Gi[t]} ${this.#Gi[t+1]} ${this.#Gi[t+2]} ${this.#Gi[t+3]} ${this.#Gi[t+4]} ${this.#Gi[t+5]}`);return e.push("Z"),e.join(" ")}serialize([e,t,r,n],i){const s=r-e,o=n-t;let a,l;switch(i){case 0:a=this.#Vi(this.#Gi,e,n,s,-o),l=this.#Vi(this.#Ii,e,n,s,-o);break;case 90:a=this.#qi(this.#Gi,e,t,s,o),l=this.#qi(this.#Ii,e,t,s,o);break;case 180:a=this.#Vi(this.#Gi,r,t,-s,o),l=this.#Vi(this.#Ii,r,t,-s,o);break;case 270:a=this.#qi(this.#Gi,r,n,-s,-o),l=this.#qi(this.#Ii,r,n,-s,-o)}return{outline:Array.from(a),points:[Array.from(l)]}}#Vi(e,t,r,n,i){const s=new Float64Array(e.length);for(let o=0,a=e.length;o<a;o+=2)s[o]=t+e[o]*n,s[o+1]=r+e[o+1]*i;return s}#qi(e,t,r,n,i){const s=new Float64Array(e.length);for(let o=0,a=e.length;o<a;o+=2)s[o]=t+e[o+1]*n,s[o+1]=r+e[o]*i;return s}#Wi(e){const t=this.#Gi;let r=t[4],i=t[5],s=r,o=i,a=r,l=i,c=r,u=i;const d=e?Math.max:Math.min;for(let e=6,h=t.length;e<h;e+=6){if(isNaN(t[e]))s=Math.min(s,t[e+4]),o=Math.min(o,t[e+5]),a=Math.max(a,t[e+4]),l=Math.max(l,t[e+5]),u<t[e+5]?(c=t[e+4],u=t[e+5]):u===t[e+5]&&(c=d(c,t[e+4]));else{const h=n.Util.bezierBoundingBox(r,i,...t.slice(e,e+6));s=Math.min(s,h[0]),o=Math.min(o,h[1]),a=Math.max(a,h[2]),l=Math.max(l,h[3]),u<h[3]?(c=h[2],u=h[3]):u===h[3]&&(c=d(c,h[2]))}r=t[e+4],i=t[e+5]}const h=s-this.#Ai,p=o-this.#Ai,m=a-s+2*this.#Ai,f=l-o+2*this.#Ai;this.#zi={x:h,y:p,width:m,height:f,lastPoint:[c,u]}}get box(){return this.#zi}getNewOutline(e,t){const{x:r,y:n,width:i,height:s}=this.#zi,[o,a,l,c]=this.#bi,u=i*l,d=s*c,h=r*l+o,p=n*c+a,m=new FreeOutliner({x:this.#Ii[0]*u+h,y:this.#Ii[1]*d+p},this.#bi,this.#Fi,e,this.#Ti,t??this.#Ai);for(let e=2;e<this.#Ii.length;e+=2)m.add({x:this.#Ii[e]*u+h,y:this.#Ii[e+1]*d+p});return m.getOutlines()}}},362:(e,t,r)=>{r.d(t,{EditorToolbar:()=>EditorToolbar,HighlightToolbar:()=>HighlightToolbar});var n=r(419);class EditorToolbar{#$i=null;#wt=null;#Pn;#Zi=null;constructor(e){this.#Pn=e}render(){const e=this.#$i=document.createElement("div");e.className="editToolbar",e.setAttribute("role","toolbar"),e.addEventListener("contextmenu",n.noContextMenu),e.addEventListener("pointerdown",EditorToolbar.#yn);const t=this.#Zi=document.createElement("div");t.className="buttons",e.append(t);const r=this.#Pn.toolbarPosition;if(r){const{style:t}=e,n="ltr"===this.#Pn._uiManager.direction?1-r[0]:r[0];t.insetInlineEnd=100*n+"%",t.top=`calc(${100*r[1]}% + var(--editor-toolbar-vert-offset))`}return this.#Ki(),e}static#yn(e){e.stopPropagation()}#Xi(e){this.#Pn._focusEventsAllowed=!1,e.preventDefault(),e.stopPropagation()}#Yi(e){this.#Pn._focusEventsAllowed=!0,e.preventDefault(),e.stopPropagation()}#Ji(e){e.addEventListener("focusin",this.#Xi.bind(this),{capture:!0}),e.addEventListener("focusout",this.#Yi.bind(this),{capture:!0}),e.addEventListener("contextmenu",n.noContextMenu)}hide(){this.#$i.classList.add("hidden"),this.#wt?.hideDropdown()}show(){this.#$i.classList.remove("hidden")}#Ki(){const e=document.createElement("button");e.className="delete",e.tabIndex=0,e.setAttribute("data-l10n-id",`pdfjs-editor-remove-${this.#Pn.editorType}-button`),this.#Ji(e),e.addEventListener("click",(e=>{this.#Pn._uiManager.delete()})),this.#Zi.append(e)}get#Qi(){const e=document.createElement("div");return e.className="divider",e}addAltTextButton(e){this.#Ji(e),this.#Zi.prepend(e,this.#Qi)}addColorPicker(e){this.#wt=e;const t=e.renderButton();this.#Ji(t),this.#Zi.prepend(t,this.#Qi)}remove(){this.#$i.remove(),this.#wt?.destroy(),this.#wt=null}}class HighlightToolbar{#Zi=null;#$i=null;#cn;constructor(e){this.#cn=e}#es(){const e=this.#$i=document.createElement("div");e.className="editToolbar",e.setAttribute("role","toolbar"),e.addEventListener("contextmenu",n.noContextMenu);const t=this.#Zi=document.createElement("div");return t.className="buttons",e.append(t),this.#ts(),e}#rs(e,t){let r=0,n=0;for(const i of e){const e=i.y+i.height;if(e<r)continue;const s=i.x+(t?i.width:0);e>r?(n=s,r=e):t?s>n&&(n=s):s<n&&(n=s)}return[t?1-n:n,r]}show(e,t,r){const[n,i]=this.#rs(t,r),{style:s}=this.#$i||=this.#es();e.append(this.#$i),s.insetInlineEnd=100*n+"%",s.top=`calc(${100*i}% + var(--editor-toolbar-vert-offset))`}hide(){this.#$i.remove()}#ts(){const e=document.createElement("button");e.className="highlightButton",e.tabIndex=0,e.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");const t=document.createElement("span");e.append(t),t.className="visuallyHidden",t.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label"),e.addEventListener("contextmenu",n.noContextMenu),e.addEventListener("click",(()=>{this.#cn.highlightSelection("floating_button")})),this.#Zi.append(e)}}},830:(e,t,r)=>{r.d(t,{AnnotationEditorUIManager:()=>AnnotationEditorUIManager,ColorManager:()=>ColorManager,KeyboardManager:()=>KeyboardManager,bindEvents:()=>o,opacityToHex:()=>a});var n=r(292),i=r(419),s=r(362);function o(e,t,r){for(const n of r)t.addEventListener(n,e[n].bind(e))}function a(e){return Math.round(Math.min(255,Math.max(1,255*e))).toString(16).padStart(2,"0")}class IdManager{#He=0;constructor(){}get id(){return`${n.AnnotationEditorPrefix}${this.#He++}`}}class ImageManager{#ns=(0,n.getUuid)();#He=0;#Ue=null;static get _isSVGFittingCanvas(){const e=new OffscreenCanvas(1,3).getContext("2d"),t=new Image;t.src='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>';const r=t.decode().then((()=>(e.drawImage(t,0,0,1,1,0,0,1,3),0===new Uint32Array(e.getImageData(0,0,1,1).data.buffer)[0])));return(0,n.shadow)(this,"_isSVGFittingCanvas",r)}async#is(e,t){this.#Ue||=new Map;let r=this.#Ue.get(e);if(null===r)return null;if(r?.bitmap)return r.refCounter+=1,r;try{let e;if(r||={bitmap:null,id:`image_${this.#ns}_${this.#He++}`,refCounter:0,isSvg:!1},"string"==typeof t?(r.url=t,e=await(0,i.fetchData)(t,"blob")):e=r.file=t,"image/svg+xml"===e.type){const t=ImageManager._isSVGFittingCanvas,n=new FileReader,i=new Image,s=new Promise(((e,s)=>{i.onload=()=>{r.bitmap=i,r.isSvg=!0,e()},n.onload=async()=>{const e=r.svgUrl=n.result;i.src=await t?`${e}#svgView(preserveAspectRatio(none))`:e},i.onerror=n.onerror=s}));n.readAsDataURL(e),await s}else r.bitmap=await createImageBitmap(e);r.refCounter=1}catch(e){console.error(e),r=null}return this.#Ue.set(e,r),r&&this.#Ue.set(r.id,r),r}async getFromFile(e){const{lastModified:t,name:r,size:n,type:i}=e;return this.#is(`${t}_${r}_${n}_${i}`,e)}async getFromUrl(e){return this.#is(e,e)}async getFromId(e){this.#Ue||=new Map;const t=this.#Ue.get(e);return t?t.bitmap?(t.refCounter+=1,t):t.file?this.getFromFile(t.file):this.getFromUrl(t.url):null}getSvgUrl(e){const t=this.#Ue.get(e);return t?.isSvg?t.svgUrl:null}deleteId(e){this.#Ue||=new Map;const t=this.#Ue.get(e);t&&(t.refCounter-=1,0===t.refCounter&&(t.bitmap=null))}isValidId(e){return e.startsWith(`image_${this.#ns}_`)}}class CommandManager{#ss=[];#os=!1;#as;#ls=-1;constructor(e=128){this.#as=e}add({cmd:e,undo:t,post:r,mustExec:n,type:i=NaN,overwriteIfSameType:s=!1,keepUndo:o=!1}){if(n&&e(),this.#os)return;const a={cmd:e,undo:t,post:r,type:i};if(-1===this.#ls)return this.#ss.length>0&&(this.#ss.length=0),this.#ls=0,void this.#ss.push(a);if(s&&this.#ss[this.#ls].type===i)return o&&(a.undo=this.#ss[this.#ls].undo),void(this.#ss[this.#ls]=a);const l=this.#ls+1;l===this.#as?this.#ss.splice(0,1):(this.#ls=l,l<this.#ss.length&&this.#ss.splice(l)),this.#ss.push(a)}undo(){if(-1===this.#ls)return;this.#os=!0;const{undo:e,post:t}=this.#ss[this.#ls];e(),t?.(),this.#os=!1,this.#ls-=1}redo(){if(this.#ls<this.#ss.length-1){this.#ls+=1,this.#os=!0;const{cmd:e,post:t}=this.#ss[this.#ls];e(),t?.(),this.#os=!1}}hasSomethingToUndo(){return-1!==this.#ls}hasSomethingToRedo(){return this.#ls<this.#ss.length-1}destroy(){this.#ss=null}}class KeyboardManager{constructor(e){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:t}=n.FeatureTest.platform;for(const[r,n,i={}]of e)for(const e of r){const r=e.startsWith("mac+");t&&r?(this.callbacks.set(e.slice(4),{callback:n,options:i}),this.allKeys.add(e.split("+").at(-1))):t||r||(this.callbacks.set(e,{callback:n,options:i}),this.allKeys.add(e.split("+").at(-1)))}}#cs(e){e.altKey&&this.buffer.push("alt"),e.ctrlKey&&this.buffer.push("ctrl"),e.metaKey&&this.buffer.push("meta"),e.shiftKey&&this.buffer.push("shift"),this.buffer.push(e.key);const t=this.buffer.join("+");return this.buffer.length=0,t}exec(e,t){if(!this.allKeys.has(t.key))return;const r=this.callbacks.get(this.#cs(t));if(!r)return;const{callback:n,options:{bubbles:i=!1,args:s=[],checker:o=null}}=r;o&&!o(e,t)||(n.bind(e,...s,t)(),i||(t.stopPropagation(),t.preventDefault()))}}class ColorManager{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const e=new Map([["CanvasText",null],["Canvas",null]]);return(0,i.getColorValues)(e),(0,n.shadow)(this,"_colors",e)}convert(e){const t=(0,i.getRGB)(e);if(!window.matchMedia("(forced-colors: active)").matches)return t;for(const[e,r]of this._colors)if(r.every(((e,r)=>e===t[r])))return ColorManager._colorsMapping.get(e);return t}getHexCode(e){const t=this._colors.get(e);return t?n.Util.makeHexColor(...t):e}}class AnnotationEditorUIManager{#us=null;#ds=new Map;#hs=new Map;#ps=null;#ms=null;#fs=null;#gs=new CommandManager;#ys=0;#bs=new Set;#vs=null;#un=null;#_s=new Set;#xs=!1;#ws=null;#Ss=null;#Ps=null;#Es=!1;#Ms=null;#Cs=new IdManager;#As=!1;#Ts=!1;#Ds=null;#Os=null;#Rs=null;#Ls=n.AnnotationEditorType.NONE;#ks=new Set;#Ns=null;#Fs=null;#Is=null;#Bs=this.blur.bind(this);#js=this.focus.bind(this);#Hs=this.copy.bind(this);#Us=this.cut.bind(this);#zs=this.paste.bind(this);#Tt=this.keydown.bind(this);#Gs=this.keyup.bind(this);#Ws=this.onEditingAction.bind(this);#Vs=this.onPageChanging.bind(this);#qs=this.onScaleChanging.bind(this);#$s=this.#Zs.bind(this);#Ks=this.onRotationChanging.bind(this);#Xs={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#Ys=[0,0];#Js=null;#U=null;#Qs=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){const e=AnnotationEditorUIManager.prototype,t=e=>e.#U.contains(document.activeElement)&&"BUTTON"!==document.activeElement.tagName&&e.hasSomethingToControl(),r=(e,{target:t})=>{if(t instanceof HTMLInputElement){const{type:e}=t;return"text"!==e&&"number"!==e}return!0},i=this.TRANSLATE_SMALL,s=this.TRANSLATE_BIG;return(0,n.shadow)(this,"_keyboardManager",new KeyboardManager([[["ctrl+a","mac+meta+a"],e.selectAll,{checker:r}],[["ctrl+z","mac+meta+z"],e.undo,{checker:r}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],e.redo,{checker:r}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],e.delete,{checker:r}],[["Enter","mac+Enter"],e.addNewEditorFromKeyboard,{checker:(e,{target:t})=>!(t instanceof HTMLButtonElement)&&e.#U.contains(t)&&!e.isEnterHandled}],[[" ","mac+ "],e.addNewEditorFromKeyboard,{checker:(e,{target:t})=>!(t instanceof HTMLButtonElement)&&e.#U.contains(document.activeElement)}],[["Escape","mac+Escape"],e.unselectAll],[["ArrowLeft","mac+ArrowLeft"],e.translateSelectedEditors,{args:[-i,0],checker:t}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e.translateSelectedEditors,{args:[-s,0],checker:t}],[["ArrowRight","mac+ArrowRight"],e.translateSelectedEditors,{args:[i,0],checker:t}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e.translateSelectedEditors,{args:[s,0],checker:t}],[["ArrowUp","mac+ArrowUp"],e.translateSelectedEditors,{args:[0,-i],checker:t}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e.translateSelectedEditors,{args:[0,-s],checker:t}],[["ArrowDown","mac+ArrowDown"],e.translateSelectedEditors,{args:[0,i],checker:t}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e.translateSelectedEditors,{args:[0,s],checker:t}]]))}constructor(e,t,r,n,s,o,a,l,c){this.#U=e,this.#Qs=t,this.#ps=r,this._eventBus=n,this._eventBus._on("editingaction",this.#Ws),this._eventBus._on("pagechanging",this.#Vs),this._eventBus._on("scalechanging",this.#qs),this._eventBus._on("rotationchanging",this.#Ks),this.#eo(),this.#to(),this.#ms=s.annotationStorage,this.#ws=s.filterFactory,this.#Fs=o,this.#Ps=a||null,this.#xs=l,this.#Rs=c||null,this.viewParameters={realScale:i.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1}destroy(){this.#ro(),this.#no(),this._eventBus._off("editingaction",this.#Ws),this._eventBus._off("pagechanging",this.#Vs),this._eventBus._off("scalechanging",this.#qs),this._eventBus._off("rotationchanging",this.#Ks);for(const e of this.#hs.values())e.destroy();this.#hs.clear(),this.#ds.clear(),this.#_s.clear(),this.#us=null,this.#ks.clear(),this.#gs.destroy(),this.#ps?.destroy(),this.#Ms?.hide(),this.#Ms=null,this.#Ss&&(clearTimeout(this.#Ss),this.#Ss=null),this.#Js&&(clearTimeout(this.#Js),this.#Js=null),this.#io()}async mlGuess(e){return this.#Rs?.guess(e)||null}get hasMLManager(){return!!this.#Rs}get hcmFilter(){return(0,n.shadow)(this,"hcmFilter",this.#Fs?this.#ws.addHCMFilter(this.#Fs.foreground,this.#Fs.background):"none")}get direction(){return(0,n.shadow)(this,"direction",getComputedStyle(this.#U).direction)}get highlightColors(){return(0,n.shadow)(this,"highlightColors",this.#Ps?new Map(this.#Ps.split(",").map((e=>e.split("=").map((e=>e.trim()))))):null)}get highlightColorNames(){return(0,n.shadow)(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,(e=>e.reverse()))):null)}setMainHighlightColorPicker(e){this.#Os=e}editAltText(e){this.#ps?.editAltText(this,e)}onPageChanging({pageNumber:e}){this.#ys=e-1}focusMainContainer(){this.#U.focus()}findParent(e,t){for(const r of this.#hs.values()){const{x:n,y:i,width:s,height:o}=r.div.getBoundingClientRect();if(e>=n&&e<=n+s&&t>=i&&t<=i+o)return r}return null}disableUserSelect(e=!1){this.#Qs.classList.toggle("noUserSelect",e)}addShouldRescale(e){this.#_s.add(e)}removeShouldRescale(e){this.#_s.delete(e)}onScaleChanging({scale:e}){this.commitOrRemove(),this.viewParameters.realScale=e*i.PixelsPerInch.PDF_TO_CSS_UNITS;for(const e of this.#_s)e.onScaleChanging()}onRotationChanging({pagesRotation:e}){this.commitOrRemove(),this.viewParameters.rotation=e}#so({anchorNode:e}){return e.nodeType===Node.TEXT_NODE?e.parentElement:e}highlightSelection(e=""){const t=document.getSelection();if(!t||t.isCollapsed)return;const{anchorNode:r,anchorOffset:i,focusNode:s,focusOffset:o}=t,a=t.toString(),l=this.#so(t).closest(".textLayer"),c=this.getSelectionBoxes(l);if(c){t.empty(),this.#Ls===n.AnnotationEditorType.NONE&&(this._eventBus.dispatch("showannotationeditorui",{source:this,mode:n.AnnotationEditorType.HIGHLIGHT}),this.showAllEditors("highlight",!0,!0));for(const t of this.#hs.values())if(t.hasTextLayer(l)){t.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:e,boxes:c,anchorNode:r,anchorOffset:i,focusNode:s,focusOffset:o,text:a});break}}}#oo(){const e=document.getSelection();if(!e||e.isCollapsed)return;const t=this.#so(e).closest(".textLayer"),r=this.getSelectionBoxes(t);r&&(this.#Ms||=new s.HighlightToolbar(this),this.#Ms.show(t,r,"ltr"===this.direction))}addToAnnotationStorage(e){e.isEmpty()||!this.#ms||this.#ms.has(e.id)||this.#ms.setValue(e.id,e)}#Zs(){const e=document.getSelection();if(!e||e.isCollapsed)return void(this.#Ns&&(this.#Ms?.hide(),this.#Ns=null,this.#ao({hasSelectedText:!1})));const{anchorNode:t}=e;if(t===this.#Ns)return;if(this.#so(e).closest(".textLayer")){if(this.#Ms?.hide(),this.#Ns=t,this.#ao({hasSelectedText:!0}),(this.#Ls===n.AnnotationEditorType.HIGHLIGHT||this.#Ls===n.AnnotationEditorType.NONE)&&(this.#Ls===n.AnnotationEditorType.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#Es=this.isShiftKeyDown,!this.isShiftKeyDown)){const e=t=>{"pointerup"===t.type&&0!==t.button||(window.removeEventListener("pointerup",e),window.removeEventListener("blur",e),"pointerup"===t.type&&this.#lo("main_toolbar"))};window.addEventListener("pointerup",e),window.addEventListener("blur",e)}}else this.#Ns&&(this.#Ms?.hide(),this.#Ns=null,this.#ao({hasSelectedText:!1}))}#lo(e=""){this.#Ls===n.AnnotationEditorType.HIGHLIGHT?this.highlightSelection(e):this.#xs&&this.#oo()}#eo(){document.addEventListener("selectionchange",this.#$s)}#io(){document.removeEventListener("selectionchange",this.#$s)}#co(){window.addEventListener("focus",this.#js),window.addEventListener("blur",this.#Bs)}#no(){window.removeEventListener("focus",this.#js),window.removeEventListener("blur",this.#Bs)}blur(){if(this.isShiftKeyDown=!1,this.#Es&&(this.#Es=!1,this.#lo("main_toolbar")),!this.hasSelection)return;const{activeElement:e}=document;for(const t of this.#ks)if(t.div.contains(e)){this.#Ds=[t,e],t._focusEventsAllowed=!1;break}}focus(){if(!this.#Ds)return;const[e,t]=this.#Ds;this.#Ds=null,t.addEventListener("focusin",(()=>{e._focusEventsAllowed=!0}),{once:!0}),t.focus()}#to(){window.addEventListener("keydown",this.#Tt),window.addEventListener("keyup",this.#Gs)}#ro(){window.removeEventListener("keydown",this.#Tt),window.removeEventListener("keyup",this.#Gs)}#uo(){document.addEventListener("copy",this.#Hs),document.addEventListener("cut",this.#Us),document.addEventListener("paste",this.#zs)}#do(){document.removeEventListener("copy",this.#Hs),document.removeEventListener("cut",this.#Us),document.removeEventListener("paste",this.#zs)}addEditListeners(){this.#to(),this.#uo()}removeEditListeners(){this.#ro(),this.#do()}copy(e){if(e.preventDefault(),this.#us?.commitOrRemove(),!this.hasSelection)return;const t=[];for(const e of this.#ks){const r=e.serialize(!0);r&&t.push(r)}0!==t.length&&e.clipboardData.setData("application/pdfjs",JSON.stringify(t))}cut(e){this.copy(e),this.delete()}paste(e){e.preventDefault();const{clipboardData:t}=e;for(const e of t.items)for(const t of this.#un)if(t.isHandlingMimeForPasting(e.type))return void t.paste(e,this.currentLayer);let r=t.getData("application/pdfjs");if(!r)return;try{r=JSON.parse(r)}catch(e){return void(0,n.warn)(`paste: "${e.message}".`)}if(!Array.isArray(r))return;this.unselectAll();const i=this.currentLayer;try{const e=[];for(const t of r){const r=i.deserialize(t);if(!r)return;e.push(r)}const t=()=>{for(const t of e)this.#ho(t);this.#po(e)},n=()=>{for(const t of e)t.remove()};this.addCommands({cmd:t,undo:n,mustExec:!0})}catch(e){(0,n.warn)(`paste: "${e.message}".`)}}keydown(e){this.isShiftKeyDown||"Shift"!==e.key||(this.isShiftKeyDown=!0),this.#Ls===n.AnnotationEditorType.NONE||this.isEditorHandlingKeyboard||AnnotationEditorUIManager._keyboardManager.exec(this,e)}keyup(e){this.isShiftKeyDown&&"Shift"===e.key&&(this.isShiftKeyDown=!1,this.#Es&&(this.#Es=!1,this.#lo("main_toolbar")))}onEditingAction({name:e}){switch(e){case"undo":case"redo":case"delete":case"selectAll":this[e]();break;case"highlightSelection":this.highlightSelection("context_menu")}}#ao(e){Object.entries(e).some((([e,t])=>this.#Xs[e]!==t))&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#Xs,e)}),this.#Ls===n.AnnotationEditorType.HIGHLIGHT&&!1===e.hasSelectedEditor&&this.#mo([[n.AnnotationEditorParamsType.HIGHLIGHT_FREE,!0]]))}#mo(e){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:e})}setEditingState(e){e?(this.#co(),this.#uo(),this.#ao({isEditing:this.#Ls!==n.AnnotationEditorType.NONE,isEmpty:this.#fo(),hasSomethingToUndo:this.#gs.hasSomethingToUndo(),hasSomethingToRedo:this.#gs.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#no(),this.#do(),this.#ao({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!this.#un){this.#un=e;for(const e of this.#un)this.#mo(e.defaultPropertiesToUpdate)}}getId(){return this.#Cs.id}get currentLayer(){return this.#hs.get(this.#ys)}getLayer(e){return this.#hs.get(e)}get currentPageIndex(){return this.#ys}addLayer(e){this.#hs.set(e.pageIndex,e),this.#As?e.enable():e.disable()}removeLayer(e){this.#hs.delete(e.pageIndex)}updateMode(e,t=null,r=!1){if(this.#Ls!==e){if(this.#Ls=e,e===n.AnnotationEditorType.NONE)return this.setEditingState(!1),void this.#go();this.setEditingState(!0),this.#yo(),this.unselectAll();for(const t of this.#hs.values())t.updateMode(e);if(t||!r){if(t)for(const e of this.#ds.values())if(e.annotationElementId===t){this.setSelected(e),e.enterInEditMode();break}}else this.addNewEditorFromKeyboard()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(e){e!==this.#Ls&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:e})}updateParams(e,t){if(this.#un){switch(e){case n.AnnotationEditorParamsType.CREATE:return void this.currentLayer.addNewEditor();case n.AnnotationEditorParamsType.HIGHLIGHT_DEFAULT_COLOR:this.#Os?.updateColor(t);break;case n.AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#Is||=new Map).set(e,t),this.showAllEditors("highlight",t)}for(const r of this.#ks)r.updateParams(e,t);for(const r of this.#un)r.updateDefaultParams(e,t)}}showAllEditors(e,t,r=!1){for(const r of this.#ds.values())r.editorType===e&&r.show(t);(this.#Is?.get(n.AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL)??!0)!==t&&this.#mo([[n.AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL,t]])}enableWaiting(e=!1){if(this.#Ts!==e){this.#Ts=e;for(const t of this.#hs.values())e?t.disableClick():t.enableClick(),t.div.classList.toggle("waiting",e)}}#yo(){if(!this.#As){this.#As=!0;for(const e of this.#hs.values())e.enable();for(const e of this.#ds.values())e.enable()}}#go(){if(this.unselectAll(),this.#As){this.#As=!1;for(const e of this.#hs.values())e.disable();for(const e of this.#ds.values())e.disable()}}getEditors(e){const t=[];for(const r of this.#ds.values())r.pageIndex===e&&t.push(r);return t}getEditor(e){return this.#ds.get(e)}addEditor(e){this.#ds.set(e.id,e)}removeEditor(e){e.div.contains(document.activeElement)&&(this.#Ss&&clearTimeout(this.#Ss),this.#Ss=setTimeout((()=>{this.focusMainContainer(),this.#Ss=null}),0)),this.#ds.delete(e.id),this.unselect(e),e.annotationElementId&&this.#bs.has(e.annotationElementId)||this.#ms?.remove(e.id)}addDeletedAnnotationElement(e){this.#bs.add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}isDeletedAnnotationElement(e){return this.#bs.has(e)}removeDeletedAnnotationElement(e){this.#bs.delete(e.annotationElementId),this.removeChangedExistingAnnotation(e),e.deleted=!1}#ho(e){const t=this.#hs.get(e.pageIndex);t?t.addOrRebuild(e):(this.addEditor(e),this.addToAnnotationStorage(e))}setActiveEditor(e){this.#us!==e&&(this.#us=e,e&&this.#mo(e.propertiesToUpdate))}get#bo(){let e=null;for(e of this.#ks);return e}updateUI(e){this.#bo===e&&this.#mo(e.propertiesToUpdate)}toggleSelected(e){if(this.#ks.has(e))return this.#ks.delete(e),e.unselect(),void this.#ao({hasSelectedEditor:this.hasSelection});this.#ks.add(e),e.select(),this.#mo(e.propertiesToUpdate),this.#ao({hasSelectedEditor:!0})}setSelected(e){for(const t of this.#ks)t!==e&&t.unselect();this.#ks.clear(),this.#ks.add(e),e.select(),this.#mo(e.propertiesToUpdate),this.#ao({hasSelectedEditor:!0})}isSelected(e){return this.#ks.has(e)}get firstSelectedEditor(){return this.#ks.values().next().value}unselect(e){e.unselect(),this.#ks.delete(e),this.#ao({hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==this.#ks.size}get isEnterHandled(){return 1===this.#ks.size&&this.firstSelectedEditor.isEnterHandled}undo(){this.#gs.undo(),this.#ao({hasSomethingToUndo:this.#gs.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#fo()})}redo(){this.#gs.redo(),this.#ao({hasSomethingToUndo:!0,hasSomethingToRedo:this.#gs.hasSomethingToRedo(),isEmpty:this.#fo()})}addCommands(e){this.#gs.add(e),this.#ao({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#fo()})}#fo(){if(0===this.#ds.size)return!0;if(1===this.#ds.size)for(const e of this.#ds.values())return e.isEmpty();return!1}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const e=[...this.#ks];this.addCommands({cmd:()=>{for(const t of e)t.remove()},undo:()=>{for(const t of e)this.#ho(t)},mustExec:!0})}commitOrRemove(){this.#us?.commitOrRemove()}hasSomethingToControl(){return this.#us||this.hasSelection}#po(e){for(const e of this.#ks)e.unselect();this.#ks.clear();for(const t of e)t.isEmpty()||(this.#ks.add(t),t.select());this.#ao({hasSelectedEditor:this.hasSelection})}selectAll(){for(const e of this.#ks)e.commit();this.#po(this.#ds.values())}unselectAll(){if((!this.#us||(this.#us.commitOrRemove(),this.#Ls===n.AnnotationEditorType.NONE))&&this.hasSelection){for(const e of this.#ks)e.unselect();this.#ks.clear(),this.#ao({hasSelectedEditor:!1})}}translateSelectedEditors(e,t,r=!1){if(r||this.commitOrRemove(),!this.hasSelection)return;this.#Ys[0]+=e,this.#Ys[1]+=t;const[n,i]=this.#Ys,s=[...this.#ks];this.#Js&&clearTimeout(this.#Js),this.#Js=setTimeout((()=>{this.#Js=null,this.#Ys[0]=this.#Ys[1]=0,this.addCommands({cmd:()=>{for(const e of s)this.#ds.has(e.id)&&e.translateInPage(n,i)},undo:()=>{for(const e of s)this.#ds.has(e.id)&&e.translateInPage(-n,-i)},mustExec:!1})}),1e3);for(const r of s)r.translateInPage(e,t)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#vs=new Map;for(const e of this.#ks)this.#vs.set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#vs)return!1;this.disableUserSelect(!1);const e=this.#vs;this.#vs=null;let t=!1;for(const[{x:r,y:n,pageIndex:i},s]of e)s.newX=r,s.newY=n,s.newPageIndex=i,t||=r!==s.savedX||n!==s.savedY||i!==s.savedPageIndex;if(!t)return!1;const r=(e,t,r,n)=>{if(this.#ds.has(e.id)){const i=this.#hs.get(n);i?e._setParentAndPosition(i,t,r):(e.pageIndex=n,e.x=t,e.y=r)}};return this.addCommands({cmd:()=>{for(const[t,{newX:n,newY:i,newPageIndex:s}]of e)r(t,n,i,s)},undo:()=>{for(const[t,{savedX:n,savedY:i,savedPageIndex:s}]of e)r(t,n,i,s)},mustExec:!0}),!0}dragSelectedEditors(e,t){if(this.#vs)for(const r of this.#vs.keys())r.drag(e,t)}rebuild(e){if(null===e.parent){const t=this.getLayer(e.pageIndex);t?(t.changeParent(e),t.addOrRebuild(e)):(this.addEditor(e),this.addToAnnotationStorage(e),e.rebuild())}else e.parent.addOrRebuild(e)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||1===this.#ks.size&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(e){return this.#us===e}getActive(){return this.#us}getMode(){return this.#Ls}get imageManager(){return(0,n.shadow)(this,"imageManager",new ImageManager)}getSelectionBoxes(e){if(!e)return null;const t=document.getSelection();for(let r=0,n=t.rangeCount;r<n;r++)if(!e.contains(t.getRangeAt(r).commonAncestorContainer))return null;const{x:r,y:n,width:i,height:s}=e.getBoundingClientRect();let o;switch(e.getAttribute("data-main-rotation")){case"90":o=(e,t,o,a)=>({x:(t-n)/s,y:1-(e+o-r)/i,width:a/s,height:o/i});break;case"180":o=(e,t,o,a)=>({x:1-(e+o-r)/i,y:1-(t+a-n)/s,width:o/i,height:a/s});break;case"270":o=(e,t,o,a)=>({x:1-(t+a-n)/s,y:(e-r)/i,width:a/s,height:o/i});break;default:o=(e,t,o,a)=>({x:(e-r)/i,y:(t-n)/s,width:o/i,height:a/s})}const a=[];for(let e=0,r=t.rangeCount;e<r;e++){const r=t.getRangeAt(e);if(!r.collapsed)for(const{x:e,y:t,width:n,height:i}of r.getClientRects())0!==n&&0!==i&&a.push(o(e,t,n,i))}return 0===a.length?null:a}addChangedExistingAnnotation({annotationElementId:e,id:t}){(this.#fs||=new Map).set(e,t)}removeChangedExistingAnnotation({annotationElementId:e}){this.#fs?.delete(e)}renderAnnotationElement(e){const t=this.#fs?.get(e.data.id);if(!t)return;const r=this.#ms.getRawValue(t);r&&(this.#Ls!==n.AnnotationEditorType.NONE||r.hasBeenModified)&&r.renderAnnotationElement(e)}}},94:(e,t,r)=>{r.d(t,{PDFFetchStream:()=>PDFFetchStream});var n=r(292),i=r(490);function s(e,t,r){return{method:"GET",headers:e,signal:r.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function o(e){const t=new Headers;for(const r in e){const n=e[r];void 0!==n&&t.append(r,n)}return t}function a(e){return e instanceof Uint8Array?e.buffer:e instanceof ArrayBuffer?e:((0,n.warn)(`getArrayBuffer - unexpected data format: ${e}`),new Uint8Array(e).buffer)}class PDFFetchStream{constructor(e){this.source=e,this.isHttp=/^https?:/i.test(e.url),this.httpHeaders=this.isHttp&&e.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return(0,n.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new PDFFetchStreamReader(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const r=new PDFFetchStreamRangeReader(this,e,t);return this._rangeRequestReaders.push(r),r}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}}class PDFFetchStreamReader{constructor(e){this._stream=e,this._reader=null,this._loaded=0,this._filename=null;const t=e.source;this._withCredentials=t.withCredentials||!1,this._contentLength=t.length,this._headersCapability=Promise.withResolvers(),this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._headers=o(this._stream.httpHeaders);const r=t.url;fetch(r,s(this._headers,this._withCredentials,this._abortController)).then((e=>{if(!(0,i.validateResponseStatus)(e.status))throw(0,i.createResponseStatusError)(e.status,r);this._reader=e.body.getReader(),this._headersCapability.resolve();const t=t=>e.headers.get(t),{allowRangeRequests:s,suggestedLength:o}=(0,i.validateRangeRequestCapabilities)({getResponseHeader:t,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=s,this._contentLength=o||this._contentLength,this._filename=(0,i.extractFilenameFromHeader)(t),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new n.AbortException("Streaming is disabled."))})).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;const{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:a(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}}class PDFFetchStreamRangeReader{constructor(e,t,r){this._stream=e,this._reader=null,this._loaded=0;const n=e.source;this._withCredentials=n.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!n.disableStream,this._abortController=new AbortController,this._headers=o(this._stream.httpHeaders),this._headers.append("Range",`bytes=${t}-${r-1}`);const a=n.url;fetch(a,s(this._headers,this._withCredentials,this._abortController)).then((e=>{if(!(0,i.validateResponseStatus)(e.status))throw(0,i.createResponseStatusError)(e.status,a);this._readCapability.resolve(),this._reader=e.body.getReader()})).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded}),{value:a(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}}},10:(e,t,r)=>{r.d(t,{FontFaceObject:()=>FontFaceObject,FontLoader:()=>FontLoader});var n=r(292);class FontLoader{#vo=new Set;constructor({ownerDocument:e=globalThis.document,styleElement:t=null}){this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(e){this.nativeFontFaces.add(e),this._document.fonts.add(e)}removeNativeFontFace(e){this.nativeFontFaces.delete(e),this._document.fonts.delete(e)}insertRule(e){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const t=this.styleElement.sheet;t.insertRule(e,t.cssRules.length)}clear(){for(const e of this.nativeFontFaces)this._document.fonts.delete(e);this.nativeFontFaces.clear(),this.#vo.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:e,_inspectFont:t}){if(e&&!this.#vo.has(e.loadedName))if((0,n.assert)(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:r,src:i,style:s}=e,o=new FontFace(r,i,s);this.addNativeFontFace(o);try{await o.load(),this.#vo.add(r),t?.(e)}catch{(0,n.warn)(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(o)}}else(0,n.unreachable)("Not implemented: loadSystemFont without the Font Loading API.")}async bind(e){if(e.attached||e.missingFile&&!e.systemFontInfo)return;if(e.attached=!0,e.systemFontInfo)return void await this.loadSystemFont(e);if(this.isFontLoadingAPISupported){const t=e.createNativeFontFace();if(t){this.addNativeFontFace(t);try{await t.loaded}catch(r){throw(0,n.warn)(`Failed to load font '${t.family}': '${r}'.`),e.disableFontFace=!0,r}}return}const t=e.createFontFaceRule();if(t){if(this.insertRule(t),this.isSyncFontLoadingSupported)return;await new Promise((t=>{const r=this._queueLoadingCallback(t);this._prepareFontLoadEvent(e,r)}))}}get isFontLoadingAPISupported(){const e=!!this._document?.fonts;return(0,n.shadow)(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){let e=!1;return(n.isNodeJS||"undefined"!=typeof navigator&&"string"==typeof navigator?.userAgent&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(e=!0),(0,n.shadow)(this,"isSyncFontLoadingSupported",e)}_queueLoadingCallback(e){const{loadingRequests:t}=this,r={done:!1,complete:function(){for((0,n.assert)(!r.done,"completeRequest() cannot be called twice."),r.done=!0;t.length>0&&t[0].done;){const e=t.shift();setTimeout(e.callback,0)}},callback:e};return t.push(r),r}get _loadTestFont(){const e=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,n.shadow)(this,"_loadTestFont",e)}_prepareFontLoadEvent(e,t){function r(e,t){return e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|255&e.charCodeAt(t+3)}function i(e,t,r,n){return e.substring(0,t)+n+e.substring(t+r)}let s,o;const a=this._document.createElement("canvas");a.width=1,a.height=1;const l=a.getContext("2d");let c=0;const u=`lt${Date.now()}${this.loadTestFontId++}`;let d=this._loadTestFont;d=i(d,976,u.length,u);const h=1482184792;let p=r(d,16);for(s=0,o=u.length-3;s<o;s+=4)p=p-h+r(u,s)|0;s<u.length&&(p=p-h+r(u+"XXX",s)|0),d=i(d,16,4,(0,n.string32)(p));const m=`@font-face {font-family:"${u}";src:${`url(data:font/opentype;base64,${btoa(d)});`}}`;this.insertRule(m);const f=this._document.createElement("div");f.style.visibility="hidden",f.style.width=f.style.height="10px",f.style.position="absolute",f.style.top=f.style.left="0px";for(const t of[e.loadedName,u]){const e=this._document.createElement("span");e.textContent="Hi",e.style.fontFamily=t,f.append(e)}this._document.body.append(f),function e(t,r){if(++c>30)return(0,n.warn)("Load test font never loaded."),void r();l.font="30px "+t,l.fillText(".",0,20),l.getImageData(0,0,1,1).data[3]>0?r():setTimeout(e.bind(null,t,r))}(u,(()=>{f.remove(),t.complete()}))}}class FontFaceObject{constructor(e,{disableFontFace:t=!1,ignoreErrors:r=!1,inspectFont:n=null}){this.compiledGlyphs=Object.create(null);for(const t in e)this[t]=e[t];this.disableFontFace=!0===t,this.ignoreErrors=!0===r,this._inspectFont=n}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let e;if(this.cssFontInfo){const t={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(t.style=`oblique ${this.cssFontInfo.italicAngle}deg`),e=new FontFace(this.cssFontInfo.fontFamily,this.data,t)}else e=new FontFace(this.loadedName,this.data,{});return this._inspectFont?.(this),e}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const e=(0,n.bytesToString)(this.data),t=`url(data:${this.mimetype};base64,${btoa(e)});`;let r;if(this.cssFontInfo){let e=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(e+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),r=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${e}src:${t}}`}else r=`@font-face {font-family:"${this.loadedName}";src:${t}}`;return this._inspectFont?.(this,t),r}getPathGenerator(e,t){if(void 0!==this.compiledGlyphs[t])return this.compiledGlyphs[t];let r;try{r=e.get(this.loadedName+"_path_"+t)}catch(e){if(!this.ignoreErrors)throw e;(0,n.warn)(`getPathGenerator - ignoring character: "${e}".`)}if(!Array.isArray(r)||0===r.length)return this.compiledGlyphs[t]=function(e,t){};const i=[];for(let e=0,t=r.length;e<t;)switch(r[e++]){case n.FontRenderOps.BEZIER_CURVE_TO:{const[t,n,s,o,a,l]=r.slice(e,e+6);i.push((e=>e.bezierCurveTo(t,n,s,o,a,l))),e+=6}break;case n.FontRenderOps.MOVE_TO:{const[t,n]=r.slice(e,e+2);i.push((e=>e.moveTo(t,n))),e+=2}break;case n.FontRenderOps.LINE_TO:{const[t,n]=r.slice(e,e+2);i.push((e=>e.lineTo(t,n))),e+=2}break;case n.FontRenderOps.QUADRATIC_CURVE_TO:{const[t,n,s,o]=r.slice(e,e+4);i.push((e=>e.quadraticCurveTo(t,n,s,o))),e+=4}break;case n.FontRenderOps.RESTORE:i.push((e=>e.restore()));break;case n.FontRenderOps.SAVE:i.push((e=>e.save()));break;case n.FontRenderOps.SCALE:(0,n.assert)(2===i.length,"Scale command is only valid at the third position.");break;case n.FontRenderOps.TRANSFORM:{const[t,n,s,o,a,l]=r.slice(e,e+6);i.push((e=>e.transform(t,n,s,o,a,l))),e+=6}break;case n.FontRenderOps.TRANSLATE:{const[t,n]=r.slice(e,e+2);i.push((e=>e.translate(t,n))),e+=2}}return this.compiledGlyphs[t]=function(e,t){i[0](e),i[1](e),e.scale(t,-t);for(let t=2,r=i.length;t<r;t++)i[t](e)}}}},62:(e,t,r)=>{r.d(t,{Metadata:()=>Metadata});var n=r(292);class Metadata{#_o;#xo;constructor({parsedData:e,rawData:t}){this.#_o=e,this.#xo=t}getRaw(){return this.#xo}get(e){return this.#_o.get(e)??null}getAll(){return(0,n.objectFromMap)(this.#_o)}has(e){return this.#_o.has(e)}}},457:(e,t,r)=>{r.d(t,{PDFNetworkStream:()=>PDFNetworkStream});var n=r(292),i=r(490);class NetworkManager{constructor(e,t={}){this.url=e,this.isHttp=/^https?:/i.test(e),this.httpHeaders=this.isHttp&&t.httpHeaders||Object.create(null),this.withCredentials=t.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(e,t,r){const n={begin:e,end:t};for(const e in r)n[e]=r[e];return this.request(n)}requestFull(e){return this.request(e)}request(e){const t=new XMLHttpRequest,r=this.currXhrId++,n=this.pendingRequests[r]={xhr:t};t.open("GET",this.url),t.withCredentials=this.withCredentials;for(const e in this.httpHeaders){const r=this.httpHeaders[e];void 0!==r&&t.setRequestHeader(e,r)}return this.isHttp&&"begin"in e&&"end"in e?(t.setRequestHeader("Range",`bytes=${e.begin}-${e.end-1}`),n.expectedStatus=206):n.expectedStatus=200,t.responseType="arraybuffer",e.onError&&(t.onerror=function(r){e.onError(t.status)}),t.onreadystatechange=this.onStateChange.bind(this,r),t.onprogress=this.onProgress.bind(this,r),n.onHeadersReceived=e.onHeadersReceived,n.onDone=e.onDone,n.onError=e.onError,n.onProgress=e.onProgress,t.send(null),r}onProgress(e,t){const r=this.pendingRequests[e];r&&r.onProgress?.(t)}onStateChange(e,t){const r=this.pendingRequests[e];if(!r)return;const i=r.xhr;if(i.readyState>=2&&r.onHeadersReceived&&(r.onHeadersReceived(),delete r.onHeadersReceived),4!==i.readyState)return;if(!(e in this.pendingRequests))return;if(delete this.pendingRequests[e],0===i.status&&this.isHttp)return void r.onError?.(i.status);const s=i.status||200;if(!(200===s&&206===r.expectedStatus)&&s!==r.expectedStatus)return void r.onError?.(i.status);const o=function(e){const t=e.response;return"string"!=typeof t?t:(0,n.stringToBytes)(t).buffer}(i);if(206===s){const e=i.getResponseHeader("Content-Range"),t=/bytes (\d+)-(\d+)\/(\d+)/.exec(e);r.onDone({begin:parseInt(t[1],10),chunk:o})}else o?r.onDone({begin:0,chunk:o}):r.onError?.(i.status)}getRequestXhr(e){return this.pendingRequests[e].xhr}isPendingRequest(e){return e in this.pendingRequests}abortRequest(e){const t=this.pendingRequests[e].xhr;delete this.pendingRequests[e],t.abort()}}class PDFNetworkStream{constructor(e){this._source=e,this._manager=new NetworkManager(e.url,{httpHeaders:e.httpHeaders,withCredentials:e.withCredentials}),this._rangeChunkSize=e.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(e){const t=this._rangeRequestReaders.indexOf(e);t>=0&&this._rangeRequestReaders.splice(t,1)}getFullReader(){return(0,n.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new PDFNetworkStreamFullRequestReader(this._manager,this._source),this._fullRequestReader}getRangeReader(e,t){const r=new PDFNetworkStreamRangeRequestReader(this._manager,e,t);return r.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(r),r}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}}class PDFNetworkStreamFullRequestReader{constructor(e,t){this._manager=e;const r={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._fullRequestId=e.requestFull(r),this._headersReceivedCapability=Promise.withResolvers(),this._disableRange=t.disableRange||!1,this._contentLength=t.length,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const e=this._fullRequestId,t=this._manager.getRequestXhr(e),r=e=>t.getResponseHeader(e),{allowRangeRequests:n,suggestedLength:s}=(0,i.validateRangeRequestCapabilities)({getResponseHeader:r,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});n&&(this._isRangeSupported=!0),this._contentLength=s||this._contentLength,this._filename=(0,i.extractFilenameFromHeader)(r),this._isRangeSupported&&this._manager.abortRequest(e),this._headersReceivedCapability.resolve()}_onDone(e){if(e)if(this._requests.length>0){this._requests.shift().resolve({value:e.chunk,done:!1})}else this._cachedChunks.push(e.chunk);if(this._done=!0,!(this._cachedChunks.length>0)){for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(e){this._storedError=(0,i.createResponseStatusError)(e,this._url),this._headersReceivedCapability.reject(this._storedError);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(e){this.onProgress?.({loaded:e.loaded,total:e.lengthComputable?e.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0){return{value:this._cachedChunks.shift(),done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._headersReceivedCapability.reject(e);for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class PDFNetworkStreamRangeRequestReader{constructor(e,t,r){this._manager=e;const n={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url,this._requestId=e.requestRange(t,r,n),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){this.onClosed?.(this)}_onDone(e){const t=e.chunk;if(this._requests.length>0){this._requests.shift().resolve({value:t,done:!1})}else this._queuedChunk=t;this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(e){this._storedError=(0,i.createResponseStatusError)(e,this._url);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(e){this.isStreamingSupported||this.onProgress?.({loaded:e.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){const e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}},490:(e,t,r)=>{r.d(t,{createResponseStatusError:()=>a,extractFilenameFromHeader:()=>o,validateRangeRequestCapabilities:()=>s,validateResponseStatus:()=>l});var n=r(292);var i=r(419);function s({getResponseHeader:e,isHttp:t,rangeChunkSize:r,disableRange:n}){const i={allowRangeRequests:!1,suggestedLength:void 0},s=parseInt(e("Content-Length"),10);if(!Number.isInteger(s))return i;if(i.suggestedLength=s,s<=2*r)return i;if(n||!t)return i;if("bytes"!==e("Accept-Ranges"))return i;return"identity"!==(e("Content-Encoding")||"identity")||(i.allowRangeRequests=!0),i}function o(e){const t=e("Content-Disposition");if(t){let e=function(e){let t=!0,r=i("filename\\*","i").exec(e);if(r){r=r[1];let e=a(r);return e=unescape(e),e=l(e),e=c(e),o(e)}if(r=function(e){const t=[];let r;const n=i("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(r=n.exec(e));){let[,e,n,i]=r;if(e=parseInt(e,10),e in t){if(0===e)break}else t[e]=[n,i]}const s=[];for(let e=0;e<t.length&&e in t;++e){let[r,n]=t[e];n=a(n),r&&(n=unescape(n),0===e&&(n=l(n))),s.push(n)}return s.join("")}(e),r)return o(c(r));if(r=i("filename","i").exec(e),r){r=r[1];let e=a(r);return e=c(e),o(e)}function i(e,t){return new RegExp("(?:^|;)\\s*"+e+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',t)}function s(e,r){if(e){if(!/^[\x00-\xFF]+$/.test(r))return r;try{const i=new TextDecoder(e,{fatal:!0}),s=(0,n.stringToBytes)(r);r=i.decode(s),t=!1}catch{}}return r}function o(e){return t&&/[\x80-\xff]/.test(e)&&(e=s("utf-8",e),t&&(e=s("iso-8859-1",e))),e}function a(e){if(e.startsWith('"')){const t=e.slice(1).split('\\"');for(let e=0;e<t.length;++e){const r=t[e].indexOf('"');-1!==r&&(t[e]=t[e].slice(0,r),t.length=e+1),t[e]=t[e].replaceAll(/\\(.)/g,"$1")}e=t.join('"')}return e}function l(e){const t=e.indexOf("'");return-1===t?e:s(e.slice(0,t),e.slice(t+1).replace(/^[^']*'/,""))}function c(e){return!e.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(e)?e:e.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,(function(e,t,r,n){if("q"===r||"Q"===r)return s(t,n=(n=n.replaceAll("_"," ")).replaceAll(/=([0-9a-fA-F]{2})/g,(function(e,t){return String.fromCharCode(parseInt(t,16))})));try{n=atob(n)}catch{}return s(t,n)}))}return""}(t);if(e.includes("%"))try{e=decodeURIComponent(e)}catch{}if((0,i.isPdfFile)(e))return e}return null}function a(e,t){return 404===e||0===e&&t.startsWith("file:")?new n.MissingPDFException('Missing PDF "'+t+'".'):new n.UnexpectedResponseException(`Unexpected server response (${e}) while retrieving PDF "${t}".`,e)}function l(e){return 200===e||206===e}},786:(e,t,r)=>{r.a(e,(async(e,n)=>{try{let e=function(e){const t=u.parse(e);return"file:"===t.protocol||t.host?t:/^[a-z]:[/\\]/i.test(e)?u.parse(`file:///${e}`):(t.host||(t.protocol="file:"),t)},o=function(e,t){return{protocol:e.protocol,auth:e.auth,host:e.hostname,port:e.port,path:e.path,method:"GET",headers:t}};r.d(t,{PDFNodeStream:()=>PDFNodeStream});var i=r(292),s=r(490);let a,l,c,u;i.isNodeJS&&(a=await import("fs"),l=await import("http"),c=await import("https"),u=await import("url"));const d=/^file:\/\/\/[a-zA-Z]:\//;class PDFNodeStream{constructor(t){this.source=t,this.url=e(t.url),this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol,this.isFsUrl="file:"===this.url.protocol,this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return(0,i.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new PDFNodeStreamFsFullReader(this):new PDFNodeStreamFullReader(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const r=this.isFsUrl?new PDFNodeStreamFsRangeReader(this,e,t):new PDFNodeStreamRangeReader(this,e,t);return this._rangeRequestReaders.push(r),r}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}}class BaseFullReader{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null;const t=e.source;this._contentLength=t.length,this._loaded=0,this._filename=null,this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers()}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();if(null===e)return this._readCapability=Promise.withResolvers(),this.read();this._loaded+=e.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength});return{value:new Uint8Array(e).buffer,done:!1}}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",(()=>{this._readCapability.resolve()})),e.on("end",(()=>{e.destroy(),this._done=!0,this._readCapability.resolve()})),e.on("error",(e=>{this._error(e)})),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new i.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class BaseRangeReader{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const t=e.source;this._isStreamingSupported=!t.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();if(null===e)return this._readCapability=Promise.withResolvers(),this.read();this._loaded+=e.length,this.onProgress?.({loaded:this._loaded});return{value:new Uint8Array(e).buffer,done:!1}}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",(()=>{this._readCapability.resolve()})),e.on("end",(()=>{e.destroy(),this._done=!0,this._readCapability.resolve()})),e.on("error",(e=>{this._error(e)})),this._storedError&&this._readableStream.destroy(this._storedError)}}class PDFNodeStreamFullReader extends BaseFullReader{constructor(e){super(e);const t=t=>{if(404===t.statusCode){const e=new i.MissingPDFException(`Missing PDF "${this._url}".`);return this._storedError=e,void this._headersCapability.reject(e)}this._headersCapability.resolve(),this._setReadableStream(t);const r=e=>this._readableStream.headers[e.toLowerCase()],{allowRangeRequests:n,suggestedLength:o}=(0,s.validateRangeRequestCapabilities)({getResponseHeader:r,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=n,this._contentLength=o||this._contentLength,this._filename=(0,s.extractFilenameFromHeader)(r)};this._request=null,"http:"===this._url.protocol?this._request=l.request(o(this._url,e.httpHeaders),t):this._request=c.request(o(this._url,e.httpHeaders),t),this._request.on("error",(e=>{this._storedError=e,this._headersCapability.reject(e)})),this._request.end()}}class PDFNodeStreamRangeReader extends BaseRangeReader{constructor(e,t,r){super(e),this._httpHeaders={};for(const t in e.httpHeaders){const r=e.httpHeaders[t];void 0!==r&&(this._httpHeaders[t]=r)}this._httpHeaders.Range=`bytes=${t}-${r-1}`;const n=e=>{if(404!==e.statusCode)this._setReadableStream(e);else{const e=new i.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=e}};this._request=null,"http:"===this._url.protocol?this._request=l.request(o(this._url,this._httpHeaders),n):this._request=c.request(o(this._url,this._httpHeaders),n),this._request.on("error",(e=>{this._storedError=e})),this._request.end()}}class PDFNodeStreamFsFullReader extends BaseFullReader{constructor(e){super(e);let t=decodeURIComponent(this._url.path);d.test(this._url.href)&&(t=t.replace(/^\//,"")),a.promises.lstat(t).then((e=>{this._contentLength=e.size,this._setReadableStream(a.createReadStream(t)),this._headersCapability.resolve()}),(e=>{"ENOENT"===e.code&&(e=new i.MissingPDFException(`Missing PDF "${t}".`)),this._storedError=e,this._headersCapability.reject(e)}))}}class PDFNodeStreamFsRangeReader extends BaseRangeReader{constructor(e,t,r){super(e);let n=decodeURIComponent(this._url.path);d.test(this._url.href)&&(n=n.replace(/^\//,"")),this._setReadableStream(a.createReadStream(n,{start:t,end:r-1}))}}n()}catch(e){n(e)}}),1)},573:(e,t,r)=>{r.a(e,(async(e,n)=>{try{r.d(t,{NodeCMapReaderFactory:()=>NodeCMapReaderFactory,NodeCanvasFactory:()=>NodeCanvasFactory,NodeFilterFactory:()=>NodeFilterFactory,NodeStandardFontDataFactory:()=>NodeStandardFontDataFactory});var i=r(583);let e,s,o;if(r(292).isNodeJS){e=await import("fs");try{s=await import("canvas")}catch{}try{o=await import("path2d")}catch{}}const a=function(t){return e.promises.readFile(t).then((e=>new Uint8Array(e)))};class NodeFilterFactory extends i.BaseFilterFactory{}class NodeCanvasFactory extends i.BaseCanvasFactory{_createCanvas(e,t){return s.createCanvas(e,t)}}class NodeCMapReaderFactory extends i.BaseCMapReaderFactory{_fetchData(e,t){return a(e).then((e=>({cMapData:e,compressionType:t})))}}class NodeStandardFontDataFactory extends i.BaseStandardFontDataFactory{_fetchData(e){return a(e)}}n()}catch(e){n(e)}}),1)},626:(e,t,r)=>{r.d(t,{OptionalContentConfig:()=>OptionalContentConfig});var n=r(292),i=r(651);const s=Symbol("INTERNAL");class OptionalContentGroup{#wo=!1;#So=!1;#Po=!1;#Eo=!0;constructor(e,{name:t,intent:r,usage:i}){this.#wo=!!(e&n.RenderingIntentFlag.DISPLAY),this.#So=!!(e&n.RenderingIntentFlag.PRINT),this.name=t,this.intent=r,this.usage=i}get visible(){if(this.#Po)return this.#Eo;if(!this.#Eo)return!1;const{print:e,view:t}=this.usage;return this.#wo?"OFF"!==t?.viewState:!this.#So||"OFF"!==e?.printState}_setVisible(e,t,r=!1){e!==s&&(0,n.unreachable)("Internal method `_setVisible` called."),this.#Po=r,this.#Eo=t}}class OptionalContentConfig{#Mo=null;#Co=new Map;#Ao=null;#To=null;constructor(e,t=n.RenderingIntentFlag.DISPLAY){if(this.renderingIntent=t,this.name=null,this.creator=null,null!==e){this.name=e.name,this.creator=e.creator,this.#To=e.order;for(const r of e.groups)this.#Co.set(r.id,new OptionalContentGroup(t,r));if("OFF"===e.baseState)for(const e of this.#Co.values())e._setVisible(s,!1);for(const t of e.on)this.#Co.get(t)._setVisible(s,!0);for(const t of e.off)this.#Co.get(t)._setVisible(s,!1);this.#Ao=this.getHash()}}#Do(e){const t=e.length;if(t<2)return!0;const r=e[0];for(let i=1;i<t;i++){const t=e[i];let s;if(Array.isArray(t))s=this.#Do(t);else{if(!this.#Co.has(t))return(0,n.warn)(`Optional content group not found: ${t}`),!0;s=this.#Co.get(t).visible}switch(r){case"And":if(!s)return!1;break;case"Or":if(s)return!0;break;case"Not":return!s;default:return!0}}return"And"===r}isVisible(e){if(0===this.#Co.size)return!0;if(!e)return(0,n.info)("Optional content group not defined."),!0;if("OCG"===e.type)return this.#Co.has(e.id)?this.#Co.get(e.id).visible:((0,n.warn)(`Optional content group not found: ${e.id}`),!0);if("OCMD"===e.type){if(e.expression)return this.#Do(e.expression);if(!e.policy||"AnyOn"===e.policy){for(const t of e.ids){if(!this.#Co.has(t))return(0,n.warn)(`Optional content group not found: ${t}`),!0;if(this.#Co.get(t).visible)return!0}return!1}if("AllOn"===e.policy){for(const t of e.ids){if(!this.#Co.has(t))return(0,n.warn)(`Optional content group not found: ${t}`),!0;if(!this.#Co.get(t).visible)return!1}return!0}if("AnyOff"===e.policy){for(const t of e.ids){if(!this.#Co.has(t))return(0,n.warn)(`Optional content group not found: ${t}`),!0;if(!this.#Co.get(t).visible)return!0}return!1}if("AllOff"===e.policy){for(const t of e.ids){if(!this.#Co.has(t))return(0,n.warn)(`Optional content group not found: ${t}`),!0;if(this.#Co.get(t).visible)return!1}return!0}return(0,n.warn)(`Unknown optional content policy ${e.policy}.`),!0}return(0,n.warn)(`Unknown group type ${e.type}.`),!0}setVisibility(e,t=!0){const r=this.#Co.get(e);r?(r._setVisible(s,!!t,!0),this.#Mo=null):(0,n.warn)(`Optional content group not found: ${e}`)}setOCGState({state:e,preserveRB:t}){let r;for(const t of e){switch(t){case"ON":case"OFF":case"Toggle":r=t;continue}const e=this.#Co.get(t);if(e)switch(r){case"ON":e._setVisible(s,!0);break;case"OFF":e._setVisible(s,!1);break;case"Toggle":e._setVisible(s,!e.visible)}}this.#Mo=null}get hasInitialVisibility(){return null===this.#Ao||this.getHash()===this.#Ao}getOrder(){return this.#Co.size?this.#To?this.#To.slice():[...this.#Co.keys()]:null}getGroups(){return this.#Co.size>0?(0,n.objectFromMap)(this.#Co):null}getGroup(e){return this.#Co.get(e)||null}getHash(){if(null!==this.#Mo)return this.#Mo;const e=new i.MurmurHash3_64;for(const[t,r]of this.#Co)e.update(`${t}:${r.visible}`);return this.#Mo=e.hexdigest()}}},814:(e,t,r)=>{r.d(t,{cleanupTextLayer:()=>u,renderTextLayer:()=>p,updateTextLayer:()=>m});var n=r(292),i=r(419);const s=30,o=.8,a=new Map;let l=null;function c(){if(!l){const e=document.createElement("canvas");e.className="hiddenCanvasElement",document.body.append(e),l=e.getContext("2d",{alpha:!1})}return l}function u(){l?.canvas.remove(),l=null}function d(e,t,r){const i=document.createElement("span"),l={angle:0,canvasWidth:0,hasText:""!==t.str,hasEOL:t.hasEOL,fontSize:0};e._textDivs.push(i);const u=n.Util.transform(e._transform,t.transform);let d=Math.atan2(u[1],u[0]);const h=r[t.fontName];h.vertical&&(d+=Math.PI/2);const p=e._fontInspectorEnabled&&h.fontSubstitution||h.fontFamily,m=Math.hypot(u[2],u[3]),f=m*function(e){const t=a.get(e);if(t)return t;const r=c(),n=r.font;r.canvas.width=r.canvas.height=s,r.font=`${s}px ${e}`;const i=r.measureText("");let l=i.fontBoundingBoxAscent,u=Math.abs(i.fontBoundingBoxDescent);if(l){const t=l/(l+u);return a.set(e,t),r.canvas.width=r.canvas.height=0,r.font=n,t}r.strokeStyle="red",r.clearRect(0,0,s,s),r.strokeText("g",0,0);let d=r.getImageData(0,0,s,s).data;u=0;for(let e=d.length-1-3;e>=0;e-=4)if(d[e]>0){u=Math.ceil(e/4/s);break}r.clearRect(0,0,s,s),r.strokeText("A",0,s),d=r.getImageData(0,0,s,s).data,l=0;for(let e=0,t=d.length;e<t;e+=4)if(d[e]>0){l=s-Math.floor(e/4/s);break}if(r.canvas.width=r.canvas.height=0,r.font=n,l){const t=l/(l+u);return a.set(e,t),t}return a.set(e,o),o}(p);let g,y;0===d?(g=u[4],y=u[5]-f):(g=u[4]+f*Math.sin(d),y=u[5]-f*Math.cos(d));const b="calc(var(--scale-factor)*",v=i.style;e._container===e._rootContainer?(v.left=`${(100*g/e._pageWidth).toFixed(2)}%`,v.top=`${(100*y/e._pageHeight).toFixed(2)}%`):(v.left=`${b}${g.toFixed(2)}px)`,v.top=`${b}${y.toFixed(2)}px)`),v.fontSize=`${b}${m.toFixed(2)}px)`,v.fontFamily=p,l.fontSize=m,i.setAttribute("role","presentation"),i.textContent=t.str,i.dir=t.dir,e._fontInspectorEnabled&&(i.dataset.fontName=h.fontSubstitutionLoadedName||t.fontName),0!==d&&(l.angle=d*(180/Math.PI));let _=!1;if(t.str.length>1)_=!0;else if(" "!==t.str&&t.transform[0]!==t.transform[3]){const e=Math.abs(t.transform[0]),r=Math.abs(t.transform[3]);e!==r&&Math.max(e,r)/Math.min(e,r)>1.5&&(_=!0)}_&&(l.canvasWidth=h.vertical?t.height:t.width),e._textDivProperties.set(i,l),e._isReadableStream&&e._layoutText(i)}function h(e){const{div:t,scale:r,properties:n,ctx:i,prevFontSize:s,prevFontFamily:o}=e,{style:a}=t;let l="";if(0!==n.canvasWidth&&n.hasText){const{fontFamily:c}=a,{canvasWidth:u,fontSize:d}=n;s===d&&o===c||(i.font=`${d*r}px ${c}`,e.prevFontSize=d,e.prevFontFamily=c);const{width:h}=i.measureText(t.textContent);h>0&&(l=`scaleX(${u*r/h})`)}0!==n.angle&&(l=`rotate(${n.angle}deg) ${l}`),l.length>0&&(a.transform=l)}class TextLayerRenderTask{constructor({textContentSource:e,container:t,viewport:r,textDivs:n,textDivProperties:s,textContentItemsStr:o}){this._textContentSource=e,this._isReadableStream=e instanceof ReadableStream,this._container=this._rootContainer=t,this._textDivs=n||[],this._textContentItemsStr=o||[],this._fontInspectorEnabled=!!globalThis.FontInspector?.enabled,this._reader=null,this._textDivProperties=s||new WeakMap,this._canceled=!1,this._capability=Promise.withResolvers(),this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:r.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:c()};const{pageWidth:a,pageHeight:l,pageX:u,pageY:d}=r.rawDims;this._transform=[1,0,0,-1,-u,d+l],this._pageWidth=a,this._pageHeight=l,(0,i.setLayerDimensions)(t,r),this._capability.promise.finally((()=>{this._layoutTextParams=null})).catch((()=>{}))}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new n.AbortException("TextLayer task cancelled.")).catch((()=>{})),this._reader=null),this._capability.reject(new n.AbortException("TextLayer task cancelled."))}_processItems(e,t){for(const r of e)if(void 0!==r.str)this._textContentItemsStr.push(r.str),d(this,r,t);else if("beginMarkedContentProps"===r.type||"beginMarkedContent"===r.type){const e=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),null!==r.id&&this._container.setAttribute("id",`${r.id}`),e.append(this._container)}else"endMarkedContent"===r.type&&(this._container=this._container.parentNode)}_layoutText(e){const t=this._layoutTextParams.properties=this._textDivProperties.get(e);if(this._layoutTextParams.div=e,h(this._layoutTextParams),t.hasText&&this._container.append(e),t.hasEOL){const e=document.createElement("br");e.setAttribute("role","presentation"),this._container.append(e)}}_render(){const{promise:e,resolve:t,reject:r}=Promise.withResolvers();let n=Object.create(null);if(this._isReadableStream){const e=()=>{this._reader.read().then((({value:r,done:i})=>{i?t():(Object.assign(n,r.styles),this._processItems(r.items,n),e())}),r)};this._reader=this._textContentSource.getReader(),e()}else{if(!this._textContentSource)throw new Error('No "textContentSource" parameter specified.');{const{items:e,styles:r}=this._textContentSource;this._processItems(e,r),t()}}e.then((()=>{n=null,function(e){if(e._canceled)return;const t=e._textDivs,r=e._capability;if(t.length>1e5)r.resolve();else{if(!e._isReadableStream)for(const r of t)e._layoutText(r);r.resolve()}}(this)}),this._capability.reject)}}function p(e){const t=new TextLayerRenderTask(e);return t._render(),t}function m({container:e,viewport:t,textDivs:r,textDivProperties:n,mustRotate:s=!0,mustRescale:o=!0}){if(s&&(0,i.setLayerDimensions)(e,{rotation:t.rotation}),o){const e=c(),i={prevFontSize:null,prevFontFamily:null,div:null,scale:t.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:e};for(const e of r)i.properties=n.get(e),i.div=e,h(i)}}},585:(e,t,r)=>{r.d(t,{PDFDataTransportStream:()=>PDFDataTransportStream});var n=r(292),i=r(419);class PDFDataTransportStream{constructor(e,{disableRange:t=!1,disableStream:r=!1}){(0,n.assert)(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:i,initialData:s,progressiveDone:o,contentDispositionFilename:a}=e;if(this._queuedChunks=[],this._progressiveDone=o,this._contentDispositionFilename=a,s?.length>0){const e=s instanceof Uint8Array&&s.byteLength===s.buffer.byteLength?s.buffer:new Uint8Array(s).buffer;this._queuedChunks.push(e)}this._pdfDataRangeTransport=e,this._isStreamingSupported=!r,this._isRangeSupported=!t,this._contentLength=i,this._fullRequestReader=null,this._rangeReaders=[],e.addRangeListener(((e,t)=>{this._onReceiveData({begin:e,chunk:t})})),e.addProgressListener(((e,t)=>{this._onProgress({loaded:e,total:t})})),e.addProgressiveReadListener((e=>{this._onReceiveData({chunk:e})})),e.addProgressiveDoneListener((()=>{this._onProgressiveDone()})),e.transportReady()}_onReceiveData({begin:e,chunk:t}){const r=t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer;if(void 0===e)this._fullRequestReader?this._fullRequestReader._enqueue(r):this._queuedChunks.push(r);else{const t=this._rangeReaders.some((function(t){return t._begin===e&&(t._enqueue(r),!0)}));(0,n.assert)(t,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(e){void 0===e.total?this._rangeReaders[0]?.onProgress?.({loaded:e.loaded}):this._fullRequestReader?.onProgress?.({loaded:e.loaded,total:e.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(e){const t=this._rangeReaders.indexOf(e);t>=0&&this._rangeReaders.splice(t,1)}getFullReader(){(0,n.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const e=this._queuedChunks;return this._queuedChunks=null,new PDFDataTransportStreamReader(this,e,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const r=new PDFDataTransportStreamRangeReader(this,e,t);return this._pdfDataRangeTransport.requestDataRange(e,t),this._rangeReaders.push(r),r}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeReaders.slice(0))t.cancel(e);this._pdfDataRangeTransport.abort()}}class PDFDataTransportStreamReader{constructor(e,t,r=!1,n=null){this._stream=e,this._done=r||!1,this._filename=(0,i.isPdfFile)(n)?n:null,this._queuedChunks=t||[],this._loaded=0;for(const e of this._queuedChunks)this._loaded+=e.byteLength;this._requests=[],this._headersReady=Promise.resolve(),e._fullRequestReader=this,this.onProgress=null}_enqueue(e){if(!this._done){if(this._requests.length>0){this._requests.shift().resolve({value:e,done:!1})}else this._queuedChunks.push(e);this._loaded+=e.byteLength}}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0){return{value:this._queuedChunks.shift(),done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class PDFDataTransportStreamRangeReader{constructor(e,t,r){this._stream=e,this._begin=t,this._end=r,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(e){if(!this._done){if(0===this._requests.length)this._queuedChunk=e;else{this._requests.shift().resolve({value:e,done:!1});for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},164:(e,t,r)=>{r.d(t,{GlobalWorkerOptions:()=>GlobalWorkerOptions});class GlobalWorkerOptions{static#Oo=null;static#Ro="";static get workerPort(){return this.#Oo}static set workerPort(e){if(!("undefined"!=typeof Worker&&e instanceof Worker)&&null!==e)throw new Error("Invalid `workerPort` type.");this.#Oo=e}static get workerSrc(){return this.#Ro}static set workerSrc(e){if("string"!=typeof e)throw new Error("Invalid `workerSrc` type.");this.#Ro=e}}},284:(e,t,r)=>{r.d(t,{XfaLayer:()=>XfaLayer});var n=r(50);class XfaLayer{static setupStorage(e,t,r,n,i){const s=n.getValue(t,{value:null});switch(r.name){case"textarea":if(null!==s.value&&(e.textContent=s.value),"print"===i)break;e.addEventListener("input",(e=>{n.setValue(t,{value:e.target.value})}));break;case"input":if("radio"===r.attributes.type||"checkbox"===r.attributes.type){if(s.value===r.attributes.xfaOn?e.setAttribute("checked",!0):s.value===r.attributes.xfaOff&&e.removeAttribute("checked"),"print"===i)break;e.addEventListener("change",(e=>{n.setValue(t,{value:e.target.checked?e.target.getAttribute("xfaOn"):e.target.getAttribute("xfaOff")})}))}else{if(null!==s.value&&e.setAttribute("value",s.value),"print"===i)break;e.addEventListener("input",(e=>{n.setValue(t,{value:e.target.value})}))}break;case"select":if(null!==s.value){e.setAttribute("value",s.value);for(const e of r.children)e.attributes.value===s.value?e.attributes.selected=!0:e.attributes.hasOwnProperty("selected")&&delete e.attributes.selected}e.addEventListener("input",(e=>{const r=e.target.options,i=-1===r.selectedIndex?"":r[r.selectedIndex].value;n.setValue(t,{value:i})}))}}static setAttributes({html:e,element:t,storage:r=null,intent:n,linkService:i}){const{attributes:s}=t,o=e instanceof HTMLAnchorElement;"radio"===s.type&&(s.name=`${s.name}-${n}`);for(const[t,r]of Object.entries(s))if(null!=r)switch(t){case"class":r.length&&e.setAttribute(t,r.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",r);break;case"style":Object.assign(e.style,r);break;case"textContent":e.textContent=r;break;default:(!o||"href"!==t&&"newWindow"!==t)&&e.setAttribute(t,r)}o&&i.addLinkAttributes(e,s.href,s.newWindow),r&&s.dataId&&this.setupStorage(e,s.dataId,t,r)}static render(e){const t=e.annotationStorage,r=e.linkService,i=e.xfaHtml,s=e.intent||"display",o=document.createElement(i.name);i.attributes&&this.setAttributes({html:o,element:i,intent:s,linkService:r});const a="richText"!==s,l=e.div;if(l.append(o),e.viewport){const t=`matrix(${e.viewport.transform.join(",")})`;l.style.transform=t}a&&l.setAttribute("class","xfaLayer xfaFont");const c=[];if(0===i.children.length){if(i.value){const e=document.createTextNode(i.value);o.append(e),a&&n.XfaText.shouldBuildText(i.name)&&c.push(e)}return{textDivs:c}}const u=[[i,-1,o]];for(;u.length>0;){const[e,i,o]=u.at(-1);if(i+1===e.children.length){u.pop();continue}const l=e.children[++u.at(-1)[1]];if(null===l)continue;const{name:d}=l;if("#text"===d){const e=document.createTextNode(l.value);c.push(e),o.append(e);continue}const h=l?.attributes?.xmlns?document.createElementNS(l.attributes.xmlns,d):document.createElement(d);if(o.append(h),l.attributes&&this.setAttributes({html:h,element:l,storage:t,intent:s,linkService:r}),l.children?.length>0)u.push([l,-1,h]);else if(l.value){const e=document.createTextNode(l.value);a&&n.XfaText.shouldBuildText(d)&&c.push(e),h.append(e)}}for(const e of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))e.setAttribute("readOnly",!0);return{textDivs:c}}static update(e){const t=`matrix(${e.viewport.transform.join(",")})`;e.div.style.transform=t,e.div.hidden=!1}}},50:(e,t,r)=>{r.d(t,{XfaText:()=>XfaText});class XfaText{static textContent(e){const t=[],r={items:t,styles:Object.create(null)};return function e(r){if(!r)return;let n=null;const i=r.name;if("#text"===i)n=r.value;else{if(!XfaText.shouldBuildText(i))return;r?.attributes?.textContent?n=r.attributes.textContent:r.value&&(n=r.value)}if(null!==n&&t.push({str:n}),r.children)for(const t of r.children)e(t)}(e),r}static shouldBuildText(e){return!("textarea"===e||"input"===e||"option"===e||"select"===e)}}},228:(e,t,r)=>{r.a(e,(async(e,n)=>{try{r.d(t,{AbortException:()=>i.AbortException,AnnotationEditorLayer:()=>l.AnnotationEditorLayer,AnnotationEditorParamsType:()=>i.AnnotationEditorParamsType,AnnotationEditorType:()=>i.AnnotationEditorType,AnnotationEditorUIManager:()=>c.AnnotationEditorUIManager,AnnotationLayer:()=>u.AnnotationLayer,AnnotationMode:()=>i.AnnotationMode,CMapCompressionType:()=>i.CMapCompressionType,ColorPicker:()=>d.ColorPicker,DOMSVGFactory:()=>o.DOMSVGFactory,DrawLayer:()=>h.DrawLayer,FeatureTest:()=>i.FeatureTest,GlobalWorkerOptions:()=>p.GlobalWorkerOptions,ImageKind:()=>i.ImageKind,InvalidPDFException:()=>i.InvalidPDFException,MissingPDFException:()=>i.MissingPDFException,OPS:()=>i.OPS,Outliner:()=>m.Outliner,PDFDataRangeTransport:()=>s.PDFDataRangeTransport,PDFDateString:()=>o.PDFDateString,PDFWorker:()=>s.PDFWorker,PasswordResponses:()=>i.PasswordResponses,PermissionFlag:()=>i.PermissionFlag,PixelsPerInch:()=>o.PixelsPerInch,RenderingCancelledException:()=>o.RenderingCancelledException,UnexpectedResponseException:()=>i.UnexpectedResponseException,Util:()=>i.Util,VerbosityLevel:()=>i.VerbosityLevel,XfaLayer:()=>f.XfaLayer,build:()=>s.build,createValidAbsoluteUrl:()=>i.createValidAbsoluteUrl,fetchData:()=>o.fetchData,getDocument:()=>s.getDocument,getFilenameFromUrl:()=>o.getFilenameFromUrl,getPdfFilenameFromUrl:()=>o.getPdfFilenameFromUrl,getXfaPageViewport:()=>o.getXfaPageViewport,isDataScheme:()=>o.isDataScheme,isPdfFile:()=>o.isPdfFile,noContextMenu:()=>o.noContextMenu,normalizeUnicode:()=>i.normalizeUnicode,renderTextLayer:()=>a.renderTextLayer,setLayerDimensions:()=>o.setLayerDimensions,shadow:()=>i.shadow,updateTextLayer:()=>a.updateTextLayer,version:()=>s.version});var i=r(292),s=r(831),o=r(419),a=r(814),l=r(731),c=r(830),u=r(976),d=r(259),h=r(47),p=r(164),m=r(61),f=r(284),g=e([s]);s=(g.then?(await g)():g)[0];n()}catch(e){n(e)}}))},178:(e,t,r)=>{r.d(t,{MessageHandler:()=>MessageHandler});var n=r(292);const i=1,s=2,o=1,a=2,l=3,c=4,u=5,d=6,h=7,p=8;function m(e){switch(e instanceof Error||"object"==typeof e&&null!==e||(0,n.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),e.name){case"AbortException":return new n.AbortException(e.message);case"MissingPDFException":return new n.MissingPDFException(e.message);case"PasswordException":return new n.PasswordException(e.message,e.code);case"UnexpectedResponseException":return new n.UnexpectedResponseException(e.message,e.status);case"UnknownErrorException":return new n.UnknownErrorException(e.message,e.details);default:return new n.UnknownErrorException(e.message,e.toString())}}class MessageHandler{constructor(e,t,r){this.sourceName=e,this.targetName=t,this.comObj=r,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=e=>{const t=e.data;if(t.targetName!==this.sourceName)return;if(t.stream)return void this.#Lo(t);if(t.callback){const e=t.callbackId,r=this.callbackCapabilities[e];if(!r)throw new Error(`Cannot resolve callback ${e}`);if(delete this.callbackCapabilities[e],t.callback===i)r.resolve(t.data);else{if(t.callback!==s)throw new Error("Unexpected callback case");r.reject(m(t.reason))}return}const n=this.actionHandler[t.action];if(!n)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){const e=this.sourceName,o=t.sourceName;new Promise((function(e){e(n(t.data))})).then((function(n){r.postMessage({sourceName:e,targetName:o,callback:i,callbackId:t.callbackId,data:n})}),(function(n){r.postMessage({sourceName:e,targetName:o,callback:s,callbackId:t.callbackId,reason:m(n)})}))}else t.streamId?this.#ko(t):n(t.data)},r.addEventListener("message",this._onComObjOnMessage)}on(e,t){const r=this.actionHandler;if(r[e])throw new Error(`There is already an actionName called "${e}"`);r[e]=t}send(e,t,r){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},r)}sendWithPromise(e,t,r){const n=this.callbackId++,i=Promise.withResolvers();this.callbackCapabilities[n]=i;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:n,data:t},r)}catch(e){i.reject(e)}return i.promise}sendWithStream(e,t,r,i){const s=this.streamId++,a=this.sourceName,l=this.targetName,c=this.comObj;return new ReadableStream({start:r=>{const n=Promise.withResolvers();return this.streamControllers[s]={controller:r,startCall:n,pullCall:null,cancelCall:null,isClosed:!1},c.postMessage({sourceName:a,targetName:l,action:e,streamId:s,data:t,desiredSize:r.desiredSize},i),n.promise},pull:e=>{const t=Promise.withResolvers();return this.streamControllers[s].pullCall=t,c.postMessage({sourceName:a,targetName:l,stream:d,streamId:s,desiredSize:e.desiredSize}),t.promise},cancel:e=>{(0,n.assert)(e instanceof Error,"cancel must have a valid reason");const t=Promise.withResolvers();return this.streamControllers[s].cancelCall=t,this.streamControllers[s].isClosed=!0,c.postMessage({sourceName:a,targetName:l,stream:o,streamId:s,reason:m(e)}),t.promise}},r)}#ko(e){const t=e.streamId,r=this.sourceName,i=e.sourceName,s=this.comObj,o=this,a=this.actionHandler[e.action],d={enqueue(e,n=1,o){if(this.isCancelled)return;const a=this.desiredSize;this.desiredSize-=n,a>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),s.postMessage({sourceName:r,targetName:i,stream:c,streamId:t,chunk:e},o)},close(){this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:r,targetName:i,stream:l,streamId:t}),delete o.streamSinks[t])},error(e){(0,n.assert)(e instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:r,targetName:i,stream:u,streamId:t,reason:m(e)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};d.sinkCapability.resolve(),d.ready=d.sinkCapability.promise,this.streamSinks[t]=d,new Promise((function(t){t(a(e.data,d))})).then((function(){s.postMessage({sourceName:r,targetName:i,stream:p,streamId:t,success:!0})}),(function(e){s.postMessage({sourceName:r,targetName:i,stream:p,streamId:t,reason:m(e)})}))}#Lo(e){const t=e.streamId,r=this.sourceName,i=e.sourceName,s=this.comObj,f=this.streamControllers[t],g=this.streamSinks[t];switch(e.stream){case p:e.success?f.startCall.resolve():f.startCall.reject(m(e.reason));break;case h:e.success?f.pullCall.resolve():f.pullCall.reject(m(e.reason));break;case d:if(!g){s.postMessage({sourceName:r,targetName:i,stream:h,streamId:t,success:!0});break}g.desiredSize<=0&&e.desiredSize>0&&g.sinkCapability.resolve(),g.desiredSize=e.desiredSize,new Promise((function(e){e(g.onPull?.())})).then((function(){s.postMessage({sourceName:r,targetName:i,stream:h,streamId:t,success:!0})}),(function(e){s.postMessage({sourceName:r,targetName:i,stream:h,streamId:t,reason:m(e)})}));break;case c:if((0,n.assert)(f,"enqueue should have stream controller"),f.isClosed)break;f.controller.enqueue(e.chunk);break;case l:if((0,n.assert)(f,"close should have stream controller"),f.isClosed)break;f.isClosed=!0,f.controller.close(),this.#No(f,t);break;case u:(0,n.assert)(f,"error should have stream controller"),f.controller.error(m(e.reason)),this.#No(f,t);break;case a:e.success?f.cancelCall.resolve():f.cancelCall.reject(m(e.reason)),this.#No(f,t);break;case o:if(!g)break;new Promise((function(t){t(g.onCancel?.(m(e.reason)))})).then((function(){s.postMessage({sourceName:r,targetName:i,stream:a,streamId:t,success:!0})}),(function(e){s.postMessage({sourceName:r,targetName:i,stream:a,streamId:t,reason:m(e)})})),g.sinkCapability.reject(m(e.reason)),g.isCancelled=!0,delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}}async#No(e,t){await Promise.allSettled([e.startCall?.promise,e.pullCall?.promise,e.cancelCall?.promise]),delete this.streamControllers[t]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}},651:(e,t,r)=>{r.d(t,{MurmurHash3_64:()=>MurmurHash3_64});const n=3285377520,i=4294901760,s=65535;class MurmurHash3_64{constructor(e){this.h1=e?4294967295&e:n,this.h2=e?4294967295&e:n}update(e){let t,r;if("string"==typeof e){t=new Uint8Array(2*e.length),r=0;for(let n=0,i=e.length;n<i;n++){const i=e.charCodeAt(n);i<=255?t[r++]=i:(t[r++]=i>>>8,t[r++]=255&i)}}else{if(!ArrayBuffer.isView(e))throw new Error("Invalid data format, must be a string or TypedArray.");t=e.slice(),r=t.byteLength}const n=r>>2,o=r-4*n,a=new Uint32Array(t.buffer,0,n);let l=0,c=0,u=this.h1,d=this.h2;const h=3432918353,p=461845907,m=11601,f=13715;for(let e=0;e<n;e++)1&e?(l=a[e],l=l*h&i|l*m&s,l=l<<15|l>>>17,l=l*p&i|l*f&s,u^=l,u=u<<13|u>>>19,u=5*u+3864292196):(c=a[e],c=c*h&i|c*m&s,c=c<<15|c>>>17,c=c*p&i|c*f&s,d^=c,d=d<<13|d>>>19,d=5*d+3864292196);switch(l=0,o){case 3:l^=t[4*n+2]<<16;case 2:l^=t[4*n+1]<<8;case 1:l^=t[4*n],l=l*h&i|l*m&s,l=l<<15|l>>>17,l=l*p&i|l*f&s,1&n?u^=l:d^=l}this.h1=u,this.h2=d}hexdigest(){let e=this.h1,t=this.h2;return e^=t>>>1,e=3981806797*e&i|36045*e&s,t=4283543511*t&i|(2950163797*(t<<16|e>>>16)&i)>>>16,e^=t>>>1,e=444984403*e&i|60499*e&s,t=3301882366*t&i|(3120437893*(t<<16|e>>>16)&i)>>>16,e^=t>>>1,(e>>>0).toString(16).padStart(8,"0")+(t>>>0).toString(16).padStart(8,"0")}}},292:(e,t,r)=>{r.d(t,{AbortException:()=>AbortException,AnnotationBorderStyleType:()=>y,AnnotationEditorParamsType:()=>h,AnnotationEditorPrefix:()=>u,AnnotationEditorType:()=>d,AnnotationMode:()=>c,AnnotationPrefix:()=>ce,AnnotationType:()=>g,BaseException:()=>Y,CMapCompressionType:()=>v,FONT_IDENTITY_MATRIX:()=>s,FeatureTest:()=>FeatureTest2,FontRenderOps:()=>ue,FormatError:()=>FormatError,IDENTITY_MATRIX:()=>i,ImageKind:()=>f,InvalidPDFException:()=>InvalidPDFException,LINE_FACTOR:()=>a,MAX_IMAGE_SIZE_TO_CACHE:()=>o,MissingPDFException:()=>MissingPDFException,OPS:()=>_,PasswordException:()=>PasswordException,PasswordResponses:()=>x,PermissionFlag:()=>p,RenderingIntentFlag:()=>l,TextRenderingMode:()=>m,UnexpectedResponseException:()=>UnexpectedResponseException,UnknownErrorException:()=>UnknownErrorException,Util:()=>Util,VerbosityLevel:()=>b,assert:()=>$,bytesToString:()=>ee,createValidAbsoluteUrl:()=>Z,getUuid:()=>le,getVerbosityLevel:()=>k,info:()=>j,isNodeJS:()=>n,normalizeUnicode:()=>ae,objectFromMap:()=>ne,setVerbosityLevel:()=>R,shadow:()=>X,string32:()=>re,stringToBytes:()=>te,unreachable:()=>q,warn:()=>z});const n=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type),i=[1,0,0,1,0,0],s=[.001,0,0,.001,0,0],o=1e7,a=1.35,l={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256},c={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},u="pdfjs_internal_editor_",d={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},h={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_DEFAULT_COLOR:32,HIGHLIGHT_THICKNESS:33,HIGHLIGHT_FREE:34,HIGHLIGHT_SHOW_ALL:35},p={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},m={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},f={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},g={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},y={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},b={ERRORS:0,WARNINGS:1,INFOS:5},v={NONE:0,BINARY:1},_={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91},x={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let w=b.WARNINGS;function R(e){Number.isInteger(e)&&(w=e)}function k(){return w}function j(e){w>=b.INFOS&&console.log(`Info: ${e}`)}function z(e){w>=b.WARNINGS&&console.log(`Warning: ${e}`)}function q(e){throw new Error(e)}function $(e,t){e||q(t)}function Z(e,t=null,r=null){if(!e)return null;try{if(r&&"string"==typeof e){if(r.addDefaultProtocol&&e.startsWith("www.")){const t=e.match(/\./g);t?.length>=2&&(e=`http://${e}`)}if(r.tryConvertEncoding)try{e=decodeURIComponent(escape(e))}catch{}}const n=t?new URL(e,t):new URL(e);if(function(e){switch(e?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(n))return n}catch{}return null}function X(e,t,r,n=!1){return Object.defineProperty(e,t,{value:r,enumerable:!n,configurable:!0,writable:!1}),r}const Y=function(){function BaseException2(e,t){this.constructor===BaseException2&&q("Cannot initialize BaseException."),this.message=e,this.name=t}return BaseException2.prototype=new Error,BaseException2.constructor=BaseException2,BaseException2}();class PasswordException extends Y{constructor(e,t){super(e,"PasswordException"),this.code=t}}class UnknownErrorException extends Y{constructor(e,t){super(e,"UnknownErrorException"),this.details=t}}class InvalidPDFException extends Y{constructor(e){super(e,"InvalidPDFException")}}class MissingPDFException extends Y{constructor(e){super(e,"MissingPDFException")}}class UnexpectedResponseException extends Y{constructor(e,t){super(e,"UnexpectedResponseException"),this.status=t}}class FormatError extends Y{constructor(e){super(e,"FormatError")}}class AbortException extends Y{constructor(e){super(e,"AbortException")}}function ee(e){"object"==typeof e&&void 0!==e?.length||q("Invalid argument for bytesToString");const t=e.length,r=8192;if(t<r)return String.fromCharCode.apply(null,e);const n=[];for(let i=0;i<t;i+=r){const s=Math.min(i+r,t),o=e.subarray(i,s);n.push(String.fromCharCode.apply(null,o))}return n.join("")}function te(e){"string"!=typeof e&&q("Invalid argument for stringToBytes");const t=e.length,r=new Uint8Array(t);for(let n=0;n<t;++n)r[n]=255&e.charCodeAt(n);return r}function re(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)}function ne(e){const t=Object.create(null);for(const[r,n]of e)t[r]=n;return t}class FeatureTest2{static get isLittleEndian(){return X(this,"isLittleEndian",function(){const e=new Uint8Array(4);return e[0]=1,1===new Uint32Array(e.buffer,0,1)[0]}())}static get isEvalSupported(){return X(this,"isEvalSupported",function(){try{return new Function(""),!0}catch{return!1}}())}static get isOffscreenCanvasSupported(){return X(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}static get platform(){return"undefined"!=typeof navigator&&"string"==typeof navigator?.platform?X(this,"platform",{isMac:navigator.platform.includes("Mac")}):X(this,"platform",{isMac:!1})}static get isCSSRoundSupported(){return X(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}const ie=Array.from(Array(256).keys(),(e=>e.toString(16).padStart(2,"0")));class Util{static makeHexColor(e,t,r){return`#${ie[e]}${ie[t]}${ie[r]}`}static scaleMinMax(e,t){let r;e[0]?(e[0]<0&&(r=t[0],t[0]=t[2],t[2]=r),t[0]*=e[0],t[2]*=e[0],e[3]<0&&(r=t[1],t[1]=t[3],t[3]=r),t[1]*=e[3],t[3]*=e[3]):(r=t[0],t[0]=t[1],t[1]=r,r=t[2],t[2]=t[3],t[3]=r,e[1]<0&&(r=t[1],t[1]=t[3],t[3]=r),t[1]*=e[1],t[3]*=e[1],e[2]<0&&(r=t[0],t[0]=t[2],t[2]=r),t[0]*=e[2],t[2]*=e[2]),t[0]+=e[4],t[1]+=e[5],t[2]+=e[4],t[3]+=e[5]}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static applyTransform(e,t){return[e[0]*t[0]+e[1]*t[2]+t[4],e[0]*t[1]+e[1]*t[3]+t[5]]}static applyInverseTransform(e,t){const r=t[0]*t[3]-t[1]*t[2];return[(e[0]*t[3]-e[1]*t[2]+t[2]*t[5]-t[4]*t[3])/r,(-e[0]*t[1]+e[1]*t[0]+t[4]*t[1]-t[5]*t[0])/r]}static getAxialAlignedBoundingBox(e,t){const r=this.applyTransform(e,t),n=this.applyTransform(e.slice(2,4),t),i=this.applyTransform([e[0],e[3]],t),s=this.applyTransform([e[2],e[1]],t);return[Math.min(r[0],n[0],i[0],s[0]),Math.min(r[1],n[1],i[1],s[1]),Math.max(r[0],n[0],i[0],s[0]),Math.max(r[1],n[1],i[1],s[1])]}static inverseTransform(e){const t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static singularValueDecompose2dScale(e){const t=[e[0],e[2],e[1],e[3]],r=e[0]*t[0]+e[1]*t[2],n=e[0]*t[1]+e[1]*t[3],i=e[2]*t[0]+e[3]*t[2],s=e[2]*t[1]+e[3]*t[3],o=(r+s)/2,a=Math.sqrt((r+s)**2-4*(r*s-i*n))/2,l=o+a||1,c=o-a||1;return[Math.sqrt(l),Math.sqrt(c)]}static normalizeRect(e){const t=e.slice(0);return e[0]>e[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t}static intersect(e,t){const r=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),n=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(r>n)return null;const i=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),s=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return i>s?null:[r,i,n,s]}static#Fo(e,t,r,n,i,s,o,a,l,c){if(l<=0||l>=1)return;const u=1-l,d=l*l,h=d*l,p=u*(u*(u*e+3*l*t)+3*d*r)+h*n,m=u*(u*(u*i+3*l*s)+3*d*o)+h*a;c[0]=Math.min(c[0],p),c[1]=Math.min(c[1],m),c[2]=Math.max(c[2],p),c[3]=Math.max(c[3],m)}static#Io(e,t,r,n,i,s,o,a,l,c,u,d){if(Math.abs(l)<1e-12)return void(Math.abs(c)>=1e-12&&this.#Fo(e,t,r,n,i,s,o,a,-u/c,d));const h=c**2-4*u*l;if(h<0)return;const p=Math.sqrt(h),m=2*l;this.#Fo(e,t,r,n,i,s,o,a,(-c+p)/m,d),this.#Fo(e,t,r,n,i,s,o,a,(-c-p)/m,d)}static bezierBoundingBox(e,t,r,n,i,s,o,a,l){return l?(l[0]=Math.min(l[0],e,o),l[1]=Math.min(l[1],t,a),l[2]=Math.max(l[2],e,o),l[3]=Math.max(l[3],t,a)):l=[Math.min(e,o),Math.min(t,a),Math.max(e,o),Math.max(t,a)],this.#Io(e,r,i,o,t,n,s,a,3*(3*(r-i)-e+o),6*(e-2*r+i),3*(r-e),l),this.#Io(e,r,i,o,t,n,s,a,3*(3*(n-s)-t+a),6*(t-2*n+s),3*(n-t),l),l}}let se=null,oe=null;function ae(e){return se||(se=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,oe=new Map([["ﬅ","ſt"]])),e.replaceAll(se,((e,t,r)=>t?t.normalize("NFKC"):oe.get(r)))}function le(){if("undefined"!=typeof crypto&&"function"==typeof crypto?.randomUUID)return crypto.randomUUID();const e=new Uint8Array(32);if("undefined"!=typeof crypto&&"function"==typeof crypto?.getRandomValues)crypto.getRandomValues(e);else for(let t=0;t<32;t++)e[t]=Math.floor(255*Math.random());return ee(e)}const ce="pdfjs_internal_id_",ue={BEZIER_CURVE_TO:0,MOVE_TO:1,LINE_TO:2,QUADRATIC_CURVE_TO:3,RESTORE:4,SAVE:5,SCALE:6,TRANSFORM:7,TRANSLATE:8}}},s={};function Pe(e){var t=s[e];if(void 0!==t)return t.exports;var r=s[e]={exports:{}};return i[e](r,r.exports,Pe),r.exports}_e="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",xe="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",we="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",Se=e=>{e&&e.d<1&&(e.d=1,e.forEach((e=>e.r--)),e.forEach((e=>e.r--?e.r++:e())))},Pe.a=(e,t,r)=>{var n;r&&((n=[]).d=-1);var i,s,o,a=new Set,l=e.exports,c=new Promise(((e,t)=>{o=t,s=e}));c[xe]=l,c[_e]=e=>(n&&e(n),a.forEach(e),c.catch((e=>{}))),e.exports=c,t((e=>{var t;i=(e=>e.map((e=>{if(null!==e&&"object"==typeof e){if(e[_e])return e;if(e.then){var t=[];t.d=0,e.then((e=>{r[xe]=e,Se(t)}),(e=>{r[we]=e,Se(t)}));var r={};return r[_e]=e=>e(t),r}}var n={};return n[_e]=e=>{},n[xe]=e,n})))(e);var r=()=>i.map((e=>{if(e[we])throw e[we];return e[xe]})),s=new Promise((e=>{(t=()=>e(r)).r=0;var s=e=>e!==n&&!a.has(e)&&(a.add(e),e&&!e.d&&(t.r++,e.push(t)));i.map((e=>e[_e](s)))}));return t.r?s:r()}),(e=>(e?o(c[we]=e):s(l),Se(n)))),n&&n.d<0&&(n.d=0)},Pe.d=(e,t)=>{for(var r in t)Pe.o(t,r)&&!Pe.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},Pe.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var o=Pe(228),a=(o=globalThis.pdfjsLib=await(globalThis.pdfjsLibPromise=o)).AbortException,l=o.AnnotationEditorLayer,c=o.AnnotationEditorParamsType,u=o.AnnotationEditorType,d=o.AnnotationEditorUIManager,h=o.AnnotationLayer,p=o.AnnotationMode,m=o.CMapCompressionType,f=o.ColorPicker,g=o.DOMSVGFactory,y=o.DrawLayer,b=o.FeatureTest,v=o.GlobalWorkerOptions,_=o.ImageKind,x=o.InvalidPDFException,w=o.MissingPDFException,R=o.OPS,k=o.Outliner,j=o.PDFDataRangeTransport,z=o.PDFDateString,q=o.PDFWorker,$=o.PasswordResponses,Z=o.PermissionFlag,X=o.PixelsPerInch,Y=o.RenderingCancelledException,ee=o.UnexpectedResponseException,te=o.Util,re=o.VerbosityLevel,ne=o.XfaLayer,ie=o.build,se=o.createValidAbsoluteUrl,oe=o.fetchData,ae=o.getDocument,le=o.getFilenameFromUrl,ce=o.getPdfFilenameFromUrl,ue=o.getXfaPageViewport,de=o.isDataScheme,he=o.isPdfFile,pe=o.noContextMenu,me=o.normalizeUnicode,fe=o.renderTextLayer,ge=o.setLayerDimensions,ye=o.shadow,be=o.updateTextLayer,ve=o.version;n()}catch(Te){n(Te)}var _e,xe,we,Se}),1)},28838:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});const n=r.p+"95e7db75d918df7dd80242426c3ebe57.js"},9460:e=>{"use strict";e.exports=JSON.parse('{"en":{"dda_basic":{"page_title":"Dock Designer Basic","feature_flags":{"ruby":{"allows_project_quotes":false},"javascript":{"shows_request_quote_button":false,"allow_adding_additional_line_items":false,"allow_cleats":false,"allow_floating_docks":false,"allow_ladders":false,"allow_gangways":false,"allow_generic_objects":false,"allow_boat_lifts":false,"allow_roofs":false,"allow_pdf_download":false,"allow_triangular_docks":false,"allow_ar":false,"allow_vr":false}}}}}')},39281:e=>{"use strict";e.exports=JSON.parse('{"en":{"dda_pro":{"page_title":"Dock Designer Pro","feature_flags":{"javascript":{"allow_ar":false,"allow_vr":false}}}}}')},77401:e=>{"use strict";e.exports=JSON.parse('{"en":{"dda_standard":{"page_title":"Dock Designer Standard","feature_flags":{"ruby":{"allows_project_quotes":false},"javascript":{"shows_request_quote_button":false,"allow_floating_docks":false,"allow_generic_objects":false,"allow_roofs":false,"allow_triangular_docks":false,"allow_ar":false,"allow_vr":false}}}}}')},20991:e=>{"use strict";e.exports={en:null}},68872:e=>{"use strict";e.exports=JSON.parse('{"en":{"devise":{"confirmations":{"confirmed":"Your email address has been successfully confirmed.","send_instructions":"You will receive an email with instructions for how to confirm your email address in a few minutes.","send_paranoid_instructions":"If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes."},"failure":{"already_authenticated":"You are already signed in.","inactive":"Your account is not activated yet.","invalid":"Login failed, invalid credentials","locked":"Your account is locked.","last_attempt":"You have one more attempt before your account is locked.","not_found_in_database":"Login failed, invalid credentials","timeout":"Your session expired. Please sign in again to continue.","unauthenticated":"You need to sign in or sign up before continuing.","unconfirmed":"You have to confirm your email address before continuing."},"mailer":{"confirmation_instructions":{"subject":"Confirmation instructions"},"reset_password_instructions":{"subject":"Reset password instructions"},"unlock_instructions":{"subject":"Unlock instructions"},"email_changed":{"subject":"Email Changed"},"password_change":{"subject":"Password Changed"}},"omniauth_callbacks":{"failure":"Could not authenticate you from %{kind} because \\"%{reason}\\".","success":"Successfully authenticated from %{kind} account."},"passwords":{"no_token":"You can\'t access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided.","send_instructions":"You will receive an email with instructions on how to reset your password in a few minutes.","send_paranoid_instructions":"If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes.","updated":"Your password has been changed successfully. You are now signed in.","updated_not_active":"Your password has been changed successfully."},"registrations":{"destroyed":"Bye! Your account has been successfully cancelled. We hope to see you again soon.","signed_up":"Welcome! You have signed up successfully.","signed_up_but_inactive":"You have signed up successfully. However, we could not sign you in because your account is not yet activated.","signed_up_but_locked":"You have signed up successfully. However, we could not sign you in because your account is locked.","signed_up_but_unconfirmed":"A message with a confirmation link has been sent to your email address. Please follow the link to activate your account.","update_needs_confirmation":"You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirmation link to confirm your new email address.","updated":"Your account has been updated successfully.","updated_but_not_signed_in":"Your account has been updated successfully, but since your password was changed, you need to sign in again"},"sessions":{"signed_in":"Signed in successfully.","signed_out":"Signed out successfully.","already_signed_out":"Signed out successfully."},"unlocks":{"send_instructions":"You will receive an email with instructions for how to unlock your account in a few minutes.","send_paranoid_instructions":"If your account exists, you will receive an email with instructions for how to unlock it in a few minutes.","unlocked":"Your account has been unlocked successfully. Please sign in to continue."}},"errors":{"messages":{"already_confirmed":"was already confirmed, please try signing in","confirmation_period_expired":"needs to be confirmed within %{period}, please request a new one","expired":"has expired, please request a new one","not_found":"not found","not_locked":"was not locked","not_saved":{"one":"1 error prohibited this %{resource} from being saved:","other":"%{count} errors prohibited this %{resource} from being saved:"}}}}}')},75312:e=>{"use strict";e.exports=JSON.parse('{"en":{"errors":{"messages":{"taken_in_past":"was used previously.","equal_to_current_password":"must be different than the current password.","equal_to_email":"must be different than the email.","password_complexity":{"digit":{"one":"must contain at least one digit","other":"must contain at least %{count} digits"},"lower":{"one":"must contain at least one lower-case letter","other":"must contain at least %{count} lower-case letters"},"symbol":{"one":"must contain at least one punctuation mark or symbol","other":"must contain at least %{count} punctuation marks or symbols"},"upper":{"one":"must contain at least one upper-case letter","other":"must contain at least %{count} upper-case letters"}}}},"devise":{"invalid_captcha":"The captcha input was invalid.","invalid_security_question":"The security question answer was invalid.","paranoid_verify":{"code_required":"Please enter the code our support team provided"},"paranoid_verification_code":{"updated":"Verification code accepted","show":{"submit_verification_code":"Submit verification code","verification_code":"Verification code","submit":"Submit"}},"password_expired":{"updated":"Your new password is saved.","change_required":"Your password is expired. Please renew your password.","show":{"renew_your_password":"Renew your password","current_password":"Current password","new_password":"New password","new_password_confirmation":"Confirm new password","change_my_password":"Change my password"}},"failure":{"session_limited":"Your login credentials were used in another browser. Please sign in again to continue in this browser.","expired":"Your account has expired due to inactivity. Please contact the site administrator."}}}}')},99377:e=>{"use strict";e.exports=JSON.parse('{"en":{"devise":{"failure":{"invited":"You have a pending invitation, accept it to finish creating your account."},"invitations":{"send_instructions":"An invitation email has been sent to %{email}.","failure_notice":"Failed to send invitation to %{email}.","duplicate_user":"A user already exists with email %{email}.","invitation_token_invalid":"The invitation token provided is not valid!","updated":"Your password was set successfully. You are now signed in.","updated_not_active":"Your password was set successfully.","no_invitations_remaining":"No invitations remaining","invitation_removed":"Your invitation was removed.","new":{"header":"Invite New User","submit_button":"Send Invitation"},"edit":{"header":"Set your password","submit_button":"Set my password"}},"mailer":{"invitation_instructions":{"subject":"Invitation instructions","hello":"Hello %{email}","someone_invited_you":"Someone has invited you to create an account on %{url}. You can accept the invitation through the link below.","accept":"Accept invitation","accept_until":"This invitation will be due in %{due_date}.","ignore":"If you don\'t want to accept the invitation, please ignore this email. Your account won\'t be created until you access the link above and set your password."}}},"time":{"formats":{"devise":{"mailer":{"invitation_instructions":{"accept_until_format":"%B %d, %Y %I:%M %p"}}}}}}}')},75274:e=>{"use strict";e.exports=JSON.parse('{"en":{"hello":"Hello world"}}')},41145:e=>{"use strict";e.exports=JSON.parse('{"en":{"simple_form":{"yes":"Yes","no":"No","required":{"text":"required","mark":"*"},"error_notification":{"default_message":"Please review the problems below:"}}}}')},33548:e=>{"use strict";e.exports=JSON.parse('{"en":{"access_platform":{"page_title":"Access Platform Designer","feature_flags":{"identifiers":{"railings":true,"demo":true},"ruby":{"allow_editing_materials":false,"show_staging_banner":false}}}}}')},71635:e=>{"use strict";e.exports=JSON.parse('{"en":{"american_muscle_docks":{"page_title":"American Muscle Docks Designer","parts_breakdown":{"title":"Pricing","disclaimer":"Pricing is an estimate for your illustrated dock design. This pricing represents a fully factory assembled dock built to your chosen specifications but does not yet include shipping, potential necessary adjustments, or special fabrication, that may be needed to complete your dock. This, along with potential shipping constraints may ultimately change how dock sections are built, orientated, floated, etc. to get as close to your illustrated dock design as possible.\\n Any shipping quotes you receive will be valid for (15) days.\\n Shipping does not include the offload of docks.  It is your responsibility to have the necessary equipment and resources necessary to offload, move, and install the dock sections in a timely manner."},"sign_up":{"disclaimer":"Pricing is an estimate for your illustrated dock design. This pricing represents a fully factory assembled dock built to your chosen specifications but does not yet include shipping, potential necessary adjustments, or special fabrication, that may be needed to complete your dock. This, along with potential shipping constraints may ultimately change how dock sections are built, orientated, floated, etc. to get as close to your illustrated dock design as possible.\\n Any shipping quotes you receive will be valid for (15) days.\\n Shipping does not include the offload of docks.  It is your responsibility to have the necessary equipment and resources necessary to offload, move, and install the dock sections in a timely manner."},"feature_flags":{"identifiers":{"docks":true},"ruby":{"allows_custom_pricing":true,"allows_custom_industry_pricing":true,"allow_guest_editor":false},"javascript":{"shows_public_design_your_own_button":false,"shows_public_price":true,"shows_price_breakdown_download_button":true,"allow_adding_additional_line_items":true,"show_public_pricing_disclaimer":true,"shows_public_layer_toggle":false,"allow_pdf_download":true}}}}}')},57092:e=>{"use strict";e.exports=JSON.parse('{"en":{"bear_ridge":{"page_title":"Bear Ridge Railing Designer","parts_breakdown":{"title":"Pricing Breakdown"},"feature_flags":{"identifiers":{"railings":true},"ruby":{"allows_custom_pricing":true,"admin_only_custom_pricing":false,"allow_guest_editor":false},"javascript":{"allow_angle_snap_toggle":true,"shows_public_design_your_own_button":false,"shows_public_price":true,"shows_structures":true,"allow_adding_plan_background":true,"limit_angle_when_not_snapping":true,"shows_price_breakdown_download_button":true,"allow_adding_additional_line_items":true,"cache_project_pricing":true,"allow_pdf_download":true}}}}}')},55234:e=>{"use strict";e.exports=JSON.parse('{"en":{"city_post":{"page_title":"CityPost Designer","external_project":{"submit_button":"FINALIZE MY QUOTE"},"parts_breakdown":{"disclaimer":"Pricing is an estimate for your railing design. It does not include shipping, taxes, or potential necessary adjustments."},"feature_flags":{"identifiers":{"railings":true},"ruby":{"allows_custom_pricing":true,"allow_external_projects_editor":true},"javascript":{"shows_pdf_public_qr":true,"allows_public_downloads":true,"allows_external_editor_downloads":true,"allow_adding_plan_background":true,"shows_structures":true,"allow_angle_snap_toggle":true,"limit_angle_when_not_snapping":true,"allow_pdf_download":true}}}}}')},91596:e=>{"use strict";e.exports=JSON.parse('{"en":{"coastal_pier_and_dock":{"page_title":"Coastal Pier And Dock Designer","feature_flags":{"identifiers":{"docks":true},"ruby":{"allows_custom_pricing":true,"admin_only_custom_pricing":false},"javascript":{"shows_public_design_your_own_button":false,"shows_price_breakdown_download_button":true,"should_render_jump_to_location_controls":true,"allow_adding_additional_line_items":true,"allow_pdf_download":true}}}}}')},5073:e=>{"use strict";e.exports=JSON.parse('{"en":{"demo":{"page_title":"Demo Dock Designer","parts_breakdown":{"disclaimer":"These estimates are provided for demonstration purposes only, and are not accurate for production use at this time."},"feature_flags":{"identifiers":{"docks":true,"demo":true},"ruby":{"allow_editing_materials":false,"show_staging_banner":false},"javascript":{"shows_guest_save_button":false,"shows_request_quote_button":false}}}}}')},6222:e=>{"use strict";e.exports=JSON.parse('{"en":{"diy":{"page_title":"DIY Dock Designer","parts_breakdown":{"disclaimer":"These estimates are provided for demonstration purposes only, and are not accurate for production use at this time."},"feature_flags":{"identifiers":{"docks":true,"demo":true},"ruby":{"allow_editing_materials":false,"allow_open_registration":false,"show_staging_banner":false}}}}}')},24369:e=>{"use strict";e.exports=JSON.parse('{"en":{"dock_designer_app":{"page_title":"Dock Designer","guest_organization":{"term":"Dock Company"},"custom_link_button":{"label":"Sign me up!","link":"https://lightningcad.com/consultation?cta_source=lightningcad-dock-designer-demo"},"feature_flags":{"identifiers":{"docks":true},"ruby":{"allows_custom_pricing":true,"allow_open_registration":false,"allow_guest_organizations":true},"javascript":{"shows_public_design_your_own_button":false,"shows_guest_request_quote_button":false,"shows_pdf_public_qr":true,"allow_adding_additional_line_items":true,"allow_cleats":true,"allow_timber_docks":true,"allow_floating_docks":true,"allow_ladders":true,"allow_gangways":true,"allow_boat_lifts":true,"allow_roofs":true,"allow_generic_objects":true,"allow_pdf_download":true,"allow_triangular_docks":true,"allow_vr":true,"show_guest_custom_link_button":true,"shows_guest_save_button":false}}}}}')},30383:e=>{"use strict";e.exports=JSON.parse('{"en":{"docks_preview":{"page_title":"Designer"}}}')},35978:e=>{"use strict";e.exports=JSON.parse('{"en":{"ezdock":{"page_title":"EZ Dock Designer","guest_organization":{"term":"Distributor"},"feature_flags":{"identifiers":{"docks":true},"ruby":{"allow_guest_organizations":true},"javascript":{"hide_pricing":true,"shows_guest_save_button":false,"shows_guest_layer_toggle":false}}}}}')},99827:e=>{"use strict";e.exports=JSON.parse('{"en":{"falcon_railings":{"plan_background_title":"Floor Plan","page_title":"Falcon Railings Designer","parts_breakdown":{"update_cached_prices_disclaimer":"Warning: updating prices will reset custom unit prices for this project","title":"Pricing Breakdown"},"feature_flags":{"identifiers":{"railings":true},"ruby":{"allows_custom_pricing":true,"admin_only_custom_pricing":false},"javascript":{"allow_angle_snap_toggle":true,"shows_public_design_your_own_button":false,"shows_public_price":true,"shows_structures":true,"allow_adding_plan_background":true,"limit_angle_when_not_snapping":true,"allow_adding_additional_line_items":true,"cache_project_pricing":true,"allow_pdf_download":true}}}}}')},73719:e=>{"use strict";e.exports=JSON.parse('{"en":{"hollaender":{"page_title":"Hollaender Railing Designer","feature_flags":{"identifiers":{"railings":true},"ruby":{"allows_custom_pricing":true},"javascript":{"allow_angle_snap_toggle":true,"allow_setting_pending_run_angle":true,"shows_structures":false,"allow_adding_plan_background":true,"limit_angle_when_not_snapping":true,"allow_pdf_download":true}}}}}')},70570:e=>{"use strict";e.exports=JSON.parse('{"en":{"innovative_aluminum":{"page_title":"Innovative Aluminum Railing Designer","guest_organization":{"term":"Dealer"},"feature_flags":{"identifiers":{"railings":true},"ruby":{"allow_guest_editor":false,"allow_open_registration":false,"allows_project_quotes":false,"allow_guest_organizations":true},"javascript":{"allow_adding_additional_line_items":true,"allow_adding_plan_background":true,"shows_request_quote_button":false,"shows_structures":true,"allow_pdf_download":true,"allow_angle_snap_toggle":true,"allow_setting_pending_run_angle":true,"limit_angle_when_not_snapping":false}}}}}')},39901:e=>{"use strict";e.exports=JSON.parse('{"en":{"k_and_s":{"page_title":"K&S Railing Designer","feature_flags":{"identifiers":{"railings":true},"ruby":{"allows_custom_pricing":true,"allows_custom_industry_pricing":true,"allow_editing_materials":false,"allow_guest_editor":false,"allow_open_registration":false},"javascript":{"shows_public_design_your_own_button":false,"shows_public_price":true,"shows_price_breakdown_download_button":true,"allow_adding_additional_line_items":true,"allow_adding_plan_background":true,"shows_request_quote_button":true,"allow_angle_snap_toggle":true,"allow_setting_pending_run_angle":true,"shows_structures":true,"limit_angle_when_not_snapping":false,"allow_pdf_download":true}}}}}')},40817:e=>{"use strict";e.exports=JSON.parse('{"en":{"kona":{"estimated_price":"Estimated Investment","page_title":"DockLife Designer","parts_breakdown":{"title":"Estimated Investment Breakdown","total_price":"Total Investment"},"feature_flags":{"identifiers":{"docks":true},"ruby":{"allow_editing_materials":false}}}}}')},89837:e=>{"use strict";e.exports=JSON.parse('{"en":{"kwikclamp":{"page_title":"Kwikclamp Designer","feature_flags":{"identifiers":{"railings":true},"ruby":{"allows_custom_pricing":true,"allow_editing_materials":true,"allow_guest_editor":false,"allow_open_registration":false},"javascript":{"shows_public_design_your_own_button":false,"shows_public_price":true,"shows_price_breakdown_download_button":true,"allow_adding_additional_line_items":true,"allow_adding_plan_background":true,"allow_angle_snap_toggle":true,"allow_setting_pending_run_angle":true,"shows_structures":true,"shows_3d_shadows":false,"limit_angle_when_not_snapping":false,"allow_pdf_download":true}}}}}')},57765:e=>{"use strict";e.exports=JSON.parse('{"en":{"oasis_boat_docks":{"page_title":"Oasis Boat Docks","feature_flags":{"ruby":{"allows_custom_pricing":true},"javascript":{"shows_public_design_your_own_button":false}}}}}')},3135:e=>{"use strict";e.exports=JSON.parse('{"en":{"omega":{"plan_background_title":"Floor Plan","page_title":"Omega Industrial Safety Products | Railing Designer","guest_organization":{"term":"Business Unit"},"feature_flags":{"identifiers":{"railings":true},"ruby":{"allows_custom_pricing":true,"admin_only_custom_pricing":false,"allows_project_quotes":false,"allow_guest_editor":false,"allow_open_registration":false,"allow_guest_organizations":true},"javascript":{"shows_public_design_your_own_button":false,"shows_price_breakdown_download_button":true,"shows_request_quote_button":false,"shows_structures":false,"allow_adding_plan_background":true,"limit_angle_when_not_snapping":true,"allow_unconnected_angle_snap_toggle":true,"allows_public_downloads":true,"allow_pdf_download":true}}}}}')},99965:e=>{"use strict";e.exports=JSON.parse('{"en":{"railing_depot":{"page_title":"Railing Depot","parts_breakdown":{"disclaimer":"These estimates are provided for demonstration purposes only"},"custom_link_button":{"label":"Sign me up!","link":"https://lightningcad.com/consultation?cta_source=lightningcad-railing-designer-demo"},"feature_flags":{"identifiers":{"railings":true,"demo":true},"ruby":{"allows_custom_pricing":true,"show_staging_banner":false,"allow_open_registration":false},"javascript":{"shows_structures":true,"allow_adding_additional_line_items":true,"allow_angle_snap_toggle":true,"shows_guest_save_button":false,"shows_request_quote_button":false,"shows_guest_request_quote_button":false,"show_guest_custom_link_button":true,"allow_adding_plan_background":true,"shows_price_breakdown_download_button":true,"shows_pdf_public_qr":true,"allow_pdf_download":true,"allow_ar":true}}}}}')},22208:e=>{"use strict";e.exports=JSON.parse('{"en":{"railings_preview":{"page_title":"Designer"}}}')},971:e=>{"use strict";e.exports=JSON.parse('{"en":{"rogue_fabricators":{"page_title":"Rogue Fabricators Railing Designer","external_project":{"submit_button":"Save to RogueOS"},"feature_flags":{"identifiers":{"railings":true},"ruby":{"allows_custom_pricing":true,"allow_editing_materials":true,"allow_guest_editor":false,"allow_open_registration":false,"allow_external_projects_editor":true},"javascript":{"shows_public_design_your_own_button":false,"shows_public_price":false,"shows_price_breakdown_download_button":true,"allow_adding_additional_line_items":true,"allow_adding_plan_background":true,"shows_request_quote_button":true,"allow_angle_snap_toggle":true,"allow_setting_pending_run_angle":true,"shows_structures":true,"limit_angle_when_not_snapping":false,"allow_pdf_download":true}}}}}')},26299:e=>{"use strict";e.exports=JSON.parse('{"en":{"safesmart_access":{"page_title":"SafeSmart Access Railing Designer","feature_flags":{"identifiers":{"railings":true,"demo":true},"ruby":{"allow_editing_materials":false,"show_staging_banner":false}}}}}')},44035:e=>{"use strict";e.exports=JSON.parse('{"en":{"ultralox":{"page_title":"Ultralox Railing Designer","feature_flags":{"identifiers":{"railings":true,"demo":true},"ruby":{"allow_editing_materials":false}}}}}')},54271:e=>{"use strict";e.exports=JSON.parse('{"en":{"waterside_docks":{"page_title":"Waterside Docks & Piers Designer","feature_flags":{"identifiers":{"docks":true},"ruby":{"allows_custom_pricing":true,"allow_guest_editor":false,"allow_open_registration":false},"javascript":{"shows_public_design_your_own_button":false,"shows_price_breakdown_download_button":true,"allow_adding_additional_line_items":true,"shows_public_layer_toggle":false,"allow_pdf_download":true}}}}}')},39200:e=>{"use strict";e.exports=JSON.parse('{"en":{"strategy":{"plan_background_title":"Background","estimated_price":"Estimated Price","external_project":{"submit_button":"Submit for Review"},"parts_breakdown":{"disclaimer":"","update_cached_prices_disclaimer":"","title":"Parts Breakdown","total_price":"Total Price"},"guest_sign_up":{"note":""},"pdf":{"qr_title":"View Design:","qr_description":"View the interactive design"},"sign_up":{"disclaimer":""},"quote":{"disclaimer":"","success":"Your quote was successfully submitted. It is currently waiting for a representative to review it."},"custom_link_button":{"label":"Custom","link":"https://lightningcad.com"},"guest_organization":{"term":"Guest Organization"},"feature_flags":{"identifiers":{"railings":false,"docks":false,"system_wide":true,"demo":false},"ruby":{"allows_custom_pricing":false,"allows_custom_industry_pricing":false,"admin_only_custom_pricing":true,"allows_project_quotes":true,"allow_guest_editor":true,"allow_editing_materials":true,"show_staging_banner":true,"allow_external_projects_editor":false,"allow_open_registration":true,"allow_guest_organizations":false},"javascript":{"shows_pdf_public_qr":false,"shows_public_design_your_own_button":true,"hide_pricing":false,"shows_public_price":false,"shows_price_breakdown_download_button":false,"only_show_price_disclaimer":false,"allow_adding_additional_line_items":false,"show_public_pricing_disclaimer":false,"shows_action_bar_icon_labels":true,"allow_adding_plan_background":false,"shows_guest_save_button":true,"start_over_button_text":"Start Over","shows_request_quote_button":true,"shows_guest_request_quote_button":true,"allow_setting_pending_run_angle":false,"shows_guest_layer_toggle":true,"shows_public_layer_toggle":true,"should_render_jump_to_location_controls":false,"allow_angle_snap_toggle":false,"allow_unconnected_angle_snap_toggle":false,"shows_structures":false,"shows_3d_shadows":true,"limit_angle_when_not_snapping":true,"allows_public_downloads":false,"allows_external_editor_downloads":false,"shows_external_editor_price":true,"cache_project_pricing":false,"allow_pdf_download":false,"allow_ar":false,"allow_vr":false,"show_guest_custom_link_button":false}}}}}')}},__webpack_module_cache__={},webpackQueues,webpackExports,webpackError,resolveQueue,leafPrototypes,getProto;function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.loaded=!0,r.exports}__webpack_require__.amdD=function(){throw new Error("define cannot be used indirect")},__webpack_require__.amdO={},webpackQueues="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",webpackExports="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",webpackError="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",resolveQueue=e=>{e&&e.d<1&&(e.d=1,e.forEach((e=>e.r--)),e.forEach((e=>e.r--?e.r++:e())))},__webpack_require__.a=(e,t,r)=>{var n;r&&((n=[]).d=-1);var i,s,o,a=new Set,l=e.exports,c=new Promise(((e,t)=>{o=t,s=e}));c[webpackExports]=l,c[webpackQueues]=e=>(n&&e(n),a.forEach(e),c.catch((e=>{}))),e.exports=c,t((e=>{var t;i=(e=>e.map((e=>{if(null!==e&&"object"==typeof e){if(e[webpackQueues])return e;if(e.then){var t=[];t.d=0,e.then((e=>{r[webpackExports]=e,resolveQueue(t)}),(e=>{r[webpackError]=e,resolveQueue(t)}));var r={};return r[webpackQueues]=e=>e(t),r}}var n={};return n[webpackQueues]=e=>{},n[webpackExports]=e,n})))(e);var r=()=>i.map((e=>{if(e[webpackError])throw e[webpackError];return e[webpackExports]})),s=new Promise((e=>{(t=()=>e(r)).r=0;var s=e=>e!==n&&!a.has(e)&&(a.add(e),e&&!e.d&&(t.r++,e.push(t)));i.map((e=>e[webpackQueues](s)))}));return t.r?s:r()}),(e=>(e?o(c[webpackError]=e):s(l),resolveQueue(n)))),n&&n.d<0&&(n.d=0)},__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},getProto=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,__webpack_require__.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var r=Object.create(null);__webpack_require__.r(r);var n={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var i=2&t&&e;"object"==typeof i&&!~leafPrototypes.indexOf(i);i=getProto(i))Object.getOwnPropertyNames(i).forEach((t=>n[t]=()=>e[t]));return n.default=()=>e,__webpack_require__.d(r,n),r},__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;__webpack_require__.g.importScripts&&(e=__webpack_require__.g.location+"");var t=__webpack_require__.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),__webpack_require__.p=e})();var __webpack_exports__=__webpack_require__(35684)})();
//# sourceMappingURL=file:///tmp/application-d5ae6c20bbc5014f8e25.digested.js.map